elk-3.99.8/0000755000175000017500000000000011577110017007400 500000000000000elk-3.99.8/README0000644000175000017500000002766311577076306010232 00000000000000$Id$ This is Elk 3.99, a pre-release of Elk 4.0, the Extension Language Kit. What is Elk? ------------ Elk is an implementation of the Scheme programming language. In contrast to existing, stand-alone Scheme systems Elk has been designed specifically as an embeddable, reusable extension language subsystem for applications written in C or C++. Developers using Elk can deliver applications with different components written in different languages, such as an efficient core written in C or C++ and an extensible user interface layer implemented in Scheme. To help building hybrid application architectures, Elk supports a tightly-knit interworking of the C/C++ parts of applications with Scheme code. Elk is also useful as a stand-alone Scheme implementation, in particular as a platform for rapid prototyping of X11-based Scheme programs. The Elk project was started in 1987 to support ISOTEXT, a multimedia document editor that has been developed at the Technical University of Berlin. The first freely available version, Elk 1.0, was published in USENET in September 1989. Since then, Elk has been successfully used as the extension language framework for numerous applications (commercial products as well as free software projects). Getting Elk ----------- You can obtain the Elk 3.99 distribution as well as additional information about Elk in the World Wide Web at http://sam.zoy.org/elk/ The distribution is also available for anonymous FTP from a number of servers including these: ftp://ftp.x.org/contrib/devel_tools/elk-3.0.tar.gz ftp://ftp.uni-bremen.de/pub/programming/languages/scheme/elk/elk-3.0.tar.gz A non-trivial example application using Elk as its extension language is available as source and pre-compiled binaries (`unroff' is a troff translator with back-ends for HTML and the -ms and -man macros): http://www.informatik.uni-bremen.de/~net/unroff Elk features ------------ o Full incremental, dynamic loading This facility enables Scheme code to load compiled Scheme extensions into the running interpreter (or into the application) on demand. Complex Elk-based applications can be decomposed into dynamically loadable components to avoid large, monolithic executables. Furthermore, user-supplied extension need not be written entirely in Scheme; they may include an efficient, low-level layer written in C or C++. Dynamic loading in Elk is supported on many platforms and is not restricted to a dlopen() interface. Elk provides automatic initialization of dynamically loaded extensions and takes care of C++ static constructors/destructors embedded in object files. o Freezing of fully customized applications into executable files Elk provides a new Scheme primitive `dump' which freezes the dynamic runtime image of the Scheme interpreter into an executable file (including an enclosing application if present). This facility resembles unexec() in Emacs, but the new executable resumes execution by returning from the call to `dump' by which that executable was created (not unlike fork() in UNIX). Dynamic loading and `dump' increase the usability of Elk as the backbone of complex applications. o Powerful C/C++ interface for language interoperability Elk provides for a tight integration of the C/C++ core of applications (or extensions) with the extension language. Applications can define their own Scheme primitives (three calling disciplines are supported), define application-specific first-class Scheme types with customized print and read functions, convert objects between Scheme types and C/C++ types in various ways, implement weak data structures, raise Scheme errors, define Scheme variables and symbols, evaluate S-expressions encoded as C strings, and utilize the garbage collector. o Full Scheme bindings for X11 and Motif Several dynamically loadable extensions provide full Scheme access to the X11/OpenWindows Xlib, to the application programmer interface of the Xt intrinsics, and to the Athena and OSF/Motif widget sets. Using these extensions, the graphical user-interfaces of Elk-based applications can be built entirely in the extension language. o UNIX interface Elk provides Scheme access to most UNIX system calls and common C library functions. The UNIX extension supports a wide range of different UNIX platforms without restricting its functionality to the lowest common denominator or to the POSIX 1003.1 functions. o Stop-and-copy and generational, incremental garbage collection Elk employs two garbage collection strategies selectable at compile time: a traditional stop-and-copy garbage collector and a generational garbage collector which is more efficient and thus reduces the time the application is disrupted by a garbage collection. On platforms with advanced memory management, `incremental' mode can be enabled for the generational garbage collector to further reduce wait times. o Non-standard Scheme features In addition to the standard Scheme core, Elk supports first-class environments, error handling, provide/require and autoloading, fluid bindings and dynamic-wind, simple `eval-twice'-style macros, property lists, string ports and bidirectional ports, shell-style `tilde expansion' in filenames, an interactive top-level written in Scheme, a Scheme debugger and a pretty printer, arbitrary length bitstrings, and Scheme records. o Comprehensive documentation The distribution includes 230+ pages of fully indexed documentation. All manuals exist as troff input files which can be translated to HTML (with `unroff') for online browsing in addition to producing typeset- quality printed versions. o Distributed in legally unencumbered form The copyright/license agreement permits free redistribution and use of Elk in commercial products. Why is Elk using Scheme? ------------------------ As extensions can get as large and complex as freestanding programs, extension language programmers (usually the users of the application) deserve the same language features that other programmers are accustomed to. By using a general-purpose programming language rather than a specialized scripting language, non-trivial extensions can benefit from the structuring functionality inherent in real programming languages (such as Lisp). Members of the Lisp language family are particularly suitable as an extension language: Lisp has a simple syntax but powerful semantics, it allows for small implementations, and its interactive nature supports rapid prototyping and encourages users to explore and test solutions to problems in an incremental way. Consequently, Lisp has become increasingly popular for this purpose, to the point where the abundance of different dialects has grown into a problem. Of the standardized dialects of Lisp, only Scheme is suitably modest, yet sufficiently general, to serve as a reusable extension language for a wide range of applications. Scheme is orthogonal and well-defined, and it is small enough to not dominate the application it serves and to be fully understood with acceptable effort. The Elk distribution -------------------- Here is a brief roadmap for the subdirectories and files included in the distribution. elk-3.0 --+-- README Explains the purpose and release status of Elk | +-- CHANGES Lists the changes between this and earlier releases | of Elk | +-- MIGRATE Explains how C/C++ code (applications or extensions) | written for older versions of Elk may have to be | modified to make it work with this version | +-- INSTALL Instructions for configuring, compiling, and | installing Elk; a brief description of the files that | get installed in the process; and a description of | the structure of the Makefiles and the purpose of | Makefile.local and `build' in each source directory | +-- MACHINES Additional, platform-specific advice for installing | and using Elk, such as compiler bugs, unsupported | features, problems with older OS versions and other | pitfalls | +-- BUGS Information about known problems with this release | +-- TODO Ideas, improvements and projects for future releases | +-- COPYING The copyright status of the distribution | +-- AUTHORS A list of people who have contributed significantly | to Elk; acknowledgments and credits | +-- include/ The include files to be #included by applications | that use Elk as their extension language, and by | extensions to Elk. Including scheme.h from this | directory causes all the other .h files to be | included in the right order. The include files may | or may not use ANSI/ISO-C prototypes, depending on | the config file you have chosen. | +-- src/ The C source files of the Scheme interpreter | +-- scm/ Scheme files that are loaded during runtime. These | are copied to a destination directory specified in | config/site when Elk is installed. | +-- lib --, This directory tree holds the C source for various | | Elk extensions that can be loaded into the Scheme | | interpreter or linked with an application | | | +-- xlib/ The C source files of the X11 Xlib extension | | | +-- xt/ The C source files of the Xt (X11 Toolkit | | Intrinsics) extension | | | +-- xaw/ The Scheme interfaces to the X11 Athena widgets. | | There is one .d file for each widget class. | | Each of these is compiled into a C source file | | when running `make' and then compiled into a | | dynamically loadable object. | | | +-- xm/ The .d files for the Motif widgets | | | +-- unix/ The C source files of the UNIX extension | | | `-- misc/ The C source files of the record extension, the | bitstring extension, the regular expression | extension, and various other dynamically | loadable Elk extensions | +-- doc/ The directory tree holding the documentation for | Elk as troff input files and pre-generated | PostScript files. See doc/README for a roadmap | of the `doc' tree. | | +-- examples --, A collection of demonstration programs for Elk | | and the various extensions (mostly in Scheme) | | | +-- scheme Basic Scheme demos (collected from USENET | | and other sources) | | | +-- xlib Programs demonstrating the Xlib, Athena, | +-- xaw and Motif extensions | +-- xm | | | +-- unix Example programs for the UNIX extension | | | +-- regexp A demonstration of the regexp extension | | | `-- c++ A few simple C++ programs demonstrating | use of Elk with C++ applications (see | README in this directory) | `-- util/ Various utilities, some of which may aid in preparing a config file for an as yet unsupported platform. elk-3.99.8/.auto/0000755000175000017500000000000011577110017010426 500000000000000elk-3.99.8/.auto/missing0000755000175000017500000002623311577103433011757 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2009-04-28.21; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, # 2008, 2009 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and \`g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # normalize program name to check for. program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). This is about non-GNU programs, so use $1 not # $program. case $1 in lex*|yacc*) # Not GNU programs, they don't have --version. ;; tar*) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $program in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te*) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison*|yacc*) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex*|flex*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit $? fi ;; makeinfo*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; tar*) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case $firstarg in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case $firstarg in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: elk-3.99.8/.auto/config.sub0000755000175000017500000010460611577103433012344 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011 Free Software Foundation, Inc. timestamp='2011-03-23' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted GNU ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 \ | ns16k | ns32k \ | open8 \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | picochip) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile-* | tilegx-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze) basic_machine=microblaze-xilinx ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; # This must be matched before tile*. tilegx*) basic_machine=tilegx-unknown os=-linux-gnu ;; tile*) basic_machine=tile-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: elk-3.99.8/.auto/config.guess0000755000175000017500000012673011577103433012703 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011 Free Software Foundation, Inc. timestamp='2011-05-11' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner. Please send patches (context # diff format) to and include a ChangeLog # entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-gnueabi else echo ${UNAME_MACHINE}-unknown-linux-gnueabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-tilera-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in i386) eval $set_cc_for_build if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then UNAME_PROCESSOR="x86_64" fi fi ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: elk-3.99.8/.auto/compile0000755000175000017500000000727111577103433011737 00000000000000#! /bin/sh # Wrapper for compilers which do not understand `-c -o'. scriptversion=2009-10-06.20; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009 Free Software # Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand `-c -o'. Remove `-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file `INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; esac ofile= cfile= eat= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as `compile cc -o foo foo.c'. # So we strip `-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no `-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # `.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use `[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: elk-3.99.8/.auto/install-sh0000755000175000017500000003253711577103433012370 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2009-04-28.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then trap '(exit $?); exit' 1 2 13 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names starting with `-'. case $src in -*) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # Protect names starting with `-'. case $dst in -*) dst=./$dst;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; -*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: elk-3.99.8/.auto/depcomp0000755000175000017500000004426711577103434011745 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2009-04-28.21; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free # Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u="sed s,\\\\\\\\,/,g" depmode=msvisualcpp fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add `dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: elk-3.99.8/.auto/ltmain.sh0000755000175000017500000105051111577103430012175 00000000000000 # libtool (GNU libtool) 2.4 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007, 2008, 2009, 2010 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --no-quiet, --no-silent # print informational messages (default) # --tag=TAG use configuration variables from tag TAG # -v, --verbose print more informational messages than default # --no-verbose don't print the extra informational messages # --version print version information # -h, --help, --help-all print short, long, or detailed help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. When passed as first option, # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.4 Debian-2.4-2 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . # GNU libtool home page: . # General help using GNU software: . PROGRAM=libtool PACKAGE=libtool VERSION="2.4 Debian-2.4-2" TIMESTAMP="" package_revision=1.3293 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # NLS nuisances: We save the old values to restore during execute mode. lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL $lt_unset CDPATH # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${EGREP="/bin/grep -E"} : ${FGREP="/bin/grep -F"} : ${GREP="/bin/grep"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SED="/bin/sed"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_dirname may be replaced by extended shell implementation # func_basename file func_basename () { func_basename_result=`$ECHO "${1}" | $SED "$basename"` } # func_basename may be replaced by extended shell implementation # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` } # func_dirname_and_basename may be replaced by extended shell implementation # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname may be replaced by extended shell implementation # These SED scripts presuppose an absolute path with a trailing slash. pathcar='s,^/\([^/]*\).*$,\1,' pathcdr='s,^/[^/]*,,' removedotparts=':dotsl s@/\./@/@g t dotsl s,/\.$,/,' collapseslashes='s@/\{1,\}@/@g' finalslash='s,/*$,/,' # func_normal_abspath PATH # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. # value returned in "$func_normal_abspath_result" func_normal_abspath () { # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` while :; do # Processed it all yet? if test "$func_normal_abspath_tpath" = / ; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result" ; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_relative_path SRCDIR DSTDIR # generates a relative path from SRCDIR to DSTDIR, with a trailing # slash if non-empty, suitable for immediately appending a filename # without needing to append a separator. # value returned in "$func_relative_path_result" func_relative_path () { func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=${func_dirname_result} if test "x$func_relative_path_tlibdir" = x ; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test "x$func_stripname_result" != x ; then func_relative_path_result=${func_relative_path_result}/${func_stripname_result} fi # Normalisation. If bindir is libdir, return empty string, # else relative path ending with a slash; either way, target # file name can be directly appended. if test ! -z "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result/" func_relative_path_result=$func_stripname_result fi } # The name of this program: func_dirname_and_basename "$progpath" progname=$func_basename_result # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=: for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' # Sed substitution that converts a w32 file name or path # which contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "$my_tmpdir" } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_tr_sh # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_version # Echo version message to standard output and exit. func_version () { $opt_debug $SED -n '/(C)/!b go :more /\./!{ N s/\n# / / b more } :go /^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $opt_debug $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" echo $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help [NOEXIT] # Echo long help message to standard output and exit, # unless 'noexit' is passed as argument. func_help () { $opt_debug $SED -n '/^# Usage:/,/# Report bugs to/ { :print s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ p d } /^# .* home page:/b print /^# General help using/b print ' < "$progpath" ret=$? if test -z "$1"; then exit $ret fi } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $opt_debug func_error "missing argument for $1." exit_cmd=exit } # func_split_short_opt shortopt # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. func_split_short_opt () { my_sed_short_opt='1s/^\(..\).*$/\1/;q' my_sed_short_rest='1s/^..\(.*\)$/\1/;q' func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` } # func_split_short_opt may be replaced by extended shell implementation # func_split_long_opt longopt # Set func_split_long_opt_name and func_split_long_opt_arg shell # variables after splitting LONGOPT at the `=' sign. func_split_long_opt () { my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^--[^=]*=//' func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` } # func_split_long_opt may be replaced by extended shell implementation exit_cmd=: magic="%%%MAGIC variable%%%" magic_exe="%%%MAGIC EXE variable%%%" # Global variables. nonopt= preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "${1}=\$${1}\${2}" } # func_append may be replaced by extended shell implementation # func_append_quoted var value # Quote VALUE and append to the end of shell variable VAR, separated # by a space. func_append_quoted () { func_quote_for_eval "${2}" eval "${1}=\$${1}\\ \$func_quote_for_eval_result" } # func_append_quoted may be replaced by extended shell implementation # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "${@}"` } # func_arith may be replaced by extended shell implementation # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` } # func_len may be replaced by extended shell implementation # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_lo2o may be replaced by extended shell implementation # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` } # func_xform may be replaced by extended shell implementation # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_error ${1+"$@"} func_error "See the $PACKAGE documentation for more information." func_fatal_error "Fatal configuration error." } # func_config # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # Display the features supported by this script. func_features () { echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag tagname # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname="$1" re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf="/$re_begincf/,/$re_endcf/p" # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Option defaults: opt_debug=: opt_dry_run=false opt_config=false opt_preserve_dup_deps=false opt_features=false opt_finish=false opt_help=false opt_help_all=false opt_silent=: opt_verbose=: opt_silent=false opt_verbose=false # Parse options once, thoroughly. This comes as soon as possible in the # script to make things like `--version' happen as quickly as we can. { # this just eases exit handling while test $# -gt 0; do opt="$1" shift case $opt in --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" $opt_debug ;; --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) opt_config=: func_config ;; --dlopen|-dlopen) optarg="$1" opt_dlopen="${opt_dlopen+$opt_dlopen }$optarg" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) opt_features=: func_features ;; --finish) opt_finish=: set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help_all=: opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_mode="$optarg" case $optarg in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_silent=false func_append preserve_args " $opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $opt" ;; --silent|--quiet) opt_silent=: func_append preserve_args " $opt" opt_verbose=false ;; --verbose|-v) opt_verbose=: func_append preserve_args " $opt" opt_silent=false ;; --tag) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_tag="$optarg" func_append preserve_args " $opt $optarg" func_enable_tag "$optarg" shift ;; -\?|-h) func_usage ;; --help) func_help ;; --version) func_version ;; # Separate optargs to long options: --*=*) func_split_long_opt "$opt" set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-n*|-v*) func_split_short_opt "$opt" set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done # Validate options: # save first non-option argument if test "$#" -gt 0; then nonopt="$opt" shift fi # preserve --debug test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test "$opt_mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$opt_mode' for more information." } # Bail if the options were screwed $exit_cmd $EXIT_FAILURE } ## ----------- ## ## Main. ## ## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case "$lt_sysroot:$1" in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result="=$func_stripname_result" ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$lt_sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $opt_debug # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result="" if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result" ; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $opt_debug if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $opt_debug # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $opt_debug if test -z "$2" && test -n "$1" ; then func_error "Could not determine host file name corresponding to" func_error " \`$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result="$1" fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $opt_debug if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " \`$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result="$3" fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $opt_debug case $4 in $1 ) func_to_host_path_result="$3$func_to_host_path_result" ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via `$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $opt_debug $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $opt_debug case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result="$1" } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result="$func_convert_core_msys_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via `$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $opt_debug if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd="func_convert_path_${func_stripname_result}" fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $opt_debug func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result="$1" } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_msys_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_mode_compile arg... func_mode_compile () { $opt_debug # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify \`-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with \`-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj="$func_basename_result" } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from \`$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac echo $ECHO "Try \`$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test "$opt_help" = :; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | sed -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | sed '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "\`$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument \`$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and \`=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test "x$prev" = x-m && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename="" if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname" ; then func_basename "$dlprefile_dlname" dlprefile_dlbasename="$func_basename_result" else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename" ; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $opt_debug sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $opt_debug match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive which possess that section. Heuristic: eliminate # all those which have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $opt_debug if func_cygming_gnu_implib_p "$1" ; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1" ; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result="" fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" if test "$lock_old_archive_extraction" = yes; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test "$lock_old_archive_extraction" = yes; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ which is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options which match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include /* declarations of non-ANSI functions */ #if defined(__MINGW32__) # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined(__CYGWIN__) # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined (other platforms) ... */ #endif /* portability defines, excluding path handling macros */ #if defined(_MSC_VER) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC # ifndef _INTPTR_T_DEFINED # define _INTPTR_T_DEFINED # define intptr_t int # endif #elif defined(__MINGW32__) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined(__CYGWIN__) # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined (other platforms) ... */ #endif #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #if defined(LT_DEBUGWRAPPER) static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -e 's/\([\\"]\)/\\\1/g' \ -e 's/^/ fputs ("/' -e 's/$/\\n", f);/' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $opt_debug case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir="$arg" prev= continue ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-flto*|-fwhopr*|-fuse-linker-plugin) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps ; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." else echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test "$prefer_static_libs" = yes || test "$prefer_static_libs,$installed" = "built,no"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib="$l" done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$lt_sysroot$libdir" absdir="$lt_sysroot$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi case "$host" in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then echo if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system can not link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi func_append newlib_search_path " $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path="$deplib" ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|qnx|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; *) func_fatal_configuration "$modename: unknown library version type \`$version_type'" ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. func_append verstring ":${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$opt_mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_apped perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" if test -n "$hardcode_libdir_flag_spec_ld"; then eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" else eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd1 in $cmds; do IFS="$save_ifs" # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test "$try_normal_branch" = yes \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=${output_objdir}/${output_la}.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " ${wl}-bind_at_load" func_append finalize_command " ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=no ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test "x$bindir" != x ; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) func_append RM " $arg"; rmforce=yes ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then odir="$objdir" else odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" test "$opt_mode" = uninstall && odir="$dir" # Remember odir for removal later, being careful to avoid duplicates if test "$opt_mode" = clean; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case "$opt_mode" in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 elk-3.99.8/ChangeLog0000644000175000017500000035466111577076306011125 00000000000000------------------------------------------------------------------------ r267 | sam | 2006-06-14 17:06:05 +0200 (Wed, 14 Jun 2006) | 2 lines Changed paths: M /trunk/configure.ac M /trunk/doc/bitstring/Makefile.am M /trunk/doc/cprog/Makefile.am M /trunk/doc/kernel/Makefile.am M /trunk/doc/man/Makefile.am M /trunk/doc/oops/Makefile.am M /trunk/doc/record/Makefile.am M /trunk/doc/regexp/Makefile.am M /trunk/doc/unix/Makefile.am M /trunk/doc/usenix/Makefile.am M /trunk/doc/xlib/Makefile.am M /trunk/doc/xt/Makefile.am * Fixed build with recent autotools. ------------------------------------------------------------------------ r266 | sam | 2006-06-14 16:48:50 +0200 (Wed, 14 Jun 2006) | 3 lines Changed paths: M /trunk M /trunk/NEWS M /trunk/configure.ac * Updated NEWS for 0.99.7. * Prepared 0.99.7 release. ------------------------------------------------------------------------ r265 | sam | 2006-06-14 16:47:30 +0200 (Wed, 14 Jun 2006) | 2 lines Changed paths: M /trunk/examples/tests/Makefile.am A /trunk/examples/tests/gc-stress.scm * Added a garbage collector stress test. ------------------------------------------------------------------------ r264 | sam | 2006-06-14 16:11:36 +0200 (Wed, 14 Jun 2006) | 2 lines Changed paths: M /trunk/src/libelk.c * Added volatile keyword to prevent gcc from optimising away. ------------------------------------------------------------------------ r263 | sam | 2006-06-14 14:33:15 +0200 (Wed, 14 Jun 2006) | 2 lines Changed paths: M /trunk/Makefile.am D /trunk/debian * Removed debian/ directory from upstream. ------------------------------------------------------------------------ r262 | sam | 2006-03-02 22:17:23 +0100 (Thu, 02 Mar 2006) | 3 lines Changed paths: M /trunk/src/cont.c * src/cont.c: marked as volatile variables that we don't want optimised away. ------------------------------------------------------------------------ r261 | sam | 2006-03-02 22:07:01 +0100 (Thu, 02 Mar 2006) | 2 lines Changed paths: M /trunk/src/proc.c * src/proc.c: store function pointers in typed variables before calling them. ------------------------------------------------------------------------ r260 | sam | 2006-03-02 22:04:10 +0100 (Thu, 02 Mar 2006) | 2 lines Changed paths: M /trunk/src/type.c * src/type.c: Replaced useless ++p with p+1. ------------------------------------------------------------------------ r259 | sam | 2006-03-02 22:02:40 +0100 (Thu, 02 Mar 2006) | 2 lines Changed paths: M /trunk/bootstrap * bootstrap: imported a newer bootstrap script. ------------------------------------------------------------------------ r258 | sam | 2006-03-02 21:54:22 +0100 (Thu, 02 Mar 2006) | 3 lines Changed paths: M /trunk/include/object.h * include/object.h: use uintptr_t instead of intptr_t to avoid side effects during divisions. ------------------------------------------------------------------------ r257 | sam | 2005-11-01 19:59:20 +0100 (Tue, 01 Nov 2005) | 2 lines Changed paths: M /trunk/bootstrap * bootstrap: support automake version 1.8 and 1.9. ------------------------------------------------------------------------ r256 | sam | 2005-11-01 19:58:14 +0100 (Tue, 01 Nov 2005) | 2 lines Changed paths: M /trunk/src/cont.c * src/cont.c: workaround for an amd64 gcc bug. ------------------------------------------------------------------------ r255 | sam | 2004-08-09 22:21:00 +0200 (Mon, 09 Aug 2004) | 3 lines Changed paths: M /trunk/src/heap-gen.c * src/heap-gen.c: + Fixed shadowed global declarations. ------------------------------------------------------------------------ r254 | sam | 2004-08-09 22:09:20 +0200 (Mon, 09 Aug 2004) | 2 lines Changed paths: D /trunk/autotools * No longer version-control autotools. ------------------------------------------------------------------------ r253 | sam | 2004-08-09 22:08:52 +0200 (Mon, 09 Aug 2004) | 6 lines Changed paths: M /trunk/Makefile.am D /trunk/autotools/Makefile.am M /trunk/bootstrap M /trunk/configure.ac * bootstrap: + Call aclocal after libtoolize. + Got rid of autotools/ * configure.ac: + Added more warning flags to the compilation process. ------------------------------------------------------------------------ r252 | sam | 2004-08-09 22:05:25 +0200 (Mon, 09 Aug 2004) | 3 lines Changed paths: M /trunk/include/exception.h M /trunk/include/extern.h M /trunk/include/funcproto.h M /trunk/include/gc.h M /trunk/include/intern.h M /trunk/include/object.h M /trunk/include/stkmem.h M /trunk/lib/misc/newhandler.cpp M /trunk/lib/unix/unix.h M /trunk/lib/xlib/xlib.h M /trunk/lib/xwidgets/motif/support.d M /trunk/lib/xwidgets/xt.h M /trunk/src/stab-elf.c * Got rid of P_() and ELLIPSIS macros. * Adapted all prototypes to no longer use P_(). ------------------------------------------------------------------------ r251 | sam | 2004-03-14 14:10:32 +0100 (Sun, 14 Mar 2004) | 5 lines Changed paths: M /trunk/debian/changelog M /trunk/debian/control M /trunk/debian/menu M /trunk/debian/rules * debian/control: + Build-depend on the new X development packages instead of xlibs-dev. * debian/menu: + Syntax fixes. ------------------------------------------------------------------------ r250 | sam | 2004-03-11 19:21:55 +0100 (Thu, 11 Mar 2004) | 4 lines Changed paths: M /trunk/src/loadlib.c * src/loadlib.c: + Use the internal Get_String() function to allocate a C string from library objects, since Elk strings are not null-terminated. ------------------------------------------------------------------------ r249 | sam | 2004-01-29 14:55:42 +0100 (Thu, 29 Jan 2004) | 3 lines Changed paths: M /trunk/src/math.c * src/math.c: + If one of the factors is the exact zero, the result yields exact zero. ------------------------------------------------------------------------ r248 | sam | 2004-01-19 20:29:59 +0100 (Mon, 19 Jan 2004) | 3 lines Changed paths: M /trunk/AUTHORS M /trunk/include/extern.h M /trunk/src/math.c M /trunk/src/prim.c * include/extern.h: + Export P_Pow to applications. ------------------------------------------------------------------------ r247 | sam | 2003-12-31 18:40:24 +0100 (Wed, 31 Dec 2003) | 3 lines Changed paths: M /trunk/debian/changelog M /trunk/debian/rules * debian/rules: + Added touch calls to avoid build failures due to clock skews. ------------------------------------------------------------------------ r246 | sam | 2003-12-31 18:21:21 +0100 (Wed, 31 Dec 2003) | 5 lines Changed paths: M /trunk/configure.ac M /trunk/debian/control * debian/control: + Switched back to libelf; elfutils is rather non-free. * configure.ac: + Don't assume -lXt when checking for -lX11. ------------------------------------------------------------------------ r245 | sam | 2003-12-08 11:48:49 +0100 (Mon, 08 Dec 2003) | 2 lines Changed paths: M /trunk/configure.ac * configure.ac: Added an additional level of quoting (from the FreeBSD port). ------------------------------------------------------------------------ r244 | sam | 2003-12-08 11:48:14 +0100 (Mon, 08 Dec 2003) | 2 lines Changed paths: M /trunk/ChangeLog * Updated ChangeLog. ------------------------------------------------------------------------ r242 | sam | 2003-12-05 13:35:48 +0100 (Fri, 05 Dec 2003) | 2 lines Changed paths: M /trunk/NEWS M /trunk/debian/changelog * Prepared release 3.99.6. ------------------------------------------------------------------------ r241 | sam | 2003-12-03 13:49:02 +0100 (Wed, 03 Dec 2003) | 3 lines Changed paths: M /trunk/examples/tests/r4rstest.scm * examples/tests/r4rstest.scm: + Updated Aubrey Jaffers' R4RS compliance test. ------------------------------------------------------------------------ r233 | sam | 2003-11-26 18:50:30 +0100 (Wed, 26 Nov 2003) | 3 lines Changed paths: M /trunk/AUTHORS M /trunk/configure.ac * configure.ac: + Fix by Phillip Rulon for uninitialised $prefix. ------------------------------------------------------------------------ r232 | sam | 2003-11-06 11:22:44 +0100 (Thu, 06 Nov 2003) | 2 lines Changed paths: M /trunk/bootstrap * bootstrap: remove autom4te.cache before running autoconf. ------------------------------------------------------------------------ r231 | sam | 2003-10-13 11:23:47 +0200 (Mon, 13 Oct 2003) | 2 lines Changed paths: M /trunk/debian/changelog M /trunk/debian/control * Minor Debian release. ------------------------------------------------------------------------ r230 | sam | 2003-10-10 14:40:37 +0200 (Fri, 10 Oct 2003) | 2 lines Changed paths: M /trunk/debian/changelog M /trunk/debian/control * New Debian upload. ------------------------------------------------------------------------ r229 | sam | 2003-10-07 21:20:35 +0200 (Tue, 07 Oct 2003) | 2 lines Changed paths: M /trunk/configure.ac * Only look for kernel32.dll if the target is windows. ------------------------------------------------------------------------ r228 | sam | 2003-10-06 02:19:21 +0200 (Mon, 06 Oct 2003) | 2 lines Changed paths: M /trunk/configure.ac * Fixed the invalid -lXt check, that was causing the -lXaw check to fail. ------------------------------------------------------------------------ r227 | sam | 2003-10-06 00:52:37 +0200 (Mon, 06 Oct 2003) | 5 lines Changed paths: M /trunk/configure.ac M /trunk/src/libelk.c M /trunk/src/loadlib.c * src/libelk.c: + Test for HAVE_STRUCT_RLIMIT, not HAVE_GETRLIMIT. * src/loadlib.c: + Style fixes. ------------------------------------------------------------------------ r226 | sam | 2003-10-05 23:05:11 +0200 (Sun, 05 Oct 2003) | 2 lines Changed paths: M /trunk/configure.ac * Minor typo fix (cosmetic). ------------------------------------------------------------------------ r225 | sam | 2003-10-05 15:11:41 +0200 (Sun, 05 Oct 2003) | 2 lines Changed paths: M /trunk/configure.ac M /trunk/src/loadlib.c * Support for the BeOS dynamic loader. ------------------------------------------------------------------------ r224 | sam | 2003-10-05 00:28:49 +0200 (Sun, 05 Oct 2003) | 2 lines Changed paths: M /trunk/src/loadlib.c * Fixed a stupid bug in the HP-UX dynamic code loading. ------------------------------------------------------------------------ r223 | sam | 2003-10-05 00:27:57 +0200 (Sun, 05 Oct 2003) | 2 lines Changed paths: M /trunk/ChangeLog M /trunk/configure.ac M /trunk/debian/changelog * Working on 3.99.6. ------------------------------------------------------------------------ r222 | sam | 2003-09-30 04:00:20 +0200 (Tue, 30 Sep 2003) | 2 lines Changed paths: M /trunk/configure.ac M /trunk/lib/xwidgets/Makefile.am * Do not fail if -lXmu is not present; -lXt should be enough. ------------------------------------------------------------------------ r221 | sam | 2003-09-28 15:05:38 +0200 (Sun, 28 Sep 2003) | 2 lines Changed paths: M /trunk/ChangeLog M /trunk/NEWS M /trunk/build-win32 M /trunk/debian/changelog * Release 3.99.5. ------------------------------------------------------------------------ r220 | sam | 2003-09-28 14:49:25 +0200 (Sun, 28 Sep 2003) | 3 lines Changed paths: M /trunk/COPYING M /trunk/MACHINES * Removed deprecated notes from MACHINES * Added $Id to COPYING and removed date information. ------------------------------------------------------------------------ r219 | sam | 2003-09-28 13:22:30 +0200 (Sun, 28 Sep 2003) | 4 lines Changed paths: M /trunk/examples/tests/Makefile.am M /trunk/examples/tests/r4rstest.scm * r4rstest.scm is the original test again, we add extra tests at build time in a generated file. * Fixed a $(srcdir) / $(builddir) confusion. ------------------------------------------------------------------------ r218 | sam | 2003-09-28 13:15:47 +0200 (Sun, 28 Sep 2003) | 2 lines Changed paths: M /trunk/doc/bitstring/Makefile.am M /trunk/doc/cprog/Makefile.am M /trunk/doc/kernel/Makefile.am M /trunk/doc/man/Makefile.am M /trunk/doc/oops/Makefile.am M /trunk/doc/record/Makefile.am M /trunk/doc/regexp/Makefile.am M /trunk/doc/unix/Makefile.am M /trunk/doc/usenix/Makefile.am M /trunk/doc/xlib/Makefile.am M /trunk/doc/xt/Makefile.am * Fixed a couple of $(srcdir) / $(builddir) mistakes in the doc rules. ------------------------------------------------------------------------ r217 | sam | 2003-09-28 12:12:49 +0200 (Sun, 28 Sep 2003) | 3 lines Changed paths: M /trunk/examples/tests/Makefile.am * Use printf "" instead of touch to create timestamps because of systems where touch does not create the file. ------------------------------------------------------------------------ r216 | sam | 2003-09-28 12:00:48 +0200 (Sun, 28 Sep 2003) | 2 lines Changed paths: M /trunk/scm/xwidgets.scm * Fixed xaw.la and motif.la loading. ------------------------------------------------------------------------ r215 | sam | 2003-09-28 12:00:26 +0200 (Sun, 28 Sep 2003) | 2 lines Changed paths: M /trunk/lib/xwidgets/Makefile.am A /trunk/lib/xwidgets/error.c (from /trunk/lib/xwidgets/xterror.c:214) A /trunk/lib/xwidgets/init.c (from /trunk/lib/xwidgets/xtinit.c:214) A /trunk/lib/xwidgets/objects.c (from /trunk/lib/xwidgets/xtobjects.c:214) D /trunk/lib/xwidgets/xterror.c D /trunk/lib/xwidgets/xtinit.c D /trunk/lib/xwidgets/xtobjects.c * Renamed xt*.c to *.c, because it is their original name in Elk 3.0. ------------------------------------------------------------------------ r214 | sam | 2003-09-28 11:57:09 +0200 (Sun, 28 Sep 2003) | 3 lines Changed paths: M /trunk/configure.ac M /trunk/lib/xwidgets/Makefile.am M /trunk/lib/xwidgets/mkwidget.scm A /trunk/lib/xwidgets/motif/Makefile.am A /trunk/lib/xwidgets/motif/init.c A /trunk/lib/xwidgets/xaw/Makefile.am A /trunk/lib/xwidgets/xaw/init.c M /trunk/lib/xwidgets/xt.h * Split the common part of the xaw and motif plugins into a separate libelk-xt shared library. ------------------------------------------------------------------------ r213 | sam | 2003-09-28 11:50:15 +0200 (Sun, 28 Sep 2003) | 2 lines Changed paths: M /trunk/lib/xlib/Makefile.am A /trunk/lib/xlib/init.c (from /trunk/lib/xlib/plugin.c:212) D /trunk/lib/xlib/plugin.c * Renamed plugin.c to init.c to match the xt plugin. ------------------------------------------------------------------------ r212 | sam | 2003-09-27 17:20:14 +0200 (Sat, 27 Sep 2003) | 4 lines Changed paths: M /trunk/lib/xlib/Makefile.am A /trunk/lib/xlib/error.c (from /trunk/lib/xlib/xerror.c:192) A /trunk/lib/xlib/objects.c (from /trunk/lib/xlib/xobjects.c:192) A /trunk/lib/xlib/plugin.c (from /trunk/lib/xlib/xinit.c:192) D /trunk/lib/xlib/xerror.c D /trunk/lib/xlib/xinit.c M /trunk/lib/xlib/xlib.h D /trunk/lib/xlib/xobjects.c * Split the xlib.la module into a shared library and a module, so that the shared library can be used by the xaw and motif modules (which I am going to split as well). ------------------------------------------------------------------------ r211 | sam | 2003-09-27 16:41:16 +0200 (Sat, 27 Sep 2003) | 2 lines Changed paths: M /trunk/configure.ac * Fixed a syntax error. ------------------------------------------------------------------------ r210 | sam | 2003-09-27 14:34:27 +0200 (Sat, 27 Sep 2003) | 2 lines Changed paths: M /trunk/lib/xwidgets/motif M /trunk/lib/xwidgets/xaw * Ask SVN to ignore the .dirstamp entry. ------------------------------------------------------------------------ r209 | sam | 2003-09-27 14:30:10 +0200 (Sat, 27 Sep 2003) | 2 lines Changed paths: M /trunk/doc/cprog/Makefile.am * Replaced a GNU sed syntax with two combined grep + sed calls. ------------------------------------------------------------------------ r208 | sam | 2003-09-27 14:07:13 +0200 (Sat, 27 Sep 2003) | 2 lines Changed paths: M /trunk/doc/bitstring/Makefile.am M /trunk/doc/cprog/Makefile.am M /trunk/doc/kernel/Makefile.am M /trunk/doc/oops/Makefile.am M /trunk/doc/record/Makefile.am M /trunk/doc/regexp/Makefile.am M /trunk/doc/unix/Makefile.am M /trunk/doc/xlib/Makefile.am M /trunk/doc/xt/Makefile.am * Use $(AWK) instead of awk. ------------------------------------------------------------------------ r207 | sam | 2003-09-27 14:05:59 +0200 (Sat, 27 Sep 2003) | 3 lines Changed paths: M /trunk/doc/util/mkindex.awk * Changed the recursion into an iteration so that we don't use awk functions and it properly works with the Solaris implementation. ------------------------------------------------------------------------ r206 | sam | 2003-09-26 19:58:08 +0200 (Fri, 26 Sep 2003) | 2 lines Changed paths: M /trunk/lib/unix/process.c * Use __environ instead of environ on platforms where it exists. ------------------------------------------------------------------------ r205 | sam | 2003-09-26 19:54:52 +0200 (Fri, 26 Sep 2003) | 3 lines Changed paths: M /trunk/configure.ac M /trunk/lib/xwidgets/Makefile.am M /trunk/lib/xwidgets/mkwidget.scm D /trunk/lib/xwidgets/motif/Makefile.am D /trunk/lib/xwidgets/motif/init.c D /trunk/lib/xwidgets/xaw/Makefile.am D /trunk/lib/xwidgets/xaw/init.c M /trunk/lib/xwidgets/xtinit.c M /trunk/scm/xwidgets.scm * Merged the *-xt.la and *-widgets.la module pairs into one *.la to avoid undefined symbols. ------------------------------------------------------------------------ r204 | sam | 2003-09-26 18:23:47 +0200 (Fri, 26 Sep 2003) | 2 lines Changed paths: M /trunk/lib/unix/process.c * Fixed environ detection under OS X. ------------------------------------------------------------------------ r203 | sam | 2003-09-26 18:21:24 +0200 (Fri, 26 Sep 2003) | 2 lines Changed paths: M /trunk/configure.ac M /trunk/examples/Makefile.am M /trunk/examples/tests A /trunk/examples/tests/Makefile.am M /trunk/examples/tests/r4rstest.scm * We run r4rstest.scm after having built elk. ------------------------------------------------------------------------ r202 | sam | 2003-09-26 17:57:43 +0200 (Fri, 26 Sep 2003) | 2 lines Changed paths: M /trunk/configure.ac * Fixed shell syntax (if "foo" = "bar" instead of if test "foo" = "bar"). ------------------------------------------------------------------------ r201 | sam | 2003-09-26 17:42:13 +0200 (Fri, 26 Sep 2003) | 2 lines Changed paths: M /trunk/configure.ac * Don't build the Xaw and Motif plugins when cross-compiling. ------------------------------------------------------------------------ r200 | sam | 2003-09-26 17:33:30 +0200 (Fri, 26 Sep 2003) | 2 lines Changed paths: M /trunk/lib/unix/process.c * Fixed linking on OS X. ------------------------------------------------------------------------ r199 | sam | 2003-09-26 17:32:16 +0200 (Fri, 26 Sep 2003) | 2 lines Changed paths: M /trunk/configure.ac M /trunk/lib/unix/process.c * Disabled the use of environ on OS X. ------------------------------------------------------------------------ r198 | sam | 2003-09-26 17:03:20 +0200 (Fri, 26 Sep 2003) | 2 lines Changed paths: M /trunk/lib/xwidgets/motif/Makefile.am M /trunk/lib/xwidgets/xaw/Makefile.am * Call Elk with case-sensitive symbols when building code. ------------------------------------------------------------------------ r197 | sam | 2003-09-26 17:02:53 +0200 (Fri, 26 Sep 2003) | 2 lines Changed paths: M /trunk/include/misc.h M /trunk/src/heap-sc.c M /trunk/src/libelk.c M /trunk/src/list.c * Renamed ALIGN into ELK_ALIGN because OS X's defines it. ------------------------------------------------------------------------ r196 | sam | 2003-09-26 14:28:31 +0200 (Fri, 26 Sep 2003) | 3 lines Changed paths: M /trunk/configure.ac M /trunk/lib/unix/fdescr.c M /trunk/src/heap-gen.c M /trunk/src/io.c * Removed compile-time checks for _SC_OPEN_MAX, _PC_PATH_MAX and _SC_PAGESIZE and used simple build-time #ifdefs. ------------------------------------------------------------------------ r195 | sam | 2003-09-26 14:17:33 +0200 (Fri, 26 Sep 2003) | 3 lines Changed paths: M /trunk/include/misc.h * Added '\r' to the list of whitespace characters, as in the patch I found on http://verno.ueda.info.waseda.ac.jp/network/patch-z . ------------------------------------------------------------------------ r194 | sam | 2003-09-26 14:13:29 +0200 (Fri, 26 Sep 2003) | 3 lines Changed paths: M /trunk/COPYING M /trunk/debian/copyright * Added my copyright to the license. * Removed useless stuff from debian/copyright. ------------------------------------------------------------------------ r193 | sam | 2003-09-26 11:18:39 +0200 (Fri, 26 Sep 2003) | 2 lines Changed paths: M /trunk * Ignore the INSTALL file. ------------------------------------------------------------------------ r192 | sam | 2003-09-26 11:11:20 +0200 (Fri, 26 Sep 2003) | 2 lines Changed paths: M /trunk/BUGS M /trunk/src/math.c * Fixed the bignum/double comparisons. ------------------------------------------------------------------------ r191 | sam | 2003-09-26 11:10:53 +0200 (Fri, 26 Sep 2003) | 2 lines Changed paths: M /trunk/src/bool.c * Fixed a minor compilation warning. ------------------------------------------------------------------------ r190 | sam | 2003-09-26 03:27:04 +0200 (Fri, 26 Sep 2003) | 2 lines Changed paths: M /trunk/examples/tests/r4rstest.scm * Updated Aubrey's r4rs conformance test which now features my suggestion. ------------------------------------------------------------------------ r189 | sam | 2003-09-25 15:28:07 +0200 (Thu, 25 Sep 2003) | 2 lines Changed paths: M /trunk/include/object.h M /trunk/lib/xlib/property.c * Replaced short with int16_t where necessary. ------------------------------------------------------------------------ r188 | sam | 2003-09-25 15:04:01 +0200 (Thu, 25 Sep 2003) | 2 lines Changed paths: M /trunk/examples/Makefile.am A /trunk/examples/tests A /trunk/examples/tests/README A /trunk/examples/tests/r4rstest.scm * Added the r4rstest.scm compliance test, with a minor addition. ------------------------------------------------------------------------ r187 | sam | 2003-09-24 20:49:46 +0200 (Wed, 24 Sep 2003) | 2 lines Changed paths: M /trunk/src/bool.c * According to r4rs section 6.2, (eqv? 1 1.0) returns #f. ------------------------------------------------------------------------ r186 | sam | 2003-09-24 19:42:55 +0200 (Wed, 24 Sep 2003) | 2 lines Changed paths: M /trunk/include/object.h * BigNums now use uint16_t, not unsigned short. ------------------------------------------------------------------------ r185 | sam | 2003-09-24 18:32:46 +0200 (Wed, 24 Sep 2003) | 3 lines Changed paths: M /trunk/BUGS M /trunk/src/special.c * Fixed scope of named let variables, fixing the bug described here: http://groups.google.com/groups?selm=871zemtmd4.fsf%40app.dial.idiom.com ------------------------------------------------------------------------ r184 | sam | 2003-09-24 17:14:16 +0200 (Wed, 24 Sep 2003) | 2 lines Changed paths: M /trunk/configure.ac M /trunk/lib/unix/process.c * Fixed the check for "environ" on OS X and Solaris. ------------------------------------------------------------------------ r183 | sam | 2003-09-24 11:19:40 +0200 (Wed, 24 Sep 2003) | 2 lines Changed paths: D /trunk/INSTALL M /trunk/bootstrap * Removed INSTALL from repository, automake installs it for us. ------------------------------------------------------------------------ r182 | sam | 2003-09-24 11:15:37 +0200 (Wed, 24 Sep 2003) | 2 lines Changed paths: M /trunk/BUGS * New bugs. ------------------------------------------------------------------------ r181 | sam | 2003-09-24 11:14:51 +0200 (Wed, 24 Sep 2003) | 2 lines Changed paths: M /trunk/AUTHORS M /trunk/include/site.h.in * extern_c should expand to extern in C, not to /* */, thanks to Mark Sapa. ------------------------------------------------------------------------ r180 | sam | 2003-09-23 14:16:43 +0200 (Tue, 23 Sep 2003) | 2 lines Changed paths: M /trunk/src/libelk.c * Case-insensitive symbols by default. ------------------------------------------------------------------------ r179 | sam | 2003-09-23 14:16:22 +0200 (Tue, 23 Sep 2003) | 2 lines Changed paths: M /trunk/include/site.h.in M /trunk/src/bignum.c * Use DBL_MAX instead of HUGE_VAL for float precision when available. ------------------------------------------------------------------------ r178 | sam | 2003-09-23 14:15:36 +0200 (Tue, 23 Sep 2003) | 2 lines Changed paths: M /trunk/src/math.c * Promoted precision in Float->String transformations. ------------------------------------------------------------------------ r177 | sam | 2003-09-23 00:54:22 +0200 (Tue, 23 Sep 2003) | 2 lines Changed paths: M /trunk/src/prim.c M /trunk/src/special.c * Empty (begin), (begin1) and (cond) return #. ------------------------------------------------------------------------ r176 | sam | 2003-09-23 00:47:03 +0200 (Tue, 23 Sep 2003) | 2 lines Changed paths: M /trunk/src/print.c * Display # instead of #[foo], to mimic Guile's output. ------------------------------------------------------------------------ r175 | sam | 2003-09-23 00:46:24 +0200 (Tue, 23 Sep 2003) | 2 lines Changed paths: M /trunk/include/extern.h M /trunk/include/object.h M /trunk/src/symbol.c * Added the "unspecified" type. ------------------------------------------------------------------------ r174 | sam | 2003-09-23 00:44:19 +0200 (Tue, 23 Sep 2003) | 2 lines Changed paths: M /trunk/ChangeLog M /trunk/NEWS * Fixed fucked up ChangeLog and NEWS files. ------------------------------------------------------------------------ r173 | sam | 2003-09-22 19:00:33 +0200 (Mon, 22 Sep 2003) | 2 lines Changed paths: M /trunk/configure.ac * Linux compilation fix. ------------------------------------------------------------------------ r172 | sam | 2003-09-20 05:25:58 +0200 (Sat, 20 Sep 2003) | 3 lines Changed paths: M /trunk/lib/misc/bitstring.c * Fixed the bitstring->unsigned-integer return value with a patch from David Marmor. ------------------------------------------------------------------------ r171 | sam | 2003-09-20 04:27:44 +0200 (Sat, 20 Sep 2003) | 3 lines Changed paths: M /trunk/NEWS M /trunk/configure.ac * Fixed the CXX check. * Updated NEWS. ------------------------------------------------------------------------ r170 | sam | 2003-09-20 03:13:14 +0200 (Sat, 20 Sep 2003) | 2 lines Changed paths: M /trunk/ChangeLog M /trunk/NEWS M /trunk/configure.ac * 3.99.4 release. ------------------------------------------------------------------------ r169 | sam | 2003-09-20 02:40:33 +0200 (Sat, 20 Sep 2003) | 2 lines Changed paths: M /trunk/AUTHORS * Updated thanks. ------------------------------------------------------------------------ r168 | sam | 2003-09-19 13:51:12 +0200 (Fri, 19 Sep 2003) | 2 lines Changed paths: M /trunk/AUTHORS * More credits. ------------------------------------------------------------------------ r167 | sam | 2003-09-19 13:47:51 +0200 (Fri, 19 Sep 2003) | 2 lines Changed paths: M /trunk/configure.ac M /trunk/lib/unix/system.c * #include if available, so that Solaris has MAXHOSTNAMELEN. ------------------------------------------------------------------------ r166 | sam | 2003-09-19 13:46:13 +0200 (Fri, 19 Sep 2003) | 2 lines Changed paths: M /trunk/src/loadlib.c * Fixed an invalid declaration that prevented compilation on HP-UX. ------------------------------------------------------------------------ r165 | sam | 2003-09-19 13:45:16 +0200 (Fri, 19 Sep 2003) | 3 lines Changed paths: M /trunk/lib/misc/regexp.c * Fixed function declarations in regexp.c that caused the Win32 plugin to crash. ------------------------------------------------------------------------ r164 | sam | 2003-09-19 10:54:08 +0200 (Fri, 19 Sep 2003) | 5 lines Changed paths: M /trunk/build-win32 M /trunk/configure.ac M /trunk/lib/unix/Makefile.am M /trunk/lib/unix/fdescr.c M /trunk/lib/unix/file.c M /trunk/lib/unix/misc.c M /trunk/lib/unix/passwd.c M /trunk/lib/unix/process.c M /trunk/lib/unix/signal.c M /trunk/lib/unix/system.c M /trunk/lib/unix/unix.h M /trunk/lib/unix/wait.c M /trunk/lib/xlib/Makefile.am M /trunk/lib/xwidgets/Makefile.am M /trunk/lib/xwidgets/motif/Makefile.am M /trunk/lib/xwidgets/xaw/Makefile.am * Added -no-undefined to all plugins' LDFLAGS. * Disabled most of the unix plugin code under Windows. * Replaced remaining index/rindex calls with strchr/strrchr. * Updated the Win32 build. ------------------------------------------------------------------------ r163 | sam | 2003-09-17 15:29:39 +0200 (Wed, 17 Sep 2003) | 3 lines Changed paths: M /trunk/src/io.c M /trunk/src/libelk.c M /trunk/src/loadlib.c * Fixed the / and \ issues in path separators. * Use strchr/strrchr instead of index/rindex. ------------------------------------------------------------------------ r162 | sam | 2003-09-17 15:18:59 +0200 (Wed, 17 Sep 2003) | 2 lines Changed paths: M /trunk/configure.ac M /trunk/include/extern.h M /trunk/include/misc.h M /trunk/include/site.h.in M /trunk/lib/misc/Makefile.am M /trunk/src/Makefile.am * Proper DLL symbol exporting under Win32. ------------------------------------------------------------------------ r161 | sam | 2003-09-17 14:01:49 +0200 (Wed, 17 Sep 2003) | 3 lines Changed paths: M /trunk/lib/misc/bitstring.c M /trunk/lib/misc/gdbm.c M /trunk/lib/misc/hack.c M /trunk/lib/misc/record.c M /trunk/lib/misc/regexp.c M /trunk/lib/misc/struct.c M /trunk/lib/unix/unix.c M /trunk/lib/xlib/xinit.c M /trunk/lib/xwidgets/motif/init.c M /trunk/lib/xwidgets/xaw/init.c M /trunk/lib/xwidgets/xtinit.c M /trunk/scm/bitstring.scm M /trunk/scm/gdbmtest.scm M /trunk/scm/oops.scm M /trunk/scm/record.scm M /trunk/scm/regexp.scm M /trunk/scm/struct.scm M /trunk/scm/unix.scm M /trunk/scm/xlib.scm M /trunk/scm/xwidgets.scm M /trunk/src/load.c M /trunk/src/loadlib.c * Do not open .so files, but look for the libtool .la library instead and get the shared object's filename from it. ------------------------------------------------------------------------ r160 | sam | 2003-09-17 04:26:57 +0200 (Wed, 17 Sep 2003) | 2 lines Changed paths: M /trunk/src/loadlib.c M /trunk/src/stab-vanilla.c * Typos and coding style. ------------------------------------------------------------------------ r159 | sam | 2003-09-17 04:26:18 +0200 (Wed, 17 Sep 2003) | 2 lines Changed paths: M /trunk/scm/Makefile.am * Fixed the distribution of .scm files that weren't installed. ------------------------------------------------------------------------ r158 | sam | 2003-09-15 14:53:36 +0200 (Mon, 15 Sep 2003) | 2 lines Changed paths: M /trunk/include/cstring.h M /trunk/include/extern.h M /trunk/include/intern.h M /trunk/include/object.h M /trunk/lib/misc/monitor.c M /trunk/lib/misc/regexp.c M /trunk/lib/unix/fdescr.c M /trunk/lib/unix/file.c M /trunk/lib/unix/system.c M /trunk/lib/unix/unix.c M /trunk/lib/unix/unix.h M /trunk/lib/xlib/graphics.c M /trunk/lib/xlib/pixmap.c M /trunk/lib/xlib/type.c M /trunk/lib/xlib/xlib.h M /trunk/lib/xwidgets/motif/support.d M /trunk/lib/xwidgets/widget.c M /trunk/src/bool.c M /trunk/src/cont.c M /trunk/src/cstring.c M /trunk/src/dump-hp9k.c M /trunk/src/feature.c M /trunk/src/heap-gen.c M /trunk/src/io.c M /trunk/src/list.c M /trunk/src/load.c M /trunk/src/print.c M /trunk/src/stab-bsd.c M /trunk/src/stab-ecoff.c M /trunk/src/stab-elf.c M /trunk/src/stab-hp9k300.c M /trunk/src/stab-hp9k800.c M /trunk/src/string.c M /trunk/src/symbol.c M /trunk/src/vector.c * Fixed all signed/unsigned and undeclared function warnings. ------------------------------------------------------------------------ r157 | sam | 2003-09-15 13:47:51 +0200 (Mon, 15 Sep 2003) | 2 lines Changed paths: M /trunk/ChangeLog M /trunk/NEWS M /trunk/configure.ac M /trunk/debian/changelog * Minor 3.99.3 release. ------------------------------------------------------------------------ r156 | sam | 2003-09-15 13:09:21 +0200 (Mon, 15 Sep 2003) | 2 lines Changed paths: M /trunk/configure.ac M /trunk/lib/misc/Makefile.am * Disabled the monitor plugin because it relies on specific gcc features. ------------------------------------------------------------------------ r155 | sam | 2003-09-15 11:12:16 +0200 (Mon, 15 Sep 2003) | 2 lines Changed paths: M /trunk/doc/man/Makefile.am * Fixed the manpage directory. ------------------------------------------------------------------------ r154 | sam | 2003-09-15 10:59:33 +0200 (Mon, 15 Sep 2003) | 3 lines Changed paths: M /trunk/doc/man/Makefile.am M /trunk/src/Makefile.am * Use install-{exec,data}-hook instead of -local so that target directories already exist when the rule is called. ------------------------------------------------------------------------ r153 | sam | 2003-09-15 10:52:09 +0200 (Mon, 15 Sep 2003) | 3 lines Changed paths: M /trunk/doc/bitstring/Makefile.am M /trunk/doc/cprog/Makefile.am M /trunk/doc/kernel/Makefile.am M /trunk/doc/man/Makefile.am M /trunk/doc/oops/Makefile.am M /trunk/doc/record/Makefile.am M /trunk/doc/regexp/Makefile.am M /trunk/doc/unix/Makefile.am M /trunk/doc/usenix/Makefile.am M /trunk/doc/xlib/Makefile.am M /trunk/doc/xt/Makefile.am M /trunk/lib/xwidgets/motif/Makefile.am M /trunk/lib/xwidgets/xaw/Makefile.am * **/Makefile.am: Use CLEANFILES instead of a new clean rule to remove temporary files generated at build time. ------------------------------------------------------------------------ r152 | sam | 2003-09-15 10:46:36 +0200 (Mon, 15 Sep 2003) | 7 lines Changed paths: M /trunk/debian/changelog M /trunk/debian/rules M /trunk/doc/man/Makefile.am M /trunk/src/Makefile.am * src/Makefile.am, doc/man/Makefile.am: + Create symlinks at install time. * debian/rules: + Moved manpages to /usr/share/man (Closes: #210894). + Ignore plugins in the dh_makeshlibs call. + Removed the elk->scheme-elk link, it is done at make install time. ------------------------------------------------------------------------ r151 | sam | 2003-09-13 08:33:51 +0200 (Sat, 13 Sep 2003) | 2 lines Changed paths: M /trunk/ChangeLog M /trunk/NEWS M /trunk/build-win32 M /trunk/debian/changelog * The 3.99.2 release is now ready. ------------------------------------------------------------------------ r150 | sam | 2003-09-13 08:31:24 +0200 (Sat, 13 Sep 2003) | 2 lines Changed paths: M /trunk/configure.ac M /trunk/src/loadlib.c * Plugin support for Win32. ------------------------------------------------------------------------ r149 | sam | 2003-09-13 02:35:20 +0200 (Sat, 13 Sep 2003) | 2 lines Changed paths: M /trunk/Makefile.am A /trunk/build-win32 * Quick and dirty .zip generator for the Win32 version. ------------------------------------------------------------------------ r148 | sam | 2003-09-13 02:34:58 +0200 (Sat, 13 Sep 2003) | 5 lines Changed paths: M /trunk/include/intern.h M /trunk/src/Makefile.am M /trunk/src/io.c M /trunk/src/libelk.c M /trunk/src/load.c * Removed references to NOMAIN. * Replaced / with \ under Win32. * The Win32 version looks for .scm files in the scm subdirectory of the executable's current directory. ------------------------------------------------------------------------ r147 | sam | 2003-09-11 22:46:50 +0200 (Thu, 11 Sep 2003) | 2 lines Changed paths: M /trunk/doc/bitstring M /trunk/doc/cprog M /trunk/doc/kernel M /trunk/doc/man M /trunk/doc/oops M /trunk/doc/record M /trunk/doc/regexp M /trunk/doc/unix M /trunk/doc/usenix M /trunk/doc/xlib M /trunk/doc/xt * Made SVN ignore temporary files. ------------------------------------------------------------------------ r146 | sam | 2003-09-11 22:44:17 +0200 (Thu, 11 Sep 2003) | 2 lines Changed paths: M /trunk/ChangeLog M /trunk/debian/changelog * Preparing new release. ------------------------------------------------------------------------ r145 | sam | 2003-09-11 12:09:27 +0200 (Thu, 11 Sep 2003) | 2 lines Changed paths: M /trunk/src/main.c * Allocate a console under Win32, and wait for user input before closing it. ------------------------------------------------------------------------ r144 | sam | 2003-09-11 10:47:10 +0200 (Thu, 11 Sep 2003) | 2 lines Changed paths: M /trunk/debian/rules M /trunk/doc/bitstring/Makefile.am M /trunk/doc/cprog/Makefile.am M /trunk/doc/kernel/Makefile.am M /trunk/doc/man/Makefile.am M /trunk/doc/oops/Makefile.am M /trunk/doc/record/Makefile.am M /trunk/doc/regexp/Makefile.am M /trunk/doc/unix/Makefile.am M /trunk/doc/usenix/Makefile.am M /trunk/doc/xlib/Makefile.am M /trunk/doc/xt/Makefile.am * Install PostScript documentation into /usr/share/doc/elk/ps/. ------------------------------------------------------------------------ r143 | sam | 2003-09-11 10:21:49 +0200 (Thu, 11 Sep 2003) | 9 lines Changed paths: M /trunk/configure.ac M /trunk/debian/control M /trunk/debian/elkdoc.docs M /trunk/debian/rules M /trunk/doc/bitstring/Makefile.am D /trunk/doc/bitstring/bitstring.ps M /trunk/doc/cprog/Makefile.am D /trunk/doc/cprog/cprog.ps M /trunk/doc/kernel/Makefile.am D /trunk/doc/kernel/kernel.ps M /trunk/doc/man/Makefile.am D /trunk/doc/man/elk.ps M /trunk/doc/oops/Makefile.am D /trunk/doc/oops/oops.ps M /trunk/doc/record/Makefile.am D /trunk/doc/record/record.ps M /trunk/doc/regexp/Makefile.am D /trunk/doc/regexp/regexp.ps M /trunk/doc/unix/Makefile.am D /trunk/doc/unix/unix.ps M /trunk/doc/usenix/Makefile.am D /trunk/doc/usenix/usenix.ps M /trunk/doc/xlib/Makefile.am D /trunk/doc/xlib/xlib.ps M /trunk/doc/xt/Makefile.am D /trunk/doc/xt/xt.ps * configure.ac: + Check for awk and groff. + Only build documentation if groff was found. * debian/rules: + Move .ps documentation to the elkdoc package. * doc/*: + Removed *.ps files from CVS. + Added proper build rules for *.ps files. ------------------------------------------------------------------------ r142 | sam | 2003-09-11 08:57:26 +0200 (Thu, 11 Sep 2003) | 4 lines Changed paths: M /trunk/configure.ac M /trunk/src/load.c * Renamed OBJ_DIR into LIB_DIR. * Fixed SCM_DIR and LIB_DIR so that they take ${prefix} into account. * Added -I $(top_builddir)/include to INCLUDES. ------------------------------------------------------------------------ r141 | sam | 2003-09-11 01:26:02 +0200 (Thu, 11 Sep 2003) | 2 lines Changed paths: M /trunk/src/main.c * Allocate a DOS command window under Win32. ------------------------------------------------------------------------ r140 | sam | 2003-09-11 00:40:44 +0200 (Thu, 11 Sep 2003) | 2 lines Changed paths: M /trunk/configure.ac * Fix HP-UX crashes by defining ARRAY_BROKEN on this platform. ------------------------------------------------------------------------ r139 | sam | 2003-09-10 17:10:11 +0200 (Wed, 10 Sep 2003) | 6 lines Changed paths: M /trunk/configure.ac M /trunk/include/object.h M /trunk/include/site.h.in * configure.ac: + Prefer the C99 inttypes.h rather than stdint.h. + Use AC_FUNC_ALLOCA instead of AC_CHECK_FUNCS(alloca). * include/object.h: + Removed a legacy #include . ------------------------------------------------------------------------ r138 | sam | 2003-09-10 17:08:00 +0200 (Wed, 10 Sep 2003) | 2 lines Changed paths: M /trunk/BUGS M /trunk/src/heap-gen.c * Fixed a bug in the garbage collector. ------------------------------------------------------------------------ r137 | sam | 2003-09-10 01:13:50 +0200 (Wed, 10 Sep 2003) | 2 lines Changed paths: M /trunk/lib/misc/bitstring.c M /trunk/lib/xlib/property.c M /trunk/lib/xwidgets/context.c M /trunk/lib/xwidgets/function.c M /trunk/lib/xwidgets/resource.c M /trunk/src/bool.c M /trunk/src/symbol.c * Replaced bcopy/bzero/bcmp with memcpu/memeset/memcmp. ------------------------------------------------------------------------ r136 | sam | 2003-09-09 22:58:45 +0200 (Tue, 09 Sep 2003) | 2 lines Changed paths: M /trunk/doc/Makefile.am * Do not recurse into util/ since we no longer need to build mkindex. ------------------------------------------------------------------------ r135 | sam | 2003-09-09 22:57:43 +0200 (Tue, 09 Sep 2003) | 2 lines Changed paths: M /trunk/doc/util/Makefile.am A /trunk/doc/util/mkindex.awk D /trunk/doc/util/mkindex.c * Rewrote mkindex.c in awk. ------------------------------------------------------------------------ r134 | sam | 2003-09-09 21:22:37 +0200 (Tue, 09 Sep 2003) | 2 lines Changed paths: M /trunk/doc/util/mkindex.c * Added comments to mkindex.c, to make its conversion easier. ------------------------------------------------------------------------ r133 | sam | 2003-09-09 20:40:42 +0200 (Tue, 09 Sep 2003) | 2 lines Changed paths: M /trunk/src * Hide elk.exe from SVN, now that the cygwin and mingw32 ports work. ------------------------------------------------------------------------ r132 | sam | 2003-09-09 20:35:16 +0200 (Tue, 09 Sep 2003) | 2 lines Changed paths: M /trunk/src/math.c * Do not declare random(), in case the prototype changes. ------------------------------------------------------------------------ r131 | sam | 2003-09-09 18:52:37 +0200 (Tue, 09 Sep 2003) | 2 lines Changed paths: M /trunk/src/libelk.c * Fixed a typo preventing the inclusion of sys/resource.h. ------------------------------------------------------------------------ r130 | sam | 2003-09-09 17:18:55 +0200 (Tue, 09 Sep 2003) | 3 lines Changed paths: M /trunk/configure.ac M /trunk/include/exception.h M /trunk/include/intern.h M /trunk/include/object.h M /trunk/include/scheme.h M /trunk/include/stkmem.h M /trunk/lib/unix/signal.c M /trunk/src/cont.c M /trunk/src/exception.c M /trunk/src/heap-gen.c M /trunk/src/heap-sc.c M /trunk/src/io.c M /trunk/src/libelk.c M /trunk/src/proc.c M /trunk/src/read.c M /trunk/src/stkmem.c * Added more system checks. * Now builds on Win32. ------------------------------------------------------------------------ r129 | sam | 2003-09-09 15:30:23 +0200 (Tue, 09 Sep 2003) | 4 lines Changed paths: M /trunk/configure.ac M /trunk/src/loadlib.c * Enhanced the dlopen() checks, especially for platforms that do not need -ldl. * Ported the plugin loading code to the HP-UX shl_load() system. ------------------------------------------------------------------------ r128 | sam | 2003-09-09 14:07:48 +0200 (Tue, 09 Sep 2003) | 3 lines Changed paths: M /trunk/bootstrap * Code clean-up. * Made bootstrap work on OS X, by calling glibtoolize instead of libtoolize. ------------------------------------------------------------------------ r127 | sam | 2003-09-08 00:33:32 +0200 (Mon, 08 Sep 2003) | 2 lines Changed paths: M /trunk/ChangeLog M /trunk/NEWS * Updated ChangeLog and NEWS for the 3.99.1 release. ------------------------------------------------------------------------ r126 | sam | 2003-09-08 00:10:41 +0200 (Mon, 08 Sep 2003) | 2 lines Changed paths: M /trunk/ChangeLog * Updated ChangeLog. ------------------------------------------------------------------------ r125 | sam | 2003-09-08 00:07:33 +0200 (Mon, 08 Sep 2003) | 2 lines Changed paths: M /trunk/configure.ac M /trunk/src/loadlib.c * Implemented the dyld plugin loader for OS X. ------------------------------------------------------------------------ r124 | sam | 2003-09-07 22:23:47 +0200 (Sun, 07 Sep 2003) | 2 lines Changed paths: M /trunk/configure.ac * Added a check for Darwin's dyld API, that we'll prefer over dlopen. ------------------------------------------------------------------------ r123 | sam | 2003-09-07 16:41:10 +0200 (Sun, 07 Sep 2003) | 2 lines Changed paths: M /trunk/lib/xwidgets/xaw/Makefile.am * Fixed the build of the xaw plugin. ------------------------------------------------------------------------ r122 | sam | 2003-09-07 16:28:01 +0200 (Sun, 07 Sep 2003) | 2 lines Changed paths: M /trunk/configure.ac M /trunk/src/print.c M /trunk/src/read.c * Fixed many tests for termio.h, termios.h, TIOCFLUSH, etc. ------------------------------------------------------------------------ r121 | sam | 2003-09-07 15:13:18 +0200 (Sun, 07 Sep 2003) | 4 lines Changed paths: M /trunk/src/Makefile.am M /trunk/src/loadlib.c D /trunk/src/stab-unix.c A /trunk/src/stab-vanilla.c (from /trunk/src/stab-unix.c:119) * Renamed stab-unix.c to stab-vanilla.c. * Implemented string parsing in stab-vanilla.c, so that libelf is no longer required. ------------------------------------------------------------------------ r120 | sam | 2003-09-07 15:12:27 +0200 (Sun, 07 Sep 2003) | 3 lines Changed paths: M /trunk/src/stab.c * Fixed a crash for symbols found in the list but that dlopen() could not properly load. ------------------------------------------------------------------------ r119 | sam | 2003-09-07 13:25:04 +0200 (Sun, 07 Sep 2003) | 4 lines Changed paths: M /trunk/src/Makefile.am M /trunk/src/stab-elf.c A /trunk/src/stab-unix.c M /trunk/src/stab.c * Disabled non-libelf stab files. * Added a stab-unix.c file which is a placeholder for future nm|objdump implementations. ------------------------------------------------------------------------ r118 | sam | 2003-09-07 13:18:38 +0200 (Sun, 07 Sep 2003) | 2 lines Changed paths: M /trunk/configure.ac * Fixed a typo in the configuration summary. ------------------------------------------------------------------------ r117 | sam | 2003-09-07 11:56:55 +0200 (Sun, 07 Sep 2003) | 2 lines Changed paths: M /trunk/src/loadlib.c * Oops, fixed a misplaced #ifdef. ------------------------------------------------------------------------ r116 | sam | 2003-09-07 11:55:56 +0200 (Sun, 07 Sep 2003) | 4 lines Changed paths: M /trunk/src/Makefile.am M /trunk/src/feature.c M /trunk/src/libelk.c D /trunk/src/load-dl.c D /trunk/src/load-ld.c D /trunk/src/load-rld.c D /trunk/src/load-shl.c M /trunk/src/load.c A /trunk/src/loadlib.c (from /trunk/src/load-dl.c:107) M /trunk/src/stab.c * Renamed load-dl.c into loadlib.c. * Removed support for bizarre dynamic linkers, will re-add them later. * Removed support for object linking with ld. ------------------------------------------------------------------------ r115 | sam | 2003-09-07 03:33:17 +0200 (Sun, 07 Sep 2003) | 2 lines Changed paths: M /trunk/configure.ac M /trunk/src/load.c * Got rid of CAN_LOAD_OBJ. We'll only use dlopen()-like functions now. ------------------------------------------------------------------------ r114 | sam | 2003-09-06 18:19:02 +0200 (Sat, 06 Sep 2003) | 3 lines Changed paths: M /trunk/configure.ac M /trunk/src/Makefile.am * Removed the hardcoded -lelf from src/Makefile.am. * Moved the hardcoded -lm -ldl from src/Makefile.am to configure.ac. ------------------------------------------------------------------------ r113 | sam | 2003-09-06 18:05:42 +0200 (Sat, 06 Sep 2003) | 2 lines Changed paths: M /trunk/configure.ac * Conditionally define CAN_DUMP, CAN_LOAD_OBJ and CAN_LOAD_LIB. ------------------------------------------------------------------------ r112 | sam | 2003-09-06 18:05:13 +0200 (Sat, 06 Sep 2003) | 2 lines Changed paths: M /trunk/src/libelk.c * Fixed a compile problem when CAN_DUMP is not defined. ------------------------------------------------------------------------ r111 | sam | 2003-09-06 17:43:16 +0200 (Sat, 06 Sep 2003) | 2 lines Changed paths: M /trunk/src/dump.c * Fixed typo (HAVE_ELF/HAVE_LIBELF). ------------------------------------------------------------------------ r110 | sam | 2003-09-06 17:41:48 +0200 (Sat, 06 Sep 2003) | 2 lines Changed paths: M /trunk/src/heap-gen.c * Renamed "link" into "linked" because of namespace collision with libc. ------------------------------------------------------------------------ r109 | sam | 2003-09-06 17:30:43 +0200 (Sat, 06 Sep 2003) | 2 lines Changed paths: M /trunk/include/misc.h M /trunk/include/object.h M /trunk/src/dump-elf.c M /trunk/src/dump.c M /trunk/src/env.c M /trunk/src/heap-gen.c M /trunk/src/heap.c M /trunk/src/libelk.c * Replaced ptrdiff_t with intptr_t. ------------------------------------------------------------------------ r108 | sam | 2003-09-06 17:29:30 +0200 (Sat, 06 Sep 2003) | 2 lines Changed paths: M /trunk/src/Makefile.am * Removed -DINIT_OBJECTS from the compilation flags. ------------------------------------------------------------------------ r107 | sam | 2003-09-06 16:46:24 +0200 (Sat, 06 Sep 2003) | 2 lines Changed paths: M /trunk/include/object.h M /trunk/src/dump-elf.c M /trunk/src/libelk.c * is deprecated, replaced with . ------------------------------------------------------------------------ r106 | sam | 2003-09-06 16:45:29 +0200 (Sat, 06 Sep 2003) | 4 lines Changed paths: M /trunk/configure.ac M /trunk/debian/changelog M /trunk/include/kernel.h M /trunk/include/scheme.h M /trunk/src/read.c M /trunk/src/stab.c * Checked for libelf, and replaced hardcoded #define ELF with HAVE_LIBELF tests. * #include "site.h" in kernel.h. ------------------------------------------------------------------------ r105 | sam | 2003-09-06 14:33:55 +0200 (Sat, 06 Sep 2003) | 3 lines Changed paths: M /trunk/configure.ac M /trunk/include/extern.h M /trunk/include/misc.h M /trunk/include/site.h.in M /trunk/src/error.c M /trunk/src/exception.c M /trunk/src/libelk.c M /trunk/src/proc.c M /trunk/src/read.c * Removed the autoconf check for __attribute__((noreturn)) and used plain C checks. ------------------------------------------------------------------------ r104 | sam | 2003-09-06 13:27:05 +0200 (Sat, 06 Sep 2003) | 2 lines Changed paths: D /trunk/lib/xlib/Include.am M /trunk/lib/xlib/Makefile.am * Removed lib/xlib/Include.am because no other plugin needs it. ------------------------------------------------------------------------ r103 | sam | 2003-09-06 13:25:29 +0200 (Sat, 06 Sep 2003) | 4 lines Changed paths: M /trunk/include M /trunk/include/Makefile.am M /trunk/include/kernel.h M /trunk/include/scheme.h A /trunk/include/site.h.in M /trunk/lib/misc/bitstring.c M /trunk/lib/misc/debug.c M /trunk/lib/misc/elk-eval.c M /trunk/lib/misc/gdbm.c M /trunk/lib/misc/hack.c M /trunk/lib/misc/monitor.c M /trunk/lib/misc/record.c M /trunk/lib/misc/regexp.c M /trunk/lib/misc/struct.c M /trunk/lib/unix/unix.h M /trunk/lib/xlib/xlib.h M /trunk/src/autoload.c M /trunk/src/bignum.c M /trunk/src/bool.c M /trunk/src/char.c M /trunk/src/cont.c M /trunk/src/cstring.c M /trunk/src/debug.c M /trunk/src/dump.c M /trunk/src/env.c M /trunk/src/error.c M /trunk/src/exception.c M /trunk/src/feature.c M /trunk/src/heap.c M /trunk/src/io.c M /trunk/src/libelk.c M /trunk/src/list.c M /trunk/src/load.c M /trunk/src/main.c M /trunk/src/malloc.c M /trunk/src/math.c M /trunk/src/onfork.c M /trunk/src/prim.c M /trunk/src/print.c M /trunk/src/proc.c M /trunk/src/promise.c M /trunk/src/read.c M /trunk/src/special.c M /trunk/src/stab.c M /trunk/src/stkmem.c M /trunk/src/string.c M /trunk/src/symbol.c M /trunk/src/terminate.c M /trunk/src/type.c M /trunk/src/vector.c * scheme.h and kernel.h no longer include config.h * Hence included config.h in all C files. * Added site.h which will replace config.h for installed headers. ------------------------------------------------------------------------ r102 | sam | 2003-09-06 13:23:33 +0200 (Sat, 06 Sep 2003) | 2 lines Changed paths: M /trunk/ChangeLog M /trunk/Makefile.am M /trunk/debian/elk.docs M /trunk/debian/elkdoc.docs M /trunk/debian/rules * Added a ChangeLog file (simple "svn log -v"). ------------------------------------------------------------------------ r101 | sam | 2003-09-06 13:20:46 +0200 (Sat, 06 Sep 2003) | 3 lines Changed paths: M /trunk/scm/Makefile.am * Do not distribute xlib.scm if X11 support wasn't found. * Ditto for motif.scm, xaw.scm and xwidgets.scm. ------------------------------------------------------------------------ r100 | sam | 2003-09-06 13:15:57 +0200 (Sat, 06 Sep 2003) | 2 lines Changed paths: M /trunk/configure.ac M /trunk/lib/xlib/Makefile.am M /trunk/lib/xwidgets/Makefile.am M /trunk/lib/xwidgets/motif/Makefile.am M /trunk/lib/xwidgets/xaw/Makefile.am * Added autoconf checks for -lgdbm, X11, Xaw and Motif. ------------------------------------------------------------------------ r99 | sam | 2003-09-06 04:33:10 +0200 (Sat, 06 Sep 2003) | 2 lines Changed paths: M /trunk/configure.ac M /trunk/include/extern.h M /trunk/src/error.c M /trunk/src/exception.c M /trunk/src/libelk.c M /trunk/src/proc.c M /trunk/src/read.c * Don't use __attribute__ if not using GNU C. ------------------------------------------------------------------------ r98 | sam | 2003-09-06 04:17:09 +0200 (Sat, 06 Sep 2003) | 2 lines Changed paths: M /trunk/configure.ac M /trunk/lib/misc/Makefile.am M /trunk/scm/Makefile.am * Don't build gdbm.so if libgdbm isn't found. ------------------------------------------------------------------------ r97 | sam | 2003-09-06 03:57:13 +0200 (Sat, 06 Sep 2003) | 2 lines Changed paths: M /trunk/configure.ac M /trunk/lib/misc/Makefile.am * Don't compile newhandler.cpp if no C++ compiler is present. ------------------------------------------------------------------------ r96 | sam | 2003-09-04 17:46:19 +0200 (Thu, 04 Sep 2003) | 2 lines Changed paths: M /trunk/debian/Makefile.am D /trunk/debian/README.Debian * Removed debian/README.Debian. File locations are no longer debian-related. ------------------------------------------------------------------------ r95 | sam | 2003-09-04 17:42:28 +0200 (Thu, 04 Sep 2003) | 2 lines Changed paths: M /trunk/lib/xwidgets/mkwidget.scm * Removed ALIASES-related stuff. We're in the XXIst century, dudes. ------------------------------------------------------------------------ r94 | sam | 2003-09-04 17:33:02 +0200 (Thu, 04 Sep 2003) | 2 lines Changed paths: M /trunk/doc/util/mkindex.c * Fixed some K&R stuff in mkindex.c. ------------------------------------------------------------------------ r93 | sam | 2003-09-04 17:30:04 +0200 (Thu, 04 Sep 2003) | 2 lines Changed paths: M /trunk/lib/xwidgets/accelerator.c M /trunk/lib/xwidgets/action.c M /trunk/lib/xwidgets/callback.c M /trunk/lib/xwidgets/class.c M /trunk/lib/xwidgets/classname.c M /trunk/lib/xwidgets/context.c M /trunk/lib/xwidgets/converter.c M /trunk/lib/xwidgets/function.c M /trunk/lib/xwidgets/identifier.c M /trunk/lib/xwidgets/mkwidget.scm M /trunk/lib/xwidgets/motif/init.c M /trunk/lib/xwidgets/motif/list.d M /trunk/lib/xwidgets/motif/row-column.d M /trunk/lib/xwidgets/motif/scale.d M /trunk/lib/xwidgets/motif/scroll-bar.d M /trunk/lib/xwidgets/motif/support.d M /trunk/lib/xwidgets/popup.c M /trunk/lib/xwidgets/resource.c M /trunk/lib/xwidgets/translation.c M /trunk/lib/xwidgets/widget.c M /trunk/lib/xwidgets/xaw/grip.d M /trunk/lib/xwidgets/xaw/init.c M /trunk/lib/xwidgets/xaw/list.d M /trunk/lib/xwidgets/xaw/stripchart.d M /trunk/lib/xwidgets/xterror.c M /trunk/lib/xwidgets/xtinit.c M /trunk/lib/xwidgets/xtobjects.c * Muahaha! No more friggin K&R stuff! ------------------------------------------------------------------------ r92 | sam | 2003-09-04 16:33:43 +0200 (Thu, 04 Sep 2003) | 2 lines Changed paths: M /trunk/src/io.c M /trunk/src/terminate.c * Some bloody K&R function definition were missing. ------------------------------------------------------------------------ r91 | sam | 2003-09-04 16:32:13 +0200 (Thu, 04 Sep 2003) | 3 lines Changed paths: M /trunk/lib/xlib/client.c M /trunk/lib/xlib/color.c M /trunk/lib/xlib/colormap.c M /trunk/lib/xlib/cursor.c M /trunk/lib/xlib/display.c M /trunk/lib/xlib/event.c M /trunk/lib/xlib/extension.c M /trunk/lib/xlib/font.c M /trunk/lib/xlib/gcontext.c M /trunk/lib/xlib/grab.c M /trunk/lib/xlib/graphics.c M /trunk/lib/xlib/key.c M /trunk/lib/xlib/pixel.c M /trunk/lib/xlib/pixmap.c M /trunk/lib/xlib/property.c M /trunk/lib/xlib/text.c M /trunk/lib/xlib/type.c M /trunk/lib/xlib/util.c M /trunk/lib/xlib/window.c M /trunk/lib/xlib/wm.c M /trunk/lib/xlib/xerror.c M /trunk/lib/xlib/xinit.c M /trunk/lib/xlib/xlib.h M /trunk/lib/xlib/xobjects.c * Fixed compilation warnings. * Removed fucking K&R syntax. ------------------------------------------------------------------------ r90 | sam | 2003-09-04 16:30:21 +0200 (Thu, 04 Sep 2003) | 2 lines Changed paths: M /trunk/lib/misc/gdbm.c M /trunk/lib/unix/process.c M /trunk/lib/unix/wait.c * Fixed remaining K&R shit. ------------------------------------------------------------------------ r89 | sam | 2003-09-04 15:29:16 +0200 (Thu, 04 Sep 2003) | 2 lines Changed paths: M /trunk/lib/unix/error.c M /trunk/lib/unix/fdescr.c M /trunk/lib/unix/file.c M /trunk/lib/unix/lock.c M /trunk/lib/unix/misc.c M /trunk/lib/unix/passwd.c M /trunk/lib/unix/process.c M /trunk/lib/unix/signal.c M /trunk/lib/unix/system.c M /trunk/lib/unix/temp.c M /trunk/lib/unix/time.c M /trunk/lib/unix/unix.c M /trunk/lib/unix/wait.c * Fucking K&R syntax! ------------------------------------------------------------------------ r88 | sam | 2003-09-04 14:46:44 +0200 (Thu, 04 Sep 2003) | 3 lines Changed paths: M /trunk/examples/Makefile.am A /trunk/examples/motif (from /trunk/examples/xm:84) M /trunk/examples/motif/drawing-area.scm M /trunk/examples/motif/list.scm M /trunk/examples/motif/main-window.scm M /trunk/examples/motif/message-dialog.scm M /trunk/examples/motif/option-menu.scm M /trunk/examples/motif/popup-menu.scm M /trunk/examples/motif/pulldown-menu.scm M /trunk/examples/motif/radio.scm M /trunk/examples/motif/scroll-bar.scm M /trunk/examples/motif/selection-box.scm M /trunk/examples/motif/vcr.scm M /trunk/examples/xaw/accel.scm M /trunk/examples/xaw/clickcount.scm M /trunk/examples/xaw/dialog.scm M /trunk/examples/xaw/grip.scm M /trunk/examples/xaw/list.scm M /trunk/examples/xaw/paned.scm M /trunk/examples/xaw/panner.scm M /trunk/examples/xaw/popup.scm M /trunk/examples/xaw/porthole.scm M /trunk/examples/xaw/pulldown.scm M /trunk/examples/xaw/scrollbar.scm M /trunk/examples/xaw/scrollbox.scm M /trunk/examples/xaw/stripchart.scm M /trunk/examples/xaw/text.scm M /trunk/examples/xaw/tree.scm M /trunk/examples/xaw/viewport.scm D /trunk/examples/xm * Renamed examples/xm into examples/motif. * Fixed example files so that they fit with the new xaw.scm and motif.scm. ------------------------------------------------------------------------ r87 | sam | 2003-09-04 14:45:48 +0200 (Thu, 04 Sep 2003) | 2 lines Changed paths: M /trunk/scm/motif.scm M /trunk/scm/xaw.scm M /trunk/scm/xlib.scm M /trunk/scm/xwidgets.scm * Beautified xaw and motif Scheme files. ------------------------------------------------------------------------ r86 | sam | 2003-09-04 14:45:17 +0200 (Thu, 04 Sep 2003) | 2 lines Changed paths: D /trunk/src/build * Removed unused obsolete build file. ------------------------------------------------------------------------ r85 | sam | 2003-09-04 14:44:54 +0200 (Thu, 04 Sep 2003) | 3 lines Changed paths: M /trunk/lib/xwidgets/Makefile.am M /trunk/lib/xwidgets/motif/Makefile.am A /trunk/lib/xwidgets/motif/init.c M /trunk/lib/xwidgets/xaw/Makefile.am A /trunk/lib/xwidgets/xaw/init.c * Renamed xaw-common.so to xaw-xt.so and motif-common.so to motif-xt.so. * Added init.c to xaw-xt.so and motif-xt.so for proper initialisation. ------------------------------------------------------------------------ r84 | sam | 2003-09-04 13:26:55 +0200 (Thu, 04 Sep 2003) | 2 lines Changed paths: M /trunk/lib/misc/bitstring.c M /trunk/lib/misc/gdbm.c M /trunk/lib/misc/hack.c M /trunk/lib/misc/record.c M /trunk/lib/misc/regexp.c M /trunk/lib/misc/struct.c M /trunk/lib/unix/unix.c M /trunk/lib/xlib/xinit.c M /trunk/lib/xwidgets/xtinit.c * Provide foo.so, not foo.o. ------------------------------------------------------------------------ r83 | sam | 2003-09-04 13:26:39 +0200 (Thu, 04 Sep 2003) | 2 lines Changed paths: M /trunk/lib/xwidgets/Makefile.am M /trunk/lib/xwidgets/mkwidget.scm M /trunk/lib/xwidgets/motif/Makefile.am M /trunk/lib/xwidgets/xaw/Makefile.am * Cosmetic fixes. ------------------------------------------------------------------------ r82 | sam | 2003-09-04 12:40:16 +0200 (Thu, 04 Sep 2003) | 2 lines Changed paths: M /trunk/scm/Makefile.am D /trunk/scm/xt.scm A /trunk/scm/xwidgets.scm (from /trunk/scm/xt.scm:81) * Renamed xt.scm to xwidgets.scm. ------------------------------------------------------------------------ r81 | sam | 2003-09-04 12:39:47 +0200 (Thu, 04 Sep 2003) | 2 lines Changed paths: M /trunk/scm/Makefile.am A /trunk/scm/xaw.scm (from /trunk/scm/xwidgets.scm:72) M /trunk/scm/xt.scm D /trunk/scm/xwidgets.scm * Renamed xwidgets.scm to xaw.scm. ------------------------------------------------------------------------ r80 | sam | 2003-09-04 11:28:57 +0200 (Thu, 04 Sep 2003) | 2 lines Changed paths: M /trunk/lib/xwidgets/motif/Makefile.am * Forgot a small xm/motif fix. ------------------------------------------------------------------------ r79 | sam | 2003-09-04 11:23:22 +0200 (Thu, 04 Sep 2003) | 2 lines Changed paths: M /trunk/configure.ac M /trunk/lib/xlib/client.c M /trunk/lib/xlib/color.c M /trunk/lib/xwidgets/Makefile.am M /trunk/lib/xwidgets/mkwidget.scm A /trunk/lib/xwidgets/motif (from /trunk/lib/xwidgets/xm:78) D /trunk/lib/xwidgets/xm * Re-renamed xm to motif (SVN rules). ------------------------------------------------------------------------ r78 | sam | 2003-09-04 00:59:20 +0200 (Thu, 04 Sep 2003) | 2 lines Changed paths: M /trunk/configure.ac M /trunk/lib/xwidgets/Makefile.am M /trunk/lib/xwidgets/mkwidget.scm D /trunk/lib/xwidgets/motif A /trunk/lib/xwidgets/xm (from /trunk/lib/xwidgets/motif:77) M /trunk/lib/xwidgets/xm/Makefile.am * Changed motif back to xm. ------------------------------------------------------------------------ r77 | sam | 2003-09-04 00:56:02 +0200 (Thu, 04 Sep 2003) | 2 lines Changed paths: D /trunk/lib/xwidgets/Include.am M /trunk/lib/xwidgets/Makefile.am M /trunk/lib/xwidgets/mkwidget.scm M /trunk/lib/xwidgets/motif/Makefile.am M /trunk/lib/xwidgets/xaw/Makefile.am * Rebuild everything properly. ------------------------------------------------------------------------ r76 | sam | 2003-09-04 00:00:01 +0200 (Thu, 04 Sep 2003) | 2 lines Changed paths: M /trunk/configure.ac M /trunk/lib/Makefile.am D /trunk/lib/xaw D /trunk/lib/xm D /trunk/lib/xt A /trunk/lib/xwidgets (from /trunk/lib/xt:75) M /trunk/lib/xwidgets/Makefile.am A /trunk/lib/xwidgets/motif (from /trunk/lib/xm:75) A /trunk/lib/xwidgets/xaw (from /trunk/lib/xaw:75) * Moved some directories. ------------------------------------------------------------------------ r75 | sam | 2003-09-03 02:51:27 +0200 (Wed, 03 Sep 2003) | 2 lines Changed paths: M /trunk/debian/changelog M /trunk/debian/control M /trunk/debian/rules * Fixed packaging. ------------------------------------------------------------------------ r74 | sam | 2003-09-03 02:05:48 +0200 (Wed, 03 Sep 2003) | 2 lines Changed paths: M /trunk/configure.ac * Removed useless line in configure.ac. ------------------------------------------------------------------------ r73 | sam | 2003-09-03 02:01:26 +0200 (Wed, 03 Sep 2003) | 2 lines Changed paths: M /trunk/Makefile.am D /trunk/util * Scrapped util. ------------------------------------------------------------------------ r72 | sam | 2003-09-03 01:53:31 +0200 (Wed, 03 Sep 2003) | 2 lines Changed paths: D /trunk/lib/xaw/clock.d * Removed obsolete file. ------------------------------------------------------------------------ r71 | sam | 2003-09-03 01:53:22 +0200 (Wed, 03 Sep 2003) | 2 lines Changed paths: M /trunk/Makefile.am M /trunk/doc/bitstring/Makefile.am M /trunk/doc/cprog/Makefile.am M /trunk/doc/kernel/Makefile.am M /trunk/doc/man/Makefile.am M /trunk/doc/oops/Makefile.am M /trunk/doc/record/Makefile.am M /trunk/doc/regexp/Makefile.am M /trunk/doc/unix/Makefile.am M /trunk/doc/usenix/Makefile.am M /trunk/doc/util/Makefile.am M /trunk/doc/xlib/Makefile.am M /trunk/doc/xt/Makefile.am M /trunk/src/Makefile.am * Fixed make dist. ------------------------------------------------------------------------ r70 | sam | 2003-09-03 01:37:49 +0200 (Wed, 03 Sep 2003) | 2 lines Changed paths: M /trunk/scm/xwidgets.scm * Fixed xwidgets.scm to work with xm.so. ------------------------------------------------------------------------ r69 | sam | 2003-09-03 01:23:17 +0200 (Wed, 03 Sep 2003) | 2 lines Changed paths: M /trunk/examples/c++/class.cpp M /trunk/examples/c++/constructor.cpp * Updated examples (compilation flags, coding style) ------------------------------------------------------------------------ r68 | sam | 2003-09-02 11:54:47 +0200 (Tue, 02 Sep 2003) | 2 lines Changed paths: M /trunk/util/alloca.c * Fuck K&R ! ------------------------------------------------------------------------ r67 | sam | 2003-09-02 11:51:35 +0200 (Tue, 02 Sep 2003) | 2 lines Changed paths: M /trunk/lib/unix/error.c M /trunk/lib/unix/fdescr.c M /trunk/lib/unix/file.c M /trunk/lib/unix/lock.c M /trunk/lib/unix/misc.c M /trunk/lib/unix/passwd.c M /trunk/lib/unix/process.c M /trunk/lib/unix/signal.c M /trunk/lib/unix/system.c M /trunk/lib/unix/temp.c M /trunk/lib/unix/time.c M /trunk/lib/unix/unix.c M /trunk/lib/unix/unix.h M /trunk/lib/unix/wait.c M /trunk/lib/xaw/ascii.d M /trunk/lib/xaw/box.d M /trunk/lib/xaw/clock.d M /trunk/lib/xaw/command.d M /trunk/lib/xaw/dialog.d M /trunk/lib/xaw/form.d M /trunk/lib/xaw/grip.d M /trunk/lib/xaw/label.d M /trunk/lib/xaw/list.d M /trunk/lib/xaw/menubutton.d M /trunk/lib/xaw/paned.d M /trunk/lib/xaw/panner.d M /trunk/lib/xaw/porthole.d M /trunk/lib/xaw/repeater.d M /trunk/lib/xaw/scrollbar.d M /trunk/lib/xaw/shell.d M /trunk/lib/xaw/simplemenu.d M /trunk/lib/xaw/sme.d M /trunk/lib/xaw/smebsb.d M /trunk/lib/xaw/smeline.d M /trunk/lib/xaw/stripchart.d M /trunk/lib/xaw/toggle.d M /trunk/lib/xaw/tree.d M /trunk/lib/xaw/viewport.d M /trunk/lib/xlib/client.c M /trunk/lib/xlib/color.c M /trunk/lib/xlib/colormap.c M /trunk/lib/xlib/cursor.c M /trunk/lib/xlib/display.c M /trunk/lib/xlib/event.c M /trunk/lib/xlib/extension.c M /trunk/lib/xlib/font.c M /trunk/lib/xlib/gcontext.c M /trunk/lib/xlib/grab.c M /trunk/lib/xlib/graphics.c M /trunk/lib/xlib/key.c M /trunk/lib/xlib/pixel.c M /trunk/lib/xlib/pixmap.c M /trunk/lib/xlib/property.c M /trunk/lib/xlib/text.c M /trunk/lib/xlib/type.c M /trunk/lib/xlib/util.c M /trunk/lib/xlib/window.c M /trunk/lib/xlib/wm.c M /trunk/lib/xlib/xerror.c M /trunk/lib/xlib/xinit.c M /trunk/lib/xlib/xlib.h M /trunk/lib/xlib/xobjects.c M /trunk/lib/xm/arrow-button.d M /trunk/lib/xm/bulletin-brd.d M /trunk/lib/xm/cascade-btn.d M /trunk/lib/xm/command.d M /trunk/lib/xm/drawing-area.d M /trunk/lib/xm/drawn-button.d M /trunk/lib/xm/file-selectn.d M /trunk/lib/xm/form.d M /trunk/lib/xm/frame.d M /trunk/lib/xm/label.d M /trunk/lib/xm/list.d M /trunk/lib/xm/main-window.d M /trunk/lib/xm/message-box.d M /trunk/lib/xm/paned-window.d M /trunk/lib/xm/push-button.d M /trunk/lib/xm/row-column.d M /trunk/lib/xm/scale.d M /trunk/lib/xm/scroll-bar.d M /trunk/lib/xm/scrolled-win.d M /trunk/lib/xm/selectn-box.d M /trunk/lib/xm/separator.d M /trunk/lib/xm/shell.d M /trunk/lib/xm/support.d M /trunk/lib/xm/text.d M /trunk/lib/xm/toggle-btn.d M /trunk/lib/xt/accelerator.c M /trunk/lib/xt/action.c M /trunk/lib/xt/callback.c M /trunk/lib/xt/class.c M /trunk/lib/xt/classname.c M /trunk/lib/xt/context.c M /trunk/lib/xt/converter.c M /trunk/lib/xt/function.c M /trunk/lib/xt/identifier.c M /trunk/lib/xt/popup.c M /trunk/lib/xt/resource.c M /trunk/lib/xt/translation.c M /trunk/lib/xt/widget.c M /trunk/lib/xt/xt.h M /trunk/lib/xt/xterror.c M /trunk/lib/xt/xtinit.c M /trunk/lib/xt/xtobjects.c * Added proper license information in all files and set the $Id property. ------------------------------------------------------------------------ r66 | sam | 2003-09-02 10:12:11 +0200 (Tue, 02 Sep 2003) | 2 lines Changed paths: M /trunk/doc/util/mkindex.c M /trunk/examples/c++/class.cpp M /trunk/include/cstring.h M /trunk/include/exception.h M /trunk/include/gc.h M /trunk/include/misc.h M /trunk/include/object.h M /trunk/include/stkmem.h M /trunk/include/type.h M /trunk/lib/misc/bitstring.c M /trunk/lib/misc/elk-eval.c M /trunk/lib/misc/gdbm.c M /trunk/lib/misc/hack.c M /trunk/lib/misc/monitor.c M /trunk/lib/misc/record.c M /trunk/lib/misc/regexp.c M /trunk/lib/misc/struct.c M /trunk/lib/unix/error.c M /trunk/lib/unix/fdescr.c M /trunk/lib/unix/file.c M /trunk/lib/unix/lock.c M /trunk/lib/unix/misc.c M /trunk/lib/unix/passwd.c M /trunk/lib/unix/process.c M /trunk/lib/unix/signal.c M /trunk/lib/unix/system.c M /trunk/lib/unix/temp.c M /trunk/lib/unix/time.c M /trunk/lib/unix/unix.c M /trunk/lib/unix/unix.h M /trunk/lib/unix/wait.c M /trunk/lib/xlib/client.c M /trunk/lib/xlib/color.c M /trunk/lib/xlib/colormap.c M /trunk/lib/xlib/cursor.c M /trunk/lib/xlib/display.c M /trunk/lib/xlib/event.c M /trunk/lib/xlib/extension.c M /trunk/lib/xlib/font.c M /trunk/lib/xlib/gcontext.c M /trunk/lib/xlib/grab.c M /trunk/lib/xlib/graphics.c M /trunk/lib/xlib/key.c M /trunk/lib/xlib/pixel.c M /trunk/lib/xlib/pixmap.c M /trunk/lib/xlib/property.c M /trunk/lib/xlib/text.c M /trunk/lib/xlib/type.c M /trunk/lib/xlib/util.c M /trunk/lib/xlib/window.c M /trunk/lib/xlib/wm.c M /trunk/lib/xlib/xerror.c M /trunk/lib/xlib/xinit.c M /trunk/lib/xlib/xlib.h M /trunk/lib/xlib/xobjects.c M /trunk/lib/xt/accelerator.c M /trunk/lib/xt/action.c M /trunk/lib/xt/callback.c M /trunk/lib/xt/class.c M /trunk/lib/xt/classname.c M /trunk/lib/xt/context.c M /trunk/lib/xt/converter.c M /trunk/lib/xt/function.c M /trunk/lib/xt/identifier.c M /trunk/lib/xt/popup.c M /trunk/lib/xt/resource.c M /trunk/lib/xt/translation.c M /trunk/lib/xt/widget.c M /trunk/lib/xt/xt.h M /trunk/lib/xt/xterror.c M /trunk/lib/xt/xtinit.c M /trunk/lib/xt/xtobjects.c M /trunk/src/autoload.c M /trunk/src/bignum.c M /trunk/src/bool.c M /trunk/src/char.c M /trunk/src/cont.c M /trunk/src/cstring.c M /trunk/src/debug.c M /trunk/src/dump-ecoff.c M /trunk/src/dump-elf.c M /trunk/src/dump-hp9k.c M /trunk/src/dump-vanilla.c M /trunk/src/dump.c M /trunk/src/env.c M /trunk/src/error.c M /trunk/src/exception.c M /trunk/src/feature.c M /trunk/src/heap-gen.c M /trunk/src/heap-sc.c M /trunk/src/heap.c M /trunk/src/io.c M /trunk/src/libelk.c M /trunk/src/list.c M /trunk/src/load-dl.c M /trunk/src/load-ld.c M /trunk/src/load-rld.c M /trunk/src/load-shl.c M /trunk/src/load.c M /trunk/src/malloc.c M /trunk/src/math.c M /trunk/src/onfork.c M /trunk/src/prim.c M /trunk/src/print.c M /trunk/src/proc.c M /trunk/src/promise.c M /trunk/src/read.c M /trunk/src/special.c M /trunk/src/stab-bsd.c M /trunk/src/stab-coff.c M /trunk/src/stab-convex.c M /trunk/src/stab-ecoff.c M /trunk/src/stab-elf.c M /trunk/src/stab-hp9k300.c M /trunk/src/stab-hp9k800.c M /trunk/src/stab-macho.c M /trunk/src/stab.c M /trunk/src/stkmem.c M /trunk/src/string.c M /trunk/src/symbol.c M /trunk/src/terminate.c M /trunk/src/type.c M /trunk/src/vector.c * No TABS !! ------------------------------------------------------------------------ r65 | sam | 2003-09-01 19:06:43 +0200 (Mon, 01 Sep 2003) | 3 lines Changed paths: M /trunk/lib/misc/bitstring.c M /trunk/lib/misc/debug.c M /trunk/lib/misc/elk-eval.c M /trunk/lib/misc/gdbm.c M /trunk/lib/misc/hack.c M /trunk/lib/misc/monitor.c M /trunk/lib/misc/record.c M /trunk/lib/misc/regexp.c M /trunk/lib/misc/struct.c * Added $Id and copyright information to all .c files in lib/misc/ * Fixed old shitty K&R syntax. ------------------------------------------------------------------------ r64 | sam | 2003-08-30 18:47:54 +0200 (Sat, 30 Aug 2003) | 2 lines Changed paths: M /trunk/include/compat.h M /trunk/include/cstring.h M /trunk/include/exception.h M /trunk/include/extern.h M /trunk/include/funcproto.h M /trunk/include/gc.h M /trunk/include/intern.h M /trunk/include/kernel.h M /trunk/include/misc.h M /trunk/include/object.h M /trunk/include/param.h M /trunk/include/scheme.h M /trunk/include/stkmem.h M /trunk/include/type.h M /trunk/src/autoload.c M /trunk/src/bignum.c M /trunk/src/bool.c M /trunk/src/char.c M /trunk/src/cont.c M /trunk/src/cstring.c M /trunk/src/debug.c M /trunk/src/dump-ecoff.c M /trunk/src/dump-elf.c M /trunk/src/dump-hp9k.c M /trunk/src/dump-vanilla.c M /trunk/src/dump.c M /trunk/src/env.c M /trunk/src/error.c M /trunk/src/exception.c M /trunk/src/feature.c M /trunk/src/heap-gen.c M /trunk/src/heap-sc.c M /trunk/src/heap.c M /trunk/src/io.c M /trunk/src/libelk.c M /trunk/src/list.c M /trunk/src/load-dl.c M /trunk/src/load-ld.c M /trunk/src/load-rld.c M /trunk/src/load-shl.c M /trunk/src/load.c M /trunk/src/main.c M /trunk/src/malloc.c M /trunk/src/math.c M /trunk/src/onfork.c M /trunk/src/prim.c M /trunk/src/print.c M /trunk/src/proc.c M /trunk/src/promise.c M /trunk/src/read.c M /trunk/src/special.c M /trunk/src/stab-bsd.c M /trunk/src/stab-coff.c M /trunk/src/stab-convex.c M /trunk/src/stab-ecoff.c M /trunk/src/stab-elf.c M /trunk/src/stab-hp9k300.c M /trunk/src/stab-hp9k800.c M /trunk/src/stab-macho.c M /trunk/src/stab.c M /trunk/src/stkmem.c M /trunk/src/string.c M /trunk/src/symbol.c M /trunk/src/terminate.c M /trunk/src/type.c M /trunk/src/vector.c * Added $Id and copyright information to all .c and .h files in the kernel. ------------------------------------------------------------------------ r63 | sam | 2003-08-30 18:16:52 +0200 (Sat, 30 Aug 2003) | 2 lines Changed paths: M /trunk/AUTHORS M /trunk/BUGS M /trunk/INSTALL M /trunk/MACHINES M /trunk/MIGRATE M /trunk/README M /trunk/TODO M /trunk/configure.ac * Fixed the $Id stuff. ------------------------------------------------------------------------ r62 | sam | 2003-08-30 18:16:40 +0200 (Sat, 30 Aug 2003) | 2 lines Changed paths: M /trunk/NEWS * Redid the layout of the NEWS file. ------------------------------------------------------------------------ r61 | sam | 2003-08-30 18:07:52 +0200 (Sat, 30 Aug 2003) | 4 lines Changed paths: M /trunk/AUTHORS M /trunk/BUGS M /trunk/INSTALL M /trunk/MACHINES M /trunk/MIGRATE M /trunk/NEWS M /trunk/README D /trunk/ROADMAP M /trunk/TODO * Added $Id tags to the root documentation files. * Merged ROADMAP into README. * Prepared 4.0 here and there. ------------------------------------------------------------------------ r60 | sam | 2003-08-28 11:40:34 +0200 (Thu, 28 Aug 2003) | 2 lines Changed paths: M /trunk/lib/xaw/Makefile.am M /trunk/lib/xlib/Makefile.am M /trunk/lib/xm/Makefile.am M /trunk/lib/xt/Makefile.am * Use XAW_LIBS etc. to build plugins. ------------------------------------------------------------------------ r59 | sam | 2003-08-28 11:39:36 +0200 (Thu, 28 Aug 2003) | 6 lines Changed paths: M /trunk/debian/Makefile.am A /trunk/debian/elkdoc.dirs M /trunk/debian/rules * debian/Makefile.am: + Distribute more debian/* files. * debian/rules: + No longer use dh_installexamples, since the package does it for us. + Ditto for dh_installman. ------------------------------------------------------------------------ r58 | sam | 2003-08-28 11:38:08 +0200 (Thu, 28 Aug 2003) | 2 lines Changed paths: D /trunk/lib/xaw/Makefile * Removed a legacy Makefile. ------------------------------------------------------------------------ r57 | sam | 2003-08-27 10:27:15 +0200 (Wed, 27 Aug 2003) | 2 lines Changed paths: M /trunk/Makefile.am * Recurse into doc/ and examples/ during the build. ------------------------------------------------------------------------ r56 | sam | 2003-08-27 03:17:40 +0200 (Wed, 27 Aug 2003) | 4 lines Changed paths: M /trunk/configure.ac * configure.ac: + Generate the doc/* Makefiles. + Export XAW_LIBS and so on to the Makefiles. ------------------------------------------------------------------------ r55 | sam | 2003-08-27 03:15:32 +0200 (Wed, 27 Aug 2003) | 2 lines Changed paths: M /trunk/doc/Makefile.am M /trunk/doc/bitstring D /trunk/doc/bitstring/Makefile A /trunk/doc/bitstring/Makefile.am M /trunk/doc/cprog D /trunk/doc/cprog/Makefile A /trunk/doc/cprog/Makefile.am M /trunk/doc/kernel D /trunk/doc/kernel/Makefile A /trunk/doc/kernel/Makefile.am M /trunk/doc/man D /trunk/doc/man/Makefile A /trunk/doc/man/Makefile.am D /trunk/doc/man/scheme.1 M /trunk/doc/oops D /trunk/doc/oops/Makefile A /trunk/doc/oops/Makefile.am M /trunk/doc/record D /trunk/doc/record/Makefile A /trunk/doc/record/Makefile.am M /trunk/doc/regexp D /trunk/doc/regexp/Makefile A /trunk/doc/regexp/Makefile.am M /trunk/doc/unix D /trunk/doc/unix/Makefile A /trunk/doc/unix/Makefile.am M /trunk/doc/usenix D /trunk/doc/usenix/Makefile A /trunk/doc/usenix/Makefile.am M /trunk/doc/util D /trunk/doc/util/Makefile A /trunk/doc/util/Makefile.am M /trunk/doc/xlib D /trunk/doc/xlib/Makefile A /trunk/doc/xlib/Makefile.am M /trunk/doc/xt D /trunk/doc/xt/Makefile A /trunk/doc/xt/Makefile.am * Beginning of the autoconfiscation of the documentation. ------------------------------------------------------------------------ r54 | sam | 2003-08-27 03:13:53 +0200 (Wed, 27 Aug 2003) | 2 lines Changed paths: M /trunk/scm/Makefile.am * Do not forget to distribute our .scm files with the tarball. ------------------------------------------------------------------------ r53 | sam | 2003-08-27 03:13:02 +0200 (Wed, 27 Aug 2003) | 2 lines Changed paths: M /trunk/examples/Makefile.am * Added the example files to both the distribution and the installed doc. ------------------------------------------------------------------------ r52 | sam | 2003-08-27 03:11:36 +0200 (Wed, 27 Aug 2003) | 2 lines Changed paths: M /trunk/examples/c++/class.cpp M /trunk/examples/c++/constructor.cpp * Fixed build instructions for the C++ examples. ------------------------------------------------------------------------ r51 | sam | 2003-08-27 01:45:30 +0200 (Wed, 27 Aug 2003) | 2 lines Changed paths: M /trunk/lib/xm/Makefile.am M /trunk/lib/xt/Makefile.am * Removed subdirs-objects, it was causing `make distclean' to fail. ------------------------------------------------------------------------ r50 | sam | 2003-08-27 01:30:22 +0200 (Wed, 27 Aug 2003) | 2 lines Changed paths: M /trunk/lib/xt/Include.am D /trunk/lib/xt/error.c D /trunk/lib/xt/init.c D /trunk/lib/xt/objects.c A /trunk/lib/xt/xterror.c (from /trunk/lib/xt/error.c:48) A /trunk/lib/xt/xtinit.c (from /trunk/lib/xt/init.c:48) A /trunk/lib/xt/xtobjects.c (from /trunk/lib/xt/objects.c:48) * Renamed files in xt/ that collided with files in xlib/. ------------------------------------------------------------------------ r49 | sam | 2003-08-27 01:29:14 +0200 (Wed, 27 Aug 2003) | 2 lines Changed paths: M /trunk/lib/xlib/Include.am D /trunk/lib/xlib/error.c D /trunk/lib/xlib/init.c D /trunk/lib/xlib/objects.c A /trunk/lib/xlib/xerror.c (from /trunk/lib/xlib/error.c:48) A /trunk/lib/xlib/xinit.c (from /trunk/lib/xlib/init.c:48) A /trunk/lib/xlib/xobjects.c (from /trunk/lib/xlib/objects.c:48) * Renamed files in xlib/ that collided with files in xt/. ------------------------------------------------------------------------ r48 | sam | 2003-08-25 20:28:02 +0200 (Mon, 25 Aug 2003) | 2 lines Changed paths: M /trunk/configure.ac M /trunk/examples/xm/drawing-area.scm M /trunk/lib/Makefile.am M /trunk/lib/xaw M /trunk/lib/xaw/Makefile A /trunk/lib/xaw/Makefile.am D /trunk/lib/xaw/build M /trunk/lib/xlib A /trunk/lib/xlib/Include.am M /trunk/lib/xlib/Makefile.am M /trunk/lib/xm D /trunk/lib/xm/Makefile A /trunk/lib/xm/Makefile.am D /trunk/lib/xm/build D /trunk/lib/xm/xt M /trunk/lib/xt A /trunk/lib/xt/Include.am D /trunk/lib/xt/Makefile A /trunk/lib/xt/Makefile.am D /trunk/lib/xt/build M /trunk/scm M /trunk/scm/xt.scm M /trunk/scm/xwidgets.scm * Fixed the build process for all extensions. ------------------------------------------------------------------------ r47 | sam | 2003-08-25 20:14:21 +0200 (Mon, 25 Aug 2003) | 3 lines Changed paths: M /trunk/scm/slib.scm.in M /trunk/scm/xlib.scm M /trunk/scm/xt.scm M /trunk/scm/xwidgets.scm * scm/slib.scm.in: version information is set a build time. * scm/*.scm: don't choke on -lib- variables that aren't needed. ------------------------------------------------------------------------ r46 | sam | 2003-08-25 19:09:12 +0200 (Mon, 25 Aug 2003) | 2 lines Changed paths: M /trunk/configure.ac D /trunk/debian/elk.ini M /trunk/debian/rules M /trunk/scm/Makefile.am A /trunk/scm/slib.scm.in * Moved debian/elk.ini to scm/slib.scm.in, generated by ./configure. ------------------------------------------------------------------------ r45 | sam | 2003-08-25 18:29:54 +0200 (Mon, 25 Aug 2003) | 2 lines Changed paths: M /trunk/Makefile.am M /trunk/configure.ac M /trunk/lib/Makefile.am M /trunk/lib/xlib D /trunk/lib/xlib/Makefile A /trunk/lib/xlib/Makefile.am D /trunk/lib/xlib/build * The Xlib plugin properly builds. ------------------------------------------------------------------------ r44 | sam | 2003-08-25 18:20:44 +0200 (Mon, 25 Aug 2003) | 7 lines Changed paths: M /trunk/debian/control D /trunk/debian/dirs M /trunk/debian/menu * debian/control: + Set policy to 3.6.1.0. * debian/dirs: + Removed that file. * debian/menu: + Changed `scheme-elk' to `elk'. ------------------------------------------------------------------------ r43 | sam | 2003-08-25 18:00:50 +0200 (Mon, 25 Aug 2003) | 3 lines Changed paths: M /trunk/configure.ac M /trunk/include/Makefile.am M /trunk/lib/unix D /trunk/lib/unix/Makefile A /trunk/lib/unix/Makefile.am D /trunk/lib/unix/build * Distribute headers in /usr/include/elk. * Build the Unix plugin. ------------------------------------------------------------------------ r42 | sam | 2003-08-25 17:59:18 +0200 (Mon, 25 Aug 2003) | 6 lines Changed paths: M /trunk/lib/misc/Makefile.am M /trunk/lib/misc/bitstring.c M /trunk/lib/misc/debug.c M /trunk/lib/misc/elk-eval.c M /trunk/lib/misc/gdbm.c M /trunk/lib/misc/hack.c M /trunk/lib/misc/monitor.c D /trunk/lib/misc/newhandler.c A /trunk/lib/misc/newhandler.cpp (from /trunk/lib/misc/newhandler.c:36) M /trunk/lib/misc/record.c M /trunk/lib/misc/regexp.c M /trunk/lib/misc/struct.c * Fixed warnings. * Renamed newhandler.c into newhandler.cpp. * Use the -module flag for plugins so that their name doesn't need to start with "lib". This is partly because libtool fucks up when a module is called "libgdbm.so" and there is also a lib with this name. ------------------------------------------------------------------------ r41 | sam | 2003-08-25 17:01:22 +0200 (Mon, 25 Aug 2003) | 2 lines Changed paths: M /trunk/configure.ac M /trunk/include/object.h M /trunk/src/dump.c M /trunk/src/heap-gen.c M /trunk/src/load.c M /trunk/src/math.c M /trunk/src/print.c M /trunk/src/stab.c * Fixed all compilation warnings in the base code. ------------------------------------------------------------------------ r40 | sam | 2003-08-25 16:47:40 +0200 (Mon, 25 Aug 2003) | 2 lines Changed paths: M /trunk/include/object.h * Use ptrdiff_t for address arithmetics. ------------------------------------------------------------------------ r39 | sam | 2003-08-25 16:35:56 +0200 (Mon, 25 Aug 2003) | 2 lines Changed paths: M /trunk/util/README D /trunk/util/getversion * Removed the useless util/getversion script. ------------------------------------------------------------------------ r38 | sam | 2003-08-25 16:35:03 +0200 (Mon, 25 Aug 2003) | 2 lines Changed paths: M /trunk/Makefile.am D /trunk/PATCHLEVEL M /trunk/ROADMAP M /trunk/debian/elk.docs * Removed the useless PATCHLEVEL file. ------------------------------------------------------------------------ r37 | sam | 2003-08-25 16:29:40 +0200 (Mon, 25 Aug 2003) | 2 lines Changed paths: M /trunk/src/bignum.c * src/bignum.c: Fixed some signed/unsigned comparisons. ------------------------------------------------------------------------ r36 | sam | 2003-08-25 16:17:09 +0200 (Mon, 25 Aug 2003) | 3 lines Changed paths: M /trunk/configure.ac M /trunk/include/intern.h M /trunk/include/stkmem.h M /trunk/lib/misc/regexp.c M /trunk/lib/unix/fdescr.c M /trunk/lib/unix/file.c M /trunk/lib/unix/process.c M /trunk/lib/unix/system.c M /trunk/lib/unix/temp.c M /trunk/lib/unix/time.c M /trunk/lib/unix/unix.h M /trunk/lib/unix/wait.c M /trunk/src/heap-gen.c M /trunk/src/io.c M /trunk/src/libelk.c M /trunk/src/math.c M /trunk/src/print.c * Added comments from the old config/ directory to configure.ac, and started changing all the AC_DEFINEs into proper autoconf checks. ------------------------------------------------------------------------ r35 | sam | 2003-08-25 15:03:52 +0200 (Mon, 25 Aug 2003) | 2 lines Changed paths: D /trunk/examples/c++/class.c A /trunk/examples/c++/class.cpp (from /trunk/examples/c++/class.c:34) D /trunk/examples/c++/constructor.c A /trunk/examples/c++/constructor.cpp (from /trunk/examples/c++/constructor.c:34) * Renamed *.c into *.cpp because this is C++. ------------------------------------------------------------------------ r34 | sam | 2003-08-25 15:02:45 +0200 (Mon, 25 Aug 2003) | 2 lines Changed paths: D /trunk/examples/CC A /trunk/examples/c++ (from /trunk/examples/CC:30) * Renamed CC into c++. ------------------------------------------------------------------------ r33 | sam | 2003-08-25 15:01:52 +0200 (Mon, 25 Aug 2003) | 2 lines Changed paths: M /trunk/examples/regexp/match.scm * siteinfo.scm is now deprecated. ------------------------------------------------------------------------ r32 | sam | 2003-08-25 15:00:27 +0200 (Mon, 25 Aug 2003) | 3 lines Changed paths: M /trunk/Makefile.am D /trunk/debian/ldflags-elk.1 D /trunk/debian/linkscheme.1 D /trunk/debian/makedl.1 D /trunk/debian/manpages M /trunk/debian/rules D /trunk/debian/scheme-elk.1 D /trunk/scripts * Removed all references to the utilities in script/ because we will be using libelk instead. ------------------------------------------------------------------------ r31 | sam | 2003-08-25 14:50:11 +0200 (Mon, 25 Aug 2003) | 4 lines Changed paths: M /trunk/scm M /trunk/scm/Makefile.am D /trunk/scm/build D /trunk/scm/build-siteinfo M /trunk/scm/xlib.scm M /trunk/scm/xt.scm * scm/Makefile.am: + Deprecated siteinfo.scm. + Distribute .scm files in /usr/share/elk. ------------------------------------------------------------------------ r30 | sam | 2003-08-25 14:41:09 +0200 (Mon, 25 Aug 2003) | 2 lines Changed paths: M /trunk/Makefile.am D /trunk/config * Removed the config/ directory; autoconf ought to do everything for us. ------------------------------------------------------------------------ r29 | sam | 2003-08-25 14:38:36 +0200 (Mon, 25 Aug 2003) | 2 lines Changed paths: M /trunk/configure.ac M /trunk/include M /trunk/include/Makefile.am D /trunk/include/build D /trunk/include/build-config * Moved the configuration macros from include/build-config to configure.ac. ------------------------------------------------------------------------ r28 | sam | 2003-08-25 14:20:01 +0200 (Mon, 25 Aug 2003) | 2 lines Changed paths: M /trunk/configure.ac M /trunk/debian/changelog M /trunk/debian/dirs M /trunk/debian/elkdoc.docs M /trunk/debian/rules M /trunk/lib/xaw/build M /trunk/lib/xm/build * Fixed the Debian package build. It now uses ./configure. ------------------------------------------------------------------------ r27 | sam | 2003-08-25 13:54:18 +0200 (Mon, 25 Aug 2003) | 2 lines Changed paths: M /trunk/configure.ac M /trunk/lib/Makefile.am M /trunk/lib/misc D /trunk/lib/misc/Makefile A /trunk/lib/misc/Makefile.am D /trunk/lib/misc/build M /trunk/src/Makefile.am * Plugins in misc/ now get compiled. ------------------------------------------------------------------------ r26 | sam | 2003-08-25 13:19:28 +0200 (Mon, 25 Aug 2003) | 2 lines Changed paths: M /trunk/debian/rules M /trunk/src/build * Removed the arch-config kludge. Will re-enable it later if necessary. ------------------------------------------------------------------------ r25 | sam | 2003-08-25 13:15:39 +0200 (Mon, 25 Aug 2003) | 4 lines Changed paths: M /trunk A /trunk/ChangeLog D /trunk/Makefile A /trunk/Makefile.am A /trunk/autotools A /trunk/autotools/Makefile.am A /trunk/bootstrap M /trunk/config A /trunk/config/Makefile.am A /trunk/configure.ac M /trunk/debian A /trunk/debian/Makefile.am M /trunk/doc A /trunk/doc/Makefile.am M /trunk/examples A /trunk/examples/Makefile.am D /trunk/include/Makefile A /trunk/include/Makefile.am M /trunk/lib A /trunk/lib/Makefile.am M /trunk/scm D /trunk/scm/Makefile A /trunk/scm/Makefile.am M /trunk/scripts D /trunk/scripts/Makefile A /trunk/scripts/Makefile.am M /trunk/src D /trunk/src/Makefile A /trunk/src/Makefile.am M /trunk/src/main.c M /trunk/util A /trunk/util/Makefile.am * First autoconfiscation step. + libelk compiles. + elk compiles. ------------------------------------------------------------------------ r24 | sam | 2003-08-25 12:42:53 +0200 (Mon, 25 Aug 2003) | 2 lines Changed paths: A /trunk/COPYING (from /trunk/COPYRIGHT:15) D /trunk/COPYRIGHT * Renamed COPYRIGHT to COPYING. ------------------------------------------------------------------------ r23 | sam | 2003-08-25 12:41:05 +0200 (Mon, 25 Aug 2003) | 2 lines Changed paths: A /trunk/AUTHORS (from /trunk/CONTRIBUTORS:15) D /trunk/CONTRIBUTORS * Renamed CONTRIBUTORS to AUTHORS. ------------------------------------------------------------------------ r22 | sam | 2003-08-25 12:40:24 +0200 (Mon, 25 Aug 2003) | 2 lines Changed paths: D /trunk/CHANGES A /trunk/NEWS (from /trunk/CHANGES:15) * Renamed CHANGES to NEWS. ------------------------------------------------------------------------ r21 | sam | 2003-08-25 12:35:09 +0200 (Mon, 25 Aug 2003) | 2 lines Changed paths: D /trunk/debian/elk.postinst M /trunk/debian/elk.prerm M /trunk/debian/manpages M /trunk/debian/rules D /trunk/debian/scheme-warning-elk D /trunk/debian/scheme-warning-elk.1 * Got rid of the useless scheme-warning-elk. ------------------------------------------------------------------------ r20 | sam | 2003-08-21 14:43:01 +0200 (Thu, 21 Aug 2003) | 2 lines Changed paths: M /trunk/debian/control * debian/control: Added proper conflict/replace rules. ------------------------------------------------------------------------ r19 | sam | 2003-08-21 14:40:09 +0200 (Thu, 21 Aug 2003) | 9 lines Changed paths: M /trunk/debian M /trunk/debian/changelog M /trunk/debian/control A /trunk/debian/libelk0-dev.dirs A /trunk/debian/libelk0.dirs M /trunk/debian/rules M /trunk/lib/xaw/build M /trunk/lib/xm/build M /trunk/src M /trunk/src/build * src/build: + Build libelk as shared and static libraries. + Dynamically link scheme with -lelk * debian/control: + New libelk0 and libelk0-dev packages. * debian/rules: + Changed build rules according to the new libelk. + Remove .svn directories from the examples in the elkdoc package. ------------------------------------------------------------------------ r18 | sam | 2003-08-21 11:58:05 +0200 (Thu, 21 Aug 2003) | 4 lines Changed paths: M /trunk/src M /trunk/src/build A /trunk/src/libelk.c (from /trunk/src/main.c:17) R /trunk/src/main.c * Renamed main.c into libelk.c. * Added a new main.c that uses libelk. Can be built this way: gcc main.c -o scheme -L. -lelk ------------------------------------------------------------------------ r17 | sam | 2003-08-21 11:51:00 +0200 (Thu, 21 Aug 2003) | 2 lines Changed paths: M /trunk/src/main.c * Added a special case in Elk_Init for the forthcoming libelk. ------------------------------------------------------------------------ r16 | sam | 2003-08-21 00:19:53 +0200 (Thu, 21 Aug 2003) | 2 lines Changed paths: M /trunk M /trunk/debian M /trunk/include M /trunk/lib/misc M /trunk/lib/unix M /trunk/lib/xaw M /trunk/lib/xlib M /trunk/lib/xm M /trunk/lib/xm/xt M /trunk/lib/xt M /trunk/scm M /trunk/scripts M /trunk/src * Proper svn:ignore properties. ------------------------------------------------------------------------ r15 | sam | 2003-08-21 00:19:07 +0200 (Thu, 21 Aug 2003) | 2 lines Changed paths: M /trunk/debian/changelog * Changelog for the 3.0-16 Debian upload. ------------------------------------------------------------------------ r14 | sam | 2003-08-21 00:18:34 +0200 (Thu, 21 Aug 2003) | 2 lines Changed paths: M /trunk/examples/CC/class.c M /trunk/examples/CC/constructor.c * Ported the C++ examplesto the shared object dynamic linking scheme. ------------------------------------------------------------------------ r13 | sam | 2003-08-20 11:26:21 +0200 (Wed, 20 Aug 2003) | 2 lines Changed paths: M /trunk/lib/misc/build M /trunk/lib/unix/build M /trunk/lib/xaw/build M /trunk/lib/xlib/build M /trunk/lib/xm/build M /trunk/lib/xm/xt/build M /trunk/lib/xt/build * Link objects with gcc, not ld. ------------------------------------------------------------------------ r12 | sam | 2003-08-19 21:50:05 +0200 (Tue, 19 Aug 2003) | 2 lines Changed paths: M /trunk/debian/rules * debian/rules: should be executable. ------------------------------------------------------------------------ r11 | sam | 2003-08-19 21:38:03 +0200 (Tue, 19 Aug 2003) | 2 lines Changed paths: M /trunk/src/build * src/build: made the build continue if debian/arch-config is not found. ------------------------------------------------------------------------ r10 | sam | 2003-08-19 21:32:56 +0200 (Tue, 19 Aug 2003) | 2 lines Changed paths: A /trunk/debian/compat M /trunk/debian/control M /trunk/debian/rules * Use debian/compat instead of DH_COMPAT. ------------------------------------------------------------------------ r9 | sam | 2003-08-19 21:27:51 +0200 (Tue, 19 Aug 2003) | 6 lines Changed paths: M /trunk/debian/changelog M /trunk/debian/rules M /trunk/doc/man/elk.1 M /trunk/src/math.c elk (3.0-15) unstable; urgency=low * In math.c:Exact_Modulo(), follow R5RS's definition of Modulo: if x/y is an integer, return Zero (Closes: #197831). * Made /usr/bin/elk a symlink to /usr/bin/scheme-elk. -- Sam Hocevar (Debian packages) Wed, 18 Jun 2003 01:42:54 +0200 ------------------------------------------------------------------------ r8 | sam | 2003-08-19 21:27:17 +0200 (Tue, 19 Aug 2003) | 5 lines Changed paths: M /trunk/debian/changelog M /trunk/debian/control elk (3.0-14) unstable; urgency=low * Rebuilt package against libgdbm's new version. * Set policy to 3.5.10. -- Sam Hocevar (Debian packages) Wed, 4 Jun 2003 02:42:08 +0200 ------------------------------------------------------------------------ r7 | sam | 2003-08-19 21:26:49 +0200 (Tue, 19 Aug 2003) | 4 lines Changed paths: M /trunk/debian/README.Debian M /trunk/debian/changelog M /trunk/debian/control M /trunk/include/extern.h M /trunk/lib/xlib/objects.c M /trunk/lib/xt/objects.c M /trunk/src/error.c M /trunk/src/print.c M /trunk/src/terminate.c elk (3.0-13) unstable; urgency=low * Fixed gcc-3.3 compilation errors due to deprecated usage of . -- Sam Hocevar (Debian packages) Fri, 30 May 2003 17:04:56 +0200 ------------------------------------------------------------------------ r6 | sam | 2003-08-19 21:26:04 +0200 (Tue, 19 Aug 2003) | 4 lines Changed paths: M /trunk/debian/changelog M /trunk/src/build elk (3.0-12) unstable; urgency=low * Fixed generation of /usr/lib/elk/module.a (needed to build sced). -- Samuel Hocevar Sat, 5 Apr 2003 01:45:26 +0200 ------------------------------------------------------------------------ r5 | sam | 2003-08-19 21:25:35 +0200 (Tue, 19 Aug 2003) | 7 lines Changed paths: M /trunk/config/system M /trunk/debian/changelog M /trunk/include/misc.h M /trunk/include/object.h M /trunk/src/env.c M /trunk/src/heap-gen.c M /trunk/src/heap.c elk (3.0-11) unstable; urgency=low * Fixed a compilation issue in src/load-dl.c:Load_Lib(). * Fixed more pointer/integer type confusions, used ptrdiff_t where possible. * Fixed a register mangling issue in heap.c:Visit_GC_List() and heap.c:Visit_Wind() (Really fixes #59893). -- Samuel Hocevar Fri, 4 Apr 2003 02:48:29 +0200 ------------------------------------------------------------------------ r4 | sam | 2003-08-19 21:25:03 +0200 (Tue, 19 Aug 2003) | 16 lines Changed paths: M /trunk/MACHINES M /trunk/config/system M /trunk/debian/README.Debian M /trunk/debian/changelog M /trunk/debian/control M /trunk/debian/elk.ini M /trunk/debian/rules M /trunk/debian/scheme-warning-elk M /trunk/include/Makefile M /trunk/include/build-config M /trunk/include/object.h M /trunk/lib/misc/Makefile M /trunk/lib/misc/bitstring.c M /trunk/lib/misc/build M /trunk/lib/misc/elk-eval.c M /trunk/lib/misc/gdbm.c M /trunk/lib/misc/hack.c M /trunk/lib/misc/record.c M /trunk/lib/misc/regexp.c M /trunk/lib/misc/struct.c M /trunk/lib/unix/Makefile M /trunk/lib/unix/build M /trunk/lib/unix/file.c M /trunk/lib/unix/passwd.c M /trunk/lib/unix/process.c M /trunk/lib/unix/unix.c M /trunk/lib/xaw/Makefile M /trunk/lib/xaw/build M /trunk/lib/xlib/Makefile M /trunk/lib/xlib/build M /trunk/lib/xlib/client.c M /trunk/lib/xlib/color.c M /trunk/lib/xlib/colormap.c M /trunk/lib/xlib/display.c M /trunk/lib/xlib/error.c M /trunk/lib/xlib/event.c M /trunk/lib/xlib/extension.c M /trunk/lib/xlib/font.c M /trunk/lib/xlib/gcontext.c M /trunk/lib/xlib/grab.c M /trunk/lib/xlib/graphics.c M /trunk/lib/xlib/init.c M /trunk/lib/xlib/key.c M /trunk/lib/xlib/pixel.c M /trunk/lib/xlib/property.c M /trunk/lib/xlib/type.c M /trunk/lib/xlib/window.c M /trunk/lib/xlib/wm.c M /trunk/lib/xm/Makefile M /trunk/lib/xm/build M /trunk/lib/xm/xt/Makefile M /trunk/lib/xm/xt/build M /trunk/lib/xt/Makefile M /trunk/lib/xt/accelerator.c M /trunk/lib/xt/action.c M /trunk/lib/xt/build M /trunk/lib/xt/callback.c M /trunk/lib/xt/class.c M /trunk/lib/xt/context.c M /trunk/lib/xt/init.c M /trunk/lib/xt/resource.c M /trunk/lib/xt/translation.c M /trunk/lib/xt/widget.c M /trunk/scm/Makefile M /trunk/scm/bitstring.scm M /trunk/scm/build M /trunk/scm/gdbmtest.scm M /trunk/scm/oops.scm M /trunk/scm/record.scm M /trunk/scm/regexp.scm M /trunk/scm/struct.scm M /trunk/scm/unix.scm M /trunk/scm/xlib.scm M /trunk/scm/xt.scm M /trunk/scm/xwidgets.scm M /trunk/scripts/Makefile M /trunk/src/Makefile M /trunk/src/autoload.c M /trunk/src/build M /trunk/src/heap.c M /trunk/src/load-dl.c M /trunk/src/load-ld.c M /trunk/src/load-rld.c M /trunk/src/load-shl.c M /trunk/src/load.c M /trunk/src/main.c elk (3.0-10) unstable; urgency=low * Updated debhelper build dependency to >>3.0.0. * Shared library handling: + Extended load.c:General_Load() to open shared libraries. + Makefiles now build shared libraries. + Stopped distributing .o files and replaced them with the .so shared libraries; built the Unix, X11, Xaw and Motif extensions. + The interpreter is no longer linked with -lgdbm, gdbm.so is instead. * Replaced standalone.o and module.o with their .a equivalents. * Made the 'debian/arch-config' sourcing errors non-fatal so that make distclean works in the src/ directory. * Changed SCM_DIR again, from /usr/share/elk/scm to /usr/share/elk, and ditto with OBJ_DIR, from /usr/lib/elk/obj to /usr/lib/elk. * Defaulted "garbage-collect-notify?" and "autoload-notify?" to #f. -- Samuel Hocevar Tue, 1 Apr 2003 23:34:26 +0200 ------------------------------------------------------------------------ r3 | sam | 2003-08-19 21:24:23 +0200 (Tue, 19 Aug 2003) | 22 lines Changed paths: M /trunk/BUGS M /trunk/config/system M /trunk/debian/README.Debian M /trunk/debian/changelog M /trunk/debian/elk.ini M /trunk/debian/rules M /trunk/include/build-config M /trunk/include/cstring.h M /trunk/include/extern.h M /trunk/include/gc.h M /trunk/include/intern.h M /trunk/include/misc.h M /trunk/include/object.h M /trunk/include/type.h M /trunk/lib/misc/bitstring.c M /trunk/lib/misc/newhandler.c M /trunk/lib/unix/fdescr.c M /trunk/lib/xlib/xlib.h M /trunk/scm/build M /trunk/scm/initscheme.scm M /trunk/src/autoload.c M /trunk/src/bignum.c M /trunk/src/bool.c M /trunk/src/char.c M /trunk/src/cont.c M /trunk/src/cstring.c M /trunk/src/debug.c M /trunk/src/dump-ecoff.c M /trunk/src/dump-elf.c M /trunk/src/dump-hp9k.c M /trunk/src/dump-vanilla.c M /trunk/src/dump.c M /trunk/src/env.c M /trunk/src/error.c M /trunk/src/exception.c M /trunk/src/feature.c M /trunk/src/heap-gen.c M /trunk/src/heap-sc.c M /trunk/src/heap.c M /trunk/src/io.c M /trunk/src/list.c M /trunk/src/load-dl.c M /trunk/src/load-ld.c M /trunk/src/load-rld.c M /trunk/src/load-shl.c M /trunk/src/load.c M /trunk/src/main.c M /trunk/src/malloc.c M /trunk/src/math.c M /trunk/src/onfork.c M /trunk/src/prim.c M /trunk/src/print.c M /trunk/src/proc.c M /trunk/src/promise.c M /trunk/src/read.c M /trunk/src/special.c M /trunk/src/stab-bsd.c M /trunk/src/stab-coff.c M /trunk/src/stab-convex.c M /trunk/src/stab-ecoff.c M /trunk/src/stab-elf.c M /trunk/src/stab-hp9k300.c M /trunk/src/stab-hp9k800.c M /trunk/src/stab-macho.c M /trunk/src/stab.c M /trunk/src/stkmem.c M /trunk/src/string.c M /trunk/src/symbol.c M /trunk/src/terminate.c M /trunk/src/type.c M /trunk/src/vector.c elk (3.0-9) unstable; urgency=low * New maintainer. * Packaging updates: + Fixed spelling in the package description (Closes: #161056). + Updated standards version to 3.5.9.0. + Changed SCM_DIR from /usr/lib/elk/scm to /usr/share/elk/scm because scheme scripts are platform-independent. * Massive code cleanups: + Added -Wall to the build rules to make error spotting easier, and fixed all compilation warnings in the main program. + Replaced sys_errlist with strerror, bcopy with memcpy, bzero with memset. + Fixed many uninitialized variables. * Fixed some pointer/integer type confusions which caused elk to crash on alpha (Closes: #59893) and probably ia64. * Fixed a read overflow in heap-gen.c:AllocPage() that was corrupting the internal heap (Closes: #57621). * Fixed a missing memory area initialization in heap-gen.c:ExpandHeap() that was causing garbage collector crashes. * Fixed an integer sign issue in main.c:Max_Stack (Closes: #176190). * Made `quit' an alias for `exit' in toplevel.scm. -- Samuel Hocevar Tue, 1 Apr 2003 11:33:23 +0200 ------------------------------------------------------------------------ r2 | sam | 2003-08-19 21:22:48 +0200 (Tue, 19 Aug 2003) | 2 lines Changed paths: M /trunk/config/site A /trunk/config/system A /trunk/debian A /trunk/debian/README.Debian A /trunk/debian/changelog A /trunk/debian/control A /trunk/debian/copyright A /trunk/debian/dirs A /trunk/debian/elk.docs A /trunk/debian/elk.ini A /trunk/debian/elk.postinst A /trunk/debian/elk.prerm A /trunk/debian/elkdoc.docs A /trunk/debian/ldflags-elk.1 A /trunk/debian/linkscheme.1 A /trunk/debian/makedl.1 A /trunk/debian/manpages A /trunk/debian/menu A /trunk/debian/rules A /trunk/debian/scheme-elk.1 A /trunk/debian/scheme-warning-elk A /trunk/debian/scheme-warning-elk.1 M /trunk/doc/README M /trunk/include/build M /trunk/include/build-config M /trunk/include/intern.h M /trunk/lib/misc/build M /trunk/lib/unix/build M /trunk/lib/xaw/build M /trunk/lib/xlib/build M /trunk/lib/xm/build M /trunk/lib/xm/xt/build M /trunk/lib/xt/build M /trunk/scm/build M /trunk/scripts/build M /trunk/scripts/src/ldflags M /trunk/scripts/src/linkscheme M /trunk/src/build M /trunk/src/cont.c M /trunk/src/dump-elf.c M /trunk/src/load-dl.c M /trunk/src/load-ld.c M /trunk/src/main.c M /trunk/src/print.c * Imported the original 3.0-8.1 Debian diff. ------------------------------------------------------------------------ r1 | sam | 2003-08-19 21:19:38 +0200 (Tue, 19 Aug 2003) | 2 lines Changed paths: A /branches A /tags A /trunk A /trunk/BUGS A /trunk/CHANGES A /trunk/CONTRIBUTORS A /trunk/COPYRIGHT A /trunk/INSTALL A /trunk/MACHINES A /trunk/MIGRATE A /trunk/Makefile A /trunk/PATCHLEVEL A /trunk/README A /trunk/ROADMAP A /trunk/TODO A /trunk/config A /trunk/config/386pc-bsdi-gcc A /trunk/config/alpha-osf1-cc A /trunk/config/dec5100-ultrix4.2-cc A /trunk/config/hp9k700-hpux10.0-cc A /trunk/config/hp9k700-hpux9.0-cc A /trunk/config/i486-linux-gcc A /trunk/config/next-mach3.3-cc A /trunk/config/powerpc-aix4.1-gcc A /trunk/config/powerpc-aix4.1-xlc A /trunk/config/powerpc-solaris2.5-cc A /trunk/config/rs6000-aix3.2-cc A /trunk/config/sgi-irix5.3-cc A /trunk/config/sgi-irix6.2-cc A /trunk/config/site A /trunk/config/sites A /trunk/config/sites/alpha-osf1 A /trunk/config/sites/dec5100-ultrix A /trunk/config/sites/hp9k700-hpux9.0 A /trunk/config/sites/sun-sunos4.1 A /trunk/config/sites/sun-sunos5 A /trunk/config/sun-sunos4.1-acc A /trunk/config/sun-sunos4.1-cc A /trunk/config/sun-sunos4.1-gcc A /trunk/config/sun-sunos5-acc A /trunk/config/sun-sunos5-gcc A /trunk/config/untested A /trunk/config/untested/386pc-386bsd-gcc A /trunk/config/untested/386pc-dos-gcc A /trunk/config/untested/convex230-convexos10-cc A /trunk/config/untested/cray-unicos-cc A /trunk/config/untested/mx300i-svr4-cc A /trunk/config/untested/sony3200-news4-gcc A /trunk/doc A /trunk/doc/README A /trunk/doc/bitstring A /trunk/doc/bitstring/Makefile A /trunk/doc/bitstring/bitstring.ms A /trunk/doc/bitstring/bitstring.ps A /trunk/doc/cprog A /trunk/doc/cprog/Makefile A /trunk/doc/cprog/cprog.ms A /trunk/doc/cprog/cprog.ps A /trunk/doc/kernel A /trunk/doc/kernel/Makefile A /trunk/doc/kernel/kernel.ms A /trunk/doc/kernel/kernel.ps A /trunk/doc/man A /trunk/doc/man/Makefile A /trunk/doc/man/elk.1 A /trunk/doc/man/elk.ps A /trunk/doc/man/scheme.1 A /trunk/doc/oops A /trunk/doc/oops/Makefile A /trunk/doc/oops/oops.ms A /trunk/doc/oops/oops.ps A /trunk/doc/record A /trunk/doc/record/Makefile A /trunk/doc/record/record.ms A /trunk/doc/record/record.ps A /trunk/doc/regexp A /trunk/doc/regexp/Makefile A /trunk/doc/regexp/regexp.ms A /trunk/doc/regexp/regexp.ps A /trunk/doc/unix A /trunk/doc/unix/Makefile A /trunk/doc/unix/unix.ms A /trunk/doc/unix/unix.ps A /trunk/doc/usenix A /trunk/doc/usenix/Makefile A /trunk/doc/usenix/usenix.ms A /trunk/doc/usenix/usenix.ps A /trunk/doc/util A /trunk/doc/util/Makefile A /trunk/doc/util/block.awk A /trunk/doc/util/fixindex.awk A /trunk/doc/util/mkindex.c A /trunk/doc/util/tmac.index A /trunk/doc/util/tmac.scheme A /trunk/doc/xlib A /trunk/doc/xlib/Makefile A /trunk/doc/xlib/xlib.ms A /trunk/doc/xlib/xlib.ps A /trunk/doc/xt A /trunk/doc/xt/Makefile A /trunk/doc/xt/xt.ms A /trunk/doc/xt/xt.ps A /trunk/examples A /trunk/examples/CC A /trunk/examples/CC/class.c A /trunk/examples/CC/constructor.c A /trunk/examples/regexp A /trunk/examples/regexp/match.scm A /trunk/examples/scheme A /trunk/examples/scheme/Y.scm A /trunk/examples/scheme/acker.scm A /trunk/examples/scheme/billiard.scm A /trunk/examples/scheme/cc.scm A /trunk/examples/scheme/cell.scm A /trunk/examples/scheme/co.scm A /trunk/examples/scheme/compile.scm A /trunk/examples/scheme/cps.scm A /trunk/examples/scheme/dynamic.scm A /trunk/examples/scheme/fib.scm A /trunk/examples/scheme/fix.scm A /trunk/examples/scheme/flame.scm A /trunk/examples/scheme/hanoi.scm A /trunk/examples/scheme/kons.scm A /trunk/examples/scheme/meissel.scm A /trunk/examples/scheme/mondo.scm A /trunk/examples/scheme/perm.scm A /trunk/examples/scheme/prim.scm A /trunk/examples/scheme/ramanujan.scm A /trunk/examples/scheme/rungekutta.scm A /trunk/examples/scheme/sqrt.scm A /trunk/examples/scheme/unify.scm A /trunk/examples/scheme/work.scm A /trunk/examples/unix A /trunk/examples/unix/calc.scm A /trunk/examples/unix/copy.scm A /trunk/examples/unix/lock.scm A /trunk/examples/unix/ls.scm A /trunk/examples/unix/pipsiz.scm A /trunk/examples/unix/timeout.scm A /trunk/examples/xaw A /trunk/examples/xaw/accel.scm A /trunk/examples/xaw/clickcount.scm A /trunk/examples/xaw/dialog.scm A /trunk/examples/xaw/grip.scm A /trunk/examples/xaw/list.scm A /trunk/examples/xaw/paned.scm A /trunk/examples/xaw/panner.scm A /trunk/examples/xaw/popup.scm A /trunk/examples/xaw/porthole.scm A /trunk/examples/xaw/pulldown.scm A /trunk/examples/xaw/scrollbar.scm A /trunk/examples/xaw/scrollbox.scm A /trunk/examples/xaw/stripchart.scm A /trunk/examples/xaw/text.scm A /trunk/examples/xaw/tree.scm A /trunk/examples/xaw/viewport.scm A /trunk/examples/xlib A /trunk/examples/xlib/hello.scm A /trunk/examples/xlib/lines.scm A /trunk/examples/xlib/map-all.scm A /trunk/examples/xlib/picture.scm A /trunk/examples/xlib/poly.scm A /trunk/examples/xlib/properties.scm A /trunk/examples/xlib/track.scm A /trunk/examples/xlib/useful.scm A /trunk/examples/xlib/wm-delete.scm A /trunk/examples/xm A /trunk/examples/xm/drawing-area.scm A /trunk/examples/xm/list.scm A /trunk/examples/xm/main-window.scm A /trunk/examples/xm/menu-stuff.scm A /trunk/examples/xm/message-dialog.scm A /trunk/examples/xm/option-menu.scm A /trunk/examples/xm/popup-menu.scm A /trunk/examples/xm/pulldown-menu.scm A /trunk/examples/xm/radio-stuff.scm A /trunk/examples/xm/radio.scm A /trunk/examples/xm/scroll-bar.scm A /trunk/examples/xm/selection-box.scm A /trunk/examples/xm/vcr.scm A /trunk/include A /trunk/include/Makefile A /trunk/include/build A /trunk/include/build-config A /trunk/include/compat.h A /trunk/include/cstring.h A /trunk/include/exception.h A /trunk/include/extern.h A /trunk/include/funcproto.h A /trunk/include/gc.h A /trunk/include/intern.h A /trunk/include/kernel.h A /trunk/include/misc.h A /trunk/include/object.h A /trunk/include/param.h A /trunk/include/scheme.h A /trunk/include/stkmem.h A /trunk/include/type.h A /trunk/lib A /trunk/lib/misc A /trunk/lib/misc/Makefile A /trunk/lib/misc/bitstring.c A /trunk/lib/misc/build A /trunk/lib/misc/debug.c A /trunk/lib/misc/elk-eval.c A /trunk/lib/misc/gdbm.c A /trunk/lib/misc/hack.c A /trunk/lib/misc/monitor.c A /trunk/lib/misc/newhandler.c A /trunk/lib/misc/record.c A /trunk/lib/misc/regexp.c A /trunk/lib/misc/struct.c A /trunk/lib/unix A /trunk/lib/unix/Makefile A /trunk/lib/unix/TODO A /trunk/lib/unix/build A /trunk/lib/unix/error.c A /trunk/lib/unix/fdescr.c A /trunk/lib/unix/file.c A /trunk/lib/unix/lock.c A /trunk/lib/unix/misc.c A /trunk/lib/unix/passwd.c A /trunk/lib/unix/process.c A /trunk/lib/unix/signal.c A /trunk/lib/unix/system.c A /trunk/lib/unix/temp.c A /trunk/lib/unix/time.c A /trunk/lib/unix/unix.c A /trunk/lib/unix/unix.h A /trunk/lib/unix/wait.c A /trunk/lib/xaw A /trunk/lib/xaw/ALIASES A /trunk/lib/xaw/Makefile A /trunk/lib/xaw/ascii.d A /trunk/lib/xaw/box.d A /trunk/lib/xaw/build A /trunk/lib/xaw/clock.d A /trunk/lib/xaw/command.d A /trunk/lib/xaw/dialog.d A /trunk/lib/xaw/form.d A /trunk/lib/xaw/grip.d A /trunk/lib/xaw/label.d A /trunk/lib/xaw/list.d A /trunk/lib/xaw/menubutton.d A /trunk/lib/xaw/paned.d A /trunk/lib/xaw/panner.d A /trunk/lib/xaw/porthole.d A /trunk/lib/xaw/repeater.d A /trunk/lib/xaw/scrollbar.d A /trunk/lib/xaw/shell.d A /trunk/lib/xaw/simplemenu.d A /trunk/lib/xaw/sme.d A /trunk/lib/xaw/smebsb.d A /trunk/lib/xaw/smeline.d A /trunk/lib/xaw/stripchart.d A /trunk/lib/xaw/toggle.d A /trunk/lib/xaw/tree.d A /trunk/lib/xaw/viewport.d A /trunk/lib/xlib A /trunk/lib/xlib/MISSING A /trunk/lib/xlib/Makefile A /trunk/lib/xlib/build A /trunk/lib/xlib/client.c A /trunk/lib/xlib/color.c A /trunk/lib/xlib/colormap.c A /trunk/lib/xlib/cursor.c A /trunk/lib/xlib/display.c A /trunk/lib/xlib/error.c A /trunk/lib/xlib/event.c A /trunk/lib/xlib/extension.c A /trunk/lib/xlib/font.c A /trunk/lib/xlib/gcontext.c A /trunk/lib/xlib/grab.c A /trunk/lib/xlib/graphics.c A /trunk/lib/xlib/init.c A /trunk/lib/xlib/key.c A /trunk/lib/xlib/objects.c A /trunk/lib/xlib/pixel.c A /trunk/lib/xlib/pixmap.c A /trunk/lib/xlib/property.c A /trunk/lib/xlib/text.c A /trunk/lib/xlib/type.c A /trunk/lib/xlib/util.c A /trunk/lib/xlib/window.c A /trunk/lib/xlib/wm.c A /trunk/lib/xlib/xlib.h A /trunk/lib/xm A /trunk/lib/xm/ALIASES A /trunk/lib/xm/Makefile A /trunk/lib/xm/arrow-button.d A /trunk/lib/xm/build A /trunk/lib/xm/bulletin-brd.d A /trunk/lib/xm/cascade-btn.d A /trunk/lib/xm/command.d A /trunk/lib/xm/drawing-area.d A /trunk/lib/xm/drawn-button.d A /trunk/lib/xm/file-selectn.d A /trunk/lib/xm/form.d A /trunk/lib/xm/frame.d A /trunk/lib/xm/label.d A /trunk/lib/xm/list.d A /trunk/lib/xm/main-window.d A /trunk/lib/xm/message-box.d A /trunk/lib/xm/paned-window.d A /trunk/lib/xm/push-button.d A /trunk/lib/xm/row-column.d A /trunk/lib/xm/scale.d A /trunk/lib/xm/scroll-bar.d A /trunk/lib/xm/scrolled-win.d A /trunk/lib/xm/selectn-box.d A /trunk/lib/xm/separator.d A /trunk/lib/xm/shell.d A /trunk/lib/xm/support.d A /trunk/lib/xm/text.d A /trunk/lib/xm/toggle-btn.d A /trunk/lib/xm/xt A /trunk/lib/xm/xt/Makefile A /trunk/lib/xm/xt/build A /trunk/lib/xt A /trunk/lib/xt/MISSING A /trunk/lib/xt/Makefile A /trunk/lib/xt/accelerator.c A /trunk/lib/xt/action.c A /trunk/lib/xt/build A /trunk/lib/xt/callback.c A /trunk/lib/xt/class.c A /trunk/lib/xt/classname.c A /trunk/lib/xt/context.c A /trunk/lib/xt/converter.c A /trunk/lib/xt/error.c A /trunk/lib/xt/function.c A /trunk/lib/xt/identifier.c A /trunk/lib/xt/init.c A /trunk/lib/xt/mkwidget.scm A /trunk/lib/xt/objects.c A /trunk/lib/xt/popup.c A /trunk/lib/xt/resource.c A /trunk/lib/xt/translation.c A /trunk/lib/xt/widget.c A /trunk/lib/xt/xt.h A /trunk/scm A /trunk/scm/Makefile A /trunk/scm/apropos.scm A /trunk/scm/bitstring.scm A /trunk/scm/build A /trunk/scm/build-siteinfo A /trunk/scm/cscheme.scm A /trunk/scm/debug.scm A /trunk/scm/describe.scm A /trunk/scm/gdbmtest.scm A /trunk/scm/initscheme.scm A /trunk/scm/motif.scm A /trunk/scm/oops.scm A /trunk/scm/parse.scm A /trunk/scm/pp.scm A /trunk/scm/qsort.scm A /trunk/scm/record.scm A /trunk/scm/recordutil.scm A /trunk/scm/regexp.scm A /trunk/scm/safe-env.scm A /trunk/scm/setf.scm A /trunk/scm/struct.scm A /trunk/scm/toplevel.scm A /trunk/scm/trace.scm A /trunk/scm/unix.scm A /trunk/scm/xlib.scm A /trunk/scm/xt.scm A /trunk/scm/xwidgets.scm A /trunk/scripts A /trunk/scripts/Makefile A /trunk/scripts/README A /trunk/scripts/build A /trunk/scripts/src A /trunk/scripts/src/ldflags A /trunk/scripts/src/linkscheme A /trunk/scripts/src/makedl-dl A /trunk/scripts/src/makedl-ld A /trunk/scripts/src/makedl-none A /trunk/scripts/src/makedl-rld A /trunk/scripts/src/makedl-shl A /trunk/src A /trunk/src/Makefile A /trunk/src/autoload.c A /trunk/src/bignum.c A /trunk/src/bool.c A /trunk/src/build A /trunk/src/char.c A /trunk/src/cont.c A /trunk/src/cstring.c A /trunk/src/debug.c A /trunk/src/dump-ecoff.c A /trunk/src/dump-elf.c A /trunk/src/dump-hp9k.c A /trunk/src/dump-vanilla.c A /trunk/src/dump.c A /trunk/src/env.c A /trunk/src/error.c A /trunk/src/exception.c A /trunk/src/feature.c A /trunk/src/heap-gen.c A /trunk/src/heap-sc.c A /trunk/src/heap.c A /trunk/src/io.c A /trunk/src/list.c A /trunk/src/load-dl.c A /trunk/src/load-ld.c A /trunk/src/load-rld.c A /trunk/src/load-shl.c A /trunk/src/load.c A /trunk/src/main.c A /trunk/src/malloc.c A /trunk/src/math.c A /trunk/src/onfork.c A /trunk/src/prim.c A /trunk/src/print.c A /trunk/src/proc.c A /trunk/src/promise.c A /trunk/src/read.c A /trunk/src/special.c A /trunk/src/stab-bsd.c A /trunk/src/stab-coff.c A /trunk/src/stab-convex.c A /trunk/src/stab-ecoff.c A /trunk/src/stab-elf.c A /trunk/src/stab-hp9k300.c A /trunk/src/stab-hp9k800.c A /trunk/src/stab-macho.c A /trunk/src/stab.c A /trunk/src/stkmem.c A /trunk/src/string.c A /trunk/src/symbol.c A /trunk/src/terminate.c A /trunk/src/type.c A /trunk/src/vector.c A /trunk/util A /trunk/util/README A /trunk/util/alloca.c A /trunk/util/getversion * Imported original elk 3.0 tree. ------------------------------------------------------------------------ elk-3.99.8/config.h.in0000644000175000017500000002200711577103433011350 00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* FIXME HARD */ #undef ALIGN_8BYTE /* FIXME HARD */ #undef ANSI_CPP /* Define if a-=1000; a[1000] doesn't work */ #undef ARRAY_BROKEN /* FIXME HARD */ #undef CACHECTL_H /* FIXME HARD */ #undef CAN_DUMP /* Define if dynamic loading is supported */ #undef CAN_LOAD_LIB /* FIXME HARD */ #undef COFF /* FIXME HARD */ #undef COFF_PAGESIZE /* FIXME HARD */ #undef CONVEX_AOUT /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP systems. This function is required for `alloca.c' support on those systems. */ #undef CRAY_STACKSEG_END /* Define to 1 if using `alloca.c'. */ #undef C_ALLOCA /* FIXME HARD */ #undef DEBUG_DUMP /* Define default max stack size */ #undef DEFAULT_MAX_STACK_SIZE /* FIXME HARD */ #undef ECOFF /* Define if defines environ */ #undef ENVIRON_IN_UNISTD_H /* FIXME HARD */ #undef FCHMOD_BROKEN /* FIXME HARD */ #undef FILE_TEXT_START /* FIXME HARD */ #undef FIND_AOUT /* FIXME HARD */ #undef FINIT_PREFIX /* FIXME HARD */ #undef GENERATIONAL_GC /* FIXME HARD */ #undef GETGROUPS_TYPE /* Define to 1 if you have `alloca', as a function or macro. */ #undef HAVE_ALLOCA /* Define to 1 if you have the header file. */ #undef HAVE_ALLOCA_H /* Define to 1 if you have the `atexit' function. */ #undef HAVE_ATEXIT /* Define to 1 if you have the header file. */ #undef HAVE_A_OUT_H /* Define if you have BSD-style flushing */ #undef HAVE_BSD_FLUSH /* Define to 1 if you have the `dirent' function. */ #undef HAVE_DIRENT /* Define to 1 if you have the header file. */ #undef HAVE_DIRENT_H /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define if you have the BeOS dl */ #undef HAVE_DL_BEOS /* Define if you have the GNU dld library */ #undef HAVE_DL_DLD_LINK /* Define if you have the dlopen API */ #undef HAVE_DL_DLOPEN /* Define if you have the Darwin dyld API */ #undef HAVE_DL_DYLD /* Define to 1 if you have the header file. */ #undef HAVE_DL_H /* Define if you have the shl_load API */ #undef HAVE_DL_SHL_LOAD /* Define if you have Windows' LoadLibrary */ #undef HAVE_DL_WINDOWS /* Define to 1 if you have the `environ' function. */ #undef HAVE_ENVIRON /* Define to 1 if you have the `fpurge' function. */ #undef HAVE_FPURGE /* Define to 1 if you have the `ftime' function. */ #undef HAVE_FTIME /* Define to 1 if you have the `getcwd' function. */ #undef HAVE_GETCWD /* Define to 1 if you have the `getdtablesize' function. */ #undef HAVE_GETDTABLESIZE /* Define to 1 if you have the `gethostname' function. */ #undef HAVE_GETHOSTNAME /* Define to 1 if you have the `getpagesize' function. */ #undef HAVE_GETPAGESIZE /* Define to 1 if you have the `getrlimit' function. */ #undef HAVE_GETRLIMIT /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY /* Define to 1 if you have the `getwd' function. */ #undef HAVE_GETWD /* Define to 1 if you have the header file. */ #undef HAVE_GRP_H /* Define to 1 if you have the header file. */ #undef HAVE_IMAGE_H /* Define to 1 if you have the `index' function. */ #undef HAVE_INDEX /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define if you have libelf. */ #undef HAVE_LIBELF /* Define to 1 if you have the `load_add_on' function. */ #undef HAVE_LOAD_ADD_ON /* Define to 1 if you have the header file. */ #undef HAVE_MACH_O_DYLD_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `mktemp' function. */ #undef HAVE_MKTEMP /* Define to 1 if you have the `mprotect' function. */ #undef HAVE_MPROTECT /* Define to 1 if you have the header file. */ #undef HAVE_NETDB_H /* Define to 1 if you have the `NSLinkModule' function. */ #undef HAVE_NSLINKMODULE /* Define to 1 if you have the header file. */ #undef HAVE_PWD_H /* Define to 1 if you have the `random' function. */ #undef HAVE_RANDOM /* Define to 1 if you have the `regcomp' function. */ #undef HAVE_REGCOMP /* Define to 1 if you have the `rename' function. */ #undef HAVE_RENAME /* Define to 1 if you have the `sigblock' function. */ #undef HAVE_SIGBLOCK /* Define to 1 if you have the header file. */ #undef HAVE_SIGNAL_H /* Define to 1 if you have the `sigprocmask' function. */ #undef HAVE_SIGPROCMASK /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define if you have struct rlimit */ #undef HAVE_STRUCT_RLIMIT /* Define to 1 if you have the header file. */ #undef HAVE_SYS_DL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_FILIO_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_IOCTL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_RESOURCE_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIMES_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_UTIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_WAIT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS__INTTYPES_H /* Define to 1 if you have the `tempnam' function. */ #undef HAVE_TEMPNAM /* Define to 1 if you have the header file. */ #undef HAVE_TERMIOS_H /* Define to 1 if you have the header file. */ #undef HAVE_TERMIO_H /* Define to 1 if you have the `tmpnam' function. */ #undef HAVE_TMPNAM /* Define to 1 if you have the `uname' function. */ #undef HAVE_UNAME /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the header file. */ #undef HAVE_UTIME_H /* Define to 1 if you have the `vfork' function. */ #undef HAVE_VFORK /* Define to 1 if you have the `vprintf' function. */ #undef HAVE_VPRINTF /* Define to 1 if you have the `wait3' function. */ #undef HAVE_WAIT3 /* Define to 1 if you have the `wait4' function. */ #undef HAVE_WAIT4 /* Define to 1 if you have the `waitpid' function. */ #undef HAVE_WAITPID /* FIXME HARD */ #undef HEAP_SIZE /* FIXME HARD */ #undef HP9K /* FIXME HARD */ #undef HPSHLIB /* FIXME HARD */ #undef INIT_PREFIX /* FIXME HARD */ #undef LD_NAME /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* FIXME HARD */ #undef MACH_O /* FIXME HARD */ #undef MEM_TEXT_START /* FIXME HARD */ #undef MPROTECT_MMAP /* FIXME HARD */ #undef MPROTECT_SIG /* Define to 1 if your C compiler doesn't accept -c and -o together. */ #undef NO_MINUS_C_MINUS_O /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* FIXME HARD */ #undef PRAGMA_ALLOCA /* FIXME HARD */ #undef SEG_SIZ /* FIXME HARD */ #undef SIGSEGV_AIX /* FIXME HARD */ #undef SIGSEGV_ARG4 /* FIXME HARD */ #undef SIGSEGV_HPUX /* FIXME HARD */ #undef SIGSEGV_SIGCONTEXT /* FIXME HARD */ #undef SIGSEGV_SIGINFO /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at runtime. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define the C99 integer types header */ #undef STDINT_HEADER /* Define if symbols start with '_' */ #undef SYMS_BEGIN_WITH /* Our operating system */ #undef SYSTEMTYPE /* Define if the system is Darwin */ #undef SYS_DARWIN /* FIXME HARD */ #undef TERMIO /* FIXME HARD */ #undef TEXT_LENGTH_ADJ /* Version number of package */ #undef VERSION /* FIXME HARD */ #undef XCOFF /* Define if defines __environ */ #undef __ENVIRON_IN_UNISTD_H /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif /* Define to `unsigned int' if does not define. */ #undef size_t elk-3.99.8/src/0000755000175000017500000000000011577110017010167 500000000000000elk-3.99.8/src/main.c0000644000175000017500000000333311577076306011215 00000000000000/* main.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "config.h" #ifdef WIN32 # include # include #endif #include #ifdef WIN32 static void exit_handler () { fprintf (stdout, "\nElk has terminated. Press return to continue.\n"); fflush (stdin); getchar (); } #endif int main (int ac, char **av) { #ifdef WIN32 AllocConsole (); freopen ("CONIN$", "r", stdin); freopen ("CONOUT$", "w", stdout); freopen ("CONOUT$", "w", stderr); atexit (exit_handler); #endif Elk_Init (ac, av, 1, ""); return 0; } elk-3.99.8/src/print.c0000644000175000017500000004201311577076306011423 00000000000000/* print.c: Output functions and primitives. * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "config.h" #include #include #include #include #if defined(HAVE_TERMIO_H) # include #elif defined(HAVE_TERMIOS_H) # include #endif #if defined(HAVE_SYS_IOCTL_H) # include #endif #include "kernel.h" extern void Print_Bignum (Object, Object); extern int errno; void Flush_Output (Object); void Print_String (Object, register char *, register unsigned int); void Pr_Char (Object, register int); void Pr_Symbol (Object, Object, int); void Pr_List (Object, Object, register int, register int, register unsigned int); void Pr_String (Object, Object, int); void Pr_Vector (Object, Object, register int, register int, register unsigned int); void Print_Special (Object, register int); int Saved_Errno; static Object V_Print_Depth, V_Print_Length; void Init_Print () { Define_Variable (&V_Print_Depth, "print-depth", Make_Integer (DEF_PRINT_DEPTH)); Define_Variable (&V_Print_Length, "print-length", Make_Integer (DEF_PRINT_LEN)); } int Print_Length () { Object pl; pl = Var_Get (V_Print_Length); return TYPE(pl) == T_Fixnum ? FIXNUM(pl) : DEF_PRINT_LEN; } int Print_Depth () { Object pd; pd = Var_Get (V_Print_Depth); return TYPE(pd) == T_Fixnum ? FIXNUM(pd) : DEF_PRINT_DEPTH; } void Print_Char (Object port, register int c) { char buf[1]; if (PORT(port)->flags & P_STRING) { buf[0] = c; Print_String (port, buf, 1); } else { if (putc (c, PORT(port)->file) == EOF) { Saved_Errno = errno; /* errno valid here? */ Primitive_Error ("write error on ~s: ~E", port); } } } void Print_String (Object port, register char *buf, register unsigned int len) { register int n; register struct S_Port *p; Object new; GC_Node; p = PORT(port); n = STRING(p->name)->size - p->ptr; if (n < (int)len) { GC_Link (port); n = len - n; if (n < STRING_GROW_SIZE) n = STRING_GROW_SIZE; new = Make_String ((char *)0, STRING(p->name)->size + n); p = PORT(port); GC_Unlink; memcpy (STRING(new)->data, STRING(p->name)->data, p->ptr); p->name = new; } memcpy (STRING(p->name)->data + p->ptr, buf, len); p->ptr += len; } #ifndef HAVE_VPRINTF void vfprintf (register FILE *f, register char *fmt, va_list ap) { _doprnt (fmt, ap, f); } void vsprintf (register char *s, register char *fmt, va_list ap) { FILE x; x._flag = _IOWRT|_IOSTRG; x._ptr = s; x._cnt = 1024; _doprnt (fmt, ap, &x); putc ('\0', &x); } #endif /*VARARGS0*/ void Printf (Object port, const char *fmt, ...) { va_list args; char buf[1024]; va_start (args, fmt); if (PORT(port)->flags & P_STRING) { vsprintf (buf, fmt, args); Print_String (port, buf, strlen (buf)); } else { vfprintf (PORT(port)->file, fmt, args); if (ferror (PORT(port)->file)) { Saved_Errno = errno; /* errno valid here? */ Primitive_Error ("write error on ~s: ~E", port); } } va_end (args); } Object General_Print (int argc, Object *argv, int raw) { General_Print_Object (argv[0], argc == 2 ? argv[1] : Curr_Output_Port, raw); return Void; } Object P_Write (int argc, Object *argv) { return General_Print (argc, argv, 0); } Object P_Display (int argc, Object *argv) { return General_Print (argc, argv, 1); } Object P_Write_Char (int argc, Object *argv) { Check_Type (argv[0], T_Character); return General_Print (argc, argv, 1); } /*VARARGS1*/ Object P_Newline (int argc, Object *argv) { General_Print_Object (Newline, argc == 1 ? argv[0] : Curr_Output_Port, 1); return Void; } Object P_Print (int argc, Object *argv) { Object port; GC_Node; port = argc == 2 ? argv[1] : Curr_Output_Port; GC_Link (port); General_Print_Object (argv[0], port, 0); Print_Char (port, '\n'); Flush_Output (port); GC_Unlink; return Void; } Object P_Clear_Output_Port (int argc, Object *argv) { Discard_Output (argc == 1 ? argv[0] : Curr_Output_Port); return Void; } void Discard_Output (Object port) { register FILE *f; Check_Output_Port (port); if (PORT(port)->flags & P_STRING) return; f = PORT(port)->file; #if defined(HAVE_FPURGE) (void)fpurge (f); #elif defined(HAVE_BSD_FLUSH) f->_cnt = 0; f->_ptr = f->_base; #endif #if defined(TIOCFLUSH) (void)ioctl (fileno (f), TIOCFLUSH, (char *)0); #elif defined(TCFLSH) (void)ioctl (fileno (f), TCFLSH, (char *)1); #endif } Object P_Flush_Output_Port (int argc, Object *argv) { Flush_Output (argc == 1 ? argv[0] : Curr_Output_Port); return Void; } void Flush_Output (Object port) { Check_Output_Port (port); if (PORT(port)->flags & P_STRING) return; if (fflush (PORT(port)->file) == EOF) { Saved_Errno = errno; /* errno valid here? */ Primitive_Error ("write error on ~s: ~E", port); } } Object P_Get_Output_String (Object port) { register struct S_Port *p; Object str; GC_Node; Check_Output_Port (port); GC_Link (port); str = Make_String ((char *)0, PORT(port)->ptr); p = PORT(port); memcpy (STRING(str)->data, STRING(p->name)->data, p->ptr); p->ptr = 0; GC_Unlink; return str; } void Check_Output_Port (Object port) { Check_Type (port, T_Port); if (!(PORT(port)->flags & P_OPEN)) Primitive_Error ("port has been closed: ~s", port); if (!IS_OUTPUT(port)) Primitive_Error ("not an output port: ~s", port); } void General_Print_Object (Object x, Object port, int raw) { Check_Output_Port (port); Print_Object (x, port, raw, Print_Depth (), Print_Length ()); } void Print_Object (Object x, Object port, register int raw, register int depth, register unsigned int length) { register int t; GC_Node2; GC_Link2 (port, x); t = TYPE(x); switch (t) { case T_Null: Printf (port, "()"); break; case T_Fixnum: Printf (port, "%d", FIXNUM(x)); break; case T_Bignum: Print_Bignum (port, x); break; case T_Flonum: Printf (port, "%s", Flonum_To_String (x)); break; case T_Boolean: Printf (port, "#%c", FIXNUM(x) ? 't' : 'f'); break; case T_Unbound: Printf (port, "#"); break; case T_Unspecified: Printf (port, "#"); break; case T_Special: Printf (port, "#"); break; case T_Character: { int c = CHAR(x); if (raw) Print_Char (port, c); else Pr_Char (port, c); break; } case T_Symbol: Pr_Symbol (port, x, raw); break; case T_Pair: Pr_List (port, x, raw, depth, length); break; case T_Environment: Printf (port, "#", POINTER(x)); break; case T_String: Pr_String (port, x, raw); break; case T_Vector: Pr_Vector (port, x, raw, depth, length); break; case T_Primitive: Printf (port, "#", PRIM(x)->name); break; case T_Compound: if (Nullp (COMPOUND(x)->name)) { Printf (port, "#", POINTER(x)); } else { Printf (port, "#name, port, raw, depth, length); Print_Char (port, '>'); } break; case T_Control_Point: Printf (port, "#", POINTER(x)); break; case T_Promise: Printf (port, "#", POINTER(x)); break; case T_Port: { int str = PORT(x)->flags & P_STRING; char *p; switch (PORT(x)->flags & (P_INPUT|P_BIDIR)) { case 0: p = "output"; break; case P_INPUT: p = "input"; break; default: p = "input-output"; break; } Printf (port, "#<%s-%s-port ", str ? "string" : "file", p); if (str) Printf (port, "%lu", POINTER(x)); else Pr_String (port, PORT(x)->name, 0); Print_Char (port, '>'); break; } case T_End_Of_File: Printf (port, "#"); break; case T_Autoload: Printf (port, "#files, port, raw, depth, length); Print_Char (port, '>'); break; case T_Macro: if (Nullp (MACRO(x)->name)) { Printf (port, "#", POINTER(x)); } else { Printf (port, "#name, port, raw, depth, length); Print_Char (port, '>'); } break; case T_Broken_Heart: Printf (port, "!!broken-heart!!"); break; default: if (t < 0 || t >= Num_Types) Panic ("bad type in print"); (Types[t].print)(x, port, raw, depth, length); } GC_Unlink; } void Pr_Char (Object port, register int c) { register char *p = 0; switch (c) { case ' ': p = "#\\space"; break; case '\t': p = "#\\tab"; break; case '\n': p = "#\\newline"; break; case '\r': p = "#\\return"; break; case '\f': p = "#\\formfeed"; break; case '\b': p = "#\\backspace"; break; default: if (c > ' ' && c < '\177') Printf (port, "#\\%c", c); else Printf (port, "#\\%03o", (unsigned char)c); } if (p) Printf (port, p); } void Pr_List (Object port, Object list, register int raw, register int depth, register unsigned int length) { Object tail; register unsigned int len; register char *s = 0; GC_Node2; if (depth == 0) { Printf (port, "&"); return; } GC_Link2 (port, list); if (!Nullp (list) && ((tail = Cdr (list)), TYPE(tail) == T_Pair) && ((tail = Cdr (tail)), Nullp (tail))) { tail = Car (list); if (EQ(tail, Sym_Quote)) s = "'"; else if (EQ(tail, Sym_Quasiquote)) s = "`"; else if (EQ(tail, Sym_Unquote)) s = ","; else if (EQ(tail, Sym_Unquote_Splicing)) s = ",@"; if (s) { Printf (port, s); Print_Object (Car (Cdr (list)), port, raw, depth < 0 ? depth : depth-1, length); GC_Unlink; return; } } Print_Char (port, '('); for (len = 0; !Nullp (list); len++, list = tail) { if (length >= 0 && len >= length) { Printf (port, "..."); break; } Print_Object (Car (list), port, raw, depth < 0 ? depth : depth-1, length); tail = Cdr (list); if (!Nullp (tail)) { if (TYPE(tail) == T_Pair) Print_Char (port, ' '); else { Printf (port, " . "); Print_Object (tail, port, raw, depth < 0 ? depth : depth-1, length); break; } } } Print_Char (port, ')'); GC_Unlink; } void Pr_Vector (Object port, Object vec, register int raw, register int depth, register unsigned int length) { register unsigned int i, j; GC_Node2; if (depth == 0) { Printf (port, "&"); return; } GC_Link2 (port, vec); Printf (port, "#("); for (i = 0, j = VECTOR(vec)->size; i < j; i++) { if (i) Print_Char (port, ' '); if (length >= 0 && i >= length) { Printf (port, "..."); break; } Print_Object (VECTOR(vec)->data[i], port, raw, depth < 0 ? depth : depth-1, length); } Print_Char (port, ')'); GC_Unlink; } void Pr_Symbol (Object port, Object sym, int raw) { Object str; register unsigned int c, i; GC_Node2; str = SYMBOL(sym)->name; if (raw) { Pr_String (port, str, raw); return; } GC_Link2 (port, str); for (i = 0; i < STRING(str)->size; i++) { c = STRING(str)->data[i]; switch (c) { case '\\': case ';': case '#': case '(': case ')': case '\'': case '`': case ',': case '"': case '.': case '\t': case '\n': case ' ': Print_Char (port, '\\'); Print_Char (port, c); break; default: if (c < ' ' || c >= '\177') Print_Special (port, c); else Print_Char (port, c); } } GC_Unlink; } void Pr_String (Object port, Object str, int raw) { register char *p = STRING(str)->data; register unsigned int c, i; register size_t len = STRING(str)->size; GC_Node2; if (raw) { if (PORT(port)->flags & P_STRING) { Print_String (port, p, len); } else { if (fwrite (p, 1, len, PORT(port)->file) != len) { Saved_Errno = errno; /* errno valid here? */ Primitive_Error ("write error on ~s: ~E", port); } } return; } GC_Link2 (port, str); Print_Char (port, '"'); for (i = 0; i < STRING(str)->size; i++) { c = STRING(str)->data[i]; if (c == '\\' || c == '"') Print_Char (port, '\\'); if (c < ' ' || c >= '\177') Print_Special (port, c); else Print_Char (port, c); } Print_Char (port, '"'); GC_Unlink; } void Print_Special (Object port, register int c) { register char *fmt = "\\%c"; switch (c) { case '\b': c = 'b'; break; case '\t': c = 't'; break; case '\r': c = 'r'; break; case '\n': c = 'n'; break; default: fmt = "\\%03o"; } Printf (port, fmt, (unsigned char)c); } Object P_Format (int argc, Object *argv) { Object port, str; register int stringret = 0; GC_Node; port = argv[0]; if (TYPE(port) == T_Boolean) { if (Truep (port)) { port = Curr_Output_Port; } else { stringret++; port = P_Open_Output_String (); } } else if (TYPE(port) == T_Port) { Check_Output_Port (port); } else Wrong_Type_Combination (port, "port or #t or #f"); str = argv[1]; Check_Type (str, T_String); GC_Link (port); Format (port, STRING(str)->data, STRING(str)->size, argc-2, argv+2); GC_Unlink; return stringret ? P_Get_Output_String (port) : Void; } void Format (Object port, char const *fmt, unsigned int len, int argc, Object *argv) { register char const *s, *ep; char *p; register int c; char buf[256]; GC_Node; Alloca_Begin; GC_Link (port); Alloca (p, char*, len); memcpy (p, fmt, len); for (ep = p + len; p < ep; p++) { if (*p == '~') { if (++p == ep) break; if ((c = *p) == '~') { Print_Char (port, c); } else if (c == '%') { Print_Char (port, '\n'); } else if (c == 'e' || c == 'E') { s = strerror(Saved_Errno); sprintf (buf, "%c%s", isupper (*s) ? tolower (*s) : *s, *s ? "" : s+1); Print_Object (Make_String (buf, strlen (buf)), port, c == 'E', 0, 0); } else { if (--argc < 0) Primitive_Error ("too few arguments"); if (c == 's' || c == 'a') { Print_Object (*argv, port, c == 'a', Print_Depth (), Print_Length ()); argv++; } else if (c == 'c') { Check_Type (*argv, T_Character); Print_Char (port, CHAR(*argv)); argv++; } else Print_Char (port, c); } } else { Print_Char (port, *p); } } Alloca_End; GC_Unlink; } elk-3.99.8/src/feature.c0000644000175000017500000000612511577076306011726 00000000000000/* feature.c: provide, require, and related primitives. * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "config.h" #include #include "kernel.h" static Object Features; void Init_Features () { Features = Null; Global_GC_Link (Features); #ifdef CAN_DUMP P_Provide (Intern ("elk:dump")); #endif #ifdef CAN_LOAD_LIB P_Provide (Intern ("elk:load-lib")); #endif } Object P_Features () { return Features; } Object P_Featurep (Object sym) { Object member; Check_Type (sym, T_Symbol); member = P_Memq (sym, Features); return Truep (member) ? True : False; } Object P_Provide (Object sym) { Object member; Check_Type (sym, T_Symbol); member = P_Memq (sym, Features); if (!Truep (member)) Features = Cons (sym, Features); return Void; } static Object Feature_Filename (Object str) { struct S_String *sp = STRING(str); unsigned int len = sp->size; char *p; Object s; GC_Node; for (p = sp->data+len-1; p >= sp->data && *p != '.'; p--) ; if (p >= sp->data) return str; GC_Link (str); s = Make_String ((char *)0, len+4); memcpy (STRING(s)->data, STRING(str)->data, len); memcpy (STRING(s)->data+len, ".scm", 4); GC_Unlink; return s; } Object P_Require (int argc, Object *argv) { Object sym, a[1], isfeature; GC_Node; sym = argv[0]; GC_Link (sym); isfeature = P_Featurep (sym); if (!Truep (isfeature)) { if (argc == 3) Check_Type (argv[2], T_Environment); a[0] = argc == 1 ? Feature_Filename (SYMBOL(sym)->name) : argv[1]; if (Var_Is_True (V_Autoload_Notifyp)) Format (Standard_Output_Port, "[Autoloading ~a]~%", 18, 1, a); (void)General_Load (a[0], argc == 3 ? argv[2] : The_Environment); isfeature = P_Featurep (sym); if (!Truep (isfeature)) Primitive_Error ("feature ~s was not provided", sym); } GC_Unlink; return Void; } elk-3.99.8/src/heap-sc.c0000644000175000017500000002032611577076306011612 00000000000000/* heap-sc.c: Stop-and-copy garbage collector. * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include extern void Uncatchable_Error (char *); extern unsigned int Stack_Size (); extern void *sbrk(); #define Recursive_Visit(p) {\ register Object *pp = p;\ if (Stack_Size () > Max_Stack)\ Fatal_Error("stack overflow during GC (increase stack limit)");\ if (Types[TYPE(*pp)].haspointer) Visit (pp);\ } char *Heap_Start, *Hp, /* First free byte */ *Heap_End, /* Points behind free bytes */ *Free_Start, /* Start of free area */ *Free_End; /* Points behind free area */ static char *To; void Make_Heap (int size) { register unsigned int k = 1024 * size; register unsigned int s = 2 * k; if ((Hp = Heap_Start = (char *)sbrk (s)) == (char *)-1) Fatal_Error ("cannot allocate heap (%u KBytes)", 2*size); Heap_End = Heap_Start + k; Free_Start = Heap_End; Free_End = Free_Start + k; } void Free_Heap () { /* Do nothing. */ } Object Alloc_Object (int size, int type, int konst) { register char *p = Hp; Object ret; if (GC_Debug) { (void)P_Collect (); p = Hp; } ELK_ALIGN(p); if (p + size > Heap_End) { (void)P_Collect (); p = Hp; ELK_ALIGN(p); if (p + size > Heap_End - HEAP_MARGIN) Uncatchable_Error ("Out of heap space"); } Hp = p + size; *(Object *)p = Null; SET(ret, type, p); if (konst) SETCONST(ret); return ret; } Object P_Collect () { register char *tmp; register int msg = 0; Object a[2]; if (!Interpreter_Initialized) Fatal_Error ("heap too small (increase heap size)"); if (GC_In_Progress) Fatal_Error ("GC while GC in progress"); Disable_Interrupts; GC_In_Progress = 1; Call_Before_GC (); if (GC_Debug) { printf ("."); (void)fflush (stdout); } else if (Var_Is_True (V_Garbage_Collect_Notifyp)) { msg++; Format (Standard_Output_Port, "[Garbage collecting... ", 23, 0, (Object *)0); (void)fflush (stdout); } To = Free_Start; Visit_GC_List (Global_GC_Obj, 0); Visit_GC_List (GC_List, 0); Visit_Wind (First_Wind, 0); Hp = To; tmp = Heap_Start; Heap_Start = Free_Start; Free_Start = tmp; tmp = Heap_End; Heap_End = Free_End; Free_End = tmp; if (!GC_Debug) { if (msg) { a[0] = Make_Integer ((Hp-Heap_Start) / 1024); a[1] = Make_Integer ((Heap_End-Heap_Start) / 1024); Format (Standard_Output_Port, "~sK of ~sK]~%", 13, 2, a); } } Call_After_GC (); GC_In_Progress = 0; Enable_Interrupts; return Void; } int Visit (register Object *p) { register Object *tag; register int t, size, reloc = 0; again: t = TYPE(*p); if (!Types[t].haspointer) return 0; tag = (Object *)POINTER(*p); if ((char *)tag >= Free_Start && (char *)tag < Free_End) return 0; if (TYPE(*tag) == T_Broken_Heart) { SETPOINTER(*p, POINTER(*tag)); return 0; } ELK_ALIGN(To); switch (t) { case T_Bignum: size = sizeof (struct S_Bignum) - sizeof (gran_t) + BIGNUM(*p)->size * sizeof (gran_t); memcpy (To, tag, size); break; case T_Flonum: size = sizeof (struct S_Flonum); *(struct S_Flonum *)To = *(struct S_Flonum *)tag; break; case T_Symbol: size = sizeof (struct S_Symbol); *(struct S_Symbol *)To = *(struct S_Symbol *)tag; break; case T_Pair: case T_Environment: size = sizeof (struct S_Pair); *(struct S_Pair *)To = *(struct S_Pair *)tag; break; case T_String: size = sizeof (struct S_String) + STRING(*p)->size - 1; memcpy (To, tag, size); break; case T_Vector: size = sizeof (struct S_Vector) + (VECTOR(*p)->size - 1) * sizeof (Object); memcpy (To, tag, size); break; case T_Primitive: size = sizeof (struct S_Primitive); *(struct S_Primitive *)To = *(struct S_Primitive *)tag; break; case T_Compound: size = sizeof (struct S_Compound); *(struct S_Compound *)To = *(struct S_Compound *)tag; break; case T_Control_Point: size = sizeof (struct S_Control) + CONTROL(*p)->size - 1; reloc = To - (char *)tag; memcpy (To, tag, size); break; case T_Promise: size = sizeof (struct S_Promise); *(struct S_Promise *)To = *(struct S_Promise *)tag; break; case T_Port: size = sizeof (struct S_Port); *(struct S_Port *)To = *(struct S_Port *)tag; break; case T_Autoload: size = sizeof (struct S_Autoload); *(struct S_Autoload *)To = *(struct S_Autoload *)tag; break; case T_Macro: size = sizeof (struct S_Macro); *(struct S_Macro *)To = *(struct S_Macro *)tag; break; case T_Broken_Heart: Panic ("broken heart in GC"); default: if (t < 0 || t >= Num_Types) Panic ("bad type in GC"); if (Types[t].size == NOFUNC) size = Types[t].const_size; else size = (Types[t].size)(*p); memcpy (To, tag, size); } SETPOINTER(*p, To); SET(*tag, T_Broken_Heart, To); To += size; if (To > Free_End) Panic ("free exhausted in GC"); switch (t) { case T_Symbol: Recursive_Visit (&SYMBOL(*p)->next); Recursive_Visit (&SYMBOL(*p)->name); Recursive_Visit (&SYMBOL(*p)->value); p = &SYMBOL(*p)->plist; goto again; case T_Pair: case T_Environment: Recursive_Visit (&PAIR(*p)->car); p = &PAIR(*p)->cdr; goto again; case T_Vector: { register int i, n; for (i = 0, n = VECTOR(*p)->size; i < n; i++) Recursive_Visit (&VECTOR(*p)->data[i]); break; } case T_Compound: Recursive_Visit (&COMPOUND(*p)->closure); Recursive_Visit (&COMPOUND(*p)->env); p = &COMPOUND(*p)->name; goto again; case T_Control_Point: Recursive_Visit (&CONTROL(*p)->memsave); CONTROL(*p)->delta += reloc; #ifdef HAVE_ALLOCA Visit_GC_List (CONTROL(*p)->gclist, CONTROL(*p)->delta); #else Recursive_Visit (&CONTROL(*p)->gcsave); #endif Visit_Wind (CONTROL(*p)->firstwind, CONTROL(*p)->delta); p = &CONTROL(*p)->env; goto again; case T_Promise: Recursive_Visit (&PROMISE(*p)->env); p = &PROMISE(*p)->thunk; goto again; case T_Port: p = &PORT(*p)->name; goto again; case T_Autoload: Recursive_Visit (&AUTOLOAD(*p)->files); p = &AUTOLOAD(*p)->env; goto again; case T_Macro: Recursive_Visit (&MACRO(*p)->body); p = &MACRO(*p)->name; goto again; default: if (Types[t].visit) (Types[t].visit)(p, Visit); } return 0; } Object Internal_GC_Status (strat, flags) { return (Cons (Sym_Stop_And_Copy_GC, Null)); } elk-3.99.8/src/debug.c0000644000175000017500000000447411577076306011366 00000000000000/* debug.c: The primitive `backtrace-list'. * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "config.h" #include "kernel.h" Object P_Backtrace_List (int argc, Object *argv) { register GCNODE *p, *gp = GC_List; register int delta = 0; Object cp, list, tail, cell, vec; GC_Node3; if (argc > 0) { cp = argv[0]; Check_Type (cp, T_Control_Point); delta = CONTROL(cp)->delta; gp = CONTROL(cp)->gclist; } vec = list = tail = Null; GC_Link3 (vec, list, tail); for ( ; gp; gp = p->next) { p = (GCNODE *)NORM(gp); switch (p->gclen) { case TAG_ENV: vec = Make_Vector (3, Null); VECTOR(vec)->data[2] = *(Object *)NORM(p->gcobj); break; case TAG_FUN: case TAG_TCFUN: VECTOR(vec)->data[0] = *(Object *)NORM(p->gcobj); break; case TAG_ARGS: VECTOR(vec)->data[1] = *(Object *)NORM(p->gcobj); cell = Cons (vec, Null); if (Nullp (list)) list = cell; else (void)P_Set_Cdr (tail, cell); tail = cell; } } GC_Unlink; return list; } elk-3.99.8/src/stab-convex.c0000644000175000017500000000541411577076306012524 00000000000000/* stab-convex.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include #include #include #include #include #include #include #include #include #ifdef INIT_OBJECTS SYMTAB *Open_File_And_Snarf_Symbols (char *name) { int f, n, len = 0; char *base; struct filehdr *fhp; struct opthdr *ohp; struct nlist *np; SYMTAB *tab; SYM *sp, **nextp; if ((f = open (name, O_RDONLY)) == -1) { Saved_Errno = errno; Primitive_Error ("can't open a.out file: ~E"); } if ((base = mmap (0xc0000000, &len, PROT_READ, MAP_FILE, f, (off_t)0)) == (char *)-1) { Saved_Errno = errno; Primitive_Error ("can't mmap a.out file: ~E"); } close (f); fhp = (struct filehdr *)base; tab = (SYMTAB *)Safe_Malloc (sizeof (SYMTAB)); tab->first = 0; tab->strings = Safe_Malloc ((unsigned int)fhp->h_strsiz); memcpy (tab->strings, base + fhp->h_strptr, (unsigned int)fhp->h_strsiz); nextp = &tab->first; ohp = (struct opthdr *)(base + sizeof *fhp); np = (struct nlist *)(base + ohp->o_symptr); for (n = 0; n < ohp->o_nsyms; n++, np++) { if (np->n_un.n_strx == 0 || np->n_type & N_STAB) continue; if ((np->n_type & N_TYPE) != N_TEXT) continue; sp = (SYM *)Safe_Malloc (sizeof (SYM)); sp->name = tab->strings + np->n_un.n_strx; sp->value = np->n_value; *nextp = sp; nextp = &sp->next; *nextp = 0; } (void)munmap (base, len); return tab; } #endif elk-3.99.8/src/load.c0000644000175000017500000001121411577076306011205 00000000000000/* load.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "config.h" #include #include "kernel.h" Object V_Load_Path, V_Load_Noisilyp, V_Load_Libraries; char *Loader_Input; /* tmp file name used by load.xx.c */ extern void Switch_Environment (Object); #ifdef CAN_LOAD_LIB extern void Load_Library (Object libs); #endif void Load_Source (Object); void Init_Load () { Define_Variable (&V_Load_Path, "load-path", Cons (Make_String (".", 1), Cons (Make_String (Scm_Dir, strlen (Scm_Dir)), Cons (Make_String (Lib_Dir, strlen (Lib_Dir)), Null)))); Define_Variable (&V_Load_Noisilyp, "load-noisily?", False); Define_Variable (&V_Load_Libraries, "load-libraries", Make_String ("", 0)); } void Init_Loadpath (char *s) { /* No GC possible here */ register char *p; Object path; path = Null; if (s[0] == '\0') return; while (1) { for (p = s; *p && *p != ':'; p++) ; path = Cons (Make_String (s, p-s), path); if (*p == '\0') break; s = ++p; } Var_Set (V_Load_Path, P_Reverse (path)); } int Has_Suffix (Object name, char const *suffix) { register char *p; register unsigned int len = strlen(suffix); register struct S_String *str; if (TYPE(name) == T_Symbol) name = SYMBOL(name)->name; str = STRING(name); p = str->data + str->size - len; return len <= str->size && !strncasecmp(p, suffix, len); } void Check_Loadarg (Object x) { Object tail; register int t = TYPE(x); if (t == T_Symbol || t == T_String) return; if (t != T_Pair) Wrong_Type_Combination (x, "string, symbol, or list"); for (tail = x; !Nullp (tail); tail = Cdr (tail)) { Object f; f = Car (tail); if (TYPE(f) != T_Symbol && TYPE(f) != T_String) Wrong_Type_Combination (f, "string or symbol"); if (!Has_Suffix (f, ".la")) Primitive_Error ("~s: not an object file", f); } } Object General_Load (Object what, Object env) { Object oldenv; GC_Node; Check_Type (env, T_Environment); oldenv = The_Environment; GC_Link (oldenv); Switch_Environment (env); Check_Loadarg (what); if (TYPE(what) == T_Pair) { if (Has_Suffix (Car (what), ".la")) #ifdef CAN_LOAD_LIB Load_Library (what) #endif ; } else if (Has_Suffix (what, ".la")) #ifdef CAN_LOAD_LIB Load_Library (Cons (what, Null)) #endif ; else Load_Source (what); Switch_Environment (oldenv); GC_Unlink; return Void; } Object P_Load (int argc, Object *argv) { return General_Load (argv[0], argc == 1 ? The_Environment : argv[1]); } void Load_Source_Port (Object port) { Object val; GC_Node; TC_Prolog; GC_Link (port); while (1) { val = General_Read (port, 1); if (TYPE(val) == T_End_Of_File) break; TC_Disable; val = Eval (val); TC_Enable; if (Var_Is_True (V_Load_Noisilyp)) { Print (val); (void)P_Newline (0, (Object *)0); } } GC_Unlink; } void Load_Source (Object name) { Object port; GC_Node; port = General_Open_File (name, P_INPUT, Var_Get (V_Load_Path)); GC_Link (port); Load_Source_Port (port); (void)P_Close_Input_Port (port); GC_Unlink; } /* Interface to P_Load() for use by applications. */ void Load_File (char *name) { Object arg; arg = Make_String(name, strlen(name)); (void)P_Load(1, &arg); } elk-3.99.8/src/bignum.c0000644000175000017500000005534511577076306011564 00000000000000/* bignum.c: Bignum functions. * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "config.h" #include #include #include #include "kernel.h" #ifndef DBL_MAX # ifdef HUGE_VAL # define DBL_MAX HUGE_VAL # else # define DBL_MAX (3.40282e+38) # endif #endif static void Bignum_Mult_In_Place (register struct S_Bignum *, int); static void Bignum_Add_In_Place (register struct S_Bignum *, int); static int Bignum_Div_In_Place (register struct S_Bignum *, int); Object Make_Uninitialized_Bignum (int size) { Object big; big = Alloc_Object ((sizeof (struct S_Bignum) - sizeof (gran_t)) + (size * sizeof (gran_t)), T_Bignum, 0); BIGNUM(big)->minusp = False; BIGNUM(big)->size = size; BIGNUM(big)->usize = 0; return big; } Object Copy_Bignum (Object x) { Object big; register int size; GC_Node; GC_Link (x); big = Make_Uninitialized_Bignum (size = BIGNUM(x)->usize); BIGNUM(big)->minusp = BIGNUM(x)->minusp; BIGNUM(big)->usize = size; memcpy (BIGNUM(big)->data, BIGNUM(x)->data, size * sizeof (gran_t)); GC_Unlink; return big; } Object Copy_S_Bignum (struct S_Bignum *s) { Object big; register int size; big = Make_Uninitialized_Bignum (size = s->usize); BIGNUM(big)->minusp = s->minusp; BIGNUM(big)->usize = size; memcpy (BIGNUM(big)->data, s->data, size * sizeof (gran_t)); return big; } Object Make_Bignum (char const *buf, int neg, int radix) { Object big; register char const *p; register int c; register int size = (strlen (buf) + 4) / 4; big = Make_Uninitialized_Bignum (size); BIGNUM(big)->minusp = neg ? True : False; p = buf; while ((c = *p++)) { Bignum_Mult_In_Place (BIGNUM(big), radix); if (radix == 16) { if (isupper (c)) c = tolower (c); if (c >= 'a') c = '9' + c - 'a' + 1; } Bignum_Add_In_Place (BIGNUM(big), c - '0'); } Bignum_Normalize_In_Place (BIGNUM(big)); /* to avoid -0 */ return big; } Object Reduce_Bignum (Object x) { unsigned int ret = 0; int i, shift = 0, size = BIGNUM(x)->usize; int digits = sizeof(int)/2; if (size > digits) return x; for (i = 0; i < digits && i < size; i++, shift += 16) ret |= (unsigned int)BIGNUM(x)->data[i] << shift; if (Truep (BIGNUM(x)->minusp)) { if (ret > (~(unsigned int)0 >> 1) + 1) return x; return Make_Integer (-ret); } else { if (ret > ~(unsigned int)0 >> 1) return x; return Make_Integer (ret); } } static void Bignum_Mult_In_Place (register struct S_Bignum *x, int n) { register unsigned int i = x->usize; register gran_t *p = x->data; register unsigned int j; register unsigned int k = 0; for (j = 0; j < i; ++j) { k += n * *p; *p++ = k; k >>= 16; } if (k) { if (i >= x->size) Panic ("Bignum_Mult_In_Place"); *p++ = k; x->usize++; } } static void Bignum_Add_In_Place (register struct S_Bignum *x, int n) { register unsigned int i = x->usize; register gran_t *p = x->data; register unsigned int j = 0; register unsigned int k = n; if (i == 0) goto extend; k += *p; *p++ = k; while (k >>= 16) { if (++j >= i) { extend: if (i >= x->size) Panic ("Bignum_Add_In_Place"); *p++ = k; x->usize++; return; } k += *p; *p++ = k; } } static int Bignum_Div_In_Place (register struct S_Bignum *x, int n) { register int i = x->usize; register gran_t *p = x->data + i; register unsigned int k = 0; for ( ; i; --i) { k <<= 16; k += *--p; *p = k / n; k %= n; } Bignum_Normalize_In_Place (x); return k; } void Bignum_Normalize_In_Place (register struct S_Bignum *x) { register int i = x->usize; register gran_t *p = x->data + i; while (i && !*--p) --i; x->usize = i; if (!i) x->minusp = False; } void Print_Bignum (Object port, Object x) { register char *p; char *buf; register int size; struct S_Bignum *big; Alloca_Begin; if (Bignum_Zero (x)) { Printf (port, "0"); return; } size = BIGNUM(x)->usize * 5 + 3; Alloca (buf, char*, size + 1); p = buf + size; *p = 0; size = (sizeof (struct S_Bignum) - sizeof (gran_t)) + BIGNUM(x)->usize * sizeof (gran_t); Alloca (big, struct S_Bignum*, size); memcpy (big, POINTER(x), size); big->size = BIGNUM(x)->usize; while (big->usize) { register unsigned int bigdig = Bignum_Div_In_Place (big, 10000); *--p = '0' + bigdig % 10; bigdig /= 10; *--p = '0' + bigdig % 10; bigdig /= 10; *--p = '0' + bigdig % 10; bigdig /= 10; *--p = '0' + bigdig; } while (*p == '0') ++p; if (Truep (BIGNUM(x)->minusp)) Printf (port, "-"); Format (port, p, strlen (p), 0, (Object *)0); Alloca_End; } Object Bignum_To_String (Object x, int radix) { register char *p; char *buf; register unsigned int div, ndig, size; struct S_Bignum *big; Object ret; Alloca_Begin; if (Bignum_Zero (x)) return Make_String ("0", 1); size = BIGNUM(x)->usize * (radix == 2 ? 17 : 6) + 3; Alloca (buf, char*, size + 1); p = buf + size; *p = 0; size = (sizeof (struct S_Bignum) - sizeof (gran_t)) + BIGNUM(x)->usize * sizeof (gran_t); Alloca (big, struct S_Bignum*, size); memcpy (big, POINTER(x), size); big->size = BIGNUM(x)->usize; switch (radix) { case 2: div = 65536; ndig = 16; break; case 8: div = 32768; ndig = 5; break; case 10: div = 10000; ndig = 4; break; case 16: default: /* Just to avoid compiler warnings */ div = 65536; ndig = 4; break; } while (big->usize) { register unsigned int bigdig = Bignum_Div_In_Place (big, div); register unsigned int i; for (i = 0; i < ndig; i++) { *--p = '0' + bigdig % radix; if (*p > '9') *p = 'A' + (*p - '9') - 1; bigdig /= radix; } } while (*p == '0') ++p; if (Truep (BIGNUM(x)->minusp)) *--p = '-'; ret = Make_String (p, strlen (p)); Alloca_End; return ret; } int Bignum_To_Integer (Object x) { unsigned int ret = 0; int i, shift = 0, size = BIGNUM(x)->usize; int digits = sizeof(int)/2; if (size > digits) err: Primitive_Error ("integer out of range: ~s", x); for (i = 0; i < digits && i < size; i++, shift += 16) ret |= (unsigned int)BIGNUM(x)->data[i] << shift; if (Truep (BIGNUM(x)->minusp)) { if (ret > (~(unsigned int)0 >> 1) + 1) goto err; return -ret; } else { if (ret > ~(unsigned int)0 >> 1) goto err; return ret; } } unsigned int Bignum_To_Unsigned (Object x) { unsigned int ret = 0; int i, shift = 0, size = BIGNUM(x)->usize; int digits = sizeof(int)/2; if (size > digits || Truep (BIGNUM(x)->minusp)) Primitive_Error ("integer out of range: ~s", x); for (i = 0; i < digits && i < size; i++, shift += 16) ret |= (unsigned int)BIGNUM(x)->data[i] << shift; return ret; } long Bignum_To_Long (Object x) { unsigned long int ret = 0; int i, shift = 0, size = BIGNUM(x)->usize; int digits = sizeof(long)/2; if (size > digits) err: Primitive_Error ("integer out of range: ~s", x); for (i = 0; i < digits && i < size; i++, shift += 16) ret |= (unsigned long int)BIGNUM(x)->data[i] << shift; if (Truep (BIGNUM(x)->minusp)) { if (ret > (~(unsigned long int)0 >> 1) + 1) goto err; return -ret; } else { if (ret > ~(unsigned long int)0 >> 1) goto err; return ret; } } unsigned long int Bignum_To_Unsigned_Long (Object x) { unsigned long int ret = 0; int i, shift = 0, size = BIGNUM(x)->usize; int digits = sizeof(long)/2; if (size > digits || Truep (BIGNUM(x)->minusp)) Primitive_Error ("integer out of range: ~s", x); for (i = 0; i < digits && i < size; i++, shift += 16) ret |= (unsigned long int)BIGNUM(x)->data[i] << shift; return ret; } Object Integer_To_Bignum (int i) { int k, digits = sizeof(int)/2; Object big; unsigned int n = i; big = Make_Uninitialized_Bignum (digits); if (i < 0) { BIGNUM(big)->minusp = True; n = -i; } for (k = 0; k < digits; k++, n >>= 16) BIGNUM(big)->data[k] = n & 0xffff; BIGNUM(big)->usize = k; Bignum_Normalize_In_Place (BIGNUM(big)); return big; } Object Unsigned_To_Bignum (unsigned int i) { int k, digits = sizeof(int)/2; Object big; big = Make_Uninitialized_Bignum (digits); for (k = 0; k < digits; k++, i >>= 16) BIGNUM(big)->data[k] = i & 0xffff; BIGNUM(big)->usize = k; Bignum_Normalize_In_Place (BIGNUM(big)); return big; } Object Long_To_Bignum (long i) { int k, digits = sizeof(long)/2; Object big; unsigned long int n = i; big = Make_Uninitialized_Bignum (digits); if (i < 0) { BIGNUM(big)->minusp = True; n = -i; } for (k = 0; k < digits; k++, n >>= 16) BIGNUM(big)->data[k] = n & 0xffff; BIGNUM(big)->usize = k; Bignum_Normalize_In_Place (BIGNUM(big)); return big; } Object Unsigned_Long_To_Bignum (unsigned long int i) { int k, digits = sizeof(long)/2; Object big; big = Make_Uninitialized_Bignum (digits); for (k = 0; k < digits; k++, i >>= 16) BIGNUM(big)->data[k] = i & 0xffff; BIGNUM(big)->usize = k; Bignum_Normalize_In_Place (BIGNUM(big)); return big; } Object Double_To_Bignum (double d) { /* Truncates the double */ Object big; int expo, size; double mantissa = frexp (d, &expo); register gran_t *p; if (expo <= 0 || mantissa == 0.0) return Make_Uninitialized_Bignum (0); size = (expo + (16-1)) / 16; big = Make_Uninitialized_Bignum (size); BIGNUM(big)->usize = size; if (mantissa < 0.0) { BIGNUM(big)->minusp = True; mantissa = -mantissa; } p = BIGNUM(big)->data; memset (p, 0, size * sizeof (gran_t)); p += size; if (expo &= (16-1)) mantissa = ldexp (mantissa, expo - 16); while (mantissa != 0.0) { if (--size < 0) break; /* inexact */ mantissa *= 65536.0; *--p = (int)mantissa; mantissa -= *p; } Bignum_Normalize_In_Place (BIGNUM(big)); /* Probably not needed */ return Reduce_Bignum (big); } double Bignum_To_Double (Object x) { /* error if it ain't fit */ double rx = 0.0; register int i = BIGNUM(x)->usize; register gran_t *p = BIGNUM(x)->data + i; for (i = BIGNUM(x)->usize; --i >= 0; ) { if (rx >= DBL_MAX / 65536.0) Primitive_Error ("cannot coerce to real: ~s", x); rx *= 65536.0; rx += *--p; } if (Truep (BIGNUM(x)->minusp)) rx = -rx; return rx; } int Bignum_Zero (Object x) { return BIGNUM(x)->usize == 0; } int Bignum_Negative (Object x) { return Truep (BIGNUM(x)->minusp); } int Bignum_Positive (Object x) { return !Truep (BIGNUM(x)->minusp) && BIGNUM(x)->usize != 0; } int Bignum_Even (Object x) { return BIGNUM(x)->usize == 0 || (BIGNUM(x)->data[0] & 1) == 0; } Object Bignum_Abs (Object x) { Object big; big = Copy_Bignum (x); BIGNUM(big)->minusp = False; return big; } int Bignum_Mantissa_Cmp (register struct S_Bignum *x, register struct S_Bignum *y) { register unsigned int i = x->usize; if (i < y->usize) return -1; else if (i > y->usize) return 1; else { register gran_t *xbuf = x->data + i; register gran_t *ybuf = y->data + i; for ( ; i; --i) { register int n; if ((n = (int)*--xbuf - (int)*--ybuf)) return n; } return 0; } } int Bignum_Cmp (register struct S_Bignum *x, register struct S_Bignum *y) { register int xm = Truep (x->minusp); register int ym = Truep (y->minusp); if (xm) { if (ym) return -Bignum_Mantissa_Cmp (x, y); else return -1; } else { if (ym) return 1; else return Bignum_Mantissa_Cmp (x, y); } } int Bignum_Equal (Object x, Object y) { return Bignum_Cmp (BIGNUM(x), BIGNUM(y)) == 0; } int Bignum_Less (Object x, Object y) { return Bignum_Cmp (BIGNUM(x), BIGNUM(y)) < 0; } int Bignum_Greater (Object x, Object y) { return Bignum_Cmp (BIGNUM(x), BIGNUM(y)) > 0; } int Bignum_Eq_Less (Object x, Object y) { return Bignum_Cmp (BIGNUM(x), BIGNUM(y)) <= 0; } int Bignum_Eq_Greater (Object x, Object y) { return Bignum_Cmp (BIGNUM(x), BIGNUM(y)) >= 0; } Object General_Bignum_Plus_Minus (Object x, Object y, int neg) { Object big; int size, xsize, ysize, xminusp, yminusp; GC_Node2; GC_Link2 (x,y); xsize = BIGNUM(x)->usize; ysize = BIGNUM(y)->usize; xminusp = Truep (BIGNUM(x)->minusp); yminusp = Truep (BIGNUM(y)->minusp); if (neg) yminusp = !yminusp; size = xsize > ysize ? xsize : ysize; if (xminusp == yminusp) size++; big = Make_Uninitialized_Bignum (size); BIGNUM(big)->usize = size; GC_Unlink; if (xminusp == yminusp) { /* Add x and y */ register unsigned int k = 0; register int i; register gran_t *xbuf = BIGNUM(x)->data; register gran_t *ybuf = BIGNUM(y)->data; register gran_t *zbuf = BIGNUM(big)->data; for (i = 0; i < size; ++i) { if (i < xsize) k += *xbuf++; if (i < ysize) k += *ybuf++; *zbuf++ = k; k >>= 16; } } else { if (Bignum_Mantissa_Cmp (BIGNUM(x), BIGNUM(y)) < 0) { Object temp; temp = x; x = y; y = temp; xsize = ysize; ysize = BIGNUM(y)->usize; xminusp = yminusp; } /* Subtract y from x */ { register unsigned int k = 1; register int i; register gran_t *xbuf = BIGNUM(x)->data; register gran_t *ybuf = BIGNUM(y)->data; register gran_t *zbuf = BIGNUM(big)->data; for (i = 0; i < size; ++i) { if (i < xsize) k += *xbuf++; else Panic ("General_Bignum_Plus_Minus"); if (i < ysize) k += ~*ybuf++ & 0xFFFF; else k += 0xFFFF; *zbuf++ = k; k >>= 16; } } } BIGNUM(big)->minusp = xminusp ? True : False; Bignum_Normalize_In_Place (BIGNUM(big)); return Reduce_Bignum (big); } Object Bignum_Plus (Object x, Object y) { /* bignum + bignum */ return General_Bignum_Plus_Minus (x, y, 0); } Object Bignum_Minus (Object x, Object y) { /* bignum - bignum */ return General_Bignum_Plus_Minus (x, y, 1); } Object Bignum_Fixnum_Multiply (Object x, Object y) { /* bignum * fixnum */ Object big; register int size, xsize, i; register gran_t *xbuf, *zbuf; int fix = FIXNUM(y); register unsigned int yl, yh; GC_Node; GC_Link (x); xsize = BIGNUM(x)->usize; size = xsize + 2; big = Make_Uninitialized_Bignum (size); BIGNUM(big)->usize = size; if (Truep (BIGNUM(x)->minusp) != (fix < 0)) BIGNUM(big)->minusp = True; memset (BIGNUM(big)->data, 0, size * sizeof (gran_t)); xbuf = BIGNUM(x)->data; if (fix < 0) fix = -fix; yl = fix & 0xFFFF; yh = fix >> 16; zbuf = BIGNUM(big)->data; for (i = 0; i < xsize; ++i) { register unsigned int xf = xbuf[i]; register unsigned int k = 0; register gran_t *r = zbuf + i; k += xf * yl + *r; *r++ = k; k >>= 16; k += xf * yh + *r; *r++ = k; k >>= 16; *r = k; } GC_Unlink; Bignum_Normalize_In_Place (BIGNUM(big)); return Reduce_Bignum (big); } Object Bignum_Multiply (Object x, Object y) { /* bignum * bignum */ Object big; register int size, xsize, ysize, i, j; register gran_t *xbuf, *ybuf, *zbuf; GC_Node2; GC_Link2 (x, y); xsize = BIGNUM(x)->usize; ysize = BIGNUM(y)->usize; size = xsize + ysize; big = Make_Uninitialized_Bignum (size); BIGNUM(big)->usize = size; if (!EQ(BIGNUM(x)->minusp, BIGNUM(y)->minusp)) BIGNUM(big)->minusp = True; memset (BIGNUM(big)->data, 0, size * sizeof (gran_t)); xbuf = BIGNUM(x)->data; ybuf = BIGNUM(y)->data; zbuf = BIGNUM(big)->data; for (i = 0; i < xsize; ++i) { register unsigned int xf = xbuf[i]; register unsigned int k = 0; register gran_t *p = ybuf; register gran_t *r = zbuf + i; for (j = 0; j < ysize; ++j) { k += xf * *p++ + *r; *r++ = k; k >>= 16; } *r = k; } GC_Unlink; Bignum_Normalize_In_Place (BIGNUM(big)); return Reduce_Bignum (big); } /* Returns cons cell (quotient . remainder); cdr is a fixnum */ Object Bignum_Fixnum_Divide (Object x, Object y) { /* bignum / fixnum */ Object big; register int xsize, i; register gran_t *xbuf, *zbuf; int fix = FIXNUM(y); int xminusp, yminusp = 0; register unsigned int rem; GC_Node; GC_Link (x); if (fix < 0) { fix = -fix; yminusp = 1; } if (fix > 0xFFFF) { big = Integer_To_Bignum (FIXNUM(y)); GC_Unlink; return Bignum_Divide (x, big); } xsize = BIGNUM(x)->usize; big = Make_Uninitialized_Bignum (xsize); BIGNUM(big)->usize = xsize; xminusp = Truep (BIGNUM(x)->minusp); if (xminusp != yminusp) BIGNUM(big)->minusp = True; xbuf = BIGNUM(x)->data; zbuf = BIGNUM(big)->data; rem = 0; for (i = xsize; --i >= 0; ) { rem <<= 16; rem += xbuf[i]; zbuf[i] = rem / fix; rem %= fix; } GC_Unlink; Bignum_Normalize_In_Place (BIGNUM(big)); if (xminusp) rem = -(int)rem; return Cons (Reduce_Bignum (big), Make_Integer ((int)rem)); } /* Returns cons cell (quotient . remainder); cdr is a fixnum */ Object Bignum_Divide (Object x, Object y) { /* bignum / bignum */ struct S_Bignum *dend, *dor; int quotsize, dendsize, dorsize, scale; unsigned int dor1, dor2; Object quot, rem; register gran_t *qp, *dendp; GC_Node2; Alloca_Begin; if (BIGNUM(y)->usize < 2) return Bignum_Fixnum_Divide (x, Make_Integer (Bignum_To_Integer (y))); GC_Link2 (x, y); quotsize = BIGNUM(x)->usize - BIGNUM(y)->usize + 1; if (quotsize < 0) quotsize = 0; quot = Make_Uninitialized_Bignum (quotsize); GC_Unlink; dendsize = (sizeof (struct S_Bignum) - sizeof (gran_t)) + (BIGNUM(x)->usize + 1) * sizeof (gran_t); Alloca (dend, struct S_Bignum*, dendsize); memcpy (dend, POINTER(x), dendsize); dend->size = BIGNUM(x)->usize + 1; if (quotsize == 0 || Bignum_Mantissa_Cmp (dend, BIGNUM(y)) < 0) goto zero; dorsize = (sizeof (struct S_Bignum) - sizeof (gran_t)) + BIGNUM (y)->usize * sizeof (gran_t); Alloca (dor, struct S_Bignum*, dorsize); memcpy (dor, POINTER(y), dorsize); dor->size = dorsize = BIGNUM(y)->usize; scale = 65536 / (unsigned int)(dor->data[dor->usize - 1] + 1); Bignum_Mult_In_Place (dend, scale); if (dend->usize < dend->size) dend->data[dend->usize++] = 0; Bignum_Mult_In_Place (dor, scale); BIGNUM(quot)->usize = BIGNUM(quot)->size; qp = BIGNUM(quot)->data + BIGNUM(quot)->size; dendp = dend->data + dend->usize; dor1 = dor->data[dor->usize - 1]; dor2 = dor->data[dor->usize - 2]; while (qp > BIGNUM(quot)->data) { unsigned int msw, guess; int k; register gran_t *dep, *dop, *edop; msw = dendp[-1] << 16 | dendp[-2]; guess = msw / dor1; if (guess >= 65536) /* [65535, 0, 0] / [65535, 65535] */ guess = 65535; for (;;) { unsigned int d1, d2, d3; d3 = dor2 * guess; d2 = dor1 * guess + (d3 >> 16); d3 &= 0xFFFF; d1 = d2 >> 16; d2 &= 0xFFFF; if (d1 < dendp[-1] || (d1 == dendp[-1] && (d2 < dendp[-2] || (d2 == dendp[-2] && d3 <= dendp[-3])))) break; --guess; } --dendp; k = 0; dep = dendp - dorsize; for (dop = dor->data, edop = dop + dor->usize; dop < edop; ) { register unsigned int prod = *dop++ * guess; k += *dep; k -= prod & 0xFFFF; *dep++ = k; ASR(k, 16); k -= prod >> 16; } k += *dep; *dep = k; if (k < 0) { k = 0; dep = dendp - dorsize; for (dop = dor->data, edop = dop + dor->usize; dop < edop; ) { k += *dep + *dop++; *dep++ = k; ASR(k, 16); } k += *dep; *dep = k; --guess; } *--qp = guess; } if (Bignum_Div_In_Place (dend, scale)) Panic ("Bignum_Div scale"); zero: dend->minusp = BIGNUM(x)->minusp; if (Truep (dend->minusp) != Truep (BIGNUM(y)->minusp)) BIGNUM(quot)->minusp = True; Bignum_Normalize_In_Place (BIGNUM(quot)); Bignum_Normalize_In_Place (dend); GC_Link (quot); rem = Reduce_Bignum (Copy_S_Bignum (dend)); GC_Unlink; Alloca_End; return Cons (Reduce_Bignum (quot), rem); } elk-3.99.8/src/stab-elf.c0000644000175000017500000001230711577076306011767 00000000000000/* stab-elf.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include "kernel.h" extern void Free_Symbols (SYMTAB *); SYMTAB * Snarf_Symbols (int lf) { SYMTAB *tab = NULL; register SYM *sp, **nextp; Elf *elf_ptr; Elf_Scn *elf_scn_ptr = NULL, *symtab_scn_ptr = NULL; Elf_Data *elf_data_ptr = NULL; Elf32_Ehdr *elf_ehdr_ptr = NULL; Elf32_Shdr *elf_shdr_ptr = NULL, *symtab_ptr = NULL; size_t elf_str_index = 0, shstrndx; char *section_name; if (elf_version (EV_CURRENT) == EV_NONE) Primitive_Error ("a.out file Elf version out of date"); if ((elf_ptr = elf_begin (lf, ELF_C_READ, (Elf *)NULL)) == NULL) Primitive_Error ("can't elf_begin() a.out file"); /* * get the elf header, so we'll know where to look for the section * names. */ if ((elf_ehdr_ptr = elf32_getehdr (elf_ptr)) == NULL) { Primitive_Error ("no elf header in a.out file"); } shstrndx = elf_ehdr_ptr->e_shstrndx; /* look for the symbol and string tables */ while ((elf_scn_ptr = elf_nextscn (elf_ptr, elf_scn_ptr))) { if ((elf_shdr_ptr = elf32_getshdr (elf_scn_ptr)) == NULL) Primitive_Error ("can't get section header in a.out file"); if (elf_shdr_ptr->sh_type == SHT_STRTAB) { /* * save the index to the string table for later use by * elf_strptr(). */ section_name = elf_strptr (elf_ptr, shstrndx, (size_t)elf_shdr_ptr->sh_name); if (strcmp (section_name, ".strtab") == 0 || strcmp (section_name, ".dynstr") == 0) { elf_str_index = elf_ndxscn (elf_scn_ptr); } } else if (elf_shdr_ptr->sh_type == SHT_SYMTAB || elf_shdr_ptr->sh_type == SHT_DYNSYM) { symtab_ptr = elf_shdr_ptr; symtab_scn_ptr = elf_scn_ptr; } } if (!symtab_ptr) Primitive_Error ("no symbol table in a.out file"); if (!elf_str_index) Primitive_Error ("no string table in a.out file"); /* * we've located the symbol table -- go through it and save the names * of the interesting symbols. */ while ((elf_data_ptr = elf_getdata (symtab_scn_ptr, elf_data_ptr))) { char *name = NULL; unsigned int symbol_count; Elf32_Sym *symbol_ptr = elf_data_ptr->d_buf; Elf32_Sym *current_symbol; tab = (SYMTAB *)Safe_Malloc (sizeof (SYMTAB)); tab->first = 0; tab->strings = 0; nextp = &tab->first; for (symbol_count = 1; /* < was <= in the version I received from the author, but * the last entry is always undefined: */ symbol_count < symtab_ptr->sh_size / symtab_ptr->sh_entsize; symbol_count++) { current_symbol = symbol_ptr + symbol_count; if (ELF32_ST_TYPE(current_symbol->st_info) != STT_FUNC || ELF32_ST_BIND(current_symbol->st_info) != STB_GLOBAL) { continue; } if ((name = elf_strptr (elf_ptr, elf_str_index, (size_t)current_symbol->st_name)) == NULL) { Free_Symbols (tab); (void)close (lf); Primitive_Error (elf_errmsg (elf_errno ())); } sp = (SYM *)Safe_Malloc (sizeof (SYM)); sp->name = Safe_Malloc (strlen (name) + 1); strcpy (sp->name, name); sp->value = current_symbol->st_value; *nextp = sp; nextp = &sp->next; *nextp = 0; } } return tab; } SYMTAB * Open_File_And_Snarf_Symbols (name) char *name; { int f; SYMTAB *tab; if ((f = open (name, O_RDONLY)) == -1) Primitive_Error ("can't open a.out file"); tab = Snarf_Symbols (f); (void)close (f); return tab; } elk-3.99.8/src/Makefile.in0000644000175000017500000016117011577103435012170 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = elk$(EXEEXT) subdir = src DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" LTLIBRARIES = $(lib_LTLIBRARIES) libelk_la_DEPENDENCIES = am__libelk_la_SOURCES_DIST = autoload.c bignum.c bool.c char.c cont.c \ cstring.c debug.c dump.c env.c error.c exception.c feature.c \ heap.c io.c libelk.c list.c load.c loadlib.c malloc.c math.c \ onfork.c prim.c print.c proc.c promise.c read.c special.c \ stab.c stab-elf.c stab-vanilla.c stkmem.c string.c symbol.c \ terminate.c type.c vector.c @HAVE_LIBELF_TRUE@am__objects_1 = libelk_la-stab-elf.lo @HAVE_LIBELF_FALSE@am__objects_2 = libelk_la-stab-vanilla.lo am__objects_3 = am_libelk_la_OBJECTS = libelk_la-autoload.lo libelk_la-bignum.lo \ libelk_la-bool.lo libelk_la-char.lo libelk_la-cont.lo \ libelk_la-cstring.lo libelk_la-debug.lo libelk_la-dump.lo \ libelk_la-env.lo libelk_la-error.lo libelk_la-exception.lo \ libelk_la-feature.lo libelk_la-heap.lo libelk_la-io.lo \ libelk_la-libelk.lo libelk_la-list.lo libelk_la-load.lo \ libelk_la-loadlib.lo libelk_la-malloc.lo libelk_la-math.lo \ libelk_la-onfork.lo libelk_la-prim.lo libelk_la-print.lo \ libelk_la-proc.lo libelk_la-promise.lo libelk_la-read.lo \ libelk_la-special.lo libelk_la-stab.lo $(am__objects_1) \ $(am__objects_2) libelk_la-stkmem.lo libelk_la-string.lo \ libelk_la-symbol.lo libelk_la-terminate.lo libelk_la-type.lo \ libelk_la-vector.lo $(am__objects_3) libelk_la_OBJECTS = $(am_libelk_la_OBJECTS) libelk_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libelk_la_CFLAGS) \ $(CFLAGS) $(libelk_la_LDFLAGS) $(LDFLAGS) -o $@ PROGRAMS = $(bin_PROGRAMS) am_elk_OBJECTS = main.$(OBJEXT) elk_OBJECTS = $(am_elk_OBJECTS) elk_DEPENDENCIES = $(top_builddir)/src/libelk.la DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/.auto/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libelk_la_SOURCES) $(elk_SOURCES) DIST_SOURCES = $(am__libelk_la_SOURCES_DIST) $(elk_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ELK_CFLAGS = @ELK_CFLAGS@ ELK_LDFLAGS = @ELK_LDFLAGS@ ELK_LIBS = @ELK_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INCLUDES = @INCLUDES@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOTIF_CFLAGS = @MOTIF_CFLAGS@ MOTIF_LIBS = @MOTIF_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STDINT_HEADER = @STDINT_HEADER@ STRIP = @STRIP@ VERSION = @VERSION@ XAW_CFLAGS = @XAW_CFLAGS@ XAW_LIBS = @XAW_LIBS@ XMKMF = @XMKMF@ XT_CFLAGS = @XT_CFLAGS@ XT_LIBS = @XT_LIBS@ X_CFLAGS = @X_CFLAGS@ X_LIBS = @X_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ NULL = lib_LTLIBRARIES = libelk.la libelk_la_CFLAGS = @ELK_CFLAGS@ -I/usr/include/libelf libelk_la_LDFLAGS = @ELK_LDFLAGS@ libelk_la_LIBADD = @ELK_LIBS@ libelk_la_SOURCES = \ autoload.c \ bignum.c \ bool.c \ char.c \ cont.c \ cstring.c \ debug.c \ dump.c \ env.c \ error.c \ exception.c \ feature.c \ heap.c \ io.c \ libelk.c \ list.c \ load.c \ loadlib.c \ malloc.c \ math.c \ onfork.c \ prim.c \ print.c \ proc.c \ promise.c \ read.c \ special.c \ stab.c \ $(stab_elf_c) \ $(stab_vanilla_c) \ stkmem.c \ string.c \ symbol.c \ terminate.c \ type.c \ vector.c \ $(NULL) @HAVE_LIBELF_TRUE@stab_elf_c = stab-elf.c @HAVE_LIBELF_FALSE@stab_vanilla_c = stab-vanilla.c EXTRA_DIST = \ dump-ecoff.c \ dump-elf.c \ dump-hp9k.c \ dump-vanilla.c \ heap-gen.c \ heap-sc.c \ stab-bsd.c \ stab-coff.c \ stab-convex.c \ stab-ecoff.c \ stab-hp9k300.c \ stab-hp9k800.c \ stab-macho.c \ $(NULL) elk_LDADD = $(top_builddir)/src/libelk.la elk_SOURCES = main.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libelk.la: $(libelk_la_OBJECTS) $(libelk_la_DEPENDENCIES) $(libelk_la_LINK) -rpath $(libdir) $(libelk_la_OBJECTS) $(libelk_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list elk$(EXEEXT): $(elk_OBJECTS) $(elk_DEPENDENCIES) @rm -f elk$(EXEEXT) $(LINK) $(elk_OBJECTS) $(elk_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_la-autoload.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_la-bignum.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_la-bool.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_la-char.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_la-cont.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_la-cstring.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_la-debug.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_la-dump.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_la-env.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_la-error.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_la-exception.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_la-feature.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_la-heap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_la-io.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_la-libelk.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_la-list.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_la-load.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_la-loadlib.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_la-malloc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_la-math.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_la-onfork.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_la-prim.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_la-print.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_la-proc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_la-promise.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_la-read.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_la-special.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_la-stab-elf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_la-stab-vanilla.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_la-stab.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_la-stkmem.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_la-string.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_la-symbol.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_la-terminate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_la-type.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_la-vector.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< libelk_la-autoload.lo: autoload.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -MT libelk_la-autoload.lo -MD -MP -MF $(DEPDIR)/libelk_la-autoload.Tpo -c -o libelk_la-autoload.lo `test -f 'autoload.c' || echo '$(srcdir)/'`autoload.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_la-autoload.Tpo $(DEPDIR)/libelk_la-autoload.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='autoload.c' object='libelk_la-autoload.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -c -o libelk_la-autoload.lo `test -f 'autoload.c' || echo '$(srcdir)/'`autoload.c libelk_la-bignum.lo: bignum.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -MT libelk_la-bignum.lo -MD -MP -MF $(DEPDIR)/libelk_la-bignum.Tpo -c -o libelk_la-bignum.lo `test -f 'bignum.c' || echo '$(srcdir)/'`bignum.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_la-bignum.Tpo $(DEPDIR)/libelk_la-bignum.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='bignum.c' object='libelk_la-bignum.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -c -o libelk_la-bignum.lo `test -f 'bignum.c' || echo '$(srcdir)/'`bignum.c libelk_la-bool.lo: bool.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -MT libelk_la-bool.lo -MD -MP -MF $(DEPDIR)/libelk_la-bool.Tpo -c -o libelk_la-bool.lo `test -f 'bool.c' || echo '$(srcdir)/'`bool.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_la-bool.Tpo $(DEPDIR)/libelk_la-bool.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='bool.c' object='libelk_la-bool.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -c -o libelk_la-bool.lo `test -f 'bool.c' || echo '$(srcdir)/'`bool.c libelk_la-char.lo: char.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -MT libelk_la-char.lo -MD -MP -MF $(DEPDIR)/libelk_la-char.Tpo -c -o libelk_la-char.lo `test -f 'char.c' || echo '$(srcdir)/'`char.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_la-char.Tpo $(DEPDIR)/libelk_la-char.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='char.c' object='libelk_la-char.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -c -o libelk_la-char.lo `test -f 'char.c' || echo '$(srcdir)/'`char.c libelk_la-cont.lo: cont.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -MT libelk_la-cont.lo -MD -MP -MF $(DEPDIR)/libelk_la-cont.Tpo -c -o libelk_la-cont.lo `test -f 'cont.c' || echo '$(srcdir)/'`cont.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_la-cont.Tpo $(DEPDIR)/libelk_la-cont.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cont.c' object='libelk_la-cont.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -c -o libelk_la-cont.lo `test -f 'cont.c' || echo '$(srcdir)/'`cont.c libelk_la-cstring.lo: cstring.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -MT libelk_la-cstring.lo -MD -MP -MF $(DEPDIR)/libelk_la-cstring.Tpo -c -o libelk_la-cstring.lo `test -f 'cstring.c' || echo '$(srcdir)/'`cstring.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_la-cstring.Tpo $(DEPDIR)/libelk_la-cstring.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cstring.c' object='libelk_la-cstring.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -c -o libelk_la-cstring.lo `test -f 'cstring.c' || echo '$(srcdir)/'`cstring.c libelk_la-debug.lo: debug.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -MT libelk_la-debug.lo -MD -MP -MF $(DEPDIR)/libelk_la-debug.Tpo -c -o libelk_la-debug.lo `test -f 'debug.c' || echo '$(srcdir)/'`debug.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_la-debug.Tpo $(DEPDIR)/libelk_la-debug.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='debug.c' object='libelk_la-debug.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -c -o libelk_la-debug.lo `test -f 'debug.c' || echo '$(srcdir)/'`debug.c libelk_la-dump.lo: dump.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -MT libelk_la-dump.lo -MD -MP -MF $(DEPDIR)/libelk_la-dump.Tpo -c -o libelk_la-dump.lo `test -f 'dump.c' || echo '$(srcdir)/'`dump.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_la-dump.Tpo $(DEPDIR)/libelk_la-dump.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dump.c' object='libelk_la-dump.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -c -o libelk_la-dump.lo `test -f 'dump.c' || echo '$(srcdir)/'`dump.c libelk_la-env.lo: env.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -MT libelk_la-env.lo -MD -MP -MF $(DEPDIR)/libelk_la-env.Tpo -c -o libelk_la-env.lo `test -f 'env.c' || echo '$(srcdir)/'`env.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_la-env.Tpo $(DEPDIR)/libelk_la-env.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='env.c' object='libelk_la-env.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -c -o libelk_la-env.lo `test -f 'env.c' || echo '$(srcdir)/'`env.c libelk_la-error.lo: error.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -MT libelk_la-error.lo -MD -MP -MF $(DEPDIR)/libelk_la-error.Tpo -c -o libelk_la-error.lo `test -f 'error.c' || echo '$(srcdir)/'`error.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_la-error.Tpo $(DEPDIR)/libelk_la-error.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='error.c' object='libelk_la-error.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -c -o libelk_la-error.lo `test -f 'error.c' || echo '$(srcdir)/'`error.c libelk_la-exception.lo: exception.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -MT libelk_la-exception.lo -MD -MP -MF $(DEPDIR)/libelk_la-exception.Tpo -c -o libelk_la-exception.lo `test -f 'exception.c' || echo '$(srcdir)/'`exception.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_la-exception.Tpo $(DEPDIR)/libelk_la-exception.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='exception.c' object='libelk_la-exception.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -c -o libelk_la-exception.lo `test -f 'exception.c' || echo '$(srcdir)/'`exception.c libelk_la-feature.lo: feature.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -MT libelk_la-feature.lo -MD -MP -MF $(DEPDIR)/libelk_la-feature.Tpo -c -o libelk_la-feature.lo `test -f 'feature.c' || echo '$(srcdir)/'`feature.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_la-feature.Tpo $(DEPDIR)/libelk_la-feature.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='feature.c' object='libelk_la-feature.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -c -o libelk_la-feature.lo `test -f 'feature.c' || echo '$(srcdir)/'`feature.c libelk_la-heap.lo: heap.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -MT libelk_la-heap.lo -MD -MP -MF $(DEPDIR)/libelk_la-heap.Tpo -c -o libelk_la-heap.lo `test -f 'heap.c' || echo '$(srcdir)/'`heap.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_la-heap.Tpo $(DEPDIR)/libelk_la-heap.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='heap.c' object='libelk_la-heap.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -c -o libelk_la-heap.lo `test -f 'heap.c' || echo '$(srcdir)/'`heap.c libelk_la-io.lo: io.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -MT libelk_la-io.lo -MD -MP -MF $(DEPDIR)/libelk_la-io.Tpo -c -o libelk_la-io.lo `test -f 'io.c' || echo '$(srcdir)/'`io.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_la-io.Tpo $(DEPDIR)/libelk_la-io.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='io.c' object='libelk_la-io.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -c -o libelk_la-io.lo `test -f 'io.c' || echo '$(srcdir)/'`io.c libelk_la-libelk.lo: libelk.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -MT libelk_la-libelk.lo -MD -MP -MF $(DEPDIR)/libelk_la-libelk.Tpo -c -o libelk_la-libelk.lo `test -f 'libelk.c' || echo '$(srcdir)/'`libelk.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_la-libelk.Tpo $(DEPDIR)/libelk_la-libelk.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libelk.c' object='libelk_la-libelk.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -c -o libelk_la-libelk.lo `test -f 'libelk.c' || echo '$(srcdir)/'`libelk.c libelk_la-list.lo: list.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -MT libelk_la-list.lo -MD -MP -MF $(DEPDIR)/libelk_la-list.Tpo -c -o libelk_la-list.lo `test -f 'list.c' || echo '$(srcdir)/'`list.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_la-list.Tpo $(DEPDIR)/libelk_la-list.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='list.c' object='libelk_la-list.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -c -o libelk_la-list.lo `test -f 'list.c' || echo '$(srcdir)/'`list.c libelk_la-load.lo: load.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -MT libelk_la-load.lo -MD -MP -MF $(DEPDIR)/libelk_la-load.Tpo -c -o libelk_la-load.lo `test -f 'load.c' || echo '$(srcdir)/'`load.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_la-load.Tpo $(DEPDIR)/libelk_la-load.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='load.c' object='libelk_la-load.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -c -o libelk_la-load.lo `test -f 'load.c' || echo '$(srcdir)/'`load.c libelk_la-loadlib.lo: loadlib.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -MT libelk_la-loadlib.lo -MD -MP -MF $(DEPDIR)/libelk_la-loadlib.Tpo -c -o libelk_la-loadlib.lo `test -f 'loadlib.c' || echo '$(srcdir)/'`loadlib.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_la-loadlib.Tpo $(DEPDIR)/libelk_la-loadlib.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='loadlib.c' object='libelk_la-loadlib.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -c -o libelk_la-loadlib.lo `test -f 'loadlib.c' || echo '$(srcdir)/'`loadlib.c libelk_la-malloc.lo: malloc.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -MT libelk_la-malloc.lo -MD -MP -MF $(DEPDIR)/libelk_la-malloc.Tpo -c -o libelk_la-malloc.lo `test -f 'malloc.c' || echo '$(srcdir)/'`malloc.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_la-malloc.Tpo $(DEPDIR)/libelk_la-malloc.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='malloc.c' object='libelk_la-malloc.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -c -o libelk_la-malloc.lo `test -f 'malloc.c' || echo '$(srcdir)/'`malloc.c libelk_la-math.lo: math.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -MT libelk_la-math.lo -MD -MP -MF $(DEPDIR)/libelk_la-math.Tpo -c -o libelk_la-math.lo `test -f 'math.c' || echo '$(srcdir)/'`math.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_la-math.Tpo $(DEPDIR)/libelk_la-math.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='math.c' object='libelk_la-math.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -c -o libelk_la-math.lo `test -f 'math.c' || echo '$(srcdir)/'`math.c libelk_la-onfork.lo: onfork.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -MT libelk_la-onfork.lo -MD -MP -MF $(DEPDIR)/libelk_la-onfork.Tpo -c -o libelk_la-onfork.lo `test -f 'onfork.c' || echo '$(srcdir)/'`onfork.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_la-onfork.Tpo $(DEPDIR)/libelk_la-onfork.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='onfork.c' object='libelk_la-onfork.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -c -o libelk_la-onfork.lo `test -f 'onfork.c' || echo '$(srcdir)/'`onfork.c libelk_la-prim.lo: prim.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -MT libelk_la-prim.lo -MD -MP -MF $(DEPDIR)/libelk_la-prim.Tpo -c -o libelk_la-prim.lo `test -f 'prim.c' || echo '$(srcdir)/'`prim.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_la-prim.Tpo $(DEPDIR)/libelk_la-prim.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='prim.c' object='libelk_la-prim.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -c -o libelk_la-prim.lo `test -f 'prim.c' || echo '$(srcdir)/'`prim.c libelk_la-print.lo: print.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -MT libelk_la-print.lo -MD -MP -MF $(DEPDIR)/libelk_la-print.Tpo -c -o libelk_la-print.lo `test -f 'print.c' || echo '$(srcdir)/'`print.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_la-print.Tpo $(DEPDIR)/libelk_la-print.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='print.c' object='libelk_la-print.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -c -o libelk_la-print.lo `test -f 'print.c' || echo '$(srcdir)/'`print.c libelk_la-proc.lo: proc.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -MT libelk_la-proc.lo -MD -MP -MF $(DEPDIR)/libelk_la-proc.Tpo -c -o libelk_la-proc.lo `test -f 'proc.c' || echo '$(srcdir)/'`proc.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_la-proc.Tpo $(DEPDIR)/libelk_la-proc.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='proc.c' object='libelk_la-proc.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -c -o libelk_la-proc.lo `test -f 'proc.c' || echo '$(srcdir)/'`proc.c libelk_la-promise.lo: promise.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -MT libelk_la-promise.lo -MD -MP -MF $(DEPDIR)/libelk_la-promise.Tpo -c -o libelk_la-promise.lo `test -f 'promise.c' || echo '$(srcdir)/'`promise.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_la-promise.Tpo $(DEPDIR)/libelk_la-promise.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='promise.c' object='libelk_la-promise.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -c -o libelk_la-promise.lo `test -f 'promise.c' || echo '$(srcdir)/'`promise.c libelk_la-read.lo: read.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -MT libelk_la-read.lo -MD -MP -MF $(DEPDIR)/libelk_la-read.Tpo -c -o libelk_la-read.lo `test -f 'read.c' || echo '$(srcdir)/'`read.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_la-read.Tpo $(DEPDIR)/libelk_la-read.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='read.c' object='libelk_la-read.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -c -o libelk_la-read.lo `test -f 'read.c' || echo '$(srcdir)/'`read.c libelk_la-special.lo: special.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -MT libelk_la-special.lo -MD -MP -MF $(DEPDIR)/libelk_la-special.Tpo -c -o libelk_la-special.lo `test -f 'special.c' || echo '$(srcdir)/'`special.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_la-special.Tpo $(DEPDIR)/libelk_la-special.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='special.c' object='libelk_la-special.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -c -o libelk_la-special.lo `test -f 'special.c' || echo '$(srcdir)/'`special.c libelk_la-stab.lo: stab.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -MT libelk_la-stab.lo -MD -MP -MF $(DEPDIR)/libelk_la-stab.Tpo -c -o libelk_la-stab.lo `test -f 'stab.c' || echo '$(srcdir)/'`stab.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_la-stab.Tpo $(DEPDIR)/libelk_la-stab.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='stab.c' object='libelk_la-stab.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -c -o libelk_la-stab.lo `test -f 'stab.c' || echo '$(srcdir)/'`stab.c libelk_la-stab-elf.lo: stab-elf.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -MT libelk_la-stab-elf.lo -MD -MP -MF $(DEPDIR)/libelk_la-stab-elf.Tpo -c -o libelk_la-stab-elf.lo `test -f 'stab-elf.c' || echo '$(srcdir)/'`stab-elf.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_la-stab-elf.Tpo $(DEPDIR)/libelk_la-stab-elf.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='stab-elf.c' object='libelk_la-stab-elf.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -c -o libelk_la-stab-elf.lo `test -f 'stab-elf.c' || echo '$(srcdir)/'`stab-elf.c libelk_la-stab-vanilla.lo: stab-vanilla.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -MT libelk_la-stab-vanilla.lo -MD -MP -MF $(DEPDIR)/libelk_la-stab-vanilla.Tpo -c -o libelk_la-stab-vanilla.lo `test -f 'stab-vanilla.c' || echo '$(srcdir)/'`stab-vanilla.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_la-stab-vanilla.Tpo $(DEPDIR)/libelk_la-stab-vanilla.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='stab-vanilla.c' object='libelk_la-stab-vanilla.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -c -o libelk_la-stab-vanilla.lo `test -f 'stab-vanilla.c' || echo '$(srcdir)/'`stab-vanilla.c libelk_la-stkmem.lo: stkmem.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -MT libelk_la-stkmem.lo -MD -MP -MF $(DEPDIR)/libelk_la-stkmem.Tpo -c -o libelk_la-stkmem.lo `test -f 'stkmem.c' || echo '$(srcdir)/'`stkmem.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_la-stkmem.Tpo $(DEPDIR)/libelk_la-stkmem.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='stkmem.c' object='libelk_la-stkmem.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -c -o libelk_la-stkmem.lo `test -f 'stkmem.c' || echo '$(srcdir)/'`stkmem.c libelk_la-string.lo: string.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -MT libelk_la-string.lo -MD -MP -MF $(DEPDIR)/libelk_la-string.Tpo -c -o libelk_la-string.lo `test -f 'string.c' || echo '$(srcdir)/'`string.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_la-string.Tpo $(DEPDIR)/libelk_la-string.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='string.c' object='libelk_la-string.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -c -o libelk_la-string.lo `test -f 'string.c' || echo '$(srcdir)/'`string.c libelk_la-symbol.lo: symbol.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -MT libelk_la-symbol.lo -MD -MP -MF $(DEPDIR)/libelk_la-symbol.Tpo -c -o libelk_la-symbol.lo `test -f 'symbol.c' || echo '$(srcdir)/'`symbol.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_la-symbol.Tpo $(DEPDIR)/libelk_la-symbol.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='symbol.c' object='libelk_la-symbol.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -c -o libelk_la-symbol.lo `test -f 'symbol.c' || echo '$(srcdir)/'`symbol.c libelk_la-terminate.lo: terminate.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -MT libelk_la-terminate.lo -MD -MP -MF $(DEPDIR)/libelk_la-terminate.Tpo -c -o libelk_la-terminate.lo `test -f 'terminate.c' || echo '$(srcdir)/'`terminate.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_la-terminate.Tpo $(DEPDIR)/libelk_la-terminate.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='terminate.c' object='libelk_la-terminate.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -c -o libelk_la-terminate.lo `test -f 'terminate.c' || echo '$(srcdir)/'`terminate.c libelk_la-type.lo: type.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -MT libelk_la-type.lo -MD -MP -MF $(DEPDIR)/libelk_la-type.Tpo -c -o libelk_la-type.lo `test -f 'type.c' || echo '$(srcdir)/'`type.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_la-type.Tpo $(DEPDIR)/libelk_la-type.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='type.c' object='libelk_la-type.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -c -o libelk_la-type.lo `test -f 'type.c' || echo '$(srcdir)/'`type.c libelk_la-vector.lo: vector.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -MT libelk_la-vector.lo -MD -MP -MF $(DEPDIR)/libelk_la-vector.Tpo -c -o libelk_la-vector.lo `test -f 'vector.c' || echo '$(srcdir)/'`vector.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_la-vector.Tpo $(DEPDIR)/libelk_la-vector.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='vector.c' object='libelk_la-vector.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_la_CFLAGS) $(CFLAGS) -c -o libelk_la-vector.lo `test -f 'vector.c' || echo '$(srcdir)/'`vector.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) install-binPROGRAMS: install-libLTLIBRARIES installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-libLTLIBRARIES @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-libLTLIBRARIES .MAKE: install-am install-exec-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libLTLIBRARIES clean-libtool ctags \ distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-exec-hook install-html \ install-html-am install-info install-info-am \ install-libLTLIBRARIES install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-libLTLIBRARIES install-exec-hook: rm -f "$(DESTDIR)$(bindir)/scheme-elk" ln -s elk "$(DESTDIR)$(bindir)/scheme-elk" echo-sources: ; echo $(SOURCES) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: elk-3.99.8/src/char.c0000644000175000017500000000763011577076306011212 00000000000000/* char.c: Character functions. * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "config.h" #include #include "kernel.h" Object Make_Char (register int c) { Object ch; SET(ch, T_Character, (unsigned char)c); return ch; } Object P_Charp (Object c) { return TYPE(c) == T_Character ? True : False; } Object P_Char_To_Integer (Object c) { Check_Type (c, T_Character); return Make_Integer (CHAR(c)); } Object P_Integer_To_Char (Object n) { register int i; if ((i = Get_Exact_Integer (n)) < 0 || i > 255) Range_Error (n); return Make_Char (i); } Object P_Char_Upper_Casep (Object c) { Check_Type (c, T_Character); return isupper (CHAR(c)) ? True : False; } Object P_Char_Lower_Casep (Object c) { Check_Type (c, T_Character); return islower (CHAR(c)) ? True : False; } Object P_Char_Alphabeticp (Object c) { Check_Type (c, T_Character); return isalpha (CHAR(c)) ? True : False; } Object P_Char_Numericp (Object c) { Check_Type (c, T_Character); return isdigit (CHAR(c)) ? True : False; } Object P_Char_Whitespacep (Object c) { register int x; Check_Type (c, T_Character); x = CHAR(c); return Whitespace (x) ? True : False; } Object P_Char_Upcase (Object c) { Check_Type (c, T_Character); return islower (CHAR(c)) ? Make_Char (toupper (CHAR(c))) : c; } Object P_Char_Downcase (Object c) { Check_Type (c, T_Character); return isupper (CHAR(c)) ? Make_Char (tolower (CHAR(c))) : c; } int General_Chrcmp (Object c1, Object c2, register int ci) { Check_Type (c1, T_Character); Check_Type (c2, T_Character); if (ci) return Char_Map[CHAR(c1)] - Char_Map[CHAR(c2)]; return CHAR(c1) - CHAR(c2); } Object P_Char_Eq (Object c1, Object c2) { return General_Chrcmp (c1, c2, 0) ? False : True; } Object P_Char_Less (Object c1, Object c2) { return General_Chrcmp (c1, c2, 0) < 0 ? True : False; } Object P_Char_Greater (Object c1, Object c2) { return General_Chrcmp (c1, c2, 0) > 0 ? True : False; } Object P_Char_Eq_Less (Object c1, Object c2) { return General_Chrcmp (c1, c2, 0) <= 0 ? True : False; } Object P_Char_Eq_Greater (Object c1, Object c2) { return General_Chrcmp (c1, c2, 0) >= 0 ? True : False; } Object P_Char_CI_Eq (Object c1, Object c2) { return General_Chrcmp (c1, c2, 1) ? False : True; } Object P_Char_CI_Less (Object c1, Object c2) { return General_Chrcmp (c1, c2, 1) < 0 ? True : False; } Object P_Char_CI_Greater (Object c1, Object c2) { return General_Chrcmp (c1, c2, 1) > 0 ? True : False; } Object P_Char_CI_Eq_Less (Object c1, Object c2) { return General_Chrcmp (c1, c2, 1) <= 0 ? True : False; } Object P_Char_CI_Eq_Greater (Object c1, Object c2) { return General_Chrcmp (c1, c2, 1) >= 0 ? True : False; } elk-3.99.8/src/dump-hp9k.c0000644000175000017500000002175311577076306012115 00000000000000/* dump-hp9k.c: Dump for the HP-PA. It needs some work; for instance, it * currently assumes that the data space is the last space in the a.out * file. If it weren't the last space, the code would have to adjust * pointers (such as header.space_location) that point into spaces beyond * the data space, as the data space in the new a.out is larger than that * in the original a.out. * * Also, it is unclear how the checksum field in the a.out header has * to be computed. * * An a.out file must not have holes in HP-UX (or exec(2) would complain * about an invalid data segment), therefore we cannot lseek over the * ununsed parts of the heap. * * The code to support dump with a dynamically linked a.out is a hack. * I have no idea why it works and if it will continue to work in * newer OS releases. * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include AOUT_H #define copy(from,to,size) {\ char buf[4096];\ unsigned int len = (size), n;\ \ while (len > 0) {\ if ((n = read (from, buf, 4096)) == -1) {\ Dump_Finalize;\ Primitive_Error ("error reading old a.out: ~E");\ }\ if (write (to, buf, n) == -1) {\ Dump_Finalize;\ Primitive_Error ("error writing new a.out: ~E");\ }\ len -= n;\ }\ } Object P_Dump (Object ofile) { struct header hdr; struct som_exec_auxhdr auxhdr; unsigned int data_size; int delta; struct stat stat; extern void *sbrk(); Dump_Prolog; /* Read a.out header and first aux header */ if (read (afd, (char *)&hdr, sizeof (hdr)) != sizeof (hdr) || lseek (afd, (off_t)hdr.aux_header_location, SEEK_SET) == -1 || read (afd, (char *)&auxhdr, sizeof (auxhdr)) != sizeof (auxhdr)) { Dump_Finalize; Primitive_Error ("can't read a.out headers"); } if (hdr.a_magic != EXEC_MAGIC && hdr.a_magic != SHARE_MAGIC && hdr.a_magic != DEMAND_MAGIC) { Dump_Finalize; Primitive_Error ("bad magic number ~s in a.out", Make_Integer (hdr.a_magic)); } if (auxhdr.som_auxhdr.type != HPUX_AUX_ID) { Dump_Finalize; Primitive_Error ("bad aux header id ~s in a.out", Make_Integer (auxhdr.som_auxhdr.type)); } /* Copy old file up to beginning of data space */ (void)lseek (afd, (off_t)0, SEEK_SET); copy (afd, ofd, auxhdr.exec_dfile); #ifdef HPSHLIB /* Save data segments of shared libraries */ Save_Shared_Data (); #endif /* Write data space (doesn't skip holes in heap yet) */ Was_Dumped = 1; Brk_On_Dump = sbrk (0); data_size = Brk_On_Dump - (char *)auxhdr.exec_dmem; if (write (ofd, (char *)auxhdr.exec_dmem, data_size) != data_size) { Dump_Finalize; Primitive_Error ("error writing data space: ~E"); } /* Check if data space was last space in a.out file. * Should not just quit, but adjust all pointers that point * beyond end of data space */ (void)fstat (afd, &stat); if (lseek (afd, (off_t)auxhdr.exec_dsize, SEEK_CUR) != stat.st_size) Primitive_Error ("$DATA$ not last space in a.out file"); /* Write new headers. * Do we have to recalculate the checksum? The manual doesn't * say how the checksum is calculated. */ delta = data_size - auxhdr.exec_dsize; hdr.som_length += delta; auxhdr.exec_dsize = data_size; auxhdr.exec_bsize = 0; (void)lseek (ofd, (off_t)0, SEEK_SET); if (write (ofd, (char *)&hdr, sizeof (hdr)) == -1 || lseek (ofd, (off_t)hdr.aux_header_location, SEEK_SET) == -1 || write (ofd, (char *)&auxhdr, sizeof (auxhdr)) == -1) { Dump_Finalize; Primitive_Error ("error writing a.out headers: ~E"); } Dump_Epilog; } #ifdef HPSHLIB /* Save and restore data segments of shared libraries. * * When the running program is dumped, we copy the data segment of * each shared library into a malloced area so that it gets saved * into the newly created a.out. * * On startup of the new a.out, we have to restore the data segments. * To do so, we first have to re-load all libraries that were present * in the old a.out when dump was called. * As the libraries may now get mapped to different locations, we * call mmap with an anonymous file to make the memory at the old * locations accessible again. */ #include #include #define MAX_SHARED 1024 struct shared_data { struct shl_descriptor desc; char *oldaddr; /* Start of data segment */ char *saved; /* Saved contents of data segment */ } shared_data[MAX_SHARED], *lsp = shared_data; #ifdef DEBUG_DUMP static char Z[1024]; # define W write(1,Z,strlen(Z)) #endif Save_Shared_Data () { struct shl_descriptor *p; struct shared_data *sp; int i; /* Assumptions: 1st shared library has index 1; * we can stop as soon as shl_get fails */ for (i = 1; shl_get (i, &p) != -1 ; i++) { #ifdef DEBUG_DUMP sprintf (Z, "Saving shared lib %s\n", p->filename); W; #endif for (sp = shared_data; sp != lsp && strcmp (sp->desc.filename, p->filename) != 0; sp++) ; if (sp == lsp) { #ifdef DEBUG_DUMP sprintf (Z, " (new library)\n"); W; #endif if (sp == shared_data + MAX_SHARED) Primitive_Error ("too many shared libraries"); lsp++; sp->desc = *p; sp->saved = Safe_Malloc (p->dend - p->dstart); sp->oldaddr = (char *)p->dstart; } } for (sp = shared_data; sp != lsp; sp++) { #ifdef DEBUG_DUMP sprintf (Z, " copy data seg from %x to %x len %d\n", sp->oldaddr, sp->saved, sp->desc.dend - sp->desc.dstart); W; #endif memcpy (sp->saved, sp->oldaddr, sp->desc.dend - sp->desc.dstart); } } Restore_Shared_Data () { struct shared_data *sp; struct shl_descriptor *p; shl_t tmp; for (sp = shared_data; sp != lsp; sp++) { /* * Assumption: libraries whose names start with /lib/ or * with /usr/lib/ were present in the original a.out and * need not be re-loaded */ #ifdef DEBUG_DUMP sprintf (Z, "Restoring shared lib %s\n", sp->desc.filename); W; #endif if (strncmp (sp->desc.filename, "/lib/", 5) != 0 && strncmp (sp->desc.filename, "/usr/lib/", 8) != 0) { /* * Re-load the library and make sure memory locations * at the old start of data segment are mapped */ #ifdef DEBUG_DUMP sprintf (Z, " (re-loading)\n"); W; #endif tmp = shl_load (sp->desc.filename, BIND_IMMEDIATE|BIND_VERBOSE, 0L); if (tmp == 0) exit (1); /* There's nothing we can do... */ (void)shl_gethandle (tmp, &p); sp->desc = *p; /* Try to mnumap the region in any case. If MAP_REPLACE is * there, use it. */ (void)munmap (sp->oldaddr, sp->desc.dend - sp->desc.dstart); #ifndef MAP_REPLACE # define MAP_REPLACE 0 #endif if (mmap (sp->oldaddr, sp->desc.dend - sp->desc.dstart, PROT_READ|PROT_WRITE, MAP_REPLACE|MAP_PRIVATE|MAP_ANONYMOUS|MAP_FIXED, -1, 0) == (char *)-1) { sprintf (Z, "mmap failed[%d]\n", errno); W; exit (1); } } #ifdef DEBUG_DUMP sprintf (Z, " copy data seg from %x to %x len %d\n", sp->saved, sp->oldaddr, sp->desc.dend-sp->desc.dstart); W; #endif memcpy (sp->oldaddr, sp->saved, sp->desc.dend - sp->desc.dstart); /* * Initial break must be set as soon as data segment of * C library is restored */ if (strcmp (sp->desc.filename, "/lib/libc.sl") == 0) (void)brk (Brk_On_Dump); } } #endif /* HPSHLIB */ elk-3.99.8/src/terminate.c0000644000175000017500000001407311577076306012264 00000000000000/* terminate.c: Termination functions, weak pointers. * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "config.h" #include #include #include "kernel.h" static WEAK_NODE *first; void Call_Terminators(); void Init_Terminate () { Register_After_GC (Call_Terminators); } /* Register an object with the given group and termination function; * object can be marked as LEADER. */ void Register_Object (Object obj, GENERIC group, PFO term, int leader_flag) { WEAK_NODE *p; p = (WEAK_NODE *)Safe_Malloc (sizeof (*p)); p->obj = obj; p->group = group; p->term = term; p->flags = leader_flag? WK_LEADER : 0; p->next = first; first = p; } void Deregister_Object (Object obj) { WEAK_NODE *p, **pp; Disable_Interrupts; for (pp = &first; (p = *pp); ) { if (WAS_FORWARDED(p->obj)) UPDATE_OBJ(p->obj); if (EQ(p->obj, obj)) { *pp = p->next; free ((char *)p); } else pp = &p->next; } Enable_Interrupts; } /* Search for an object of a given type (arg 1) and group (arg 2). * Use the given match function (arg 3); it is called with an object * and the remaining arguments of Find_Object() (a va_list). * Null is returned when the object has not been found. */ /*VARARGS*/ Object Find_Object (int type, GENERIC group, MATCHFUN match, ...) { WEAK_NODE *p; va_list args; va_start (args, match); for (p = first; p; p = p->next) { if (TYPE(p->obj) != type || p->group != group) continue; /* * I believe updating the object is wrong here, as Find_Object() may * be called from within GC (see Widget_Visit() in lib/xt/widget.c). * If an object is updated here, it will no longer be regarded as * alive in the call to Call_Terminators() later. * if (WAS_FORWARDED(p->obj)) UPDATE_OBJ(p->obj); */ if (match (p->obj, args)) { va_end (args); REVIVE_OBJ(p->obj); return p->obj; } } va_end (args); return Null; } /* Each of the following functions terminates the objects in two passes. * First, they are removed from the global list and added to a temporary * list. In a second pass, this list is scanned to call the terminator * functions and actually free the objects. * * This is to avoid that calling a terminator functions causes the global * list to be clobbered recursively resulting in an inconsistent data * structure. */ /* Terminate all objects belonging to the given group except leaders. */ void Terminate_Group (GENERIC group) { WEAK_NODE *p, **pp, *q = 0; Disable_Interrupts; for (pp = &first; (p = *pp); ) { if (p->group == group && !(p->flags & WK_LEADER)) { if (WAS_FORWARDED(p->obj)) UPDATE_OBJ(p->obj); *pp = p->next; /* move object to temporary list */ p->next = q; q = p; } else pp = &p->next; } while (q) { /* scan temporary list, call terminators and free objects */ WEAK_NODE *tmp = q; if (q->term) (void)q->term (q->obj); q = q->next; free ((char *)tmp); } Enable_Interrupts; } /* Terminate all objects of a given type. */ void Terminate_Type (int type) { WEAK_NODE *p, **pp, *q = 0; Disable_Interrupts; for (pp = &first; (p = *pp); ) { if (TYPE(p->obj) == type) { if (WAS_FORWARDED(p->obj)) UPDATE_OBJ(p->obj); *pp = p->next; /* move object to temporary list */ p->next = q; q = p; } else pp = &p->next; } while (q) { /* scan temporary list, call terminators and free objects */ WEAK_NODE *tmp = q; if (q->term) (void)q->term (q->obj); q = q->next; free ((char *)tmp); } Enable_Interrupts; } /* The after-GC function. */ void Call_Terminators () { WEAK_NODE *p, **pp, *q = 0, **qq = &q; Disable_Interrupts; for (pp = &first; (p = *pp); ) { if (IS_ALIVE(p->obj)) { if (WAS_FORWARDED(p->obj)) UPDATE_OBJ(p->obj); pp = &p->next; } else { *pp = p->next; if (p->flags & WK_LEADER) { *qq = p; /* move leader to end of temporary list */ qq = &p->next; *qq = 0; } else { p->next = q; /* move non-leader to front of list */ if (qq == &q) qq = &p->next; q = p; } } } /* Scan the temporary list, call terminators and free objects. * As leaders have been appended to the list, they are now * scanned after all non-leaders have been taken care of. */ while (q) { WEAK_NODE *tmp = q; if (q->term) (void)q->term (q->obj); q = q->next; free ((char *)tmp); } Enable_Interrupts; } elk-3.99.8/src/special.c0000644000175000017500000003520711577076306011716 00000000000000/* special.c: Special forms. * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "config.h" #include "kernel.h" extern void Do_Wind (Object); extern void Pop_Frame (); extern void Push_Frame (Object); extern void Add_Wind (register WIND *, Object, Object); Object Sym_Else; void Init_Special () { Define_Symbol (&Sym_Else, "else"); } Object P_Quote (Object argl) { return Car (argl); } Object Quasiquote (Object x, int level) { Object form, list, tail, cell, qcar, qcdr, ret; TC_Prolog; if (TYPE(x) == T_Vector) { /* Inefficient, but works. */ x = P_Vector_To_List (x); x = Quasiquote (x, level); return P_List_To_Vector (x); } if (TYPE(x) != T_Pair) return x; if (EQ(Car (x), Sym_Unquote)) { x = Cdr (x); if (TYPE(x) != T_Pair) Primitive_Error ("bad unquote form: ~s", x); if (level) { ret = Cons (Car (x), Null); ret = Quasiquote (ret, level-1); ret = Cons (Sym_Unquote, ret); } else { TC_Disable; ret = Eval (Car (x)); TC_Enable; } return ret; } else if (TYPE(Car (x)) == T_Pair && EQ(Car (Car (x)), Sym_Unquote_Splicing)) { GC_Node6; qcdr = Cdr (x); form = list = tail = cell = Null; x = Car (x); if (TYPE(Cdr (x)) != T_Pair) Primitive_Error ("bad unquote-splicing form: ~s", x); if (level) { GC_Link2 (list, qcdr); list = Quasiquote (Cdr (x), level-1); list = Cons (Sym_Unquote_Splicing, list); qcdr = Quasiquote (qcdr, level); list = Cons (list, qcdr); GC_Unlink; return list; } GC_Link6 (x, qcdr, form, list, tail, cell); TC_Disable; form = Eval (Car (Cdr (x))); TC_Enable; for ( ; TYPE(form) == T_Pair; tail = cell, form = Cdr (form)) { cell = Cons (Car (form), Null); if (Nullp (list)) list = cell; else (void)P_Set_Cdr (tail, cell); } qcdr = Quasiquote (qcdr, level); GC_Unlink; if (Nullp (list)) return qcdr; (void)P_Set_Cdr (tail, qcdr); return list; } else { GC_Node3; qcar = qcdr = Null; GC_Link3 (x, qcar, qcdr); if (EQ(Car (x), Sym_Quasiquote)) /* hack! */ ++level; qcar = Quasiquote (Car (x), level); qcdr = Quasiquote (Cdr (x), level); list = Cons (qcar, qcdr); GC_Unlink; return list; } } Object P_Quasiquote (Object argl) { return Quasiquote (Car (argl), 0); } Object P_Begin (Object forms) { GC_Node; TC_Prolog; if (Nullp (forms)) return Unspecified; GC_Link (forms); TC_Disable; for ( ; !Nullp (Cdr (forms)); forms = Cdr (forms)) (void)Eval (Car (forms)); GC_Unlink; TC_Enable; return Eval (Car (forms)); } Object P_Begin1 (Object forms) { register int n; Object r, ret; GC_Node; TC_Prolog; if (Nullp (forms)) return Unspecified; GC_Link (forms); TC_Disable; for (n = 1; !Nullp (Cdr (forms)); n = 0, forms = Cdr (forms)) { r = Eval (Car (forms)); if (n) ret = r; } GC_Unlink; TC_Enable; r = Eval (Car (forms)); return n ? r : ret; } Object P_If (Object argl) { Object cond, ret; GC_Node; TC_Prolog; GC_Link (argl); TC_Disable; cond = Eval (Car (argl)); TC_Enable; argl = Cdr (argl); if (Truep (cond)) { ret = Eval (Car (argl)); } else { /* Special case: avoid calling Begin() for zero/one-form else-part. */ argl = Cdr (argl); if (Nullp (argl)) ret = Null; else if (Nullp (Cdr (argl))) ret = Eval (Car (argl)); else ret = Begin (argl); } GC_Unlink; return ret; } Object P_Case (Object argl) { Object ret, key, clause, select; GC_Node; TC_Prolog; GC_Link (argl); ret = False; TC_Disable; key = Eval (Car (argl)); for (argl = Cdr (argl); !Nullp (argl); argl = Cdr (argl)) { clause = Car (argl); Check_List (clause); if (Nullp (clause)) Primitive_Error ("empty clause"); select = Car (clause); if (EQ(select, Sym_Else)) { if (!Nullp (Cdr (argl))) Primitive_Error ("`else' not in last clause"); if (Nullp (Cdr (clause))) Primitive_Error ("no forms in `else' clause"); } else if (TYPE(select) == T_Pair) { select = P_Memv (key, select); } else select = P_Eqv (key, select); if (Truep (select)) { clause = Cdr (clause); TC_Enable; ret = Nullp (clause) ? True : Begin (clause); break; } } TC_Enable; GC_Unlink; return ret; } Object P_Cond (Object argl) { Object ret, clause, guard; int else_clause = 0; GC_Node3; TC_Prolog; if (Nullp (argl)) return Unspecified; ret = False; clause = guard = Null; GC_Link3 (argl, clause, guard); TC_Disable; for ( ; !Nullp (argl); argl = Cdr (argl)) { clause = Car (argl); Check_List (clause); if (Nullp (clause)) Primitive_Error ("empty clause"); guard = Car (clause); if (EQ(guard, Sym_Else)) { if (!Nullp (Cdr (argl))) Primitive_Error ("`else' not in last clause"); if (Nullp (Cdr (clause))) Primitive_Error ("no forms in `else' clause"); else_clause++; } else guard = Eval (Car (clause)); if (Truep (guard)) { clause = Cdr (clause); if (!else_clause && !Nullp (clause) && EQ(Car (clause), Intern ("=>"))) { clause = Cdr (clause); if (Nullp (clause) || !Nullp (Cdr (clause))) Primitive_Error ("syntax error after =>"); clause = Eval (Car (clause)); Check_Procedure (clause); guard = Cons (guard, Null); TC_Enable; ret = Funcall (clause, guard, 0); } else { TC_Enable; ret = Nullp (clause) ? guard : Begin (clause); } break; } } TC_Enable; GC_Unlink; return ret; } Object General_Junction (Object argl, register int and) { Object ret; GC_Node; TC_Prolog; ret = and ? True : False; if (Nullp (argl)) return ret; GC_Link (argl); TC_Disable; for ( ; !Nullp (Cdr (argl)); argl = Cdr (argl)) { ret = Eval (Car (argl)); if (and != Truep (ret)) break; } TC_Enable; if (Nullp (Cdr (argl))) ret = Eval (Car (argl)); GC_Unlink; return ret; } Object P_And (Object argl) { return General_Junction (argl, 1); } Object P_Or (Object argl) { return General_Junction (argl, 0); } Object P_Do (Object argl) { Object tail, b, val, test, frame, newframe, len, ret; register int local_vars; GC_Node6; TC_Prolog; b = test = frame = newframe = Null; GC_Link6 (argl, tail, b, test, frame, newframe); TC_Disable; for (tail = Car (argl); !Nullp (tail); tail = Cdr (tail)) { Check_List (tail); b = Car (tail); if (Nullp (b)) Primitive_Error ("bad initialization form"); val = P_Cdr (b); Check_List (val); b = Car (b); Check_Type (b, T_Symbol); if (!Nullp (val)) val = Eval (Car (val)); test = Assq (b, frame); if (!EQ(test, False)) Primitive_Error ("~s: duplicate variable binding", b); frame = Add_Binding (frame, b, val); } if ((local_vars = !Nullp (frame))) Push_Frame (frame); test = Car (Cdr (argl)); Check_Type (test, T_Pair); while (1) { b = Eval (Car (test)); if (Truep (b)) break; (void)Begin (Cdr (Cdr (argl))); if (!local_vars) continue; newframe = Null; for (tail = Car (argl); !Nullp (tail); tail = Cdr (tail)) { b = Car (tail); val = Cdr (b); len = P_Length (val); val = FIXNUM(len) > 1 ? Car (Cdr (val)) : Car (b); val = Eval (val); newframe = Add_Binding (newframe, Car (b), val); } Pop_Frame (); Push_Frame (newframe); } Check_List (Cdr (test)); TC_Enable; ret = Begin (Cdr (test)); if (local_vars) Pop_Frame (); GC_Unlink; return ret; } Object General_Let (Object argl, int disc) { Object frame, b, binding, val, tail, ret; GC_Node5; TC_Prolog; frame = b = val = Null; GC_Link5 (argl, frame, b, val, tail); TC_Disable; for (tail = Car (argl); !Nullp (tail); tail = Cdr (tail)) { Check_List (tail); b = Car (tail); if (Nullp (b)) Primitive_Error ("bad binding form"); val = P_Cdr (b); Check_List (val); if (!Nullp (val) && !Nullp (Cdr (val))) Primitive_Error ("bad binding form"); b = Car (b); Check_Type (b, T_Symbol); if (!Nullp (val)) val = Car (val); if (disc == 0) { if (!Nullp (val)) val = Eval (val); } else if (disc == 1) { Push_Frame (frame); if (!Nullp (val)) val = Eval (val); Pop_Frame (); } else if (disc == 2) val = Null; binding = Assq (b, frame); if (disc != 1 && !EQ(binding, False)) Primitive_Error ("~s: duplicate variable binding", b); if (disc == 1 && !EQ(binding, False)) Cdr (binding) = val; else frame = Add_Binding (frame, b, val); } Push_Frame (frame); if (disc == 2) { for (tail = Car (argl); !Nullp (tail); tail = Cdr (tail)) { b = Car (tail); val = Cdr (b); if (Nullp (val)) continue; val = Car (val); b = Lookup_Symbol (Car (b), 1); val = Eval (val); Cdr (b) = val; SYMBOL(Car (b))->value = val; } } TC_Enable; ret = Begin (Cdr (argl)); Pop_Frame (); GC_Unlink; return ret; } Object Named_Let (Object argl) { Object b, val, tail, vlist, vtail, flist, ftail, cell; GC_Node6; TC_Prolog; tail = vlist = vtail = flist = ftail = Null; GC_Link6 (argl, tail, vlist, vtail, flist, ftail); TC_Disable; for (tail = Car (Cdr (argl)); !Nullp (tail); tail = Cdr (tail)) { Check_List (tail); b = Car (tail); if (Nullp (b)) Primitive_Error ("bad binding form"); val = P_Cdr (b); Check_List (val); if (Nullp (val) || !Nullp (Cdr (val))) Primitive_Error ("bad binding form"); Check_Type (Car (b), T_Symbol); if (!Nullp (val)) val = Car (val); cell = Cons (val, Null); if (Nullp (flist)) flist = cell; else (void)P_Set_Cdr (ftail, cell); ftail = cell; cell = Cons (Car (Car (tail)), Null); if (Nullp (vlist)) vlist = cell; else (void)P_Set_Cdr (vtail, cell); vtail = cell; } /* Create a new environment to protect our named let variable */ Push_Frame (Add_Binding (Null, Car (argl), Null)); tail = Cons (vlist, Cdr (Cdr (argl))); if (Nullp (Cdr (tail))) Primitive_Error ("no subexpressions in named let"); tail = P_Lambda (tail); COMPOUND(tail)->name = Car (argl); b = Lookup_Symbol (Car (argl), 1); Cdr (b) = tail; SYMBOL(Car (argl))->value = tail; TC_Enable; /* Restore environment before calling the function */ Pop_Frame (); /* vlist: list of variables * flist: list of initial values * tail: our new lambda function */ tail = Funcall (tail, flist, 1); GC_Unlink; return tail; } Object P_Let (Object argl) { if (TYPE(Car (argl)) == T_Symbol) return Named_Let (argl); else return General_Let (argl, 0); } Object P_Letseq (Object argl) { return General_Let (argl, 1); } Object P_Letrec (Object argl) { return General_Let (argl, 2); } Object Internal_Fluid_Let (Object bindings, Object argl) { Object b, sym, val, vec, ret; WIND w; GC_Node5; if (Nullp (bindings)) return Begin (Cdr (argl)); b = sym = val = Null; GC_Link5 (bindings, argl, b, sym, val); Check_List (bindings); b = Car (bindings); if (Nullp (b)) Primitive_Error ("bad binding form"); sym = Car (b); val = P_Cdr (b); Check_List (val); Check_Type (sym, T_Symbol); if (!Nullp (val)) val = Car (val); if (!Nullp (val)) val = Eval (val); b = Lookup_Symbol (sym, 1); vec = Make_Vector (3, Null); VECTOR(vec)->data[0] = sym; VECTOR(vec)->data[1] = The_Environment; VECTOR(vec)->data[2] = Cdr (b); Add_Wind (&w, vec, vec); Cdr (b) = val; SYMBOL(sym)->value = val; ret = Internal_Fluid_Let (Cdr (bindings), argl); Do_Wind (Car (w.inout)); GC_Unlink; return ret; } Object P_Fluid_Let (Object argl) { Object ret; WIND *first = First_Wind, *last = Last_Wind; TC_Prolog; TC_Disable; ret = Internal_Fluid_Let (Car (argl), argl); if ((Last_Wind = last)) last->next = 0; First_Wind = first; TC_Enable; return ret; } elk-3.99.8/src/vector.c0000644000175000017500000001073411577076306011576 00000000000000/* vector.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "config.h" #include #include "kernel.h" extern int Get_Index (Object, Object); Object General_Make_Vector (unsigned int len, Object fill, int konst) { Object vec; register Object *op; GC_Node; GC_Link (fill); vec = Alloc_Object ((len-1) * sizeof (Object) + sizeof (struct S_Vector), T_Vector, konst); VECTOR(vec)->tag = Null; VECTOR(vec)->size = len; for (op = VECTOR(vec)->data; len--; op++) *op = fill; GC_Unlink; return vec; } Object Make_Vector (unsigned int len, Object fill) { return General_Make_Vector (len, fill, 0); } Object Make_Const_Vector (unsigned int len, Object fill) { return General_Make_Vector (len, fill, 1); } Object P_Make_Vector (int argc, Object *argv) { register unsigned int len; if ((len = Get_Exact_Integer (argv[0])) < 0) Range_Error (argv[0]); return Make_Vector (len, argc == 1 ? Null : argv[1]); } Object P_Vector (int argc, Object *argv) { Object vec; register int i; vec = Make_Vector (argc, Null); for (i = 0; i < argc; i++) VECTOR(vec)->data[i] = *argv++; return vec; } Object P_Vectorp (Object x) { return TYPE(x) == T_Vector ? True : False; } Object P_Vector_Length (Object x) { Check_Type (x, T_Vector); return Make_Integer (VECTOR(x)->size); } Object P_Vector_Ref (Object vec, Object n) { Check_Type (vec, T_Vector); return VECTOR(vec)->data[Get_Index (n, vec)]; } Object P_Vector_Set (Object vec, Object n, Object new) { Object old; register unsigned int i; Check_Type (vec, T_Vector); Check_Mutable (vec); old = VECTOR(vec)->data[i = Get_Index (n, vec)]; VECTOR(vec)->data[i] = new; return old; } /* We cannot simply call P_List with vec->size and vec->data here, * because the latter can change during GC. */ Object P_Vector_To_List (Object vec) { register unsigned int i; Object list, tail, cell; GC_Node3; Check_Type (vec, T_Vector); list = tail = Null; GC_Link3 (vec, list, tail); for (i = 0; i < VECTOR(vec)->size; i++, tail = cell) { cell = Cons (VECTOR(vec)->data[i], Null); if (Nullp (list)) list = cell; else (void)P_Set_Cdr (tail, cell); } GC_Unlink; return list; } Object List_To_Vector (Object list, int konst) { Object vec, len; register int i; GC_Node; GC_Link (list); len = P_Length (list); if (konst) vec = Make_Const_Vector (FIXNUM(len), Null); else vec = Make_Vector (FIXNUM(len), Null); for (i = 0; i < FIXNUM(len); i++, list = Cdr (list)) VECTOR(vec)->data[i] = Car (list); GC_Unlink; return vec; } Object P_List_To_Vector (Object list) { return List_To_Vector (list, 0); } Object P_Vector_Fill (Object vec, Object fill) { register unsigned int i; Check_Type (vec, T_Vector); Check_Mutable (vec); for (i = 0; i < VECTOR(vec)->size; i++) VECTOR(vec)->data[i] = fill; return vec; } Object P_Vector_Copy (Object vec) { Object new; GC_Node; Check_Type (vec, T_Vector); GC_Link (vec); new = Make_Vector (VECTOR(vec)->size, Null); memcpy (POINTER(new), POINTER(vec), (VECTOR(vec)->size-1) * sizeof (Object) + sizeof (struct S_Vector)); GC_Unlink; return new; } elk-3.99.8/src/env.c0000644000175000017500000001451011577076306011060 00000000000000/* env.c: Environments, define, set!, etc. * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "config.h" #include "kernel.h" void Set_Name (Object, Object); void Memoize_Frame (Object); void Memoize_Frames (Object, Object); void Forget_Frame (Object); #define Env_To_List(env, list) SET((list), T_Pair, (intptr_t)POINTER(env)) #define List_To_Env(list, env) SET((env), T_Environment, (intptr_t)POINTER(list)) Object The_Environment, Global_Environment; Object General_Define(); void Init_Env () { List_To_Env (Cons (Null, Null), Global_Environment); The_Environment = Global_Environment; Global_GC_Link (Global_Environment); Global_GC_Link (The_Environment); } Object P_Environment_To_List (Object env) { Object e; Check_Type (env, T_Environment); Env_To_List (env, e); return Copy_List (e); } Object P_Environmentp (Object x) { return TYPE(x) == T_Environment ? True : False; } void Push_Frame (Object frame) { Object e; Memoize_Frame (frame); Env_To_List (The_Environment, e); List_To_Env (Cons (frame, e), The_Environment); } void Pop_Frame () { Object e; Env_To_List (The_Environment, e); List_To_Env (Cdr (e), The_Environment); Forget_Frame (Car (e)); } void Switch_Environment (Object to) { Object old, new, n; if (EQ(The_Environment,to)) return; Env_To_List (The_Environment, old); Env_To_List (to, new); for ( ; !Nullp (old); old = Cdr (old)) { for (n = new; !Nullp (n) && !EQ(n,old); n = Cdr (n)) ; if (EQ(n,old)) break; Forget_Frame (Car (old)); } Memoize_Frames (new, n); The_Environment = to; } void Memoize_Frames (Object this, Object last) { if (Nullp (this) || EQ(this,last)) return; Memoize_Frames (Cdr (this), last); Memoize_Frame (Car (this)); } void Memoize_Frame (Object frame) { Object binding; for (; !Nullp (frame); frame = Cdr (frame)) { binding = Car (frame); SYMBOL(Car (binding))->value = Cdr (binding); } } void Forget_Frame (Object frame) { for (; !Nullp (frame); frame = Cdr (frame)) SYMBOL(Car (Car (frame)))->value = Unbound; } Object Add_Binding (Object frame, Object sym, Object val) { Object b; GC_Node; GC_Link (frame); b = Cons (sym, val); GC_Unlink; return Cons (b, frame); } Object Lookup_Symbol (Object sym, int err) { Object p, f, b; Env_To_List (The_Environment, p); for (; !Nullp (p); p = Cdr (p)) { for (f = Car (p); !Nullp (f); f = Cdr (f)) { /* Inlined Assq() */ b = Car (f); if (EQ(Car (b), sym)) return b; } } if (err) Primitive_Error ("unbound variable: ~s", sym); return Null; } Object P_The_Environment () { return The_Environment; } Object P_Global_Environment () { return Global_Environment; } Object Define_Procedure (Object form, Object body, Object sym) { Object ret; GC_Node3; GC_Link3 (form, body, sym); body = Cons (Cdr (form), body); body = Cons (sym, body); body = Cons (body, Null); body = Cons (Car (form), body); ret = General_Define (body, sym); GC_Unlink; return ret; } Object General_Define (Object argl, Object sym) { Object val, var, frame, binding; GC_Node3; TC_Prolog; var = Car (argl); val = Cdr (argl); if (TYPE(var) == T_Symbol) { frame = Null; GC_Link3 (var, val, frame); if (Nullp (val)) { val = Void; } else { TC_Disable; val = Eval (Car (val)); TC_Enable; } Set_Name (var, val); frame = Car (The_Environment); binding = Assq (var, frame); if (EQ(binding, False)) { frame = Add_Binding (frame, var, val); Car (The_Environment) = frame; } else Cdr (binding) = val; SYMBOL(var)->value = val; GC_Unlink; return var; } else if (TYPE(var) == T_Pair) { if (Nullp (val)) Primitive_Error ("no sub-forms in compound: ~s", var); return Define_Procedure (var, val, sym); } else Wrong_Type_Combination (var, "symbol or pair"); /*NOTREACHED*/ } Object P_Define (Object argl) { return General_Define (argl, Sym_Lambda); } Object P_Define_Macro (Object argl) { return General_Define (argl, Sym_Macro); } Object P_Set (Object argl) { Object val, var, binding, old; GC_Node3; TC_Prolog; var = Car (argl); val = Car (Cdr (argl)); Check_Type (var, T_Symbol); binding = Lookup_Symbol (var, 1); old = Cdr (binding); GC_Link3 (var, binding, old); TC_Disable; val = Eval (val); TC_Enable; Set_Name (var, val); Cdr (binding) = val; SYMBOL(var)->value = val; GC_Unlink; return old; } void Set_Name (Object var, Object val) { register int t; t = TYPE(val); if (t == T_Compound) { if (Nullp (COMPOUND(val)->name)) COMPOUND(val)->name = var; } else if (t == T_Macro) { if (Nullp (MACRO(val)->name)) MACRO(val)->name = var; } } Object P_Boundp (Object x) { Check_Type (x, T_Symbol); return Nullp (Lookup_Symbol (x, 0)) ? False : True; } elk-3.99.8/src/loadlib.c0000644000175000017500000001566211577076306011707 00000000000000/* loadlib.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "config.h" #ifdef CAN_LOAD_LIB #include #include #include #include #if defined (HAVE_DL_DYLD) # if defined (HAVE_MACH_O_DYLD_H) # include # endif #elif defined (HAVE_DL_WINDOWS) # include #elif defined (HAVE_DL_BEOS) # if defined (HAVE_IMAGE_H) # include # endif #elif defined (HAVE_DL_DLOPEN) # if defined (HAVE_DLFCN_H) # include # endif # if defined (HAVE_SYS_DL_H) # include # endif #elif defined (HAVE_DL_SHL_LOAD) # if defined (HAVE_DL_H) # include # endif #endif #include "kernel.h" extern void Free_Symbols (SYMTAB *); extern void Call_Initializers (SYMTAB *, char *, int); void Dlopen_File (char *obj) { SYM *sp; #if defined (HAVE_DL_DYLD) NSModule handle; NSObjectFileImage image; NSObjectFileImageReturnCode ret; if (Verb_Load) printf ("[dyld %s]\n", obj); ret = NSCreateObjectFileImageFromFile (obj, &image); if (ret != NSObjectFileImageSuccess) Primitive_Error ("could not map `~%~s'", Make_String (obj, strlen (obj))); /* Open the dynamic module */ handle = NSLinkModule (image, obj, NSLINKMODULE_OPTION_RETURN_ON_ERROR); if (!handle) { NSLinkEditErrors errors; const char *file, *err; int errnum; NSLinkEditError (&errors, &errnum, &file, &err); Primitive_Error ("could not dyld `~%~s': ~%~s", Make_String (file, strlen (file)), Make_String (err, strlen (err))); } /* Destroy our image, we won't need it */ NSDestroyObjectFileImage (image); /* NSUnLinkModule (handle, FALSE); */ #elif defined (HAVE_DL_WINDOWS) void *handle; if (Verb_Load) printf ("[dll %s]\n", obj); handle = LoadLibrary (obj); if (handle == NULL) { Primitive_Error ("LoadLibrary failed on ~%~s", Make_String (obj, strlen (obj))); } #elif defined (HAVE_DL_BEOS) int handle; if (Verb_Load) printf ("[load_add_on %s]\n", obj); handle = load_add_on (obj); if (handle < 0) { Primitive_Error ("load_add_on failed on ~%~s", Make_String (obj, strlen (obj))); } #elif defined (HAVE_DL_DLOPEN) void *handle; if (Verb_Load) printf ("[dlopen %s]\n", obj); #if defined (RTLD_GLOBAL) handle = dlopen (obj, RTLD_NOW | RTLD_GLOBAL); #elif defined (DL_GLOBAL) handle = dlopen (obj, DL_NOW | DL_GLOBAL); #else handle = dlopen (obj, 0); #endif if (handle == NULL) { char *err = dlerror (); Primitive_Error ("dlopen failed: ~%~s", Make_String (err, strlen (err))); } #elif defined (HAVE_DL_SHL_LOAD) shl_t handle; if (Verb_Load) printf ("[shl_load %s]\n", obj); handle = shl_load (obj, BIND_IMMEDIATE | BIND_NONFATAL, NULL); if (handle == NULL) { char *err = strerror (errno); Primitive_Error ("shl_load failed: ~%~s", Make_String (err, strlen (err))); } #else # error "No dynamic plugins API" #endif if (The_Symbols) Free_Symbols (The_Symbols); The_Symbols = Open_File_And_Snarf_Symbols (obj); for (sp = The_Symbols->first; sp; sp = sp->next) { #if defined (HAVE_DL_DYLD) NSSymbol sym = NSLookupSymbolInModule (handle, sp->name); if (sym) sp->value = (unsigned long int)(intptr_t)NSAddressOfSymbol (sym); #elif defined (HAVE_DL_WINDOWS) sp->value = (unsigned long int)(intptr_t)GetProcAddress (handle, sp->name); #elif defined (HAVE_DL_BEOS) void *sym; if (get_image_symbol (handle, sp->name, B_SYMBOL_TYPE_TEXT, &sym) == B_OK) { sp->value = (unsigned long int)(intptr_t)sym; } #elif defined (HAVE_DL_DLOPEN) /* dlsym() may fail for symbols not exported by object file; * this can be safely ignored. */ sp->value = (unsigned long int)(intptr_t)dlsym (handle, sp->name); #elif defined (HAVE_DL_SHL_LOAD) void *sym; shl_findsym (&handle, sp->name, TYPE_UNDEFINED, &sym); sp->value = (unsigned long int)(intptr_t)sym; #endif } Call_Initializers (The_Symbols, 0, PR_CONSTRUCTOR); Call_Initializers (The_Symbols, 0, PR_EXTENSION); } static void Load_Lib (Object libs) { char *lib = NULL; Object port, name; GC_Node2; if (Nullp (libs)) return; Load_Lib (Cdr (libs)); port = name = Null; GC_Link2 (port, name); /* Read the libtool object to find our library's name */ port = General_Open_File (Car (libs), P_INPUT, Var_Get (V_Load_Path)); while (!feof (PORT(port)->file)) { char buffer [BUFSIZ], *dlname, *eol, *path; if (fgets (buffer, BUFSIZ, PORT(port)->file) == NULL) break; buffer[BUFSIZ-1] = '\0'; /* Our line starts with dlname='... */ if (strncmp (buffer, "dlname", 6)) continue; dlname = strchr (buffer, '\''); if (dlname == NULL) continue; dlname++; eol = strrchr (buffer, '\''); if (eol == NULL || eol == dlname) continue; *eol = '\0'; path = Get_String (PORT(port)->name); eol = strrchr (path, SEPARATOR_CHAR); if (eol == NULL) eol = path; *eol = '\0'; lib = malloc (strlen (path) + 1 + strlen (dlname) + 1); sprintf (lib, "%s" SEPARATOR_STRING "%s", path, dlname); break; } (void)P_Close_Input_Port (port); if (lib) Dlopen_File (lib); GC_Unlink; } void Load_Library (Object libs) { Disable_Interrupts; Load_Lib (libs); Enable_Interrupts; } #endif /* CAN_LOAD_LIB */ elk-3.99.8/src/string.c0000644000175000017500000002157411577076306011606 00000000000000/* string.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "config.h" #include #include #include "kernel.h" extern int Get_Index (Object, Object); char Char_Map[256]; void Init_String () { register int i; for (i = 0; i < 256; i++) Char_Map[i] = i; for (i = 'A'; i <= 'Z'; i++) Char_Map[i] = tolower (i); } Object General_Make_String (char const *s, unsigned int len, int konst) { Object str; str = Alloc_Object (len + sizeof (struct S_String) - 1, T_String, konst); STRING(str)->tag = Null; STRING(str)->size = len; if (s) memcpy (STRING(str)->data, s, len); return str; } Object Make_String (char const *s, unsigned int len) { return General_Make_String (s, len, 0); } Object Make_Const_String (char const *s, unsigned int len) { return General_Make_String (s, len, 1); } Object P_Stringp (Object s) { return TYPE(s) == T_String ? True : False; } Object P_Make_String (int argc, Object *argv) { register unsigned int len, c = ' '; Object str; register char *p; if ((len = Get_Exact_Integer (argv[0])) < 0) Range_Error (argv[0]); if (argc == 2) { Check_Type (argv[1], T_Character); c = CHAR(argv[1]); } str = Make_String ((char *)0, len); for (p = STRING(str)->data; len; len--) *p++ = c; return str; } Object P_String (int argc, Object *argv) { Object str; register int i; str = Make_String ((char *)0, argc); for (i = 0; i < argc; i++) { Check_Type (argv[i], T_Character); STRING(str)->data[i] = CHAR(argv[i]); } return str; } Object P_String_To_Number (int argc, Object *argv) { Object ret; char *b; register struct S_String *p; int radix = 10; Alloca_Begin; Check_Type (argv[0], T_String); if (argc == 2) { radix = Get_Exact_Integer (argv[1]); switch (radix) { case 2: case 8: case 10: case 16: break; default: Primitive_Error ("invalid radix: ~s", argv[1]); } } p = STRING(argv[0]); Alloca (b, char*, p->size+1); memcpy (b, p->data, p->size); b[p->size] = '\0'; ret = Parse_Number (Null, b, radix); Alloca_End; return Nullp (ret) ? False : ret; } Object P_String_Length (Object s) { Check_Type (s, T_String); return Make_Integer (STRING(s)->size); } Object P_String_Ref (Object s, Object n) { Check_Type (s, T_String); return Make_Char (STRING(s)->data[Get_Index (n, s)]); } Object P_String_Set (Object s, Object n, Object new) { register int i, old; Check_Type (s, T_String); Check_Mutable (s); Check_Type (new, T_Character); old = STRING(s)->data[i = Get_Index (n, s)]; STRING(s)->data[i] = CHAR(new); return Make_Char (old); } Object P_Substring (Object s, Object a, Object b) { register int i, j; Check_Type (s, T_String); i = Get_Exact_Integer (a); if (i < 0 || i > (int)STRING(s)->size) Range_Error (a); j = Get_Exact_Integer (b); if (j < 0 || j > (int)STRING(s)->size) Range_Error (b); if (i > j) Primitive_Error ("`end' less than `start'"); return Make_String (&STRING(s)->data[i], j-i); } Object P_String_Copy (Object s) { Check_Type (s, T_String); return Make_String (STRING(s)->data, STRING(s)->size); } Object P_String_Append (int argc, Object *argv) { register int i, len; Object s, str; for (len = i = 0; i < argc; i++) { Check_Type (argv[i], T_String); len += STRING(argv[i])->size; } str = Make_String ((char *)0, len); for (len = i = 0; i < argc; i++) { s = argv[i]; memcpy (&STRING(str)->data[len], STRING(s)->data, STRING(s)->size); len += STRING(s)->size; } return str; } Object P_List_To_String (Object list) { Object str, len; register int i; GC_Node; GC_Link (list); len = P_Length (list); str = Make_String ((char *)0, FIXNUM(len)); for (i = 0; i < FIXNUM(len); i++, list = Cdr (list)) { Check_Type (Car (list), T_Character); STRING(str)->data[i] = CHAR(Car (list)); } GC_Unlink; return str; } Object P_String_To_List (Object s) { register unsigned int i; Object list, tail, cell; GC_Node3; Check_Type (s, T_String); list = tail = Null; GC_Link3 (s, list, tail); for (i = 0; i < STRING(s)->size; i++, tail = cell) { cell = Cons (Make_Char (STRING(s)->data[i]), Null); if (Nullp (list)) list = cell; else (void)P_Set_Cdr (tail, cell); } GC_Unlink; return list; } Object P_Substring_Fill (Object s, Object a, Object b, Object c) { register int i, j; Check_Type (s, T_String); Check_Mutable (s); Check_Type (c, T_Character); i = Get_Index (a, s); j = Get_Exact_Integer (b); if (j < 0 || j > (int)STRING(s)->size) Range_Error (b); if (i > j) Primitive_Error ("`end' less than `start'"); while (i < j) STRING(s)->data[i++] = CHAR(c); return s; } Object P_String_Fill (Object s, Object c) { Object ret; GC_Node2; Check_Type (s, T_String); Check_Mutable (s); GC_Link2 (s, c); ret = P_Substring_Fill (s, Make_Integer (0), Make_Integer (STRING(s)->size), c); GC_Unlink; return ret; } Object General_Substringp (Object s1, Object s2, register int ci) { register int n, l1, l2; register char *p1, *p2, *p3, *map; Check_Type (s1, T_String); Check_Type (s2, T_String); l1 = STRING(s1)->size; l2 = STRING(s2)->size; map = Char_Map; for (p2 = STRING(s2)->data; l2 >= l1; p2++, l2--) { for (p1 = STRING(s1)->data, p3 = p2, n = l1; n; n--, p1++, p3++) { if (ci) { if (map[(int)*p1] != map[(int)*p3]) goto fail; } else if (*p1 != *p3) goto fail; } return Make_Integer (STRING(s2)->size - l2); fail: ; } return False; } Object P_Substringp (Object s1, Object s2) { return General_Substringp (s1, s2, 0); } Object P_CI_Substringp (Object s1, Object s2) { return General_Substringp (s1, s2, 1); } int General_Strcmp (Object s1, Object s2, register int ci) { register int n, l1, l2; register char *p1, *p2, *map; Check_Type (s1, T_String); Check_Type (s2, T_String); l1 = STRING(s1)->size; l2 = STRING(s2)->size; n = l1 > l2 ? l2 : l1; p1 = STRING(s1)->data; p2 = STRING(s2)->data; for (map = Char_Map; --n >= 0; p1++, p2++) { if (ci) { if (map[(int)*p1] != map[(int)*p2]) break; } else if (*p1 != *p2) break; } if (n < 0) return l1 - l2; return ci ? map[(int)*p1] - map[(int)*p2] : *p1 - *p2; } Object P_String_Eq (Object s1, Object s2) { return General_Strcmp (s1, s2, 0) ? False : True; } Object P_String_Less (Object s1, Object s2) { return General_Strcmp (s1, s2, 0) < 0 ? True : False; } Object P_String_Greater (Object s1, Object s2) { return General_Strcmp (s1, s2, 0) > 0 ? True : False; } Object P_String_Eq_Less (Object s1, Object s2) { return General_Strcmp (s1, s2, 0) <= 0 ? True : False; } Object P_String_Eq_Greater (Object s1, Object s2) { return General_Strcmp (s1, s2, 0) >= 0 ? True : False; } Object P_String_CI_Eq (Object s1, Object s2) { return General_Strcmp (s1, s2, 1) ? False : True; } Object P_String_CI_Less (Object s1, Object s2) { return General_Strcmp (s1, s2, 1) < 0 ? True : False; } Object P_String_CI_Greater (Object s1, Object s2) { return General_Strcmp (s1, s2, 1) > 0 ? True : False; } Object P_String_CI_Eq_Less (Object s1, Object s2) { return General_Strcmp (s1, s2, 1) <= 0 ? True : False; } Object P_String_CI_Eq_Greater (Object s1, Object s2) { return General_Strcmp (s1, s2, 1) >= 0 ? True : False; } elk-3.99.8/src/cstring.c0000644000175000017500000000526511577076306011750 00000000000000/* cstring.c: Convert Scheme strings to C strings. The contents of strings * has to be copied, because strings in Elk do not have a terminating null- * byte (strings may _contain_ null-bytes). * * Get_String() and Get_Strsym() allocate memory in NUMSTRBUFS cyclically * reused buffers in the C heap. * The macros Get_String_Stack() and Get_Strsym_Stack() in include/cstring.h * allocate memory on the stack. They have to be used whenever more than * NUMSTRBUFS strings are active in a function at the same time. * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "config.h" #include #include "kernel.h" static char *heapstr[NUMSTRBUFS]; static unsigned int heaplen[NUMSTRBUFS]; static int nextstr; void Init_Cstring() { /* Preallocate memory to avoid fragmentation */ int i; for (i = 0; i < NUMSTRBUFS; i++) heapstr[i] = Safe_Malloc (heaplen[i] = 512); } char *Get_String (Object str) { char **pp = &heapstr[nextstr]; unsigned int len; Check_Type (str, T_String); len = STRING(str)->size + 1; if (len > heaplen[nextstr]) { Disable_Interrupts; *pp = Safe_Realloc (*pp, len); heaplen[nextstr] = len; Enable_Interrupts; } memcpy (*pp, STRING(str)->data, --len); (*pp)[len] = '\0'; if (++nextstr == NUMSTRBUFS) nextstr = 0; return *pp; } char *Get_Strsym (Object str) { if (TYPE(str) == T_Symbol) str = SYMBOL(str)->name; else if (TYPE(str) != T_String) Wrong_Type_Combination (str, "string or symbol"); return Get_String (str); } elk-3.99.8/src/stab-hp9k300.c0000644000175000017500000001004011577076306012307 00000000000000/* stab-hp9k300.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include AOUT_H #include /* On the HP9000 an nlist entry contains a fixed length * part consisting of the symbol information, plus a variable * length part, the name without a '\0' terminator. * We don't know how much space to allocate for the names * until we have read them all. * The solution here is to save all the names on the fly * in a table that is grown in units of STRING_BLOCK bytes, * using realloc to expand it on demand. */ #define STRING_BLOCK 8192 extern void Free_Symbols (SYMTAB *); SYMTAB *Snarf_Symbols (FILE *f, struct exec *ep) { SYMTAB *tab; register SYM *sp; register SYM **nextp; int strsiz = 0; /* running total length of names read, */ /* each '\0' terminated */ int nread = 0; /* running total of bytes read from symbol table */ int max = 0; /* current maximum size of name table */ char *names = 0; /* the name table */ struct nlist_ nl; tab = (SYMTAB *)Safe_Malloc (sizeof (SYMTAB)); tab->first = 0; tab->strings = 0; nextp = &tab->first; (void)fseek (f, (long)LESYM_OFFSET(*ep), 0); while (nread < ep->a_lesyms) { if (fread ((char *)&nl, sizeof (nl), 1, f) != 1) { Free_Symbols (tab); (void)fclose (f); Primitive_Error ("corrupt symbol table in object file"); } nread += sizeof (nl); if (nl.n_length == 0) { continue; } else if (nl.n_length + strsiz + 1 > max) { max += STRING_BLOCK; names = Safe_Realloc (names, max); } if (fread (names + strsiz, 1, nl.n_length, f) != nl.n_length) { Free_Symbols (tab); (void)fclose (f); Primitive_Error ("corrupt symbol table in object file"); } else { nread += nl.n_length; names[ strsiz + nl.n_length ] = '\0'; } if ((nl.n_type & N_TYPE) != N_TEXT) { strsiz += nl.n_length +1; continue; } sp = (SYM *)Safe_Malloc (sizeof (SYM)); sp->name = (char *)strsiz; strsiz += (nl.n_length + 1); sp->value = nl.n_value; *nextp = sp; nextp = &sp->next; *nextp = 0; } tab->strings = names; for (sp = tab->first; sp; sp = sp->next) sp->name += (unsigned int)names; return tab; } #ifdef INIT_OBJECTS SYMTAB *Open_File_And_Snarf_Symbols (char *name) { struct exec hdr; FILE *f; SYMTAB *tab; if ((f = fopen (name, "r")) == NULL) Primitive_Error ("can't open a.out file"); if (fread ((char *)&hdr, sizeof hdr, 1, f) != 1) { (void)fclose (f); Primitive_Error ("can't read a.out header"); } tab = Snarf_Symbols (f, &hdr); (void)fclose (f); return tab; } #endif /* INIT_OBJECTS */ elk-3.99.8/src/promise.c0000644000175000017500000000427311577076306011753 00000000000000/* promise.c: Delay and force. * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "config.h" #include "kernel.h" Object P_Promisep (Object x) { return TYPE(x) == T_Promise ? True : False; } Object P_Delay (Object argl) { Object d; GC_Node; GC_Link (argl); d = Alloc_Object (sizeof (struct S_Promise), T_Promise, 0); GC_Unlink; PROMISE(d)->done = 0; PROMISE(d)->env = The_Environment; PROMISE(d)->thunk = Car (argl); return d; } Object P_Force (Object d) { Object ret, a[2]; GC_Node; TC_Prolog; Check_Type (d, T_Promise); if (PROMISE(d)->done) return PROMISE(d)->thunk; GC_Link (d); a[0] = PROMISE(d)->thunk; a[1] = PROMISE(d)->env; TC_Disable; ret = P_Eval (2, a); TC_Enable; GC_Unlink; if (PROMISE(d)->done) /* take care of recursive force calls */ return PROMISE(d)->thunk; PROMISE(d)->thunk = ret; PROMISE(d)->done = 1; return ret; } Object P_Promise_Environment (Object p) { Check_Type (p, T_Promise); return PROMISE(p)->env; } elk-3.99.8/src/heap-gen.c0000644000175000017500000014360411577076306011763 00000000000000/* heap-gen.c: The generational, incremental garbage collector. * Written by Marco Scheibe. Fixes provided by Craig McPheeters, * Carsten Bormann, Jon Hartlaub, Charlie Xiaoli Huang, Gal Shalif. * * This garbage collector is still experimental and probably needs to be * rewritten at least in parts. See also ../BUGS. If your application * does not work correctly and you suspect the generational garbage * collector to be the culprit, try the stop-and-copy GC instead. * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include #include #include #include #if defined(MPROTECT_SIG) || defined(MPROTECT_MMAP) # include #endif #if defined(HAVE_UNISTD_H) # include # if defined(_SC_PAGE_SIZE) && !defined(_SC_PAGESIZE) /* Wrong in HP-UX */ # define _SC_PAGESIZE _SC_PAGE_SIZE # endif #endif #ifdef SIGSEGV_SIGINFO # include # include #endif /* The following variables may be set from outside the collector to * fine-tune some used parameters. */ int tuneable_forward_region = 5; /* fraction of heap pages that are tried * to allocate as forward region when * collecting. */ int tuneable_force_total = 35; /* % newly allocated during collection * to force total collection */ int tuneable_newly_expand = 25; /* % of heap newly allocated during * a total collection to force heap * expansion. */ int tuneable_force_expand = 20; /* % stable to force heap expansion */ /* ------------------------------------------------------------------------ defined in object.h: typedef int gcspace_t; // type used for space and type arrays typedef unsigned int gcptr_t; // type used for pointers ------------------------------------------------------------------------ */ static int percent = 0; static pageno_t old_logical_pages; static int inc_collection = 0; static int incomplete_msg = 0; static pageno_t logical_pages, spanning_pages, physical_pages; /* pagebase is #defined in object.h if ARRAY_BROKEN is not defined. */ #ifdef ARRAY_BROKEN pageno_t pagebase; #endif static pageno_t firstpage, lastpage; static char *saved_heap_ptr; gcspace_t *space; static gcspace_t *types, *pmap; static pageno_t *linked; static pageno_t current_pages, forwarded_pages; static pageno_t protected_pages, allocated_pages; static addrarith_t bytes_per_pp, pp_shift; /* bytes per physical page */ static addrarith_t hp_per_pp; /* number of heap pages per physical page */ static addrarith_t pp_mask; /* ANDed with a virtual address gives * base address of physical page */ static addrarith_t hp_per_pp_mask; /* ANDed with heap page number gives * first page number in the physical * page the heap page belongs to. */ #define SAME_PHYSPAGE(a,b) (((a) & pp_mask) == ((b) & pp_mask)) gcspace_t current_space; /* has to be exported because IS_ALIVE depends on it */ static gcspace_t forward_space, previous_space; static pageno_t current_freepage, current_free; static pageno_t forward_freepage, forward_free; static pageno_t last_forward_freepage; static Object *current_freep, *forward_freep; static int scanning = 0; /* set to true if scanning a * physical page is in progress */ static Object *scanpointer; static Object *scanfirst, *scanlast; #define IN_SCANREGION(addr) ((Object*)(addr) >= scanfirst \ && (Object*)(addr) <= scanlast) #define IS_SCANNED(addr) ((Object *)(addr) < scanpointer) #define MAXRESCAN 10 static pageno_t rescan[MAXRESCAN]; static int rescanpages = 0; static int allscan = 0; static pageno_t stable_queue, stable_tail; /* head and tail of the queue * of stable pages */ #define DIRTYENTRIES 20 struct dirty_rec { pageno_t pages[DIRTYENTRIES]; struct dirty_rec *next; }; static struct dirty_rec *dirtylist, *dirtyhead; static int dirtyentries; static int ScanCluster (); static int Scanner (); static void TerminateGC (); /*****************************************************************************/ /* PAGEBYTES is defined in object.h */ #define PAGEWORDS ((addrarith_t)(PAGEBYTES / sizeof (Object))) #define HEAPPAGEMASK ~((gcptr_t)PAGEBYTES-1) #ifdef ALIGN_8BYTE # define MAX_OBJECTWORDS (PAGEWORDS - 1) # define NEEDED_PAGES(size) (((size) + PAGEWORDS) / PAGEWORDS) #else # define MAX_OBJECTWORDS PAGEWORDS # define NEEDED_PAGES(size) (((size) + PAGEWORDS - 1) / PAGEWORDS) #endif #define MAKE_HEADER(obj,words,type) (SET(obj, type, words)) #define HEADER_TO_TYPE(header) ((unsigned int)TYPE(header)) #define HEADER_TO_WORDS(header) ((unsigned int)FIXNUM(header)) /* some conversion stuff. PHYSPAGE converts a logical page number into the * start address of the physical page the logical page lies on. * If ARRAY_BROKEN is defined, page numbering will start at 0 for the * first heap page. Not that this will introduce some extra overhead. * Note that PAGE_TO_ADDR(0) == 0 if ARRAY_BROKEN is not defined... */ #define OBJ_TO_PPADDR(obj) ((gcptr_t)POINTER(obj) & pp_mask) #define PTR_TO_PPADDR(ptr) ((gcptr_t)(ptr) & pp_mask) #define ADDR_TO_PAGE(addr) ((((addr) & HEAPPAGEMASK) / PAGEBYTES) - pagebase) #define PAGE_TO_ADDR(page) (((page) + pagebase) * PAGEBYTES) #define PHYSPAGE(page) ((((page) + pagebase) * PAGEBYTES) & pp_mask) #define UNALLOCATED_PAGE (gcspace_t)(-2) #define FREE_PAGE 1 #define OBJECTPAGE 0 #define CONTPAGE 1 #define PERCENT(x, y) (((x) * 100) / (y)) #define HEAPPERCENT(x) PERCENT(x, logical_pages) #define IS_CLUSTER(a,b) (SAME_PHYSPAGE (PAGE_TO_ADDR ((a)), \ PAGE_TO_ADDR ((b))) || \ (space[a] == space[b] && \ types[(a)&hp_per_pp_mask] == OBJECTPAGE && \ types[((b)&hp_per_pp_mask)+hp_per_pp] == OBJECTPAGE)) /* check whether the (physical) page starting at address addr is protected * or not. SET_PROTECT and SET_UNPROTECT are used to set or clear the flag * for the page starting at address addr in the pmap array. The job of * protecting a page (by calling mprotect) is done in PROTECT/UNPROTECT. */ #define PMAP(addr) pmap[((addr) - PAGE_TO_ADDR(0)) >> pp_shift] #define IS_PROTECTED(addr) ( PMAP (addr) ) #define SET_PROTECT(addr) { PMAP (addr) = 1; protected_pages++; } #define SET_UNPROTECT(addr) { PMAP (addr) = 0; protected_pages--; } #if defined(MPROTECT_SIG) || defined(MPROTECT_MMAP) # ifndef PROT_RW # define PROT_RW (PROT_READ | PROT_WRITE) # endif # ifndef PROT_NONE # define PROT_NONE 0 # endif # define MPROTECT(addr,len,prot) { if (inc_collection) \ mprotect ((caddr_t)(addr), (len), \ (prot)); } #else # define PROT_RW # define PROT_NONE # define MPROTECT(addr,len,prot) #endif #define PROTECT(addr) { if (!IS_PROTECTED (addr)) { \ if (!scanning) { \ SET_PROTECT (addr); \ MPROTECT ((addr), bytes_per_pp, PROT_NONE); \ } else \ AddDirty ((addr)); \ } } #define UNPROTECT(addr) { if (IS_PROTECTED (addr)) { \ SET_UNPROTECT (addr); \ MPROTECT ((addr), bytes_per_pp, PROT_RW); \ } } /*****************************************************************************/ /* the following functions maintain a linked list to remember pages that * are "endangered" while scanning goes on. The list elements are arrays, * each one containing some page addresses. If an array is filled, a new * one is appended to the list (dynamically). * An address is not added to the list if the most recently added entry * is the same address. It is not necessary to add an address if it is in * the list anywhere, but searching would be too time-consuming. */ static void SetupDirtyList () { dirtylist = (struct dirty_rec *) malloc (sizeof (struct dirty_rec)); if (dirtylist == (struct dirty_rec *)0) Fatal_Error ("SetupDirtyList: unable to allocate memory"); memset (dirtylist->pages, 0, sizeof (dirtylist->pages)); dirtylist->next = (struct dirty_rec *)0; dirtyhead = dirtylist; dirtyentries = 0; } static void AddDirty (pageno_t addr) { struct dirty_rec *p; if (dirtyentries != 0 && dirtylist->pages[(dirtyentries-1) % DIRTYENTRIES] == addr) return; else dirtylist->pages[dirtyentries++ % DIRTYENTRIES] = addr; if (dirtyentries % DIRTYENTRIES == 0) { p = (struct dirty_rec *) malloc (sizeof (struct dirty_rec)); if (p == (struct dirty_rec *)0) Fatal_Error ("AddDirty: unable to allocate memory"); memset (p->pages, 0, sizeof (p->pages)); p->next = (struct dirty_rec *)0; dirtylist->next = p; dirtylist = p; } } static void ReprotectDirty () { int i; dirtylist = dirtyhead; while (dirtylist) { for (i = 0; i < DIRTYENTRIES && dirtyentries--; i++) PROTECT (dirtylist->pages[i]); dirtylist = dirtylist->next; } dirtyentries = 0; dirtylist = dirtyhead; dirtylist->next = (struct dirty_rec *)0; } /* register a page which has been promoted into the scan region by the * Visit function. If that page has not been scanned yet, return, else * remember the page to be scanned later. If there is not enough space * to remember pages, set a flag to rescan the whole scan region. */ static void RegisterPage (pageno_t page) { if (allscan) return; if (IS_SCANNED (PAGE_TO_ADDR (page))) { if (rescanpages < MAXRESCAN) rescan[rescanpages++] = page; else allscan = 1; } } /* determine a physical page cluster. Search backward until the beginning * of the cluster is found, then forward until the length of the cluster * is determined. The first parameter is the address of the first physical * page in the cluster, the second one is the length in physical pages. * Note that these parameters are value-result parameters ! */ static void DetermineCluster (gcptr_t *addr, int *len) { gcptr_t addr1; *len = 1; while (types[ADDR_TO_PAGE (*addr)] != OBJECTPAGE) { *addr -= bytes_per_pp; (*len)++; } addr1 = *addr + ((*len) << pp_shift); while (ADDR_TO_PAGE(addr1) <= lastpage && space[ADDR_TO_PAGE(addr1)] > 0 && types[ADDR_TO_PAGE(addr1)] != OBJECTPAGE) { addr1 += bytes_per_pp; (*len)++; } } /* the following two functions are used to protect or unprotect a page * cluster. The first parameter is the address of the first page of the * cluster, the second one is the length in physical pages. If the length * is 0, DetermineCluster is called to set length accordingly. */ static void ProtectCluster (gcptr_t addr, unsigned int len) { if (!len) DetermineCluster (&addr, &len); if (len > 1) { while (len) { if (!IS_PROTECTED (addr)) { MPROTECT (addr, len << pp_shift, PROT_NONE); break; } len--; addr += bytes_per_pp; } while (len--) { if (!IS_PROTECTED (addr)) SET_PROTECT (addr); addr += bytes_per_pp; } } else { if (!IS_PROTECTED (addr)) { MPROTECT (addr, bytes_per_pp, PROT_NONE); SET_PROTECT (addr); } } } static void UnprotectCluster (gcptr_t addr, unsigned int len) { if (!len) DetermineCluster (&addr, &len); MPROTECT (addr, len << pp_shift, PROT_RW); while (len--) { if (IS_PROTECTED (addr)) SET_UNPROTECT (addr); addr += bytes_per_pp; } } /* add one page to the stable set queue */ static void AddQueue (pageno_t page) { if (stable_queue != (pageno_t)-1) linked[stable_tail] = page; else stable_queue = page; linked[page] = (pageno_t)-1; stable_tail = page; } /* the following function promotes all heap pages in the stable set queue * into current space. After this, there are no more forwarded pages in the * heap. */ static void PromoteStableQueue () { Object *p; int pcount, size; pageno_t start; while (stable_queue != (pageno_t)-1) { p = PAGE_TO_OBJ (stable_queue); #ifdef ALIGN_8BYTE p++; #endif size = HEADER_TO_WORDS (*p); pcount = NEEDED_PAGES (size); start = stable_queue; while (pcount--) space[start++] = current_space; stable_queue = linked[stable_queue]; } current_pages = allocated_pages; forwarded_pages = 0; } /* calculate the logarithm (base 2) for arguments == 2**n */ static int Logbase2 (addrarith_t psize) { int shift = 0; #if LONG_BITS-64 == 0 if (psize & 0xffffffff00000000) shift += 32; if (psize & 0xffff0000ffff0000) shift += 16; if (psize & 0xff00ff00ff00ff00) shift += 8; if (psize & 0xf0f0f0f0f0f0f0f0) shift += 4; if (psize & 0xcccccccccccccccc) shift += 2; if (psize & 0xaaaaaaaaaaaaaaaa) shift += 1; #else if (psize & 0xffff0000) shift += 16; if (psize & 0xff00ff00) shift += 8; if (psize & 0xf0f0f0f0) shift += 4; if (psize & 0xcccccccc) shift += 2; if (psize & 0xaaaaaaaa) shift += 1; #endif return (shift); } /* return next heap page number, wrap around at the end of the heap. */ static pageno_t next (pageno_t page) { return ((page < lastpage) ? page+1 : firstpage); } /*****************************************************************************/ #ifdef MPROTECT_MMAP static char *heapmalloc (int s) { char *ret = mmap (0, s, PROT_READ|PROT_WRITE, MAP_ANON, -1, 0); if (ret == (char*)-1) ret = 0; return ret; } #else # define heapmalloc(size) (char *)malloc ((size)) #endif /* * make a heap of size kilobytes. It is divided into heappages of * PAGEBYTES byte and is aligned at a physical page boundary. The * heapsize is rounded up to the nearest multiple of the physical * pagesize. Checked by sam@hocevar.net on Apr 1, 2003. */ void Make_Heap (int size) { addrarith_t heapsize = size * 2 * 1024; char *heap_ptr, *aligned_heap_ptr; Object heap_obj; pageno_t i; #if defined(MPROTECT_SIG) || defined(MPROTECT_MMAP) InstallHandler (); #endif /* calculate number of logical heappages and of used physical pages. * First, round up to the nearest multiple of the physical pagesize, * then calculate the resulting number of heap pages. */ #if defined(_SC_PAGESIZE) if ((bytes_per_pp = sysconf (_SC_PAGESIZE)) == -1) Fatal_Error ("sysconf(_SC_PAGESIZE) failed; can't get pagesize"); #elif defined(HAVE_GETPAGESIZE) bytes_per_pp = getpagesize (); #elif defined(MPROTECT_SIG) || defined(MPROTECT_MMAP) # error "mprotect requires getpagesize or sysconf_pagesize" #else bytes_per_pp = 4096; #endif physical_pages = (heapsize+bytes_per_pp-1)/bytes_per_pp; hp_per_pp = bytes_per_pp / PAGEBYTES; hp_per_pp_mask = ~(hp_per_pp - 1); logical_pages = spanning_pages = physical_pages * hp_per_pp; pp_mask = ~(bytes_per_pp-1); pp_shift = Logbase2 (bytes_per_pp); heap_ptr = heapmalloc (logical_pages*PAGEBYTES+bytes_per_pp-1); /* FIXME: add heap_ptr to a list of pointers to free */ saved_heap_ptr = heap_ptr; if (heap_ptr == NULL) Fatal_Error ("cannot allocate heap (%u KBytes)", size); /* Align heap at a memory page boundary */ if ((gcptr_t)heap_ptr & (bytes_per_pp-1)) aligned_heap_ptr = (char*)(((gcptr_t)heap_ptr+bytes_per_pp-1) & ~(bytes_per_pp-1)); else aligned_heap_ptr = heap_ptr; SET(heap_obj, 0, (intptr_t)aligned_heap_ptr); #ifdef ARRAY_BROKEN pagebase = ((gcptr_t)POINTER (heap_obj)) / PAGEBYTES; #endif firstpage = OBJ_TO_PAGE (heap_obj); lastpage = firstpage+logical_pages-1; space = (gcspace_t *)malloc (logical_pages*sizeof (gcspace_t)); types = (gcspace_t *)malloc ((logical_pages + 1)*sizeof (gcspace_t)); pmap = (gcspace_t *)malloc (physical_pages*sizeof (gcspace_t)); linked = (pageno_t *)malloc (logical_pages*sizeof (pageno_t)); if (!space || !types || !pmap || !linked) { free (heap_ptr); if (space) free ((char*)space); if (types) free ((char*)types); if (pmap) free ((char*)pmap); if (linked) free ((char*)linked); Fatal_Error ("cannot allocate heap maps"); } memset (types, 0, (logical_pages + 1)*sizeof (gcspace_t)); memset (pmap, 0, physical_pages*sizeof (gcspace_t)); memset (linked, 0, logical_pages*sizeof (unsigned int)); space -= firstpage; /* to index the arrays with the heap page number */ types -= firstpage; types[lastpage+1] = OBJECTPAGE; linked -= firstpage; #ifndef ARRAY_BROKEN pmap -= (PAGE_TO_ADDR (firstpage) >> pp_shift); #endif for (i = firstpage; i <= lastpage; i++) space[i] = FREE_PAGE; allocated_pages = 0; forwarded_pages = 0; current_pages = 0; protected_pages = 0; stable_queue = (pageno_t)-1; SetupDirtyList (); current_space = forward_space = previous_space = 3; current_freepage = firstpage; current_free = 0; } /* * increment the heap by 1024 KB. Checked by sam@hocevar.net on Apr 1, 2003. */ static int ExpandHeap (char *reason) { int increment = (1024 * 1024 + bytes_per_pp - 1) / bytes_per_pp; int incpages = increment * hp_per_pp; addrarith_t heapinc = incpages * PAGEBYTES; pageno_t new_first, inc_first; pageno_t new_last, inc_last; pageno_t new_logpages, new_physpages; pageno_t new_spanpages; gcptr_t addr; gcspace_t *new_space, *new_type, *new_pmap; pageno_t *new_link, i; char *heap_ptr, *aligned_heap_ptr; Object heap_obj; #ifdef ARRAY_BROKEN pageno_t new_pagebase, offset; pageno_t new_firstpage, new_lastpage; #else # define offset 0 #endif /* FIXME: this pointer is lost */ heap_ptr = heapmalloc (heapinc+bytes_per_pp/*-1*/); if (heap_ptr == NULL) { if (Var_Is_True (V_Garbage_Collect_Notifyp)) { char buf[243]; sprintf(buf, "[Heap expansion failed (%s)]~%%", reason); Format (Standard_Output_Port, buf, strlen(buf), 0, (Object *)0); (void)fflush (stdout); } return (0); } /* Align heap at a memory page boundary */ if ((gcptr_t)heap_ptr & (bytes_per_pp-1)) aligned_heap_ptr = (char*)(((gcptr_t)heap_ptr+bytes_per_pp-1) & ~(bytes_per_pp-1)); else aligned_heap_ptr = heap_ptr; SET(heap_obj, 0, (intptr_t)aligned_heap_ptr); new_first = firstpage; new_last = lastpage; #ifdef ARRAY_BROKEN new_pagebase = ((gcptr_t)POINTER (heap_obj)) / PAGEBYTES; inc_first = 0; /* = OBJ_TO_PAGE (heap_obj) - new_pagebase */ new_firstpage = (pagebase > new_pagebase) ? new_pagebase : pagebase; new_lastpage = (pagebase > new_pagebase) ? pagebase + lastpage : new_pagebase + incpages - 1; offset = pagebase - new_firstpage; #else inc_first = OBJ_TO_PAGE (heap_obj); #endif inc_last = inc_first+incpages-1; if (inc_last > lastpage) new_last = inc_last; if (inc_first < firstpage) new_first = inc_first; new_logpages = logical_pages+incpages; #ifdef ARRAY_BROKEN new_spanpages = new_lastpage-new_firstpage+1; new_last = new_spanpages-1; #else new_spanpages = new_last-new_first+1; #endif new_physpages = new_spanpages / hp_per_pp; new_space = (gcspace_t *)malloc (new_spanpages*sizeof (gcspace_t)); new_type = (gcspace_t *)malloc ((new_spanpages + 1)*sizeof (gcspace_t)); new_pmap = (gcspace_t *)malloc (new_physpages*sizeof (gcspace_t)); new_link = (pageno_t *)malloc (new_spanpages*sizeof (pageno_t)); if (!new_space || !new_type || !new_pmap || !new_link) { free (heap_ptr); if (new_space) free ((char*)new_space); if (new_type) free ((char*)new_type); if (new_pmap) free ((char*)new_pmap); if (new_link) free ((char*)new_link); if (Var_Is_True (V_Garbage_Collect_Notifyp)) { Format (Standard_Output_Port, "[Heap expansion failed]~%", 25, 0, (Object *)0); (void)fflush (stdout); } return (0); } /* new_first will be 0 if ARRAY_BROKEN is defined. */ new_space -= new_first; new_type -= new_first; new_link -= new_first; memset (new_pmap, 0, new_physpages * sizeof (gcspace_t)); #ifndef ARRAY_BROKEN new_pmap -= (PHYSPAGE (new_first) >> pp_shift); #endif memset (new_type+inc_first+offset, 0, (incpages+1)*sizeof (gcspace_t)); memset (new_link+inc_first+offset, 0, incpages*sizeof (unsigned int)); /* FIXME: memmove! */ for (i = firstpage; i <= lastpage; i++) { new_link[i + offset] = linked[i] + offset; new_type[i + offset] = types[i]; } for (addr = PAGE_TO_ADDR (firstpage); addr <= PAGE_TO_ADDR (lastpage); addr += bytes_per_pp) { new_pmap[((addr - PAGE_TO_ADDR(0)) >> pp_shift) + offset] = IS_PROTECTED (addr); } #ifdef ARRAY_BROKEN for (i = 0; i < new_spanpages; i++) new_space[i] = UNALLOCATED_PAGE; for (i = firstpage; i <= lastpage; i++) new_space[i+offset] = space[i]; offset = offset ? 0 : new_pagebase - pagebase; for (i = offset; i <= offset + inc_last; i++) new_space[i] = FREE_PAGE; new_type[new_spanpages] = OBJECTPAGE; #else for (i = new_first; i < firstpage; i++) new_space[i] = UNALLOCATED_PAGE; for (i = firstpage; i <= lastpage; i++) new_space[i] = space[i]; for (i = lastpage+1; i <= new_last; i++) new_space[i] = UNALLOCATED_PAGE; for (i = inc_first; i <= inc_last; i++) new_space[i] = FREE_PAGE; new_type[new_last+1] = OBJECTPAGE; #endif current_freepage += offset; forward_freepage += offset; last_forward_freepage += offset; free ((char*)(linked+firstpage)); free ((char*)(types+firstpage)); free ((char*)(space+firstpage)); #ifndef ARRAY_BROKEN free ((char*)(pmap+(PAGE_TO_ADDR (firstpage) >> pp_shift))); #else free ((char*)pmap); #endif linked = new_link; types = new_type; space = new_space; pmap = new_pmap; firstpage = new_first; lastpage = new_last; logical_pages = new_logpages; spanning_pages = new_spanpages; physical_pages = new_physpages; if (Var_Is_True (V_Garbage_Collect_Notifyp)) { int a = (logical_pages * PAGEBYTES) >> 10; char buf[243]; sprintf(buf, "[Heap expanded to %dK (%s)]~%%", a, reason); Format (Standard_Output_Port, buf, strlen(buf), 0, (Object *)0); (void)fflush (stdout); } return (1); } /* * free the heap. */ void Free_Heap () { free (saved_heap_ptr); free ((char*)(linked+firstpage)); free ((char*)(types+firstpage)); free ((char*)(space+firstpage)); #ifndef ARRAY_BROKEN free ((char*)(pmap+(PAGE_TO_ADDR (firstpage) >> pp_shift))); #else free ((char*)pmap); #endif } /* allocate new logical heappages. npg is the number of pages to allocate. * If there is not enough space left, the heap will be expanded if possible. * The new page is allocated in current space. */ static int ProtectedInRegion (pageno_t start, pageno_t npages) { gcptr_t beginpage = PHYSPAGE (start); gcptr_t endpage = PHYSPAGE (start+npages-1); do { if (IS_PROTECTED (beginpage)) return (1); beginpage += bytes_per_pp; } while (beginpage <= endpage); return (0); } static void AllocPage (pageno_t npg) { pageno_t first_freepage = 0;/* first free heap page */ pageno_t cont_free; /* contiguous free pages */ pageno_t n, p; if (current_space != forward_space) { (void)Scanner ((pageno_t)1); if (!protected_pages) TerminateGC (); } else { if (inc_collection) { if (allocated_pages+npg >= logical_pages/3) P_Collect_Incremental (); } else { if (allocated_pages+npg >= logical_pages/2) P_Collect (); } } /* now look for a cluster of npg free pages. cont_free counts the * number of free pages found, first_freepage is the number of the * first free heap page in the cluster. */ for (p = spanning_pages, cont_free = 0; p; p--) { /* If we have more space than before, or if the current page is * stable, start again with the next page. */ if (space[current_freepage] >= previous_space || STABLE (current_freepage)) { current_freepage = next (current_freepage); cont_free = 0; continue; } if (cont_free == 0) { /* This is our first free page, first check that we have a * continuous cluster of pages (we'll check later that they * are free). Otherwise, go to the next free page. */ if ((current_freepage+npg-1) > lastpage || !IS_CLUSTER (current_freepage, current_freepage+npg-1)) { current_freepage = next ((current_freepage&hp_per_pp_mask) +hp_per_pp-1); continue; } first_freepage = current_freepage; } cont_free++; if (cont_free == npg) { space[first_freepage] = current_space; types[first_freepage] = OBJECTPAGE; for (n = 1; n < npg; n++) { space[first_freepage+n] = current_space; types[first_freepage+n] = CONTPAGE; } current_freep = PAGE_TO_OBJ (first_freepage); current_free = npg*PAGEWORDS; current_pages += npg; allocated_pages += npg; current_freepage = next (first_freepage+npg-1); if (ProtectedInRegion (first_freepage, npg)) (void)ScanCluster (PHYSPAGE (first_freepage)); return; } /* check the next free page. If we warped, reset cont_free to 0. */ current_freepage = next (current_freepage); if (current_freepage == firstpage) cont_free = 0; } /* no space available, try to expand heap */ if (ExpandHeap ("to allocate new object")) { AllocPage (npg); return; } Fatal_Error ("unable to allocate %lu bytes in heap", npg*PAGEBYTES); /*NOTREACHED*/ } /* allocate an object in the heap. size is the size of the new object * in bytes, type describes the object's type (see object.h), and konst * determines whether the object is immutable. */ Object Alloc_Object (size, type, konst) { Object obj; register addrarith_t s = /* size in words */ ((size + sizeof(Object) - 1) / sizeof(Object)) + 1; int big = 0; if (GC_Debug) { if (inc_collection) P_Collect_Incremental (); else P_Collect (); } /* if there is not enough space left on the current page, discard * the left space and allocate a new page. Space is discarded by * writing a T_Freespace object. */ if (s > current_free) { if (current_free) { MAKE_HEADER (*current_freep, current_free, T_Freespace); current_free = 0; } /* If we are about to allocate an object bigger than one heap page, * set a flag. The space behind big objects is discarded, see below. */ #ifdef ALIGN_8BYTE if (s < PAGEWORDS-1) AllocPage ((pageno_t)1); else { AllocPage ((pageno_t)(s+PAGEWORDS)/PAGEWORDS); big = 1; } MAKE_HEADER (*current_freep, 1, T_Align_8Byte); current_freep++; current_free--; #else if (s < PAGEWORDS) AllocPage ((pageno_t)1); else { AllocPage ((pageno_t)(s+PAGEWORDS-1)/PAGEWORDS); big = 1; } #endif } /* now write a header for the object into the heap and update the * pointer to the next free location and the counter of free words * in the current heappage. */ MAKE_HEADER (*current_freep, s, type); current_freep++; *current_freep = Null; SET (obj, type, (intptr_t)current_freep); if (big) current_freep = (Object*)0, current_free = 0; else current_freep += (s-1), current_free -= s; #ifdef ALIGN_8BYTE if (!((gcptr_t)current_freep & 7) && current_free) { MAKE_HEADER (*current_freep, 1, T_Align_8Byte); current_freep++; current_free--; } #endif if (type == T_Control_Point) CONTROL(obj)->reloc = 0; if (konst) SETCONST (obj); return (obj); } /* allocate a page in forward space. If there is no space left, the heap * is expanded. The argument prevents allocation of a heap page which lies * on the same physical page the referenced object lies on. */ static void AllocForwardPage (Object bad) { Object *badaddr = (Object *)POINTER (bad); pageno_t whole_heap = spanning_pages; pageno_t tpage; while (whole_heap--) { if (space[forward_freepage] < previous_space && !STABLE (forward_freepage) && !SAME_PHYSPAGE ((gcptr_t)badaddr, PAGE_TO_ADDR (forward_freepage)) && !IN_SCANREGION (PAGE_TO_ADDR (forward_freepage))) { allocated_pages++; forwarded_pages++; space[forward_freepage] = forward_space; types[forward_freepage] = OBJECTPAGE; forward_freep = PAGE_TO_OBJ (forward_freepage); forward_free = PAGEWORDS; AddQueue (forward_freepage); tpage = last_forward_freepage; last_forward_freepage = next (forward_freepage); forward_freepage = tpage; return; } else { forward_freepage = next (forward_freepage); } } if (ExpandHeap ("to allocate forward page")) { AllocForwardPage (bad); return; } Fatal_Error ("unable to allocate forward page in %lu KBytes heap", (logical_pages * PAGEBYTES) >> 10); /*NOTREACHED*/ } /* Visit an object and move it into forward space. The forwarded * object must be protected because it is to be scanned later. */ int Visit (register Object *cp) { register pageno_t page = OBJ_TO_PAGE (*cp); register Object *obj_ptr = (Object *)POINTER (*cp); int tag = TYPE (*cp); int konst = ISCONST (*cp); addrarith_t objwords; pageno_t objpages, pcount; gcptr_t ffreep, pageaddr = 0; int outside; /* if the Visit function is called via the REVIVE_OBJ macro and we are * not inside an incremental collection, exit immediately. */ if (current_space == forward_space) return 0; if (page < firstpage || page > lastpage || STABLE (page) || space[page] == current_space || space[page] == UNALLOCATED_PAGE || !Types[tag].haspointer) return 0; if (space[page] != previous_space) { char buf[100]; sprintf (buf, "Visit: object not in prev space at %p ('%s') %d %d", obj_ptr, Types[tag].name, space[page], previous_space); Panic (buf); } if (!IN_SCANREGION (obj_ptr) && IS_PROTECTED ((gcptr_t)obj_ptr)) { pageaddr = OBJ_TO_PPADDR (*cp); UNPROTECT (pageaddr); } if (WAS_FORWARDED (*cp)) { if (pageaddr != 0) PROTECT (pageaddr); MAKEOBJ (*cp, tag, (intptr_t)POINTER(*obj_ptr)); if (konst) SETCONST (*cp); return 0; } ffreep = PTR_TO_PPADDR (forward_freep); outside = !IN_SCANREGION (forward_freep); objwords = HEADER_TO_WORDS (*(obj_ptr - 1)); if (objwords >= forward_free) { #ifdef ALIGN_8BYTE if (objwords >= PAGEWORDS - 1) { objpages = (objwords + PAGEWORDS) / PAGEWORDS; #else if (objwords >= PAGEWORDS) { objpages = (objwords + PAGEWORDS - 1) / PAGEWORDS; #endif forwarded_pages += objpages; for (pcount = 0; pcount < objpages; pcount++) space[page + pcount] = forward_space; AddQueue (page); if (IN_SCANREGION (PAGE_TO_ADDR (page))) RegisterPage (page); else ProtectCluster (PHYSPAGE (page), 0); if (pageaddr != 0) PROTECT (pageaddr); return 0; } if (forward_free) { if (outside && IS_PROTECTED (ffreep) && !SAME_PHYSPAGE ((gcptr_t)obj_ptr, ffreep)) { UNPROTECT (ffreep); MAKE_HEADER (*forward_freep, forward_free, T_Freespace); forward_free = 0; PROTECT (ffreep); } else { MAKE_HEADER (*forward_freep, forward_free, T_Freespace); forward_free = 0; } } AllocForwardPage (*cp); outside = !IN_SCANREGION (forward_freep); ffreep = PTR_TO_PPADDR (forward_freep); /* re-set ffreep ! */ #ifdef ALIGN_8BYTE if (outside && IS_PROTECTED (ffreep)) UNPROTECT (ffreep); MAKE_HEADER (*forward_freep, 1, T_Align_8Byte); forward_freep++; forward_free--; goto do_forward; #endif } if (outside && IS_PROTECTED (ffreep)) UNPROTECT (ffreep); #ifdef ALIGN_8BYTE do_forward: #endif if (tag == T_Control_Point) { CONTROL (*cp)->reloc = (char*)(forward_freep + 1) - (char*)obj_ptr; } MAKE_HEADER (*forward_freep, objwords, tag); forward_freep++; memcpy (forward_freep, obj_ptr, (objwords-1)*sizeof(Object)); SET (*obj_ptr, T_Broken_Heart, (intptr_t)forward_freep); MAKEOBJ (*cp, tag, (intptr_t)forward_freep); if (konst) SETCONST (*cp); forward_freep += (objwords - 1); forward_free -= objwords; #ifdef ALIGN_8BYTE if (!((gcptr_t)forward_freep & 7) && forward_free) { MAKE_HEADER (*forward_freep, 1, T_Align_8Byte); forward_freep++; forward_free--; } #endif if (outside) PROTECT (ffreep); if (pageaddr != 0) PROTECT (pageaddr); return 0; } /* Scan a page and visit all objects referenced by objects lying on the * page. This will possibly forward the referenced objects. */ static void ScanPage (Object *currentp, Object *nextcp) { Object *cp = currentp, obj; addrarith_t len, m, n; int t; while (cp < nextcp && (cp != forward_freep || forward_free == 0)) { t = HEADER_TO_TYPE (*cp); len = HEADER_TO_WORDS (*cp); cp++; /* cp now points to the real Scheme object in the heap. t denotes * the type of the object, len its length inclusive header in * words. */ SET(obj, t, (intptr_t)cp); switch (t) { case T_Symbol: Visit (&SYMBOL(obj)->next); Visit (&SYMBOL(obj)->name); Visit (&SYMBOL(obj)->value); Visit (&SYMBOL(obj)->plist); break; case T_Pair: case T_Environment: Visit (&PAIR(obj)->car); Visit (&PAIR(obj)->cdr); break; case T_Vector: for (n = 0, m = VECTOR(obj)->size; n < m; n++ ) Visit (&VECTOR(obj)->data[n]); break; case T_Compound: Visit (&COMPOUND(obj)->closure); Visit (&COMPOUND(obj)->env); Visit (&COMPOUND(obj)->name); break; case T_Control_Point: (CONTROL(obj)->delta) += CONTROL(obj)->reloc; #ifdef HAVE_ALLOCA Visit_GC_List (CONTROL(obj)->gclist, CONTROL(obj)->delta); #else Visit (&CONTROL(obj)->gcsave); #endif Visit_Wind (CONTROL(obj)->firstwind, (CONTROL(obj)->delta) ); Visit (&CONTROL(obj)->env); break; case T_Promise: Visit (&PROMISE(obj)->env); Visit (&PROMISE(obj)->thunk); break; case T_Port: Visit (&PORT(obj)->name); break; case T_Autoload: Visit (&AUTOLOAD(obj)->files); Visit (&AUTOLOAD(obj)->env); break; case T_Macro: Visit (&MACRO(obj)->body); Visit (&MACRO(obj)->name); break; default: if (Types[t].visit) (Types[t].visit) (&obj, Visit); } cp += (len - 1); } } /* rescan all pages remembered by the RegisterPage function. */ static void RescanPages () { register Object *cp; register int i; int pages = rescanpages; rescanpages = 0; for (i = 0; i < pages; i++) { cp = PAGE_TO_OBJ (rescan[i]); #ifdef ALIGN_8BYTE ScanPage (cp + 1, cp + PAGEWORDS); #else ScanPage (cp, cp + PAGEWORDS); #endif } } static int ScanCluster (gcptr_t addr) { register pageno_t page, last; pageno_t npages; int n = 0; scanning = 1; DetermineCluster (&addr, &n); npages = n; scanfirst = (Object *)addr; scanlast = (Object *)(addr + (npages << pp_shift) - sizeof (Object)); UnprotectCluster ((gcptr_t)scanfirst, (int)npages); rescan_cluster: last = ADDR_TO_PAGE ((gcptr_t)scanlast); for (page = ADDR_TO_PAGE ((gcptr_t)scanfirst); page <= last; page++) { if (STABLE (page) && types[page] == OBJECTPAGE) { scanpointer = PAGE_TO_OBJ (page); #ifdef ALIGN_8BYTE ScanPage (scanpointer + 1, scanpointer + PAGEWORDS); #else ScanPage (scanpointer, scanpointer + PAGEWORDS); #endif } } while (rescanpages) { if (allscan) { allscan = 0; goto rescan_cluster; } else RescanPages (); } scanfirst = (Object *)0; scanlast = (Object *)0; scanning = 0; ReprotectDirty (); return (npages); /* return number of scanned pages */ } static int Scanner (pageno_t npages) { register gcptr_t addr, lastaddr; pageno_t spages; pageno_t scanned = 0; while (npages > 0 && protected_pages) { lastaddr = PAGE_TO_ADDR (lastpage); for (addr = PAGE_TO_ADDR(firstpage); addr < lastaddr && npages > 0; addr += bytes_per_pp) { if (IS_PROTECTED (addr)) { if (space[ADDR_TO_PAGE (addr)] == UNALLOCATED_PAGE) Panic ("Scanner: found incorrect heap page"); spages = ScanCluster (addr); scanned += spages; npages -= spages; } } } scanfirst = (Object *)0; scanlast = scanfirst; return (scanned); } #if defined(MPROTECT_SIG) || defined(MPROTECT_MMAP) /* the following function handles a page fault. If the fault was caused * by the mutator and incremental collection is enabled, this will result * in scanning the physical page the fault occured on. */ #ifdef SIGSEGV_SIGCONTEXT static void PagefaultHandler (int sig, int code, struct sigcontext *scp) { char *addr = (char *)(scp->sc_badvaddr); #else #ifdef SIGSEGV_AIX static void PagefaultHandler (int sig, int code, struct sigcontext *scp) { char *addr = (char *)scp->sc_jmpbuf.jmp_context.except[3]; /* * Or should that be .jmp_context.o_vaddr? */ #else #ifdef SIGSEGV_SIGINFO static void PagefaultHandler (int sig, siginfo_t *sip, ucontext_t *ucp) { char *addr; #else #ifdef SIGSEGV_ARG4 static void PagefaultHandler (int sig, int code, struct sigcontext *scp, char *addr) { #else #ifdef SIGSEGV_HPUX static void PagefaultHandler (int sig, int code, struct sigcontext *scp) { #else # include "HAVE_MPROTECT defined, but missing SIGSEGV_xxx" #endif #endif #endif #endif #endif pageno_t page; gcptr_t ppage; char *errmsg = 0; #ifdef SIGSEGV_AIX if ((char *)scp->sc_jmpbuf.jmp_context.except[0] != addr) Panic ("except"); #endif #ifdef SIGSEGV_SIGINFO if (sip == 0) Fatal_Error ("SIGSEGV handler got called with zero siginfo_t"); addr = sip->si_addr; #endif #ifdef SIGSEGV_HPUX char *addr; if (scp == 0) Fatal_Error ("SIGSEGV handler got called with zero sigcontext"); addr = (char *)scp->sc_sl.sl_ss.ss_cr21; #endif ppage = PTR_TO_PPADDR(addr); page = ADDR_TO_PAGE((gcptr_t)addr); if (!inc_collection) errmsg = "SIGSEGV signal received"; else if (current_space == forward_space) errmsg = "SIGSEGV signal received while not garbage collecting"; else if (page < firstpage || page > lastpage) errmsg = "SIGSEV signal received; address outside of heap"; if (errmsg) { fprintf (stderr, "\n[%s]\n", errmsg); abort (); } GC_In_Progress = 1; (void)ScanCluster (ppage); GC_In_Progress = 0; #ifdef SIGSEGV_AIX InstallHandler (); #endif return; } void InstallHandler () { #ifdef SIGSEGV_SIGINFO struct sigaction sact; sigset_t mask; sact.sa_handler = (void (*)())PagefaultHandler; sigemptyset (&mask); sact.sa_mask = mask; sact.sa_flags = SA_SIGINFO; if (sigaction (SIGSEGV, &sact, 0) == -1) { perror ("sigaction"); exit (1); } #else (void)signal (SIGSEGV, (void (*)())PagefaultHandler); #endif } #endif static void TerminateGC () { int save_force_total; forward_space = current_space; previous_space = current_space; if (protected_pages) Panic ("TerminateGC: protected pages after collection"); allocated_pages = current_pages + forwarded_pages; current_pages = 0; if (forward_free) { MAKE_HEADER (*forward_freep, forward_free, T_Freespace); forward_free = 0; } forward_freep = (Object *)0; Call_After_GC(); GC_In_Progress = 0; Enable_Interrupts; if (Var_Is_True (V_Garbage_Collect_Notifyp) && !GC_Debug) { int foo = percent - HEAPPERCENT (allocated_pages); Object bar; bar = Make_Integer (foo); if (!incomplete_msg) Format (Standard_Output_Port, "[", 1, 0, (Object *)0); if (foo >= 0) Format (Standard_Output_Port, "~s% reclaimed]~%", 16, 1, &bar); else Format (Standard_Output_Port, "finished]~%", 11, 0, (Object *)0); (void)fflush (stdout); incomplete_msg = 0; } if (PERCENT (allocated_pages, old_logical_pages) >= tuneable_force_total) { PromoteStableQueue (); save_force_total = tuneable_force_total; tuneable_force_total = 100; if (inc_collection) P_Collect_Incremental (); else P_Collect (); tuneable_force_total = save_force_total; if (HEAPPERCENT (allocated_pages) >= tuneable_newly_expand) /* return value should not be ignore here: */ (void)ExpandHeap ("after full collection"); } } static void Finish_Collection () { register gcptr_t addr; do { for (addr = PAGE_TO_ADDR(firstpage); addr < PAGE_TO_ADDR(lastpage); addr += bytes_per_pp) { if (IS_PROTECTED (addr)) { (void)ScanCluster (addr); if (protected_pages == 0) TerminateGC (); } } } while (protected_pages); return; } static void General_Collect (int initiate) { pageno_t fpage, free_fpages, i; pageno_t page; pageno_t fregion_pages; Object obj; if (!Interpreter_Initialized) Fatal_Error ("Out of heap space (increase heap size)"); if (current_space != forward_space && !inc_collection) { Format (Standard_Output_Port, "GC while GC in progress~%", 25, 0, (Object*)0); return; } /* Call all user-registered functions to be executed just before GC. */ Disable_Interrupts; GC_In_Progress = 1; Call_Before_GC(); percent = HEAPPERCENT (allocated_pages); old_logical_pages = logical_pages; if (Var_Is_True (V_Garbage_Collect_Notifyp) && !GC_Debug) { if (initiate) { Format (Standard_Output_Port, "[Garbage collecting...]~%", 25, 0, (Object *)0); incomplete_msg = 0; } else { Format (Standard_Output_Port, "[Garbage collecting... ", 23, 0, (Object *)0); incomplete_msg = 1; } (void)fflush (stdout); } if (GC_Debug) { printf ("."); (void)fflush (stdout); } /* discard any remaining portion of the current heap page */ if (current_free) { MAKE_HEADER (*current_freep, current_free, T_Freespace); current_free = 0; } /* partition regions for forwarded and newly-allocated objects. Then * advance the current free pointer so that - if possible - there will * be RESERVEDPAGES free heap pages in the forward region. */ forward_freepage = current_freepage; last_forward_freepage = forward_freepage; current_freep = PAGE_TO_OBJ (current_freepage); forward_freep = current_freep; fpage = forward_freepage; free_fpages = 0; fregion_pages = logical_pages / tuneable_forward_region; for (i = 0; free_fpages <= fregion_pages && i < spanning_pages; i++) { if (space[fpage] != current_space && !STABLE (fpage)) free_fpages++; fpage = next (fpage); } current_freep = (Object *)PHYSPAGE (fpage); SET(obj, 0, (intptr_t)current_freep); current_freepage = OBJ_TO_PAGE (obj); /* advance spaces. Then forward all objects directly accessible * via the global GC lists and the WIND list. */ current_pages = 0; forward_space = current_space + 1; current_space = current_space + 2; Visit_GC_List (Global_GC_Obj, 0); Visit_GC_List (GC_List, 0); Visit_Wind (First_Wind, 0); /* If collecting in a non-incremental manner, scan all heap pages which * have been protected, else check whether to expand the heap because * the stable set has grown too big. */ page = stable_queue; while (page != (pageno_t)-1) { ProtectCluster (PHYSPAGE (page), 0); page = linked[page]; } if (!initiate) { Finish_Collection (); } else if (HEAPPERCENT (forwarded_pages) > tuneable_force_expand) /* return value should not be ignored here: */ (void)ExpandHeap ("large stable set"); GC_In_Progress = 0; return; } Object P_Collect_Incremental () { /* if already collecting, scan a few pages and return */ if (!inc_collection) { if (current_space == forward_space) Primitive_Error ("incremental garbage collection not enabled"); else { inc_collection = 1; Finish_Collection (); inc_collection = 0; return (True); } } else { if (current_space != forward_space) { (void)Scanner ((pageno_t)1); GC_In_Progress = 0; if (protected_pages == 0) TerminateGC (); return (protected_pages ? False : True); } else { General_Collect (1); return (False); } } /*NOTREACHED*/ } Object P_Collect () { /* Check the inc_collection flag. If an incremental GC is in * progress and the flag has been changed to false, finish * the collection. */ if (!inc_collection && current_space != forward_space) { inc_collection = 1; Finish_Collection (); inc_collection = 0; return (Void); } if (current_space != forward_space) { Finish_Collection (); return (Void); } else { General_Collect (0); return (Void); } } void Generational_GC_Finalize () { if (current_space != forward_space) Finish_Collection (); } void Generational_GC_Reinitialize () { #if defined(MPROTECT_SIG) || defined(MPROTECT_MMAP) InstallHandler (); #endif } Object Internal_GC_Status (int strat, int flags) { Object list; #if defined(MPROTECT_SIG) || defined(MPROTECT_MMAP) Object cell; #endif GC_Node; list = Cons (Sym_Generational_GC, Null); GC_Link (list); switch (strat) { default: /* query or stop-and-copy */ #if defined(MPROTECT_SIG) || defined(MPROTECT_MMAP) if (inc_collection) { cell = Cons (Sym_Incremental_GC, Null); (void)P_Set_Cdr (list, cell); } #endif break; case GC_STRAT_GEN: if (flags == GC_FLAGS_INCR) { #if defined(MPROTECT_SIG) || defined(MPROTECT_MMAP) inc_collection = 1; cell = Cons (Sym_Incremental_GC, Null); (void)P_Set_Cdr (list, cell); #endif } else inc_collection = 0; break; } GC_Unlink; return (list); } elk-3.99.8/src/type.c0000644000175000017500000000671111577076306011255 00000000000000/* type.c: Built-in and user-defined Scheme types. * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "config.h" #include #include "kernel.h" #define TYPE_GROW 10 TYPEDESCR *Types; int Num_Types, Max_Type; char *builtin_types[] = { "0integer", "1integer" /* bignum */, "1real", "0null", "0boolean", "0unbound", "0special", "0character", "1symbol", "1pair", "1environment", "1string", "1vector", "1primitive", "1compound", "1control-point", "1promise", "1port", "0end-of-file", "1autoload", "1macro", "1!!broken-heart!!", #ifdef GENERATIONAL_GC "0align_8byte", "0freespace", #endif 0 }; void Wrong_Type (Object x, register int t) { Wrong_Type_Combination (x, Types[t].name); } void Wrong_Type_Combination (Object x, register char const *name) { register int t = TYPE(x); char buf[100]; if (t < 0 || t >= Num_Types) Panic ("bad type1"); sprintf (buf, "wrong argument type %s (expected %s)", Types[t].name, name); Primitive_Error (buf); } Object P_Type (Object x) { register int t = TYPE(x); if (t < 0 || t >= Num_Types) Panic ("bad type2"); return Intern (Types[t].name); } int Define_Type (register int t, char const *name, int (*size)(), int const_size, int (*eqv)(), int (*equal)(), int (*print)(), int (*visit)()) { register TYPEDESCR *p; Set_Error_Tag ("define-type"); if (t != 0) Fatal_Error("first arg of Define_Type() must be 0"); if (Num_Types == Max_Type) { Max_Type += TYPE_GROW; Types = (TYPEDESCR *)Safe_Realloc((char *)Types, Max_Type * sizeof(TYPEDESCR)); } Disable_Interrupts; p = &Types[Num_Types++]; p->haspointer = 1; p->name = name; p->size = size; p->const_size = const_size; p->eqv = eqv; p->equal = equal; p->print = print; p->visit = visit; Enable_Interrupts; return Num_Types-1; } void Init_Type() { int i, bytes; char *p; Num_Types = (sizeof(builtin_types) - 1) / sizeof(char *); Max_Type = Num_Types + TYPE_GROW; bytes = Max_Type * sizeof(TYPEDESCR); Types = (TYPEDESCR *)Safe_Malloc(bytes); memset(Types, 0, bytes); for (i = 0; (p = builtin_types[i]); i++) { Types[i].haspointer = *p != '0'; Types[i].name = p + 1; /* Skip first character */ } } elk-3.99.8/src/cont.c0000644000175000017500000002406311577076306011237 00000000000000/* cont.c: Continuations and dynamic-wind. * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "config.h" #include #include "kernel.h" extern void Switch_Environment (Object); void Jump_Cont (struct S_Control *, Object); void Do_Wind (Object); /* The C library versions of longjmp on the VAX and the Convex unwind * the stack. As Jump_Cont below installs a new stack before calling * longjmp, the standard version cannot be used. The following simplistic * version of setjmp/longjmp is used instead: */ #if defined(vax) || defined(__vax__) __asm__(" .globl _setjmp"); __asm__("_setjmp:"); __asm__(" .word 0"); __asm__(" movl 4(ap),r0"); __asm__(" movq r2,(r0)+"); __asm__(" movq r4,(r0)+"); __asm__(" movq r6,(r0)+"); __asm__(" movq r8,(r0)+"); __asm__(" movq r10,(r0)+"); __asm__(" movl fp,(r0)+"); __asm__(" movq 4(fp),(r0)+"); __asm__(" movq 12(fp),(r0)+"); __asm__(" movq 20(fp),(r0)"); __asm__(" clrl r0"); __asm__(" ret"); __asm__(" .globl _longjmp"); __asm__("_longjmp:"); __asm__(" .word 0"); __asm__(" movl 4(ap),r0"); __asm__(" movq (r0)+,r2"); __asm__(" movq (r0)+,r4"); __asm__(" movq (r0)+,r6"); __asm__(" movq (r0)+,r8"); __asm__(" movq (r0)+,r10"); __asm__(" movl (r0)+,r1"); __asm__(" movq (r0)+,4(r1)"); __asm__(" movq (r0)+,12(r1)"); __asm__(" movq (r0),20(r1)"); __asm__(" movl 8(ap),r0"); __asm__(" movl r1,fp"); __asm__(" ret"); #endif #if defined(convex) || defined(__convex__) convex_longjmp (char *p, int i) { __asm__("ld.w 4(ap),s0"); __asm__("ld.w 0(ap),a1"); __asm__("ld.w 12(a1),a7"); __asm__("ld.w 16(a1),a0"); __asm__("ld.w 8(a1),a3"); __asm__("mov a3,psw"); __asm__("ld.w 4(a1),a2"); __asm__("jmp 0(a2)"); } #define longjmp convex_longjmp #endif WIND *First_Wind, *Last_Wind; static Object Cont_Value; #ifndef HAVE_ALLOCA static Object Cont_GCsave; #endif int Check_Stack_Grows_Down () { char foo; return &foo < stkbase; } /* Stack_Size returns the current stack size relative to stkbase. * It works independent of the direction into which the stack grows * (the stack grows upwards on HP-PA based machines and Pyramids). */ unsigned int Stack_Size () { volatile char foo; char *pfoo = &foo; return Stack_Grows_Down ? stkbase-pfoo : pfoo-stkbase; } void Grow_Stack (struct S_Control *cp, Object val) { volatile char buf[100]; /* Prevent the optimizer from optimizing buf away: */ memset (buf, 0, 1); Jump_Cont (cp, val); } void Jump_Cont (struct S_Control *cp, Object val) { static struct S_Control *p; static char *from, *to; /* Must not be allocated on stack */ static int i; /* Ditto */ volatile char foo; /* Reinstall the saved stack contents; take stack direction * into account. cp must be put into a static variable, as * variables living on the stack cannot be referenced any * longer after the new stack has been installed. * * (The asm below must not be the first statement in the function * to prevent buggy Sun ANSI SPARCompiler C 2.0.1 from emitting * it at the wrong position.) */ p = cp; Cont_Value = val; if (Stack_Grows_Down) { if (stkbase < &foo + p->size) Grow_Stack (cp, val); to = stkbase - p->size; } else { if (stkbase + p->size > &foo) Grow_Stack (cp, val); to = stkbase; } from = p->stack; #if defined(sparc) || defined(__sparc__) __asm__("t 0x3"); /* Flush register window */ #endif for (i = p->size; i > 0; i--) *to++ = *from++; longjmp (p->j, 1); } #ifndef HAVE_ALLOCA Object Terminate_Cont (Object cont) { Free_Mem_Nodes (CONTROL(cont)->memlist); return Void; } #endif Object P_Control_Pointp (Object x) { return TYPE(x) == T_Control_Point ? True : False; } Object P_Call_With_Current_Continuation (Object proc) { register int t; t = TYPE(proc); if (t != T_Primitive && t != T_Compound && t != T_Control_Point) Wrong_Type_Combination (proc, "procedure"); return Internal_Call_CC (0, proc); } Object Internal_Call_CC (int from_dump, Object proc) { Object control, ret, gcsave; register struct S_Control *cp; register char *p, *to; register int size; GC_Node3; control = gcsave = Null; GC_Link3 (proc, control, gcsave); #ifndef HAVE_ALLOCA gcsave = Save_GC_Nodes (); #endif size = Stack_Size (); size = (size + 7) & ~7; control = Alloc_Object (size + sizeof (struct S_Control) - 1, T_Control_Point, 0); cp = CONTROL(control); cp->env = The_Environment; cp->gclist = GC_List; cp->firstwind = First_Wind; cp->lastwind = Last_Wind; cp->tailcall = Tail_Call; cp->intrlevel = Intr_Level; cp->size = size; cp->memsave = Null; cp->gcsave = gcsave; #if defined(sparc) || defined(__sparc__) __asm__("t 0x3"); /* Flush register window */ #endif /* Save the current stack contents; take stack direction * into account. delta holds the number of bytes by which * the stack contents has been moved in memory (it is required * to access variables on the saved stack later): */ p = Stack_Grows_Down ? stkbase - cp->size : stkbase; to = cp->stack; memcpy (to, p, cp->size); cp->delta = to - p; #ifndef HAVE_ALLOCA Register_Object (control, (GENERIC)0, Terminate_Cont, 0); Save_Mem_Nodes (control); #endif if (setjmp (CONTROL(control)->j) != 0) { #ifndef HAVE_ALLOCA Restore_GC_Nodes (Cont_GCsave); #endif if (Intr_Level == 0) { Force_Enable_Interrupts; } else { Force_Disable_Interrupts; } return Cont_Value; } if (from_dump) { #ifdef CAN_DUMP Dump_Control_Point = control; #endif ret = False; } else { control = Cons (control, Null); ret = Funcall (proc, control, 0); } GC_Unlink; return ret; } void Funcall_Control_Point (Object control, Object argl, int eval) { Object val, len; register struct S_Control *cp; register WIND *w, *wp, *cwp, *p; register int delta = 0; GC_Node3; if (GC_In_Progress) Fatal_Error ("jumping out of GC"); val = Null; GC_Link3 (argl, control, val); len = P_Length (argl); if (FIXNUM(len) != 1) Primitive_Error ("control point expects one argument"); val = Car (argl); if (eval) val = Eval (val); delta = CONTROL(control)->delta; wp = First_Wind; cwp = CONTROL(control)->firstwind; while (wp && cwp) { p = (WIND *)NORM(wp); if (!EQ(wp->inout,p->inout)) break; wp = wp->next; cwp = p->next; } if (wp) { for (w = Last_Wind; w != wp->prev; w = w->prev) Do_Wind (Cdr (w->inout)); } while (cwp) { delta = CONTROL(control)->delta; p = (WIND *)NORM(cwp); cwp = p->next; Do_Wind (Car (p->inout)); } GC_Unlink; Disable_Interrupts; cp = CONTROL(control); Switch_Environment (cp->env); GC_List = cp->gclist; #ifndef HAVE_ALLOCA Restore_Mem_Nodes (control); Cont_GCsave = CONTROL(control)->gcsave; #endif First_Wind = cp->firstwind; Last_Wind = cp->lastwind; Intr_Level = cp->intrlevel; Jump_Cont (cp, val); /*NOTREACHED*/ } void Do_Wind (Object w) { Object oldenv, b, tmp; if (TYPE(w) == T_Vector) { /* fluid-let */ oldenv = The_Environment; Switch_Environment (VECTOR(w)->data[1]); b = Lookup_Symbol (VECTOR(w)->data[0], 0); if (Nullp (b)) Panic ("fluid-let"); tmp = VECTOR(w)->data[2]; VECTOR(w)->data[2] = Cdr (b); Cdr (b) = tmp; SYMBOL(Car (b))->value = tmp; VECTOR(w)->data[1] = oldenv; Switch_Environment (oldenv); } else { /* dynamic-wind */ (void)Funcall (w, Null, 0); } } void Add_Wind (register WIND *w, Object in, Object out) { Object inout; GC_Node2; GC_Link2 (in, out); inout = Cons (in, out); w->inout = inout; w->next = 0; if (First_Wind == 0) First_Wind = w; else Last_Wind->next = w; w->prev = Last_Wind; Last_Wind = w; GC_Unlink; } Object P_Dynamic_Wind (Object in, Object body, Object out) { WIND w, *first = First_Wind; Object ret; GC_Node4; Check_Procedure (in); Check_Procedure (body); Check_Procedure (out); ret = Null; GC_Link4 (in, body, out, ret); Add_Wind (&w, in, out); (void)Funcall (in, Null, 0); ret = Funcall (body, Null, 0); (void)Funcall (out, Null, 0); if ((Last_Wind = w.prev)) Last_Wind->next = 0; First_Wind = first; GC_Unlink; return ret; } Object P_Control_Point_Environment (Object c) { Check_Type (c, T_Control_Point); return CONTROL(c)->env; } elk-3.99.8/src/stab-ecoff.c0000644000175000017500000001100411577076306012274 00000000000000/* stab-ecoff.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ /* On the SGI, includes a file that defines a variable named * auxtemp. This causes the linker to complain about this variable * being multiply defined, because was already included by * load.vanilla.c. */ #define _auxtemp Auxtemp #include AOUT_H extern void Free_Symbols (SYMTAB *); SYMTAB *Snarf_Symbols (FILE *fp) { long fdi; /* a counter for the file desc table */ FDR *file_desc; /* pointer to the filedesc table */ struct filehdr file_hdr; /* pointer to the file header */ char *strbase; HDRR sym_hdr; /* pointer to symbolic header */ long symi; /* a counter for the local symbol table */ SYMR *symbol; /* pointer to symbol table */ SYMTAB *tab; char *p; SYM *sp, **nextp; Alloca_Begin; /* Read file header and symbolic header */ (void)rewind (fp); if (fread ((char *)&file_hdr, sizeof (file_hdr), 1, fp) == 0) { fclose (fp); Primitive_Error ("cannot read a.out file header"); } (void)fseek (fp, file_hdr.f_symptr, SEEK_SET); if (fread ((char *)&sym_hdr, sizeof (sym_hdr), 1, fp) == 0) { fclose (fp); Primitive_Error ("cannot read a.out symbolic header"); } tab = (SYMTAB *)Safe_Malloc (sizeof (SYMTAB)); tab->first = 0; tab->strings = 0; nextp = &tab->first; /* Read symbol table */ Alloca (symbol, SYMR*, sym_hdr.isymMax * sizeof (SYMR)); (void)fseek (fp, sym_hdr.cbSymOffset, SEEK_SET); if (fread ((char *)symbol, sizeof (SYMR), sym_hdr.isymMax, fp) == 0) { symerr: fclose (fp); Free_Symbols (tab); Primitive_Error ("cannot read symbol/string/fd table"); } /* Read string table */ tab->strings = Safe_Malloc (sym_hdr.issMax); (void)fseek (fp, sym_hdr.cbSsOffset, SEEK_SET); if (fread (tab->strings, sym_hdr.issMax, 1, fp) == 0) goto symerr; /* Read file descriptor table */ Alloca (file_desc, FDR*, sym_hdr.ifdMax * sizeof (FDR)); (void)fseek (fp, sym_hdr.cbFdOffset, SEEK_SET); if (fread ((char *)file_desc, sizeof (FDR), sym_hdr.ifdMax, fp) == 0) goto symerr; /* For each file in the file descriptor table do: */ for (fdi = 0; fdi < sym_hdr.ifdMax; fdi++) { strbase = tab->strings + file_desc[fdi].issBase; for (symi = file_desc[fdi].isymBase; symi < file_desc[fdi].csym + file_desc[fdi].isymBase; symi++) { if (symbol[symi].st == stProc && symbol[symi].sc == scText) { p = symbol[symi].iss + strbase; /* Allocate and initialize node in the symbol table list; * link node into list */ sp = (SYM *)Safe_Malloc (sizeof (SYM)); sp->name = Safe_Malloc (strlen (p) + 1); strcpy (sp->name, p); sp->value = symbol[symi].value; *nextp = sp; nextp = &sp->next; *nextp = 0; } } } Alloca_End; return tab; } SYMTAB *Open_File_And_Snarf_Symbols (char *name) { FILE *fp; SYMTAB *tab; if ((fp = fopen (name, "r")) == NULL) Primitive_Error ("can't open a.out file"); tab = Snarf_Symbols (fp); (void)fclose (fp); return tab; } elk-3.99.8/src/io.c0000644000175000017500000002540611577076306010705 00000000000000/* io.c: Ports and I/O primitives. * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "config.h" #include #include #ifdef HAVE_PWD_H # include #endif #include #include #include #include #ifdef HAVE_UNISTD_H # include #endif #include "kernel.h" extern void Flush_Output (Object); extern int errno; extern char *getenv(); Object Curr_Input_Port, Curr_Output_Port; Object Standard_Input_Port, Standard_Output_Port; void Init_Io () { Standard_Input_Port = Make_Port (P_INPUT, stdin, Make_String ("stdin", 5)); Standard_Output_Port = Make_Port (0, stdout, Make_String ("stdout", 6)); Curr_Input_Port = Standard_Input_Port; Curr_Output_Port = Standard_Output_Port; Global_GC_Link (Standard_Input_Port); Global_GC_Link (Standard_Output_Port); Global_GC_Link (Curr_Input_Port); Global_GC_Link (Curr_Output_Port); } void Reset_IO (int destructive) { Discard_Input (Curr_Input_Port); if (destructive) Discard_Output (Curr_Output_Port); else Flush_Output (Curr_Output_Port); Curr_Input_Port = Standard_Input_Port; Curr_Output_Port = Standard_Output_Port; } Object Make_Port (int flags, FILE *f, Object name) { Object port; GC_Node; GC_Link (name); port = Alloc_Object (sizeof (struct S_Port), T_Port, 0); PORT(port)->flags = flags|P_OPEN; PORT(port)->file = f; PORT(port)->name = name; PORT(port)->ptr = 0; PORT(port)->lno = 1; PORT(port)->closefun = fclose; GC_Unlink; return port; } Object P_Port_File_Name (Object p) { Check_Type (p, T_Port); return (PORT(p)->flags & P_STRING) ? False : PORT(p)->name; } Object P_Port_Line_Number (Object p) { Check_Type (p, T_Port); return Make_Unsigned (PORT(p)->lno); } Object P_Eof_Objectp (Object x) { return TYPE(x) == T_End_Of_File ? True : False; } Object P_Current_Input_Port () { return Curr_Input_Port; } Object P_Current_Output_Port () { return Curr_Output_Port; } Object P_Input_Portp (Object x) { return TYPE(x) == T_Port && IS_INPUT(x) ? True : False; } Object P_Output_Portp (Object x) { return TYPE(x) == T_Port && IS_OUTPUT(x) ? True : False; } unsigned int Path_Max () { #if defined(PATH_MAX) /* POSIX */ return PATH_MAX; #elif defined(MAXPATHLEN) /* 4.3 BSD */ return MAXPATHLEN; #elif defined(_PC_PATH_MAX) static int r; if (r == 0) { if ((r = pathconf ("/", _PC_PATH_MAX)) == -1) r = 1024; r++; } return r; #else return 1024; #endif } Object Get_File_Name (Object name) { register unsigned int len; if (TYPE(name) == T_Symbol) name = SYMBOL(name)->name; else if (TYPE(name) != T_String) Wrong_Type_Combination (name, "string or symbol"); len = STRING(name)->size; if (len > Path_Max () || len == 0) Primitive_Error ("invalid file name"); return name; } char *Internal_Tilde_Expand (register char *s, register char **dirp) { register char *p; #ifdef HAVE_PWD_H struct passwd *pw, *getpwnam(); #endif if (*s++ != '~') return 0; for (p = s; *p && *p != '/'; p++) ; if (*p == '/') *p++ = 0; #ifdef HAVE_PWD_H if (*s == '\0') { if ((*dirp = getenv ("HOME")) == 0) *dirp = ""; } else { if ((pw = getpwnam (s)) == 0) Primitive_Error ("unknown user: ~a", Make_String (s, strlen (s))); *dirp = pw->pw_dir; } #else *dirp = ""; #endif return p; } Object General_File_Operation (Object s, register int op) { register char *r; Object ret, fn; Alloca_Begin; fn = Get_File_Name (s); Get_Strsym_Stack (fn, r); switch (op) { case 0: { char *p, *dir; p = Internal_Tilde_Expand (r, &dir); if (p == 0) { Alloca_End; return s; } Alloca (r, char*, strlen (dir) + 1 + strlen (p) + 1); sprintf (r, "%s" SEPARATOR_STRING "%s", dir, p); ret = Make_String (r, strlen (r)); Alloca_End; return ret; } case 1: { struct stat st; /* Doesn't make much sense to check for errno != ENOENT here: */ ret = stat (r, &st) == 0 ? True : False; Alloca_End; return ret; } default: { return Null; /* Just to avoid compiler warnings */ }} /*NOTREACHED*/ } Object P_Tilde_Expand (Object s) { return General_File_Operation (s, 0); } Object P_File_Existsp (Object s) { return General_File_Operation (s, 1); } void Close_All_Files () { Terminate_Type (T_Port); } Object Terminate_File (Object port) { (void)(PORT(port)->closefun) (PORT(port)->file); PORT(port)->flags &= ~P_OPEN; return Void; } Object Open_File (char *name, int flags, int err) { register FILE *f; char *dir, *p; Object fn, port; struct stat st; Alloca_Begin; p = Internal_Tilde_Expand (name, &dir); if (p) { Alloca (name, char*, strlen (dir) + 1 + strlen (p) + 1); sprintf (name, "%s" SEPARATOR_STRING "%s", dir, p); } if (!err && stat (name, &st) == -1 && (errno == ENOENT || errno == ENOTDIR)) { Alloca_End; return Null; } switch (flags & (P_INPUT|P_BIDIR)) { case 0: p = "w"; break; case P_INPUT: p = "r"; break; default: p = "r+"; break; } fn = Make_String (name, strlen (name)); Disable_Interrupts; if ((f = fopen (name, p)) == NULL) { Saved_Errno = errno; /* errno valid here? */ Primitive_Error ("~s: ~E", fn); } port = Make_Port (flags, f, fn); Register_Object (port, (GENERIC)0, Terminate_File, 0); Enable_Interrupts; Alloca_End; return port; } Object General_Open_File (Object name, int flags, Object path) { Object port, pref; char *buf = 0; register char *fn; register unsigned int plen, len, blen = 0, gotpath = 0; Alloca_Begin; name = Get_File_Name (name); len = STRING(name)->size; fn = STRING(name)->data; #ifdef WIN32 if (fn[0] < 'A' || fn[0] > 'Z' || fn[1] != ':' ) { #else if (fn[0] != '/' && fn[0] != '~') { #endif for ( ; TYPE(path) == T_Pair; path = Cdr (path)) { pref = Car (path); if (TYPE(pref) == T_Symbol) pref = SYMBOL(pref)->name; if (TYPE(pref) != T_String) continue; gotpath = 1; plen = STRING(pref)->size; if (plen > Path_Max () || plen == 0) continue; if (len + plen + 2 > blen) { blen = len + plen + 2; Alloca (buf, char*, blen); } memcpy (buf, STRING(pref)->data, plen); if (buf[plen-1] != SEPARATOR_CHAR) buf[plen++] = SEPARATOR_CHAR; memcpy (buf+plen, fn, len); buf[len+plen] = '\0'; port = Open_File (buf, flags, 0); /* No GC has been taken place in Open_File() if it returns Null. */ if (!Nullp (port)) { Alloca_End; return port; } } } if (gotpath) Primitive_Error ("file ~s not found", name); if (len + 1 > blen) Alloca (buf, char*, len + 1); memcpy (buf, fn, len); buf[len] = '\0'; port = Open_File (buf, flags, 1); Alloca_End; return port; } Object P_Open_Input_File (Object name) { return General_Open_File (name, P_INPUT, Null); } Object P_Open_Output_File (Object name) { return General_Open_File (name, 0, Null); } Object P_Open_Input_Output_File (Object name) { return General_Open_File (name, P_BIDIR, Null); } Object General_Close_Port (Object port) { register int flags, err = 0; FILE *f; Check_Type (port, T_Port); flags = PORT(port)->flags; if (!(flags & P_OPEN) || (flags & P_STRING)) return Void; f = PORT(port)->file; if (f == stdin || f == stdout) return Void; if ((PORT(port)->closefun) (f) == EOF) { Saved_Errno = errno; /* errno valid here? */ err++; } PORT(port)->flags &= ~P_OPEN; Deregister_Object (port); if (err) Primitive_Error ("write error on ~s: ~E", port); return Void; } Object P_Close_Input_Port (Object port) { return General_Close_Port (port); } Object P_Close_Output_Port (Object port) { return General_Close_Port (port); } #define General_With(prim,curr,flags) Object prim (Object name, Object thunk) {\ Object old, ret;\ GC_Node2;\ \ Check_Procedure (thunk);\ old = curr;\ GC_Link2 (thunk, old);\ curr = General_Open_File (name, flags, Null);\ ret = Funcall (thunk, Null, 0);\ (void)General_Close_Port (curr);\ GC_Unlink;\ curr = old;\ return ret;\ } General_With (P_With_Input_From_File, Curr_Input_Port, P_INPUT) General_With (P_With_Output_To_File, Curr_Output_Port, 0) Object General_Call_With (Object name, int flags, Object proc) { Object port, ret; GC_Node2; Check_Procedure (proc); GC_Link2 (proc, port); port = General_Open_File (name, flags, Null); port = Cons (port, Null); ret = Funcall (proc, port, 0); (void)General_Close_Port (Car (port)); GC_Unlink; return ret; } Object P_Call_With_Input_File (Object name, Object proc) { return General_Call_With (name, P_INPUT, proc); } Object P_Call_With_Output_File (Object name, Object proc) { return General_Call_With (name, 0, proc); } Object P_Open_Input_String (Object string) { Check_Type (string, T_String); return Make_Port (P_STRING|P_INPUT, (FILE *)0, string); } Object P_Open_Output_String () { return Make_Port (P_STRING, (FILE *)0, Make_String ((char *)0, 0)); } elk-3.99.8/src/stab-vanilla.c0000644000175000017500000000776211577076306012660 00000000000000/* stab-vanilla.c: naive symbol finder for shared objects; simply finds all * strings in the object file, without asking questions. * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include "kernel.h" SYMTAB *Snarf_Symbols (FILE *f) { SYMTAB *tab; register SYM *sp, **nextp; unsigned char buffer[BUFSIZ]; int i = 0, start = 0, end = 0; tab = (SYMTAB *)Safe_Malloc (sizeof (SYMTAB)); tab->first = 0; tab->strings = 0; nextp = &tab->first; while (start != end || !feof (f)) { if (i == end) { /* If we filled our buffer without finding a string, we set * start = end so that the buffer is completely emptied */ if (start == 0 && end != 0) start = end; /* Fill our buffer some more */ memmove (buffer, buffer + start, end - start); end -= start; start = 0; i = fread (buffer + end, 1, BUFSIZ - end, f); if (i == 0) break; end += i; } for (i = start; i < end; i++) if (buffer[i] >= 0x20 && buffer[i] < 0x80) break; if (i == end) continue; start = i; for (i = start + 1; i < end; i++) if (buffer[i] == 0) break; if (i == end) continue; /* If this string contains INIT_PREFIX or FINIT_PREFIX, it's * potentially a valid symbol. */ if (strstr (buffer + start, INIT_PREFIX) || strstr (buffer + start, FINIT_PREFIX)) { sp = tab->first; while (sp) { if (!strcmp (sp->name, buffer + start)) { /* We have already seen this symbol; abort */ goto next_string; } sp = sp->next; } /* We found a valid string, link it to the symbol list */ sp = (SYM *)Safe_Malloc (sizeof (SYM)); sp->name = Safe_Malloc (strlen (buffer + start) + 1); strcpy (sp->name, buffer + start); sp->value = 0; *nextp = sp; nextp = &sp->next; *nextp = NULL; } next_string: start = i + 1; } return tab; } SYMTAB *Open_File_And_Snarf_Symbols (char *name) { int fd; FILE *fp; SYMTAB *tab; #ifdef O_BINARY fd = open (name, O_RDONLY|O_BINARY); #else fd = open (name, O_RDONLY); #endif if (fd == -1) { Saved_Errno = errno; Primitive_Error ("can't open file: ~E"); } fp = fdopen (fd, "rb"); if (fp == NULL) { close (fd); Primitive_Error ("can't fdopen file"); } tab = Snarf_Symbols (fp); (void)fclose (fp); return tab; } elk-3.99.8/src/stab-hp9k800.c0000644000175000017500000000564511577076306012333 00000000000000/* stab-hp9k800.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include AOUT_H #include extern void Free_Symbols (SYMTAB *); SYMTAB *Snarf_Symbols (FILE *f, struct header *hp) { SYMTAB *tab; register SYM *sp, **nextp; register int n; struct symbol_dictionary_record r; tab = (SYMTAB *)Safe_Malloc (sizeof (SYMTAB)); tab->first = 0; nextp = &tab->first; tab->strings = Safe_Malloc (hp->symbol_strings_size); (void)fseek (f, (long)hp->symbol_strings_location, SEEK_SET); if (fread (tab->strings, hp->symbol_strings_size, 1, f) != 1) { (void)fclose (f); Free_Symbols (tab); Primitive_Error ("corrupt string table in object file"); } (void)fseek (f, (long)hp->symbol_location, SEEK_SET); for (n = hp->symbol_total; n > 0; n--) { if (fread ((char *)&r, sizeof r, 1, f) != 1) { (void)fclose (f); Free_Symbols (tab); Primitive_Error ("corrupt symbol table in object file"); } if (r.symbol_type != ST_CODE) continue; if (r.symbol_scope != SS_UNIVERSAL) continue; sp = (SYM *)Safe_Malloc (sizeof (SYM)); sp->name = tab->strings + r.name.n_strx; sp->value = r.symbol_value & ~3; /* mask out privilege level */ *nextp = sp; nextp = &sp->next; *nextp = 0; } return tab; } SYMTAB *Open_File_And_Snarf_Symbols (char *name) { struct header hdr; FILE *f; SYMTAB *tab; if ((f = fopen (name, "r")) == NULL) Primitive_Error ("can't open a.out file"); if (fread ((char *)&hdr, sizeof hdr, 1, f) != 1) { (void)fclose (f); Primitive_Error ("can't read a.out header"); } tab = Snarf_Symbols (f, &hdr); (void)fclose (f); return tab; } elk-3.99.8/src/stab-macho.c0000644000175000017500000000771311577076306012315 00000000000000/* stab-macho.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include #include static SYMTAB *Grovel_Over_Nlist (symcmd, nl, strtab, text_sect) struct symtab_command *symcmd; /* ptr to MACH-O symtab command */ struct nlist nl[]; /* ptr to symbol table */ char *strtab; /* ptr to string table */ long text_sect; /* # of text section */ { SYMTAB *tab; register SYM *sp, **nextp; long i; tab = (SYMTAB *) Safe_Malloc (sizeof (SYMTAB)); tab->first = 0; tab->strings = 0; nextp = &tab->first; /* Grovel over the file's nlist, extracting global symbols that * have a section mumber equal to the number of the text section: */ for (i = 0; i < symcmd->nsyms; i++) { if ((nl[i].n_type & (N_TYPE|N_EXT)) == (N_SECT|N_EXT) && nl[i].n_sect == text_sect) { sp = (SYM *)Safe_Malloc (sizeof (SYM)); sp->name = strtab + nl[i].n_un.n_strx; sp->value = nl[i].n_value; sp->next = 0; *nextp = sp; nextp = &sp->next; } } return tab; } SYMTAB *Snarf_Symbols (struct mach_header *mhdr) { struct load_command *ld_cmd; struct symtab_command *sym_cmd; struct segment_command *seg_cmd; struct section *sp; struct nlist *symtab = 0; char *cmdptr, *strtab; long i, j, text_sect = 0; /* Loop through the load commands, find the symbol table and * the segment command carrying the text section to determine * the number of the text section: */ cmdptr = (char *)mhdr + sizeof (struct mach_header); for (i = 0; i < mhdr->ncmds; i++) { ld_cmd = (struct load_command *)cmdptr; if (ld_cmd->cmd == LC_SYMTAB && !symtab) { sym_cmd = (struct symtab_command *)ld_cmd; symtab = (struct nlist *)((char *)mhdr + sym_cmd->symoff); strtab = (char *)mhdr + sym_cmd->stroff; } else if (ld_cmd->cmd == LC_SEGMENT && !text_sect) { seg_cmd = (struct segment_command *)ld_cmd; sp = (struct section *) ((char *)ld_cmd + sizeof (struct segment_command)); for (j = 1; j <= seg_cmd->nsects && !text_sect; j++, sp++) if (strcmp (sp->sectname, SECT_TEXT) == 0) text_sect = j; } cmdptr += ld_cmd->cmdsize; } if (!symtab) Primitive_Error ("couldn't find symbol table in object file"); if (!text_sect) Primitive_Error ("couldn't find text section in object file"); return Grovel_Over_Nlist (sym_cmd, symtab, strtab, text_sect); } #ifdef INIT_OBJECTS SYMTAB *Open_File_And_Snarf_Symbols (char *name) { extern char *_mh_execute_header; return Snarf_Symbols ((struct mach_header *)&_mh_execute_header); } #endif /* INIT_OBJECTS */ elk-3.99.8/src/libelk.c0000644000175000017500000003170011577076306011532 00000000000000/* libelk.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #ifdef HAVE_STRUCT_RLIMIT # ifdef HAVE_SYS_TIME_H # include # endif # ifdef HAVE_SYS_RESOURCE_H # include # endif #endif #ifdef WIN32 # include #endif #ifdef HAVE_UNISTD_H # include #endif #ifdef HAVE_SYS_FILE_H # include #endif #include "kernel.h" extern void Call_Initializers (SYMTAB *, char *, int); extern void Load_Source (Object); extern void Call_Finalizers (); extern void Generational_GC_Reinitialize (); extern int Check_Stack_Grows_Down (); extern void Make_Heap (int); extern void Free_Heap (); extern void Init_Auto (void); extern void Init_Cstring(); extern void Init_Dump (); extern void Init_Env (); extern void Init_Error (); extern void Init_Exception (); extern void Init_Features (); extern void Init_Heap (); extern void Init_Io (); extern void Init_Load (); extern void Init_Loadpath (char *); extern void Init_Math (); extern void Init_Prim (); extern void Init_Print (); extern void Init_Proc (); extern void Init_Read (); extern void Init_Special (); extern void Init_String (); extern void Init_Symbol (); extern void Init_Terminate (); extern void Init_Type(); extern char *getenv(); void Get_Stack_Limit (); void Usage (); void Init_Everything (); char *stkbase; int Stack_Grows_Down; unsigned int Max_Stack; int Interpreter_Initialized; int GC_Debug = 0; int Case_Insensitive = 1; int Verb_Load = 0, Verb_Init = 0; char **Argv; int Argc, First_Arg; char *Scm_Dir; char *Lib_Dir; #ifdef FIND_AOUT char *A_Out_Name; char *Find_Executable(); #endif #if defined(CAN_LOAD_LIB) || defined(INIT_OBJECTS) SYMTAB *The_Symbols; #endif void Exit_Handler () { #if defined(CAN_LOAD_LIB) || defined(INIT_OBJECTS) Call_Finalizers (); #endif Free_Heap (); } #ifndef HAVE_ATEXIT /* Hack: __GNUC_MINOR__ was introduced together with __attribute__ */ #ifdef __GNUC_MINOR__ extern void _exit() elk_attribute(__noreturn__); #endif #ifndef PROFILING void exit (n) { Exit_Handler (); _cleanup (); _exit (n); } #endif #endif #ifdef CAN_DUMP int Was_Dumped; char *Brk_On_Dump; #endif /* dump currently does not work for applications using Elk_Init(). * The reason is that in this case the INITIAL_STK_OFFSET which * compensates for differences in argv[] in the original/dumped a.out * is not in effect (see comment below). * This cannot be fixed without changing Elk_Init() and its use in * an incompatible way. */ void Check_If_Dump_Works () { Primitive_Error ("not yet supported for standalone applications"); } void Elk_Init (int ac, char **av, int init_objects, char *toplevel) { /* To avoid that the stack copying code overwrites argv if a dumped * copy of the interpreter is invoked with more arguments than the * original a.out, move the stack base INITIAL_STK_OFFSET bytes down. * The call to memset() is there to prevent the optimizer from removing * the array. */ #ifdef CAN_DUMP char unused[INITIAL_STK_OFFSET]; #endif char *initfile, *loadfile = 0, *loadpath = 0; int debug = 0, heap = HEAP_SIZE; Object file; struct stat st; extern int errno; #if defined(CAN_DUMP) # define foo (av[0][0]) #else volatile char foo; #endif #ifdef CAN_DUMP memset (unused, 0, 1); /* see comment above */ #endif if (ac == 0) { av[0] = "Elk"; ac = 1; } Get_Stack_Limit (); Lib_Dir = NULL; Scm_Dir = NULL; #ifdef WIN32 if (av[0]) { char path[MAX_PATH], *exe; GetFullPathName (av[0], MAX_PATH, path, &exe); if (exe > path && exe[-1] == '\\') { char newpath[MAX_PATH+5]; exe[-1] = '\0'; sprintf (newpath, "%s\\lib", path); Lib_Dir = strdup (newpath); sprintf (newpath, "%s\\scm", path); Scm_Dir = strdup (newpath); } } #elif defined(FIND_AOUT) A_Out_Name = Find_Executable (av[0]); #endif if (Scm_Dir == NULL) Scm_Dir = strdup (SCM_DIR); if (Lib_Dir == NULL) Lib_Dir = strdup (LIB_DIR); Argc = ac; Argv = av; First_Arg = 1; #ifdef CAN_DUMP if (Was_Dumped) { /* Check if beginning of stack has moved by a large amount. * This is the case, for instance, on a Sun-4m when the * interpreter was dumped on a Sun-4c and vice versa. */ if (abs (stkbase - &foo) > INITIAL_STK_OFFSET) { fprintf (stderr, "Can't restart dumped interpreter from a different machine architecture\n"); fprintf (stderr, " (Stack delta = %lld bytes).\n", (long long int)(intptr_t)(stkbase - &foo)); exit (1); } /* Check if program break must be reset. */ if ((intptr_t)Brk_On_Dump && (intptr_t)brk (Brk_On_Dump) == (intptr_t)-1) { perror ("brk"); exit (1); } #if defined(HP9K) && defined(CAN_DUMP) && defined(HPSHLIB) Restore_Shared_Data (); #endif #ifdef GENERATIONAL_GC Generational_GC_Reinitialize (); #endif Loader_Input = 0; Install_Intr_Handler (); (void)Funcall_Control_Point (Dump_Control_Point, Arg_True, 0); /*NOTREACHED*/ } #endif for ( ; First_Arg < ac; First_Arg++) { if (strcmp (av[First_Arg], "-debug") == 0) { debug = 1; } else if (strcmp (av[First_Arg], "-g") == 0) { Case_Insensitive = 0; } else if (strcmp (av[First_Arg], "-i") == 0) { Case_Insensitive = 1; } else if (strcmp (av[First_Arg], "-v") == 0) { if (++First_Arg == ac) Usage (); if (strcmp (av[First_Arg], "load") == 0) Verb_Load = 1; else if (strcmp (av[First_Arg], "init") == 0) Verb_Init = 1; else Usage (); } else if (strcmp (av[First_Arg], "-h") == 0) { if (++First_Arg == ac) Usage (); if ((heap = atoi (av[First_Arg])) <= 0) { fprintf (stderr, "Heap size must be a positive number.\n"); exit (1); } } else if (strcmp (av[First_Arg], "-l") == 0) { if (++First_Arg == ac || loadfile) Usage (); loadfile = av[First_Arg]; } else if (strcmp (av[First_Arg], "-p") == 0) { if (++First_Arg == ac || loadpath) Usage (); loadpath = av[First_Arg]; } else if (strcmp (av[First_Arg], "--") == 0) { First_Arg++; break; } else if (av[First_Arg][0] == '-') { Usage (); } else { break; } } stkbase = &foo; Stack_Grows_Down = Check_Stack_Grows_Down (); ELK_ALIGN(stkbase); Make_Heap (heap); Init_Everything (); #ifdef HAVE_ATEXIT if (atexit (Exit_Handler) != 0) Fatal_Error ("atexit returned non-zero value"); #endif #ifdef INIT_OBJECTS if (init_objects) { Set_Error_Tag ("init-objects"); The_Symbols = Open_File_And_Snarf_Symbols (A_Out_Name); Call_Initializers (The_Symbols, (char *)0, PR_EXTENSION); } #endif if (loadpath || (loadpath = getenv (LOADPATH_ENV))) Init_Loadpath (loadpath); /* The following code is sort of a hack. initscheme.scm should not * be resolved against load-path. However, the .scm-files may not * have been installed yet (note that the interpreter is already * used in the "make" process). * Solution: if initscheme.scm hasn't been installed yet, do search * the load-path, so that -p can be used. */ Set_Error_Tag ("scheme-init"); initfile = Safe_Malloc (strlen (Scm_Dir) + 1 + sizeof (INITFILE) + 1); sprintf (initfile, "%s" SEPARATOR_STRING "%s", Scm_Dir, INITFILE); if (stat (initfile, &st) == -1 && errno == ENOENT) file = Make_String (INITFILE, sizeof(INITFILE)-1); else file = Make_String (initfile, strlen (initfile)); free (initfile); (void)General_Load (file, The_Environment); Install_Intr_Handler (); Set_Error_Tag ("top-level"); if (toplevel == 0) { Interpreter_Initialized = 1; GC_Debug = debug; return; } /* Special case: if toplevel is "", act as if run from main() */ if (loadfile == 0 && toplevel[0] != '\0') loadfile = toplevel; if (loadfile == 0) loadfile = "toplevel.scm"; file = Make_String (loadfile, strlen (loadfile)); Interpreter_Initialized = 1; GC_Debug = debug; if (loadfile[0] == '-' && loadfile[1] == '\0') Load_Source_Port (Standard_Input_Port); else (void)General_Load (file, The_Environment); } static char *Usage_Msg[] = { "Options:", " [-l filename] Load file instead of standard toplevel", " [-l -] Load from standard input", " [-h heapsize] Heap size in KBytes", " [-p loadpath] Initialize load-path (colon-list of directories)", " [-debug] Enable GC-debugging", " [-g] Case-sensitive symbols", " [-i] Case-insensitive symbols", " [-v type] Be verbose. \"type\" controls what to print:", " load linker command when loading object file", " init names of extension [f]init functions when \ called", " [--] End options and begin arguments", 0 }; void Usage () { char **p; fprintf (stderr, "Usage: %s [options] [arguments]\n", Argv[0]); for (p = Usage_Msg; *p; p++) fprintf (stderr, "%s\n", *p); exit (1); } void Init_Everything () { Init_Type (); Init_Cstring (); Init_String (); Init_Symbol (); Init_Env (); Init_Error (); Init_Exception (); Init_Io (); Init_Prim (); Init_Math (); Init_Print (); Init_Auto (); Init_Heap (); Init_Load (); Init_Proc (); Init_Special (); Init_Read (); Init_Features (); Init_Terminate (); #ifdef CAN_DUMP Init_Dump (); #endif } void Get_Stack_Limit () { #ifdef HAVE_STRUCT_RLIMIT struct rlimit rl; if (getrlimit (RLIMIT_STACK, &rl) == -1) { perror ("getrlimit"); exit (1); } Max_Stack = rl.rlim_cur; #else Max_Stack = DEFAULT_MAX_STACK_SIZE; #endif Max_Stack -= STACK_MARGIN; } #ifdef FIND_AOUT int Executable (char *fn) { struct stat s; return stat (fn, &s) != -1 && (s.st_mode & S_IFMT) == S_IFREG && access (fn, X_OK) != -1; } char *Find_Executable (char *fn) { char *path, *dir, *getenv(); static char buf[1025]; /* Can't use Path_Max or Safe_Malloc here */ register char *p; for (p = fn; *p; p++) { if (*p == '/') { if (Executable (fn)) return fn; else Fatal_Error ("%s is not executable", fn); } } if ((path = getenv ("PATH")) == 0) path = ":/usr/ucb:/bin:/usr/bin"; dir = path; do { p = buf; while (*dir && *dir != ':') *p++ = *dir++; if (*dir) ++dir; if (p > buf) *p++ = '/'; strcpy (p, fn); if (Executable (buf)) return buf; } while (*dir); if (dir > path && dir[-1] == ':' && Executable (fn)) return fn; Fatal_Error ("cannot find pathname of %s", fn); /*NOTREACHED*/ } #endif Object P_Command_Line_Args () { Object ret, tail; register int i; GC_Node2; ret = tail = P_Make_List (Make_Integer (Argc-First_Arg), Null); GC_Link2 (ret, tail); for (i = First_Arg; i < Argc; i++, tail = Cdr (tail)) { Object a; a = Make_String (Argv[i], strlen (Argv[i])); Car (tail) = a; } GC_Unlink; return ret; } Object P_Exit (int argc, Object *argv) { exit (argc == 0 ? 0 : Get_Unsigned (argv[0])); /*NOTREACHED*/ } elk-3.99.8/src/prim.c0000644000175000017500000006133511577076306011246 00000000000000/* prim.c: Built-in primitives, Define_Primitive(). * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "config.h" #include "kernel.h" extern void Memoize_Frame (Object); struct Prim_Init { Object (*fun)(); char *name; int minargs, maxargs; enum discipline disc; } Primitives[] = { /* autoload.c: */ { P_Autoload, "autoload", 2, 2, EVAL }, /* bool.c: */ { P_Booleanp, "boolean?", 1, 1, EVAL }, { P_Not, "not", 1, 1, EVAL }, { P_Eq, "eq?", 2, 2, EVAL }, { P_Eqv, "eqv?", 2, 2, EVAL }, { P_Equal, "equal?", 2, 2, EVAL }, { P_Empty_List_Is_False, "empty-list-is-false-for-backward-compatibility", 1, 1, EVAL }, /* char.c: */ { P_Charp, "char?", 1, 1, EVAL }, { P_Char_To_Integer, "char->integer", 1, 1, EVAL }, { P_Integer_To_Char, "integer->char", 1, 1, EVAL }, { P_Char_Upper_Casep, "char-upper-case?", 1, 1, EVAL }, { P_Char_Lower_Casep, "char-lower-case?", 1, 1, EVAL }, { P_Char_Alphabeticp, "char-alphabetic?", 1, 1, EVAL }, { P_Char_Numericp, "char-numeric?", 1, 1, EVAL }, { P_Char_Whitespacep, "char-whitespace?", 1, 1, EVAL }, { P_Char_Upcase, "char-upcase", 1, 1, EVAL }, { P_Char_Downcase, "char-downcase", 1, 1, EVAL }, { P_Char_Eq, "char=?", 2, 2, EVAL }, { P_Char_Less, "char?", 2, 2, EVAL }, { P_Char_Eq_Less, "char<=?", 2, 2, EVAL }, { P_Char_Eq_Greater, "char>=?", 2, 2, EVAL }, { P_Char_CI_Eq, "char-ci=?", 2, 2, EVAL }, { P_Char_CI_Less, "char-ci?", 2, 2, EVAL }, { P_Char_CI_Eq_Less, "char-ci<=?", 2, 2, EVAL }, { P_Char_CI_Eq_Greater,"char-ci>=?", 2, 2, EVAL }, /* cont.c: */ { P_Control_Pointp, "control-point?", 1, 1, EVAL }, { P_Call_With_Current_Continuation, "call-with-current-continuation", 1, 1, EVAL }, { P_Dynamic_Wind, "dynamic-wind", 3, 3, EVAL }, { P_Control_Point_Environment, "control-point-environment", 1, 1, EVAL }, /* debug.c: */ { P_Backtrace_List, "backtrace-list", 0, 1, VARARGS }, /* dump.c: */ #ifdef CAN_DUMP { P_Dump, "dump", 1, 1, EVAL }, #endif /* env.c: */ { P_Environmentp, "environment?", 1, 1, EVAL }, { P_The_Environment, "the-environment", 0, 0, EVAL }, { P_Global_Environment,"global-environment", 0, 0, EVAL }, { P_Define, "define", 1, MANY, NOEVAL }, { P_Define_Macro, "define-macro", 1, MANY, NOEVAL }, { P_Set, "set!", 2, 2, NOEVAL }, { P_Environment_To_List, "environment->list", 1, 1, EVAL }, { P_Boundp, "bound?", 1, 1, EVAL }, /* error.c: */ { P_Error, "error", 2, MANY, VARARGS }, { P_Reset, "reset", 0, 0, EVAL }, /* exception.c: */ { P_Disable_Interrupts,"disable-interrupts", 0, 0, EVAL }, { P_Enable_Interrupts, "enable-interrupts", 0, 0, EVAL }, /* feature.c: */ { P_Features, "features", 0, 0, EVAL }, { P_Featurep, "feature?", 1, 1, EVAL }, { P_Provide, "provide", 1, 1, EVAL }, { P_Require, "require", 1, 3, VARARGS }, /* heap.c: */ { P_Collect, "collect", 0, 0, EVAL }, { P_Garbage_Collect_Status, "garbage-collect-status", 0, 2, VARARGS }, #ifdef GENERATIONAL_GC { P_Collect_Incremental, "collect-incremental", 0, 0, EVAL }, #endif /* io.c: */ { P_Port_File_Name, "port-file-name", 1, 1, EVAL }, { P_Port_Line_Number, "port-line-number", 1, 1, EVAL }, { P_Eof_Objectp, "eof-object?", 1, 1, EVAL }, { P_Current_Input_Port, "current-input-port", 0, 0, EVAL }, { P_Current_Output_Port, "current-output-port", 0, 0, EVAL }, { P_Input_Portp, "input-port?", 1, 1, EVAL }, { P_Output_Portp, "output-port?", 1, 1, EVAL }, { P_Open_Input_File, "open-input-file", 1, 1, EVAL }, { P_Open_Output_File, "open-output-file", 1, 1, EVAL }, { P_Open_Input_Output_File, "open-input-output-file", 1, 1, EVAL }, { P_Close_Input_Port, "close-input-port", 1, 1, EVAL }, { P_Close_Output_Port, "close-output-port", 1, 1, EVAL }, { P_With_Input_From_File, "with-input-from-file", 2, 2, EVAL }, { P_With_Output_To_File, "with-output-to-file", 2, 2, EVAL }, { P_Call_With_Input_File, "call-with-input-file", 2, 2, EVAL }, { P_Call_With_Output_File, "call-with-output-file", 2, 2, EVAL }, { P_Open_Input_String, "open-input-string", 1, 1, EVAL }, { P_Open_Output_String,"open-output-string", 0, 0, EVAL }, { P_Tilde_Expand, "tilde-expand", 1, 1, EVAL }, { P_File_Existsp, "file-exists?", 1, 1, EVAL }, /* load.c: */ { P_Load, "load", 1, 2, VARARGS }, /* list.c: */ { P_Cons, "cons", 2, 2, EVAL }, { P_Car, "car", 1, 1, EVAL }, { P_Cdr, "cdr", 1, 1, EVAL }, { P_Caar, "caar", 1, 1, EVAL }, { P_Cadr, "cadr", 1, 1, EVAL }, { P_Cdar, "cdar", 1, 1, EVAL }, { P_Cddr, "cddr", 1, 1, EVAL }, { P_Caaar, "caaar", 1, 1, EVAL }, { P_Caadr, "caadr", 1, 1, EVAL }, { P_Cadar, "cadar", 1, 1, EVAL }, { P_Caddr, "caddr", 1, 1, EVAL }, { P_Cdaar, "cdaar", 1, 1, EVAL }, { P_Cdadr, "cdadr", 1, 1, EVAL }, { P_Cddar, "cddar", 1, 1, EVAL }, { P_Cdddr, "cdddr", 1, 1, EVAL }, { P_Caaaar, "caaaar", 1, 1, EVAL }, { P_Caaadr, "caaadr", 1, 1, EVAL }, { P_Caadar, "caadar", 1, 1, EVAL }, { P_Caaddr, "caaddr", 1, 1, EVAL }, { P_Cadaar, "cadaar", 1, 1, EVAL }, { P_Cadadr, "cadadr", 1, 1, EVAL }, { P_Caddar, "caddar", 1, 1, EVAL }, { P_Cadddr, "cadddr", 1, 1, EVAL }, { P_Cdaaar, "cdaaar", 1, 1, EVAL }, { P_Cdaadr, "cdaadr", 1, 1, EVAL }, { P_Cdadar, "cdadar", 1, 1, EVAL }, { P_Cdaddr, "cdaddr", 1, 1, EVAL }, { P_Cddaar, "cddaar", 1, 1, EVAL }, { P_Cddadr, "cddadr", 1, 1, EVAL }, { P_Cdddar, "cdddar", 1, 1, EVAL }, { P_Cddddr, "cddddr", 1, 1, EVAL }, { P_Cxr, "cxr", 2, 2, EVAL }, { P_Nullp, "null?", 1, 1, EVAL }, { P_Pairp, "pair?", 1, 1, EVAL }, { P_Listp, "list?", 1, 1, EVAL }, { P_Set_Car, "set-car!", 2, 2, EVAL }, { P_Set_Cdr, "set-cdr!", 2, 2, EVAL }, { P_Assq, "assq", 2, 2, EVAL }, { P_Assv, "assv", 2, 2, EVAL }, { P_Assoc, "assoc", 2, 2, EVAL }, { P_Memq, "memq", 2, 2, EVAL }, { P_Memv, "memv", 2, 2, EVAL }, { P_Member, "member", 2, 2, EVAL }, { P_Make_List, "make-list", 2, 2, EVAL }, { P_List, "list", 0, MANY, VARARGS }, { P_Length, "length", 1, 1, EVAL }, { P_Append, "append", 0, MANY, VARARGS }, { P_Append_Set, "append!", 0, MANY, VARARGS }, { P_Last_Pair, "last-pair", 1, 1, EVAL }, { P_Reverse, "reverse", 1, 1, EVAL }, { P_Reverse_Set, "reverse!", 1, 1, EVAL }, { P_List_Tail, "list-tail", 2, 2, EVAL }, { P_List_Ref, "list-ref", 2, 2, EVAL }, /* main.c: */ { P_Command_Line_Args, "command-line-args", 0, 0, EVAL }, { P_Exit, "exit", 0, 1, VARARGS }, /* math.c: */ { P_Number_To_String, "number->string", 1, 2, VARARGS }, { P_Numberp, "number?", 1, 1, EVAL }, { P_Complexp, "complex?", 1, 1, EVAL }, { P_Realp, "real?", 1, 1, EVAL }, { P_Rationalp, "rational?", 1, 1, EVAL }, { P_Integerp, "integer?", 1, 1, EVAL }, { P_Zerop, "zero?", 1, 1, EVAL }, { P_Positivep, "positive?", 1, 1, EVAL }, { P_Negativep, "negative?", 1, 1, EVAL }, { P_Oddp, "odd?", 1, 1, EVAL }, { P_Evenp, "even?", 1, 1, EVAL }, { P_Exactp, "exact?", 1, 1, EVAL }, { P_Inexactp, "inexact?", 1, 1, EVAL }, { P_Exact_To_Inexact, "exact->inexact", 1, 1, EVAL }, { P_Inexact_To_Exact, "inexact->exact", 1, 1, EVAL }, { P_Generic_Less, "<", 1, MANY, VARARGS }, { P_Generic_Greater, ">", 1, MANY, VARARGS }, { P_Generic_Equal, "=", 1, MANY, VARARGS }, { P_Generic_Eq_Less, "<=", 1, MANY, VARARGS }, { P_Generic_Eq_Greater,">=", 1, MANY, VARARGS }, { P_Inc, "1+", 1, 1, EVAL }, { P_Dec, "-1+", 1, 1, EVAL }, { P_Dec, "1-", 1, 1, EVAL }, { P_Generic_Plus, "+", 0, MANY, VARARGS }, { P_Generic_Minus, "-", 1, MANY, VARARGS }, { P_Generic_Multiply, "*", 0, MANY, VARARGS }, { P_Generic_Divide, "/", 1, MANY, VARARGS }, { P_Abs, "abs", 1, 1, EVAL }, { P_Quotient, "quotient", 2, 2, EVAL }, { P_Remainder, "remainder", 2, 2, EVAL }, { P_Modulo, "modulo", 2, 2, EVAL }, { P_Gcd, "gcd", 0, MANY, VARARGS }, { P_Lcm, "lcm", 0, MANY, VARARGS }, { P_Floor, "floor", 1, 1, EVAL }, { P_Ceiling, "ceiling", 1, 1, EVAL }, { P_Truncate, "truncate", 1, 1, EVAL }, { P_Round, "round", 1, 1, EVAL }, { P_Sqrt, "sqrt", 1, 1, EVAL }, { P_Exp, "exp", 1, 1, EVAL }, { P_Pow, "pow", 2, 2, EVAL }, { P_Log, "log", 1, 1, EVAL }, { P_Sin, "sin", 1, 1, EVAL }, { P_Cos, "cos", 1, 1, EVAL }, { P_Tan, "tan", 1, 1, EVAL }, { P_Asin, "asin", 1, 1, EVAL }, { P_Acos, "acos", 1, 1, EVAL }, { P_Atan, "atan", 1, 2, VARARGS }, { P_Min, "min", 1, MANY, VARARGS }, { P_Max, "max", 1, MANY, VARARGS }, { P_Random, "random", 0, 0, EVAL }, { P_Srandom, "srandom", 1, 1, EVAL }, /* prim.c: */ /* print.c: */ { P_Write, "write", 1, 2, VARARGS }, { P_Display, "display", 1, 2, VARARGS }, { P_Write_Char, "write-char", 1, 2, VARARGS }, { P_Newline, "newline", 0, 1, VARARGS }, { P_Print, "print", 1, 2, VARARGS }, { P_Clear_Output_Port, "clear-output-port", 0, 1, VARARGS }, { P_Flush_Output_Port, "flush-output-port", 0, 1, VARARGS }, { P_Get_Output_String, "get-output-string", 1, 1, EVAL }, { P_Format, "format", 2, MANY, VARARGS }, /* proc.c: */ { P_Procedurep, "procedure?", 1, 1, EVAL }, { P_Primitivep, "primitive?", 1, 1, EVAL }, { P_Primitive_To_String, "primitive->string", 1, 1, EVAL }, { P_Compoundp, "compound?", 1, 1, EVAL }, { P_Compound_To_String, "compound->string", 1, 1, EVAL }, { P_Macrop, "macro?", 1, 1, EVAL }, { P_Macro_To_String, "macro->string", 1, 1, EVAL }, { P_Eval, "eval", 1, 2, VARARGS }, { P_Apply, "apply", 2, MANY, VARARGS }, { P_Lambda, "lambda", 2, MANY, NOEVAL }, { P_Procedure_Environment, "procedure-environment", 1, 1, EVAL }, { P_Procedure_Lambda, "procedure-lambda", 1, 1, EVAL }, { P_Map, "map", 2, MANY, VARARGS }, { P_For_Each, "for-each", 2, MANY, VARARGS }, { P_Macro, "macro", 2, MANY, NOEVAL }, { P_Macro_Body, "macro-body", 1, 1, EVAL }, { P_Macro_Expand, "macro-expand", 1, 1, EVAL }, /* promise.c: */ { P_Delay, "delay", 1, 1, NOEVAL }, { P_Force, "force", 1, 1, EVAL }, { P_Promisep, "promise?", 1, 1, EVAL }, { P_Promise_Environment, "promise-environment", 1, 1, EVAL }, /* read.c: */ { P_Clear_Input_Port, "clear-input-port", 0, 1, VARARGS }, { P_Read, "read", 0, 1, VARARGS }, { P_Read_Char, "read-char", 0, 1, VARARGS }, { P_Read_String, "read-string", 0, 1, VARARGS }, { P_Unread_Char, "unread-char", 1, 2, VARARGS }, { P_Peek_Char, "peek-char", 0, 1, VARARGS }, { P_Char_Readyp, "char-ready?", 0, 1, VARARGS }, /* special.c: */ { P_Quote, "quote", 1, 1, NOEVAL }, { P_Quasiquote, "quasiquote", 1, 1, NOEVAL }, { P_Begin, "begin", 0, MANY, NOEVAL }, { P_Begin1, "begin1", 0, MANY, NOEVAL }, { P_If, "if", 2, MANY, NOEVAL }, { P_Case, "case", 2, MANY, NOEVAL }, { P_Cond, "cond", 0, MANY, NOEVAL }, { P_Do, "do", 2, MANY, NOEVAL }, { P_Let, "let", 2, MANY, NOEVAL }, { P_Letseq, "let*", 2, MANY, NOEVAL }, { P_Letrec, "letrec", 2, MANY, NOEVAL }, { P_Fluid_Let, "fluid-let", 2, MANY, NOEVAL }, { P_And, "and", 0, MANY, NOEVAL }, { P_Or, "or", 0, MANY, NOEVAL }, /* string.c: */ { P_String, "string", 0, MANY, VARARGS }, { P_Stringp, "string?", 1, 1, EVAL }, { P_Make_String, "make-string", 1, 2, VARARGS }, { P_String_Length, "string-length", 1, 1, EVAL }, { P_String_To_Number, "string->number", 1, 2, VARARGS }, { P_String_Ref, "string-ref", 2, 2, EVAL }, { P_String_Set, "string-set!", 3, 3, EVAL }, { P_Substring, "substring", 3, 3, EVAL }, { P_String_Copy, "string-copy", 1, 1, EVAL }, { P_String_Append, "string-append", 0, MANY, VARARGS }, { P_List_To_String, "list->string", 1, 1, EVAL }, { P_String_To_List, "string->list", 1, 1, EVAL }, { P_String_Fill, "string-fill!", 2, 2, EVAL }, { P_Substring_Fill, "substring-fill!", 4, 4, EVAL }, { P_String_Eq, "string=?", 2, 2, EVAL }, { P_String_Less, "string?", 2, 2, EVAL }, { P_String_Eq_Less, "string<=?", 2, 2, EVAL }, { P_String_Eq_Greater, "string>=?", 2, 2, EVAL }, { P_String_CI_Eq, "string-ci=?", 2, 2, EVAL }, { P_String_CI_Less, "string-ci?", 2, 2, EVAL }, { P_String_CI_Eq_Less, "string-ci<=?", 2, 2, EVAL }, { P_String_CI_Eq_Greater, "string-ci>=?", 2, 2, EVAL }, { P_Substringp, "substring?", 2, 2, EVAL }, { P_CI_Substringp, "substring-ci?", 2, 2, EVAL }, /* symbol.c: */ { P_String_To_Symbol, "string->symbol", 1, 1, EVAL }, { P_Oblist, "oblist", 0, 0, EVAL }, { P_Symbolp, "symbol?", 1, 1, EVAL }, { P_Symbol_To_String, "symbol->string", 1, 1, EVAL }, { P_Put, "put", 2, 3, VARARGS }, { P_Get, "get", 2, 2, EVAL }, { P_Symbol_Plist, "symbol-plist", 1, 1, EVAL }, /* type.c: */ { P_Type, "type", 1, 1, EVAL }, /* vector.c: */ { P_Vectorp, "vector?", 1, 1, EVAL }, { P_Make_Vector, "make-vector", 1, 2, VARARGS }, { P_Vector, "vector", 0, MANY, VARARGS }, { P_Vector_Length, "vector-length", 1, 1, EVAL }, { P_Vector_Ref, "vector-ref", 2, 2, EVAL }, { P_Vector_Set, "vector-set!", 3, 3, EVAL }, { P_Vector_To_List, "vector->list", 1, 1, EVAL }, { P_List_To_Vector, "list->vector", 1, 1, EVAL }, { P_Vector_Fill, "vector-fill!", 2, 2, EVAL }, { P_Vector_Copy, "vector-copy", 1, 1, EVAL }, { 0 } }; /* The C-compiler can't initialize unions, thus the primitive procedures * must be created during run-time (the problem actually is that one can't * provide an intializer for the "tag" component of an S_Primitive). */ void Init_Prim () { register struct Prim_Init *p; Object frame, prim, sym; for (frame = Car (The_Environment), p = Primitives; p->fun; p++) { prim = Make_Primitive (p->fun, p->name, p->minargs, p->maxargs, p->disc); sym = Intern (p->name); frame = Add_Binding (frame, sym, prim); } Car (The_Environment) = frame; Memoize_Frame (frame); } void Define_Primitive (Object (*fun)(), char const *name, int min, int max, enum discipline disc) { Object prim, sym, frame; GC_Node2; Set_Error_Tag ("define-primitive"); prim = Make_Primitive (fun, name, min, max, disc); sym = Null; GC_Link2 (prim, sym); sym = Intern (name); if (disc == EVAL && min != max) Primitive_Error ("~s: number of arguments must be fixed", sym); frame = Add_Binding (Car (The_Environment), sym, prim); SYMBOL(sym)->value = prim; Car (The_Environment) = frame; GC_Unlink; } elk-3.99.8/src/error.c0000644000175000017500000001220111577076306011414 00000000000000/* error.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "config.h" #include #include #include #include "kernel.h" void Reset () elk_attribute(__noreturn__); void Err_Handler () elk_attribute(__noreturn__); Object Arg_True; static Object V_Error_Handler, V_Top_Level_Control_Point; /* Error_Tag should be static and users should only use the functions * Set_Error_Tag() and Get_Error_Tag(). However, in older versions * the variable was manipulated directly, therefore it will remain global * for some time for backwards compatibility. */ char const *Error_Tag; char *appname; void Init_Error () { Arg_True = Cons (True, Null); Global_GC_Link (Arg_True); Define_Variable (&V_Error_Handler, "error-handler", Null); Define_Variable (&V_Top_Level_Control_Point, "top-level-control-point", Null); } char const *Get_Error_Tag () { return Error_Tag; } void Set_Error_Tag (char const *tag) { Error_Tag = tag; } void Set_App_Name (char *name) { appname = name; } #ifdef lint /*VARARGS1*/ void Fatal_Error (const char *foo) { foo = foo; } #else void Fatal_Error (const char *fmt, ...) { va_list args; Disable_Interrupts; va_start (args, fmt); (void)fflush (stdout); if (appname) fprintf (stderr, "\n%s: fatal error: ", appname); else fprintf (stderr, "\nFatal error: "); vfprintf (stderr, fmt, args); fprintf (stderr, ".\n"); va_end (args); exit (1); } #endif void Panic (char const *msg) { Disable_Interrupts; (void)fflush (stdout); if (appname) fprintf (stderr, "\n%s: panic: ", appname); else fprintf (stderr, "\nPanic: "); fprintf (stderr, "%s (dumping core).\n", msg); abort (); } void Uncatchable_Error (char *errmsg) { Disable_Interrupts; Reset_IO (0); /* * The message can be sent to stdout, as Reset_IO() resets the * current output port back to the Standard_Output_Port: */ if (appname) { printf ("%s: %c", appname, tolower (errmsg[0])); errmsg++; } printf("%s\n", errmsg); Reset (); } #ifdef lint /*VARARGS1*/ void Primitive_Error (const char *foo) { foo = foo; } #else void Primitive_Error (const char *fmt, ...) { va_list args; register const char *p; register int i, n; Object msg, sym, argv[10]; GC_Node; GCNODE gcv; va_start (args, fmt); for (n = 0, p = fmt; *p; p++) if (*p == '~' && p[1] != '~' && p[1] != '%' && p[1] != 'E' && p[1] != 'e') n++; if (n > 10) Panic ("Primitive_Error args"); for (i = 0; i < n; i++) argv[i] = va_arg (args, Object); sym = Null; GC_Link (sym); gcv.gclen = 1 + i; gcv.gcobj = argv; gcv.next = &gc1; GC_List = &gcv; sym = Intern (Error_Tag); msg = Make_String (fmt, p - fmt); Err_Handler (sym, msg, i, argv); /*NOTREACHED*/ } #endif Object P_Error (int argc, Object *argv) { Check_Type (argv[1], T_String); Err_Handler (argv[0], argv[1], argc-2, argv+2); /*NOTREACHED*/ } void Err_Handler (Object sym, Object fmt, int argc, Object *argv) { Object fun, args, a[1]; GC_Node3; Reset_IO (0); args = Null; GC_Link3 (args, sym, fmt); args = P_List (argc, argv); args = Cons (fmt, args); args = Cons (sym, args); fun = Var_Get (V_Error_Handler); if (TYPE(fun) == T_Compound) (void)Funcall (fun, args, 0); a[0] = sym; Format (Curr_Output_Port, "~s: ", 4, 1, a); Format (Curr_Output_Port, STRING(fmt)->data, STRING(fmt)->size, argc, argv); (void)P_Newline (0, (Object *)0); GC_Unlink; Reset (); /*NOTREACHED*/ } void Reset () { Object cp; cp = Var_Get (V_Top_Level_Control_Point); if (TYPE(cp) == T_Control_Point) (void)Funcall_Control_Point (cp, Arg_True, 0); (void)fflush (stdout); exit (1); } Object P_Reset () { Reset_IO (0); Reset (); /*NOTREACHED*/ } void Range_Error (Object i) { Primitive_Error ("argument out of range: ~s", i); } elk-3.99.8/src/stab-bsd.c0000644000175000017500000000656511577076306012002 00000000000000/* stab-bsd.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include AOUT_H #include #include #include extern void Free_Symbols (SYMTAB *); extern int errno; #ifndef O_BINARY # define O_BINARY 0 #endif SYMTAB *Snarf_Symbols (FILE *f, struct exec *ep) { SYMTAB *tab; register SYM *sp, **nextp; int nsyms, strsiz; struct nlist nl; tab = (SYMTAB *)Safe_Malloc (sizeof (SYMTAB)); tab->first = 0; tab->strings = 0; nextp = &tab->first; (void)fseek (f, (long)N_SYMOFF(*ep), 0); for (nsyms = ep->a_syms / sizeof (nl); nsyms > 0; nsyms--) { if (fread ((char *)&nl, sizeof (nl), 1, f) != 1) { Free_Symbols (tab); (void)fclose (f); Primitive_Error ("corrupt symbol table in object file"); } if (nl.n_un.n_strx == 0 || nl.n_type & N_STAB) continue; #ifndef ibm023 if ((nl.n_type & N_TYPE) != N_TEXT) continue; #endif sp = (SYM *)Safe_Malloc (sizeof (SYM)); sp->name = (char *)nl.n_un.n_strx; sp->value = nl.n_value; *nextp = sp; nextp = &sp->next; *nextp = 0; } if (fread ((char *)&strsiz, sizeof (strsiz), 1, f) != 1) { strerr: Free_Symbols (tab); (void)fclose (f); Primitive_Error ("corrupt string table in object file"); } if (strsiz <= 4) goto strerr; tab->strings = Safe_Malloc (strsiz); strsiz -= 4; if (fread (tab->strings+4, 1, strsiz, f) != strsiz) goto strerr; for (sp = tab->first; sp; sp = sp->next) sp->name = tab->strings + (long)sp->name; return tab; } SYMTAB *Open_File_And_Snarf_Symbols (char *name) { struct exec hdr; int fd; FILE *fp; SYMTAB *tab; if ((fd = open (name, O_RDONLY|O_BINARY)) == -1) { Saved_Errno = errno; Primitive_Error ("can't open a.out file: ~E"); } if (read (fd, (char *)&hdr, sizeof hdr) != sizeof hdr) { close (fd); Primitive_Error ("can't read a.out header"); } if ((fp = fdopen (fd, O_BINARY ? "rb" : "r")) == NULL) { close (fd); Primitive_Error ("can't fdopen a.out file"); } tab = Snarf_Symbols (fp, &hdr); (void)fclose (fp); return tab; } elk-3.99.8/src/onfork.c0000644000175000017500000000406411577076306011571 00000000000000/* onfork.c: This module allows code to register `onfork' handlers, similar * to the way exit handlers are registered in C with atexit(). * The interpreter kernel proper never calls the onfork handlers, * but the fork primitive of the UNIX extension does in the newly * created child process (other extensions may also call the handlers). * * The dynamic loading implementation of the interpreter kernel * may register onfork handlers to add links to the temp files. * User-supplied extensions may want to register onfork handlers * as well. * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "config.h" #include "kernel.h" static FUNCT *Onfork_Funcs; void Register_Onfork (void (*f)()) { FUNCT *p; p = (FUNCT *)Safe_Malloc (sizeof (*p)); p->func = f; p->next = Onfork_Funcs; Onfork_Funcs = p; } void Call_Onfork () { FUNCT *p; for (p = Onfork_Funcs; p; p = p->next) p->func(); } elk-3.99.8/src/stkmem.c0000644000175000017500000000631611577076306011575 00000000000000/* stkmem.c: Alloca() simulation. * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "config.h" #include "kernel.h" #ifndef HAVE_ALLOCA extern char *malloc(); MEM_NODE *Mem_List; char *Mem_Alloc (unsigned int size) { char *ret; Disable_Interrupts; if ((ret = malloc (size)) == 0) Fatal_Error ("not enough memory to malloc %u bytes", size); Enable_Interrupts; return ret; } Free_Mem_Nodes (MEM_NODE *first) { MEM_NODE *p; Disable_Interrupts; while (p = first) { first = first->next; if (--p->refcnt == 0) free ((char *)p); } Enable_Interrupts; } Save_Mem_Nodes (Object cont) { unsigned int sum = 0; char *s; MEM_NODE *p; Object str; GC_Node; CONTROL(cont)->memlist = Mem_List; for (p = Mem_List; p; p = p->next) sum += p->len; GC_Link (cont); str = Make_String ((char *)0, sum); CONTROL(cont)->memsave = str; GC_Unlink; for (p = Mem_List, s = STRING(str)->data; p; s += p->len, p = p->next) { memcpy (s, p+1, p->len); p->refcnt++; } } Restore_Mem_Nodes (Object cont) { MEM_NODE *p; char *s; Object str; Free_Mem_Nodes (Mem_List); Mem_List = CONTROL(cont)->memlist; str = CONTROL(cont)->memsave; for (p = Mem_List, s = STRING(str)->data; p; s += p->len, p = p->next) { p->refcnt++; memcpy (p+1, s, p->len); } } Object Save_GC_Nodes () { Object vec; register unsigned int sum = 0, i = 0, n; register GCNODE *p; for (p = GC_List; p; p = p->next) sum += p->gclen <= 0 ? 1 : p->gclen-1; vec = Make_Vector (sum, Null); for (p = GC_List; p; p = p->next, i += n) { n = p->gclen <= 0 ? 1 : p->gclen-1; memcpy (&(VECTOR(vec)->data[i]), p->gcobj, n * sizeof (Object)); } return vec; } Restore_GC_Nodes (Object vec) { register int i = 0, n; register GCNODE *p; for (p = GC_List; p; p = p->next, i += n) { n = p->gclen <= 0 ? 1 : p->gclen-1; memcpy (p->gcobj, &(VECTOR(vec)->data[i]), n * sizeof (Object)); } } #endif elk-3.99.8/src/list.c0000644000175000017500000002327011577076306011246 00000000000000/* list.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "config.h" #include "kernel.h" extern unsigned int Stack_Size (); extern void Uncatchable_Error (char *); Object Const_Cons (Object car, Object cdr) { Object ret; ret = P_Cons (car, cdr); SETCONST(ret); return ret; } Object P_Cons (Object car, Object cdr) { Object cell; GC_Node2; #ifdef GENERATIONAL_GC GC_Link2 (car, cdr); cell = Alloc_Object (sizeof (struct S_Pair), T_Pair, 0); GC_Unlink; #else /* This is an optimization (it duplicates parts of Alloc_Object()): */ register char *p; p = Hp; ELK_ALIGN(p); if (p + sizeof (struct S_Pair) <= Heap_End && !GC_Debug) { Hp = p + sizeof (struct S_Pair); SET(cell, T_Pair, (struct S_Pair *)p); } else { GC_Link2 (car, cdr); cell = Alloc_Object (sizeof (struct S_Pair), T_Pair, 0); GC_Unlink; } #endif Car (cell) = car; Cdr (cell) = cdr; return cell; } Object P_Car (Object x) { Check_Type (x, T_Pair); return Car (x); } Object P_Cdr (Object x) { Check_Type (x, T_Pair); return Cdr (x); } Object Cxr (Object x, register char *pat, register unsigned int len) { Object ret; for (ret = x, pat += len; len > 0; len--) switch (*--pat) { case 'a': ret = P_Car (ret); break; case 'd': ret = P_Cdr (ret); break; default: Primitive_Error ("invalid pattern"); } return ret; } Object P_Cddr (Object x) { return Cxr (x, "dd", 2); } Object P_Cdar (Object x) { return Cxr (x, "da", 2); } Object P_Cadr (Object x) { return Cxr (x, "ad", 2); } Object P_Caar (Object x) { return Cxr (x, "aa", 2); } Object P_Cdddr (Object x) { return Cxr (x, "ddd", 3); } Object P_Cddar (Object x) { return Cxr (x, "dda", 3); } Object P_Cdadr (Object x) { return Cxr (x, "dad", 3); } Object P_Cdaar (Object x) { return Cxr (x, "daa", 3); } Object P_Caddr (Object x) { return Cxr (x, "add", 3); } Object P_Cadar (Object x) { return Cxr (x, "ada", 3); } Object P_Caadr (Object x) { return Cxr (x, "aad", 3); } Object P_Caaar (Object x) { return Cxr (x, "aaa", 3); } Object P_Caaaar (Object x) { return Cxr (x, "aaaa", 4); } Object P_Caaadr (Object x) { return Cxr (x, "aaad", 4); } Object P_Caadar (Object x) { return Cxr (x, "aada", 4); } Object P_Caaddr (Object x) { return Cxr (x, "aadd", 4); } Object P_Cadaar (Object x) { return Cxr (x, "adaa", 4); } Object P_Cadadr (Object x) { return Cxr (x, "adad", 4); } Object P_Caddar (Object x) { return Cxr (x, "adda", 4); } Object P_Cadddr (Object x) { return Cxr (x, "addd", 4); } Object P_Cdaaar (Object x) { return Cxr (x, "daaa", 4); } Object P_Cdaadr (Object x) { return Cxr (x, "daad", 4); } Object P_Cdadar (Object x) { return Cxr (x, "dada", 4); } Object P_Cdaddr (Object x) { return Cxr (x, "dadd", 4); } Object P_Cddaar (Object x) { return Cxr (x, "ddaa", 4); } Object P_Cddadr (Object x) { return Cxr (x, "ddad", 4); } Object P_Cdddar (Object x) { return Cxr (x, "ddda", 4); } Object P_Cddddr (Object x) { return Cxr (x, "dddd", 4); } Object P_Cxr (Object x, Object pat) { Check_List (x); if (TYPE(pat) == T_Symbol) pat = SYMBOL(pat)->name; else if (TYPE(pat) != T_String) Wrong_Type_Combination (pat, "string or symbol"); return Cxr (x, STRING(pat)->data, STRING(pat)->size); } Object P_Nullp (Object x) { return Nullp (x) ? True : False; } Object P_Pairp (Object x) { return TYPE(x) == T_Pair ? True : False; } Object P_Listp (Object x) { Object s; register int f; for (s = x, f = 0; !Nullp (x); f ^= 1) { if (TYPE(x) != T_Pair) return False; x = Cdr (x); if (EQ(x, s)) return False; if (f) s = Cdr (s); } return True; } Object P_Set_Car (Object x, Object new) { Check_Type (x, T_Pair); Check_Mutable (x); Car (x) = new; return new; } Object P_Set_Cdr (Object x, Object new) { Check_Type (x, T_Pair); Check_Mutable (x); Cdr (x) = new; return new; } Object General_Member (Object key, Object list, register int comp) { register int r; for ( ; !Nullp (list); list = Cdr (list)) { Check_List (list); if (comp == 0) r = EQ(Car (list), key); else if (comp == 1) r = Eqv (Car (list), key); else r = Equal (Car (list), key); if (r) return list; } return False; } Object P_Memq (Object key, Object list) { return General_Member (key, list, 0); } Object P_Memv (Object key, Object list) { return General_Member (key, list, 1); } Object P_Member (Object key, Object list) { return General_Member (key, list, 2); } Object General_Assoc (Object key, Object alist, register int comp) { Object elem; register int r; for ( ; !Nullp (alist); alist = Cdr (alist)) { Check_List (alist); elem = Car (alist); if (TYPE(elem) != T_Pair) continue; if (comp == 0) r = EQ(Car (elem), key); else if (comp == 1) r = Eqv (Car (elem), key); else r = Equal (Car (elem), key); if (r) return elem; } return False; } Object P_Assq (Object key, Object alist) { return General_Assoc (key, alist, 0); } Object P_Assv (Object key, Object alist) { return General_Assoc (key, alist, 1); } Object P_Assoc (Object key, Object alist) { return General_Assoc (key, alist, 2); } unsigned int Fast_Length (Object list) { Object tail; register int i; for (i = 0, tail = list; TYPE(tail) == T_Pair; tail = Cdr (tail), i++) ; return i; } Object P_Length (Object list) { Object tail; register int i; for (i = 0, tail = list; !Nullp (tail); tail = Cdr (tail), i++) Check_List (tail); return Make_Integer (i); } Object P_Make_List (Object n, Object init) { register unsigned int len; Object list; GC_Node; if ((len = Get_Exact_Integer (n)) < 0) Range_Error (n); list = Null; GC_Link (init); while (len-- > 0) list = Cons (init, list); GC_Unlink; return list; } Object P_List (int argc, Object *argv) { Object list, tail, cell; GC_Node2; GC_Link2 (list, tail); for (list = tail = Null; argc-- > 0; tail = cell) { cell = Cons (*argv++, Null); if (Nullp (list)) list = cell; else (void)P_Set_Cdr (tail, cell); } GC_Unlink; return list; } Object P_Last_Pair (Object x) { Check_Type (x, T_Pair); for ( ; TYPE(Cdr (x)) == T_Pair; x = Cdr (x)) ; return x; } Object P_Append (int argc, Object *argv) { Object list, last, tail, cell; register int i; GC_Node3; list = last = Null; GC_Link3 (list, last, tail); for (i = 0; i < argc-1; i++) { for (tail = argv[i]; !Nullp (tail); tail = Cdr (tail)) { Check_List (tail); cell = Cons (Car (tail), Null); if (Nullp (list)) list = cell; else (void)P_Set_Cdr (last, cell); last = cell; } } if (argc) { if (Nullp (list)) list = argv[i]; else (void)P_Set_Cdr (last, argv[i]); } GC_Unlink; return list; } Object P_Append_Set (int argc, Object *argv) { register int i, j; for (i = j = 0; i < argc; i++) if (!Nullp (argv[i])) argv[j++] = argv[i]; if (j == 0) return Null; for (i = 0; i < j-1; i++) (void)P_Set_Cdr (P_Last_Pair (argv[i]), argv[i+1]); return *argv; } Object P_Reverse (Object x) { Object ret; GC_Node; GC_Link (x); for (ret = Null; !Nullp (x); x = Cdr (x)) { Check_List (x); ret = Cons (Car (x), ret); } GC_Unlink; return ret; } Object P_Reverse_Set (Object x) { Object prev, tail; for (prev = Null; !Nullp (x); prev = x, x = tail) { Check_List (x); tail = Cdr (x); (void)P_Set_Cdr (x, prev); } return prev; } Object P_List_Tail (Object x, Object num) { register int n; for (n = Get_Exact_Integer (num); n > 0 && !Nullp (x); n--, x = P_Cdr (x)) ; return x; } Object P_List_Ref (Object x, Object num) { return P_Car (P_List_Tail (x, num)); } Object Copy_List (Object x) { Object car, cdr; GC_Node3; if (TYPE(x) == T_Pair) { if (Stack_Size () > Max_Stack) Uncatchable_Error ("Out of stack space"); car = cdr = Null; GC_Link3 (x, car, cdr); car = Copy_List (Car (x)); cdr = Copy_List (Cdr (x)); x = Cons (car, cdr); GC_Unlink; } return x; } elk-3.99.8/src/stab.c0000644000175000017500000001222111577076306011216 00000000000000/* stab.c: Read and manage symbol tables from object modules. * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "config.h" #include #include #include "kernel.h" void Free_Symbols (SYMTAB *); #if defined(CAN_LOAD_LIB) || defined (INIT_OBJECTS) /*#if defined(MACH_O) # include "stab-macho.c" #elif defined(HAVE_LIBELF) # include "stab-elf.c" #elif defined(COFF) || defined(XCOFF) # include "stab-coff.c" #elif defined(ECOFF) # include "stab-ecoff.c" #elif defined(CONVEX_AOUT) # include "stab-convex.c" #elif defined(hp9000s300) || defined(__hp9000s300) || defined(__hp9000s300__) # include "stab-hp9k300.c" #elif defined(hp9000s800) || defined(__hp9000s800) || defined(__hp9000s800__) # include "stab-hp9k800.c" #elif defined(HAVE_A_OUT_H) # include "stab-bsd.c" #else # include "stab-unix.c" #endif*/ static SYMPREFIX Ignore_Prefixes[] = { /* Currently none */ { 0, 0 } }; static SYMPREFIX Init_Prefixes[] = { { INIT_PREFIX, PR_EXTENSION }, { "_GLOBAL_.I.", PR_CONSTRUCTOR }, /* SVR4.2/g++ */ { "__sti__", PR_CONSTRUCTOR }, { "_STI", PR_CONSTRUCTOR }, { "_GLOBAL_$I$", PR_CONSTRUCTOR }, { 0, 0 } }; static SYMPREFIX Finit_Prefixes[] = { { FINIT_PREFIX, PR_EXTENSION }, { "_GLOBAL_.D.", PR_CONSTRUCTOR }, { "__std__", PR_CONSTRUCTOR }, { "_STD", PR_CONSTRUCTOR }, { "_GLOBAL_$D$", PR_CONSTRUCTOR }, { 0, 0 } }; static FUNCT *Finalizers; static void Call (unsigned long int l) { #ifdef XCOFF unsigned long int vec[3]; extern main(); memcpy (vec, main, sizeof vec); vec[0] = (l & ~0xF0000000) + (vec[0] & 0xF0000000); ((void (*)())vec)(); #else ((void (*)())l)(); #endif } void Call_Initializers (SYMTAB *tab, char *addr, int which) { SYM *sp; char *p; SYMPREFIX *pp; FUNCT *fp, **fpp; /* Set pointer to end of list of finalizers; extension finalization * functions and C++ static destructors will be appended to this list: */ for (fpp = &Finalizers; *fpp; fpp = &(*fpp)->next) ; for (sp = tab->first; sp; sp = sp->next) { if (!sp->value || (char *)sp->value < addr) continue; p = sp->name; #ifdef SYMS_BEGIN_WITH if (*p == SYMS_BEGIN_WITH) p++; else continue; #endif for (pp = Ignore_Prefixes; pp->name; pp++) if (strncmp (p, pp->name, strlen (pp->name)) == 0) goto next; for (pp = Init_Prefixes; pp->name; pp++) { if (pp->type == which && strncmp (p, pp->name, strlen (pp->name)) == 0) { if (Verb_Init) printf ("[calling %s]\n", p); Call (sp->value); } } /* Append to list of finalizers (to be invoked on exit): */ for (pp = Finit_Prefixes; pp->name; pp++) { if (pp->type == which && strncmp (p, pp->name, strlen (pp->name)) == 0) { fp = (FUNCT *)Safe_Malloc (sizeof (FUNCT)); fp->func = (void (*)())sp->value; fp->name = Safe_Malloc (strlen (p) + 1); strcpy (fp->name, p); fp->next = 0; *fpp = fp; fpp = &fp->next; } } next: ; } } /* Call the finialization functions and C++ static destructors. Make sure * that calling exit() from a function doesn't cause endless recursion. */ void Call_Finalizers () { while (Finalizers) { FUNCT *fp = Finalizers; Finalizers = fp->next; if (Verb_Init) printf ("[calling %s]\n", fp->name); Call ((unsigned long int)fp->func); } } void Free_Symbols (SYMTAB *tab) { register SYM *sp, *nextp; for (sp = tab->first; sp; sp = nextp) { nextp = sp->next; #if defined(COFF) || defined(ECOFF) free (sp->name); #endif free ((char *)sp); } if (tab->strings) free (tab->strings); free ((char *)tab); } #endif /* CAN_LOAD_LIB || INIT_OBJECTS */ elk-3.99.8/src/stab-coff.c0000644000175000017500000000510111577076306012130 00000000000000/* stab-coff.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include #include #undef TYPE /* ldfnc.h defines a TYPE macro. */ #include SYMTAB *Snarf_Symbols (LDFILE *lf, int ep) { SYMTAB *tab; register SYM *sp, **nextp; SYMENT sym; long inx; char *p; extern char *ldgetname(); if (ldtbseek (lf) == FAILURE) { ldclose (lf); Primitive_Error ("can't ldtbseek"); } tab = (SYMTAB *)Safe_Malloc (sizeof (SYMTAB)); tab->first = 0; tab->strings = 0; nextp = &tab->first; while (1) { inx = ldtbindex (lf); if (ldtbread (lf, inx, &sym) == FAILURE) break; if (sym.n_scnum == N_UNDEF || sym.n_scnum == N_DEBUG || sym.n_scnum > HEADER(lf).f_nscns || sym.n_sclass != C_EXT) continue; if ((p = ldgetname (lf, &sym)) == NULL) continue; sp = (SYM *)Safe_Malloc (sizeof (SYM)); sp->name = Safe_Malloc (strlen (p) + 1); strcpy (sp->name, p); sp->value = sym.n_value; *nextp = sp; nextp = &sp->next; *nextp = 0; } return tab; } #ifdef INIT_OBJECTS SYMTAB *Open_File_And_Snarf_Symbols (char *name) { LDFILE *f; SYMTAB *tab; if ((f = ldopen (name, NULL)) == FAILURE) Primitive_Error ("can't ldopen a.out file"); tab = Snarf_Symbols (f); ldclose (f); return tab; } #endif /* INIT_OBJECTS */ elk-3.99.8/src/dump-vanilla.c0000644000175000017500000001723511577076306012670 00000000000000/* dump-vanilla.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #ifdef COFF # include # include # include # include # ifndef N_BADMAG # define N_BADMAG(x) (0) # endif #else # include AOUT_H #endif extern void *sbrk(); #if defined(hp9000s300) || defined(__hp9000s300) || defined(__hp9000s300__) static int getpagesize () { return EXEC_PAGESIZE; } #endif Object P_Dump (Object ofile) { #ifdef COFF static struct scnhdr thdr, dhdr, bhdr, scn; static struct filehdr hdr; static struct aouthdr ohdr; unsigned int bias; unsigned int lnno_start, syms_start; unsigned int text_scn_start, data_scn_start; unsigned int data_end; int pagemask = COFF_PAGESIZE-1; #else struct exec hdr, shdr; unsigned int data_start, data_end; int pagemask = getpagesize () - 1; #endif char *afn; register int n; char buf[BUFSIZ]; Dump_Prolog; if (read (afd, (char *)&hdr, sizeof (hdr)) != sizeof (hdr) || N_BADMAG(hdr)) { #ifdef COFF badaout: #endif Dump_Finalize; Primitive_Error ("corrupt a.out file"); } #ifdef COFF data_end = ((unsigned int)sbrk (0) + pagemask) & ~pagemask; syms_start = sizeof (hdr); if (hdr.f_opthdr > 0) { if (read (afd, (char *)&ohdr, sizeof (ohdr)) != sizeof (ohdr)) goto badaout; } for (n = 0; n < hdr.f_nscns; n++) { if (read (afd, (char *)&scn, sizeof (scn)) != sizeof (scn)) goto badaout; if (scn.s_scnptr > 0 && syms_start < scn.s_scnptr + scn.s_size) syms_start = scn.s_scnptr + scn.s_size; if (strcmp (scn.s_name, ".text") == 0) thdr = scn; else if (strcmp (scn.s_name, ".data") == 0) dhdr = scn; else if (strcmp (scn.s_name, ".bss") == 0) bhdr = scn; } hdr.f_flags |= (F_RELFLG|F_EXEC); ohdr.dsize = data_end - ohdr.data_start; ohdr.bsize = 0; thdr.s_size = ohdr.tsize; thdr.s_scnptr = sizeof (hdr) + sizeof (ohdr) + hdr.f_nscns * sizeof (thdr); lnno_start = thdr.s_lnnoptr; text_scn_start = thdr.s_scnptr; dhdr.s_paddr = dhdr.s_vaddr = ohdr.data_start; dhdr.s_size = ohdr.dsize; dhdr.s_scnptr = thdr.s_scnptr + thdr.s_size; data_scn_start = dhdr.s_scnptr; bhdr.s_paddr = bhdr.s_vaddr = ohdr.data_start + ohdr.dsize; bhdr.s_size = ohdr.bsize; bhdr.s_scnptr = 0; bias = dhdr.s_scnptr + dhdr.s_size - syms_start; if (hdr.f_symptr > 0) hdr.f_symptr += bias; if (thdr.s_lnnoptr > 0) thdr.s_lnnoptr += bias; if (write (ofd, (char *)&hdr, sizeof (hdr)) != sizeof (hdr)) { badwrite: Dump_Finalize; Primitive_Error ("error writing dump file: ~E"); } if (write (ofd, (char *)&ohdr, sizeof (ohdr)) != sizeof (ohdr)) goto badwrite; if (write (ofd, (char *)&thdr, sizeof (thdr)) != sizeof (thdr)) goto badwrite; if (write (ofd, (char *)&dhdr, sizeof (dhdr)) != sizeof (dhdr)) goto badwrite; if (write (ofd, (char *)&bhdr, sizeof (bhdr)) != sizeof (bhdr)) goto badwrite; lseek (ofd, (off_t)text_scn_start, 0); if (write (ofd, (char *)ohdr.text_start, ohdr.tsize) != ohdr.tsize) goto badwrite; Was_Dumped = 1; lseek (ofd, (off_t)data_scn_start, 0); if (write (ofd, (char *)ohdr.data_start, ohdr.dsize) != ohdr.dsize) goto badwrite; lseek (afd, lnno_start ? (off_t)lnno_start : (off_t)syms_start, 0); #else close (afd); #if defined(__bsdi__) data_start = N_DATADDR(hdr); #else data_start = hdr.a_text; #if defined(sun) || defined(__sun__) data_start += pagemask+1; #endif data_start = (data_start + SEG_SIZ-1) & ~(SEG_SIZ-1); #endif data_end = (unsigned int)sbrk (0); #if !defined(__bsdi__) data_end = (data_end + pagemask) & ~pagemask; #endif hdr.a_data = data_end - data_start; hdr.a_bss = 0; hdr.a_trsize = hdr.a_drsize = 0; afn = Loader_Input; if (!afn) afn = A_Out_Name; if ((afd = open (afn, O_RDONLY|O_BINARY)) == -1) { Dump_Finalize; Primitive_Error ("cannot open symbol table file: ~E"); } if (read (afd, (char *)&shdr, sizeof (shdr)) != sizeof (shdr) || N_BADMAG(shdr)) { Dump_Finalize; Primitive_Error ("corrupt symbol table file"); } #if defined(hp9000s300) || defined(__hp9000s300) || defined(__hp9000s300__) hdr.a_lesyms = shdr.a_lesyms; #else hdr.a_syms = shdr.a_syms; #endif (void)lseek (ofd, (off_t)FILE_TEXT_START, 0); n = hdr.a_text - TEXT_LENGTH_ADJ; if (write (ofd, (char *)MEM_TEXT_START, n) != n) { badwrite: Dump_Finalize; Primitive_Error ("error writing dump file: ~E"); } Was_Dumped = 1; #if defined(hp9000s300) || defined(__hp9000s300) || defined(__hp9000s300__) (void)lseek (ofd, (off_t)DATA_OFFSET(hdr), 0); #endif #if defined(__bsdi__) (void)lseek (ofd, (off_t)N_DATOFF(hdr), 0); #endif #ifdef GENERATIONAL_GC n = data_end - data_start; if (write (ofd, (char *)data_start, n) != n) goto badwrite; #else if (Heap_Start > Free_Start) { n = (unsigned int)Free_Start - data_start; if (write (ofd, (char *)data_start, n) != n) goto badwrite; (void)lseek (ofd, (off_t)(Free_End - Free_Start), 1); n = Hp - Heap_Start; if (write (ofd, Heap_Start, n) != n) goto badwrite; (void)lseek (ofd, (off_t)(Heap_End - Hp), 1); n = data_end - (unsigned int)Heap_End; if (write (ofd, Heap_End, n) != n) goto badwrite; } else { n = (unsigned int)Hp - data_start; if (write (ofd, (char *)data_start, n) != n) goto badwrite; (void)lseek (ofd, (off_t)(Free_End - Hp), 1); n = data_end - (unsigned int)Free_End; if (write (ofd, Free_End, n) != n) goto badwrite; } #endif #if defined(hp9000s300) || defined(__hp9000s300) || defined(__hp9000s300__) (void)lseek (afd, (off_t)LESYM_OFFSET(shdr), 0); (void)lseek (ofd, (off_t)LESYM_OFFSET(hdr), 0); #else (void)lseek (afd, (off_t)N_SYMOFF(shdr), 0); #if defined(__bsdi__) (void)lseek (ofd, (off_t)N_SYMOFF(hdr), 0); #endif #endif #endif /* !COFF */ while ((n = read (afd, buf, BUFSIZ)) > 0) { if (write (ofd, buf, n) != n) goto badwrite; } if (n < 0) { Dump_Finalize; Primitive_Error ("error reading symbol table: ~E"); } #if !defined(COFF) (void)lseek (ofd, (off_t)0L, 0); if (write (ofd, (char *)&hdr, sizeof (hdr)) != sizeof (hdr)) goto badwrite; #endif Dump_Epilog; } elk-3.99.8/src/bool.c0000644000175000017500000001041411577076306011222 00000000000000/* bool.c: Boolean functions. * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "config.h" #include #include "kernel.h" extern int Generic_Equal (Object, Object); Object P_Booleanp (Object x) { return TYPE(x) == T_Boolean ? True : False; } Object P_Not (Object x) { return Truep (x) ? False : True; } Object P_Eq (Object x1, Object x2) { return EQ(x1, x2) ? True : False; } Object P_Eqv (Object x1, Object x2) { return Eqv (x1, x2) ? True : False; } Object P_Equal (Object x1, Object x2) { return Equal (x1, x2) ? True : False; } int Eqv (Object x1, Object x2) { register int t1, t2; if (EQ(x1, x2)) return 1; t1 = TYPE(x1); t2 = TYPE(x2); if (Numeric (t1) && Numeric (t2)) { /* r4rs 6.2 states that (eqv? 1 1.0) ==> #f */ if((t1 == T_Flonum && t2 != T_Flonum) || (t1 != T_Flonum && t2 == T_Flonum)) return 0; return Generic_Equal (x1, x2); } if (t1 != t2) return 0; switch (t1) { case T_String: return STRING(x1)->size == 0 && STRING(x2)->size == 0; case T_Vector: return VECTOR(x1)->size == 0 && VECTOR(x2)->size == 0; case T_Primitive: return strcmp (PRIM(x1)->name, PRIM(x2)->name) == 0; default: if (t1 < 0 || t1 >= Num_Types) Panic ("bad type in eqv"); if (Types[t1].eqv == NOFUNC) return 0; return (Types[t1].eqv)(x1, x2); } /*NOTREACHED*/ } int Equal (Object x1, Object x2) { register int t1, t2; register unsigned int i; again: if (EQ(x1, x2)) return 1; t1 = TYPE(x1); t2 = TYPE(x2); if (Numeric (t1) && Numeric (t2)) return Generic_Equal (x1, x2); if (t1 != t2) return 0; switch (t1) { case T_Boolean: case T_Character: case T_Compound: case T_Control_Point: case T_Promise: case T_Port: case T_Macro: return 0; case T_Primitive: case T_Environment: return Eqv (x1, x2); case T_Symbol: { struct S_Symbol *p1 = SYMBOL(x1), *p2 = SYMBOL(x2); return Equal (p1->name, p2->name) && Equal (p1->plist, p2->plist); } case T_Pair: if (!Equal (Car (x1), Car (x2))) return 0; x1 = Cdr (x1); x2 = Cdr (x2); goto again; case T_String: { struct S_String *p1 = STRING(x1), *p2 = STRING(x2); return p1->size == p2->size && memcmp (p1->data, p2->data, p1->size) == 0; } case T_Vector: { struct S_Vector *p1 = VECTOR(x1), *p2 = VECTOR(x2); if (p1->size != p2->size) return 0; for (i = 0; i < p1->size; i++) if (!Equal (p1->data[i], p2->data[i])) return 0; return 1; } default: if (t1 < 0 || t1 >= Num_Types) Panic ("bad type in equal"); if (Types[t1].equal == NOFUNC) return 0; return (Types[t1].equal)(x1, x2); } /*NOTREACHED*/ } Object P_Empty_List_Is_False (Object is_false) { Check_Type (is_false, T_Boolean); if (Truep (is_false)) False2 = Null; else False2 = False; return Void; } elk-3.99.8/src/autoload.c0000644000175000017500000000444011577076306012101 00000000000000/* autoload.c: Autoloading support. * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "config.h" #include "kernel.h" Object V_Autoload_Notifyp; void Init_Auto (void) { Define_Variable (&V_Autoload_Notifyp, "autoload-notify?", False); } Object P_Autoload (Object sym, Object files) { Object al, ret; GC_Node3; al = Null; Check_Type (sym, T_Symbol); Check_Loadarg (files); GC_Link3 (al, sym, files); al = Alloc_Object (sizeof (struct S_Autoload), T_Autoload, 0); AUTOLOAD(al)->files = files; AUTOLOAD(al)->env = The_Environment; al = Cons (al, Null); al = Cons (sym, al); ret = P_Define (al); GC_Unlink; return ret; } Object Do_Autoload (Object sym, Object al) { Object val, a[1]; GC_Node; if (Var_Is_True (V_Autoload_Notifyp)) { a[0] = AUTOLOAD(al)->files; Format (Standard_Output_Port, "[Autoloading ~a]~%", 18, 1, a); } GC_Link (sym); (void)General_Load (AUTOLOAD(al)->files, AUTOLOAD(al)->env); GC_Unlink; val = SYMBOL(sym)->value; if (TYPE(val) == T_Autoload) Primitive_Error ("autoloading failed to define ~s", sym); return val; } elk-3.99.8/src/dump-ecoff.c0000644000175000017500000001624011577076306012317 00000000000000/* dump-ecoff.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include #include #include #include #include #include extern char *sbrk(); /* Find section header of section with given name. */ #define FIND_SECTHDR(name,ptr) {\ char err[100];\ int _i;\ for (_i = 0; _i < fhdr.f_nscns; _i++)\ if (strncmp (sect[_i].s_name, (name), sizeof(sect[_i].s_name)) == 0)\ break;\ if (_i == fhdr.f_nscns) {\ Dump_Finalize;\ sprintf (err, "running a.out doesn't have %s section", (name));\ Primitive_Error (err);\ }\ (ptr) = sect+_i;\ } #define MAX_SECTS 20 Object P_Dump (Object ofile) { struct filehdr fhdr; struct aouthdr ahdr; struct scnhdr sect[MAX_SECTS]; struct scnhdr *sp, *datap; unsigned long int data_start, data_end, delta; int mask, n; HDRR shdr; char buf[4096]; Dump_Prolog; /* Read file header, optional header, and section headers from * running a.out; locate .data section. * Reading the headers is not really necessary, as they get * mapped into the address space on startup. * However, we do not know where exactly they get mapped and * whether they haven't been modified. */ if (read (afd, (char *)&fhdr, sizeof (fhdr)) != sizeof (fhdr) || read (afd, (char *)&ahdr, sizeof (ahdr)) != sizeof (ahdr)) { Dump_Finalize; Primitive_Error ("error reading a.out headers: ~E"); } if (fhdr.f_nscns > MAX_SECTS) { Dump_Finalize; Primitive_Error ("too many sections in a.out"); } if (read (afd, (char *)sect, fhdr.f_nscns * sizeof (sect[0])) != fhdr.f_nscns * sizeof (sect[0])) { Dump_Finalize; Primitive_Error ("error reading section headers: ~E"); } FIND_SECTHDR (_DATA, datap); /* Adjust optional header and size of data segment */ data_start = datap->s_vaddr; mask = getpagesize () - 1; data_end = (unsigned long int)sbrk (0) + mask & ~mask; delta = data_end - data_start - datap->s_size; ahdr.dsize = data_end - ahdr.data_start; ahdr.bsize = 0; ahdr.bss_start = ahdr.data_start + ahdr.dsize; datap->s_size += delta; /* Deactivate sections that aren't really needed (such as bss). * Actually, the section type should be set to STYP_DSECT (dummy section), * but this causes the linker to complain next time an object file is * loaded. * Adjust offsets in section headers of all other sections (such as * .comment). (XXX: Should s_lnnoptr be adjusted as well?) */ for (sp = datap+1; sp < sect+fhdr.f_nscns; sp++) { switch (sp->s_flags & ~0xf) { case STYP_BSS: case STYP_SBSS: case STYP_LIT4: case STYP_LIT8: case STYP_SDATA: #ifdef DEBUG_DUMP /* .comment is not null-terminated */ printf ("nuking %.8s\n", sp->s_name); #endif sp->s_paddr = sp->s_vaddr = sp->s_scnptr = sp->s_lnnoptr = 0; sp->s_size = 0; break; default: #ifdef DEBUG_DUMP printf ("adjusting %.8s\n", sp->s_name); #endif sp->s_paddr += delta; sp->s_vaddr += delta; if (sp->s_scnptr) sp->s_scnptr += delta; } } delta = ahdr.tsize + ahdr.dsize - fhdr.f_symptr; fhdr.f_symptr += delta; /* Write headers */ n = fhdr.f_nscns * sizeof (sect[0]); if (write (ofd, (char *)&fhdr, sizeof (fhdr)) != sizeof (fhdr) || write (ofd, (char *)&ahdr, sizeof (ahdr)) != sizeof (ahdr) || write (ofd, (char *)sect, n) != n) { Dump_Finalize; Primitive_Error ("error writing a.out/section headers: ~E"); } /* Write sections */ Was_Dumped = 1; n += sizeof (fhdr) + sizeof (ahdr); #ifdef DEBUG_DUMP printf ("writing text 0x%x bytes and data 0x%x bytes\n", ahdr.tsize-n, ahdr.dsize); #endif if (write (ofd, (char *)ahdr.text_start+n, ahdr.tsize-n) != ahdr.tsize-n) { Dump_Finalize; Primitive_Error ("error writing text section: ~E"); } if (write (ofd, (char *)ahdr.data_start, ahdr.dsize) != ahdr.dsize) { Dump_Finalize; Primitive_Error ("error writing data sections: ~E"); } /* Copy the symbol table. If an object file has been loaded into * this invocation, copy the symbols from the ld temp file, * otherwise from the running a.out. * Adjust various offsets in the symbolic header. * (XXX: Are there any offsets to be adjusted in the table proper?) */ if (Loader_Input) { close (afd); if ((afd = open (Loader_Input, O_RDONLY)) == -1) { Dump_Finalize; Primitive_Error ("cannot open symbol table file: ~E"); } delta = fhdr.f_symptr; if (read (afd, (char *)&fhdr, sizeof (fhdr)) != sizeof (fhdr)) { Dump_Finalize; Primitive_Error ("error reading a.out header: ~E"); } delta -= fhdr.f_symptr; (void)lseek (afd, (off_t)fhdr.f_symptr, SEEK_SET); } else (void)lseek (afd, (off_t)fhdr.f_symptr-delta, SEEK_SET); #ifdef DEBUG_DUMP printf ("copying symbols from %s\n", Loader_Input ? Loader_Input : A_Out_Name); #endif if (read (afd, (char *)&shdr, sizeof (shdr)) != sizeof (shdr)) { symrerr: Dump_Finalize; Primitive_Error ("error reading symbol table: ~E"); } #define ADJUST(what) if (shdr.what > 0) shdr.what += delta ADJUST (cbLineOffset); ADJUST (cbDnOffset); ADJUST (cbPdOffset); ADJUST (cbSymOffset); ADJUST (cbOptOffset); ADJUST (cbAuxOffset); ADJUST (cbSsOffset); ADJUST (cbSsExtOffset); ADJUST (cbFdOffset); ADJUST (cbRfdOffset); ADJUST (cbExtOffset); if (write (ofd, (char *)&shdr, sizeof (shdr)) != sizeof (shdr)) { symwerr: Dump_Finalize; Primitive_Error ("error writing symbol table: ~E"); } while ((n = read (afd, buf, 4096)) > 0) if (write (ofd, buf, n) != n) goto symwerr; if (n < 0) goto symrerr; Dump_Epilog; } elk-3.99.8/src/dump-elf.c0000644000175000017500000002661711577076306012014 00000000000000/* dump-elf.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include #include #include #include #include #include #include #include #include /* Find section header of section with given name. */ #define FIND_SECTHDR(name,ndx) {\ char err[100];\ unsigned int _i;\ for (_i = 0; _i < ohdr->e_shnum; _i++)\ if (strcmp (sectstr+osecthdr[_i].sh_name, (name)) == 0) break;\ if (_i == ohdr->e_shnum) {\ Dump_Finalize;\ sprintf (err, "running a.out doesn't have %s section", (name));\ Primitive_Error (err);\ }\ (ndx) = _i;\ } /* Find section header of section with given name (if present, else * set to -1). */ #define FIND_SECTHDR_MAYBE(name,ndx) {\ int _i;\ for ((ndx) = -1, _i = 0; _i < ohdr->e_shnum; _i++)\ if (strcmp (sectstr+osecthdr[_i].sh_name, (name)) == 0) {\ (ndx) = _i;\ break;\ }\ } /* If a new section was inserted, adjust section index if it points behind * old .bss section */ #define UPDATE_SHNDX(ndx) if (sect_created && (ndx) >= obssndx) (ndx)++; /* Bug: the mmapped regions are never munmapped again. */ Object P_Dump (Object ofile) { /* * ELF header, section header table, program header table of running * a.out and new a.out */ Elf32_Ehdr *ohdr, *nhdr; Elf32_Shdr *osecthdr, *nsecthdr; Elf32_Phdr *oproghdr, *nproghdr; /* * .bss section index and section header pointer of running a.out */ unsigned int obssndx; Elf32_Shdr *obssp; /* * .mdebug section index */ int mdebugndx; /* * Pointers to section headers of new .bss and new .data */ Elf32_Shdr *nbssp, *ndatap; /* * Memory address, size, and file offset of newly created .data section */ Elf32_Addr ndata; Elf32_Word ndatasize; Elf32_Off ndataoff; /* * Start of .shstrtab section of running a.out */ char *sectstr; /* * Memory address of running a.out and new a.out (mmap() return value) */ char *oaddr, *naddr; struct stat st; unsigned int i; int sect_created = !Was_Dumped; Dump_Prolog; /* mmap running a.out, setup pointers to ELF header, section header * table, program header table, section names, and old .bss * XXX: call munmap later. */ if (fstat (afd, &st) == -1) { Dump_Finalize; Primitive_Error ("cannot fstat running a.out: ~E"); } oaddr = (char *)mmap ((caddr_t)0, st.st_size, PROT_READ, MAP_SHARED, afd, 0); if (oaddr == (char *)-1) { Dump_Finalize; Primitive_Error ("cannot mmap running a.out: ~E"); } ohdr = (Elf32_Ehdr *)(oaddr); osecthdr = (Elf32_Shdr *)(oaddr + ohdr->e_shoff); oproghdr = (Elf32_Phdr *)(oaddr + ohdr->e_phoff); if (ohdr->e_shstrndx == SHN_UNDEF) { Dump_Finalize; Primitive_Error ("running a.out doesn't have section names"); } sectstr = oaddr + osecthdr[ohdr->e_shstrndx].sh_offset; FIND_SECTHDR (".bss", obssndx); obssp = osecthdr+obssndx; FIND_SECTHDR_MAYBE (".mdebug", mdebugndx); /* Determine size of newly created .data section; address and file * offset are that of the old .bss section */ if ((Brk_On_Dump = sbrk (0)) == (char *)-1) { Dump_Finalize; Primitive_Error ("sbrk(0) failed: ~E"); } ndata = obssp->sh_addr; ndatasize = (Elf32_Addr)((intptr_t)Brk_On_Dump - (intptr_t)ndata); ndataoff = obssp->sh_offset; /* mmap new a.out file, setup pointers to ELF header, section header * table, and program header table * XXX: munmap missing */ st.st_size += ndatasize; if (!Was_Dumped) st.st_size += sizeof (osecthdr[0]); if (ftruncate (ofd, st.st_size) == -1) { Dump_Finalize; Primitive_Error ("cannot ftruncate new a.out: ~E"); } naddr = (char *)mmap ((caddr_t)0, st.st_size, PROT_READ|PROT_WRITE, MAP_SHARED, ofd, 0); if (naddr == (char *)-1) { Dump_Finalize; Primitive_Error ("cannot mmap new a.out: ~E"); } nhdr = (Elf32_Ehdr *)(naddr); nsecthdr = (Elf32_Shdr *)(naddr + ohdr->e_shoff + ndatasize); nproghdr = (Elf32_Phdr *)(naddr + ohdr->e_phoff); /* Copy and adjust ELF header, copy program header table */ *nhdr = *ohdr; if (!Was_Dumped) nhdr->e_shnum++; UPDATE_SHNDX (nhdr->e_shstrndx); nhdr->e_shoff += ndatasize; memcpy ((void *)nproghdr, (void *)oproghdr, ohdr->e_phnum * sizeof (oproghdr[0])); /* Scan program header table and search for a loadable segment that * ends immediately below the .bss section. Extend this segment so * that it encompasses the newly created .data section. * There must not exist any segment above the new .data. */ #define max(a,b) ((a) > (b) ? (a) : (b)) for (i = 0; i < nhdr->e_phnum; i++) { Elf32_Phdr *pp = nproghdr+i; unsigned int mask = max(pp->p_align, obssp->sh_addralign) - 1; Elf32_Addr ends_at = (pp->p_vaddr + pp->p_filesz + mask) & ~mask; Elf32_Addr bssend = (obssp->sh_addr + mask) & ~mask; #ifndef __sgi if (pp->p_vaddr + pp->p_filesz > obssp->sh_addr) { Dump_Finalize; Primitive_Error ("running a.out has segment above .bss"); } #endif if (pp->p_type == PT_LOAD && ends_at == bssend) break; } nproghdr[i].p_filesz += ndatasize; nproghdr[i].p_memsz = nproghdr[i].p_filesz; /* load entire segment */ #ifdef __sgi for (i = 0; i < nhdr->e_phnum; i++) { Elf32_Phdr *pp = nproghdr+i; if (pp->p_vaddr >= ndata) pp->p_vaddr += ndatasize - obssp->sh_size; if (pp->p_offset >= ndataoff) pp->p_offset += ndatasize; } #endif if (Was_Dumped) { /* No need to insert a new data section header. Just copy * section header table. Data segment to be adjusted must * be immediately before .bss */ memcpy ((void*)nsecthdr, (void *)osecthdr, nhdr->e_shnum * sizeof (osecthdr[0])); nbssp = nsecthdr + obssndx; ndatap = nbssp - 1; if (strcmp (sectstr+ndatap->sh_name, ".data")) { Dump_Finalize; Primitive_Error ("missing .data section in dumped a.out"); } ndatap->sh_size += ndatasize; } else { /* Copy section headers up to old .bss, then copy remaining section * headers shifted by one position to make room for new .data */ memcpy ((void *)nsecthdr, (void *)osecthdr, obssndx * sizeof (osecthdr[0])); ndatap = nsecthdr + obssndx; nbssp = ndatap + 1; memcpy ((void *)nbssp, (void *)obssp, (nhdr->e_shnum-obssndx) * sizeof (osecthdr[0])); /* Initialize section header for new .data section with values * from old .data section; set new address, size, and file offset */ FIND_SECTHDR (".data", i); ndatap[0] = osecthdr[i]; ndatap->sh_addr = ndata; ndatap->sh_size = ndatasize; ndatap->sh_offset = ndataoff; } nbssp->sh_size = 0; nbssp->sh_addr += ndatasize; /* Now copy the contents of the sections. If section is in memory * and writable, copy from memory, else copy from a.out file. * Skip sections that are inactive or occupy no space in file. * Adjust file offset of sections behind new .data section. */ Was_Dumped = 1; for (i = 1; i < nhdr->e_shnum; i++) { void *from; Elf32_Shdr *sp = nsecthdr+i; #ifdef DEBUG_DUMP printf ("%s (from %s)", sectstr+sp->sh_name, (sp->sh_flags & (SHF_ALLOC|SHF_WRITE)) == (SHF_ALLOC|SHF_WRITE) ? "memory" : "file"); (void)fflush (stdout); #endif if ((sp->sh_flags & (SHF_ALLOC|SHF_WRITE)) == (SHF_ALLOC|SHF_WRITE)) from = (void *)(intptr_t)sp->sh_addr; else from = (void *)(oaddr + sp->sh_offset); if (sp != ndatap && sp->sh_offset >= ndataoff) sp->sh_offset += ndatasize; if (sp->sh_type != SHT_NULL && sp->sh_type != SHT_NOBITS) { #ifdef DEBUG_DUMP printf (" copy from %p to %p size %x", from, naddr+sp->sh_offset, sp->sh_size); (void)fflush (stdout); #endif memcpy ((void *)(naddr + sp->sh_offset), from, sp->sh_size); } #ifdef DEBUG_DUMP printf ("\n"); #endif } /* Go through all section headers and fixup sh_link and sh_info fields * that point behind new .data section, also fixup st_shndx fields in * symbol table entries */ for (i = 1; i < nhdr->e_shnum; i++) { Elf32_Shdr *sp = nsecthdr+i; UPDATE_SHNDX (sp->sh_link); if (sp->sh_type != SHT_DYNSYM && sp->sh_type != SHT_SYMTAB) UPDATE_SHNDX (sp->sh_info); if (sp->sh_type == SHT_SYMTAB || sp->sh_type == SHT_DYNSYM) { Elf32_Sym *p = (Elf32_Sym *)(naddr + sp->sh_offset), *ep = p + sp->sh_size / sp->sh_entsize; for ( ; p < ep; p++) switch (p->st_shndx) { case SHN_UNDEF: case SHN_ABS: case SHN_COMMON: break; default: UPDATE_SHNDX (p->st_shndx); } } } #ifdef __sgi /* If the .mdebug section is located after the newly inserted section, * update the offsets. */ if (mdebugndx >= obssndx) { HDRR *mp; mdebugndx++; mp = (HDRR *)(naddr + nsecthdr[mdebugndx].sh_offset); if (mp->cbLine > 0) mp->cbLineOffset += ndatasize; if (mp->idnMax > 0) mp->cbDnOffset += ndatasize; if (mp->ipdMax > 0) mp->cbPdOffset += ndatasize; if (mp->isymMax > 0) mp->cbSymOffset += ndatasize; if (mp->ioptMax > 0) mp->cbOptOffset += ndatasize; if (mp->iauxMax > 0) mp->cbAuxOffset += ndatasize; if (mp->issMax > 0) mp->cbSsOffset += ndatasize; if (mp->issExtMax > 0) mp->cbSsExtOffset += ndatasize; if (mp->ifdMax > 0) mp->cbFdOffset += ndatasize; if (mp->crfd > 0) mp->cbRfdOffset += ndatasize; if (mp->iextMax > 0) mp->cbExtOffset += ndatasize; } #endif Dump_Epilog; } elk-3.99.8/src/Makefile.am0000644000175000017500000000216611577076306012164 00000000000000NULL = lib_LTLIBRARIES = libelk.la libelk_la_CFLAGS = @ELK_CFLAGS@ -I/usr/include/libelf libelk_la_LDFLAGS = @ELK_LDFLAGS@ libelk_la_LIBADD = @ELK_LIBS@ libelk_la_SOURCES = \ autoload.c \ bignum.c \ bool.c \ char.c \ cont.c \ cstring.c \ debug.c \ dump.c \ env.c \ error.c \ exception.c \ feature.c \ heap.c \ io.c \ libelk.c \ list.c \ load.c \ loadlib.c \ malloc.c \ math.c \ onfork.c \ prim.c \ print.c \ proc.c \ promise.c \ read.c \ special.c \ stab.c \ $(stab_elf_c) \ $(stab_vanilla_c) \ stkmem.c \ string.c \ symbol.c \ terminate.c \ type.c \ vector.c \ $(NULL) if HAVE_LIBELF stab_elf_c = stab-elf.c else stab_vanilla_c = stab-vanilla.c endif EXTRA_DIST = \ dump-ecoff.c \ dump-elf.c \ dump-hp9k.c \ dump-vanilla.c \ heap-gen.c \ heap-sc.c \ stab-bsd.c \ stab-coff.c \ stab-convex.c \ stab-ecoff.c \ stab-hp9k300.c \ stab-hp9k800.c \ stab-macho.c \ $(NULL) bin_PROGRAMS = elk elk_LDADD = $(top_builddir)/src/libelk.la elk_SOURCES = main.c install-exec-hook: rm -f "$(DESTDIR)$(bindir)/scheme-elk" ln -s elk "$(DESTDIR)$(bindir)/scheme-elk" echo-sources: ; echo $(SOURCES) elk-3.99.8/src/dump.c0000644000175000017500000000671211577076306011242 00000000000000/* dump.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "config.h" #ifdef CAN_DUMP #include #include #include #include #include "kernel.h" #ifndef O_BINARY # define O_BINARY 0 #endif extern void Check_If_Dump_Works (); extern void Flush_Output (Object); extern void Close_All_Files (); extern void Generational_GC_Finalize (); extern int errno; void Set_File_Executable (int, char *); Object Dump_Control_Point; void Init_Dump () { Dump_Control_Point = Null; Global_GC_Link (Dump_Control_Point); } #ifdef GENERATIONAL_GC # define GC_FINALIZE Generational_GC_Finalize() #else # define GC_FINALIZE #endif #define Dump_Prolog \ Object ret;\ int ofd, afd;\ char *ofn;\ GC_Node;\ \ Check_If_Dump_Works ();\ if (!EQ (Curr_Input_Port, Standard_Input_Port) ||\ !EQ (Curr_Output_Port, Standard_Output_Port))\ Primitive_Error ("cannot dump with current ports redirected");\ Flush_Output (Curr_Output_Port);\ Close_All_Files ();\ GC_FINALIZE;\ \ GC_Link (ofile);\ ret = Internal_Call_CC (1, Null);\ if (Truep (ret))\ return ret;\ GC_Unlink;\ \ Disable_Interrupts;\ \ ofn = Get_Strsym (ofile);\ if ((ofd = open (ofn, O_RDWR|O_CREAT|O_TRUNC|O_BINARY, 0666)) == -1) {\ Saved_Errno = errno;\ Primitive_Error ("cannot open ~s: ~E", ofile);\ }\ if ((afd = open (A_Out_Name, O_RDONLY|O_BINARY)) == -1) {\ Saved_Errno = errno;\ close (ofd);\ Primitive_Error ("cannot open a.out file: ~E");\ } #define Dump_Finalize Saved_Errno = errno; close (afd); close (ofd) #define Dump_Epilog {\ close (afd);\ Set_File_Executable (ofd, ofn);\ close (ofd);\ Enable_Interrupts;\ return False;\ } #if defined(HAVE_LIBELF) # include "dump-elf.c" #elif defined(ECOFF) # include "dump-ecoff.c" #elif defined(HP9K) # include "dump-hp9k.c" #else # include "dump-vanilla.c" #endif /*ARGSUSED1*/ void Set_File_Executable (int fd, char *fn) { struct stat st; if (fstat (fd, &st) != -1) { int omask = umask (0); (void)umask (omask); #ifdef FCHMOD_BROKEN (void)chmod (fn, (st.st_mode & 0777) | (0111 & ~omask)); #else (void)fchmod (fd, (st.st_mode & 0777) | (0111 & ~omask)); #endif } } #endif /* CAN_DUMP */ elk-3.99.8/src/read.c0000644000175000017500000004733511577076306011216 00000000000000/* read.c: Input functions and primitives; the Scheme reader/parser. * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "config.h" #include #include #include #if defined(HAVE_TERMIO_H) # include #elif defined(HAVE_TERMIOS_H) # include #endif #if defined(HAVE_SYS_IOCTL_H) # include #endif #if defined(HAVE_SYS_FILIO_H) # include #endif #include "kernel.h" extern void Flush_Output (Object); extern double atof(); int Skip_Comment (Object); void Reader_Error (Object, char *) elk_attribute(__noreturn__); Object Sym_Quote, Sym_Quasiquote, Sym_Unquote, Sym_Unquote_Splicing; #define Octal(c) ((c) >= '0' && (c) <= '7') static READFUN Readers[256]; static char *Read_Buf; static int Read_Size, Read_Max; #define Read_Reset() (Read_Size = 0) #define Read_Store(c) (Read_Size == Read_Max ? \ (Read_Grow(), Read_Buf[Read_Size++] = (c)) : (Read_Buf[Read_Size++] = (c))) static void Read_Grow () { Read_Max *= 2; Read_Buf = Safe_Realloc (Read_Buf, Read_Max); } Object General_Read(), Read_Sequence(), Read_Atom(), Read_Special(); Object Read_String(), Read_Sharp(), Read_True(), Read_False(), Read_Void(); Object Read_Kludge(), Read_Vector_Paren(), Read_Vector_Bracket(), Read_Radix(), Read_Char(); void Init_Read () { Define_Symbol (&Sym_Quote, "quote"); Define_Symbol (&Sym_Quasiquote, "quasiquote"); Define_Symbol (&Sym_Unquote, "unquote"); Define_Symbol (&Sym_Unquote_Splicing, "unquote-splicing"); Readers['t'] = Readers['T'] = Read_True; Readers['f'] = Readers['F'] = Read_False; Readers['v'] = Readers['V'] = Read_Void; Readers['!'] = Read_Kludge; /* for interpreter files */ Readers['('] = Read_Vector_Paren; Readers['['] = Read_Vector_Bracket; Readers['b'] = Readers['B'] = Readers['o'] = Readers['O'] = Readers['d'] = Readers['D'] = Readers['x'] = Readers['X'] = Readers['e'] = Readers['E'] = Readers['i'] = Readers['I'] = Read_Radix; Readers['\\'] = Read_Char; Read_Max = 128; Read_Buf = Safe_Malloc (Read_Max); } int String_Getc (Object port) { register struct S_Port *p; register struct S_String *s; p = PORT(port); if (p->flags & P_UNREAD) { p->flags &= ~P_UNREAD; return p->unread; } s = STRING(p->name); return p->ptr >= s->size ? EOF : s->data[p->ptr++]; } void String_Ungetc (Object port, register int c) { PORT(port)->flags |= P_UNREAD; PORT(port)->unread = c; } void Check_Input_Port (Object port) { Check_Type (port, T_Port); if (!(PORT(port)->flags & P_OPEN)) Primitive_Error ("port has been closed: ~s", port); if (!IS_INPUT(port)) Primitive_Error ("not an input port: ~s", port); } Object P_Clear_Input_Port (int argc, Object *argv) { Discard_Input (argc == 1 ? argv[0] : Curr_Input_Port); return Void; } void Discard_Input (Object port) { register FILE *f; Check_Input_Port (port); if (PORT(port)->flags & P_STRING) return; f = PORT(port)->file; #if defined(HAVE_FPURGE) (void)fpurge (f); #elif defined(HAVE_BSD_FLUSH) f->_cnt = 0; f->_ptr = f->_base; #endif #if defined(TIOCFLUSH) (void)ioctl (fileno (f), TIOCFLUSH, (char *)0); #elif defined(TCFLSH) (void)ioctl (fileno (f), TCFLSH, (char *)0); #endif } Object P_Unread_Char (int argc, Object *argv) { Object port, ch; register struct S_Port *p; ch = argv[0]; Check_Type (ch, T_Character); port = argc == 2 ? argv[1] : Curr_Input_Port; Check_Input_Port (port); p = PORT(port); if (p->flags & P_STRING) { if (p->flags & P_UNREAD) Primitive_Error ("cannot push back more than one char"); String_Ungetc (port, CHAR(ch)); } else { if (ungetc (CHAR(ch), p->file) == EOF) Primitive_Error ("failed to push back char"); } if (CHAR(ch) == '\n' && PORT(port)->lno > 1) PORT(port)->lno--; return ch; } Object P_Read_Char (int argc, Object *argv) { Object port; register FILE *f; register int c, str, flags; port = argc == 1 ? argv[0] : Curr_Input_Port; Check_Input_Port (port); f = PORT(port)->file; flags = PORT(port)->flags; str = flags & P_STRING; Reader_Getc; Reader_Tweak_Stream; return c == EOF ? Eof : Make_Char (c); } Object P_Peek_Char (int argc, Object *argv) { Object a[2]; a[0] = P_Read_Char (argc, argv); if (argc == 1) a[1] = argv[0]; return EQ(a[0], Eof) ? Eof : P_Unread_Char (argc+1, a); } /* char-ready? cannot be implemented correctly based on FILE pointers. * The following is only an approximation; even if FIONREAD is supported, * the primitive may return #f although a call to read-char would not block. */ Object P_Char_Readyp (int argc, Object *argv) { Object port; port = argc == 1 ? argv[0] : Curr_Input_Port; Check_Input_Port (port); if (PORT(port)->flags & P_STRING || feof (PORT(port)->file)) return True; #ifdef FIONREAD { long num = 0; (void)ioctl (fileno (PORT(port)->file), FIONREAD, (char *)&num); if (num != 0) return True; } #endif return False; } Object P_Read_String (int argc, Object *argv) { Object port; register FILE *f; register int c, str; port = argc == 1 ? argv[0] : Curr_Input_Port; Check_Input_Port (port); f = PORT(port)->file; str = PORT(port)->flags & P_STRING; Read_Reset (); while (1) { Reader_Getc; if (c == '\n' || c == EOF) break; Read_Store (c); } Reader_Tweak_Stream; return c == EOF ? Eof : Make_String (Read_Buf, Read_Size); } Object P_Read (int argc, Object *argv) { return General_Read (argc == 1 ? argv[0] : Curr_Input_Port, 0); } Object General_Read (Object port, int konst) { register FILE *f; register int c, str; Object ret; Check_Input_Port (port); Flush_Output (Curr_Output_Port); f = PORT(port)->file; str = PORT(port)->flags & P_STRING; while (1) { Reader_Getc; if (c == EOF) { ret = Eof; break; } if (Whitespace (c)) continue; if (c == ';') { comment: if (Skip_Comment (port) == EOF) { ret = Eof; break; } continue; } if (c == '(' || c == '[') { ret = Read_Sequence (port, 0, konst, c); } else if (c == '#') { ret = Read_Sharp (port, konst); if (TYPE(ret) == T_Special) /* it was a #! */ goto comment; } else { Reader_Ungetc; ret = Read_Atom (port, konst); } break; } Reader_Tweak_Stream; return ret; } int Skip_Comment (Object port) { register FILE *f; register int c, str; f = PORT(port)->file; str = PORT(port)->flags & P_STRING; do { Reader_Getc; } while (c != '\n' && c != EOF); return c; } Object Read_Atom (Object port, int konst) { Object ret; ret = Read_Special (port, konst); if (TYPE(ret) == T_Special) Reader_Error (port, "syntax error"); return ret; } Object Read_Special (Object port, int konst) { Object ret; register int c, str; register FILE *f; #define READ_QUOTE(sym) \ ( ret = Read_Atom (port, konst),\ konst ? (ret = Const_Cons (ret, Null), Const_Cons (sym, ret))\ : (ret = Cons (ret, Null), Cons (sym, ret))) f = PORT(port)->file; str = PORT(port)->flags & P_STRING; again: Reader_Getc; switch (c) { case EOF: eof: Reader_Tweak_Stream; Reader_Error (port, "premature end of file"); case ';': if (Skip_Comment (port) == EOF) goto eof; goto again; case ']': case ')': SET(ret, T_Special, c); return ret; case '[': case '(': return Read_Sequence (port, 0, konst, c); case '\'': return READ_QUOTE(Sym_Quote); case '`': return READ_QUOTE(Sym_Quasiquote); case ',': Reader_Getc; if (c == EOF) goto eof; if (c == '@') { return READ_QUOTE(Sym_Unquote_Splicing); } else { Reader_Ungetc; return READ_QUOTE(Sym_Unquote); } case '"': return Read_String (port, konst); case '#': ret = Read_Sharp (port, konst); if (TYPE(ret) == T_Special) goto again; return ret; default: if (Whitespace (c)) goto again; Read_Reset (); if (c == '.') { Reader_Getc; if (c == EOF) goto eof; if (Whitespace (c)) { Reader_Ungetc; SET(ret, T_Special, '.'); return ret; } Read_Store ('.'); } while (!Whitespace (c) && !Delimiter (c) && c != EOF) { if (c == '\\') { Reader_Getc; if (c == EOF) break; } Read_Store (c); Reader_Getc; } Read_Store ('\0'); if (c != EOF) Reader_Ungetc; ret = Parse_Number (port, Read_Buf, 10); if (Nullp (ret)) ret = Intern (Read_Buf); return ret; } /*NOTREACHED*/ } Object Read_Sequence (Object port, int vec, int konst, int start_chr) { Object ret, e, tail, t; GC_Node3; ret = tail = Null; GC_Link3 (ret, tail, port); while (1) { e = Read_Special (port, konst); if (TYPE(e) == T_Special) { if (CHAR(e) == ')' || CHAR(e) == ']') { if ((start_chr == '(' && CHAR(e) == ']') || (start_chr == '[' && CHAR(e) == ')')) { char buf[64]; sprintf(buf, "expression starts with '%c' but ends " "with '%c'", start_chr, CHAR(e)); Reader_Error (port, buf); } GC_Unlink; return ret; } if (vec) Reader_Error (port, "wrong syntax in vector"); if (CHAR(e) == '.') { if (Nullp (tail)) { ret = Read_Atom (port, konst); } else { e = Read_Atom (port, konst); /* * Possibly modifying pure cons. Must be fixed! */ Cdr (tail) = e; } e = Read_Special (port, konst); if (TYPE(e) == T_Special && (CHAR(e) == ')' || CHAR(e) == ']')) { GC_Unlink; return ret; } Reader_Error (port, "dot in wrong context"); } Reader_Error (port, "syntax error"); } if (konst) t = Const_Cons (e, Null); else t = Cons (e, Null); if (!Nullp (tail)) /* * Possibly modifying pure cons. Must be fixed! */ Cdr (tail) = t; else ret = t; tail = t; } /*NOTREACHED*/ } Object Read_String (Object port, int konst) { register FILE *f; register int n, c, oc, str; Read_Reset (); f = PORT(port)->file; str = PORT(port)->flags & P_STRING; while (1) { Reader_Getc; if (c == EOF) { eof: Reader_Tweak_Stream; Reader_Error (port, "end of file in string"); } if (c == '\\') { Reader_Getc; switch (c) { case EOF: goto eof; case 'b': c = '\b'; break; case 't': c = '\t'; break; case 'r': c = '\r'; break; case 'n': c = '\n'; break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': oc = n = 0; do { oc <<= 3; oc += c - '0'; Reader_Getc; if (c == EOF) goto eof; } while (Octal (c) && ++n <= 2); Reader_Ungetc; c = oc; } } else if (c == '"') break; Read_Store (c); } return General_Make_String (Read_Buf, Read_Size, konst); } Object Read_Sharp (Object port, int konst) { int c, str; FILE *f; char buf[32]; f = PORT(port)->file; str = PORT(port)->flags & P_STRING; Reader_Getc; if (c == EOF) Reader_Sharp_Eof; if (!Readers[c]) { sprintf (buf, "no reader for syntax #%c", c); Reader_Error (port, buf); } return Readers[c](port, c, konst); } /*ARGSUSED*/ Object Read_True (Object port, int chr, int konst) { return True; } /*ARGSUSED*/ Object Read_False (Object port, int chr, int konst) { return False; } /*ARGSUSED*/ Object Read_Void (Object port, int chr, int konst) { Object ret; ret = Const_Cons (Void, Null); return Const_Cons (Sym_Quote, ret); } /*ARGSUSED*/ Object Read_Kludge (Object port, int chr, int konst) { return Special; } /*ARGSUSED*/ Object Read_Vector_Paren (Object port, int chr, int konst) { return List_To_Vector (Read_Sequence (port, 1, konst, '('), konst); } /*ARGSUSED*/ Object Read_Vector_Bracket (Object port, int chr, int konst) { return List_To_Vector (Read_Sequence (port, 1, konst, '['), konst); } /*ARGSUSED*/ Object Read_Radix (Object port, int chr, int konst) { int c, str; FILE *f; Object ret; Read_Reset (); f = PORT(port)->file; str = PORT(port)->flags & P_STRING; Read_Store ('#'); Read_Store (chr); while (1) { Reader_Getc; if (c == EOF) Reader_Sharp_Eof; if (Whitespace (c) || Delimiter (c)) break; Read_Store (c); } Reader_Ungetc; Read_Store ('\0'); ret = Parse_Number (port, Read_Buf, 10); if (Nullp (ret)) Reader_Error (port, "radix not followed by a valid number"); return ret; } /*ARGSUSED*/ Object Read_Char (Object port, int chr, int konst) { int c, str; FILE *f; char buf[10], *p = buf; f = PORT(port)->file; str = PORT(port)->flags & P_STRING; Reader_Getc; if (c == EOF) Reader_Sharp_Eof; *p++ = c; while (1) { Reader_Getc; if (c == EOF) Reader_Sharp_Eof; if (Whitespace (c) || Delimiter (c)) break; if (p == buf+9) Reader_Error (port, "syntax error in character constant"); *p++ = c; } Reader_Ungetc; if (p == buf+1) return Make_Char (*buf); *p = '\0'; if (p == buf+3) { for (c = 0, p = buf; p < buf+3 && Octal (*p); p++) c = c << 3 | (*p - '0'); if (p == buf+3) return Make_Char (c); } for (p = buf; *p; p++) if (isupper (*p)) *p = tolower (*p); if (strcmp (buf, "space") == 0) return Make_Char (' '); if (strcmp (buf, "newline") == 0) return Make_Char ('\n'); if (strcmp (buf, "return") == 0) return Make_Char ('\r'); if (strcmp (buf, "tab") == 0) return Make_Char ('\t'); if (strcmp (buf, "formfeed") == 0) return Make_Char ('\f'); if (strcmp (buf, "backspace") == 0) return Make_Char ('\b'); Reader_Error (port, "syntax error in character constant"); /*NOTREACHED*/ } void Define_Reader (int c, READFUN fun) { if (Readers[c] && Readers[c] != fun) Primitive_Error ("reader for `~a' already defined", Make_Char (c)); Readers[c] = fun; } Object Parse_Number (Object port, char const *buf, int radix) { char const *p; int c, i; int mdigit = 0, edigit = 0, expo = 0, neg = 0, point = 0; int gotradix = 0, exact = 0, inexact = 0; unsigned int max; int maxdig; Object ret; for ( ; *buf == '#'; buf++) { switch (*++buf) { case 'b': case 'B': if (gotradix++) return Null; radix = 2; break; case 'o': case 'O': if (gotradix++) return Null; radix = 8; break; case 'd': case 'D': if (gotradix++) return Null; radix = 10; break; case 'x': case 'X': if (gotradix++) return Null; radix = 16; break; case 'e': case 'E': if (exact++ || inexact) return Null; break; case 'i': case 'I': if (inexact++ || exact) return Null; break; default: return Null; } } p = buf; if (*p == '+' || (neg = *p == '-')) p++; for ( ; (c = *p); p++) { if (c == '.') { if (expo || point++) return Null; } else if (radix != 16 && (c == 'e' || c == 'E')) { if (expo++) return Null; if (p[1] == '+' || p[1] == '-') p++; #ifdef HAVE_INDEX } else if (radix == 16 && !index ("0123456789abcdefABCDEF", c)) { #else } else if (radix == 16 && !strchr ("0123456789abcdefABCDEF", c)) { #endif return Null; } else if (radix < 16 && (c < '0' || c > '0' + radix-1)) { return Null; } else { if (expo) edigit++; else mdigit++; } } if (!mdigit || (expo && !edigit)) return Null; if (point || expo) { if (radix != 10) { if (Nullp (port)) return Null; Reader_Error (port, "reals must be given in decimal"); } /* Lacking ratnums, there's nothing we can do if #e has been * specified-- just return the inexact number. */ return Make_Flonum (atof (buf)); } max = (neg ? -(unsigned int)INT_MIN : INT_MAX); maxdig = max % radix; max /= radix; for (i = 0, p = buf; (c = *p); p++) { if (c == '-' || c == '+') { buf++; continue; } if (radix == 16) { if (isupper (c)) c = tolower (c); if (c >= 'a') c = '9' + c - 'a' + 1; } c -= '0'; if ((unsigned int)i > max || ((unsigned int)i == max && c > maxdig)) { ret = Make_Bignum (buf, neg, radix); return inexact ? Make_Flonum (Bignum_To_Double (ret)) : ret; } i *= radix; i += c; } if (neg) i = -i; return inexact ? Make_Flonum ((double)i) : Make_Integer (i); } void Reader_Error (Object port, char *msg) { char buf[100]; if (PORT(port)->flags & P_STRING) { sprintf (buf, "[string-port]: %u: %s", PORT(port)->lno, msg); Primitive_Error (buf); } else { sprintf (buf, "~s: %u: %s", PORT(port)->lno, msg); Primitive_Error (buf, PORT(port)->name); } } elk-3.99.8/src/heap.c0000644000175000017500000000776311577076306011221 00000000000000/* heap.c: Code that is common to both garbage collectors. * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "config.h" #include "kernel.h" int GC_In_Progress; GCNODE *GC_List; static GCNODE *Global_GC_Obj; static FUNCT *Before_GC_Funcs, *After_GC_Funcs; static Object V_Garbage_Collect_Notifyp; static Object Sym_Stop_And_Copy_GC, Sym_Generational_GC, Sym_Incremental_GC; void Init_Heap () { Define_Variable (&V_Garbage_Collect_Notifyp, "garbage-collect-notify?", False); Define_Symbol (&Sym_Stop_And_Copy_GC, "stop-and-copy"); Define_Symbol (&Sym_Generational_GC, "generational"); Define_Symbol (&Sym_Incremental_GC, "incremental"); } void Register_Before_GC (void (*f)(void)) { FUNCT *p; p = (FUNCT *)Safe_Malloc (sizeof (*p)); p->func = f; p->next = Before_GC_Funcs; Before_GC_Funcs = p; } void Call_Before_GC () { FUNCT *p; for (p = Before_GC_Funcs; p; p = p->next) p->func(); } void Register_After_GC (void (*f)(void)) { FUNCT *p; p = (FUNCT *)Safe_Malloc (sizeof (*p)); p->func = f; p->next = After_GC_Funcs; After_GC_Funcs = p; } void Call_After_GC () { FUNCT *p; for (p = After_GC_Funcs; p; p = p->next) p->func(); } void Visit_GC_List (GCNODE *list, intptr_t delta) { register GCNODE *gp, *p; register int n; register Object *vec; for (gp = list; gp; gp = p->next) { p = (GCNODE *)NORM(gp); if (p->gclen <= 0) { Visit ((Object *)NORM(p->gcobj)); } else { vec = (Object *)NORM(p->gcobj); for (n = 0; n < p->gclen-1; n++) Visit (&vec[n]); } } } void Visit_Wind (WIND *list, intptr_t delta) { register WIND *wp, *p; for (wp = list; wp; wp = p->next) { p = (WIND *)NORM(wp); Visit (&p->inout); } } void Func_Global_GC_Link (Object *x) { GCNODE *p; p = (GCNODE *)Safe_Malloc (sizeof (*p)); p->gclen = 0; p->gcobj = x; p->next = Global_GC_Obj; Global_GC_Obj = p; } #define GC_STRAT_SAC 1 #define GC_STRAT_GEN 2 #define GC_FLAGS_INCR 1 Object Internal_GC_Status(); Object P_Garbage_Collect_Status (int argc, Object* argv) { int strat = 0, flags = 0; if (argc > 0) { Check_Type (argv[0], T_Symbol); if (EQ (argv[0], Sym_Stop_And_Copy_GC)) strat = GC_STRAT_SAC; else if (EQ (argv[0], Sym_Generational_GC)) strat = GC_STRAT_GEN; else Primitive_Error ("unknown GC strategy: ~s", argv[0]); if (argc == 2) { Check_Type (argv[1], T_Symbol); if (EQ (argv[1], Sym_Incremental_GC)) flags = GC_FLAGS_INCR; else Primitive_Error ("unknown GC strategy: ~s", argv[1]); } } return Internal_GC_Status (strat, flags); } #ifdef GENERATIONAL_GC # include "heap-gen.c" #else # include "heap-sc.c" #endif elk-3.99.8/src/exception.c0000644000175000017500000000574011577076306012273 00000000000000/* exception.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "config.h" #include #include "kernel.h" extern void Reset () elk_attribute(__noreturn__); int Intr_Was_Ignored; unsigned long int Intr_Level; #if defined(HAVE_SIGPROCMASK) sigset_t Sigset_Old, Sigset_Block; #elif defined(HAVE_SIGBLOCK) int Sigmask_Old, Sigmask_Block; #endif static Object V_Interrupt_Handler; /* Make sure temp files are removed on hangup and broken pipe. */ /*ARGSUSED*/ void Signal_Exit (int sig) { Exit_Handler (); exit (1); } void Init_Exception () { Define_Variable (&V_Interrupt_Handler, "interrupt-handler", Null); #if defined(HAVE_SIGPROCMASK) sigemptyset (&Sigset_Block); sigaddset (&Sigset_Block, SIGINT); (void)sigprocmask (0, (sigset_t *)0, &Sigset_Old); #elif defined(HAVE_SIGBLOCK) Sigmask_Block = sigmask (SIGINT); Sigmask_Old = sigblock (0); #endif #ifdef SIGHUP (void)signal (SIGHUP, Signal_Exit); #endif #ifdef SIGPIPE (void)signal (SIGPIPE, Signal_Exit); #endif } /*ARGSUSED*/ void Intr_Handler (int sig) { Object fun; #if defined(HAVE_SIGPROCMASK) || ! defined(HAVE_SIGBLOCK) (void)signal (SIGINT, Intr_Handler); #endif Set_Error_Tag ("interrupt-handler"); Reset_IO (1); fun = Var_Get (V_Interrupt_Handler); if (TYPE(fun) == T_Compound && COMPOUND(fun)->min_args == 0) (void)Funcall (fun, Null, 0); Format (Curr_Output_Port, "~%\7Interrupt!~%", 15, 0, (Object *)0); Reset (); /*NOTREACHED*/ } void Install_Intr_Handler () { if (signal (SIGINT, SIG_IGN) == SIG_IGN) Intr_Was_Ignored = 1; else (void)signal (SIGINT, Intr_Handler); } Object P_Disable_Interrupts () { Disable_Interrupts; return Make_Unsigned_Long (Intr_Level); } Object P_Enable_Interrupts () { Enable_Interrupts; return Make_Unsigned_Long (Intr_Level); } elk-3.99.8/src/symbol.c0000644000175000017500000002115611577076306011601 00000000000000/* symbol.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "config.h" #include #include #include "kernel.h" int Hash (char const *, unsigned int); Object Obarray; Object Null, True, False, False2, Unbound, Special, Void, Newline, Eof, Unspecified, Zero, One; void Init_Symbol () { SET(Null, T_Null, 0); SET(True, T_Boolean, 1); SET(False, T_Boolean, 0); False2 = False; SET(Unbound, T_Unbound, 0); SET(Special, T_Special, 0); SET(Eof, T_End_Of_File, 0); SET(Unspecified, T_Unspecified, 0); Newline = Make_Char ('\n'); Zero = Make_Integer (0); One = Make_Integer (1); Obarray = Make_Vector (OBARRAY_SIZE, Null); Global_GC_Link (Obarray); Define_Symbol (&Void, ""); } Object Make_Symbol (Object name) { Object sym; register struct S_Symbol *sp; GC_Node; GC_Link (name); sym = Alloc_Object (sizeof (struct S_Symbol), T_Symbol, 0); sp = SYMBOL(sym); sp->name = name; sp->value = Unbound; sp->plist = Null; GC_Unlink; return sym; } Object P_Symbolp (Object x) { return TYPE(x) == T_Symbol ? True : False; } Object P_Symbol_To_String (Object x) { Check_Type (x, T_Symbol); return SYMBOL(x)->name; } Object Obarray_Lookup (register char const *str, register unsigned int len) { register int h; register struct S_String *s; register struct S_Symbol *sym; Object p; h = Hash (str, len) % OBARRAY_SIZE; for (p = VECTOR(Obarray)->data[h]; !Nullp (p); p = sym->next) { sym = SYMBOL(p); s = STRING(sym->name); if (s->size == len && memcmp (s->data, str, len) == 0) return p; } return Make_Integer (h); } Object CI_Intern (char const *str) { Object s, *p, sym, ostr; register unsigned int len; register char const *src; char *dst; char buf[128]; Alloca_Begin; len = strlen (str); if (len > sizeof (buf)) { Alloca (dst, char*, len); } else dst = buf; src = str; str = dst; for ( ; *src; src++, dst++) *dst = isupper (*src) ? tolower (*src) : *src; s = Obarray_Lookup (str, len); if (TYPE(s) != T_Fixnum) { Alloca_End; return s; } ostr = Make_Const_String (str, len); sym = Make_Symbol (ostr); p = &VECTOR(Obarray)->data[FIXNUM(s)]; SYMBOL(sym)->next = *p; Alloca_End; *p = sym; return sym; } Object Intern (char const *str) { Object s, *p, sym, ostr; register unsigned int len; if (Case_Insensitive) return CI_Intern (str); len = strlen (str); s = Obarray_Lookup (str, len); if (TYPE(s) != T_Fixnum) return s; ostr = Make_Const_String (str, len); sym = Make_Symbol (ostr); p = &VECTOR(Obarray)->data[FIXNUM(s)]; SYMBOL(sym)->next = *p; *p = sym; return sym; } Object P_String_To_Symbol (Object str) { Object s, *p, sym; Check_Type (str, T_String); s = Obarray_Lookup (STRING(str)->data, STRING(str)->size); if (TYPE(s) != T_Fixnum) return s; str = Make_String (STRING(str)->data, STRING(str)->size); sym = Make_Symbol (str); p = &VECTOR(Obarray)->data[FIXNUM(s)]; SYMBOL(sym)->next = *p; *p = sym; return sym; } Object P_Oblist () { register int i; Object p, list, bucket; GC_Node2; p = list = Null; GC_Link2 (p, list); for (i = 0; i < OBARRAY_SIZE; i++) { bucket = Null; for (p = VECTOR(Obarray)->data[i]; !Nullp (p); p = SYMBOL(p)->next) bucket = Cons (p, bucket); if (!Nullp (bucket)) list = Cons (bucket, list); } GC_Unlink; return list; } Object P_Put (int argc, Object *argv) { Object sym, key, last, tail, prop; GC_Node3; sym = argv[0]; key = argv[1]; Check_Type (sym, T_Symbol); Check_Type (key, T_Symbol); last = Null; for (tail = SYMBOL(sym)->plist; !Nullp (tail); tail = Cdr (tail)) { prop = Car (tail); if (EQ(Car (prop), key)) { if (argc == 3) Cdr (prop) = argv[2]; else if (Nullp (last)) SYMBOL(sym)->plist = Cdr (tail); else Cdr (last) = Cdr (tail); return key; } last = tail; } if (argc == 2) return False; GC_Link3 (sym, last, key); tail = Cons (key, argv[2]); tail = Cons (tail, Null); if (Nullp (last)) SYMBOL(sym)->plist = tail; else Cdr (last) = tail; GC_Unlink; return key; } Object P_Get (Object sym, Object key) { Object prop; Check_Type (sym, T_Symbol); Check_Type (key, T_Symbol); prop = Assq (key, SYMBOL(sym)->plist); if (!Truep (prop)) return False; /* * Do we want to signal an error or return #f? * * Primitive_Error ("~s has no such property: ~s", sym, key); */ return Cdr (prop); } Object P_Symbol_Plist (Object sym) { Check_Type (sym, T_Symbol); return Copy_List (SYMBOL(sym)->plist); } int Hash (char const *str, unsigned int len) { register int h; register char const *p, *ep; h = 5 * len; if (len > 5) len = 5; for (p = str, ep = p+len; p < ep; ++p) h = (h << 2) ^ *p; return h & 017777777777; } void Define_Symbol (Object *sym, char const *name) { *sym = Intern (name); Func_Global_GC_Link (sym); } void Define_Variable (Object *var, char const *name, Object init) { Object frame, sym; GC_Node; GC_Link (init); sym = Intern (name); SYMBOL(sym)->value = init; frame = Add_Binding (Car (The_Environment), sym, init); *var = Car (frame); Car (The_Environment) = frame; Func_Global_GC_Link (var); GC_Unlink; } Object Var_Get (Object var) { return Cdr (var); } void Var_Set (Object var, Object val) { Cdr (var) = val; SYMBOL (Car (var))->value = val; } int Var_Is_True (Object var) { var = Var_Get (var); return Truep (var); } unsigned long int Symbols_To_Bits (Object x, int mflag, SYMDESCR *stab) { register SYMDESCR *syms; register unsigned long int mask = 0; Object l, s; register char *p; register int n; if (!mflag) Check_Type (x, T_Symbol); for (l = x; !Nullp (l); l = Cdr (l)) { if (mflag) { Check_Type (l, T_Pair); x = Car (l); } Check_Type (x, T_Symbol); s = SYMBOL(x)->name; p = STRING(s)->data; n = STRING(s)->size; for (syms = stab; syms->name; syms++) if (n && strncmp (syms->name, p, n) == 0) break; if (syms->name == 0) Primitive_Error ("invalid argument: ~s", x); mask |= syms->val; if (!mflag) break; } return mask; } Object Bits_To_Symbols (unsigned long int x, int mflag, SYMDESCR *stab) { register SYMDESCR *syms; Object list, tail, cell; GC_Node2; if (mflag) { GC_Link2 (list, tail); for (list = tail = Null, syms = stab; syms->name; syms++) if ((x & syms->val) && syms->val != ~0U) { Object z; z = Intern (syms->name); cell = Cons (z, Null); if (Nullp (list)) list = cell; else P_Set_Cdr (tail, cell); tail = cell; } GC_Unlink; return list; } for (syms = stab; syms->name; syms++) if (syms->val == x) return Intern (syms->name); return Null; } elk-3.99.8/src/proc.c0000644000175000017500000004422711577076306011243 00000000000000/* proc.c: Eval, funcall, apply, map, lambda, etc. The main-loop of the * Scheme evaluator. * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "config.h" #include "kernel.h" #ifdef HAVE_ALLOCA # define MAX_ARGS_ON_STACK 4 #else # define MAX_ARGS_ON_STACK 8 #endif #define Get_Arglist_Length(_cnt, _lst, _x) \ for (_cnt = 0, _x = _lst; TYPE(_x) == T_Pair; _x = Cdr (_x), _cnt++) \ ; \ if (!Nullp(_x)) \ Primitive_Error("improper argument list"); \ #define Funcall_Switch(t,func,args,eval) \ if (t == T_Primitive) {\ return Funcall_Primitive (func, args, eval);\ } else if (t == T_Compound) {\ return Funcall_Compound (func, args, eval);\ } else if (t == T_Control_Point) {\ Funcall_Control_Point (func, args, eval);\ } else Primitive_Error ("application of non-procedure: ~s", func);\ extern void Switch_Environment (Object); extern unsigned int Stack_Size (); extern void Uncatchable_Error (char *); extern void Funcall_Control_Point (Object, Object, int) elk_attribute(__noreturn__); extern void Pop_Frame (); extern void Push_Frame (Object); /* Tail_Call indicates whether we are executing the last form in a * sequence of forms. If it is true and we are about to call a compound * procedure, we are allowed to check whether a tail-call can be * performed instead. */ int Tail_Call = 0; Object Sym_Lambda, Sym_Macro; static Object tc_fun, tc_argl, tc_env; Object Macro_Expand(), Funcall_Primitive(), Funcall_Compound(); void Init_Proc () { Define_Symbol (&Sym_Lambda, "lambda"); Define_Symbol (&Sym_Macro, "macro"); } void Check_Procedure (Object x) { register int t = TYPE(x); if (t != T_Primitive && t != T_Compound) Wrong_Type_Combination (x, "procedure"); if (t == T_Primitive && PRIM(x)->disc == NOEVAL) Primitive_Error ("invalid procedure: ~s", x); } Object P_Procedurep (Object x) { register int t = TYPE(x); return t == T_Primitive || t == T_Compound || t == T_Control_Point ? True : False; } Object P_Primitivep (Object x) { return TYPE(x) == T_Primitive ? True : False; } Object P_Primitive_To_String (Object x) { Check_Type (x, T_Primitive); return Make_String (PRIM(x)->name, strlen(PRIM(x)->name)); } Object P_Compoundp (Object x) { return TYPE(x) == T_Compound ? True : False; } Object P_Compound_To_String (Object x) { Check_Type (x, T_Compound); if (Nullp (COMPOUND(x)->name)) { static char buf[64]; sprintf (buf, "#", POINTER(x)); return Make_String (buf, strlen(buf)); } return COMPOUND(x)->name; } Object P_Macrop (Object x) { return TYPE(x) == T_Macro ? True : False; } Object P_Macro_To_String (Object x) { Check_Type (x, T_Macro); if (Nullp (MACRO(x)->name)) { static char buf[64]; sprintf (buf, "#", POINTER(x)); return Make_String (buf, strlen(buf)); } return MACRO(x)->name; } Object Make_Compound () { Object proc; proc = Alloc_Object (sizeof (struct S_Compound), T_Compound, 0); COMPOUND(proc)->closure = COMPOUND(proc)->env = COMPOUND(proc)->name = Null; return proc; } Object Make_Primitive (Object (*fun)(), char const *name, int min, int max, enum discipline disc) { Object prim; register struct S_Primitive *pr; prim = Alloc_Object (sizeof (struct S_Primitive), T_Primitive, 0); pr = PRIM(prim); pr->tag = Null; pr->fun = fun; pr->name = name; pr->minargs = min; pr->maxargs = max; pr->disc = disc; return prim; } Object Eval (Object form) { register int t; register struct S_Symbol *sym; Object fun, binding, ret; static unsigned int tick; GC_Node; TC_Prolog; again: t = TYPE(form); if (t == T_Symbol) { sym = SYMBOL(form); if (TYPE(sym->value) == T_Unbound) { binding = Lookup_Symbol (form, 1); sym->value = Cdr (binding); } ret = sym->value; if (TYPE(ret) == T_Autoload) ret = Do_Autoload (form, ret); return ret; } if (t != T_Pair) { if (t == T_Null) Primitive_Error ("no subexpression in procedure call"); if (t == T_Vector) Primitive_Error ("unevaluable object: ~s", form); return form; } if ((tick++ & 7) == 0) if (Stack_Size () > Max_Stack) Uncatchable_Error ("Out of stack space"); /* * Avoid recursive Eval() for the most common case: */ fun = Car (form); if (TYPE(fun) != T_Symbol || (fun = SYMBOL(fun)->value, TYPE(fun) == T_Unbound) || TYPE(fun) == T_Autoload) { GC_Link (form); TC_Disable; fun = Eval (Car (form)); TC_Enable; GC_Unlink; } form = Cdr (form); t = TYPE(fun); if (t == T_Macro) { form = Macro_Expand (fun, form); goto again; } Funcall_Switch (t, fun, form, 1); /*NOTREACHED*/ } Object P_Eval (int argc, Object *argv) { Object ret, oldenv; GC_Node; if (argc == 1) return Eval (argv[0]); Check_Type (argv[1], T_Environment); oldenv = The_Environment; GC_Link (oldenv); Switch_Environment (argv[1]); ret = Eval (argv[0]); Switch_Environment (oldenv); GC_Unlink; return ret; } Object P_Apply (int argc, Object *argv) { Object ret, list, tail, cell, last; register int i; GC_Node3; Check_Procedure (argv[0]); /* Make a list of all args but the last, then append the * last arg (which must be a proper list) to this list. */ list = tail = last = Null; GC_Link3 (list, tail, last); for (i = 1; i < argc-1; i++, tail = cell) { cell = Cons (argv[i], Null); if (Nullp (list)) list = cell; else (void)P_Set_Cdr (tail, cell); } for (last = argv[argc-1]; !Nullp (last); last = Cdr (last), tail = cell) { cell = Cons (P_Car (last), Null); if (Nullp (list)) list = cell; else (void)P_Set_Cdr (tail, cell); } ret = Funcall (argv[0], list, 0); GC_Unlink; return ret; } Object Funcall_Primitive (Object fun, Object argl, int eval) { register struct S_Primitive *prim; register int argc, i; char const *last_tag; register Object *argv = NULL; Object abuf[MAX_ARGS_ON_STACK], r, e; GC_Node4; GCNODE gcv; TC_Prolog; Alloca_Begin; prim = PRIM(fun); last_tag = Error_Tag; /* avoid function calls here */ Error_Tag = prim->name; Get_Arglist_Length (argc, argl, r); /* r is temporary variable */ if (argc < prim->minargs || (prim->maxargs != MANY && argc > prim->maxargs)) Primitive_Error ("wrong number of arguments"); e = The_Environment; GC_Link4_Tag_Primitive (argl, fun, e, r); if (prim->disc == NOEVAL) { r = (prim->fun)(argl); } else { TC_Disable; /* * Skip the loop if argc==0 or argc==1 (special case below). */ if (prim->disc != EVAL || argc >= 2) { if (argc <= MAX_ARGS_ON_STACK) argv = abuf; else Alloca (argv, Object*, argc * sizeof (Object)); gcv.gclen = 1; gcv.gcobj = argv; gcv.next = &gc4; GC_List = &gcv; for (r = argl, i = 0; i < argc; i++, r = Cdr (r)) { argv[i] = eval ? Eval (Car (r)) : Car (r); gcv.gclen++; } TC_Enable; prim = PRIM(fun); /* fun has possibly been moved during gc */ } if (prim->disc == VARARGS) { Object (*varfun) (int, Object *); varfun = (Object (*) (int, Object *))prim->fun; r = varfun(argc, argv); } else { switch (argc) { case 0: { Object (*myfun) (void); myfun = (Object (*) (void))prim->fun; r = myfun(); break; } case 1: TC_Disable; r = eval ? Eval (Car (argl)) : Car (argl); TC_Enable; r = (PRIM(fun)->fun)(r); break; case 2: r = (prim->fun)(argv[0], argv[1]); break; case 3: r = (prim->fun)(argv[0], argv[1], argv[2]); break; case 4: r = (prim->fun)(argv[0], argv[1], argv[2], argv[3]); break; case 5: r = (prim->fun)(argv[0], argv[1], argv[2], argv[3], argv[4]); break; case 6: r = (prim->fun)(argv[0], argv[1], argv[2], argv[3], argv[4], argv[5]); break; case 7: r = (prim->fun)(argv[0], argv[1], argv[2], argv[3], argv[4], argv[5], argv[6]); break; case 8: r = (prim->fun)(argv[0], argv[1], argv[2], argv[3], argv[4], argv[5], argv[6], argv[7]); break; case 9: r = (prim->fun)(argv[0], argv[1], argv[2], argv[3], argv[4], argv[5], argv[6], argv[7], argv[8]); break; case 10: r = (prim->fun)(argv[0], argv[1], argv[2], argv[3], argv[4], argv[5], argv[6], argv[7], argv[8], argv[9]); break; default: Panic ("too many args for primitive"); } } Alloca_End; } GC_Unlink; Error_Tag = last_tag; return r; } /* This macro is used by Funcall_Compound() below. Note that * if we are in a tail recursion, we are reusing the old procedure * frame; we just assign new values to the formal parameters. * Add_Binding() has been inlined here for speed. r is used as * a temporary variable. */ #define Lambda_Bind(var,val) {\ r = Cons (var, val);\ if (tail_calling)\ newframe = Cons (r, newframe);\ else\ frame = Cons (r, frame);\ } Object Funcall_Compound (Object fun, Object argl, int eval) { register int argc, min, max, i, tail_calling = 0; register Object *argv = NULL; Object abuf[MAX_ARGS_ON_STACK], rest, r, frame, tail, tail_call_env, oldenv, newframe; register GCNODE *p; GC_Node7; GCNODE gcv; Alloca_Begin; if (Tail_Call && eval) { for (p = GC_List; p && p->gclen != TAG_FUN; p = p->next) { if (p->gclen == TAG_TCFUN && EQ(*(p->gcobj), fun)) { SET(r, T_Special, 0); tc_fun = fun; tc_argl = argl; tc_env = The_Environment; return r; } } } r = frame = tail = newframe = Null; oldenv = The_Environment; GC_Link7_Tag_Compound (argl, fun, oldenv, frame, tail, newframe, r); again: Get_Arglist_Length (argc, argl, r); /* r is temporary variable here */ min = COMPOUND(fun)->min_args; max = COMPOUND(fun)->max_args; if (argc < min) Primitive_Error ("too few arguments for ~s", fun); if (max >= 0 && argc > max) Primitive_Error ("too many arguments for ~s", fun); if (tail_calling) { tail = The_Environment; Switch_Environment (tail_call_env); } else { if (argc <= MAX_ARGS_ON_STACK) argv = abuf; else Alloca (argv, Object*, argc * sizeof (Object)); } Tail_Call = 0; gcv.gclen = 1; gcv.gcobj = argv; gcv.next = &gc7; GC_List = &gcv; for (r = argl, i = 0; i < argc; i++, r = Cdr (r)) { argv[i] = eval ? Eval (Car (r)) : Car (r); gcv.gclen++; } if (tail_calling) Switch_Environment (tail); tail = Car (Cdr (COMPOUND(fun)->closure)); for (i = 0; i < min; i++, tail = Cdr (tail)) Lambda_Bind (Car (tail), argv[i]); if (max == -1) { rest = P_List (argc-i, argv+i); Lambda_Bind (tail, rest); } if (tail_calling) { Pop_Frame (); Push_Frame (newframe); } else { Switch_Environment (COMPOUND(fun)->env); Push_Frame (frame); } tail = Cdr (Cdr (COMPOUND(fun)->closure)); for (i = COMPOUND(fun)->numforms; i > 1; i--, tail = Cdr (tail)) (void)Eval (Car (tail)); Tail_Call = 1; r = Eval (Car (tail)); /* * If evaluation of the function body returned a T_Special object, * a tail-call has been taken place. If it is a tail-call to a * different function, just return, otherwise unpack new arguments * and environment and jump to the beginning. */ if (TYPE(r) == T_Special && EQ(fun, tc_fun)) { argl = tc_argl; tail_call_env = tc_env; tail_calling = 1; eval = 1; newframe = Null; goto again; } Tail_Call = 0; Pop_Frame (); Switch_Environment (oldenv); GC_Unlink; Alloca_End; return r; } Object Funcall (Object fun, Object argl, int eval) { register int t = TYPE(fun); Funcall_Switch (t, fun, argl, eval); /*NOTREACHED*/ } void Check_Formals (Object x, int *min, int *max) { Object s, t1, t2; *min = *max = 0; for (t1 = Car (x); !Nullp (t1); t1 = Cdr (t1)) { s = TYPE(t1) == T_Pair ? Car (t1) : t1; Check_Type (s, T_Symbol); for (t2 = Car (x); !EQ(t2, t1); t2 = Cdr (t2)) if (EQ(s, Car (t2))) Primitive_Error ("~s: duplicate variable binding", s); if (TYPE(t1) != T_Pair) break; (*min)++; (*max)++; } if (TYPE(t1) == T_Symbol) *max = -1; else if (!Nullp (t1)) Wrong_Type_Combination (t1, "list or symbol"); } Object P_Lambda (Object argl) { Object proc, closure; GC_Node2; proc = Null; GC_Link2 (argl, proc); proc = Make_Compound (); closure = Cons (Sym_Lambda, argl); COMPOUND(proc)->closure = closure; COMPOUND(proc)->env = The_Environment; COMPOUND(proc)->numforms = Fast_Length (Cdr (argl)); Check_Formals (argl, &COMPOUND(proc)->min_args, &COMPOUND(proc)->max_args); GC_Unlink; return proc; } Object P_Procedure_Lambda (Object p) { Check_Type (p, T_Compound); return Copy_List (COMPOUND(p)->closure); } Object P_Procedure_Environment (Object p) { Check_Type (p, T_Compound); return COMPOUND(p)->env; } Object General_Map (int argc, Object *argv, register int accum) { register int i; Object *args; Object head, list, tail, cell, arglist, val; GC_Node2; GCNODE gcv; TC_Prolog; Alloca_Begin; Check_Procedure (argv[0]); Alloca (args, Object*, (argc-1) * sizeof (Object)); list = tail = Null; GC_Link2 (list, tail); gcv.gclen = argc; gcv.gcobj = args; gcv.next = &gc2; GC_List = &gcv; while (1) { for (i = 1; i < argc; i++) { head = argv[i]; if (Nullp (head)) { GC_Unlink; Alloca_End; return list; } Check_Type (head, T_Pair); args[i-1] = Car (head); argv[i] = Cdr (head); } arglist = P_List (argc-1, args); TC_Disable; val = Funcall (argv[0], arglist, 0); TC_Enable; if (!accum) continue; cell = Cons (val, Null); if (Nullp (list)) list = cell; else (void)P_Set_Cdr (tail, cell); tail = cell; } /*NOTREACHED*/ } Object P_Map (int argc, Object *argv) { return General_Map (argc, argv, 1); } Object P_For_Each (int argc, Object *argv) { return General_Map (argc, argv, 0); } Object Make_Macro () { Object mac; mac = Alloc_Object (sizeof (struct S_Macro), T_Macro, 0); MACRO(mac)->body = MACRO(mac)->name = Null; return mac; } Object P_Macro (Object argl) { Object mac, body; GC_Node2; mac = Null; GC_Link2 (argl, mac); mac = Make_Macro (); body = Cons (Sym_Macro, argl); MACRO(mac)->body = body; Check_Formals (argl, &MACRO(mac)->min_args, &MACRO(mac)->max_args); GC_Unlink; return mac; } Object P_Macro_Body (Object m) { Check_Type (m, T_Macro); return Copy_List (MACRO(m)->body); } Object Macro_Expand (Object mac, Object argl) { register int argc, min, max, i; Object frame, r, tail; GC_Node4; TC_Prolog; frame = tail = Null; GC_Link4 (argl, frame, tail, mac); Get_Arglist_Length (argc, argl, r); min = MACRO(mac)->min_args; max = MACRO(mac)->max_args; if (argc < min) Primitive_Error ("too few arguments for ~s", mac); if (max >= 0 && argc > max) Primitive_Error ("too many arguments for ~s", mac); tail = Car (Cdr (MACRO(mac)->body)); for (i = 0; i < min; i++, tail = Cdr (tail), argl = Cdr (argl)) frame = Add_Binding (frame, Car (tail), Car (argl)); if (max == -1) frame = Add_Binding (frame, tail, argl); Push_Frame (frame); TC_Disable; r = Begin (Cdr (Cdr (MACRO(mac)->body))); TC_Enable; Pop_Frame (); GC_Unlink; return r; } Object P_Macro_Expand (Object form) { Object ret, mac; GC_Node; Check_Type (form, T_Pair); GC_Link (form); mac = Eval (Car (form)); if (TYPE(mac) != T_Macro) ret = form; else ret = Macro_Expand (mac, Cdr (form)); GC_Unlink; return ret; } elk-3.99.8/src/math.c0000644000175000017500000007222711577076306011232 00000000000000/* math.c: Generic math functions. * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include "kernel.h" extern int Bignum_To_Integer (Object); Object Generic_Multiply(), Generic_Divide(); void Init_Math () { #ifdef HAVE_RANDOM srandom (getpid ()); #else srand (getpid ()); #endif } Object Make_Integer (register int n) { Object num; SET(num, T_Fixnum, n); return num; } Object Make_Unsigned (register unsigned int n) { if (UFIXNUM_FITS(n)) return Make_Integer (n); else return Unsigned_To_Bignum (n); } Object Make_Long (register long int n) { if (n < 0 ? (n < (long)INT_MIN) : (n > (long)INT_MAX)) return Long_To_Bignum (n); else return Make_Integer ((int)n); } Object Make_Unsigned_Long (register unsigned long int n) { if ((n & ~((unsigned long int)SIGNBIT-1)) == 0) return Make_Integer ((int)n); else return Unsigned_Long_To_Bignum (n); } Object Fixnum_To_String (Object x, int radix) { char buf[32]; register char *p; register int n = FIXNUM(x), neg = 0; if (n == 0) return Make_String ("0", 1); if (n < 0) { neg++; n = -n; } p = buf+31; *p = '\0'; while (n > 0) { *--p = '0' + n % radix; if (*p > '9') *p = 'A' + (*p - '9') - 1; n /= radix; } if (neg) *--p = '-'; return Make_String (p, strlen (p)); } char *Flonum_To_String (Object x) { static char buf[64]; char *p; sprintf (buf, "%.31g", FLONUM(x)->val); for (p = buf; *p; p++) if (*p == '.' || *p == 'e' || *p == 'N' || *p == 'i') return buf; *p++ = '.', *p++ = '0', *p++ = '\0'; return buf; } Object P_Number_To_String (int argc, Object *argv) { int radix = 10; Object x; char *s; x = argv[0]; if (argc == 2) { radix = Get_Exact_Integer (argv[1]); switch (radix) { case 2: case 8: case 10: case 16: break; default: Primitive_Error ("invalid radix: ~s", argv[1]); } } Check_Number (x); switch (TYPE(x)) { case T_Fixnum: return Fixnum_To_String (x, radix); case T_Bignum: return Bignum_To_String (x, radix); case T_Flonum: if (radix != 10) Primitive_Error ("radix for reals must be 10"); /* bleah! */ s = Flonum_To_String (x); return Make_String (s, strlen (s)); default: /* Just to avoid compiler warnings */ return Null; } /*NOTREACHED*/ } int Get_Integer (Object x) { double d; int expo; switch (TYPE(x)) { case T_Fixnum: return FIXNUM(x); case T_Bignum: return Bignum_To_Integer (x); case T_Flonum: d = FLONUM(x)->val; if (d != floor (d)) Wrong_Type (x, T_Fixnum); (void)frexp (d, &expo); if (expo <= 8 * (int)sizeof(int) - 1) return d; Primitive_Error ("integer out of range: ~s", x); default: Wrong_Type (x, T_Fixnum); } /*NOTREACHED*/ } unsigned int Get_Unsigned (Object x) { double d; int expo; switch (TYPE(x)) { case T_Fixnum: if (FIXNUM(x) < 0) goto err; return FIXNUM(x); case T_Bignum: return Bignum_To_Unsigned (x); case T_Flonum: d = FLONUM(x)->val; if (d < 0) goto err; if (d != floor (d)) Wrong_Type (x, T_Fixnum); (void)frexp (d, &expo); if (expo <= 8 * (int)sizeof(int)) return d; err: Primitive_Error ("integer out of range: ~s", x); default: Wrong_Type (x, T_Fixnum); } /*NOTREACHED*/ } long int Get_Long (Object x) { double d; int expo; switch (TYPE(x)) { case T_Fixnum: return FIXNUM(x); case T_Bignum: return Bignum_To_Long (x); case T_Flonum: d = FLONUM(x)->val; if (d != floor (d)) Wrong_Type (x, T_Fixnum); (void)frexp (d, &expo); if (expo <= 8 * (int)sizeof(long) - 1) return d; Primitive_Error ("integer out of range: ~s", x); default: Wrong_Type (x, T_Fixnum); } /*NOTREACHED*/ } unsigned long int Get_Unsigned_Long (Object x) { double d; int expo; switch (TYPE(x)) { case T_Fixnum: if (FIXNUM(x) < 0) goto err; return (unsigned long int)FIXNUM(x); case T_Bignum: return Bignum_To_Unsigned_Long (x); case T_Flonum: d = FLONUM(x)->val; if (d < 0) goto err; if (d != floor (d)) Wrong_Type (x, T_Fixnum); (void)frexp (d, &expo); if (expo <= 8 * (int)sizeof(long)) return d; err: Primitive_Error ("integer out of range: ~s", x); default: Wrong_Type (x, T_Fixnum); } /*NOTREACHED*/ } int Get_Exact_Integer (Object x) { switch (TYPE(x)) { case T_Fixnum: return FIXNUM(x); case T_Bignum: return Bignum_To_Integer (x); default: Wrong_Type (x, T_Fixnum); } /*NOTREACHED*/ } unsigned int Get_Exact_Unsigned (Object x) { switch (TYPE(x)) { case T_Fixnum: if (FIXNUM(x) < 0) Primitive_Error ("integer out of range: ~s", x); return FIXNUM(x); case T_Bignum: return Bignum_To_Unsigned (x); default: Wrong_Type (x, T_Fixnum); } /*NOTREACHED*/ } long int Get_Exact_Long (Object x) { switch (TYPE(x)) { case T_Fixnum: return FIXNUM(x); case T_Bignum: return Bignum_To_Long (x); default: Wrong_Type (x, T_Fixnum); } /*NOTREACHED*/ } unsigned long int Get_Exact_Unsigned_Long (Object x) { switch (TYPE(x)) { case T_Fixnum: if (FIXNUM(x) < 0) Primitive_Error ("integer out of range: ~s", x); return FIXNUM(x); case T_Bignum: return Bignum_To_Unsigned_Long (x); default: Wrong_Type (x, T_Fixnum); } /*NOTREACHED*/ } int Get_Index (Object n, Object obj) { register int size, i; i = Get_Exact_Integer (n); size = TYPE(obj) == T_Vector ? VECTOR(obj)->size : STRING(obj)->size; if (i < 0 || i >= size) Range_Error (n); return i; } Object Make_Flonum (double d) { Object num; num = Alloc_Object (sizeof (struct S_Flonum), T_Flonum, 0); FLONUM(num)->tag = Null; FLONUM(num)->val = d; return num; } Object Make_Reduced_Flonum (double d) { Object num; int expo; if (floor (d) == d) { if (d == 0) return Zero; (void)frexp (d, &expo); if (expo <= FIXBITS-1) return Make_Integer ((int)d); } num = Alloc_Object (sizeof (struct S_Flonum), T_Flonum, 0); FLONUM(num)->tag = Null; FLONUM(num)->val = d; return num; } int Fixnum_Add (int a, int b, int *fits) { int ret = a + b; *fits = 1; if (a > 0 && b > 0) { if (ret < 0) *fits = 0; } else if (a < 0 && b < 0) { if (ret > 0) *fits = 0; } return ret; } int Fixnum_Sub (int a, int b, int *fits) { int ret = a - b; *fits = 1; if (a < 0 && b > 0) { if (ret > 0) *fits = 0; } else if (a > 0 && b < 0) { if (ret < 0) *fits = 0; } return ret; } /* This function assumes 32bit integers. This doesn't really matter, * because if the `*' primitive resorts to bignum multiplication, the * resulting bignum gets reduced to a fixnum (if it fits) anyway. * (This should be fixed, though...) */ Object Fixnum_Multiply (int a, int b) { register unsigned int aa = a; register unsigned int ab = b; register unsigned int prod, prod2; register int sign = 1; if (a < 0) { aa = -a; sign = -1; } if (b < 0) { ab = -b; sign = -sign; } prod = (aa & 0xFFFF) * (ab & 0xFFFF); if (aa & 0xFFFF0000) { if (ab & 0xFFFF0000) return Null; prod2 = (aa >> 16) * ab; } else { prod2 = aa * (ab >> 16); } prod2 += prod >> 16; prod &= 0xFFFF; if (prod2 > (1 << (FIXBITS - 1 - 16)) - 1) { if (sign == 1 || prod2 != (1 << (FIXBITS - 1 - 16)) || prod != 0) return Null; return Make_Integer (-(unsigned int)SIGNBIT); } prod += prod2 << 16; if (sign == -1) prod = - prod; return Make_Integer (prod); } Object P_Integerp (Object x) { double d; switch (TYPE(x)) { case T_Fixnum: case T_Bignum: return True; case T_Flonum: d = FLONUM(x)->val; return d == floor(d) ? True : False; } return False; } Object P_Rationalp (Object x) { return P_Integerp (x); } Object P_Realp (Object x) { register int t = TYPE(x); return t == T_Flonum || t == T_Fixnum || t == T_Bignum ? True : False; } Object P_Complexp (Object x) { return P_Realp (x); } Object P_Numberp (Object x) { return P_Complexp (x); } Object P_Exactp (Object n) { Check_Number (n); return TYPE(n) == T_Flonum ? False : True; } Object P_Inexactp (Object n) { Check_Number (n); return TYPE(n) == T_Flonum ? True : False; } Object P_Exact_To_Inexact (Object n) { Check_Number (n); switch (TYPE(n)) { case T_Fixnum: return Make_Flonum ((double)FIXNUM(n)); case T_Flonum: return n; case T_Bignum: return Make_Flonum (Bignum_To_Double (n)); default: /* Just to avoid compiler warnings */ return Null; } /*NOTREACHED*/ } Object P_Inexact_To_Exact (Object n) { double d; int i; Check_Number (n); switch (TYPE(n)) { case T_Fixnum: case T_Bignum: return n; case T_Flonum: d = floor (FLONUM(n)->val + 0.5); (void)frexp (d, &i); return (i <= FIXBITS-1) ? Make_Integer ((int)d) : Double_To_Bignum (d); default: /* Just to avoid compiler warnings */ return Null; } /*NOTREACHED*/ } #define General_Generic_Predicate(prim,op,bigop)\ Object prim (Object x) {\ register int ret;\ Check_Number (x);\ switch (TYPE(x)) {\ case T_Flonum:\ ret = FLONUM(x)->val op 0; break;\ case T_Fixnum:\ ret = FIXNUM(x) op 0; break;\ case T_Bignum:\ ret = bigop (x); break;\ default: /* Just to avoid compiler warnings */\ return False;\ }\ return ret ? True : False;\ } General_Generic_Predicate (P_Zerop, ==, Bignum_Zero) General_Generic_Predicate (P_Negativep, <, Bignum_Negative) General_Generic_Predicate (P_Positivep, >, Bignum_Positive) Object P_Evenp (Object x) { register int ret; double d; switch (TYPE(x)) { case T_Fixnum: ret = !(FIXNUM(x) & 1); break; case T_Bignum: ret = Bignum_Even (x); break; case T_Flonum: d = FLONUM(x)->val; if (floor (d) == d) { d /= 2; ret = floor (d) == d; break; } /*FALLTHROUGH*/ default: Wrong_Type (x, T_Fixnum); /*NOTREACHED*/ } return ret ? True : False; } Object P_Oddp (Object x) { Object tmp; tmp = P_Evenp (x); return EQ(tmp,True) ? False : True; } #define General_Generic_Compare(name,op)\ int Generic_##name (Object x, Object y) {\ Object b; register int ret;\ GC_Node;\ \ switch (TYPE(x)) {\ case T_Fixnum:\ switch (TYPE(y)) {\ case T_Fixnum:\ return FIXNUM(x) op FIXNUM(y);\ case T_Flonum:\ return FIXNUM(x) op FLONUM(y)->val;\ case T_Bignum:\ GC_Link (y);\ b = Integer_To_Bignum (FIXNUM(x));\ ret = Bignum_##name (b, y);\ GC_Unlink;\ return ret;\ default: /* Just to avoid compiler warnings */\ return 0;\ }\ case T_Flonum:\ switch (TYPE(y)) {\ case T_Fixnum:\ return FLONUM(x)->val op FIXNUM(y);\ case T_Flonum:\ return FLONUM(x)->val op FLONUM(y)->val;\ case T_Bignum:\ GC_Link(y);\ b = Double_To_Bignum(FLONUM(x)->val);\ ret = Bignum_##name (b, y);\ GC_Unlink;\ return ret;\ /*return FLONUM(x)->val op Bignum_To_Double (y);*/\ default: /* Just to avoid compiler warnings */\ return 0;\ }\ case T_Bignum:\ switch (TYPE(y)) {\ case T_Fixnum:\ GC_Link (x);\ b = Integer_To_Bignum (FIXNUM(y));\ ret = Bignum_##name (x, b);\ GC_Unlink;\ return ret;\ case T_Flonum:\ GC_Link(x);\ b = Double_To_Bignum(FLONUM(y)->val);\ ret = Bignum_##name (x, b);\ GC_Unlink;\ return ret;\ /*return Bignum_To_Double (x) op FLONUM(y)->val;*/\ case T_Bignum:\ return Bignum_##name (x, y);\ default: /* Just to avoid compiler warnings */\ return 0;\ }\ default: /* Just to avoid compiler warnings */\ return 0;\ }\ /*NOTREACHED*/ /* ...but lint never sees it */\ } General_Generic_Compare (Equal, ==) General_Generic_Compare (Less, <) General_Generic_Compare (Greater, >) General_Generic_Compare (Eq_Less, <=) General_Generic_Compare (Eq_Greater, >=) Object General_Compare (int argc, Object *argv, register int (*op)()) { register int i; Check_Number (argv[0]); for (i = 1; i < argc; i++) { Check_Number (argv[i]); if (!(*op) (argv[i-1], argv[i])) return False; } return True; } Object P_Generic_Equal (int argc, Object *argv) { return General_Compare (argc, argv, Generic_Equal); } Object P_Generic_Less (int argc, Object *argv) { return General_Compare (argc, argv, Generic_Less); } Object P_Generic_Greater (int argc, Object *argv) { return General_Compare (argc, argv, Generic_Greater); } Object P_Generic_Eq_Less (int argc, Object *argv) { return General_Compare (argc, argv, Generic_Eq_Less); } Object P_Generic_Eq_Greater (int argc, Object *argv) { return General_Compare (argc, argv, Generic_Eq_Greater); } #define General_Generic_Operator(name,op,fixop,bigop) Object name (Object x,\ Object y) {\ Object b1, b2, ret; register int i;\ int fits;\ GC_Node2;\ \ switch (TYPE(x)) {\ case T_Fixnum:\ switch (TYPE(y)) {\ case T_Fixnum:\ i = fixop (FIXNUM(x), FIXNUM(y), &fits);\ if (fits)\ return Make_Integer (i);\ b1 = b2 = Null;\ GC_Link2 (b1, b2);\ b1 = Integer_To_Bignum (FIXNUM(x));\ b2 = Integer_To_Bignum (FIXNUM(y));\ ret = bigop (b1, b2);\ GC_Unlink;\ return ret;\ case T_Flonum:\ return Make_Flonum (FIXNUM(x) op FLONUM(y)->val);\ case T_Bignum:\ GC_Link (y);\ b1 = Integer_To_Bignum (FIXNUM(x));\ ret = bigop (b1, y);\ GC_Unlink;\ return ret;\ default: /* Just to avoid compiler warnings */\ return False;\ }\ case T_Flonum:\ switch (TYPE(y)) {\ case T_Fixnum:\ return Make_Flonum (FLONUM(x)->val op FIXNUM(y));\ case T_Flonum:\ return Make_Flonum (FLONUM(x)->val op FLONUM(y)->val);\ case T_Bignum:\ return Make_Flonum (FLONUM(x)->val op Bignum_To_Double (y));\ default: /* Just to avoid compiler warnings */\ return False;\ }\ case T_Bignum:\ switch (TYPE(y)) {\ case T_Fixnum:\ GC_Link (x);\ b1 = Integer_To_Bignum (FIXNUM(y));\ ret = bigop (x, b1);\ GC_Unlink;\ return ret;\ case T_Flonum:\ return Make_Flonum (Bignum_To_Double (x) op FLONUM(y)->val);\ case T_Bignum:\ return bigop (x, y);\ default: /* Just to avoid compiler warnings */\ return False;\ }\ default: /* Just to avoid compiler warnings */\ return False;\ }\ /*NOTREACHED*/ /* ...but lint never sees it */\ } General_Generic_Operator (Generic_Plus, +, Fixnum_Add, Bignum_Plus) General_Generic_Operator (Generic_Minus, -, Fixnum_Sub, Bignum_Minus) Object P_Inc (Object x) { Check_Number (x); return Generic_Plus (x, One); } Object P_Dec (Object x) { Check_Number (x); return Generic_Minus (x, One); } Object General_Operator (int argc, Object *argv, Object start, register Object (*op)()) { register int i; Object accum; if (argc > 0) Check_Number (argv[0]); accum = start; switch (argc) { case 0: break; case 1: accum = (*op) (accum, argv[0]); break; default: for (accum = argv[0], i = 1; i < argc; i++) { Check_Number (argv[i]); accum = (*op) (accum, argv[i]); } } return accum; } Object P_Generic_Plus (int argc, Object *argv) { return General_Operator (argc, argv, Zero, Generic_Plus); } Object P_Generic_Minus (int argc, Object *argv) { return General_Operator (argc, argv, Zero, Generic_Minus); } Object P_Generic_Multiply (int argc, Object *argv) { return General_Operator (argc, argv, One, Generic_Multiply); } Object P_Generic_Divide (int argc, Object *argv) { return General_Operator (argc, argv, One, Generic_Divide); } Object Generic_Multiply (Object x, Object y) { Object b, ret; switch (TYPE(x)) { case T_Fixnum: if(FIXNUM(x) == 0) return Zero; switch (TYPE(y)) { case T_Fixnum: ret = Fixnum_Multiply (FIXNUM(x), FIXNUM(y)); if (Nullp (ret)) { b = Integer_To_Bignum (FIXNUM(x)); return Bignum_Fixnum_Multiply (b, y); } return ret; case T_Flonum: return Make_Flonum (FIXNUM(x) * FLONUM(y)->val); case T_Bignum: return Bignum_Fixnum_Multiply (y, x); default: /* Just to avoid compiler warnings */ return Null; } case T_Flonum: switch (TYPE(y)) { case T_Fixnum: if(FIXNUM(y) == 0) return Zero; return Make_Flonum (FLONUM(x)->val * FIXNUM(y)); case T_Flonum: return Make_Flonum (FLONUM(x)->val * FLONUM(y)->val); case T_Bignum: return Make_Flonum (FLONUM(x)->val * Bignum_To_Double (y)); default: /* Just to avoid compiler warnings */ return Null; } case T_Bignum: switch (TYPE(y)) { case T_Fixnum: if(FIXNUM(y) == 0) return Zero; return Bignum_Fixnum_Multiply (x, y); case T_Flonum: return Make_Flonum (Bignum_To_Double (x) * FLONUM(y)->val); case T_Bignum: return Bignum_Multiply (x, y); default: /* Just to avoid compiler warnings */ return Null; } default: /* Just to avoid compiler warnings */ return Null; } /*NOTREACHED*/ } Object Generic_Divide (Object x, Object y) { register int t = TYPE(y); Object b, ret; GC_Node2; if (t == T_Fixnum ? FIXNUM(y) == 0 : (t == T_Flonum ? FLONUM(y) == 0 : Bignum_Zero (y))) Range_Error (y); switch (TYPE(x)) { case T_Fixnum: switch (t) { case T_Fixnum: return Make_Reduced_Flonum ((double)FIXNUM(x) / (double)FIXNUM(y)); case T_Flonum: return Make_Flonum ((double)FIXNUM(x) / FLONUM(y)->val); case T_Bignum: GC_Link (y); b = Integer_To_Bignum (FIXNUM(x)); ret = Bignum_Divide (b, y); GC_Unlink; if (EQ(Cdr (ret),Zero)) return Car (ret); return Make_Reduced_Flonum ((double)FIXNUM(x) / Bignum_To_Double (y)); default: /* Just to avoid compiler warnings */ return Null; } case T_Flonum: switch (t) { case T_Fixnum: return Make_Flonum (FLONUM(x)->val / (double)FIXNUM(y)); case T_Flonum: return Make_Flonum (FLONUM(x)->val / FLONUM(y)->val); case T_Bignum: return Make_Flonum (FLONUM(x)->val / Bignum_To_Double (y)); default: /* Just to avoid compiler warnings */ return Null; } case T_Bignum: switch (t) { case T_Fixnum: GC_Link (x); ret = Bignum_Fixnum_Divide (x, y); GC_Unlink; if (EQ(Cdr (ret),Zero)) return Car (ret); return Make_Reduced_Flonum (Bignum_To_Double (x) / (double)FIXNUM(y)); case T_Flonum: return Make_Flonum (Bignum_To_Double (x) / FLONUM(y)->val); case T_Bignum: GC_Link2 (x, y); ret = Bignum_Divide (x, y); GC_Unlink; if (EQ(Cdr (ret),Zero)) return Car (ret); return Make_Reduced_Flonum (Bignum_To_Double (x) / Bignum_To_Double (y)); default: /* Just to avoid compiler warnings */ return Null; } default: /* Just to avoid compiler warnings */ return Null; } /*NOTREACHED*/ } Object P_Abs (Object x) { register int i; Check_Number (x); switch (TYPE(x)) { case T_Fixnum: i = FIXNUM(x); return i < 0 ? Make_Integer (-i) : x; case T_Flonum: return Make_Flonum (fabs (FLONUM(x)->val)); case T_Bignum: return Bignum_Abs (x); default: /* Just to avoid compiler warnings */ return Null; } /*NOTREACHED*/ } Object General_Integer_Divide (Object x, Object y, int rem) { register int fx = FIXNUM(x), fy = FIXNUM(y); Object b, ret; GC_Node; if (TYPE(y) == T_Fixnum ? FIXNUM(y) == 0 : Bignum_Zero (y)) Range_Error (y); switch (TYPE(x)) { case T_Fixnum: switch (TYPE(y)) { case T_Fixnum: return Make_Integer (rem ? (fx % fy) : (fx / fy)); case T_Bignum: GC_Link (y); b = Integer_To_Bignum (fx); GC_Unlink; ret = Bignum_Divide (b, y); done: return rem ? Cdr (ret) : Car (ret); default: /* Just to avoid compiler warnings */ return Null; } case T_Bignum: switch (TYPE(y)) { case T_Fixnum: ret = Bignum_Fixnum_Divide (x, y); goto done; case T_Bignum: ret = Bignum_Divide (x, y); goto done; default: /* Just to avoid compiler warnings */ return Null; } default: /* Just to avoid compiler warnings */ return Null; } /*NOTREACHED*/ } Object Exact_Quotient (Object x, Object y) { return General_Integer_Divide (x, y, 0); } Object Exact_Remainder (Object x, Object y) { return General_Integer_Divide (x, y, 1); } Object Exact_Modulo (Object x, Object y) { Object rem, xneg, yneg; GC_Node2; GC_Link2 (x, y); rem = General_Integer_Divide (x, y, 1); if (!EQ(rem,Zero)) { xneg = P_Negativep (x); yneg = P_Negativep (y); if (!EQ(xneg,yneg)) rem = Generic_Plus (rem, y); } GC_Unlink; return rem; } Object With_Exact_Ints (Object x, Object y, Object (*fun)()) { Object i, ret; int inex = 0; GC_Node3; ret = Null; GC_Link3 (x, y, ret); i = P_Integerp (x); if (!EQ(i,True)) Wrong_Type (x, T_Fixnum); i = P_Integerp (y); if (!EQ(i,True)) Wrong_Type (y, T_Fixnum); if (TYPE(x) == T_Flonum) { x = P_Inexact_To_Exact (x); inex++; } if (TYPE(y) == T_Flonum) { y = P_Inexact_To_Exact (y); inex++; } ret = fun (x, y); if (inex) ret = P_Exact_To_Inexact (ret); GC_Unlink; return ret; } Object P_Quotient (Object x, Object y) { return With_Exact_Ints (x, y, Exact_Quotient); } Object P_Remainder (Object x, Object y) { return With_Exact_Ints (x, y, Exact_Remainder); } Object P_Modulo (Object x, Object y) { return With_Exact_Ints (x, y, Exact_Modulo); } Object Exact_Gcd (Object x, Object y) { Object r, z; GC_Node2; GC_Link2 (x, y); while (1) { z = P_Zerop (x); if (EQ(z,True)) { r = y; break; } z = P_Zerop (y); if (EQ(z,True)) { r = x; break; } r = General_Integer_Divide (x, y, 1); x = y; y = r; } GC_Unlink; return r; } Object General_Gcd (Object x, Object y) { return With_Exact_Ints (x, y, Exact_Gcd); } Object P_Gcd (int argc, Object *argv) { return P_Abs (General_Operator (argc, argv, Zero, General_Gcd)); } Object Exact_Lcm (Object x, Object y) { Object ret, p, z; GC_Node3; ret = Null; GC_Link3 (x, y, ret); ret = Exact_Gcd (x, y); z = P_Zerop (ret); if (!EQ(z,True)) { p = Generic_Multiply (x, y); ret = General_Integer_Divide (p, ret, 0); } GC_Unlink; return ret; } Object General_Lcm (Object x, Object y) { return With_Exact_Ints (x, y, Exact_Lcm); } Object P_Lcm (int argc, Object *argv) { return P_Abs (General_Operator (argc, argv, One, General_Lcm)); } #define General_Conversion(name,op) Object name (Object x) {\ double d, i;\ \ Check_Number (x);\ if (TYPE(x) != T_Flonum)\ return x;\ d = FLONUM(x)->val;\ (void)modf (op (d), &i);\ return Make_Flonum (i);\ } #define trunc(x) (x) General_Conversion (P_Floor, floor) General_Conversion (P_Ceiling, ceil) General_Conversion (P_Truncate, trunc) Object P_Round (Object x) { double d, y, f; Object ret, isodd; Check_Number (x); if (TYPE(x) != T_Flonum) return x; d = FLONUM(x)->val; y = d + 0.5; f = floor (y); ret = Make_Flonum (f); if (y == f) { isodd = P_Oddp (ret); if (Truep (isodd)) FLONUM(ret)->val--; } return ret; } double Get_Double (Object x) { Check_Number (x); switch (TYPE(x)) { case T_Fixnum: return (double)FIXNUM(x); case T_Flonum: return FLONUM(x)->val; case T_Bignum: return Bignum_To_Double (x); default: /* Just to avoid compiler warnings */ return 0.0; } /*NOTREACHED*/ } Object General_Function (Object x, Object y, double (*fun)()) { double d, ret; d = Get_Double (x); errno = 0; if (Nullp (y)) ret = (*fun) (d); else ret = (*fun) (d, Get_Double (y)); if (errno == ERANGE || errno == EDOM) Range_Error (x); return Make_Flonum (ret); } Object P_Sqrt (Object x) { return General_Function (x, Null, sqrt); } Object P_Exp (Object x) { return General_Function (x, Null, exp); } Object P_Pow (Object x, Object y) { return General_Function (x, y, pow); } Object P_Log (Object x) { return General_Function (x, Null, log); } Object P_Sin (Object x) { return General_Function (x, Null, sin); } Object P_Cos (Object x) { return General_Function (x, Null, cos); } Object P_Tan (Object x) { return General_Function (x, Null, tan); } Object P_Asin (Object x) { return General_Function (x, Null, asin); } Object P_Acos (Object x) { return General_Function (x, Null, acos); } Object P_Atan (int argc, Object *argv) { register int a2 = argc == 2; return General_Function (argv[0], a2 ? argv[1] : Null, a2 ? (double(*)())atan2 : (double(*)())atan); } Object Min (Object x, Object y) { Object ret; ret = Generic_Less (x, y) ? x : y; if (TYPE(x) == T_Flonum || TYPE(y) == T_Flonum) ret = P_Exact_To_Inexact (ret); return ret; } Object Max (Object x, Object y) { Object ret; ret = Generic_Less (x, y) ? y : x; if (TYPE(x) == T_Flonum || TYPE(y) == T_Flonum) ret = P_Exact_To_Inexact (ret); return ret; } Object P_Min (int argc, Object *argv) { return General_Operator (argc, argv, argv[0], Min); } Object P_Max (int argc, Object *argv) { return General_Operator (argc, argv, argv[0], Max); } Object P_Random () { #ifdef HAVE_RANDOM return Make_Long (random ()); #else return Make_Integer (rand ()); #endif } Object P_Srandom (Object x) { #ifdef HAVE_RANDOM srandom (Get_Unsigned (x)); #else srand (Get_Unsigned (x)); #endif return x; } elk-3.99.8/src/malloc.c0000644000175000017500000000410311577076306011534 00000000000000/* malloc.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "config.h" #include #include "kernel.h" char *Safe_Malloc (unsigned int size) { char *ret; Disable_Interrupts; if ((ret = malloc (size)) == 0) { if (Interpreter_Initialized) Primitive_Error ("not enough memory to malloc ~s bytes", Make_Integer (size)); else Fatal_Error ("not enough memory to malloc %u bytes", size); } Enable_Interrupts; return ret; } char *Safe_Realloc (char *ptr, unsigned int size) { char *ret; Disable_Interrupts; if ((ret = ptr ? realloc (ptr, size) : malloc (size)) == 0) { if (Interpreter_Initialized) Primitive_Error ("not enough memory to malloc ~s bytes", Make_Integer (size)); else Fatal_Error ("not enough memory to malloc %u bytes", size); } Enable_Interrupts; return ret; } elk-3.99.8/bootstrap0000755000175000017500000000755111577076306011307 00000000000000#! /bin/sh # $Id$ # bootstrap: generic bootstrap/autogen.sh script for autotools projects # # Copyright (c) 2002-2009 Sam Hocevar # # This program is free software. It comes without any warranty, to # the extent permitted by applicable law. You can redistribute it # and/or modify it under the terms of the Do What The Fuck You Want # To Public License, Version 2, as published by Sam Hocevar. See # http://sam.zoy.org/wtfpl/COPYING for more details. # # The latest version of this script can be found at the following place: # http://caca.zoy.org/wiki/build # Die if an error occurs set -e # Guess whether we are using configure.ac or configure.in if test -f configure.ac; then conffile="configure.ac" elif test -f configure.in; then conffile="configure.in" else echo "$0: could not find configure.ac or configure.in" exit 1 fi # Check for needed features auxdir="`sed -ne 's/^[ \t]*A._CONFIG_AUX_DIR *([[ ]*\([^] )]*\).*/\1/p' $conffile`" pkgconfig="`grep '^[ \t]*PKG_PROG_PKG_CONFIG' $conffile >/dev/null 2>&1 && echo yes || echo no`" libtool="`grep '^[ \t]*A._PROG_LIBTOOL' $conffile >/dev/null 2>&1 && echo yes || echo no`" header="`grep '^[ \t]*A._CONFIG_HEADER' $conffile >/dev/null 2>&1 && echo yes || echo no`" makefile="`[ -f Makefile.am ] && echo yes || echo no`" aclocalflags="`sed -ne 's/^[ \t]*ACLOCAL_AMFLAGS[ \t]*=//p' Makefile.am 2>/dev/null || :`" # Check for automake amvers="no" for v in 11 10 9 8 7 6 5; do if automake-1.${v} --version >/dev/null 2>&1; then amvers="-1.${v}" break elif automake1.${v} --version >/dev/null 2>&1; then amvers="1.${v}" break fi done if test "${amvers}" = "no" && automake --version > /dev/null 2>&1; then amvers="`automake --version | sed -e '1s/[^0-9]*//' -e q`" if expr "$amvers" "<" "1.5" > /dev/null 2>&1; then amvers="no" else amvers="" fi fi if test "$amvers" = "no"; then echo "$0: you need automake version 1.5 or later" exit 1 fi # Check for autoconf acvers="no" for v in "" "259" "253"; do if autoconf${v} --version >/dev/null 2>&1; then acvers="${v}" break fi done if test "$acvers" = "no"; then echo "$0: you need autoconf" exit 1 fi # Check for libtool if test "$libtool" = "yes"; then libtoolize="no" if glibtoolize --version >/dev/null 2>&1; then libtoolize="glibtoolize" else for v in "16" "15" "" "14"; do if libtoolize${v} --version >/dev/null 2>&1; then libtoolize="libtoolize${v}" break fi done fi if test "$libtoolize" = "no"; then echo "$0: you need libtool" exit 1 fi fi # Check for pkg-config if test "$pkgconfig" = "yes"; then if ! pkg-config --version >/dev/null 2>&1; then echo "$0: you need pkg-config" exit 1 fi fi # Remove old cruft for x in aclocal.m4 configure config.guess config.log config.sub config.cache config.h.in config.h compile libtool.m4 ltoptions.m4 ltsugar.m4 ltversion.m4 ltmain.sh libtool ltconfig missing mkinstalldirs depcomp install-sh; do rm -f $x autotools/$x; if test -n "$auxdir"; then rm -f "$auxdir/$x"; fi; done rm -Rf autom4te.cache if test -n "$auxdir"; then if test ! -d "$auxdir"; then mkdir "$auxdir" fi aclocalflags="${aclocalflags} -I $auxdir -I ." fi # Explain what we are doing from now set -x # Bootstrap package if test "$libtool" = "yes"; then ${libtoolize} --copy --force if test -n "$auxdir" -a ! "$auxdir" = "." -a -f "ltmain.sh"; then echo "$0: working around a minor libtool issue" mv ltmain.sh "$auxdir/" fi fi aclocal${amvers} ${aclocalflags} autoconf${acvers} if test "$header" = "yes"; then autoheader${acvers} fi if test "$makefile" = "yes"; then #add --include-deps if you want to bootstrap with any other compiler than gcc #automake${amvers} --add-missing --copy --include-deps automake${amvers} --foreign --add-missing --copy fi # Remove cruft that we no longer want rm -Rf autom4te.cache elk-3.99.8/test/0000755000175000017500000000000011577110020010351 500000000000000elk-3.99.8/test/check-build0000755000175000017500000000163211577100003012373 00000000000000#!/bin/sh # # Check that we have no tabs or trailing spaces in the source code # nfails=0 nfiles=0 nlines=0 for dir in lib/misc lib/unix lib/xlib lib/xwidgets lib/xwidgets/motif \ lib/xwidgets/xaw src; do if [ ! -d "../$dir" ]; then continue; fi for x in $(make -s echo-sources -C ../$dir); do case "$x" in *.c|*.cpp|*.h|*.m|*.php|*.cs|*.java|.py|.pl) nfiles=$(($nfiles + 1)); nlines=$(($nlines + `grep -c . "../$dir/$x"`)) ;; *) continue ;; esac if grep '[[:space:]]$' "../$dir/$x" >/dev/null 2>&1; then echo "error: $dir/$x contains trailing spaces" nfails=$(($nfails + 1)) fi if grep ' ' "../$dir/$x" >/dev/null 2>&1; then echo "error: $dir/$x contains tabs" nfails=$(($nfails + 1)) fi done done echo "$nfiles files, $nlines lines, $nfails errors in source code" if test "$nfails" != "0"; then exit 1 fi exit 0 elk-3.99.8/test/README0000644000175000017500000000031111577076306011166 00000000000000Various Scheme conformance tests -------------------------------- r4rstest.scm: Aubrey Jaffer's R4RS conformance test, downloaded from http://swissnet.ai.mit.edu/ftpdir/scm/r4rstest.scm elk-3.99.8/test/r4rstest.scm0000644000175000017500000010560411577076306012617 00000000000000;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 2000, 2003 Free Software Foundation, Inc. ;; ;; This program is free software; you can redistribute it and/or modify it ;; under the terms of the GNU General Public License as published by the ;; Free Software Foundation; either version 2, or (at your option) any ;; later version. ;; ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; ;; To receive a copy of the GNU General Public License, write to the ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA; or view ;; http://swissnet.ai.mit.edu/~jaffer/GPL.html ;;;; "r4rstest.scm" Test correctness of scheme implementations. ;;; Author: Aubrey Jaffer ;;; This includes examples from ;;; William Clinger and Jonathan Rees, editors. ;;; Revised^4 Report on the Algorithmic Language Scheme ;;; and the IEEE specification. ;;; The input tests read this file expecting it to be named "r4rstest.scm". ;;; Files `tmp1', `tmp2' and `tmp3' will be created in the course of running ;;; these tests. You may need to delete them in order to run ;;; "r4rstest.scm" more than once. ;;; There are three optional tests: ;;; (TEST-CONT) tests multiple returns from call-with-current-continuation ;;; ;;; (TEST-SC4) tests procedures required by R4RS but not by IEEE ;;; ;;; (TEST-DELAY) tests DELAY and FORCE, which are not required by ;;; either standard. ;;; If you are testing a R3RS version which does not have `list?' do: ;;; (define list? #f) ;;; send corrections or additions to agj @ alum.mit.edu (define cur-section '())(define errs '()) (define SECTION (lambda args (display "SECTION") (write args) (newline) (set! cur-section args) #t)) (define record-error (lambda (e) (set! errs (cons (list cur-section e) errs)))) (define test (lambda (expect fun . args) (write (cons fun args)) (display " ==> ") ((lambda (res) (write res) (newline) (cond ((not (equal? expect res)) (record-error (list res expect (cons fun args))) (display " BUT EXPECTED ") (write expect) (newline) #f) (else #t))) (if (procedure? fun) (apply fun args) (car args))))) (define (report-errs) (newline) (if (null? errs) (display "Passed all tests") (begin (display "errors were:") (newline) (display "(SECTION (got expected (call)))") (newline) (for-each (lambda (l) (write l) (newline)) errs))) (newline)) (SECTION 2 1);; test that all symbol characters are supported. '(+ - ... !.. $.+ %.- &.! *.: /:. :+. <-. =. >. ?. ~. _. ^.) (SECTION 3 4) (define disjoint-type-functions (list boolean? char? null? number? pair? procedure? string? symbol? vector?)) (define type-examples (list #t #f #\a '() 9739 '(test) record-error "test" "" 'test '#() '#(a b c) )) (define i 1) (for-each (lambda (x) (display (make-string i #\ )) (set! i (+ 3 i)) (write x) (newline)) disjoint-type-functions) (define type-matrix (map (lambda (x) (let ((t (map (lambda (f) (f x)) disjoint-type-functions))) (write t) (write x) (newline) t)) type-examples)) (set! i 0) (define j 0) (for-each (lambda (x y) (set! j (+ 1 j)) (set! i 0) (for-each (lambda (f) (set! i (+ 1 i)) (cond ((and (= i j)) (cond ((not (f x)) (test #t f x)))) ((f x) (test #f f x))) (cond ((and (= i j)) (cond ((not (f y)) (test #t f y)))) ((f y) (test #f f y)))) disjoint-type-functions)) (list #t #\a '() 9739 '(test) record-error "test" 'car '#(a b c)) (list #f #\newline '() -3252 '(t . t) car "" 'nil '#())) (SECTION 4 1 2) (test '(quote a) 'quote (quote 'a)) (test '(quote a) 'quote ''a) (SECTION 4 1 3) (test 12 (if #f + *) 3 4) (SECTION 4 1 4) (test 8 (lambda (x) (+ x x)) 4) (define reverse-subtract (lambda (x y) (- y x))) (test 3 reverse-subtract 7 10) (define add4 (let ((x 4)) (lambda (y) (+ x y)))) (test 10 add4 6) (test '(3 4 5 6) (lambda x x) 3 4 5 6) (test '(5 6) (lambda (x y . z) z) 3 4 5 6) (SECTION 4 1 5) (test 'yes 'if (if (> 3 2) 'yes 'no)) (test 'no 'if (if (> 2 3) 'yes 'no)) (test '1 'if (if (> 3 2) (- 3 2) (+ 3 2))) (SECTION 4 1 6) (define x 2) (test 3 'define (+ x 1)) (set! x 4) (test 5 'set! (+ x 1)) (SECTION 4 2 1) (test 'greater 'cond (cond ((> 3 2) 'greater) ((< 3 2) 'less))) (test 'equal 'cond (cond ((> 3 3) 'greater) ((< 3 3) 'less) (else 'equal))) (test 2 'cond (cond ((assv 'b '((a 1) (b 2))) => cadr) (else #f))) (test 'composite 'case (case (* 2 3) ((2 3 5 7) 'prime) ((1 4 6 8 9) 'composite))) (test 'consonant 'case (case (car '(c d)) ((a e i o u) 'vowel) ((w y) 'semivowel) (else 'consonant))) (test #t 'and (and (= 2 2) (> 2 1))) (test #f 'and (and (= 2 2) (< 2 1))) (test '(f g) 'and (and 1 2 'c '(f g))) (test #t 'and (and)) (test #t 'or (or (= 2 2) (> 2 1))) (test #t 'or (or (= 2 2) (< 2 1))) (test #f 'or (or #f #f #f)) (test #f 'or (or)) (test '(b c) 'or (or (memq 'b '(a b c)) (+ 3 0))) (SECTION 4 2 2) (test 6 'let (let ((x 2) (y 3)) (* x y))) (test 35 'let (let ((x 2) (y 3)) (let ((x 7) (z (+ x y))) (* z x)))) (test 70 'let* (let ((x 2) (y 3)) (let* ((x 7) (z (+ x y))) (* z x)))) (test #t 'letrec (letrec ((even? (lambda (n) (if (zero? n) #t (odd? (- n 1))))) (odd? (lambda (n) (if (zero? n) #f (even? (- n 1)))))) (even? 88))) (define x 34) (test 5 'let (let ((x 3)) (define x 5) x)) (test 34 'let x) (test 6 'let (let () (define x 6) x)) (test 34 'let x) (test 7 'let* (let* ((x 3)) (define x 7) x)) (test 34 'let* x) (test 8 'let* (let* () (define x 8) x)) (test 34 'let* x) (test 9 'letrec (letrec () (define x 9) x)) (test 34 'letrec x) (test 10 'letrec (letrec ((x 3)) (define x 10) x)) (test 34 'letrec x) (define (s x) (if x (let () (set! s x) (set! x s)))) (SECTION 4 2 3) (define x 0) (test 6 'begin (begin (set! x (begin (begin 5))) (begin ((begin +) (begin x) (begin (begin 1)))))) (SECTION 4 2 4) (test '#(0 1 2 3 4) 'do (do ((vec (make-vector 5)) (i 0 (+ i 1))) ((= i 5) vec) (vector-set! vec i i))) (test 25 'do (let ((x '(1 3 5 7 9))) (do ((x x (cdr x)) (sum 0 (+ sum (car x)))) ((null? x) sum)))) (test 1 'let (let foo () 1)) (test '((6 1 3) (-5 -2)) 'let (let loop ((numbers '(3 -2 1 6 -5)) (nonneg '()) (neg '())) (cond ((null? numbers) (list nonneg neg)) ((negative? (car numbers)) (loop (cdr numbers) nonneg (cons (car numbers) neg))) (else (loop (cdr numbers) (cons (car numbers) nonneg) neg))))) ;;From: Allegro Petrofsky (test -1 'let (let ((f -)) (let f ((n (f 1))) n))) (SECTION 4 2 6) (test '(list 3 4) 'quasiquote `(list ,(+ 1 2) 4)) (test '(list a (quote a)) 'quasiquote (let ((name 'a)) `(list ,name ',name))) (test '(a 3 4 5 6 b) 'quasiquote `(a ,(+ 1 2) ,@(map abs '(4 -5 6)) b)) (test '((foo 7) . cons) 'quasiquote `((foo ,(- 10 3)) ,@(cdr '(c)) . ,(car '(cons)))) ;;; sqt is defined here because not all implementations are required to ;;; support it. (define (sqt x) (do ((i 0 (+ i 1))) ((> (* i i) x) (- i 1)))) (test '#(10 5 2 4 3 8) 'quasiquote `#(10 5 ,(sqt 4) ,@(map sqt '(16 9)) 8)) (test 5 'quasiquote `,(+ 2 3)) (test '(a `(b ,(+ 1 2) ,(foo 4 d) e) f) 'quasiquote `(a `(b ,(+ 1 2) ,(foo ,(+ 1 3) d) e) f)) (test '(a `(b ,x ,'y d) e) 'quasiquote (let ((name1 'x) (name2 'y)) `(a `(b ,,name1 ,',name2 d) e))) (test '(list 3 4) 'quasiquote (quasiquote (list (unquote (+ 1 2)) 4))) (test '`(list ,(+ 1 2) 4) 'quasiquote '(quasiquote (list (unquote (+ 1 2)) 4))) (SECTION 5 2 1) (define add3 (lambda (x) (+ x 3))) (test 6 'define (add3 3)) (define first car) (test 1 'define (first '(1 2))) (define old-+ +) (begin (begin (begin) (begin (begin (begin) (define + (lambda (x y) (list y x))) (begin))) (begin)) (begin) (begin (begin (begin) (test '(3 6) add3 6) (begin)))) (set! + old-+) (test 9 add3 6) (begin) (begin (begin)) (begin (begin (begin (begin)))) (SECTION 5 2 2) (test 45 'define (let ((x 5)) (begin (begin (begin) (begin (begin (begin) (define foo (lambda (y) (bar x y))) (begin))) (begin)) (begin) (begin) (begin (define bar (lambda (a b) (+ (* a b) a)))) (begin)) (begin) (begin (foo (+ x 3))))) (define x 34) (define (foo) (define x 5) x) (test 5 foo) (test 34 'define x) (define foo (lambda () (define x 5) x)) (test 5 foo) (test 34 'define x) (define (foo x) ((lambda () (define x 5) x)) x) (test 88 foo 88) (test 4 foo 4) (test 34 'define x) (test 99 'internal-define (letrec ((foo (lambda (arg) (or arg (and (procedure? foo) (foo 99)))))) (define bar (foo #f)) (foo #f))) (test 77 'internal-define (letrec ((foo 77) (bar #f) (retfoo (lambda () foo))) (define baz (retfoo)) (retfoo))) (SECTION 6 1) (test #f not #t) (test #f not 3) (test #f not (list 3)) (test #t not #f) (test #f not '()) (test #f not (list)) (test #f not 'nil) ;(test #t boolean? #f) ;(test #f boolean? 0) ;(test #f boolean? '()) (SECTION 6 2) (test #t eqv? 'a 'a) (test #f eqv? 'a 'b) (test #t eqv? 2 2) (test #t eqv? '() '()) (test #t eqv? '10000 '10000) (test #f eqv? (cons 1 2)(cons 1 2)) (test #f eqv? (lambda () 1) (lambda () 2)) (test #f eqv? #f 'nil) (let ((p (lambda (x) x))) (test #t eqv? p p)) (define gen-counter (lambda () (let ((n 0)) (lambda () (set! n (+ n 1)) n)))) (let ((g (gen-counter))) (test #t eqv? g g)) (test #f eqv? (gen-counter) (gen-counter)) (letrec ((f (lambda () (if (eqv? f g) 'f 'both))) (g (lambda () (if (eqv? f g) 'g 'both)))) (test #f eqv? f g)) (test #t eq? 'a 'a) (test #f eq? (list 'a) (list 'a)) (test #t eq? '() '()) (test #t eq? car car) (let ((x '(a))) (test #t eq? x x)) (let ((x '#())) (test #t eq? x x)) (let ((x (lambda (x) x))) (test #t eq? x x)) (define test-eq?-eqv?-agreement (lambda (obj1 obj2) (cond ((eq? (eq? obj1 obj2) (eqv? obj1 obj2))) (else (record-error (list #f #t (list 'test-eq?-eqv?-agreement obj1 obj2))) (display "eqv? and eq? disagree about ") (write obj1) (display #\ ) (write obj2) (newline))))) (test-eq?-eqv?-agreement '#f '#f) (test-eq?-eqv?-agreement '#t '#t) (test-eq?-eqv?-agreement '#t '#f) (test-eq?-eqv?-agreement '(a) '(a)) (test-eq?-eqv?-agreement '(a) '(b)) (test-eq?-eqv?-agreement car car) (test-eq?-eqv?-agreement car cdr) (test-eq?-eqv?-agreement (list 'a) (list 'a)) (test-eq?-eqv?-agreement (list 'a) (list 'b)) (test-eq?-eqv?-agreement '#(a) '#(a)) (test-eq?-eqv?-agreement '#(a) '#(b)) (test-eq?-eqv?-agreement "abc" "abc") (test-eq?-eqv?-agreement "abc" "abz") (test #t equal? 'a 'a) (test #t equal? '(a) '(a)) (test #t equal? '(a (b) c) '(a (b) c)) (test #t equal? "abc" "abc") (test #t equal? 2 2) (test #t equal? (make-vector 5 'a) (make-vector 5 'a)) (SECTION 6 3) (test '(a b c d e) 'dot '(a . (b . (c . (d . (e . ())))))) (define x (list 'a 'b 'c)) (define y x) (and list? (test #t list? y)) (set-cdr! x 4) (test '(a . 4) 'set-cdr! x) (test #t eqv? x y) (test '(a b c . d) 'dot '(a . (b . (c . d)))) (and list? (test #f list? y)) (and list? (let ((x (list 'a))) (set-cdr! x x) (test #f 'list? (list? x)))) ;(test #t pair? '(a . b)) ;(test #t pair? '(a . 1)) ;(test #t pair? '(a b c)) ;(test #f pair? '()) ;(test #f pair? '#(a b)) (test '(a) cons 'a '()) (test '((a) b c d) cons '(a) '(b c d)) (test '("a" b c) cons "a" '(b c)) (test '(a . 3) cons 'a 3) (test '((a b) . c) cons '(a b) 'c) (test 'a car '(a b c)) (test '(a) car '((a) b c d)) (test 1 car '(1 . 2)) (test '(b c d) cdr '((a) b c d)) (test 2 cdr '(1 . 2)) (test '(a 7 c) list 'a (+ 3 4) 'c) (test '() list) (test 3 length '(a b c)) (test 3 length '(a (b) (c d e))) (test 0 length '()) (test '(x y) append '(x) '(y)) (test '(a b c d) append '(a) '(b c d)) (test '(a (b) (c)) append '(a (b)) '((c))) (test '() append) (test '(a b c . d) append '(a b) '(c . d)) (test 'a append '() 'a) (test '(c b a) reverse '(a b c)) (test '((e (f)) d (b c) a) reverse '(a (b c) d (e (f)))) (test 'c list-ref '(a b c d) 2) (test '(a b c) memq 'a '(a b c)) (test '(b c) memq 'b '(a b c)) (test '#f memq 'a '(b c d)) (test '#f memq (list 'a) '(b (a) c)) (test '((a) c) member (list 'a) '(b (a) c)) (test '(101 102) memv 101 '(100 101 102)) (define e '((a 1) (b 2) (c 3))) (test '(a 1) assq 'a e) (test '(b 2) assq 'b e) (test #f assq 'd e) (test #f assq (list 'a) '(((a)) ((b)) ((c)))) (test '((a)) assoc (list 'a) '(((a)) ((b)) ((c)))) (test '(5 7) assv 5 '((2 3) (5 7) (11 13))) (SECTION 6 4) ;(test #t symbol? 'foo) (test #t symbol? (car '(a b))) ;(test #f symbol? "bar") ;(test #t symbol? 'nil) ;(test #f symbol? '()) ;(test #f symbol? #f) ;;; But first, what case are symbols in? Determine the standard case: (define char-standard-case char-upcase) (if (string=? (symbol->string 'A) "a") (set! char-standard-case char-downcase)) (test #t 'standard-case (string=? (symbol->string 'a) (symbol->string 'A))) (test #t 'standard-case (or (string=? (symbol->string 'a) "A") (string=? (symbol->string 'A) "a"))) (define (str-copy s) (let ((v (make-string (string-length s)))) (do ((i (- (string-length v) 1) (- i 1))) ((< i 0) v) (string-set! v i (string-ref s i))))) (define (string-standard-case s) (set! s (str-copy s)) (do ((i 0 (+ 1 i)) (sl (string-length s))) ((>= i sl) s) (string-set! s i (char-standard-case (string-ref s i))))) (test (string-standard-case "flying-fish") symbol->string 'flying-fish) (test (string-standard-case "martin") symbol->string 'Martin) (test "Malvina" symbol->string (string->symbol "Malvina")) (test #t 'standard-case (eq? 'a 'A)) (define x (string #\a #\b)) (define y (string->symbol x)) (string-set! x 0 #\c) (test "cb" 'string-set! x) (test "ab" symbol->string y) (test y string->symbol "ab") (test #t eq? 'mISSISSIppi 'mississippi) (test #f 'string->symbol (eq? 'bitBlt (string->symbol "bitBlt"))) (test 'JollyWog string->symbol (symbol->string 'JollyWog)) (SECTION 6 5 5) (test #t number? 3) (test #t complex? 3) (test #t real? 3) (test #t rational? 3) (test #t integer? 3) (test #t exact? 3) (test #f inexact? 3) (test #t = 22 22 22) (test #t = 22 22) (test #f = 34 34 35) (test #f = 34 35) (test #t > 3 -6246) (test #f > 9 9 -2424) (test #t >= 3 -4 -6246) (test #t >= 9 9) (test #f >= 8 9) (test #t < -1 2 3 4 5 6 7 8) (test #f < -1 2 3 4 4 5 6 7) (test #t <= -1 2 3 4 5 6 7 8) (test #t <= -1 2 3 4 4 5 6 7) (test #f < 1 3 2) (test #f >= 1 3 2) (test #t zero? 0) (test #f zero? 1) (test #f zero? -1) (test #f zero? -100) (test #t positive? 4) (test #f positive? -4) (test #f positive? 0) (test #f negative? 4) (test #t negative? -4) (test #f negative? 0) (test #t odd? 3) (test #f odd? 2) (test #f odd? -4) (test #t odd? -1) (test #f even? 3) (test #t even? 2) (test #t even? -4) (test #f even? -1) (test 38 max 34 5 7 38 6) (test -24 min 3 5 5 330 4 -24) (test 7 + 3 4) (test '3 + 3) (test 0 +) (test 4 * 4) (test 1 *) (test -1 - 3 4) (test -3 - 3) (test 7 abs -7) (test 7 abs 7) (test 0 abs 0) (test 5 quotient 35 7) (test -5 quotient -35 7) (test -5 quotient 35 -7) (test 5 quotient -35 -7) (test 1 modulo 13 4) (test 1 remainder 13 4) (test 3 modulo -13 4) (test -1 remainder -13 4) (test -3 modulo 13 -4) (test 1 remainder 13 -4) (test -1 modulo -13 -4) (test -1 remainder -13 -4) (test 0 modulo 0 86400) (test 0 modulo 0 -86400) (define (divtest n1 n2) (= n1 (+ (* n2 (quotient n1 n2)) (remainder n1 n2)))) (test #t divtest 238 9) (test #t divtest -238 9) (test #t divtest 238 -9) (test #t divtest -238 -9) (test 4 gcd 0 4) (test 4 gcd -4 0) (test 4 gcd 32 -36) (test 0 gcd) (test 288 lcm 32 -36) (test 1 lcm) (SECTION 6 5 5) ;;; Implementations which don't allow division by 0 can have fragile ;;; string->number. (define (test-string->number str) (define ans (string->number str)) (cond ((not ans) #t) ((number? ans) #t) (else ans))) (for-each (lambda (str) (test #t test-string->number str)) '("+#.#" "-#.#" "#.#" "1/0" "-1/0" "0/0" "+1/0i" "-1/0i" "0/0i" "0/0-0/0i" "1/0-1/0i" "-1/0+1/0i" "#i" "#e" "#" "#i0/0")) (cond ((number? (string->number "1+1i")) ;More kawa bait (test #t number? (string->number "#i-i")) (test #t number? (string->number "#i+i")) (test #t number? (string->number "#i2+i")))) ;;;;From: fred@sce.carleton.ca (Fred J Kaudel) ;;; Modified by jaffer. (define (test-inexact) (define f3.9 (string->number "3.9")) (define f4.0 (string->number "4.0")) (define f-3.25 (string->number "-3.25")) (define f.25 (string->number ".25")) (define f4.5 (string->number "4.5")) (define f3.5 (string->number "3.5")) (define f0.0 (string->number "0.0")) (define f0.8 (string->number "0.8")) (define f1.0 (string->number "1.0")) (define wto write-test-obj) (define lto load-test-obj) (newline) (display ";testing inexact numbers; ") (newline) (SECTION 6 2) (test #f eqv? 1 f1.0) (test #f eqv? 0 f0.0) (SECTION 6 5 5) (test #t inexact? f3.9) (test #t 'max (inexact? (max f3.9 4))) (test f4.0 max f3.9 4) (test f4.0 exact->inexact 4) (test f4.0 exact->inexact 4.0) (test 4 inexact->exact 4) (test 4 inexact->exact 4.0) (test (- f4.0) round (- f4.5)) (test (- f4.0) round (- f3.5)) (test (- f4.0) round (- f3.9)) (test f0.0 round f0.0) (test f0.0 round f.25) (test f1.0 round f0.8) (test f4.0 round f3.5) (test f4.0 round f4.5) (test 1 expt 0 0) (test 0 expt 0 1) (test (atan 1) atan 1 1) (set! write-test-obj (list f.25 f-3.25));.25 inexact errors less likely. (set! load-test-obj (list 'define 'foo (list 'quote write-test-obj))) (test #t call-with-output-file "tmp3" (lambda (test-file) (write-char #\; test-file) (display #\; test-file) (display ";" test-file) (write write-test-obj test-file) (newline test-file) (write load-test-obj test-file) (output-port? test-file))) (check-test-file "tmp3") (set! write-test-obj wto) (set! load-test-obj lto) (let ((x (string->number "4195835.0")) (y (string->number "3145727.0"))) (test #t 'pentium-fdiv-bug (> f1.0 (- x (* (/ x y) y))))) (report-errs)) (define (test-inexact-printing) (let ((f0.0 (string->number "0.0")) (f0.5 (string->number "0.5")) (f1.0 (string->number "1.0")) (f2.0 (string->number "2.0"))) (define log2 (let ((l2 (log 2))) (lambda (x) (/ (log x) l2)))) (define (slow-frexp x) (if (zero? x) (list f0.0 0) (let* ((l2 (log2 x)) (e (floor (log2 x))) (e (if (= l2 e) (inexact->exact e) (+ (inexact->exact e) 1))) (f (/ x (expt 2 e)))) (list f e)))) (define float-precision (let ((mantissa-bits (do ((i 0 (+ i 1)) (eps f1.0 (* f0.5 eps))) ((= f1.0 (+ f1.0 eps)) i))) (minval (do ((x f1.0 (* f0.5 x))) ((zero? (* f0.5 x)) x)))) (lambda (x) (apply (lambda (f e) (let ((eps (cond ((= f1.0 f) (expt f2.0 (+ 1 (- e mantissa-bits)))) ((zero? f) minval) (else (expt f2.0 (- e mantissa-bits)))))) (if (zero? eps) ;Happens if gradual underflow. minval eps))) (slow-frexp x))))) (define (float-print-test x) (define (testit number) (eqv? number (string->number (number->string number)))) (let ((eps (float-precision x)) (all-ok? #t)) (do ((j -100 (+ j 1))) ((or (not all-ok?) (> j 100)) all-ok?) (let* ((xx (+ x (* j eps))) (ok? (testit xx))) (cond ((not ok?) (display "Number readback failure for ") (display `(+ ,x (* ,j ,eps))) (newline) (display xx) (newline) (set! all-ok? #f)) ;; (else (display xx) (newline)) ))))) (define (mult-float-print-test x) (let ((res #t)) (for-each (lambda (mult) (or (float-print-test (* mult x)) (set! res #f))) (map string->number '("1.0" "10.0" "100.0" "1.0e20" "1.0e50" "1.0e100" "0.1" "0.01" "0.001" "1.0e-20" "1.0e-50" "1.0e-100"))) res)) (SECTION 6 5 6) (test #t 'float-print-test (float-print-test f0.0)) (test #t 'mult-float-print-test (mult-float-print-test f1.0)) (test #t 'mult-float-print-test (mult-float-print-test (string->number "3.0"))) (test #t 'mult-float-print-test (mult-float-print-test (string->number "7.0"))) (test #t 'mult-float-print-test (mult-float-print-test (string->number "3.1415926535897931"))) (test #t 'mult-float-print-test (mult-float-print-test (string->number "2.7182818284590451"))))) (define (test-bignum) (define tb (lambda (n1 n2) (= n1 (+ (* n2 (quotient n1 n2)) (remainder n1 n2))))) (newline) (display ";testing bignums; ") (newline) (SECTION 6 5 7) (test 0 modulo 33333333333333333333 3) (test 0 modulo 33333333333333333333 -3) (test 0 remainder 33333333333333333333 3) (test 0 remainder 33333333333333333333 -3) (test 2 modulo 33333333333333333332 3) (test -1 modulo 33333333333333333332 -3) (test 2 remainder 33333333333333333332 3) (test 2 remainder 33333333333333333332 -3) (test 1 modulo -33333333333333333332 3) (test -2 modulo -33333333333333333332 -3) (test -2 remainder -33333333333333333332 3) (test -2 remainder -33333333333333333332 -3) (test 3 modulo 3 33333333333333333333) (test 33333333333333333330 modulo -3 33333333333333333333) (test 3 remainder 3 33333333333333333333) (test -3 remainder -3 33333333333333333333) (test -33333333333333333330 modulo 3 -33333333333333333333) (test -3 modulo -3 -33333333333333333333) (test 3 remainder 3 -33333333333333333333) (test -3 remainder -3 -33333333333333333333) (test 0 modulo -2177452800 86400) (test 0 modulo 2177452800 -86400) (test 0 modulo 2177452800 86400) (test 0 modulo -2177452800 -86400) (test 0 modulo 0 -2177452800) (test #t 'remainder (tb 281474976710655325431 65535)) (test #t 'remainder (tb 281474976710655325430 65535)) (SECTION 6 5 8) (test 281474976710655325431 string->number "281474976710655325431") (test "281474976710655325431" number->string 281474976710655325431) (report-errs)) (define (test-numeric-predicates) (let* ((big-ex (expt 2 90)) (big-inex (exact->inexact big-ex))) (newline) (display ";testing bignum-inexact comparisons;") (newline) (SECTION 6 5 5) (test #f = (+ big-ex 1) big-inex (- big-ex 1)) (test #f = big-inex (+ big-ex 1) (- big-ex 1)) (test #t < (- (inexact->exact big-inex) 1) big-inex (+ (inexact->exact big-inex) 1)))) (SECTION 6 5 9) (test "0" number->string 0) (test "100" number->string 100) (test "100" number->string 256 16) (test 100 string->number "100") (test 256 string->number "100" 16) (test #f string->number "") (test #f string->number ".") (test #f string->number "d") (test #f string->number "D") (test #f string->number "i") (test #f string->number "I") (test #f string->number "3i") (test #f string->number "3I") (test #f string->number "33i") (test #f string->number "33I") (test #f string->number "3.3i") (test #f string->number "3.3I") (test #f string->number "-") (test #f string->number "+") (test #t 'string->number (or (not (string->number "80000000" 16)) (positive? (string->number "80000000" 16)))) (test #t 'string->number (or (not (string->number "-80000000" 16)) (negative? (string->number "-80000000" 16)))) (SECTION 6 6) (test #t eqv? '#\ #\Space) (test #t eqv? #\space '#\Space) (test #t char? #\a) (test #t char? #\() (test #t char? #\ ) (test #t char? '#\newline) (test #f char=? #\A #\B) (test #f char=? #\a #\b) (test #f char=? #\9 #\0) (test #t char=? #\A #\A) (test #t char? #\A #\B) (test #f char>? #\a #\b) (test #t char>? #\9 #\0) (test #f char>? #\A #\A) (test #t char<=? #\A #\B) (test #t char<=? #\a #\b) (test #f char<=? #\9 #\0) (test #t char<=? #\A #\A) (test #f char>=? #\A #\B) (test #f char>=? #\a #\b) (test #t char>=? #\9 #\0) (test #t char>=? #\A #\A) (test #f char-ci=? #\A #\B) (test #f char-ci=? #\a #\B) (test #f char-ci=? #\A #\b) (test #f char-ci=? #\a #\b) (test #f char-ci=? #\9 #\0) (test #t char-ci=? #\A #\A) (test #t char-ci=? #\A #\a) (test #t char-ci? #\A #\B) (test #f char-ci>? #\a #\B) (test #f char-ci>? #\A #\b) (test #f char-ci>? #\a #\b) (test #t char-ci>? #\9 #\0) (test #f char-ci>? #\A #\A) (test #f char-ci>? #\A #\a) (test #t char-ci<=? #\A #\B) (test #t char-ci<=? #\a #\B) (test #t char-ci<=? #\A #\b) (test #t char-ci<=? #\a #\b) (test #f char-ci<=? #\9 #\0) (test #t char-ci<=? #\A #\A) (test #t char-ci<=? #\A #\a) (test #f char-ci>=? #\A #\B) (test #f char-ci>=? #\a #\B) (test #f char-ci>=? #\A #\b) (test #f char-ci>=? #\a #\b) (test #t char-ci>=? #\9 #\0) (test #t char-ci>=? #\A #\A) (test #t char-ci>=? #\A #\a) (test #t char-alphabetic? #\a) (test #t char-alphabetic? #\A) (test #t char-alphabetic? #\z) (test #t char-alphabetic? #\Z) (test #f char-alphabetic? #\0) (test #f char-alphabetic? #\9) (test #f char-alphabetic? #\space) (test #f char-alphabetic? #\;) (test #f char-numeric? #\a) (test #f char-numeric? #\A) (test #f char-numeric? #\z) (test #f char-numeric? #\Z) (test #t char-numeric? #\0) (test #t char-numeric? #\9) (test #f char-numeric? #\space) (test #f char-numeric? #\;) (test #f char-whitespace? #\a) (test #f char-whitespace? #\A) (test #f char-whitespace? #\z) (test #f char-whitespace? #\Z) (test #f char-whitespace? #\0) (test #f char-whitespace? #\9) (test #t char-whitespace? #\space) (test #f char-whitespace? #\;) (test #f char-upper-case? #\0) (test #f char-upper-case? #\9) (test #f char-upper-case? #\space) (test #f char-upper-case? #\;) (test #f char-lower-case? #\0) (test #f char-lower-case? #\9) (test #f char-lower-case? #\space) (test #f char-lower-case? #\;) (test #\. integer->char (char->integer #\.)) (test #\A integer->char (char->integer #\A)) (test #\a integer->char (char->integer #\a)) (test #\A char-upcase #\A) (test #\A char-upcase #\a) (test #\a char-downcase #\A) (test #\a char-downcase #\a) (SECTION 6 7) (test #t string? "The word \"recursion\\\" has many meanings.") ;(test #t string? "") (define f (make-string 3 #\*)) (test "?**" 'string-set! (begin (string-set! f 0 #\?) f)) (test "abc" string #\a #\b #\c) (test "" string) (test 3 string-length "abc") (test #\a string-ref "abc" 0) (test #\c string-ref "abc" 2) (test 0 string-length "") (test "" substring "ab" 0 0) (test "" substring "ab" 1 1) (test "" substring "ab" 2 2) (test "a" substring "ab" 0 1) (test "b" substring "ab" 1 2) (test "ab" substring "ab" 0 2) (test "foobar" string-append "foo" "bar") (test "foo" string-append "foo") (test "foo" string-append "foo" "") (test "foo" string-append "" "foo") (test "" string-append) (test "" make-string 0) (test #t string=? "" "") (test #f string? "" "") (test #t string<=? "" "") (test #t string>=? "" "") (test #t string-ci=? "" "") (test #f string-ci? "" "") (test #t string-ci<=? "" "") (test #t string-ci>=? "" "") (test #f string=? "A" "B") (test #f string=? "a" "b") (test #f string=? "9" "0") (test #t string=? "A" "A") (test #t string? "A" "B") (test #f string>? "a" "b") (test #t string>? "9" "0") (test #f string>? "A" "A") (test #t string<=? "A" "B") (test #t string<=? "a" "b") (test #f string<=? "9" "0") (test #t string<=? "A" "A") (test #f string>=? "A" "B") (test #f string>=? "a" "b") (test #t string>=? "9" "0") (test #t string>=? "A" "A") (test #f string-ci=? "A" "B") (test #f string-ci=? "a" "B") (test #f string-ci=? "A" "b") (test #f string-ci=? "a" "b") (test #f string-ci=? "9" "0") (test #t string-ci=? "A" "A") (test #t string-ci=? "A" "a") (test #t string-ci? "A" "B") (test #f string-ci>? "a" "B") (test #f string-ci>? "A" "b") (test #f string-ci>? "a" "b") (test #t string-ci>? "9" "0") (test #f string-ci>? "A" "A") (test #f string-ci>? "A" "a") (test #t string-ci<=? "A" "B") (test #t string-ci<=? "a" "B") (test #t string-ci<=? "A" "b") (test #t string-ci<=? "a" "b") (test #f string-ci<=? "9" "0") (test #t string-ci<=? "A" "A") (test #t string-ci<=? "A" "a") (test #f string-ci>=? "A" "B") (test #f string-ci>=? "a" "B") (test #f string-ci>=? "A" "b") (test #f string-ci>=? "a" "b") (test #t string-ci>=? "9" "0") (test #t string-ci>=? "A" "A") (test #t string-ci>=? "A" "a") (SECTION 6 8) (test #t vector? '#(0 (2 2 2 2) "Anna")) ;(test #t vector? '#()) (test '#(a b c) vector 'a 'b 'c) (test '#() vector) (test 3 vector-length '#(0 (2 2 2 2) "Anna")) (test 0 vector-length '#()) (test 8 vector-ref '#(1 1 2 3 5 8 13 21) 5) (test '#(0 ("Sue" "Sue") "Anna") 'vector-set (let ((vec (vector 0 '(2 2 2 2) "Anna"))) (vector-set! vec 1 '("Sue" "Sue")) vec)) (test '#(hi hi) make-vector 2 'hi) (test '#() make-vector 0) (test '#() make-vector 0 'a) (SECTION 6 9) (test #t procedure? car) ;(test #f procedure? 'car) (test #t procedure? (lambda (x) (* x x))) (test #f procedure? '(lambda (x) (* x x))) (test #t call-with-current-continuation procedure?) (test 7 apply + (list 3 4)) (test 7 apply (lambda (a b) (+ a b)) (list 3 4)) (test 17 apply + 10 (list 3 4)) (test '() apply list '()) (define compose (lambda (f g) (lambda args (f (apply g args))))) (test 30 (compose sqt *) 12 75) (test '(b e h) map cadr '((a b) (d e) (g h))) (test '(5 7 9) map + '(1 2 3) '(4 5 6)) (test '(1 2 3) map + '(1 2 3)) (test '(1 2 3) map * '(1 2 3)) (test '(-1 -2 -3) map - '(1 2 3)) (test '#(0 1 4 9 16) 'for-each (let ((v (make-vector 5))) (for-each (lambda (i) (vector-set! v i (* i i))) '(0 1 2 3 4)) v)) (test -3 call-with-current-continuation (lambda (exit) (for-each (lambda (x) (if (negative? x) (exit x))) '(54 0 37 -3 245 19)) #t)) (define list-length (lambda (obj) (call-with-current-continuation (lambda (return) (letrec ((r (lambda (obj) (cond ((null? obj) 0) ((pair? obj) (+ (r (cdr obj)) 1)) (else (return #f)))))) (r obj)))))) (test 4 list-length '(1 2 3 4)) (test #f list-length '(a b . c)) (test '() map cadr '()) ;;; This tests full conformance of call-with-current-continuation. It ;;; is a separate test because some schemes do not support call/cc ;;; other than escape procedures. I am indebted to ;;; raja@copper.ucs.indiana.edu (Raja Sooriamurthi) for fixing this ;;; code. The function leaf-eq? compares the leaves of 2 arbitrary ;;; trees constructed of conses. (define (next-leaf-generator obj eot) (letrec ((return #f) (cont (lambda (x) (recur obj) (set! cont (lambda (x) (return eot))) (cont #f))) (recur (lambda (obj) (if (pair? obj) (for-each recur obj) (call-with-current-continuation (lambda (c) (set! cont c) (return obj))))))) (lambda () (call-with-current-continuation (lambda (ret) (set! return ret) (cont #f)))))) (define (leaf-eq? x y) (let* ((eot (list 'eot)) (xf (next-leaf-generator x eot)) (yf (next-leaf-generator y eot))) (letrec ((loop (lambda (x y) (cond ((not (eq? x y)) #f) ((eq? eot x) #t) (else (loop (xf) (yf))))))) (loop (xf) (yf))))) (define (test-cont) (newline) (display ";testing continuations; ") (newline) (SECTION 6 9) (test #t leaf-eq? '(a (b (c))) '((a) b c)) (test #f leaf-eq? '(a (b (c))) '((a) b c d)) (report-errs)) ;;; Test Optional R4RS DELAY syntax and FORCE procedure (define (test-delay) (newline) (display ";testing DELAY and FORCE; ") (newline) (SECTION 6 9) (test 3 'delay (force (delay (+ 1 2)))) (test '(3 3) 'delay (let ((p (delay (+ 1 2)))) (list (force p) (force p)))) (test 2 'delay (letrec ((a-stream (letrec ((next (lambda (n) (cons n (delay (next (+ n 1))))))) (next 0))) (head car) (tail (lambda (stream) (force (cdr stream))))) (head (tail (tail a-stream))))) (letrec ((count 0) (p (delay (begin (set! count (+ count 1)) (if (> count x) count (force p))))) (x 5)) (test 6 force p) (set! x 10) (test 6 force p)) (test 3 'force (letrec ((p (delay (if c 3 (begin (set! c #t) (+ (force p) 1))))) (c #f)) (force p))) (report-errs)) (SECTION 6 10 1) (test #t input-port? (current-input-port)) (test #t output-port? (current-output-port)) (test #t call-with-input-file "r4rstest.scm" input-port?) (define this-file (open-input-file "r4rstest.scm")) (test #t input-port? this-file) (SECTION 6 10 2) (test #\; peek-char this-file) (test #\; read-char this-file) (test '(define cur-section '()) read this-file) (test #\( peek-char this-file) (test '(define errs '()) read this-file) (close-input-port this-file) (close-input-port this-file) (define (check-test-file name) (define test-file (open-input-file name)) (test #t 'input-port? (call-with-input-file name (lambda (test-file) (test load-test-obj read test-file) (test #t eof-object? (peek-char test-file)) (test #t eof-object? (read-char test-file)) (input-port? test-file)))) (test #\; read-char test-file) (test #\; read-char test-file) (test #\; read-char test-file) (test write-test-obj read test-file) (test load-test-obj read test-file) (close-input-port test-file)) (SECTION 6 10 3) (define write-test-obj '(#t #f a () 9739 -3 . #((test) "te \" \" st" "" test #() b c))) (define load-test-obj (list 'define 'foo (list 'quote write-test-obj))) (test #t call-with-output-file "tmp1" (lambda (test-file) (write-char #\; test-file) (display #\; test-file) (display ";" test-file) (write write-test-obj test-file) (newline test-file) (write load-test-obj test-file) (output-port? test-file))) (check-test-file "tmp1") (define test-file (open-output-file "tmp2")) (write-char #\; test-file) (display #\; test-file) (display ";" test-file) (write write-test-obj test-file) (newline test-file) (write load-test-obj test-file) (test #t output-port? test-file) (close-output-port test-file) (check-test-file "tmp2") (define (test-sc4) (newline) (display ";testing scheme 4 functions; ") (newline) (SECTION 6 7) (test '(#\P #\space #\l) string->list "P l") (test '() string->list "") (test "1\\\"" list->string '(#\1 #\\ #\")) (test "" list->string '()) (SECTION 6 8) (test '(dah dah didah) vector->list '#(dah dah didah)) (test '() vector->list '#()) (test '#(dididit dah) list->vector '(dididit dah)) (test '#() list->vector '()) (SECTION 6 10 4) (load "tmp1") (test write-test-obj 'load foo) (report-errs)) (report-errs) (let ((have-inexacts? (and (string->number "0.0") (inexact? (string->number "0.0")))) (have-bignums? (let ((n (string->number "281474976710655325431"))) (and n (exact? n))))) (cond (have-inexacts? (test-inexact) (test-inexact-printing))) (if have-bignums? (test-bignum)) (if (and have-inexacts? have-bignums?) (test-numeric-predicates))) (newline) (display "To fully test continuations, Scheme 4, and DELAY/FORCE do:") (newline) (display "(test-cont) (test-sc4) (test-delay)") (newline) "last item in file" elk-3.99.8/test/Makefile.in0000644000175000017500000003236311577103435012361 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # $Id$ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = test DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/check-gc.in $(srcdir)/check-gc2.in \ $(srcdir)/check-r4rs.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = check-gc check-gc2 check-r4rs CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__tty_colors = \ red=; grn=; lgn=; blu=; std= DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ELK_CFLAGS = @ELK_CFLAGS@ ELK_LDFLAGS = @ELK_LDFLAGS@ ELK_LIBS = @ELK_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INCLUDES = @INCLUDES@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOTIF_CFLAGS = @MOTIF_CFLAGS@ MOTIF_LIBS = @MOTIF_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STDINT_HEADER = @STDINT_HEADER@ STRIP = @STRIP@ VERSION = @VERSION@ XAW_CFLAGS = @XAW_CFLAGS@ XAW_LIBS = @XAW_LIBS@ XMKMF = @XMKMF@ XT_CFLAGS = @XT_CFLAGS@ XT_LIBS = @XT_LIBS@ X_CFLAGS = @X_CFLAGS@ X_LIBS = @X_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = README check-build r4rstest.scm \ check-gc.in check-gc2.in check-r4rs.in DISTCLEANFILES = check-gc check-gc2 check-r4rs @NATIVE_BUILD_TRUE@native_tests = check-gc check-gc2 check-r4rs TESTS = check-build $(native_tests) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign test/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): check-gc: $(top_builddir)/config.status $(srcdir)/check-gc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ check-gc2: $(top_builddir)/config.status $(srcdir)/check-gc2.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ check-r4rs: $(top_builddir)/config.status $(srcdir)/check-r4rs.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ $(am__tty_colors); \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ col=$$red; res=XPASS; \ ;; \ *) \ col=$$grn; res=PASS; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xfail=`expr $$xfail + 1`; \ col=$$lgn; res=XFAIL; \ ;; \ *) \ failed=`expr $$failed + 1`; \ col=$$red; res=FAIL; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ col=$$blu; res=SKIP; \ fi; \ echo "$${col}$$res$${std}: $$tst"; \ done; \ if test "$$all" -eq 1; then \ tests="test"; \ All=""; \ else \ tests="tests"; \ All="All "; \ fi; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="$$All$$all $$tests passed"; \ else \ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all $$tests failed"; \ else \ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ if test "$$skip" -eq 1; then \ skipped="($$skip test was not run)"; \ else \ skipped="($$skip tests were not run)"; \ fi; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ echo "$$grn$$dashes"; \ else \ echo "$$red$$dashes"; \ fi; \ echo "$$banner"; \ test -z "$$skipped" || echo "$$skipped"; \ test -z "$$report" || echo "$$report"; \ echo "$$dashes$$std"; \ test "$$failed" -eq 0; \ else :; fi distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: all all-am check check-TESTS check-am clean clean-generic \ clean-libtool distclean distclean-generic distclean-libtool \ distdir dvi dvi-am html html-am info info-am install \ install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: elk-3.99.8/test/check-gc.in0000644000175000017500000000131111577076306012303 00000000000000#!/bin/sh # this test sometimes crashes the GC with the well-known # Panic: Visit: object not in prev space at 0x40210b2c ('pair') 8199 8201 (dumping core). cat << EOF | @top_builddir@/src/elk -p .:@top_srcdir@/scm -l - (display "testing garbage collector integrity (10000 loops)\n") ;(set! garbage-collect-notify? #t) (define c 0) (define cb (lambda ignore (let ((s '())) (set! c (+ 1 c)) (call/cc (lambda (return) (do ((i 0 (+ i 1))) ((= i 100)) (let ((a (+ i 1))) (set! s (append s (list i)))) (if (= i 60) (return #t)))))))) (do ((i 0 (+ i 1))) ((= i 10000)) (cb)) (display "test passed.\n") EOF elk-3.99.8/test/check-r4rs.in0000644000175000017500000000024111577076306012605 00000000000000#!/bin/sh (cat @srcdir@/r4rstest.scm; echo '(test-cont) (test-sc4) (test-delay)') \ | @top_builddir@/src/elk -p .:@top_srcdir@/scm -l - rm -f tmp1 tmp2 tmp3 elk-3.99.8/test/check-gc2.in0000644000175000017500000000045711577076306012377 00000000000000#!/bin/sh # This test used to crash the GC. cat << EOF | @top_builddir@/src/elk -p .:@top_srcdir@/scm -l - (display "testing deep calls (2000 calls)\n") (define crash (lambda (x) (begin (if (> x 0) (crash (- x 1))) (collect)))) (crash 2000) (display "test passed.\n") EOF elk-3.99.8/test/Makefile.am0000644000175000017500000000040411577076306012345 00000000000000# $Id$ EXTRA_DIST = README check-build r4rstest.scm \ check-gc.in check-gc2.in check-r4rs.in DISTCLEANFILES = check-gc check-gc2 check-r4rs if NATIVE_BUILD native_tests = check-gc check-gc2 check-r4rs endif TESTS = check-build $(native_tests) elk-3.99.8/Makefile.in0000644000175000017500000005520511577103435011402 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/configure .auto/compile .auto/config.guess \ .auto/config.sub .auto/depcomp .auto/install-sh \ .auto/ltmain.sh .auto/missing AUTHORS COPYING ChangeLog NEWS \ TODO ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d "$(distdir)" \ || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr "$(distdir)"; }; } am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ELK_CFLAGS = @ELK_CFLAGS@ ELK_LDFLAGS = @ELK_LDFLAGS@ ELK_LIBS = @ELK_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INCLUDES = @INCLUDES@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOTIF_CFLAGS = @MOTIF_CFLAGS@ MOTIF_LIBS = @MOTIF_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STDINT_HEADER = @STDINT_HEADER@ STRIP = @STRIP@ VERSION = @VERSION@ XAW_CFLAGS = @XAW_CFLAGS@ XAW_LIBS = @XAW_LIBS@ XMKMF = @XMKMF@ XT_CFLAGS = @XT_CFLAGS@ XT_LIBS = @XT_LIBS@ X_CFLAGS = @X_CFLAGS@ X_LIBS = @X_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ NULL = SUBDIRS = include src lib scm doc examples test DIST_SUBDIRS = $(SUBDIRS) EXTRA_DIST = \ bootstrap \ build-win32 \ BUGS \ ChangeLog \ MACHINES \ MIGRATE \ $(NULL) AUTOMAKE_OPTIONS = dist-bzip2 all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @$(am__cd) '$(distuninstallcheck_dir)' \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile config.h installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ ctags-recursive install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ distcheck distclean distclean-generic distclean-hdr \ distclean-libtool distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-recursive uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: elk-3.99.8/include/0000755000175000017500000000000011577110017011023 500000000000000elk-3.99.8/include/stkmem.h0000644000175000017500000000526011577076306012433 00000000000000/* stkmem.h * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #ifdef HAVE_ALLOCA #ifdef HAVE_ALLOCA_H # include #endif /* #pragma must be indented to prevent some C-compilers from complaining * about "undefined control". */ #ifdef PRAGMA_ALLOCA #pragma alloca #endif #if !defined(alloca) && !defined(__GNUC__) C_LINKAGE_BEGIN extern char *alloca (int); C_LINKAGE_END #endif /* MIPS cc under Ultrix 4.2 requires argument to alloca() to be * parenthesized if it's a compound expression. * * Declare variable in Alloca_Begin and reference it in Alloca to make * sure users won't forget Alloca_Begin when using macros like * Get_String_Stack(). */ #define Alloca_Begin int _Check_Alloca_Begin #define Alloca(ret,type,size) (_Check_Alloca_Begin = 0,\ (ret) = (type)alloca((size))) #define Alloca_End #else /* HAVE_ALLOCA */ extern MEM_NODE *Mem_List; extern char *Mem_Alloc (unsigned); #define Alloca_Begin MEM_NODE *_mem_first = 0 #define Alloca(ret,type,size) {\ register MEM_NODE *_p;\ _p = (MEM_NODE*)Mem_Alloc ((unsigned)(size) + sizeof(MEM_NODE));\ _p->next = Mem_List;\ _p->len = (size);\ _p->refcnt = 1;\ Mem_List = _p;\ if (_mem_first == 0) _mem_first = _p;\ (ret) = (type)(_p+1);\ } #define Alloca_End {\ register MEM_NODE *_p, *_q;\ if (_mem_first != 0) {\ _p = Mem_List;\ do {\ _q = _p;\ _p = _p->next;\ if (--_q->refcnt == 0)\ free ((char *)_q);\ } while (_q != _mem_first);\ Mem_List = _p;\ }\ } #endif elk-3.99.8/include/type.h0000644000175000017500000000354011577076306012113 00000000000000/* type.h: Miscellaneous macros for type-checking Scheme objects. * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #define Check_Type(x,t) {\ if (TYPE(x) != t) Wrong_Type (x, t);\ } #define Check_List(x) {\ if (TYPE(x) != T_Pair && !Nullp (x)) Wrong_Type_Combination (x, "list");\ } #define Check_Number(x) {\ register int t = TYPE(x);\ if (!Numeric (t)) Wrong_Type_Combination (x, "number");\ } /* This should be renamed; it checks whether x is an *exact* integer. */ #define Check_Integer(x) {\ register int t = TYPE(x);\ if (t != T_Fixnum && t != T_Bignum) Wrong_Type (x, T_Fixnum);\ } #define Check_Mutable(x) {\ if (ISCONST(x))\ Primitive_Error ("attempt to modify constant");\ } elk-3.99.8/include/Makefile.in0000644000175000017500000003601011577103434013015 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = include DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/site.h.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = site.h CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(pkgincludedir)" \ "$(DESTDIR)$(pkgincludedir)" HEADERS = $(nodist_pkginclude_HEADERS) $(pkginclude_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ELK_CFLAGS = @ELK_CFLAGS@ ELK_LDFLAGS = @ELK_LDFLAGS@ ELK_LIBS = @ELK_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INCLUDES = @INCLUDES@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOTIF_CFLAGS = @MOTIF_CFLAGS@ MOTIF_LIBS = @MOTIF_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STDINT_HEADER = @STDINT_HEADER@ STRIP = @STRIP@ VERSION = @VERSION@ XAW_CFLAGS = @XAW_CFLAGS@ XAW_LIBS = @XAW_LIBS@ XMKMF = @XMKMF@ XT_CFLAGS = @XT_CFLAGS@ XT_LIBS = @XT_LIBS@ X_CFLAGS = @X_CFLAGS@ X_LIBS = @X_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ NULL = pkginclude_HEADERS = \ compat.h \ cstring.h \ exception.h \ extern.h \ funcproto.h \ gc.h \ intern.h \ kernel.h \ misc.h \ object.h \ param.h \ scheme.h \ stkmem.h \ type.h \ $(NULL) nodist_pkginclude_HEADERS = site.h EXTRA_DIST = site.h.in all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign include/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): site.h: $(top_builddir)/config.status $(srcdir)/site.h.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-nodist_pkgincludeHEADERS: $(nodist_pkginclude_HEADERS) @$(NORMAL_INSTALL) test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" @list='$(nodist_pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \ done uninstall-nodist_pkgincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(nodist_pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(pkgincludedir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(pkgincludedir)" && rm -f $$files install-pkgincludeHEADERS: $(pkginclude_HEADERS) @$(NORMAL_INSTALL) test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \ done uninstall-pkgincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(pkgincludedir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(pkgincludedir)" && rm -f $$files ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(HEADERS) installdirs: for dir in "$(DESTDIR)$(pkgincludedir)" "$(DESTDIR)$(pkgincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-nodist_pkgincludeHEADERS \ install-pkgincludeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-nodist_pkgincludeHEADERS \ uninstall-pkgincludeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool ctags distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-nodist_pkgincludeHEADERS \ install-pdf install-pdf-am install-pkgincludeHEADERS \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-nodist_pkgincludeHEADERS \ uninstall-pkgincludeHEADERS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: elk-3.99.8/include/intern.h0000644000175000017500000001107411577076306012432 00000000000000/* intern.h: Functions and variables that are used by more than one source * file of the kernel. Not available to extensions and applications. * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ C_LINKAGE_BEGIN /* autoload.c */ extern Object V_Autoload_Notifyp; extern Object Do_Autoload (Object, Object); /* bignum.c */ extern int Bignum_Zero (Object); extern int Bignum_Positive (Object); extern int Bignum_Negative (Object); extern int Bignum_Even (Object); extern Object Make_Bignum (const char*, int, int); extern Object Integer_To_Bignum (int); extern Object Bignum_Divide (Object, Object); extern Object Bignum_Abs (Object); extern Object Bignum_Plus (Object, Object); extern Object Bignum_Minus (Object, Object); extern Object Bignum_Fixnum_Multiply (Object, Object); extern Object Bignum_Multiply (Object, Object); extern Object Bignum_Fixnum_Divide (Object, Object); extern Object Double_To_Bignum (double); extern Object Unsigned_To_Bignum (unsigned); extern Object Long_To_Bignum (long); extern Object Unsigned_Long_To_Bignum (unsigned long); extern unsigned Bignum_To_Unsigned (Object); extern unsigned long Bignum_To_Unsigned_Long (Object); extern long Bignum_To_Long (Object); extern Object Bignum_To_String (Object, int); extern int Bignum_Equal (Object, Object); extern int Bignum_Greater (Object, Object); extern int Bignum_Less (Object, Object); extern int Bignum_Eq_Less (Object, Object); extern int Bignum_Eq_Greater (Object, Object); /* cont.c */ extern WIND *First_Wind, *Last_Wind; extern Object Internal_Call_CC (int, Object); /* dump.c */ extern Object Dump_Control_Point; /* env.c */ extern Object Add_Binding (Object, Object, Object); extern Object Lookup_Symbol (Object, int); /* error.c */ extern Object Arg_True; extern char *appname; /* exception.c */ extern void Install_Intr_Handler (void); /* heap.c */ #ifndef GENERATIONAL_GC extern char *Hp, *Heap_Start, *Heap_End, *Free_Start, *Free_End; #endif extern int GC_In_Progress; /* io.c */ extern Object General_Open_File (Object, int, Object); /* load.c */ extern char *Loader_Input; extern Object V_Load_Path, V_Load_Noisilyp, V_Load_Libraries; extern void Check_Loadarg (Object); extern Object General_Load (Object, Object); /* list.c */ extern Object General_Assoc (Object, Object, int); /* libelk.c */ extern char *stkbase, *A_Out_Name; extern int Stack_Grows_Down; extern unsigned int Max_Stack; extern int Interpreter_Initialized, Was_Dumped; extern char *Brk_On_Dump; extern int Verb_Load, Verb_Init, Case_Insensitive; extern SYMTAB *The_Symbols; extern char *Scm_Dir; extern char *Lib_Dir; #ifndef HAVE_ATEXIT extern void exit (int); #endif /* math.c */ extern char *Flonum_To_String (Object); /* proc.c */ extern Object Sym_Lambda, Sym_Macro; extern void Funcall_Control_Point (Object, Object, int); extern Object Make_Primitive (Object(*)(), const char*, int, int, enum discipline); /* read.c */ extern Object Sym_Quote; extern Object Sym_Quasiquote, Sym_Unquote, Sym_Unquote_Splicing; extern Object Parse_Number (Object, const char*, int); /* stab.c */ extern SYMTAB *Open_File_And_Snarf_Symbols (char *); /* stkmem.c */ #ifndef HAVE_ALLOCA extern Object Save_GC_Nodes (void); #endif /* string.c */ extern char Char_Map[]; extern Object General_Make_String (const char*, unsigned int, int); /* symbol.c */ extern Object Unbound, Special, Zero, One; /* type.c */ extern int Num_Types, Max_Type; /* vector.c */ extern Object List_To_Vector (Object, int); C_LINKAGE_END elk-3.99.8/include/extern.h0000644000175000017500000004231411577076306012441 00000000000000/* extern.h: This include file declares all symbols exported by the interpreter * kernel that may be used by applications or extensions. * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ C_LINKAGE_BEGIN /* Autoloading */ extern Object P_Autoload (Object, Object); /* Bignums */ extern Object Make_Uninitialized_Bignum (int); extern void Bignum_Normalize_In_Place (struct S_Bignum *); extern double Bignum_To_Double (Object); /* Boolean operators */ extern Object P_Booleanp (Object); extern Object P_Not (Object); extern Object P_Eq (Object, Object); extern Object P_Eqv (Object, Object); extern Object P_Equal (Object, Object); extern Object P_Empty_List_Is_False (Object); extern int Eqv (Object, Object); extern int Equal (Object, Object); /* Characters */ extern Object Make_Char (int); extern Object P_Charp (Object); extern Object P_Char_Upcase (Object); extern Object P_Char_Downcase (Object); extern Object P_Char_Eq (Object, Object); extern Object P_Char_Less (Object, Object); extern Object P_Char_Greater (Object, Object); extern Object P_Char_Eq_Less (Object, Object); extern Object P_Char_Eq_Greater (Object, Object); extern Object P_Char_CI_Eq (Object, Object); extern Object P_Char_CI_Less (Object, Object); extern Object P_Char_CI_Greater (Object, Object); extern Object P_Char_CI_Eq_Less (Object, Object); extern Object P_Char_CI_Eq_Greater (Object, Object); extern Object P_Char_Upper_Casep (Object); extern Object P_Char_Lower_Casep (Object); extern Object P_Char_Alphabeticp (Object); extern Object P_Char_Numericp (Object); extern Object P_Char_Whitespacep (Object); extern Object P_Char_To_Integer (Object); extern Object P_Integer_To_Char (Object); /* Continuations */ extern Object P_Call_With_Current_Continuation (Object); extern Object P_Dynamic_Wind (Object, Object, Object); extern Object P_Control_Pointp (Object); extern Object P_Control_Point_Environment (Object); /* Scheme strings --> C Strings */ extern char *Get_String (Object); extern char *Get_Strsym (Object); /* Debugging */ extern Object P_Backtrace_List (int, Object*); /* Dump */ extern Object P_Dump (Object); /* Lexical bindings, environments */ extern Object P_The_Environment (void); extern Object P_Define (Object); extern Object P_Set (Object); extern Object P_Environment_To_List (Object); extern Object P_Define_Macro (Object); extern Object P_Boundp (Object); extern Object P_Global_Environment (void); extern Object P_Environmentp (Object); extern Object The_Environment, Global_Environment; /* Error handling */ extern void Primitive_Error (const char*, ...) elk_attribute(__noreturn__); extern void Fatal_Error (const char*, ...) elk_attribute(__noreturn__); extern void Range_Error (Object); extern void Panic (const char*); extern Object P_Error (int, Object*); extern Object P_Reset (void); extern const char *Error_Tag; /* will be removed in the near future */ extern const char *Get_Error_Tag (void); extern void Set_Error_Tag (const char *); extern void Set_App_Name (char *); extern void Reader_Error (Object, char *) elk_attribute(__noreturn__); /* Interrupts */ extern Object P_Disable_Interrupts (void); extern Object P_Enable_Interrupts (void); extern void Signal_Exit (int); /* Features */ extern Object P_Features (void); extern Object P_Featurep (Object); extern Object P_Provide (Object); extern Object P_Require (int, Object*); /* Memory allocation, garbage collection */ extern int GC_Debug; extern Object Alloc_Object (int, int, int); extern void Register_Before_GC (void (*)(void)); extern void Register_After_GC (void (*)(void)); extern Object P_Collect (void); extern Object P_Garbage_Collect_Status (int, Object *); #ifdef GENERATIONAL_GC extern Object P_Collect_Incremental (void); #endif /* Files and ports */ extern Object Curr_Input_Port, Curr_Output_Port; extern Object Standard_Input_Port, Standard_Output_Port; extern void Reset_IO (int); extern Object P_Current_Input_Port (void); extern Object P_Current_Output_Port (void); extern Object P_Input_Portp (Object); extern Object P_Output_Portp (Object); extern Object P_Open_Input_File (Object); extern Object P_Open_Output_File (Object); extern Object P_Open_Input_Output_File (Object); extern Object P_Eof_Objectp (Object); extern Object P_With_Input_From_File (Object, Object); extern Object P_With_Output_To_File (Object, Object); extern Object P_Call_With_Input_File (Object, Object); extern Object P_Call_With_Output_File (Object, Object); extern Object P_Open_Input_String (Object); extern Object P_Open_Output_String (void); extern Object P_Port_File_Name (Object); extern Object P_Tilde_Expand (Object); extern Object P_File_Existsp (Object); extern Object P_Close_Input_Port (Object); extern Object P_Close_Output_Port (Object); extern Object P_Port_Line_Number (Object); extern Object Terminate_File (Object); extern Object Make_Port (int, FILE*, Object); extern unsigned int Path_Max (void); /* Loading of files */ extern Object P_Load (int, Object*); extern void Load_Source_Port (Object); extern void Load_File (char *); /* Pairs and lists */ extern Object P_Cons (Object, Object); extern Object P_Car (Object); extern Object P_Cdr (Object); extern Object P_Set_Car (Object, Object); extern Object P_Set_Cdr (Object, Object); extern Object P_Listp (Object); extern Object P_List (int, Object*); extern Object P_Length (Object); extern Object P_Nullp (Object); extern Object P_Pairp (Object); extern Object P_Cxr (Object, Object); extern Object P_Cddr (Object); extern Object P_Cdar (Object); extern Object P_Cadr (Object); extern Object P_Caar (Object); extern Object P_Cdddr (Object); extern Object P_Cddar (Object); extern Object P_Cdadr (Object); extern Object P_Cdaar (Object); extern Object P_Caddr (Object); extern Object P_Cadar (Object); extern Object P_Caadr (Object); extern Object P_Caaar (Object); extern Object P_Caaaar (Object); extern Object P_Caaadr (Object); extern Object P_Caadar (Object); extern Object P_Caaddr (Object); extern Object P_Cadaar (Object); extern Object P_Cadadr (Object); extern Object P_Caddar (Object); extern Object P_Cadddr (Object); extern Object P_Cdaaar (Object); extern Object P_Cdaadr (Object); extern Object P_Cdadar (Object); extern Object P_Cdaddr (Object); extern Object P_Cddaar (Object); extern Object P_Cddadr (Object); extern Object P_Cdddar (Object); extern Object P_Cddddr (Object); extern Object P_Append (int, Object*); extern Object P_Append_Set (int, Object*); extern Object P_Last_Pair (Object); extern Object P_Reverse (Object); extern Object P_Reverse_Set (Object); extern Object P_List_Tail (Object, Object); extern Object P_List_Ref (Object, Object); extern Object P_Assq (Object, Object); extern Object P_Assv (Object, Object); extern Object P_Assoc (Object, Object); extern Object P_Memq (Object, Object); extern Object P_Memv (Object, Object); extern Object P_Member (Object, Object); extern Object P_Make_List (Object, Object); extern Object Copy_List (Object); extern unsigned int Fast_Length (Object); extern Object Const_Cons (Object, Object); /* Startup and termination */ extern Object P_Command_Line_Args (void); extern Object P_Exit (int, Object*); extern void Elk_Init (int, char **av, int, char *); extern void Exit_Handler (void); /* malloc() and realloc() */ extern char *Safe_Malloc (unsigned int); extern char *Safe_Realloc (char*, unsigned int); /* Numbers */ extern Object Make_Integer (int); extern Object Make_Unsigned (unsigned int); extern Object Make_Long (long int); extern Object Make_Unsigned_Long (unsigned long int); extern Object Make_Reduced_Flonum (double); extern Object Make_Flonum (double); extern Object P_Numberp (Object); extern Object P_Complexp (Object); extern Object P_Realp (Object); extern Object P_Rationalp (Object); extern Object P_Integerp (Object); extern Object P_Abs (Object); extern Object P_Zerop (Object); extern Object P_Positivep (Object); extern Object P_Negativep (Object); extern Object P_Oddp (Object); extern Object P_Evenp (Object); extern Object P_Exactp (Object); extern Object P_Inexactp (Object); extern Object P_Exact_To_Inexact (Object); extern Object P_Inexact_To_Exact (Object); extern Object P_Inc (Object); extern Object P_Dec (Object); extern Object P_Generic_Equal (int, Object*); extern Object P_Generic_Less (int, Object*); extern Object P_Generic_Greater (int, Object*); extern Object P_Generic_Eq_Less (int, Object*); extern Object P_Generic_Eq_Greater (int, Object*); extern Object P_Generic_Plus (int, Object*); extern Object P_Generic_Minus (int, Object*); extern Object P_Generic_Multiply (int, Object*); extern Object P_Generic_Divide (int, Object*); extern Object P_Quotient (Object, Object); extern Object P_Remainder (Object, Object); extern Object P_Modulo (Object, Object); extern Object P_Gcd (int, Object*); extern Object P_Lcm (int, Object*); extern Object P_Floor (Object); extern Object P_Ceiling (Object); extern Object P_Truncate (Object); extern Object P_Round (Object); extern Object P_Sqrt (Object); extern Object P_Exp (Object); extern Object P_Pow (Object, Object); extern Object P_Log (Object); extern Object P_Sin (Object); extern Object P_Cos (Object); extern Object P_Tan (Object); extern Object P_Asin (Object); extern Object P_Acos (Object); extern Object P_Atan (int, Object*); extern Object P_Min (int, Object*); extern Object P_Max (int, Object*); extern Object P_Random (void); extern Object P_Srandom (Object); extern Object P_Number_To_String (int, Object*); extern double Get_Double (Object); extern int Get_Integer (Object); extern unsigned int Get_Unsigned (Object); extern long int Get_Long (Object); extern unsigned long int Get_Unsigned_Long (Object); extern int Get_Exact_Integer (Object); extern unsigned int Get_Exact_Unsigned (Object); extern long int Get_Exact_Long (Object); extern unsigned long int Get_Exact_Unsigned_Long (Object); /* Onfork handlers */ extern void Register_Onfork (void (*)(void)); extern void Call_Onfork (void); /* Define_Primitive() */ extern void Define_Primitive (Object (*)(), const char*, int, int, enum discipline); /* Output */ extern Object P_Write (int, Object*); extern Object P_Display (int, Object*); extern Object P_Write_Char (int, Object*); extern Object P_Newline (int, Object*); extern Object P_Format (int, Object*); extern Object P_Clear_Output_Port (int, Object*); extern Object P_Flush_Output_Port (int, Object*); extern Object P_Print (int, Object*); extern Object P_Get_Output_String (Object); extern void Check_Output_Port (Object); extern void Discard_Output (Object); extern void Printf (Object, const char *, ...); extern void Print_Object (Object, Object, int, int, unsigned int); extern void General_Print_Object (Object, Object, int); extern void Format (Object, const char*, unsigned int, int, Object*); extern int Saved_Errno; /* Evaluator, procedures, macros */ extern Object Eval (Object); extern Object P_Eval (int, Object*); extern Object P_Apply (int, Object*); extern Object Funcall (Object, Object, int); extern Object P_Lambda (Object); extern Object P_Map (int, Object*); extern Object P_Procedure_Environment (Object); extern Object P_Procedure_Lambda (Object); extern Object P_For_Each (int, Object*); extern Object P_Procedurep (Object); extern Object P_Macro (Object); extern Object P_Macro_Body (Object); extern Object P_Macro_Expand (Object); extern Object P_Primitivep (Object); extern Object P_Primitive_To_String (Object); extern Object P_Compoundp (Object); extern Object P_Compound_To_String (Object); extern Object P_Macrop (Object); extern Object P_Macro_To_String (Object); extern void Check_Procedure (Object); /* Delay and force */ extern Object P_Delay (Object); extern Object P_Force (Object); extern Object P_Promisep (Object); extern Object P_Promise_Environment (Object); /* Input */ extern Object P_Read (int, Object*); extern Object P_Read_Char (int, Object*); extern Object P_Peek_Char (int, Object*); extern Object P_Char_Readyp (int, Object*); extern Object P_Unread_Char (int, Object*); extern Object P_Read_String (int, Object*); extern Object P_Clear_Input_Port (int, Object*); extern Object General_Read (Object, int); extern void Check_Input_Port (Object); extern void Discard_Input (Object); extern void Define_Reader (int, READFUN); /* Special forms */ extern Object P_Quote (Object); extern Object P_If (Object); extern Object P_Let (Object); extern Object P_Letseq (Object); extern Object P_Letrec (Object); extern Object P_Case (Object); extern Object P_Cond (Object); extern Object P_And (Object); extern Object P_Or (Object); extern Object P_Do (Object); extern Object P_Quasiquote (Object); extern Object P_Fluid_Let (Object); extern Object P_Begin (Object); extern Object P_Begin1 (Object); /* Strings */ extern Object Make_String (const char*, unsigned int); extern Object Make_Const_String (const char*, unsigned int); extern Object P_Make_String (int, Object*); extern Object P_Stringp (Object); extern Object P_String (int, Object*); extern Object P_String_To_Number (int, Object*); extern Object P_String_Eq (Object, Object); extern Object P_String_Less (Object, Object); extern Object P_String_Greater (Object, Object); extern Object P_String_Eq_Less (Object, Object); extern Object P_String_Eq_Greater (Object, Object); extern Object P_String_CI_Eq (Object, Object); extern Object P_String_CI_Less (Object, Object); extern Object P_String_CI_Greater (Object, Object); extern Object P_String_CI_Eq_Less (Object, Object); extern Object P_String_CI_Eq_Greater (Object, Object); extern Object P_String_Length (Object); extern Object P_String_Ref (Object, Object); extern Object P_String_Set (Object, Object, Object); extern Object P_Substring (Object, Object, Object); extern Object P_String_Copy (Object); extern Object P_String_Append (int, Object*); extern Object P_List_To_String (Object); extern Object P_String_To_List (Object); extern Object P_Substring_Fill (Object, Object, Object, Object); extern Object P_String_Fill (Object, Object); extern Object P_Substringp (Object, Object); extern Object P_CI_Substringp (Object, Object); extern int String_Getc (Object); extern void String_Ungetc (Object, register int); /* Symbols, variables, frequently used Scheme objects */ extern_c Object elk_import Null; extern_c Object elk_import True; extern_c Object elk_import False; extern_c Object elk_import Void; extern_c Object elk_import Newline; extern_c Object elk_import Eof; extern_c Object elk_import Unspecified; extern Object Intern (const char*); extern Object CI_Intern (const char*); extern Object P_Oblist (void); extern Object P_Symbolp (Object); extern Object P_Symbol_To_String (Object); extern Object P_String_To_Symbol (Object); extern Object P_Put (int, Object*); extern Object P_Get (Object, Object); extern Object P_Symbol_Plist (Object); extern void Define_Variable (Object*, const char*, Object); extern void Define_Symbol (Object *, const char*); extern Object Sym_Else; extern Object Var_Get (Object); extern void Var_Set (Object, Object); extern int Var_Is_True (Object); extern unsigned long int Symbols_To_Bits (Object, int, SYMDESCR*); extern Object Bits_To_Symbols (unsigned long int, int, SYMDESCR*); /* Termination functions */ extern void Register_Object (Object, GENERIC, PFO, int); extern void Deregister_Object (Object); extern Object Find_Object (int, GENERIC, MATCHFUN, ...); extern void Terminate_Group (GENERIC); extern void Terminate_Type (int); /* Types, Define_Type() */ extern TYPEDESCR *Types; extern Object P_Type (Object); extern void Wrong_Type (Object, int) elk_attribute(__noreturn__); extern void Wrong_Type_Combination (Object, const char*) elk_attribute(__noreturn__); extern int Define_Type (int, const char*, int (*)(Object), int, int (*)(Object, Object), int (*)(Object, Object), int (*)(Object, Object, int, int, int), int (*)(Object*, int (*)(Object*)) ); /* Vectors */ extern Object Make_Vector (unsigned int, Object); extern Object Make_Const_Vector (unsigned int, Object); extern Object P_Make_Vector (int, Object*); extern Object P_Vectorp (Object); extern Object P_Vector (int, Object*); extern Object P_Vector_Length (Object); extern Object P_Vector_Ref (Object, Object); extern Object P_Vector_Set (Object, Object, Object); extern Object P_Vector_To_List (Object); extern Object P_List_To_Vector (Object); extern Object P_Vector_Fill (Object, Object); extern Object P_Vector_Copy (Object); C_LINKAGE_END elk-3.99.8/include/exception.h0000644000175000017500000000500511577076306013126 00000000000000/* exception.h * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #ifdef HAVE_SIGNAL_H # include #endif extern int Intr_Was_Ignored; extern unsigned long Intr_Level; #if defined(HAVE_SIGPROCMASK) extern sigset_t Sigset_Old, Sigset_Block; #elif defined(HAVE_SIGBLOCK) extern int Sigmask_Old, Sigmask_Block; #else C_LINKAGE_BEGIN extern void Intr_Handler (int); C_LINKAGE_END #endif #if defined(HAVE_SIGPROCMASK) || ! defined(HAVE_SIGBLOCK) # ifndef sigmask # define sigmask(n) (1 << ((n)-1)) # endif #endif #define Disable_Interrupts {\ if (Intr_Level++ == 0) Force_Disable_Interrupts;\ } #define Enable_Interrupts {\ if (Intr_Level > 0 && --Intr_Level == 0) Force_Enable_Interrupts;\ } #ifdef HAVE_SIGPROCMASK #define Force_Disable_Interrupts (void)sigprocmask (SIG_BLOCK, &Sigset_Block,\ (sigset_t *)0) #define Force_Enable_Interrupts (void)sigprocmask (SIG_SETMASK, &Sigset_Old,\ (sigset_t *)0) #elif defined(HAVE_SIGBLOCK) #define Force_Disable_Interrupts (void)sigblock (Sigmask_Block) #define Force_Enable_Interrupts (void)sigsetmask (Sigmask_Old) #else #define Force_Disable_Interrupts {\ if (!Intr_Was_Ignored) (void)signal (SIGINT, SIG_IGN);\ } #define Force_Enable_Interrupts {\ if (!Intr_Was_Ignored) (void)signal (SIGINT, Intr_Handler);\ } #endif elk-3.99.8/include/object.h0000644000175000017500000002360511577076306012404 00000000000000/* object.h: The Scheme object representation, and a few other important * data types. * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include #include typedef struct { int64_t data; int tag; } Object; #define FIXBITS (8 * (int)sizeof(int)) #define SIGNBIT ((unsigned int)1 << (FIXBITS-1)) #define CONSTBIT 1 #define TYPEBITS (8 * (int)sizeof(int) - 1) #define MAX_TYPE ((1 << TYPEBITS) - 1) #define UFIXNUM_FITS(i) (((i) & SIGNBIT) == 0) #define FIXNUM_FITS(i) 1 #define TYPE(x) ((x).tag >> 1) #define FIXNUM(x) ((int)(x).data) #define CHAR(x) ((int)(x).data) #define POINTER(x) ((void *)(uintptr_t)(x).data) #define SETPOINTER(x,p) ((x).data = (uintptr_t)(void *)(p)) #define SET(x,t,p) ((x).tag = (int)t << 1, (x).data = (p)) #define ISCONST(x) ((x).tag & CONSTBIT) #define SETCONST(x) ((x).tag |= CONSTBIT) #define EQ(x,y) ((x).data == (y).data && (x).tag == (y).tag) /* GC related macros: */ #define WAS_FORWARDED(obj) (TYPE(*(Object *)POINTER(obj)) == T_Broken_Heart) #define UPDATE_OBJ(obj) SETPOINTER(obj, POINTER(*(Object *)POINTER(obj))) #ifdef GENERATIONAL_GC typedef int gcspace_t; /* type for space and type arrays */ typedef uintptr_t gcptr_t; /* type for pointers */ typedef uintptr_t pageno_t; /* type for page numbers */ typedef uintptr_t addrarith_t; /* type for address arithmetic */ extern gcspace_t *space; extern gcspace_t current_space; C_LINKAGE_BEGIN extern int Visit (Object*); /* required for REVIVE_OBJ below */ C_LINKAGE_END # ifdef ARRAY_BROKEN extern pageno_t pagebase; # else # define pagebase ((pageno_t)0) # endif # define PAGEBYTES 512 # define PAGE_TO_OBJ(p) ((Object *) (((p) + pagebase) * PAGEBYTES)) # define OBJ_TO_PAGE(p) ((((gcptr_t)POINTER(p)) / PAGEBYTES) - pagebase) # define STABLE(x) ((~space[(x)]) & 1) # define MAKEOBJ(o,t,p) (SET(o, t, p)) # define IS_ALIVE(obj) ((WAS_FORWARDED(obj)) || \ (STABLE(OBJ_TO_PAGE(obj))) || \ (space[OBJ_TO_PAGE(obj)] == current_space)) # define REVIVE_OBJ(obj) Visit (&obj); #else C_LINKAGE_BEGIN extern int Visit (Object*); /* required in heap.c */ C_LINKAGE_END # define IS_ALIVE(obj) WAS_FORWARDED(obj) # define REVIVE_OBJ(obj) #endif /* Fixed types. Cannot use enum, because the set of types is extensible: */ #define T_Fixnum 0 /* Must be 0 */ #define T_Bignum 1 #define T_Flonum 2 #define T_Null 3 /* empty list */ #define T_Boolean 4 /* #t (1) and #f (0) */ #define T_Unbound 5 /* only used internally */ #define T_Special 6 /* only used internally */ #define T_Character 7 #define T_Symbol 8 #define T_Pair 9 #define T_Environment 10 /* A pair */ #define T_String 11 #define T_Vector 12 #define T_Primitive 13 /* Primitive procedure */ #define T_Compound 14 /* Compound procedure */ #define T_Control_Point 15 #define T_Promise 16 /* Result of (delay expression) */ #define T_Port 17 #define T_End_Of_File 18 #define T_Unspecified 19 /* only used internally */ #define T_Autoload 20 #define T_Macro 21 #define T_Broken_Heart 22 /* only used internally */ #ifdef GENERATIONAL_GC # define T_Align_8Byte 23 /* only used internally */ # define T_Freespace 24 /* only used internally */ #endif #define BIGNUM(x) ((struct S_Bignum *)POINTER(x)) #define FLONUM(x) ((struct S_Flonum *)POINTER(x)) #define STRING(x) ((struct S_String *)POINTER(x)) #define VECTOR(x) ((struct S_Vector *)POINTER(x)) #define SYMBOL(x) ((struct S_Symbol *)POINTER(x)) #define PAIR(x) ((struct S_Pair *)POINTER(x)) #define PRIM(x) ((struct S_Primitive *)POINTER(x)) #define COMPOUND(x) ((struct S_Compound *)POINTER(x)) #define CONTROL(x) ((struct S_Control *)POINTER(x)) #define PROMISE(x) ((struct S_Promise *)POINTER(x)) #define PORT(x) ((struct S_Port *)POINTER(x)) #define AUTOLOAD(x) ((struct S_Autoload *)POINTER(x)) #define MACRO(x) ((struct S_Macro *)POINTER(x)) typedef uint16_t gran_t; /* Granularity of bignums */ struct S_Bignum { Object minusp; unsigned int size; /* Number of uint16_t allocated */ unsigned int usize; /* Number of uint16_t actually used */ gran_t data[1]; /* Data, lsw first */ }; struct S_Flonum { Object tag; /* Each S_Foo must start with an Object */ double val; }; struct S_Symbol { Object value; Object next; Object name; /* A string */ Object plist; }; struct S_Pair { Object car, cdr; }; struct S_String { Object tag; unsigned int size; char data[1]; }; struct S_Vector { Object tag; unsigned int size; Object data[1]; }; enum discipline { EVAL, NOEVAL, VARARGS }; struct S_Primitive { Object tag; Object (*fun) (); const char *name; int minargs; int maxargs; /* Or MANY */ enum discipline disc; }; #define MANY 100 struct S_Compound { Object closure; /* (lambda (args) form ...) */ Object env; /* Procedure's environment */ int min_args, max_args; int numforms; Object name; }; typedef struct wind { struct wind *next, *prev; Object inout; /* Pair of thunks */ } WIND; typedef struct funct { struct funct *next; char *name; void (*func) (void); } FUNCT; typedef struct gcnode { struct gcnode *next; int gclen; Object *gcobj; } GCNODE; typedef struct mem_node { struct mem_node *next; unsigned int len; unsigned long int refcnt; } MEM_NODE; #if defined(vax) || defined(__vax__) typedef int jmp_buf[17]; #else # include #endif struct S_Control { Object env; GCNODE *gclist; MEM_NODE *memlist; Object memsave; /* string */ Object gcsave; /* vector */ WIND *firstwind, *lastwind; int tailcall; intptr_t delta; #ifdef GENERATIONAL_GC int reloc; #endif jmp_buf j; unsigned int size; unsigned long int intrlevel; char stack[1]; /* must be word aligned */ }; struct S_Promise { Object env; Object thunk; int done; }; struct S_Port { Object name; /* string */ uint16_t flags; char unread; unsigned int ptr; FILE *file; unsigned int lno; int (*closefun) (FILE*); }; #define P_OPEN 1 /* flags */ #define P_INPUT 2 #define P_STRING 4 #define P_UNREAD 8 #define P_BIDIR 16 #define IS_INPUT(port) (PORT(port)->flags & (P_INPUT|P_BIDIR)) #define IS_OUTPUT(port) ((PORT(port)->flags & (P_INPUT|P_BIDIR)) != P_INPUT) struct S_Autoload { Object files; Object env; }; struct S_Macro { Object body; int min_args, max_args; Object name; }; /* "size" is called with one object and returns the size of the object. * If "size" is NOFUNC, then "const_size" is taken instead. * "eqv" and "equal" are called with two objects and return 0 or 1. * NOFUNC may be passed instead (then eqv and equal always return #f). * "print" is called with an object, a port, a flag indicating whether * the object is to be printed "raw" (a la display), the print-depth, * and the print-length. * "visit" is called with a pointer to an object and a function. * For each component of the object, the function must be called with * a pointer to the component. NOFUNC may be supplied. */ typedef struct { int haspointer; const char *name; int (*size) (Object); int const_size; int (*eqv) (Object, Object); int (*equal) (Object, Object); int (*print) (Object, Object, int, int, int); int (*visit) (Object*, int (*)(Object*)); } TYPEDESCR; #ifdef ELK_USE_PROTOTYPES # define NOFUNC 0 #else # define NOFUNC ((int (*)())0) #endif typedef struct sym { struct sym *next; char *name; unsigned long int value; } SYM; typedef struct { SYM *first; char *strings; } SYMTAB; typedef struct { char *name; int type; } SYMPREFIX; #define PR_EXTENSION 0 /* Elk extension initializers/finalizers */ #define PR_CONSTRUCTOR 1 /* C++ static constructors/destructors */ /* PFO, GENERIC, and MATCHFUN exist for backwards compatibility */ typedef Object (*PFO) (Object); typedef int (*MATCHFUN) (); #define GENERIC char* typedef struct weak_node { struct weak_node *next; Object obj; PFO term; GENERIC group; char flags; } WEAK_NODE; /* flags */ #define WK_LEADER 1 typedef struct { char *name; unsigned long int val; } SYMDESCR; /* Function that can be registered as a reader by Define_Reader(): */ typedef Object (*READFUN) (Object, int, int); elk-3.99.8/include/kernel.h0000644000175000017500000000311711577076306012412 00000000000000/* kernel.h: The `wrapper' include file used by the interpreter. * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #ifndef KERNEL_H #define KERNEL_H #include #include #include "site.h" #include "funcproto.h" #include "param.h" #include "object.h" #include "intern.h" #include "extern.h" #include "misc.h" #include "exception.h" #include "gc.h" #include "type.h" #include "stkmem.h" #include "cstring.h" #include "compat.h" #endif elk-3.99.8/include/funcproto.h0000644000175000017500000000263111577076306013151 00000000000000/* funcproto.h: These definitions are not tunable. Do not change them. * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #ifdef __cplusplus # define C_LINKAGE_BEGIN extern "C" { # define C_LINKAGE_END } #else # define C_LINKAGE_BEGIN # define C_LINKAGE_END #endif elk-3.99.8/include/scheme.h0000644000175000017500000000303711577076306012377 00000000000000/* scheme.h: The `wrapper' include file used by extensions and applications. * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #ifndef SCHEME_H #define SCHEME_H #include "site.h" #include "funcproto.h" #include "param.h" #include "object.h" #include "extern.h" #include "misc.h" #include "exception.h" #include "gc.h" #include "type.h" #include "stkmem.h" #include "cstring.h" #include "compat.h" #endif elk-3.99.8/include/misc.h0000644000175000017500000000546411577076306012074 00000000000000/* misc.h * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ extern_c Object elk_import False2; #define Nullp(x) (TYPE(x) == T_Null) #define Truep(x) (!EQ(x,False) && !EQ(x,False2)) #define Car(x) PAIR(x)->car #define Cdr(x) PAIR(x)->cdr #define Cons P_Cons #define Begin P_Begin #define Assq(x,y) General_Assoc(x,y,0) #define Print(x) General_Print_Object (x, Curr_Output_Port, 0) #define Numeric(t) (t == T_Fixnum || t == T_Flonum || t == T_Bignum) #define Whitespace(c) (c == ' ' || c == '\t' || c == '\014' || c == '\n' || c == '\r') #define Delimiter(c) (c == ';' || c == ')' || c == '(' || c == '[' || c == ']' || c == '"') /* Align heap addresses */ #ifdef ALIGN_8BYTE # define ELK_ALIGN(ptr) ((ptr) = (void *)(((intptr_t)(ptr) + 7) & ~7)) #else # define ELK_ALIGN(ptr) ((ptr) = (void *)(((intptr_t)(ptr) + 3) & ~3)) #endif /* Normalize stack addresses */ #define NORM(addr) ((intptr_t)(addr) + delta) /* Used in special forms: */ extern int Tail_Call; #define TC_Prolog register int _t = Tail_Call #define TC_Disable Tail_Call = 0 #define TC_Enable Tail_Call = _t /* Macros to be used by readers registered with Define_Reader(). * They operate on variables c, port, f, and str. */ #define Reader_Getc {\ c = str ? String_Getc (port) : getc (f);\ if (c == '\n') PORT(port)->lno++;\ } #define Reader_Ungetc {\ if (str) String_Ungetc (port,c); else (void)ungetc (c,f);\ if (c == '\n') if (PORT(port)->lno > 1) PORT(port)->lno--;\ } #define Reader_Tweak_Stream {\ if (!str && (feof (f) || ferror (f))) clearerr (f);\ } #define Reader_Sharp_Eof {\ Reader_Tweak_Stream;\ Reader_Error (port, "end of file after `#'");\ } elk-3.99.8/include/cstring.h0000644000175000017500000000357511577076306012613 00000000000000/* cstring.h * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ /* These must be defined as macros, because they use Alloca(). */ #define Get_String_Stack(_from,_to) {\ unsigned int _len;\ Check_Type(_from, T_String);\ _len = STRING(_from)->size;\ Alloca ((_to), char*, _len+1);\ memcpy ((_to), STRING(_from)->data, _len);\ (_to)[_len] = '\0';\ } #define Get_Strsym_Stack(_from,_to) {\ unsigned int _len;\ if (TYPE(_from) == T_Symbol)\ (_from) = SYMBOL(_from)->name;\ else if (TYPE(_from) != T_String)\ Wrong_Type_Combination ((_from), "string or symbol");\ _len = STRING(_from)->size;\ Alloca ((_to), char*, _len+1);\ memcpy ((_to), STRING(_from)->data, _len);\ (_to)[_len] = '\0';\ } elk-3.99.8/include/compat.h0000644000175000017500000000664411577076306012425 00000000000000/* compat.h: Definitions that were used in older versions of Elk, but are * now obsolete and should not be used any longer. * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #define Declare_C_Strings Alloca_Begin #define Make_C_String Get_Strsym_Stack #define Dispose_C_Strings Alloca_End #define Val(x) Cdr(x) #define FIXNUM_FITS_UNSIGNED UFIXNUM_FITS #define SETFAST(x,y) ((x) = (y)) #define Make_Fixnum Make_Integer /* The names of a few functions implementing primitives have been changed * for consistency: */ #define P_Setcar P_Set_Car #define P_Setcdr P_Set_Cdr #define P_With_Input P_With_Input_From_File #define P_With_Output P_With_Output_To_File #define P_Call_With_Input P_Call_With_Input_File #define P_Call_With_Output P_Call_With_Output_File #define P_Call_CC P_Call_With_Current_Continuation #define P_Promise_Env P_Promise_Environment #define P_Procedure_Env P_Procedure_Environment #define P_Control_Point_Env P_Control_Point_Environment #define P_Curr_Input_Port P_Current_Input_Port #define P_Curr_Output_Port P_Current_Output_Port #define P_Env_List P_Environment_To_List #define P_Char_Lower_Case P_Char_Lower_Casep #define P_Char_Upper_Case P_Char_Upper_Casep #define P_Char_Alphabetic P_Char_Alphabeticp #define P_Char_Numeric P_Char_Numericp #define P_Char_Whitespace P_Char_Whitespacep #define P_Chr_Eq P_Char_Eq #define P_Chr_Less P_Char_Less #define P_Chr_Greater P_Char_Greater #define P_Chr_Eq_Less P_Char_Eq_Less #define P_Chr_Eq_Greater P_Char_Eq_Greater #define P_Chr_CI_Eq P_Char_CI_Eq #define P_Chr_CI_Less P_Char_CI_Less #define P_Chr_CI_Greater P_Char_CI_Greater #define P_Chr_CI_Eq_Less P_Char_CI_Eq_Less #define P_Chr_CI_Eq_Greater P_Char_CI_Eq_Greater #define P_Str_Eq P_String_Eq #define P_Str_Less P_String_Less #define P_Str_Greater P_String_Greater #define P_Str_Eq_Less P_String_Eq_Less #define P_Str_Eq_Greater P_String_Eq_Greater #define P_Str_CI_Eq P_String_CI_Eq #define P_Str_CI_Less P_String_CI_Less #define P_Str_CI_Greater P_String_CI_Greater #define P_Str_CI_Eq_Less P_String_CI_Eq_Less #define P_Str_CI_Eq_Greater P_String_CI_Eq_Greater elk-3.99.8/include/Makefile.am0000644000175000017500000000041311577076306013011 00000000000000NULL = pkginclude_HEADERS = \ compat.h \ cstring.h \ exception.h \ extern.h \ funcproto.h \ gc.h \ intern.h \ kernel.h \ misc.h \ object.h \ param.h \ scheme.h \ stkmem.h \ type.h \ $(NULL) nodist_pkginclude_HEADERS = site.h EXTRA_DIST = site.h.in elk-3.99.8/include/site.h.in0000644000175000017500000000473511577076306012512 00000000000000/* site.h.in: Site-local features. * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ /* The C99 integer types header */ #include @STDINT_HEADER@ /* C Compiler features */ #ifndef __GNUC__ # define __asm__ asm #endif /* Under gcc, we use the __attribute__ macro to tell the compiler that a * function does not return. */ #ifdef __GNUC__ # define elk_attribute(att) __attribute__ ((att)) #else # define elk_attribute(att) /* */ #endif /* Properly export Win32 symbols */ #if (defined(_WIN32) || defined(__CYGWIN__)) && \ !(defined(ELK_BUILD_DLL) || defined(ELK_STATIC)) # define elk_import __declspec(dllimport) #else # define elk_import /* */ #endif #if defined(__cplusplus) # define extern_c extern "C" #else # define extern_c extern #endif /* Directory separator */ #ifdef WIN32 # define SEPARATOR_CHAR '\\' # define SEPARATOR_STRING "\\" #else # define SEPARATOR_CHAR '/' # define SEPARATOR_STRING "/" #endif /* Arithmetic shift right for compilers that don't sign extend: */ #if (-1 >> 1) < 0 # define ASR(n,s) ((n) >>= (s)) #else # define NBITS(v) ((sizeof v) * 8) # define HIBIT(v,n) (NBITS(v) - (n)) # define ASR(n,s) ((n) >>= (s),\ ((n) & (1 << (HIBIT((n),(s)) - 1)) ?\ ((n) |= ~(((unsigned)1 << HIBIT((n),(s))) - 1)) :\ (n))) #endif elk-3.99.8/include/param.h0000644000175000017500000000474011577076306012235 00000000000000/* param.h: These definitions are not intended to be tunable. Do not change * them unless you _must_. * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ /* Name of Scheme file which is always loaded on startup: */ #define INITFILE "initscheme.scm" /* Name of environment variable holding initial load-path: */ #define LOADPATH_ENV "ELK_LOADPATH" /* Size of `obarray' (symbol hash table): */ #define OBARRAY_SIZE 1009 /* Approximate size of gap between beginning of stack and `stkbase' * (subtracted from stack limit on startup): */ #define STACK_MARGIN (64*1024) /* Minimum number of bytes that must be reclaimed by a run of the * stop-and-copy garbage collector: */ #define HEAP_MARGIN (HEAP_SIZE/10*1024) /* The buffers maintained by output string ports grow in increments * of STRING_GROW_SIZE when written: */ #define STRING_GROW_SIZE 64 /* Initial print depth and print length: */ #define DEF_PRINT_DEPTH 20 #define DEF_PRINT_LEN 1000 /* Offset to compensate for differences in argv/environment between base * a.out and dumped a.out on startup (see src/main.c): */ #ifdef CAN_DUMP # define INITIAL_STK_OFFSET (20*1024) /* 2*NCARGS */ #endif /* Number of static string buffers cyclically reused by Get_String() * and Get_Strsym(): */ #define NUMSTRBUFS 3 elk-3.99.8/include/gc.h0000644000175000017500000001113111577076306011516 00000000000000/* gc.h * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ extern GCNODE *GC_List; #define TAG_FUN -1 #define TAG_TCFUN -2 #define TAG_ARGS -3 #define TAG_ENV -4 #define GC_Node GCNODE gc1 #define GC_Node2 GCNODE gc1, gc2 #define GC_Node3 GCNODE gc1, gc2, gc3 #define GC_Node4 GCNODE gc1, gc2, gc3, gc4 #define GC_Node5 GCNODE gc1, gc2, gc3, gc4, gc5 #define GC_Node6 GCNODE gc1, gc2, gc3, gc4, gc5, gc6 #define GC_Node7 GCNODE gc1, gc2, gc3, gc4, gc5, gc6, gc7 #define GC_Link(x) {\ gc1.gclen = 0; gc1.gcobj = &x; gc1.next = GC_List; GC_List = &gc1;\ } #define GC_Link2(x1,x2) {\ gc1.gclen = 0; gc1.gcobj = &x1; gc1.next = GC_List;\ gc2.gclen = 0; gc2.gcobj = &x2; gc2.next = &gc1; GC_List = &gc2;\ } #define GC_Link3(x1,x2,x3) {\ gc1.gclen = 0; gc1.gcobj = &x1; gc1.next = GC_List;\ gc2.gclen = 0; gc2.gcobj = &x2; gc2.next = &gc1;\ gc3.gclen = 0; gc3.gcobj = &x3; gc3.next = &gc2; GC_List = &gc3;\ } #define GC_Link4(x1,x2,x3,x4) {\ gc1.gclen = 0; gc1.gcobj = &x1; gc1.next = GC_List;\ gc2.gclen = 0; gc2.gcobj = &x2; gc2.next = &gc1;\ gc3.gclen = 0; gc3.gcobj = &x3; gc3.next = &gc2;\ gc4.gclen = 0; gc4.gcobj = &x4; gc4.next = &gc3; GC_List = &gc4;\ } /* see src/proc.c */ #define GC_Link4_Tag_Primitive(args,fun,env,x4) {\ gc1.gclen = TAG_ARGS; gc1.gcobj = &args; gc1.next = GC_List;\ gc2.gclen = Tail_Call ? TAG_TCFUN : TAG_FUN;\ gc2.gcobj = &fun; gc2.next = &gc1;\ gc3.gclen = TAG_ENV; gc3.gcobj = &env; gc3.next = &gc2;\ gc4.gclen = 0; gc4.gcobj = &x4; gc4.next = &gc3; GC_List = &gc4;\ } #define GC_Link5(x1,x2,x3,x4,x5) {\ gc1.gclen = 0; gc1.gcobj = &x1; gc1.next = GC_List;\ gc2.gclen = 0; gc2.gcobj = &x2; gc2.next = &gc1;\ gc3.gclen = 0; gc3.gcobj = &x3; gc3.next = &gc2;\ gc4.gclen = 0; gc4.gcobj = &x4; gc4.next = &gc3;\ gc5.gclen = 0; gc5.gcobj = &x5; gc5.next = &gc4; GC_List = &gc5;\ } #define GC_Link6(x1,x2,x3,x4,x5,x6) {\ gc1.gclen = 0; gc1.gcobj = &x1; gc1.next = GC_List;\ gc2.gclen = 0; gc2.gcobj = &x2; gc2.next = &gc1;\ gc3.gclen = 0; gc3.gcobj = &x3; gc3.next = &gc2;\ gc4.gclen = 0; gc4.gcobj = &x4; gc4.next = &gc3;\ gc5.gclen = 0; gc5.gcobj = &x5; gc5.next = &gc4;\ gc6.gclen = 0; gc6.gcobj = &x6; gc6.next = &gc5; GC_List = &gc6;\ } #define GC_Link7(x1,x2,x3,x4,x5,x6,x7) {\ gc1.gclen = 0; gc1.gcobj = &x1; gc1.next = GC_List;\ gc2.gclen = 0; gc2.gcobj = &x2; gc2.next = &gc1;\ gc3.gclen = 0; gc3.gcobj = &x3; gc3.next = &gc2;\ gc4.gclen = 0; gc4.gcobj = &x4; gc4.next = &gc3;\ gc5.gclen = 0; gc5.gcobj = &x5; gc5.next = &gc4;\ gc6.gclen = 0; gc6.gcobj = &x6; gc6.next = &gc5;\ gc7.gclen = 0; gc7.gcobj = &x7; gc7.next = &gc6; GC_List = &gc7;\ } /* see src/proc.c */ #define GC_Link7_Tag_Compound(args,fun,env,x4,x5,x6,x7) {\ gc1.gclen = TAG_ARGS;\ gc1.gcobj = &args; gc1.next = GC_List;\ gc2.gclen = Tail_Call ? TAG_TCFUN : TAG_FUN;\ gc2.gcobj = &fun; gc2.next = &gc1;\ gc3.gclen = TAG_ENV;\ gc3.gcobj = &env; gc3.next = &gc2;\ gc4.gclen = 0; gc4.gcobj = &x4; gc4.next = &gc3;\ gc5.gclen = 0; gc5.gcobj = &x5; gc5.next = &gc4;\ gc6.gclen = 0; gc6.gcobj = &x6; gc6.next = &gc5;\ gc7.gclen = 0; gc7.gcobj = &x7; gc7.next = &gc6; GC_List = &gc7;\ } #define GC_Unlink (GC_List = gc1.next) C_LINKAGE_BEGIN extern void Func_Global_GC_Link (Object*); C_LINKAGE_END #define Global_GC_Link(x) Func_Global_GC_Link(&x) elk-3.99.8/BUGS0000644000175000017500000000324711577076306010025 00000000000000$Id$ Generational/Incremental Garbage Collector The generational, incremental garbage collector still is considered experimental, although it stands up well in some real applications. Here is a list of known problems: o On a Sun (Sun-4/SunOS4 or 5) when compiling Elk with gcc (2.6.3 or older), the generational garbage collector sometimes loops (when working in non-incremental mode). This can be circumvented by compiling src/proc.c (yes, proc.c, not heap.c) without the -O option. We are not sure yet whether this is a bug in Elk or in gcc. o Running out of memory when expanding the heap shouldn't be handled as a fatal error. Instead, the garbage collector should clean up and then invoke Uncatchable_Error() to return control to the Scheme program. o The return value of ExpandHeap() is sometimes ignored. o When running the program (garbage-collect-status 'generational 'incremental) (define (f) (make-list 10000 'a) (f)) (f) the pairs in the lists become stable quickly and aren't reclaimed, as the current algorithm favors heap expansions over full collections. o With the same test program, the GC sometimes crashes with SIGSEGV after having expanded the heap to 9MB. o Under HP-UX 9.0 and AIX 4.1, the GC doesn't work in incremental mode (a broken-heart is passed to Memoize_Frame() after an ExpandHeap()). o The percentage displayed at the end of a GC run is sometimes wrong. Other bugs Almost no Unix commands work under Win32, and they are badly disabled. bignum/double comparisons are not perfect, see scm's scm_bigdblcomp for a better implementation. elk-3.99.8/MACHINES0000644000175000017500000001364111577076306010453 00000000000000$Id$ Sun-3 and Sun-4, SunOS 4.1 o Tested with /bin/cc, various gcc versions, and with the Sun SPARCompiler 2.0.1 (acc). o For compiling Elk with gcc and the generational garbage collector, see the remark in the file BUGS. Sun-4, SunOS 5.2 (Solaris 2.2) o Tested with various gcc versions and with ANSI SPARCompiler 2.0.1. If you have gcc, however, you should use it rather than the Sun compiler. gcc produces much faster code. o The Motif extension has been tested with both vanilla OSF Motif 1.2 as well as Sun's version of Motif (which usually lives in /usr/dt). The X11 extensions have been tested with OpenWindows in addition to X Consortium X11R6. o Certain versions of gcc complain about syntax errors in code that uses sigset_t (from ), although this should not happen unless -ansi is given. A possible fix is to add add -D__STDC__=0 to the cflags in the config file. DECstation 5100, Ultrix 4.2 o Prototypes have been disabled in the config file, as cc has trouble with certain forms of prototype declarations (this looks like a bug). o The LDFLAGS "-Wl,-D,800000" are required for dynamic loading to work. o You have to create "-G 0" versions of all X libraries to be able to dynamically load the X11 extensions of Elk (the MIPS linker requires this). DEC/Alpha, OSF/1 o This platform uses ELF and the dlopen()-style linker interface. SGI IRIS Indy, Irix 5.3 o examples/unix/calc.scm doesn't work, because /usr/bin/dc uses buffered output if stdout is not a terminal. o For Irix 5.2, -lSM and -lICE must be removed from the libx* definitions in config/site (the X11 version seems to be X11R5). HP 9000/700, HP-UX 9.0 and HP-UX 10.0 o Dynamic loading is based on the shl_load() interface to the dynamic linker of HP-UX. If you are writing your own extensions, compile them with the option +z and use $install_dir/lib/makedl to link them. The load-libraries are simply shl_loaded before the files passed to the "load" primitives. Each load-library is only loaded once. o wait3 has been set to `no' in the system file, because this function has a non-standard third argument in HP-UX 9.0. o HP-UX 10 does have a stack-extending alloca() (in contrast to HP-UX 9.0), but it has a serious bug and therefore is not used by Elk (the function overwrites its argument if it is a register variable). o The incremental garbage collector doesn't work (see the file BUGS). o The Athena widgets are not included with HP-UX 9.0. IBM RS/6000, AIX 3.2 o Dynamic loading does not work. It is not clear whether the dynamic loading semantics of Elk can be implemented with the dynamic linker interface of AIX at all. PowerPC, AIX 4.1 (xlc and gcc) o No dynamic loading. o The incremental garbage collector doesn't work (see the file BUGS). NeXT workstation, MACH/NeXT-OS 3.3 o Dynamic loading is implemented by means of the rld_load() library function. Due to what looks like a bug in rld_load(), it only works sometimes. In particular, it is not possible to load the UNIX extension. The source of the problem seems to be that sometimes the string table of the newly loaded object file gets truncated when being mapped into memory by rld_load(). You can observe the problem by inserting a statement like "write(1, strtab, sym_cmd->strsize);" right after the line beginning with "strtab =" in src/stab-macho.c. o Linking extensions statically with the interpreter doesn't work either; there are no symbols in the symbol table when it is read on startup of the executable. This seems to be related to the bug described above. These two problems render Elk virtually unusable on the NeXT. 386/486-PC, Linux 1.2.8 o examples/unix/calc.scm doesn't work, because /usr/bin/dc uses buffered output if stdout is not a terminal. 386/486-PC, 32-bit gcc (DJGPP) and `go32' DOS extender o Elk 3.0 has not been tested on this platform. o As the typical DOS machine doesn't have a fully functional UNIX shell, sed, etc., you have to cross-localize the source tree on a UNIX machine (i.e. create all the localized Makefiles, create include/config.h, etc.). To do so, just copy the DOS config file to config/system (or make a link), edit config/site, and call make localized.zip This cleans the source tree, performs the necessary localizations, and packages a minimal distribution into a zip file. You can then FTP the zip file to the DOS machine and run `make' there. The zip file basically contains the interpreter sources, the Scheme files needed at runtime, the extensions in lib/misc, and the localized Makefiles and include files. X Window System o You need either X11R4, X11R5, X11R6, or (on Suns) OpenWindows 3.x to use the Elk/X11 extensions. The current release of Elk has been tested with X11R6 and OpenWindows. If you are still running X11R4, edit the file lib/xaw/build and remove the lines referring to the Athena widgets that are new in X11R5 (panner, porthole, repeater, and tree). If you are running X11R5 or older, you may want to edit lib/xaw/build and add lines for the `clock' widget. Also, remove -lSM and -lICE from the definitions in config/site. examples/xaw/porthole.scm and examples/xaw/viewport.scm don't work with X11R6, as they are using the clock widget which doesn't exist any longer. Motif Widgets o You need at least Motif 1.1 to use the Elk/Motif extension. The current release of Elk has been tested with OSF/Motif 1.2 and, under Solaris 2.4, with Sun Motif (/usr/dt). Make sure that X11 has been compiled with the symbol MotifBC set to YES in site.def. elk-3.99.8/configure.ac0000644000175000017500000004643111577103326011623 00000000000000# $Id$ AC_INIT(src/main.c) AC_PREREQ(2.50) AC_CONFIG_AUX_DIR(.auto) AC_CANONICAL_SYSTEM AM_INIT_AUTOMAKE(elk, 3.99.8) dnl AM_MAINTAINER_MODE AM_CONFIG_HEADER(config.h) AC_PROG_CC AM_PROG_CC_C_O AC_PROG_CXX AC_LIBTOOL_WIN32_DLL AC_PROG_LIBTOOL AC_STDC_HEADERS AC_C_CONST AC_C_INLINE AC_TYPE_SIZE_T # Check whether we are doing a native build AM_CONDITIONAL(NATIVE_BUILD, test "${cross_compiling}" = "no") AC_CHECK_HEADERS(inttypes.h, [STDINT_HEADER=""], [AC_CHECK_HEADERS(sys/inttypes.h, [STDINT_HEADER=""], [AC_CHECK_HEADERS(sys/_inttypes.h, [STDINT_HEADER=""], [AC_CHECK_HEADERS(stdint.h, [STDINT_HEADER=""], [AC_MSG_ERROR([cannot find C99 integer headers])])])])]) AC_DEFINE_UNQUOTED(STDINT_HEADER, [${STDINT_HEADER}], [Define the C99 integer types header]) AC_SUBST(STDINT_HEADER) # $system should contain the name of this file. It may be used by some # of the build scripts to do things that are specific to one single # type of system. AC_DEFINE_UNQUOTED(SYSTEMTYPE, ["${target_os}"], [Our operating system]) SYSTEM="${target_os}" MATH_LIBS="-lm" case "${target_os}" in *hpux*) AC_DEFINE(ARRAY_BROKEN, 1, [Define if a-=1000; a[1000] doesn't work]) ;; *mingw32*) ELK_CFLAGS="${ELK_CFLAGS} -DELK_BUILD_DLL" ELK_LDFLAGS="${ELK_LDFLAGS} -no-undefined" MATH_LIBS="" SYSTEM="mingw32" ;; *cygwin*) SYSTEM="cygwin" ;; *darwin*) AC_DEFINE(SYS_DARWIN, 1, Define if the system is Darwin) ;; esac ELK_LIBS="${ELK_LIBS} ${MATH_LIBS}" # Various required headers AC_CHECK_HEADERS(pwd.h grp.h sys/resource.h) # The UNIX extension likes to know which of the following system calls, # library functions, and include files are supported by the system. AC_CHECK_HEADERS(utime.h sys/utime.h sys/wait.h sys/times.h dirent.h netdb.h) AC_CHECK_FUNCS(waitpid wait3 wait4 vfork uname gethostname gettimeofday ftime) AC_CHECK_FUNCS(mktemp tmpnam tempnam getcwd getwd rename regcomp environ) AC_MSG_CHECKING(for __environ in unistd.h) AC_EGREP_HEADER(__environ, unistd.h, [AC_MSG_RESULT(yes) AC_DEFINE(__ENVIRON_IN_UNISTD_H, 1, Define if defines __environ)], [AC_MSG_RESULT(no)]) AC_MSG_CHECKING(for environ in unistd.h) AC_EGREP_HEADER(environ, unistd.h, [AC_MSG_RESULT(yes) AC_DEFINE(ENVIRON_IN_UNISTD_H, 1, Define if defines environ)], [AC_MSG_RESULT(no)]) # Does the system support the vprintf library function? If not, # availability of the (non-portable) _doprnt function is assumed. AC_CHECK_FUNCS(vprintf) # Does the directory(3) library follow the POSIX conventions (i.e. # requires the include file and uses "struct dirent")? # If not, the (obsolete) BSD-style interface with and # "struct direct" is assumed. AC_CHECK_FUNCS(dirent) # Does the system have the random/srandom library functions? If not, # rand/srand will be used instead. AC_CHECK_FUNCS(random) # Does the system have the index library function? If not, strchr # will be used. AC_CHECK_FUNCS(index) # Does the system have the bcopy, bzero, and bcmp library functions? # If not, memcpy/memset/memcmp will be used. dnl FIXME # Does using the access system call require to be included? # (Look into the manual page for access if in doubt.) AC_CHECK_HEADERS(unistd.h) # If the FIONREAD ioctl command is defined, which file must be included? AC_CHECK_HEADERS(termios.h sys/ioctl.h sys/filio.h) # If getdtablesize() is available to determine the maximum number of open # files per process, set getdtablesize=yes. # Alternatively, if POSIX-style sysconf() can be called with _SC_OPEN_MAX, # set sysconf_open_max=yes. # If neither is set to "yes", an educated guess will be made. AC_CHECK_FUNCS(getdtablesize) # If POSIX-style pathconf() can be invoked with _PC_PATH_MAX to determine # the maximum pathname length, set pathconf_path_max=yes. # If the system page size can be determined by calling getpagesize() # set getpagesize=yes. # Alternatively, if sysconf() can be invoked with _SC_PAGESIZE, set # sysconf_pagesize=yes. # These two variables are only required if the generational garbage # collector is used. AC_CHECK_FUNCS(getpagesize) # Set reliable_signals=bsd if your system supports BSD-style reliable # signals (has sigblock and related functions); set reliable_signals=posix # for POSIX-style signals (sigprocmask, sigsets); otherwise old V7/SysV # signal semantics are assumed. AC_CHECK_HEADERS(signal.h) AC_CHECK_FUNCS(sigprocmask sigblock) # To support dynamic loading of object files and "dump", the system's # a.out format has to be known. Choose one of the following: # # coff ecoff xcoff elf macho hp9k convex # # Other values of "aout_format" are interpreted as BSD-style a.out format. if false; then AC_DEFINE(COFF, 1, [FIXME HARD]) fi if false; then AC_DEFINE(ECOFF, 1, [FIXME HARD]) fi if false; then AC_DEFINE(XCOFF, 1, [FIXME HARD]) fi AC_CHECK_LIB(elf, elf_begin, ac_cv_my_have_elf=yes, ac_cv_my_have_elf=no) AM_CONDITIONAL(HAVE_LIBELF, test "${ac_cv_my_have_elf}" = "yes") if false; then AC_DEFINE(MACH_O, 1, [FIXME HARD]) fi if false; then AC_DEFINE(CONVEX_AOUT, 1, [FIXME HARD]) fi if false; then AC_DEFINE(HP9K, 1, [FIXME HARD]) fi if test "${ac_cv_my_have_elf}" = "yes"; then AC_DEFINE(HAVE_LIBELF, 1, Define if you have libelf.) ELK_LIBS="${ELK_LIBS} -lelf" ac_cv_my_can_dump=yes else ac_cv_my_can_dump=no dnl AC_MSG_ERROR([could not handle the native object format, if you are running Linux please install the libelf development headers]) fi # Which mechanism should be used to dynamically load object files? ac_cv_my_can_load_lib=no # OS X style AC_CHECK_HEADERS(mach-o/dyld.h, [AC_CHECK_FUNCS(NSLinkModule, [AC_DEFINE(HAVE_DL_DYLD, 1, [Define if you have the Darwin dyld API]) AC_DEFINE(SYMS_BEGIN_WITH, ['_'], [Define if symbols start with '_']) ac_cv_my_can_load_lib=yes])]) # HP-UX style if test "${ac_cv_my_can_load_lib}" = "no"; then AC_CHECK_HEADERS(dl.h) ac_cv_my_have_shl_load=no AC_CHECK_FUNC(shl_load, [ac_cv_my_have_shl_load=yes, AC_CHECK_LIB(dld, shl_load, [ac_cv_my_have_shl_load=yes ELK_LIBS="${ELK_LIBS} -ldld"])]) if test "${ac_cv_my_have_shl_load}" = "yes"; then AC_DEFINE(HAVE_DL_SHL_LOAD, 1, [Define if you have the shl_load API]) ac_cv_my_can_load_lib=yes fi fi # Whatever style if test "${ac_cv_my_can_load_lib}" = "no"; then AC_CHECK_LIB(dld, dld_link, [ELK_LIBS="${ELK_LIBS} -ldld" AC_DEFINE(HAVE_DL_DLD_LINK, 1, [Define if you have the GNU dld library]) ac_cv_my_can_load_lib=yes]) fi # BeOS style if test "${ac_cv_my_can_load_lib}" = "no"; then AC_CHECK_HEADERS(image.h) AC_CHECK_FUNCS(load_add_on, [AC_DEFINE(HAVE_DL_BEOS, 1, [Define if you have the BeOS dl]) ac_cv_my_can_load_lib=yes]) fi # Win32 style if test "${ac_cv_my_can_load_lib}" = "no"; then if test "${SYSTEM}" = "mingw32" -o "${SYSTEM}" = "cygwin"; then AC_CHECK_LIB(kernel32, main, [ELK_LIBS="${ELK_LIBS} -lkernel32" AC_DEFINE(HAVE_DL_WINDOWS, 1, [Define if you have Windows' LoadLibrary]) ac_cv_my_can_load_lib=yes]) fi fi AC_CHECK_HEADERS(a.out.h) # Only test for dlopen() if the others didn't work if test "${ac_cv_my_can_load_lib}" = "no"; then AC_CHECK_HEADERS(dlfcn.h sys/dl.h) ac_cv_my_have_dlopen=no AC_CHECK_FUNC(dlopen, ac_cv_my_have_dlopen=yes, AC_CHECK_LIB(dl, dlopen, ac_cv_my_have_dlopen=yes ELK_LIBS="${ELK_LIBS} -ldl", AC_CHECK_LIB(svld, dlopen, ac_cv_my_have_dlopen=yes ELK_LIBS="${ELK_LIBS} -lsvld"))) if test "${ac_cv_my_have_dlopen}" = "yes"; then AC_DEFINE(HAVE_DL_DLOPEN, 1, [Define if you have the dlopen API]) ac_cv_my_can_load_lib=yes fi fi if test "${ac_cv_my_can_load_lib}" = "yes"; then AC_DEFINE(CAN_LOAD_LIB, 1, [Define if dynamic loading is supported]) fi # Systems with "aout_format=ecoff" may require a call to the cacheflush # system call after an object file has been loaded. Which include file # has to be included in this case? AC_DEFINE(CACHECTL_H, , [FIXME HARD]) # Is the ANSI-C atexit function supported to register an exit handler? # If not, the exit library function will be redefined and will end in # a call to _exit. AC_CHECK_FUNCS(atexit) # The symbol prefixes of extension initialization and finalization # functions (without the initial $syms_begin_with). Do not change # these unless the compiler or linker restricts the length of symbols! AC_DEFINE(INIT_PREFIX, "elk_init_", [FIXME HARD]) AC_DEFINE(FINIT_PREFIX, "elk_finit_", [FIXME HARD]) # Is the "dump" function supported? if test "${ac_cv_my_can_dump}" = "yes"; then AC_DEFINE(CAN_DUMP, 1, [FIXME HARD]) fi # Is the fchmod system call broken or unavailable? if false; then AC_DEFINE(FCHMOD_BROKEN, 1, [FIXME HARD]) fi # These four variables are only relevant if the system has the BSD-style # a.out format. # segment_size is the segment size of the system's memory management # unit, i.e. the number to a multiple of which the size of an a.out # segment (e.g. .text) is rounded up. # file_text_start is the file offset at which the text segment starts # in an a.out file. # mem_text_start is the starting address of the text segment in memory. # text_length_adj must be set to "sizeof (struct exec)" if the length of # the text segment stored in the a.out header includes the a.out header # itself. AC_DEFINE(SEG_SIZ, 1024, [FIXME HARD]) AC_DEFINE(FILE_TEXT_START, N_TXTOFF(hdr), [FIXME HARD]) AC_DEFINE(MEM_TEXT_START, 0, [FIXME HARD]) AC_DEFINE(TEXT_LENGTH_ADJ, 0, [FIXME HARD]) # Only relevant if "aout_format=coff": the system's pagesize. AC_DEFINE(COFF_PAGESIZE, 4096, [FIXME HARD]) # Only relevant if "aout_format=hp9k" and "load_obj=shl" AC_DEFINE(HPSHLIB, 1, [FIXME HARD]) # Print debug messages when dumping AC_DEFINE(DEBUG_DUMP, 1, [FIXME HARD]) # Is the "termio" terminal interface supported by the system? If not, # BSD-style tty handling will be used. AC_DEFINE(TERMIO, 1, [FIXME HARD]) # flush_stdio and flush_tty indicate how clear-input/output-port can # flush (purge) a FILE pointer and a TTY file descriptor. # Possible values of flush_stdio: # bsd assume old BSD-style FILE* (with _cnt, _ptr, _base) # fpurge use 4.4BSD-style fpurge stdio library function # Possible values of flush_tty: # tiocflush use TIOCFLUSH ioctl from # tcflsh use TCFLSH ioctl from # Leave the variable(s) empty if flushing is not supported. AC_CHECK_FUNCS(fpurge) AC_CACHE_CHECK([for BSD-style flushing], [ac_cv_have_bsd_flush], [AC_TRY_COMPILE( [#include ], [FILE *f; f->_cnt = 0; f->_ptr = f->_base;], ac_cv_have_bsd_flush=yes, ac_cv_have_bsd_flush=no)]) if test "${ac_cv_have_bsd_flush}" = "yes"; then AC_DEFINE(HAVE_BSD_FLUSH, 1, [Define if you have BSD-style flushing]) fi AC_CHECK_HEADERS(termio.h termios.h) # The interpreter uses the getrlimit function to determine the maximum # stack size of the running program. If this function is not supported, # set max_stack_size to a (fixed) maximum stack size (in bytes). AC_CHECK_FUNCS(getrlimit) AC_CACHE_CHECK([for struct rlimit], [ac_cv_have_struct_rlimit], [AC_TRY_COMPILE( [#ifdef HAVE_SYS_TIME_H # include #endif #ifdef HAVE_SYS_RESOURCE_H # include #endif #ifdef HAVE_UNISTD_H # include #endif], [struct rlimit rl;], ac_cv_have_struct_rlimit=yes, ac_cv_have_struct_rlimit=no)]) if test "${ac_cv_have_struct_rlimit}" = "yes"; then AC_DEFINE(HAVE_STRUCT_RLIMIT, 1, [Define if you have struct rlimit]) fi AC_DEFINE(DEFAULT_MAX_STACK_SIZE, 1024*1024, [Define default max stack size]) # Is the mprotect system call supported? The generational garbage collector # requires mprotect to implement incremental GC. $mprotect is ignored if # generational_gc is set to "no" in the site file. Set mprotect=mmap if # mprotect is supported, but only for mmap()ed memory. AC_CHECK_FUNCS(mprotect) if false; then AC_DEFINE(MPROTECT_SIG, 1, [FIXME HARD]) fi if false; then AC_DEFINE(MPROTECT_MMAP, 1, [FIXME HARD]) fi # How can a SIGSEGV or SIGBUS signal handler find out the address of # the faulting memory reference? This variable is only used if # $mprotect is "yes" or "mmap". Possible values are: # # siginfo handler is called with siginfo_t structure (enabled # by a call to sigaction) # sigcontext address is in the sigcontext structure (3rd arg, sc_badvaddr) # arg4 address is delivered to handler as argument #4 # aix use an AIX-specific hack to get hold of the bad address # hpux use a HP-UX-specific hack if false; then AC_DEFINE(SIGSEGV_SIGINFO, 1, [FIXME HARD]) fi if false; then AC_DEFINE(SIGSEGV_SIGCONTEXT, 1, [FIXME HARD]) fi if false; then AC_DEFINE(SIGSEGV_ARG4, 1, [FIXME HARD]) fi if false; then AC_DEFINE(SIGSEGV_AIX, 1, [FIXME HARD]) fi if false; then AC_DEFINE(SIGSEGV_HPUX, 1, [FIXME HARD]) fi # Does the system support the alloca library function, and does this # function actually extend the stack? If in doubt, extract alloca.o # from the C library and check if it contains the symbols malloc and free. # If this is the case, forget it. AC_FUNC_ALLOCA dnl AC_CHECK_FUNCS(alloca) # Must be included to use alloca? Is "#pragma alloca" required? AC_CHECK_HEADERS(alloca.h) if false; then AC_DEFINE(PRAGMA_ALLOCA, 1, [FIXME HARD]) fi # Does the system (or compiler) require certain objects (e.g. doubles) # to be aligned at 8-byte boundaries? If not, 4-byte alignment will # be assumed. if false; then AC_DEFINE(ALIGN_8BYTE, 1, [FIXME HARD]) fi # The name of the linker. This is usually just "ld", or /usr/ccs/bin/ld # in SVR4-based systems. AC_DEFINE(LD_NAME, "ld", [FIXME HARD]) # Does your C preprocessor support the ANSI-C ## operator, although # __STDC__ is not defined? AC_DEFINE(ANSI_CPP, 1, [FIXME HARD]) # Element type of the gidset argument of getgroups(); typically int # or gid_t. Only needed by the UNIX extension. AC_DEFINE(GETGROUPS_TYPE, gid_t, [FIXME HARD]) # Do you want to use the generational garbage collector? If not, the # stop-and-copy garbage collector will be used. AC_DEFINE(GENERATIONAL_GC, 1, [FIXME HARD]) # The default heap size of the Scheme interpreter in KBytes (if the # stop-and-copy garbage collector is used). AC_DEFINE(HEAP_SIZE, 1024, [FIXME HARD]) # The directory where all files are installed by running "make install". We # cannot use AC_DEFINE_UNQUOTED here because ${prefix} is not set until the # end of the configure script. Thanks to Phillip Rulon for spotting that. CPPFLAGS="${CPPFLAGS} -DSCM_DIR=\"\\\"\$(prefix)/share/elk\\\"\"" CPPFLAGS="${CPPFLAGS} -DLIB_DIR=\"\\\"\$(prefix)/lib/elk\\\"\"" #define FIND_AOUT defined(USE_LD) || defined(CAN_DUMP) || defined(INIT_OBJECTS) AC_DEFINE(FIND_AOUT, 1, [FIXME HARD]) dnl dnl Check for available compiler features dnl CFLAGS_save="${CFLAGS}" LDFLAGS_save="${LDFLAGS}" AC_CACHE_CHECK([if \$CXX really works], [ac_cv_my_have_cxx], [AC_LANG_PUSH(C++) AC_TRY_COMPILE([],,ac_cv_my_have_cxx=yes, ac_cv_my_have_cxx=no) AC_LANG_POP(C++)]) AM_CONDITIONAL(HAVE_CXX, test "${ac_cv_my_have_cxx}" = "yes") AC_CACHE_CHECK([if \$CC accepts -Wall], [ac_cv_c_Wall], [CFLAGS="-Wall ${CFLAGS_save}" AC_TRY_COMPILE([],,ac_cv_c_Wall=yes, ac_cv_c_Wall=no)]) if test "x${ac_cv_c_Wall}" != "xno"; then CFLAGS_save="-Wall ${CFLAGS_save}" fi # Code qui fait des warnings == code de porc == deux baffes dans ta gueule CFLAGS_warn="-Wpointer-arith -Wcast-align -Wcast-qual -Wshadow -Wmissing-prototypes -Wnested-externs -Wsign-compare" AC_CACHE_CHECK([if \$CC accepts ${CFLAGS_warn}], [ac_cv_c_Wwarn], [CFLAGS="${CFLAGS_warn} ${CFLAGS_save}" AC_TRY_COMPILE([],,ac_cv_c_Wwarn=yes, ac_cv_c_Wwarn=no)]) if test "x${ac_cv_c_Wwarn}" != "xno"; then CFLAGS_save="${CFLAGS_warn} ${CFLAGS_save}" fi dnl dnl Check for available headers and libraries dnl CFLAGS="${CFLAGS_save}" LDFLAGS="${LDFLAGS_save}" AM_CONDITIONAL(HAVE_MONITOR, false) AC_CHECK_LIB(gdbm, gdbm_open, ac_cv_my_have_gdbm=yes, ac_cv_my_have_gdbm=no) AM_CONDITIONAL(HAVE_GDBM, test "${ac_cv_my_have_gdbm}" = "yes") AC_PATH_X if test -n "${x_includes}"; then x_cflags="-I${x_includes}"; fi if test -n "${x_libraries}"; then x_libs="-I${x_libraries}"; fi AC_CHECK_LIB(X11, XOpenDisplay, [ac_cv_my_have_x11=yes X_CFLAGS="${x_cflags}" X_LIBS="${x_libs} -lX11"], [ac_cv_my_have_x11=no], [[${x_libs}]]) AM_CONDITIONAL(HAVE_X11, test "${ac_cv_my_have_x11}" = "yes") AC_SUBST(X_CFLAGS) AC_SUBST(X_LIBS) if test "${cross_compiling}" = "no"; then AC_CHECK_LIB(Xt, XtFree, [ac_cv_my_have_xt=yes AC_CHECK_LIB(Xmu, XmuDrawLogo, [XT_CFLAGS="${x_cflags}" XT_LIBS="${x_libs} -lXmu -lXt -lSM -lICE -lXext -lX11"], [XT_CFLAGS="${x_cflags}" XT_LIBS="${x_libs} -lXt -lSM -lICE -lXext -lX11"], [[-lXt -lSM -lICE -lXext -lX11 ${x_libs}]])], [ac_cv_my_have_xt=no], [[-lSM -lICE -lXext -lX11 ${x_libs}]]) else ac_cv_my_have_xt=no fi AM_CONDITIONAL(HAVE_XT, test "${ac_cv_my_have_xt}" = "yes") AC_SUBST(XT_CFLAGS) AC_SUBST(XT_LIBS) if test "${cross_compiling}" = "no"; then AC_CHECK_LIB(Xaw, XawTextSearch, [ac_cv_my_have_xaw=yes XAW_CFLAGS="${x_cflags}" XAW_LIBS="${x_libs} -lXaw ${XT_LIBS}"], [ac_cv_my_have_xaw=no], [[${XT_LIBS}]]) else ac_cv_my_have_xaw="no (cross-compiling)" fi AM_CONDITIONAL(HAVE_XAW, test "${ac_cv_my_have_xaw}" = "yes") AC_SUBST(XAW_CFLAGS) AC_SUBST(XAW_LIBS) if test "${cross_compiling}" = "no"; then AC_CHECK_LIB(Xm, XmStringConcat, [ac_cv_my_have_motif=yes MOTIF_CFLAGS="${x_cflags} -I/usr/include/Xm" MOTIF_LIBS="${x_libs} -lXm ${XT_LIBS}"], [ac_cv_my_have_motif=no], [[${XT_LIBS}]]) else ac_cv_my_have_motif="no (cross-compiling)" fi AM_CONDITIONAL(HAVE_MOTIF, test "${ac_cv_my_have_motif}" = "yes") AC_SUBST(MOTIF_CFLAGS) AC_SUBST(MOTIF_LIBS) INCLUDES="${INCLUDES} -I\$(top_srcdir)/include -I\$(top_builddir)/include" AC_SUBST(INCLUDES) dnl Export variables AC_SUBST(ELK_CFLAGS) AC_SUBST(ELK_LDFLAGS) AC_SUBST(ELK_LIBS) dnl dnl Check for available programs dnl AC_PROG_AWK AC_MSG_CHECKING(for groff -ms) if echo foo | groff -ms >/dev/null 2>&1; then ac_cv_my_have_groff=yes else ac_cv_my_have_groff=no fi AC_MSG_RESULT([${ac_cv_my_have_groff}]) AM_CONDITIONAL(HAVE_GROFF, test "${ac_cv_my_have_groff}" = "yes") dnl dnl Finished! dnl AC_CONFIG_FILES([ Makefile doc/Makefile doc/bitstring/Makefile doc/cprog/Makefile doc/kernel/Makefile doc/man/Makefile doc/oops/Makefile doc/record/Makefile doc/regexp/Makefile doc/unix/Makefile doc/usenix/Makefile doc/util/Makefile doc/xlib/Makefile doc/xt/Makefile examples/Makefile include/Makefile lib/Makefile lib/misc/Makefile lib/unix/Makefile lib/xlib/Makefile lib/xwidgets/Makefile lib/xwidgets/xaw/Makefile lib/xwidgets/motif/Makefile scm/Makefile src/Makefile test/Makefile ]) AC_CONFIG_FILES([ scm/slib.scm include/site.h ]) AC_CONFIG_FILES([test/check-gc], [chmod 0755 test/check-gc]) AC_CONFIG_FILES([test/check-gc2], [chmod 0755 test/check-gc2]) AC_CONFIG_FILES([test/check-r4rs], [chmod 0755 test/check-r4rs]) AC_OUTPUT cat << EOF Elk configuration summary ------------------------- build C++ plugins: ${ac_cv_my_have_cxx} libgdbm support: ${ac_cv_my_have_gdbm} X11 support: ${ac_cv_my_have_x11} Xaw support: ${ac_cv_my_have_xaw} Motif support: ${ac_cv_my_have_motif} build documentation: ${ac_cv_my_have_groff} EOF elk-3.99.8/COPYING0000644000175000017500000000227011577076306010370 00000000000000$Id$ Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin (except for the contents of the directory `doc/usenix'). Copyright 2002, 2003 Sam Hocevar , Paris This software was derived from Elk 1.2, which was Copyright 1987, 1988, 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written by Oliver Laumann (me) for TELES Telematic Services, Berlin, in a joint project between TELES and Nixdorf Microprocessor Engineering, Berlin). Sam Hocevar, Oliver Laumann, TELES GmbH, and Nixdorf Computer AG, as co-owners or individual owners of copyright in this software, grant to any person or company a worldwide, royalty free, license to i) copy this software, ii) prepare derivative works based on this software, iii) distribute copies of this software or derivative works, iv) perform this software, or v) display this software, provided that this notice is not removed and that neither Sam Hocevar, Oliver Laumann, nor Teles nor Nixdorf are deemed to have made any representations as to the suitability of this software for any purpose nor are held responsible for any defects of this software. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. elk-3.99.8/aclocal.m40000644000175000017500000123042511577103432011172 00000000000000# generated automatically by aclocal 1.11.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, [m4_warning([this file was generated for autoconf 2.68. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010 Free Software Foundation, # Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010 Free Software Foundation, # Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 57 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # `#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test $lt_write_fail = 0 && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2010 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_REPLACE_SHELLFNS mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES # -------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test "$lt_cv_ld_force_load" = "yes"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script which will find a shell with a builtin # printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case "$ECHO" in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [ --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified).], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([${with_sysroot}]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and in which our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[123]]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) version_type=linux need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ F* | *Sun*Fortran*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi _LT_TAGVAR(link_all_deplibs, $1)=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; freebsd1*) _LT_TAGVAR(ld_shlibs, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS="$save_LDFLAGS"]) if test "$lt_cv_irix_exported_symbol" = yes; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1], [[If ld is used when linking, flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd[[12]]*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) # ------------------------------------------------------ # In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and # '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. m4_defun([_LT_PROG_FUNCTION_REPLACE], [dnl { sed -e '/^$1 ()$/,/^} # $1 /c\ $1 ()\ {\ m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) } # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: ]) # _LT_PROG_REPLACE_SHELLFNS # ------------------------- # Replace existing portable implementations of several shell functions with # equivalent extended shell implementations where those features are available.. m4_defun([_LT_PROG_REPLACE_SHELLFNS], [if test x"$xsi_shell" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"}]) _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl func_split_long_opt_name=${1%%=*} func_split_long_opt_arg=${1#*=}]) _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) fi if test x"$lt_shell_append" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl func_quote_for_eval "${2}" dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) fi ]) # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine which file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS # Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, # Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 7 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [pic_mode="$withval"], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) # ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 3293 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4]) m4_define([LT_PACKAGE_REVISION], [1.3293]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4' macro_revision='1.3293' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.11.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 10 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 8 # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 16 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 6 # AM_PROG_CC_C_O # -------------- # Like AC_PROG_CC_C_O, but changed for automake. AC_DEFUN([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC_C_O])dnl AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o if test "$am_t" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi dnl Make sure AC_PROG_CC is never called again, or it will override our dnl setting of CC. m4_define([AC_PROG_CC], [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 6 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR elk-3.99.8/scm/0000755000175000017500000000000011577110017010162 500000000000000elk-3.99.8/scm/toplevel.scm0000644000175000017500000000460311577076306012457 00000000000000;;; -*-Scheme-*- ;;; ;;; Read-eval-print loop and error handler (autoload 'pp 'pp.scm) (autoload 'apropos 'apropos.scm) (autoload 'sort 'qsort.scm) (autoload 'describe 'describe.scm) (autoload 'backtrace 'debug.scm) (autoload 'inspect 'debug.scm) (define ?) (define ??) (define ???) (define !) (define !!) (define !!!) (define &) (define (rep-loop env) (define input) (define value) (let loop () (set! ??? ??) (set! ?? ?) (set! ? &) ;;; X Windows hack (if (and (bound? 'display-flush-output) (bound? 'dpy) (display? dpy)) (display-flush-output dpy)) (if (> rep-level 0) (display rep-level)) (display "> ") (set! input (read)) (set! & input) (if (not (eof-object? input)) (begin (set! value (eval input env)) (set! !!! !!) (set! !! !) (set! ! value) (write value) (newline) (loop))))) (define rep-frames) (define rep-level) (set! interrupt-handler (lambda () (format #t "~%\7Interrupt!~%") (let ((next-frame (car rep-frames))) (next-frame #t)))) (define-macro (push-frame control-point) `(begin (set! rep-frames (cons ,control-point rep-frames)) (set! rep-level (1+ rep-level)))) (define-macro (pop-frame) '(begin (set! rep-frames (cdr rep-frames)) (set! rep-level (1- rep-level)))) (define (error-print error-msg) (format #t "~s: " (car error-msg)) (apply format `(#t ,@(cdr error-msg))) (newline)) (set! error-handler (lambda error-msg (error-print error-msg) (let loop ((intr-level (enable-interrupts))) (if (positive? intr-level) (loop (enable-interrupts)))) (let loop () (if (call-with-current-continuation (lambda (control-point) (push-frame control-point) (rep-loop (the-environment)) #f)) (begin (pop-frame) (loop)))) (newline) (pop-frame) (let ((next-frame (car rep-frames))) (next-frame #t)))) (define top-level-environment (the-environment)) (define (top-level) (let loop () ;;; Allow GC to free old rep-frames when we get here on "reset": (set! rep-frames (list top-level-control-point)) (if (call-with-current-continuation (lambda (control-point) (set! rep-frames (list control-point)) (set! top-level-control-point control-point) (set! rep-level 0) (rep-loop top-level-environment) #f)) (loop)))) (define (the-top-level) (top-level) (newline) (exit)) (the-top-level) elk-3.99.8/scm/oops.scm0000644000175000017500000002110111577076306011575 00000000000000;;; -*-Scheme-*- ;;; ;;; A simple `OOPS' package (require 'hack.la) (provide 'oops) (define class-size 5) (define instance-size 3) ;;; Classes and instances are represented as vectors. The first ;;; two slots (tag and class-name) are common to classes and instances. (define (tag v) (vector-ref v 0)) (define (set-tag! v t) (vector-set! v 0 t)) (define (class-name v) (vector-ref v 1)) (define (set-class-name! v n) (vector-set! v 1 n)) (define (class-instance-vars c) (vector-ref c 2)) (define (set-class-instance-vars! c v) (vector-set! c 2 v)) (define (class-env c) (vector-ref c 3)) (define (set-class-env! c e) (vector-set! c 3 e)) (define (class-super c) (vector-ref c 4)) (define (set-class-super! c s) (vector-set! c 4 s)) (define (instance-env i) (vector-ref i 2)) (define (set-instance-env! i e) (vector-set! i 2 e)) ;;; Methods are bound in the class environment. (define (method-known? method class) (eval `(bound? ',method) (class-env class))) (define (lookup-method method class) (eval method (class-env class))) (define (class? c) (and (vector? c) (= (vector-length c) class-size) (eq? (tag c) 'class))) (define (check-class sym c) (if (not (class? c)) (error sym "argument is not a class"))) (define (instance? i) (and (vector? i) (= (vector-length i) instance-size) (eq? (tag i) 'instance))) (define (check-instance sym i) (if (not (instance? i)) (error sym "argument is not an instance"))) ;;; Evaluate `body' within the scope of instance `i'. (define-macro (with-instance i . body) `(eval '(begin ,@body) (instance-env ,i))) ;;; Set a variable in an instance. (define (instance-set! instance var val) (eval `(set! ,var ',val) (instance-env instance))) ;;; Set a class variable when no instance is available. (define (class-set! class var val) (eval `(set! ,var ',val) (class-env class))) ;;; Convert a class variable spec into a binding suitable for a `let'. (define (make-binding var) (if (symbol? var) (list var '()) ; No initializer given; use () var)) ; Initializer has been specified; leave alone ;;; Check whether the elements of `vars' are either a symbol or ;;; of the form (symbol initializer). (define (check-vars vars) (if (not (null? vars)) (if (not (or (symbol? (car vars)) (and (pair? (car vars)) (= (length (car vars)) 2) (symbol? (caar vars))))) (error 'define-class "bad variable spec: ~s" (car vars)) (check-vars (cdr vars))))) ;;; Check whether the class var spec `v' is already a member of ;;; the list `l'. If this is the case, check whether the initializers ;;; are identical. (define (find-matching-var l v) (cond ((null? l) #f) ((eq? (caar l) (car v)) (if (not (equal? (cdar l) (cdr v))) (error 'define-class "initializer mismatch: ~s and ~s" (car l) v) #t)) (else (find-matching-var (cdr l) v)))) ;;; Same as above, but don't check initializer. (define (find-var l v) (cond ((null? l) #f) ((eq? (caar l) (car v)) #t) (else (find-var (cdr l) v)))) ;;; Create a new list of class var specs by discarding all variables ;;; from `b' that are already a member of `a' (with identical initializers). (define (join-vars a b) (cond ((null? b) a) ((find-matching-var a (car b)) (join-vars a (cdr b))) (else (join-vars (cons (car b) a) (cdr b))))) ;;; The syntax is as follows: ;;; (define-class class-name . options) ;;; options are: (super-class class-name) ;;; (class-vars . var-specs) ;;; (instance-vars . var-specs) ;;; each var-spec is either a symbol or (symbol initializer). (define-macro (define-class name . args) (let ((class-vars) (instance-vars (list (make-binding 'self))) (super) (super-class-env)) (do ((a args (cdr a))) ((null? a)) (cond ((not (pair? (car a))) (error 'define-class "bad argument: ~s" (car a))) ((eq? (caar a) 'class-vars) (check-vars (cdar a)) (set! class-vars (cdar a))) ((eq? (caar a) 'instance-vars) (check-vars (cdar a)) (set! instance-vars (append instance-vars (map make-binding (cdar a))))) ((eq? (caar a) 'super-class) (if (> (length (cdar a)) 1) (error 'define-class "only one super-class allowed")) (set! super (cadar a))) (else (error 'define-class "bad keyword: ~s" (caar a))))) (if (not (null? super)) (let ((class (eval super))) (set! super-class-env (class-env class)) (set! instance-vars (join-vars (class-instance-vars class) instance-vars))) (set! super-class-env (the-environment))) `(define ,name (let ((c (make-vector class-size '()))) (set-tag! c 'class) (set-class-name! c ',name) (set-class-instance-vars! c ',instance-vars) (set-class-env! c (eval `(let* ,(map make-binding ',class-vars) (the-environment)) ,super-class-env)) (set-class-super! c ',super) c)))) (define-macro (define-method class lambda-list . body) (if (not (pair? lambda-list)) (error 'define-method "bad lambda list")) `(begin (check-class 'define-method ,class) (let ((env (class-env ,class)) (method (car ',lambda-list)) (args (cdr ',lambda-list)) (forms ',body)) (eval `(define ,method (lambda ,args ,@forms)) env) #v))) ;;; All arguments of the form (instance-var init-value) are used ;;; to initialize the specified instance variable; then an ;;; initialize-instance message is sent with all remaining ;;; arguments. (define-macro (make-instance class . args) `(begin (check-class 'make-instance ,class) (let* ((e (the-environment)) (i (make-vector instance-size #f)) (class-env (class-env ,class)) (instance-vars (class-instance-vars ,class))) (set-tag! i 'instance) (set-class-name! i ',class) (set-instance-env! i (eval `(let* ,instance-vars (the-environment)) class-env)) (eval `(set! self ',i) (instance-env i)) (init-instance ',args ,class i e) i))) (define (init-instance args class instance env) (let ((other-args)) (do ((a args (cdr a))) ((null? a)) (if (and (pair? (car a)) (= (length (car a)) 2) (find-var (class-instance-vars class) (car a))) (instance-set! instance (caar a) (eval (cadar a) env)) (set! other-args (cons (eval (car a) env) other-args)))) (call-init-methods class instance (reverse! other-args)))) ;;; Call all initialize-instance methods in super-class to sub-class ;;; order in the environment of `instance' with arguments `args'. (define (call-init-methods class instance args) (let ((called '())) (let loop ((class class)) (if (not (null? (class-super class))) (loop (eval (class-super class)))) (if (method-known? 'initialize-instance class) (let ((method (lookup-method 'initialize-instance class))) (if (not (memq method called)) (begin (apply (hack-procedure-environment! method (instance-env instance)) args) (set! called (cons method called))))))))) (define (send instance msg . args) (check-instance 'send instance) (let ((class (eval (class-name instance)))) (if (not (method-known? msg class)) (error 'send "message not understood: ~s" `(,msg ,@args)) (apply (hack-procedure-environment! (lookup-method msg class) (instance-env instance)) args)))) ;;; If the message is not understood, return #f. Otherwise return ;;; a list of one element, the result of the method. (define (send-if-handles instance msg . args) (check-instance 'send-if-handles instance) (let ((class (eval (class-name instance)))) (if (not (method-known? msg class)) #f (list (apply (hack-procedure-environment! (lookup-method msg class) (instance-env instance)) args))))) (define (describe-class c) (check-class 'describe-class c) (format #t "Class name: ~s~%" (class-name c)) (format #t "Superclass: ~s~%" (if (not (null? (class-super c))) (class-super c) 'None)) (format #t "Instancevars: ") (do ((v (class-instance-vars c) (cdr v)) (space #f #t)) ((null? v)) (if space (format #t " ")) (print (cons (caar v) (cadar v)))) (format #t "Classvars/Methods: ") (define v (car (environment->list (class-env c)))) (if (not (null? v)) (do ((f v (cdr f)) (space #f #t)) ((null? f)) (if space (format #t " ")) (print (car f))) (print 'None)) #v) (define (describe-instance i) (check-instance 'describe-instance i) (format #t "Instance of: ~s~%" (class-name i)) (format #t "Instancevars: ") (do ((f (car (environment->list (instance-env i))) (cdr f)) (space #f #t)) ((null? f)) (if space (format #t " ")) (print (car f))) #v) elk-3.99.8/scm/gdbmtest.scm0000644000175000017500000000420511577076306012434 00000000000000;;; -*-Scheme-*- ;;; ;;; An interactive command loop for testing the GNU gdbm extension. ;;; Contributed by Martin Stut. (require 'gdbm.la) (let ((gf (gdbm-open 'test.gdbm 1024 'create)) (last "nothing")) (if (not gf) (error 'gdbm-open "cannot open test.gdbm")) (format #t "Type ? for help~%") (let loop ((op (read-char))) (newline) (if (not (char=? op #\newline)) (read-string)) ; flush rest of line (case op ((#\? #\h) (format #t "c -- count items~%") (format #t "d -- delete item~%") (format #t "f -- fetch item~%") (format #t "s -- store item~%") (format #t "n -- next key~%") (format #t "1 -- first key~%") (format #t "2 -- next key of last n, 1, or 2~%") (format #t "r -- reorganize~%") (format #t "q -- quit~%")) (#\c (do ((i 0 (1+ i)) (x (gdbm-firstkey gf) (gdbm-nextkey gf x))) ((not x) (format #t "Number of entries: ~s~%" i)))) (#\d (display "Key: ") (if (gdbm-delete gf (read-string)) (format #t "Deleted.~%") (format #t "Doesn't exist.~%"))) (#\f (display "Key: ") ((lambda (d) (if d (format #t "Data: ~s~%" d) (format #t "Doesn't exist.~%"))) (gdbm-fetch gf (read-string)))) (#\s (display "Key: ") ((lambda (k) (display "Data: ") (if (= 1 (gdbm-store gf k (read-string) 'insert)) (format #t "Already there.~%") (format #t "Inserted.~%"))) (read-string))) (#\n (display "Key: ") ((lambda (r) (if r (begin (format #t "Next: ~s Data: ~s~%" r (gdbm-fetch gf r)) (set! last r)) (print #f))) (gdbm-nextkey gf (read-string)))) (#\1 ((lambda (r) (if r (begin (format #t "First: ~s Data: ~s~%" r (gdbm-fetch gf r)) (set! last r)) (print #f))) (gdbm-firstkey gf))) (#\2 ((lambda (r) (if r (begin (format #t "Next: ~s Data: ~s~%" r (gdbm-fetch gf r)) (set! last r)) (print #f))) (gdbm-nextkey gf last))) (#\r (gdbm-reorganize gf) (format #t "Reorganized.~%")) (#\q (exit))) (loop (read-char)))) elk-3.99.8/scm/debug.scm0000644000175000017500000001351011577076306011710 00000000000000;;; -*-Scheme-*- ;;; ;;; A simple debugger (improvements by Thomas M. Breuel ). (define (backtrace . args) (if (> (length args) 1) (error 'backtrace "too many arguments")) (if (not (null? args)) (if (not (eq? (type (car args)) 'control-point)) (error 'backtrace "argument must be a control point"))) (let ((trace (apply backtrace-list args))) (if (null? args) (set! trace (cdddr trace))) (show-backtrace trace 0 999999))) (define (show-backtrace trace start-frame end-frame) (define (rjust n x) (let* ((y (string-append (make-string n #\space) x)) (l (string-length y))) (substring y (- l n) l))) (let ((maxlen 28)) (let loop ((frames (list-tail trace start-frame)) (num start-frame)) (if (or (null? frames) (>= num end-frame)) #v (let ((frame (car frames))) (let* ((func (format #f "~s" (vector-ref frame 0))) (indent (- maxlen (+ 5 (string-length func))))) (display (rjust 4 (number->string num))) (display " ") (display func) (if (negative? indent) (begin (newline) (set! indent maxlen))) (do ((i indent (1- i))) ((> 0 i)) (display " "))) (fluid-let ((print-depth 2) (print-length 3)) (display (vector-ref frame 1))) (newline)) (loop (cdr frames) (1+ num)))))) (define (show-environment env) (fluid-let ((print-length 2) (print-depth 2)) (do ((f (environment->list env) (cdr f))) ((null? f)) (do ((b (car f) (cdr b))) ((null? b)) (format #t "~s\t~s~%" (caar b) (cdar b))) (print '-------))) #v) (define inspect) (let ((frame) (trace) (help-text '("q -- quit inspector" "f -- print current frame" "u -- go up one frame" "d -- go down one frame" "^ -- go to top frame" "$ -- go to bottom frame" "g -- goto to n-th frame" "e -- eval expressions in environment" "p -- pretty-print procedure" "v -- show environment" " -- pretty-print n-th argument" "b -- show backtrace starting at current frame" "t -- show top of bracktrace starting at current frame" "z -- show and move top of backtrace starting at current frame" "o -- obarray information"))) (define (inspect-command-loop) (let ((input) (done #f)) (display "inspect> ") (set! input (read)) (case input (q (set! done #t)) (? (for-each (lambda (msg) (display msg) (newline)) help-text)) (f (print-frame)) (^ (set! frame 0) (print-frame)) ($ (set! frame (1- (length trace))) (print-frame)) (u (if (zero? frame) (format #t "Already on top frame.~%") (set! frame (1- frame)) (print-frame))) (d (if (= frame (1- (length trace))) (format #t "Already on bottom frame.~%") (set! frame (1+ frame)) (print-frame))) (g (set! input (read)) (if (integer? input) (set! frame (cond ((negative? input) 0) ((>= input (length trace)) (1- (length trace))) (else input))) (format #t "Frame number must be an integer.~%"))) (v (show-environment (vector-ref (list-ref trace frame) 2))) (e (format #t "Type ^D to return to Inspector.~%") (let loop () (display "eval> ") (set! input (read)) (if (not (eof-object? input)) (begin (write (eval input (vector-ref (list-ref trace frame) 2))) (newline) (loop)))) (newline)) (p (pp (vector-ref (list-ref trace frame) 0)) (newline)) (z (show-backtrace trace frame (+ frame 10)) (set! frame (+ frame 9)) (if (>= frame (length trace)) (set! frame (1- (length trace))))) (t (show-backtrace trace frame (+ frame 10))) (b (show-backtrace trace frame 999999)) (o (let ((l (map length (oblist)))) (let ((n 0)) (for-each (lambda (x) (set! n (+ x n))) l) (format #t "~s symbols " n) (format #t "(maximum bucket: ~s).~%" (apply max l))))) (else (cond ((integer? input) (let ((args (vector-ref (list-ref trace frame) 1))) (if (or (< input 1) (> input (length args))) (format #t "No such argument.~%") (pp (list-ref args (1- input))) (newline)))) ((eof-object? input) (set! done #t)) (else (format #t "Invalid command. Type ? for help.~%"))))) (if (not done) (inspect-command-loop)))) (define (print-frame) (format #t "~%Frame ~s of ~s:~%~%" frame (1- (length trace))) (let* ((f (list-ref trace frame)) (args (vector-ref f 1))) (format #t "Procedure: ~s~%" (vector-ref f 0)) (format #t "Environment: ~s~%" (vector-ref f 2)) (if (null? args) (format #t "No arguments.~%") (fluid-let ((print-depth 2) (print-length 3)) (do ((i 1 (1+ i)) (args args (cdr args))) ((null? args)) (format #t "Argument ~s: ~s~%" i (car args)))))) (newline)) (define (find-frame proc) (let loop ((l trace) (i 0)) (cond ((null? l) -1) ((eq? (vector-ref (car l) 0) proc) i) (else (loop (cdr l) (1+ i)))))) (set! inspect (lambda () (set! trace (backtrace-list)) (set! trace (cddr trace)) (do ((t trace (cdr t)) (f 1 (1+ f))) ((null? t)) (if (not (null? (vector-ref (car t) 1))) (let ((last (last-pair (vector-ref (car t) 1)))) (if (not (null? (cdr last))) (begin (format #t "[inspector: fixing improper arglist in frame ~s]~%" f) (set-cdr! last (cons (cdr last) '()))))))) (set! frame (find-frame error-handler)) (if (negative? frame) (set! frame 0)) (format #t "Inspector (type ? for help):~%") (let loop () (if (call-with-current-continuation (lambda (control-point) (push-frame control-point) (inspect-command-loop) #f)) (begin (pop-frame) (loop)))) (newline) (pop-frame) (let ((next-frame (car rep-frames))) (next-frame #t))))) elk-3.99.8/scm/xaw.scm0000644000175000017500000000015311577076306011420 00000000000000;;; -*-Scheme-*- ;;; ;;; The Scheme part of the X11 widget interface. (provide 'xaw) (require 'xwidgets) elk-3.99.8/scm/Makefile.in0000644000175000017500000003115511577103434012161 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = scm DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/slib.scm.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = slib.scm CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(pkgdatadir)" DATA = $(pkgdata_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ELK_CFLAGS = @ELK_CFLAGS@ ELK_LDFLAGS = @ELK_LDFLAGS@ ELK_LIBS = @ELK_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INCLUDES = @INCLUDES@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOTIF_CFLAGS = @MOTIF_CFLAGS@ MOTIF_LIBS = @MOTIF_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STDINT_HEADER = @STDINT_HEADER@ STRIP = @STRIP@ VERSION = @VERSION@ XAW_CFLAGS = @XAW_CFLAGS@ XAW_LIBS = @XAW_LIBS@ XMKMF = @XMKMF@ XT_CFLAGS = @XT_CFLAGS@ XT_LIBS = @XT_LIBS@ X_CFLAGS = @X_CFLAGS@ X_LIBS = @X_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ NULL = EXTRA_DIST = $(SCM_FILES) $(SCM_DIST) slib.scm.in pkgdata_DATA = $(SCM_FILES) $(SCM_MAYBE) slib.scm SCM_FILES = \ apropos.scm \ bitstring.scm \ cscheme.scm \ debug.scm \ describe.scm \ initscheme.scm \ oops.scm \ parse.scm \ pp.scm \ qsort.scm \ record.scm \ recordutil.scm \ regexp.scm \ safe-env.scm \ setf.scm \ struct.scm \ toplevel.scm \ trace.scm \ unix.scm \ $(NULL) SCM_MAYBE = \ $(gdbmtest_scm) \ $(motif_scm) \ $(xlib_scm) \ $(xaw_scm) \ $(xwidgets_scm) \ $(NULL) SCM_DIST = \ gdbmtest.scm \ motif.scm \ xlib.scm \ xaw.scm \ xwidgets.scm \ $(NULL) @HAVE_GDBM_TRUE@gdbmtest_scm = gdbmtest.scm @HAVE_X11_TRUE@xlib_scm = xlib.scm @HAVE_XAW_TRUE@xaw_scm = xaw.scm @HAVE_MOTIF_TRUE@xwidgets_scm = xwidgets.scm @HAVE_XAW_TRUE@xwidgets_scm = xwidgets.scm @HAVE_MOTIF_TRUE@motif_scm = motif.scm all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign scm/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign scm/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): slib.scm: $(top_builddir)/config.status $(srcdir)/slib.scm.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-pkgdataDATA: $(pkgdata_DATA) @$(NORMAL_INSTALL) test -z "$(pkgdatadir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)" @list='$(pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgdatadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgdatadir)" || exit $$?; \ done uninstall-pkgdataDATA: @$(NORMAL_UNINSTALL) @list='$(pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(pkgdatadir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(pkgdatadir)" && rm -f $$files tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(pkgdatadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-pkgdataDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkgdataDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-pkgdataDATA install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-pkgdataDATA # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: elk-3.99.8/scm/initscheme.scm0000644000175000017500000000433111577076306012753 00000000000000;;; -*-Scheme-*- ;;; ;;; Initialization code for the Elk interpreter kernel. ;;; ;;; This file is loaded on startup before the toplevel (or the file ;;; supplied along with the -l option) is loaded. ;;; ;;; If a garbage collection is triggered while loading this file, ;;; it is regarded as an indication that the heap size is too small ;;; and an error message is printed. ;;; Primitives that are part of the core functionality but are not ;;; implemented in C. This is a bad thing, because extension or ;;; application writers should be able to rely on P_Expt(). (define (expt x y) (define (square x) (* x x)) (define (integer-expt b n) (cond ((= n 0) 1) ((negative? n) (/ 1 (integer-expt b (abs n)))) ((even? n) (square (integer-expt b (/ n 2)))) (else (* b (integer-expt b (- n 1)))))) (cond ((zero? x) (if (zero? y) 1 0)) ((integer? y) (integer-expt x y)) (else (exp (* (log x) y))))) ;;; Synonyms: (define call/cc call-with-current-continuation) (define quit exit) ;;; Backwards compatibility. These procedures are really obsolete; ;;; please do not use them any longer. (define (close-port p) (if (input-port? p) (close-input-port p) (close-output-port p))) (define (void? x) (eq? x (string->symbol ""))) (define (re-entrant-continuations?) #t) ;;; Useful macros (these were loaded by the standard toplevel in ;;; earlier versions of Elk). They shouldn't really be here, but ;;; it's too late... (define (expand form) (if (or (not (pair? form)) (null? form)) form (let ((head (expand (car form))) (args (expand (cdr form))) (result)) (if (and (symbol? head) (bound? head)) (begin (set! result (macro-expand (cons head args))) (if (not (equal? result form)) (expand result) result)) (cons head args))))) (define-macro (unwind-protect body . unwind-forms) `(dynamic-wind (lambda () #f) (lambda () ,body) (lambda () ,@unwind-forms))) (define-macro (while test . body) `(let loop () (cond (,test ,@body (loop))))) (define-macro (when test . body) `(cond (,test ,@body))) (define-macro (unless test . body) `(when (not ,test) ,@body)) (define-macro (multiple-value-bind vars form . body) `(apply (lambda ,vars ,@body) ,form)) elk-3.99.8/scm/pp.scm0000644000175000017500000000530211577076306011241 00000000000000;;; -*-Scheme-*- ;;; ;;; Trivial pretty-printer (provide 'pp) (define pp) (let ((max-pos 55) (pos 0) (tab-stop 8)) (put 'lambda 'special #t) (put 'macro 'special #t) (put 'define 'special #t) (put 'define-macro 'special #t) (put 'define-structure 'special #t) (put 'fluid-let 'special #t) (put 'let 'special #t) (put 'let* 'special #t) (put 'letrec 'special #t) (put 'case 'special #t) (put 'call-with-current-continuation 'long #t) (put 'quote 'abbr "'") (put 'quasiquote 'abbr "`") (put 'unquote 'abbr ",") (put 'unquote-splicing 'abbr ",@") (set! pp (lambda (x) (set! pos 0) (cond ((eq? (type x) 'compound) (set! x (procedure-lambda x))) ((eq? (type x) 'macro) (set! x (macro-body x)))) (fluid-let ((garbage-collect-notify? #f)) (pp-object x)) #v)) (define (flat-size s) (fluid-let ((print-length 50) (print-depth 10)) (string-length (format #f "~a" s)))) (define (pp-object x) (if (or (null? x) (pair? x)) (pp-list x) (if (void? x) (display "#v") (write x)) (set! pos (+ pos (flat-size x))))) (define (pp-list x) (if (and (pair? x) (symbol? (car x)) (string? (get (car x) 'abbr)) (= 2 (length x))) (let ((abbr (get (car x) 'abbr))) (display abbr) (set! pos (+ pos (flat-size abbr))) (pp-object (cadr x))) (if (> (flat-size x) (- max-pos pos)) (pp-list-vertically x) (pp-list-horizontally x)))) (define (pp-list-vertically x) (maybe-pp-list-vertically #t x)) (define (pp-list-horizontally x) (maybe-pp-list-vertically #f x)) (define (maybe-pp-list-vertically vertical? list) (display "(") (set! pos (1+ pos)) (if (null? list) (begin (display ")") (set! pos (1+ pos))) (let ((pos1 pos)) (pp-object (car list)) (if (and vertical? (or (and (pair? (car list)) (not (null? (cdr list)))) (and (symbol? (car list)) (get (car list) 'long)))) (indent-newline (1- pos1))) (let ((pos2 (1+ pos)) (key (car list))) (let tail ((flag #f) (l (cdr list))) (cond ((pair? l) (if flag (indent-newline (if (and (symbol? key) (get key 'special)) (1+ pos1) pos2)) (display " ") (set! pos (1+ pos))) (pp-object (car l)) (tail vertical? (cdr l))) (else (cond ((not (null? l)) (display " . ") (set! pos (+ pos 3)) (if flag (indent-newline pos2)) (pp-object l))) (display ")") (set! pos (1+ pos))))))))) (define (indent-newline x) (newline) (set! pos x) (let loop ((i x)) (cond ((>= i tab-stop) (display "\t") (loop (- i tab-stop))) ((> i 0) (display " ") (loop (1- i))))))) elk-3.99.8/scm/struct.scm0000644000175000017500000001014011577076306012142 00000000000000;;; -*-Scheme-*- ;;; ;;; The `strucuture' extension is obsolete and should not be used in ;;; applications any longer; it has been replaced by the more powerful ;;; `record' extension. ;;; ;;; The Scheme part of the structures implementation ;;; ;;; (define-structure name slot slot ...) ;;; ;;; slot = slot-name or (slot-name initial-value) (require 'struct.la) (define-macro (define-structure name . slot-descr) (internal-define-structure name slot-descr #t)) (define-macro (define-simple-structure name . slot-descr) (internal-define-structure name slot-descr #f)) (define (internal-define-structure name slot-descr full?) (if (not (symbol? name)) (error 'define-structure "structure name must be a symbol")) (if (null? slot-descr) (error 'define-structure "structure has no slots")) (let* ((s (symbol->string name)) (constructor (string->symbol (string-append "make-" s))) (predicator (string->symbol (string-append s "?"))) (copier (string->symbol (string-append "copy-" s))) (slots '()) (arg-slots '())) (for-each (lambda (slot) (cond ((symbol? slot) (set! slots (cons slot slots)) (set! arg-slots (cons slot arg-slots))) ((pair? slot) (if (or (not (pair? (cdr slot))) (not (null? (cddr slot)))) (error 'define-structure "invalid slot specification") (if (not (symbol? (car slot))) (error 'define-structure "slot name must be a symbol")) (set! slots (cons (car slot) slots)))) (else (error 'define-structure "slot must be symbol or list")))) slot-descr) (set! slots (reverse slots)) `(begin (make-constructor ,constructor ,name ,slots ,(reverse arg-slots) ,slot-descr) (make-predicator ,predicator ',name) (make-copier ,copier) ,@(let ((offset -1)) (map (lambda (slot) (let ((f (string->symbol (format #f "~s-~s" name slot)))) (set! offset (1+ offset)) `(make-accessor ,f ',name ,offset))) slots)) ,@(if full? (let ((offset -1)) (map (lambda (slot) (let ((f (string->symbol (format #f "set-~s-~s!" name slot)))) (set! offset (1+ offset)) `(make-mutator ,f ',name ,offset))) slots))) ',name))) (define-macro (make-constructor constructor name slots arg-slots descr) `(define (,constructor ,@arg-slots) (let ((,name (make-structure ',name ',slots))) ,@(let ((offset -1)) (map (lambda (slot) (set! offset (1+ offset)) `(structure-set! ,name ',name ,offset ,(if (symbol? slot) slot (cadr slot)))) descr)) ,name))) (define-macro (make-predicator predicator name) `(define (,predicator x) (and (structure? x) (eq? (structure-name x) ,name)))) (define-macro (make-copier copier) `(define (,copier x) (copy-structure x))) (define-macro (make-accessor accessor name offset) `(define (,accessor x) (structure-ref x ,name ,offset))) (define-macro (make-mutator mutator name offset) `(define (,mutator x val) (structure-set! x ,name ,offset val))) (define (copy-structure s) (let* ((slots (structure-slots s)) (name (structure-name s)) (new (make-structure name slots)) (size (length slots))) (do ((offset 0 (1+ offset))) ((= offset size) new) (structure-set! new name offset (structure-ref s name offset))))) (define (describe-structure s) (format #t "a structure of type ~s.~%" (structure-name s)) (if (null? (structure-slots s)) (format #t "It has no slots.~%") (format #t "Its slots are:") (for-each (lambda (s v) (format #t " (~s ~s)" s v)) (structure-slots s) (structure-values s)) (format #t ".~%"))) (provide 'struct) elk-3.99.8/scm/describe.scm0000644000175000017500000000420611577076306012404 00000000000000;;; -*-Scheme-*- ;;; ;;; describe -- print information about a Scheme object (define (describe x) (fluid-let ((print-depth 2) (print-length 3)) (format #t "~s is " (if (void? x) '\#v x))) (case (type x) (integer (format #t "an integer.~%")) (real (format #t "a real.~%")) (null (format #t "an empty list.~%")) (boolean (format #t "a boolean value (~s).~%" (if x 'true 'false))) (character (format #t "a character, ascii value is ~s~%" (char->integer x))) (symbol (format #t "a symbol~a." (if (void? x) " (the non-printing object)" "")) (let ((l (symbol-plist x))) (if (null? l) (format #t " It has no property list.~%") (format #t "~%Its property list is: ~s.~%" l)))) (pair (if (pair? (cdr x)) (let ((p (last-pair x))) (if (null? (cdr p)) (format #t "a list of length ~s.~%" (length x)) (format #t "an improper list.~%"))) (format #t "a pair.~%"))) (environment (format #t "an environment.~%")) (string (if (eqv? x "") (format #t "an empty string.~%") (format #t "a string of length ~s.~%" (string-length x)))) (vector (if (eqv? x '#()) (format #t "an empty vector.~%") (if (and (feature? 'oops) (memq (vector-ref x 0) '(class instance))) (if (eq? (vector-ref x 0) 'class) (begin (format #t "a class.~%~%") (describe-class x)) (format #t "an instance.~%~%") (describe-instance x)) (format #t "a vector of length ~s.~%" (vector-length x))))) (primitive (format #t "a primitive procedure.~%")) (compound (format #t "a compound procedure (type ~s).~%" (car (procedure-lambda x)))) (control-point (format #t "a control point (continuation).~%")) (promise (format #t "a promise.~%")) (port (format #t "a port.~%")) (end-of-file (format #t "the end-of-file object.~%")) (macro (format #t "a macro.~%")) (else (let ((descr-func (string->symbol (format #f "describe-~s" (type x))))) (if (bound? descr-func) ((eval descr-func) x) (format #t "an object of unknown type (~s)~%" (type x))))))) elk-3.99.8/scm/xwidgets.scm0000644000175000017500000000174111577076306012463 00000000000000;;; -*-Scheme-*- ;;; ;;; The Scheme part of the Xt extension. (define widgets (if (feature? 'motif) 'motif 'xaw)) (require 'xlib) (require (string->symbol (format #f "~a.la" widgets))) (provide 'xwidgets) (define (manage-child w) (manage-children (list w))) (define (unmanage-child w) (unmanage-children (list w))) (define (add-callback w name fun) (add-callbacks w name (list fun))) (define (create-managed-widget . args) (let ((w (apply create-widget args))) (manage-child w) w)) (define application-initialize #f) (let ((con) (dpy) (app-class #f) (shell-class #f)) (set! application-initialize (lambda (name . fallback-res) (set! con (create-context)) (if (not (null? fallback-res)) (apply set-context-fallback-resources! con fallback-res)) (set! dpy (initialize-display con #f name app-class)) (create-shell name shell-class (find-class 'application-shell) dpy)))) ;; Backwards compatibility: (define widget-window widget->window) elk-3.99.8/scm/setf.scm0000644000175000017500000000114011577076306011557 00000000000000;;; -*-Scheme-*- ;;; ;;; An attempt on defsetf and setf (define defsetf) (define get-setter) (let ((setters '())) (set! defsetf (lambda (accessor setter) (set! setters (cons (cons accessor setter) setters)) #v)) (set! get-setter (lambda (accessor) (let ((a (assoc accessor setters))) (if a (cdr a) (error 'get-setter "no setter for ~s" accessor)))))) (define-macro (setf var val) (cond ((symbol? var) `(set! ,var ,val)) ((pair? var) (let ((setter (get-setter (eval (car var))))) `(,setter ,@(cdr var) ,val))) (else (error 'setf "symbol or form expected")))) elk-3.99.8/scm/cscheme.scm0000644000175000017500000000734411577076306012241 00000000000000;;; -*-Scheme-*- ;;; ;;; A few C-Scheme compatibility hacks (provide 'cscheme) (define-macro (syntax-table-define table name mac) `(define ,(eval name) ,mac)) (define mapcar map) (define user-initial-environment (global-environment)) (define (rep-environment) (global-environment)) (define (atom? x) (not (pair? x))) (define nil '()) (define *the-non-printing-object* #v) (define (integer->string i) (format #f "~s" i)) (define (get* sym prop) (let ((ret (get sym prop))) (if ret ret '()))) (define-macro (access sym env) `(eval ',sym ,env)) (define-macro (in-package env . body) `(eval '(begin ,@body) ,env)) (define-macro (without-interrupts thunk) `(,thunk)) (define-macro (rec var exp) `(letrec ((,var ,exp)) ,exp)) (define (cons* first . rest) (let loop ((curr first) (rest rest)) (if (null? rest) curr (cons curr (loop (car rest) (cdr rest)))))) (define sequence begin) (define -1+ 1-) (define (remq x y) (cond ((null? y) y) ((eq? x (car y)) (remq x (cdr y))) (else (cons (car y) (remq x (cdr y)))))) (define (remv x y) (cond ((null? y) y) ((eqv? x (car y)) (remv x (cdr y))) (else (cons (car y) (remv x (cdr y)))))) (define (remove x y) (cond ((null? y) y) ((equal? x (car y)) (remove x (cdr y))) (else (cons (car y) (remove x (cdr y)))))) (define (remq! x y) (cond ((null? y) y) ((eq? x (car y)) (remq! x (cdr y))) (else (let loop ((prev y)) (cond ((null? (cdr prev)) y) ((eq? (cadr prev) x) (set-cdr! prev (cddr prev)) (loop prev)) (else (loop (cdr prev)))))))) (define (remv! x y) (cond ((null? y) y) ((eqv? x (car y)) (remv! x (cdr y))) (else (let loop ((prev y)) (cond ((null? (cdr prev)) y) ((eqv? (cadr prev) x) (set-cdr! prev (cddr prev)) (loop prev)) (else (loop (cdr prev)))))))) (define (remove! x y) (cond ((null? y) y) ((equal? x (car y)) (remove! x (cdr y))) (else (let loop ((prev y)) (cond ((null? (cdr prev)) y) ((equal? (cadr prev) x) (set-cdr! prev (cddr prev)) (loop prev)) (else (loop (cdr prev)))))))) (define delq remq) (define delv remv) (define delete remove) (define delq! remq!) (define delv! remv!) (define delete! remove!) (empty-list-is-false-for-backward-compatibility #t) (if (feature? 'bitstring) (begin (define (bit-string-allocate k) (make-bitstring k #f)) (define bit-string-copy bitstring-copy) (define bit-string? bitstring?) (define bit-string-length bitstring-length) (define bit-string-ref bitstring-ref) (define (bit-string-set! b i) (bitstring-set! b i #t)) (define (bit-string-clear! b i) (bitstring-set! b i #f)) (define bit-string-append bitstring-append) (define bit-substring bitstring-substring) (define bit-string-zero? bitstring-zero?) (define bit-string=? bitstring=?) (define bit-string-not bitstring-not) (define bit-string-movec! bitstring-not!) (define bit-string-and bitstring-and) (define bit-string-andc bitstring-andnot) (define bit-string-or bitstring-or) (define bit-string-xor bitstring-xor) (define bit-string-and! bitstring-and!) (define bit-string-or! bitstring-or!) (define bit-string-xor! bitstring-xor!) (define bit-string-andc! bitstring-andnot!) (define bit-string-fill! bitstring-fill!) (define bit-string-move! bitstring-move!) (define bit-substring-move-right! bitstring-substring-move!) (define unsigned-integer->bit-string unsigned-integer->bitstring) (define signed-integer->bit-string signed-integer->bitstring) (define bit-string->unsigned-integer bitstring->unsigned-integer) (define bit-string->signed-integer bitstring->signed-integer))) elk-3.99.8/scm/trace.scm0000644000175000017500000000243311577076306011722 00000000000000;;; -*-Scheme-*- ;;; ;;; A simple trace package contributed in 1990 by WAKITA Ken ;;; (ken-w@is.s.u-tokyo.ac.jp) (define trc:trace-list '(())) (define (reset-trace) (set! trc:trace-list '(()))) (define-macro (trace func) `(let ((the-func (eval ,func)) (result #v)) (if (assoc ',func trc:trace-list) (error 'trace "~s already trace on." ,func)) (if (not (compound? ,func)) (error 'trace "wrong argument type ~s (expected compound)" (type ,func))) (set! trc:trace-list (cons '() (cons (cons ',func the-func) (cdr trc:trace-list)))) (set! ,func (lambda param-list (format #t "# Entering ~s~%" (cons ',func param-list)) (set! result (apply the-func param-list)) (format #t "# Exiting ~s ==> ~s~%" (cons ',func param-list) result) result)))) (define-macro (untrace func) `(let ((the-func (assoc ',func trc:trace-list))) (define (remove! func) (let ((prev trc:trace-list) (here (cdr trc:trace-list))) (while (and here (not (eq? func (caar here)))) (set! prev here) (set! here (cdr here))) (if (not here) (error 'remove "item ~s not found." func) (set-cdr! prev (cdr here))))) (if the-func (begin (remove! ',func) (set! ,func (cdr the-func)))))) elk-3.99.8/scm/regexp.scm0000644000175000017500000000140311577076306012112 00000000000000;;; -*-Scheme-*- ;;; ;;; The Scheme layer of the regexp extension is (almost) empty for now. ;;; It mainly exists to enable use of "(require 'regexp)". (require 'regexp.la) (define (describe-regexp r) (format #t "a regular expression.~%") (format #t "Its pattern is ~s,~%" (regexp-pattern r)) (format #t "and its flags are ~s.~%" (regexp-flags r))) (define (describe-regexp-match m) (format #t "a regular expression match.~%") (let ((n (regexp-match-number m))) (if (zero? n) (format #t "It has no substring matches.~%") (format #t "It has ~s substring match~a:~%" n (if (= n 1) "" "es")) (do ((i 0 (1+ i))) ((= i n)) (format #t " ~s~%" (cons (regexp-match-start m i) (regexp-match-end m i))))))) (provide 'regexp) elk-3.99.8/scm/xlib.scm0000644000175000017500000003160711577076306011567 00000000000000;;; -*-Scheme-*- ;;; ;;; The Scheme part of the Xlib extension. (require 'xlib.la) (define (create-window . args) (apply-with-keywords 'create-window xlib-create-window '((parent) (x 0) (y 0) (width) (height) (border 2)) 'set-window-attributes set-window-attributes-slots args)) (define (create-gcontext . args) (apply-with-keywords 'create-gcontext xlib-create-gcontext '((window)) 'gcontext gcontext-slots args)) (define (set-wm-hints! . args) (apply-with-keywords 'set-wm-hints! xlib-set-wm-hints! '((window)) 'wm-hints wm-hints-slots args)) (define (wm-hints w) (cdr (vector->list (xlib-wm-hints w)))) (define (set-wm-normal-hints! . args) (apply-with-keywords 'set-wm-normal-hints! xlib-set-wm-normal-hints! '((window)) 'size-hints size-hints-slots args)) (define (wm-normal-hints w) (cdr (vector->list (xlib-wm-normal-hints w)))) (define (reconfigure-wm-window . args) (apply-with-keywords 'reconfigure-wm-window xlib-reconfigure-wm-window '((window) (screen)) 'window-configuration window-configuration-slots args)) (define (apply-with-keywords name function formals tag slots args) (let* ((v (make-vector (1+ (length slots)) '())) (empty '(empty)) (l (make-list (1+ (length formals)) empty)) (slot '())) (vector-set! v 0 tag) (do ((a args (cddr a))) ((null? a)) (if (not (symbol? (car a))) (error name "even-numbered argument must be a symbol")) (if (null? (cdr a)) (error name "missing value for ~s" (car a))) (set! slot (assq (car a) slots)) (if slot (vector-set! v (cdr slot) (cadr a)) (let loop ((f formals) (g l)) (if (null? f) (error name "unknown argument ~s" (car a))) (if (eq? (car a) (caar f)) (set-car! g (cadr a)) (loop (cdr f) (cdr g)))))) (set-car! (last-pair l) v) (do ((f formals (cdr f)) (a l (cdr a))) ((null? f)) (if (eq? (car a) empty) (if (pair? (cdar f)) (set-car! a (cadar f)) (error name "you must specify a value for ~s" (caar f))))) (apply function l))) ;;; Definition of the access and update functions for window attributes, ;;; geometry, gcontexts, etc. (define-macro (define-functions definer type fun pref) (let ((slots (string->symbol (format #f "~s-slots" type)))) `(for-each eval (map (lambda (s) (,definer ',type (1+ (length ,slots)) ,fun s ,pref)) ,slots)))) (define (define-accessor-with-cache type num-slots fun slot pref) (let ((name (string->symbol (format #f pref (car slot))))) `(define (,name object) (general-accessor object ',type ,fun ,(cdr slot))))) (define (define-mutator-with-cache type num-slots fun slot pref) (let ((name (string->symbol (format #f pref (car slot))))) `(define (,name object val) (general-mutator object val ',type ,num-slots ,fun ,(cdr slot))))) (define (define-accessor type num-slots fun slot pref) (let ((name (string->symbol (format #f pref (car slot))))) `(define (,name . args) (vector-ref (apply ,fun args) ,(cdr slot))))) (define-functions define-accessor-with-cache get-window-attributes xlib-get-window-attributes "window-~s") (define-functions define-mutator-with-cache set-window-attributes xlib-change-window-attributes "set-window-~s!") (define-functions define-mutator-with-cache window-configuration xlib-configure-window "set-window-~s!") (define-functions define-accessor-with-cache geometry xlib-get-geometry "drawable-~s") (define-functions define-mutator-with-cache gcontext xlib-change-gcontext "set-gcontext-~s!") ;; Note: gcontext-clip-mask and gcontext-dashes are bogus. (define gcontext-values-slots gcontext-slots) (define-functions define-accessor-with-cache gcontext-values xlib-get-gcontext-values "gcontext-~s") (define-functions define-accessor-with-cache font-info xlib-font-info "font-~s") (define-functions define-accessor char-info xlib-char-info "char-~s") (define (min-char-info c) (xlib-char-info c 'min)) (define (max-char-info c) (xlib-char-info c 'max)) ;; Note: min-char-attributes, max-char-attributes, and ;; text-extents-attributes are bogus. (define-functions define-accessor char-info min-char-info "min-char-~s") (define-functions define-accessor char-info max-char-info "max-char-~s") (define-functions define-accessor char-info xlib-text-extents "extents-~s") ;;; ``cache'' is an a-list of (drawable-or-gcontext-or-font . state) pairs, ;;; where state is a vector of buffers as listed below. Each slot in ;;; a vector can be #f to indicate that the cache is empty. The cache ;;; is manipulated by the ``with'' macro. (define cache '()) (define num-slots 7) (put 'set-window-attributes 'cache-slot 0) (put 'get-window-attributes 'cache-slot 1) (put 'window-configuration 'cache-slot 2) (put 'geometry 'cache-slot 3) (put 'gcontext 'cache-slot 4) (put 'font-info 'cache-slot 5) (put 'gcontext-values 'cache-slot 6) ;;; List of buffers that are manipulated by mutator functions and must ;;; be flushed using the associated update function when a ``with'' is ;;; left (e.g., a set-window-attributes buffer is manipulated by ;;; set-window-FOO functions; the buffer is flushed by a call to ;;; (change-window-attributes WINDOW BUFFER)): (define mutable-types '(set-window-attributes window-configuration gcontext)) (put 'set-window-attributes 'update-function xlib-change-window-attributes) (put 'window-configuration 'update-function xlib-configure-window) (put 'gcontext 'update-function xlib-change-gcontext) ;;; Some types of buffers in the cache are invalidated when other ;;; buffers are written to. For instance, a get-window-attributes ;;; buffer for a window must be filled again when the window's ;;; set-window-attributes or window-configuration buffers have been ;;; written to. (put 'get-window-attributes 'invalidated-by '(set-window-attributes window-configuration)) (put 'geometry 'invalidated-by '(set-window-attributes window-configuration)) (put 'gcontext-values 'invalidated-by '(gcontext)) ;;; Within the scope of a ``with'', the first call to a OBJECT-FOO ;;; function causes the result of the corresponding Xlib function to ;;; be retained in the cache; subsequent calls just read from the cache. ;;; Similarly, calls to Xlib functions for set-OBJECT-FOO! functions are ;;; delayed until exit of the ``with'' body or until a OBJECT-FOO ;;; is called and the cached data for this accessor function has been ;;; invalidated by the call to the mutator function (see ``invalidated-by'' ;;; property above). (define-macro (with object . body) `(if (assq ,object cache) ; if it's already in the cache, just (begin ,@body) ; execute the body. (dynamic-wind (lambda () (set! cache (cons (cons ,object (make-vector num-slots #f)) cache))) (lambda () ,@body) (lambda () (for-each (lambda (x) (flush-cache (car cache) x)) mutable-types) (set! cache (cdr cache)))))) ;;; If a mutator function has been called on an entry in the cache ;;; of the given type, flush it by calling the right update function. (define (flush-cache entry type) (let* ((slot (get type 'cache-slot)) (buf (vector-ref (cdr entry) slot))) (if buf (begin ((get type 'update-function) (car entry) buf) (vector-set! (cdr entry) slot #f))))) ;;; General accessor function (OBJECT-FOO). See if the data in the ;;; cache have been invalidated. If this is the case, or if the cache ;;; has not yet been filled, fill it. (define (general-accessor object type fun slot) (let ((v) (entry (assq object cache))) (if entry (let ((cache-slot (get type 'cache-slot)) (inval (get type 'invalidated-by))) (if inval (let ((must-flush #f)) (for-each (lambda (x) (if (vector-ref (cdr entry) (get x 'cache-slot)) (set! must-flush #t))) inval) (if must-flush (begin (for-each (lambda (x) (flush-cache entry x)) inval) (vector-set! (cdr entry) cache-slot #f))))) (if (not (vector-ref (cdr entry) cache-slot)) (vector-set! (cdr entry) cache-slot (fun object))) (set! v (vector-ref (cdr entry) cache-slot))) (set! v (fun object))) (vector-ref v slot))) ;;; General mutator function (set-OBJECT-FOO!). If the cache is empty, ;;; put a new buffer of the given type and size into it. Write VAL ;;; into the buffer. (define (general-mutator object val type num-slots fun slot) (let ((entry (assq object cache))) (if entry (let ((cache-slot (get type 'cache-slot))) (if (not (vector-ref (cdr entry) cache-slot)) (let ((v (make-vector num-slots '()))) (vector-set! v 0 type) (vector-set! (cdr entry) cache-slot v) (vector-set! v slot val)) (vector-set! (vector-ref (cdr entry) cache-slot) slot val))) (let ((v (make-vector num-slots '()))) (vector-set! v 0 type) (vector-set! v slot val) (fun object v))))) (define (translate-text string) (list->vector (map char->integer (string->list string)))) (define (drawable? d) (or (window? d) (pixmap? d))) (define (clear-window w) (clear-area w 0 0 0 0 #f)) (define (raise-window w) (set-window-stack-mode! w 'above)) (define (lower-window w) (set-window-stack-mode! w 'below)) (define (restack-windows l) (let loop ((w (car l)) (t (cdr l))) (if t (begin (set-window-sibling! (car t) w) (set-window-stack-mode! (car t) 'below) (loop (car t) (cdr t)))))) (define (define-cursor w c) (set-window-cursor! w c)) (define (undefine-cursor w) (set-window-cursor! w 'none)) (define (create-font-cursor dpy which) (let ((font (open-font dpy 'cursor))) (unwind-protect (create-glyph-cursor font which font (1+ which) (make-color 0 0 0) (make-color 1 1 1)) (close-font font)))) (define (synchronize d) (set-after-function! d (lambda (d) (display-wait-output d #f)))) (define (font-property font prop) (let* ((dpy (font-display font)) (atom (intern-atom dpy prop)) (properties (vector->list (font-properties font))) (result (assq atom properties))) (if result (cdr result) result))) (define-macro (with-server-grabbed dpy . body) `(dynamic-wind (lambda () (grab-server ,dpy)) (lambda () ,@body) (lambda () (ungrab-server ,dpy)))) (define (warp-pointer dst dst-x dst-y) (general-warp-pointer (window-display dst) dst dst-x dst-y 'none 0 0 0 0)) (define (warp-pointer-relative dpy x-off y-off) (general-warp-pointer dpy 'none x-off y-off 'none 0 0 0 0)) (define (query-best-cursor dpy w h) (query-best-size dpy w h 'cursor)) (define (query-best-tile dpy w h) (query-best-size dpy w h 'tile)) (define (query-best-stipple dpy w h) (query-best-size dpy w h 'stipple)) (define store-buffer) (define store-bytes) (define fetch-buffer) (define fetch-bytes) (define rotate-buffers) (let ((xa-string (make-atom 31)) (xa-cut-buffers (vector (make-atom 9) (make-atom 10) (make-atom 11) (make-atom 12) (make-atom 13) (make-atom 14) (make-atom 15) (make-atom 16)))) (set! store-buffer (lambda (dpy bytes buf) (if (<= 0 buf 7) (change-property (display-root-window dpy) (vector-ref xa-cut-buffers buf) xa-string 8 'replace bytes)))) (set! store-bytes (lambda (dpy bytes) (store-buffer dpy bytes 0))) (set! fetch-buffer (lambda (dpy buf) (if (<= 0 buf 7) (multiple-value-bind (type format data bytes-left) (get-property (display-root-window dpy) (vector-ref xa-cut-buffers buf) xa-string 0 100000 #f) (if (and (eq? type xa-string) (< format 32)) data "")) ""))) (set! fetch-bytes (lambda (dpy) (fetch-buffer dpy 0))) (set! rotate-buffers (lambda (dpy delta) (rotate-properties (display-root-window dpy) xa-cut-buffers delta)))) (define xa-wm-normal-hints (make-atom 40)) (define (xlib-wm-normal-hints w) (xlib-wm-size-hints w xa-wm-normal-hints)) (define (xlib-set-wm-normal-hints! w h) (xlib-set-wm-size-hints! w xa-wm-normal-hints h)) (define xa-wm-name (make-atom 39)) (define xa-wm-icon-name (make-atom 37)) (define xa-wm-client-machine (make-atom 36)) (define (wm-name w) (get-text-property w xa-wm-name)) (define (wm-icon-name w) (get-text-property w xa-wm-icon-name)) (define (wm-client-machine w) (get-text-property w xa-wm-client-machine)) (define (set-wm-name! w s) (set-text-property! w s xa-wm-name)) (define (set-wm-icon-name! w s) (set-text-property! w s xa-wm-icon-name)) (define (set-wm-client-machine! w s) (set-text-property! w s xa-wm-client-machine)) ;; Backwards compatibility: (define display-root-window display-default-root-window) (define display-colormap display-default-colormap) ;; Backwards compatibility hack for old-style make-* functions: (define-macro (make-compat make-macro create-function) `(define-macro (,make-macro . args) (let ((cargs (let loop ((a args) (v '())) (if (null? a) v (loop (cdr a) `(',(caar a) ,(cadar a) ,@v)))))) (cons ,create-function cargs)))) (make-compat make-gcontext create-gcontext) (make-compat make-window create-window) ;;; Describe functions go here: (provide 'xlib) elk-3.99.8/scm/apropos.scm0000644000175000017500000000115511577076306012307 00000000000000;;; -*-Scheme-*- ;;; ;;; apropos -- print matching symbols (define apropos) (let ((found)) (define (got-one sym) (if (bound? sym) (begin (set! found #t) (print sym)))) (set! apropos (lambda (what) (if (symbol? what) (set! what (symbol->string what)) (if (not (string? what)) (error 'apropos "string or symbol expected"))) (set! found #f) (do ((tail (oblist) (cdr tail))) ((null? tail)) (do ((l (car tail) (cdr l))) ((null? l)) (if (substring? what (symbol->string (car l))) (got-one (car l))))) (if (not found) (format #t "~a: nothing appropriate~%" what)) #v))) elk-3.99.8/scm/recordutil.scm0000644000175000017500000000230211577076306012773 00000000000000;;; -*-Scheme-*- ;;; ;;; Utility macros for use with the record extension. (define-macro (define-record-type name fields) (let* ((rtd (eval `(make-record-type ',name ',fields))) (namestr (symbol->string name))) `(begin (define ,(string->symbol (string-append namestr "-record")) ,rtd) (define ,(string->symbol (string-append "make-" namestr "-record")) ,(record-constructor rtd '())) (define ,(string->symbol (string-append namestr "-record?")) ,(record-predicate rtd)) #v))) (define-macro (define-record-accessors rtd) (let* ((r (eval rtd))) `(begin ,@(map (lambda (field) `(define ( ,(string->symbol (string-append (record-type-name r) "-" (symbol->string field))) record) (,(record-accessor r field) record))) (record-type-field-names r)) #v))) (define-macro (define-record-modifiers rtd) (let* ((r (eval rtd))) `(begin ,@(map (lambda (field) `(define ( ,(string->symbol (string-append "set-" (record-type-name r) "-" (symbol->string field) "!")) record value) (,(record-modifier r field) record value))) (record-type-field-names r)) #v))) (provide 'recordutil) elk-3.99.8/scm/unix.scm0000644000175000017500000001242111577076306011605 00000000000000;;; -*-Scheme-*- ;;; ;;; The Scheme layer of the UNIX extension. (require 'record) (require 'recordutil) (require 'unix.la) (define-record-type stat (type mode ino dev nlink uid gid size atime mtime ctime)) (define-record-accessors stat-record) (define (unix-stat fn) (let* ((ret (make-stat-record)) (err (unix-stat-vector-fill! fn (record-values ret)))) (if (unix-error? err) err ret))) (if (feature? 'unix:symlinks) (define (unix-lstat fn) (let* ((ret (make-stat-record)) (err (unix-lstat-vector-fill! fn (record-values ret)))) (if (unix-error? err) err ret)))) (define-record-type time (seconds minutes hours day-of-month month year weekday day-of-year dst)) (define-record-accessors time-record) (define-record-modifiers time-record) (define (unix-decode-localtime t) (let ((ret (make-time-record))) (unix-decode-time-vector-fill! t (record-values ret) #f) ret)) (define (unix-decode-utc t) (let ((ret (make-time-record))) (unix-decode-time-vector-fill! t (record-values ret) #t) ret)) (define (unix-time->string t) (cond ((integer? t) (unix-time->string-internal t)) ((time-record? t) (unix-time->string-internal (record-values t))) (else (error 'unix-time->string "argument must be integer or time-record")))) (define-record-type nanotime (nanoseconds minuteswest dst)) (define-record-accessors nanotime-record) (define (unix-internal-make-nanotime v i) (if (vector-ref v i) (vector-set! v i (+ (* (car (vector-ref v i)) 1000000000) (cdr (vector-ref v i)))))) (define (unix-nanotime) (let* ((ret (make-nanotime-record)) (v (record-values ret))) (unix-nanotime-vector-fill! v) (vector-set! v 0 (+ (* (car (vector-ref v 0)) 1000000000) (cdr (vector-ref v 0)))) ret)) (define-record-type system (hostname sysname osname)) (define-record-accessors system-record) (define (unix-system-info) (let ((ret (make-system-record))) (unix-system-info-vector-fill! (record-values ret)) ret)) (define-record-type passwd (name password uid gid gecos homedir shell)) (define-record-accessors passwd-record) (define (unix-get-passwd . arg) (let* ((ret (make-passwd-record)) (err (apply unix-get-passwd-vector-fill! (record-values ret) arg))) (if (unix-error? err) err ret))) (define-record-type group (name password gid members)) (define-record-accessors group-record) (define (unix-get-group . arg) (let* ((ret (make-group-record)) (err (apply unix-get-group-vector-fill! (record-values ret) arg))) (if (unix-error? err) err ret))) (define-record-type resources (user-time system-time)) (define-record-accessors resources-record) (define (unix-process-resources) (let* ((self (make-resources-record)) (children (make-resources-record)) (v1 (record-values self)) (v2 (record-values children)) (ticks/s (unix-process-resources-vector-fill! v1 v2)) (convert (lambda (ticks) (round (/ (* ticks 1000000000) ticks/s))))) (vector-set! v1 0 (convert (vector-ref v1 0))) (vector-set! v1 1 (convert (vector-ref v1 1))) (vector-set! v2 0 (convert (vector-ref v2 0))) (vector-set! v2 1 (convert (vector-ref v2 1))) (cons self children))) (if (feature? 'unix:file-locking) (begin (define-record-type lock (exclusive? whence start length)) (define-record-accessors lock-record) (define-record-modifiers lock-record) (define (unix-set-lock fd lock wait?) (if (not (lock-record? lock)) (error 'unix-set-lock "argument not a lock-record")) (unix-internal-lock-operation fd (record-values lock) wait? #\s 0)) (define (unix-remove-lock fd lock) (if (not (lock-record? lock)) (error 'unix-remove-lock "argument not a lock-record")) (unix-internal-lock-operation fd (record-values lock) #f #\r 0)) (define (unix-query-lock fd lock) (if (not (lock-record? lock)) (error 'unix-remove-lock "argument not a lock-record")) (let* ((ret (make-lock-record)) (pid (unix-internal-lock-operation fd (record-values lock) #f #\q (record-values ret)))) (if pid (cons pid ret) #f))))) (define-record-type wait (pid status code core-dump? resources)) (define-record-accessors wait-record) (define (unix-wait . options) (let* ((ret (make-wait-record)) (resources ((record-constructor resources-record) #f #f)) (v (record-values ret)) (rv (record-values resources)) (err (apply unix-wait-vector-fill! v rv options))) (unix-internal-make-nanotime rv 0) (unix-internal-make-nanotime rv 1) (vector-set! v 4 resources) (if (unix-error? err) err ret))) (if (feature? 'unix:wait-process) (define (unix-wait-process pid . options) (let* ((ret (make-wait-record)) (resources ((record-constructor resources-record) #f #f)) (v (record-values ret)) (rv (record-values resources)) (err (apply unix-wait-process-vector-fill! v rv pid options))) (unix-internal-make-nanotime rv 0) (unix-internal-make-nanotime rv 1) (vector-set! v 4 resources) (if (unix-error? err) err ret)))) (define (unix-perror str) (format #t "~a: ~E" str)) (define-macro (unix-errval expr) `(fluid-let ((unix-call-standard-error-handler? #f)) ,expr)) ;; also need the opposite of unix-errval (i.e. make sure error is handled) (provide 'unix) elk-3.99.8/scm/parse.scm0000644000175000017500000000070011577076306011731 00000000000000;;; -*-Scheme-*- ;;; ;;; string-tokenize -- parse a string into a list of tokens (define (string-tokenize s) (let ((i 0) (j) (n (string-length s))) (let loop ((args '())) (while (and (< i n) (char-whitespace? (string-ref s i))) (set! i (1+ i))) (if (>= i n) (reverse! args) (set! j i) (while (and (< i n) (not (char-whitespace? (string-ref s i)))) (set! i (1+ i))) (loop (cons (substring s j i) args)))))) elk-3.99.8/scm/qsort.scm0000644000175000017500000000151511577076306011774 00000000000000;;; -*-Scheme-*- ;;; ;;; Quicksort (straight from Wirth, Algorithmen & Datenstrukturen, p. 117) (provide 'sort) (define (sort obj pred) (if (vector? obj) (sort! (vector-copy obj) pred) (vector->list (sort! (list->vector obj) pred)))) (define (sort! v pred) (define (internal-sort l r) (let ((i l) (j r) (x (vector-ref v (quotient (1- (+ l r)) 2)))) (let loop () (do () ((not (pred (vector-ref v i) x))) (set! i (1+ i))) (do () ((not (pred x (vector-ref v j)))) (set! j (1- j))) (if (<= i j) (begin (vector-set! v j (vector-set! v i (vector-ref v j))) (set! i (1+ i)) (set! j (1- j)))) (if (<= i j) (loop))) (if (< l j) (internal-sort l j)) (if (< i r) (internal-sort i r)))) (let ((len (vector-length v))) (if (> len 1) (internal-sort 0 (1- len))) v)) elk-3.99.8/scm/motif.scm0000644000175000017500000000023211577076306011735 00000000000000;;; -*-Scheme-*- ;;; ;;; This file is `required' in place of `xwidgets' when the Motif widgets ;;; are to be used. (provide 'motif) (require 'xwidgets) elk-3.99.8/scm/record.scm0000644000175000017500000000525211577076306012104 00000000000000;;; -*-Scheme-*- ;;; ;;; The Scheme layer of the record extension. (require 'record.la) (define (record-field-index name fields) (let loop ((fields fields) (index 0)) (cond ((null? fields) (error 'record-field-index "invalid field name")) ((eq? name (car fields)) index) (else (loop (cdr fields) (1+ index)))))) (define (record-constructor rtd . fields) (define (check-fields f) (if (not (null? f)) (if (or (not (symbol? (car f))) (memq (car f) (cdr f))) (error 'record-constructor "invalid field name") (check-fields (cdr f))))) (let* ((rtd-fields (record-type-field-names rtd)) (indexes '()) (size (length rtd-fields))) (if (null? fields) (set! fields rtd-fields) (if (not (null? (cdr fields))) (error 'record-constructor "too many arguments")) (set! fields (car fields)) check-fields fields) (set! indexes (map (lambda (x) (record-field-index x rtd-fields)) fields)) (lambda args (if (not (= (length args) (length fields))) (error 'record-constructor "invalid number of fields")) (let ((vec (make-vector size '()))) (for-each (lambda (index value) (vector-set! vec index value)) indexes args) (make-record rtd vec))))) (define (record-predicate rtd) (if (not (record-type? rtd)) (error 'record-predicate "argument not a record-type")) (lambda (obj) (and (record? obj) (eq? (record-type-descriptor obj) rtd)))) (define (record-accessor rtd field-name) (let ((index (record-field-index field-name (record-type-field-names rtd)))) (lambda (obj) (if (and (record? obj) (eq? (record-type-descriptor obj) rtd)) (vector-ref (record-values obj) index) (error 'record-accessor "argument not of correct record type"))))) (define (record-modifier rtd field-name) (let ((index (record-field-index field-name (record-type-field-names rtd)))) (lambda (obj val) (if (and (record? obj) (eq? (record-type-descriptor obj) rtd)) (vector-set! (record-values obj) index val) (error 'record-modifier "argument not of correct record type"))))) (define (describe-record-type rtd) (format #t "a record type.~%") (if (null? (record-type-field-names rtd)) (format #t "It has no fields.~%") (format #t "Its fields are: ~s.~%" (record-type-field-names rtd)))) (define (describe-record rec) (format #t "a record.~%") (let ((fields (record-type-field-names (record-type-descriptor rec)))) (if (null? fields) (format #t "It has no fields.~%") (format #t "Its fields are:") (for-each (lambda (f v) (format #t " (~s ~s)" f v)) fields (vector->list (record-values rec))) (format #t ".~%")))) (provide 'record) elk-3.99.8/scm/bitstring.scm0000644000175000017500000000341611577076306012633 00000000000000;;; -*-Scheme-*- ;;; ;;; The Scheme layer of the bitstring extension. (require 'bitstring.la) (define (bitstring-copy b) (let ((new (make-bitstring (bitstring-length b) #f))) (bitstring-move! new b) new)) (define (bitstring-append a b) (let* ((alen (bitstring-length a)) (blen (bitstring-length b)) (new (make-bitstring (+ alen blen) #f))) (bitstring-substring-move! a 0 alen new 0) (bitstring-substring-move! b 0 blen new alen) new)) (define (bitstring-substring b from to) (let ((new (make-bitstring (- to from) #f))) (bitstring-substring-move! b from to new 0) new)) (define (bitstring-not b) (let ((new (bitstring-copy b))) (bitstring-not! new b) new)) (define (bitstring-make-logical-function fun!) (lambda (a b) (let ((new (bitstring-copy a))) (fun! new b) new))) (define bitstring-and (bitstring-make-logical-function bitstring-and!)) (define bitstring-andnot (bitstring-make-logical-function bitstring-andnot!)) (define bitstring-or (bitstring-make-logical-function bitstring-or!)) (define bitstring-xor (bitstring-make-logical-function bitstring-xor!)) (define (signed-integer->bitstring len n) (if (or (>= n (expt 2 (1- len))) (< n (- (expt 2 (1- len))))) (error 'signed-integer->bitstring "length ~s too small for signed integer ~s" len n)) (unsigned-integer->bitstring len (if (negative? n) (+ n (expt 2 len)) n))) (define (bitstring->signed-integer b) (let ((n (bitstring->unsigned-integer b)) (len (bitstring-length b))) (cond ((zero? len) 0) ((bitstring-ref b (1- len)) (- n (expt 2 len))) (else n)))) (define (describe-bitstring b) (let ((len (bitstring-length b))) (format #t "a bitstring of length ~s bit~a.~%" len (if (= len 1) "" "s")))) (provide 'bitstring) elk-3.99.8/scm/safe-env.scm0000644000175000017500000000104511577076306012326 00000000000000;;; -*-Scheme-*- ;;; ;;; This macro evaluates its arguments (arbitrary expressions) in a ;;; lexical environment created as a copy of the global environment ;;; in which all the predefined primitives are bound. ;;; Contributed by Carsten Bormann (define-macro (with-safe-environment . body) (let* ((built-in-environment (car (last-pair (environment->list (the-environment))))) (binding-copy (map (lambda (p) (list (car p) (car p))) built-in-environment)) ) `(let ,binding-copy ,@body))) elk-3.99.8/scm/Makefile.am0000644000175000017500000000147011577076306012154 00000000000000NULL = EXTRA_DIST = $(SCM_FILES) $(SCM_DIST) slib.scm.in pkgdata_DATA = $(SCM_FILES) $(SCM_MAYBE) slib.scm SCM_FILES = \ apropos.scm \ bitstring.scm \ cscheme.scm \ debug.scm \ describe.scm \ initscheme.scm \ oops.scm \ parse.scm \ pp.scm \ qsort.scm \ record.scm \ recordutil.scm \ regexp.scm \ safe-env.scm \ setf.scm \ struct.scm \ toplevel.scm \ trace.scm \ unix.scm \ $(NULL) SCM_MAYBE = \ $(gdbmtest_scm) \ $(motif_scm) \ $(xlib_scm) \ $(xaw_scm) \ $(xwidgets_scm) \ $(NULL) SCM_DIST = \ gdbmtest.scm \ motif.scm \ xlib.scm \ xaw.scm \ xwidgets.scm \ $(NULL) if HAVE_GDBM gdbmtest_scm = gdbmtest.scm endif if HAVE_X11 xlib_scm = xlib.scm endif if HAVE_XAW xaw_scm = xaw.scm xwidgets_scm = xwidgets.scm endif if HAVE_MOTIF motif_scm = motif.scm xwidgets_scm = xwidgets.scm endif elk-3.99.8/scm/slib.scm.in0000644000175000017500000002057511577076306012171 00000000000000;;;"elk.init" Initialisation file for SLIB for ELK 2.1 -*- Scheme -*- ;;; Copyright (C) 1991, 1992, 1993 Aubrey Jaffer. ; ;Permission to copy this software, to redistribute it, and to use it ;for any purpose is granted, subject to the following restrictions and ;understandings. ; ;1. Any copy made of this software must include this copyright notice ;in full. ; ;2. I have made no warrantee or representation that the operation of ;this software will be error-free, and I am under no obligation to ;provide any services, by way of maintenance, update, or otherwise. ; ;3. In conjunction with products arising from the use of this ;material, there shall be no use of my name in any advertising, ;promotional, or sales literature without prior written consent in ;each case. ; No guarantees are given about the correctness of any of the ; choices made below. Only enough work was done to get the require ; mechanism to work correctly. ; ; Stephen J. Bevan 19920912 modified by Mike ; Sperber to work correctly with statically-linked Elk and slib1d. Be ; sure to change the library vicinities according to your local ; configuration. If you're running MS-DOS (which is possible since ; 2.1), you probably have to change this file to make everything work ; correctly. ;;; (software-type) should be set to the generic operating system type. ;;; UNIX, VMS, MACOS, AMIGA and MS-DOS are supported. (define (software-type) 'UNIX) ;;; (scheme-implementation-type) should return the name of the scheme ;;; implementation loading this file. (define (scheme-implementation-type) 'elk) ;;; (scheme-implementation-version) should return a string describing ;;; the version the scheme implementation loading this file. (define (scheme-implementation-version) "@VERSION@") ;;; (implementation-vicinity) should be defined to be the pathname of ;;; the directory where any auxillary files to your Scheme ;;; implementation reside. (define (implementation-vicinity) "@prefix@/share/elk") ;;; (library-vicinity) should be defined to be the pathname of the ;;; directory where files of Scheme library functions reside. ;(define library-vicinity ; (let ((library-path ; (or (getenv "SCHEME_LIBRARY_PATH") ; ;; Uses this path if SCHEME_LIBRARY_PATH is not defined. ; (case (software-type) ; ((UNIX) "/usr/local/lib/slib/") ; ((VMS) "lib$scheme:") ; ((MS-DOS) "C:\\SLIB\\") ; (else ""))))) ; (lambda () library-path))) (define (library-vicinity) "@prefix@/lib/slib/") ;;; *features* should be set to a list of symbols describing features ;;; of this implementation. Suggestions for features are: (define *features* '( ; source ;can load scheme source files ;(slib:load-source "filename") ; compiled ;can load compiled files ;(slib:load-compiled "filename") rev4-report ieee-p1178 sicp rev4-optional-procedures rev3-procedures rev2-procedures multiarg/and- multiarg-apply delay transcript full-continuation ; sort format system ; getenv <------- does elk 3.0 really have getenv? couldn't find it program-arguments string-port )) ;------------ (define program-arguments (lambda () (cons "undefined-program-name" (command-line-args)))) ; EXACT? appears to always return #f which isn't very useful. ; Approximating it with INTEGER? at least means that some ; of the code in the library will work correctly (define exact? integer?) ; WARNING: redefining EXACT? (define (inexact? arg) (not (exact? arg))) ;;; (TMPNAM) makes a temporary file name. (define tmpnam (let ((cntr 100)) (lambda () (set! cntr (+ 1 cntr)) (let ((tmp (string-append "slib_" (number->string cntr)))) (if (file-exists? tmp) (tmpnam) tmp))))) (require 'unix) ; Pull in GENTENV and SYSTEM ;;; (FILE-EXISTS? ) already here. ;;; (DELETE-FILE ) (define (delete-file f) (system (string-append "rm " f))) ;------------ ;;; (OUTPUT-PORT-WIDTH ) (define (output-port-width . arg) 79) ;;; (OUTPUT-PORT-HEIGHT ) (define (output-port-height . arg) 24) ;;; (CURRENT-ERROR-PORT) ;;; is already defined in Elk 2.1 ;;; FORCE-OUTPUT flushes any pending output on optional arg output port ;;; use this definition if your system doesn't have such a procedure. (define force-output flush-output-port) ;;; CALL-WITH-INPUT-STRING and CALL-WITH-OUTPUT-STRING are the string ;;; port versions of CALL-WITH-*PUT-FILE. (define (call-with-output-string f) (let ((outsp (open-output-string))) (f outsp) (let ((s (get-output-string outsp))) (close-output-port outsp) s))) (define (call-with-input-string s f) (let* ((insp (open-input-string s)) (res (f insp))) (close-input-port insp) res)) ;;; CHAR-CODE-LIMIT is one greater than the largest integer which can ;;; be returned by CHAR->INTEGER. (define char-code-limit 256) ;;; MOST-POSITIVE-FIXNUM is used in modular.scm (define most-positive-fixnum 8388608) ; 23 bit integers ? ;;; Return argument (define (identity x) x) ;;; If your implementation provides eval SLIB:EVAL is single argument ;;; eval using the top-level (user) environment. (define slib:eval eval) (define *macros* '()) (define (defmacro? m) (and (assq m *macros*) #t)) (define-macro (defmacro key pattern . body) `(begin (define-macro ,(cons key pattern) ,@body) (set! *macros* (cons (cons ',key (lambda ,pattern ,@body)) *macros*)))) (define (macroexpand-1 e) (if (pair? e) (let ((a (car e))) (cond ((symbol? a) (set! a (assq a *macros*)) (if a (apply (cdr a) (cdr e)) e)) (else e))) e)) (define (macroexpand e) (if (pair? e) (let ((a (car e))) (cond ((symbol? a) (set! a (assq a *macros*)) (if a (macroexpand (apply (cdr a) (cdr e))) e)) (else e))) e)) (define gentemp (let ((*gensym-counter* -1)) (lambda () (set! *gensym-counter* (+ *gensym-counter* 1)) (string->symbol (string-append "slib:G" (number->string *gensym-counter*)))))) (define defmacro:eval slib:eval) (define defmacro:load load) ;;; If your implementation provides R4RS macros: ;(define macro:eval slib:eval) ;(define macro:load load) (define (slib:eval-load evl) (if (not (file-exists? )) (set! (string-append (scheme-file-suffix)))) (call-with-input-file (lambda (port) (let ((old-load-pathname *load-pathname*)) (set! *load-pathname* ) (do ((o (read port) (read port))) ((eof-object? o)) (evl o)) (set! *load-pathname* old-load-pathname))))) ;;; define an error procedure for the library (define slib:error error) ;;; define these as appropriate for your system. (define slib:tab #\tab) (define slib:form-feed #\formfeed) ;;; Define these if your implementation's syntax can support it and if ;;; they are not already defined. ;(define (1+ n) (+ n 1)) ;(define (-1+ n) (+ n -1)) ;(define 1- -1+) (define in-vicinity string-append) ;;; Define SLIB:EXIT to be the implementation procedure to exit or ;;; return if exitting not supported. (define slib:exit (lambda args (exit (cond ((null? args) 0) ((eqv? #t (car args)) 0) ((and (number? (car args)) (integer? (car args))) (car args)) (else 1))))) ;;; Here for backward compatability (define scheme-file-suffix (let ((suffix (case (software-type) ((NOSVE) "_scm") (else ".scm")))) (lambda () suffix))) ;;; (SLIB:LOAD-SOURCE "foo") should load "foo.scm" or with whatever ;;; suffix all the module files in SLIB have. See feature 'SOURCE. ; Modify the already modified _load_ so that it copes with ; environments correctly. The change involves using ; _(global-environment)_ if none is explicitly specified. ; If this is not done, definitions in files loaded by other files will ; not be loaded in the correct environment. (define slib:load-source (let ((primitive-load load)) (lambda ( . rest) (let ((env (if (null? rest) (list (global-environment)) rest))) (apply primitive-load (string-append ".scm") env))))) ;;; (SLIB:LOAD-COMPILED "foo") should load the file that was produced ;;; by compiling "foo.scm" if this implementation can compile files. ;;; See feature 'COMPILED. (define slib:load-compiled (let ((primitive-load load)) (lambda ( . rest) (apply primitive-load (string->symbol (string-append name ".o")) rest)))) ;;; At this point SLIB:LOAD must be able to load SLIB files. (define slib:load slib:load-source) ;WARNING: redefining LOAD (slib:load (in-vicinity (library-vicinity) "require")) elk-3.99.8/configure0000755000175000017500000227564611577103433011261 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.68. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software # Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= ac_unique_file="src/main.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS HAVE_GROFF_FALSE HAVE_GROFF_TRUE ELK_LIBS ELK_LDFLAGS ELK_CFLAGS INCLUDES MOTIF_LIBS MOTIF_CFLAGS HAVE_MOTIF_FALSE HAVE_MOTIF_TRUE XAW_LIBS XAW_CFLAGS HAVE_XAW_FALSE HAVE_XAW_TRUE XT_LIBS XT_CFLAGS HAVE_XT_FALSE HAVE_XT_TRUE X_LIBS X_CFLAGS HAVE_X11_FALSE HAVE_X11_TRUE XMKMF HAVE_GDBM_FALSE HAVE_GDBM_TRUE HAVE_MONITOR_FALSE HAVE_MONITOR_TRUE HAVE_CXX_FALSE HAVE_CXX_TRUE ALLOCA HAVE_LIBELF_FALSE HAVE_LIBELF_TRUE STDINT_HEADER NATIVE_BUILD_FALSE NATIVE_BUILD_TRUE CXXCPP CPP OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED LIBTOOL OBJDUMP DLLTOOL AS am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE ac_ct_CXX CXXFLAGS CXX am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_os target_vendor target_cpu target host_os host_vendor host_cpu host build_os build_vendor build_cpu build target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_dependency_tracking enable_shared enable_static with_pic enable_fast_install with_gnu_ld with_sysroot enable_libtool_lock with_x ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CXX CXXFLAGS CCC CPP CXXCPP XMKMF' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names X features: --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] --target=TARGET configure for building compilers for TARGET [HOST] _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-x use the X Window System Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CXX C++ compiler command CXXFLAGS C++ compiler flags CPP C preprocessor CXXCPP C++ preprocessor XMKMF Path to xmkmf, Makefile generator for X Window System Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_cxx_try_cpp LINENO # ------------------------ # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_cpp # ac_fn_cxx_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_link # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= for ac_dir in .auto "$srcdir"/.auto; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in .auto \"$srcdir\"/.auto" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 $as_echo_n "checking target system type... " >&6; } if ${ac_cv_target+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$target_alias" = x; then ac_cv_target=$ac_cv_host else ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 $as_echo "$ac_cv_target" >&6; } case $ac_cv_target in *-*-*) ;; *) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; esac target=$ac_cv_target ac_save_IFS=$IFS; IFS='-' set x $ac_cv_target shift target_cpu=$1 target_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: target_os=$* IFS=$ac_save_IFS case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac # The aliases save the names the user supplied, while $host etc. # will get canonicalized. test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- am__api_version='1.11' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE=elk VERSION=3.99.8 cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' ac_config_headers="$ac_config_headers config.h" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi if test "x$CC" != xcc; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 $as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5 $as_echo_n "checking whether cc understands -c and -o together... " >&6; } fi set dummy $CC; ac_cc=`$as_echo "$2" | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* if { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -f conftest2.$ac_objext && { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then eval ac_cv_prog_cc_${ac_cc}_c_o=yes if test "x$CC" != xcc; then # Test first that cc exists at all. if { ac_try='cc -c conftest.$ac_ext >&5' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* if { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -f conftest2.$ac_objext && { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # cc works too. : else # cc exists but doesn't like -o. eval ac_cv_prog_cc_${ac_cc}_c_o=no fi fi fi else eval ac_cv_prog_cc_${ac_cc}_c_o=no fi rm -f core conftest* fi if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h fi # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o if test "$am_t" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CXX" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CXX_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AS"; then ac_cv_prog_AS="$AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AS="${ac_tool_prefix}as" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AS=$ac_cv_prog_AS if test -n "$AS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 $as_echo "$AS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_AS"; then ac_ct_AS=$AS # Extract the first word of "as", so it can be a program name with args. set dummy as; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AS"; then ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_AS="as" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AS=$ac_cv_prog_ac_ct_AS if test -n "$ac_ct_AS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 $as_echo "$ac_ct_AS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_AS" = x; then AS="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AS=$ac_ct_AS fi else AS="$ac_cv_prog_AS" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi ;; esac test -z "$AS" && AS=as test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$OBJDUMP" && OBJDUMP=objdump case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4' macro_revision='1.3293' ltmain="$ac_aux_dir/ltmain.sh" # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case "$ECHO" in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 $as_echo "$xsi_shell" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 $as_echo "$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test "$GCC" != yes; then reload_cmds=false fi ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 $as_echo "${with_sysroot}" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf # Set options enable_dlopen=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; pic_mode="$withval" else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' lt_prog_compiler_pic='-Xcompiler -fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ F* | *Sun*Fortran*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='${wl}--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld='-rpath $libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi link_all_deplibs=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld='+b $libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test x"$lt_cv_prog_compiler__b" = xyes; then archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test "$lt_cv_irix_exported_symbol" = yes; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([A-Za-z]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) version_type=linux need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test "$hardcode_action" = relink || test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report which library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if ${ac_cv_prog_CXXCPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 $as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu else _lt_caught_CXX_error=yes fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= compiler_needs_object_CXX=no export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_flag_spec_ld_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no inherit_rpath_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds reload_flag_CXX=$reload_flag reload_cmds_CXX=$reload_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC compiler_CXX=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes file_list_spec_CXX='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct_CXX=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec_CXX='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. always_export_symbols_CXX=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_CXX='-berok' # Determine the default libpath from the value encoded in an empty # executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' ${wl}-bernotok' allow_undefined_flag_CXX=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' fi archive_cmds_need_lc_CXX=yes # This is similar to how AIX traditionally builds its shared # libraries. archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_CXX=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_CXX=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_CXX=' ' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=yes file_list_spec_CXX='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' enable_shared_with_static_runtimes_CXX=yes # Don't use ranlib old_postinstall_cmds_CXX='chmod 644 $oldlib' postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' export_dynamic_flag_spec_CXX='${wl}--export-all-symbols' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_CXX=no fi ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec_CXX='' fi link_all_deplibs_CXX=yes allow_undefined_flag_CXX="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" if test "$lt_cv_apple_cc_single_mod" != "yes"; then archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi else ld_shlibs_CXX=no fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd[12]*) # C++ shared libraries reported to be fairly broken before # switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; gnu*) ;; haiku*) archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs_CXX=yes ;; hpux9*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: case $host_cpu in hppa*64*|ia64*) ;; *) export_dynamic_flag_spec_CXX='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; *) hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; interix[3-9]*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: inherit_rpath_CXX=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [1-5].* | *pgcpp\ [1-5].*) prelink_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' old_archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object_CXX=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) ld_shlibs_CXX=yes ;; openbsd2*) # C++ shared libraries are fairly broken ld_shlibs_CXX=no ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no hardcode_direct_absolute_CXX=yes archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' export_dynamic_flag_spec_CXX='${wl}-E' whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else ld_shlibs_CXX=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) case $host in osf3*) allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' ;; *) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' ;; esac hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_CXX='${wl}-z,text' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_CXX='${wl}-z,text' allow_undefined_flag_CXX='${wl}-z,nodefs' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-R,$libdir' hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes export_dynamic_flag_spec_CXX='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ '"$old_archive_cmds_CXX" reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ '"$reload_cmds_CXX" ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no GCC_CXX="$GXX" LD_CXX="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; esac if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX="${prev}${p}" else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX="${prev}${p}" else postdeps_CXX="${postdeps_CXX} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$predep_objects_CXX"; then predep_objects_CXX="$p" else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX="$p" else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken case $host_os in interix[3-9]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. predep_objects_CXX= postdep_objects_CXX= postdeps_CXX= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then postdeps_CXX='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then postdeps_CXX='-library=Cstd -library=Crun' fi ;; esac ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac compiler_lib_search_dirs_CXX= if test -n "${compiler_lib_search_path_CXX}"; then compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic_CXX='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static_CXX= ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix[4-9]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) # IBM XL 8.0, 9.0 on PPC and BlueGene lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-qpic' lt_prog_compiler_static_CXX='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_CXX=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works_CXX=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_CXX=yes fi else lt_cv_prog_compiler_static_works_CXX=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then : else lt_prog_compiler_static_CXX= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' case $host_os in aix[4-9]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' ;; esac ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs_CXX=no ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no with_gnu_ld_CXX=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX pic_flag=$lt_prog_compiler_pic_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc_CXX=no else lt_cv_archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 $as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) version_type=linux need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || test -n "$runpath_var_CXX" || test "X$hardcode_automatic_CXX" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct_CXX" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no && test "$hardcode_minus_L_CXX" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 $as_echo "$hardcode_action_CXX" >&6; } if test "$hardcode_action_CXX" = relink || test "$inherit_rpath_CXX" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_commands="$ac_config_commands libtool" # Only expand once: { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset cs; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } if ${ac_cv_c_inline+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_inline=$ac_kw fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 $as_echo "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi # Check whether we are doing a native build if test "${cross_compiling}" = "no"; then NATIVE_BUILD_TRUE= NATIVE_BUILD_FALSE='#' else NATIVE_BUILD_TRUE='#' NATIVE_BUILD_FALSE= fi for ac_header in inttypes.h do : ac_fn_c_check_header_mongrel "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default" if test "x$ac_cv_header_inttypes_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_INTTYPES_H 1 _ACEOF STDINT_HEADER="" else for ac_header in sys/inttypes.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/inttypes.h" "ac_cv_header_sys_inttypes_h" "$ac_includes_default" if test "x$ac_cv_header_sys_inttypes_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_INTTYPES_H 1 _ACEOF STDINT_HEADER="" else for ac_header in sys/_inttypes.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/_inttypes.h" "ac_cv_header_sys__inttypes_h" "$ac_includes_default" if test "x$ac_cv_header_sys__inttypes_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS__INTTYPES_H 1 _ACEOF STDINT_HEADER="" else for ac_header in stdint.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" if test "x$ac_cv_header_stdint_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDINT_H 1 _ACEOF STDINT_HEADER="" else as_fn_error $? "cannot find C99 integer headers" "$LINENO" 5 fi done fi done fi done fi done cat >>confdefs.h <<_ACEOF #define STDINT_HEADER ${STDINT_HEADER} _ACEOF # $system should contain the name of this file. It may be used by some # of the build scripts to do things that are specific to one single # type of system. cat >>confdefs.h <<_ACEOF #define SYSTEMTYPE "${target_os}" _ACEOF SYSTEM="${target_os}" MATH_LIBS="-lm" case "${target_os}" in *hpux*) $as_echo "#define ARRAY_BROKEN 1" >>confdefs.h ;; *mingw32*) ELK_CFLAGS="${ELK_CFLAGS} -DELK_BUILD_DLL" ELK_LDFLAGS="${ELK_LDFLAGS} -no-undefined" MATH_LIBS="" SYSTEM="mingw32" ;; *cygwin*) SYSTEM="cygwin" ;; *darwin*) $as_echo "#define SYS_DARWIN 1" >>confdefs.h ;; esac ELK_LIBS="${ELK_LIBS} ${MATH_LIBS}" # Various required headers for ac_header in pwd.h grp.h sys/resource.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # The UNIX extension likes to know which of the following system calls, # library functions, and include files are supported by the system. for ac_header in utime.h sys/utime.h sys/wait.h sys/times.h dirent.h netdb.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in waitpid wait3 wait4 vfork uname gethostname gettimeofday ftime do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in mktemp tmpnam tempnam getcwd getwd rename regcomp environ do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __environ in unistd.h" >&5 $as_echo_n "checking for __environ in unistd.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "__environ" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define __ENVIRON_IN_UNISTD_H 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f conftest* { $as_echo "$as_me:${as_lineno-$LINENO}: checking for environ in unistd.h" >&5 $as_echo_n "checking for environ in unistd.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "environ" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define ENVIRON_IN_UNISTD_H 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f conftest* # Does the system support the vprintf library function? If not, # availability of the (non-portable) _doprnt function is assumed. for ac_func in vprintf do : ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf" if test "x$ac_cv_func_vprintf" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_VPRINTF 1 _ACEOF fi done # Does the directory(3) library follow the POSIX conventions (i.e. # requires the include file and uses "struct dirent")? # If not, the (obsolete) BSD-style interface with and # "struct direct" is assumed. for ac_func in dirent do : ac_fn_c_check_func "$LINENO" "dirent" "ac_cv_func_dirent" if test "x$ac_cv_func_dirent" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DIRENT 1 _ACEOF fi done # Does the system have the random/srandom library functions? If not, # rand/srand will be used instead. for ac_func in random do : ac_fn_c_check_func "$LINENO" "random" "ac_cv_func_random" if test "x$ac_cv_func_random" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_RANDOM 1 _ACEOF fi done # Does the system have the index library function? If not, strchr # will be used. for ac_func in index do : ac_fn_c_check_func "$LINENO" "index" "ac_cv_func_index" if test "x$ac_cv_func_index" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_INDEX 1 _ACEOF fi done # Does the system have the bcopy, bzero, and bcmp library functions? # If not, memcpy/memset/memcmp will be used. # Does using the access system call require to be included? # (Look into the manual page for access if in doubt.) for ac_header in unistd.h do : ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" if test "x$ac_cv_header_unistd_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_UNISTD_H 1 _ACEOF fi done # If the FIONREAD ioctl command is defined, which file must be included? for ac_header in termios.h sys/ioctl.h sys/filio.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # If getdtablesize() is available to determine the maximum number of open # files per process, set getdtablesize=yes. # Alternatively, if POSIX-style sysconf() can be called with _SC_OPEN_MAX, # set sysconf_open_max=yes. # If neither is set to "yes", an educated guess will be made. for ac_func in getdtablesize do : ac_fn_c_check_func "$LINENO" "getdtablesize" "ac_cv_func_getdtablesize" if test "x$ac_cv_func_getdtablesize" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GETDTABLESIZE 1 _ACEOF fi done # If POSIX-style pathconf() can be invoked with _PC_PATH_MAX to determine # the maximum pathname length, set pathconf_path_max=yes. # If the system page size can be determined by calling getpagesize() # set getpagesize=yes. # Alternatively, if sysconf() can be invoked with _SC_PAGESIZE, set # sysconf_pagesize=yes. # These two variables are only required if the generational garbage # collector is used. for ac_func in getpagesize do : ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize" if test "x$ac_cv_func_getpagesize" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GETPAGESIZE 1 _ACEOF fi done # Set reliable_signals=bsd if your system supports BSD-style reliable # signals (has sigblock and related functions); set reliable_signals=posix # for POSIX-style signals (sigprocmask, sigsets); otherwise old V7/SysV # signal semantics are assumed. for ac_header in signal.h do : ac_fn_c_check_header_mongrel "$LINENO" "signal.h" "ac_cv_header_signal_h" "$ac_includes_default" if test "x$ac_cv_header_signal_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SIGNAL_H 1 _ACEOF fi done for ac_func in sigprocmask sigblock do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done # To support dynamic loading of object files and "dump", the system's # a.out format has to be known. Choose one of the following: # # coff ecoff xcoff elf macho hp9k convex # # Other values of "aout_format" are interpreted as BSD-style a.out format. if false; then $as_echo "#define COFF 1" >>confdefs.h fi if false; then $as_echo "#define ECOFF 1" >>confdefs.h fi if false; then $as_echo "#define XCOFF 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for elf_begin in -lelf" >&5 $as_echo_n "checking for elf_begin in -lelf... " >&6; } if ${ac_cv_lib_elf_elf_begin+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lelf $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char elf_begin (); int main () { return elf_begin (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_elf_elf_begin=yes else ac_cv_lib_elf_elf_begin=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_elf_elf_begin" >&5 $as_echo "$ac_cv_lib_elf_elf_begin" >&6; } if test "x$ac_cv_lib_elf_elf_begin" = xyes; then : ac_cv_my_have_elf=yes else ac_cv_my_have_elf=no fi if test "${ac_cv_my_have_elf}" = "yes"; then HAVE_LIBELF_TRUE= HAVE_LIBELF_FALSE='#' else HAVE_LIBELF_TRUE='#' HAVE_LIBELF_FALSE= fi if false; then $as_echo "#define MACH_O 1" >>confdefs.h fi if false; then $as_echo "#define CONVEX_AOUT 1" >>confdefs.h fi if false; then $as_echo "#define HP9K 1" >>confdefs.h fi if test "${ac_cv_my_have_elf}" = "yes"; then $as_echo "#define HAVE_LIBELF 1" >>confdefs.h ELK_LIBS="${ELK_LIBS} -lelf" ac_cv_my_can_dump=yes else ac_cv_my_can_dump=no fi # Which mechanism should be used to dynamically load object files? ac_cv_my_can_load_lib=no # OS X style for ac_header in mach-o/dyld.h do : ac_fn_c_check_header_mongrel "$LINENO" "mach-o/dyld.h" "ac_cv_header_mach_o_dyld_h" "$ac_includes_default" if test "x$ac_cv_header_mach_o_dyld_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_MACH_O_DYLD_H 1 _ACEOF for ac_func in NSLinkModule do : ac_fn_c_check_func "$LINENO" "NSLinkModule" "ac_cv_func_NSLinkModule" if test "x$ac_cv_func_NSLinkModule" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_NSLINKMODULE 1 _ACEOF $as_echo "#define HAVE_DL_DYLD 1" >>confdefs.h $as_echo "#define SYMS_BEGIN_WITH '_'" >>confdefs.h ac_cv_my_can_load_lib=yes fi done fi done # HP-UX style if test "${ac_cv_my_can_load_lib}" = "no"; then for ac_header in dl.h do : ac_fn_c_check_header_mongrel "$LINENO" "dl.h" "ac_cv_header_dl_h" "$ac_includes_default" if test "x$ac_cv_header_dl_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DL_H 1 _ACEOF fi done ac_cv_my_have_shl_load=no ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : ac_cv_my_have_shl_load=yes, { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : ac_cv_my_have_shl_load=yes ELK_LIBS="${ELK_LIBS} -ldld" fi fi if test "${ac_cv_my_have_shl_load}" = "yes"; then $as_echo "#define HAVE_DL_SHL_LOAD 1" >>confdefs.h ac_cv_my_can_load_lib=yes fi fi # Whatever style if test "${ac_cv_my_can_load_lib}" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : ELK_LIBS="${ELK_LIBS} -ldld" $as_echo "#define HAVE_DL_DLD_LINK 1" >>confdefs.h ac_cv_my_can_load_lib=yes fi fi # BeOS style if test "${ac_cv_my_can_load_lib}" = "no"; then for ac_header in image.h do : ac_fn_c_check_header_mongrel "$LINENO" "image.h" "ac_cv_header_image_h" "$ac_includes_default" if test "x$ac_cv_header_image_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_IMAGE_H 1 _ACEOF fi done for ac_func in load_add_on do : ac_fn_c_check_func "$LINENO" "load_add_on" "ac_cv_func_load_add_on" if test "x$ac_cv_func_load_add_on" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LOAD_ADD_ON 1 _ACEOF $as_echo "#define HAVE_DL_BEOS 1" >>confdefs.h ac_cv_my_can_load_lib=yes fi done fi # Win32 style if test "${ac_cv_my_can_load_lib}" = "no"; then if test "${SYSTEM}" = "mingw32" -o "${SYSTEM}" = "cygwin"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lkernel32" >&5 $as_echo_n "checking for main in -lkernel32... " >&6; } if ${ac_cv_lib_kernel32_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lkernel32 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_kernel32_main=yes else ac_cv_lib_kernel32_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_kernel32_main" >&5 $as_echo "$ac_cv_lib_kernel32_main" >&6; } if test "x$ac_cv_lib_kernel32_main" = xyes; then : ELK_LIBS="${ELK_LIBS} -lkernel32" $as_echo "#define HAVE_DL_WINDOWS 1" >>confdefs.h ac_cv_my_can_load_lib=yes fi fi fi for ac_header in a.out.h do : ac_fn_c_check_header_mongrel "$LINENO" "a.out.h" "ac_cv_header_a_out_h" "$ac_includes_default" if test "x$ac_cv_header_a_out_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_A_OUT_H 1 _ACEOF fi done # Only test for dlopen() if the others didn't work if test "${ac_cv_my_can_load_lib}" = "no"; then for ac_header in dlfcn.h sys/dl.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_cv_my_have_dlopen=no ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : ac_cv_my_have_dlopen=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : ac_cv_my_have_dlopen=yes ELK_LIBS="${ELK_LIBS} -ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : ac_cv_my_have_dlopen=yes ELK_LIBS="${ELK_LIBS} -lsvld" fi fi fi if test "${ac_cv_my_have_dlopen}" = "yes"; then $as_echo "#define HAVE_DL_DLOPEN 1" >>confdefs.h ac_cv_my_can_load_lib=yes fi fi if test "${ac_cv_my_can_load_lib}" = "yes"; then $as_echo "#define CAN_LOAD_LIB 1" >>confdefs.h fi # Systems with "aout_format=ecoff" may require a call to the cacheflush # system call after an object file has been loaded. Which include file # has to be included in this case? $as_echo "#define CACHECTL_H " >>confdefs.h # Is the ANSI-C atexit function supported to register an exit handler? # If not, the exit library function will be redefined and will end in # a call to _exit. for ac_func in atexit do : ac_fn_c_check_func "$LINENO" "atexit" "ac_cv_func_atexit" if test "x$ac_cv_func_atexit" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ATEXIT 1 _ACEOF fi done # The symbol prefixes of extension initialization and finalization # functions (without the initial $syms_begin_with). Do not change # these unless the compiler or linker restricts the length of symbols! $as_echo "#define INIT_PREFIX \"elk_init_\"" >>confdefs.h $as_echo "#define FINIT_PREFIX \"elk_finit_\"" >>confdefs.h # Is the "dump" function supported? if test "${ac_cv_my_can_dump}" = "yes"; then $as_echo "#define CAN_DUMP 1" >>confdefs.h fi # Is the fchmod system call broken or unavailable? if false; then $as_echo "#define FCHMOD_BROKEN 1" >>confdefs.h fi # These four variables are only relevant if the system has the BSD-style # a.out format. # segment_size is the segment size of the system's memory management # unit, i.e. the number to a multiple of which the size of an a.out # segment (e.g. .text) is rounded up. # file_text_start is the file offset at which the text segment starts # in an a.out file. # mem_text_start is the starting address of the text segment in memory. # text_length_adj must be set to "sizeof (struct exec)" if the length of # the text segment stored in the a.out header includes the a.out header # itself. $as_echo "#define SEG_SIZ 1024" >>confdefs.h $as_echo "#define FILE_TEXT_START N_TXTOFF(hdr)" >>confdefs.h $as_echo "#define MEM_TEXT_START 0" >>confdefs.h $as_echo "#define TEXT_LENGTH_ADJ 0" >>confdefs.h # Only relevant if "aout_format=coff": the system's pagesize. $as_echo "#define COFF_PAGESIZE 4096" >>confdefs.h # Only relevant if "aout_format=hp9k" and "load_obj=shl" $as_echo "#define HPSHLIB 1" >>confdefs.h # Print debug messages when dumping $as_echo "#define DEBUG_DUMP 1" >>confdefs.h # Is the "termio" terminal interface supported by the system? If not, # BSD-style tty handling will be used. $as_echo "#define TERMIO 1" >>confdefs.h # flush_stdio and flush_tty indicate how clear-input/output-port can # flush (purge) a FILE pointer and a TTY file descriptor. # Possible values of flush_stdio: # bsd assume old BSD-style FILE* (with _cnt, _ptr, _base) # fpurge use 4.4BSD-style fpurge stdio library function # Possible values of flush_tty: # tiocflush use TIOCFLUSH ioctl from # tcflsh use TCFLSH ioctl from # Leave the variable(s) empty if flushing is not supported. for ac_func in fpurge do : ac_fn_c_check_func "$LINENO" "fpurge" "ac_cv_func_fpurge" if test "x$ac_cv_func_fpurge" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_FPURGE 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD-style flushing" >&5 $as_echo_n "checking for BSD-style flushing... " >&6; } if ${ac_cv_have_bsd_flush+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f; f->_cnt = 0; f->_ptr = f->_base; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_have_bsd_flush=yes else ac_cv_have_bsd_flush=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_bsd_flush" >&5 $as_echo "$ac_cv_have_bsd_flush" >&6; } if test "${ac_cv_have_bsd_flush}" = "yes"; then $as_echo "#define HAVE_BSD_FLUSH 1" >>confdefs.h fi for ac_header in termio.h termios.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # The interpreter uses the getrlimit function to determine the maximum # stack size of the running program. If this function is not supported, # set max_stack_size to a (fixed) maximum stack size (in bytes). for ac_func in getrlimit do : ac_fn_c_check_func "$LINENO" "getrlimit" "ac_cv_func_getrlimit" if test "x$ac_cv_func_getrlimit" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GETRLIMIT 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct rlimit" >&5 $as_echo_n "checking for struct rlimit... " >&6; } if ${ac_cv_have_struct_rlimit+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_SYS_TIME_H # include #endif #ifdef HAVE_SYS_RESOURCE_H # include #endif #ifdef HAVE_UNISTD_H # include #endif int main () { struct rlimit rl; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_have_struct_rlimit=yes else ac_cv_have_struct_rlimit=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_struct_rlimit" >&5 $as_echo "$ac_cv_have_struct_rlimit" >&6; } if test "${ac_cv_have_struct_rlimit}" = "yes"; then $as_echo "#define HAVE_STRUCT_RLIMIT 1" >>confdefs.h fi $as_echo "#define DEFAULT_MAX_STACK_SIZE 1024*1024" >>confdefs.h # Is the mprotect system call supported? The generational garbage collector # requires mprotect to implement incremental GC. $mprotect is ignored if # generational_gc is set to "no" in the site file. Set mprotect=mmap if # mprotect is supported, but only for mmap()ed memory. for ac_func in mprotect do : ac_fn_c_check_func "$LINENO" "mprotect" "ac_cv_func_mprotect" if test "x$ac_cv_func_mprotect" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_MPROTECT 1 _ACEOF fi done if false; then $as_echo "#define MPROTECT_SIG 1" >>confdefs.h fi if false; then $as_echo "#define MPROTECT_MMAP 1" >>confdefs.h fi # How can a SIGSEGV or SIGBUS signal handler find out the address of # the faulting memory reference? This variable is only used if # $mprotect is "yes" or "mmap". Possible values are: # # siginfo handler is called with siginfo_t structure (enabled # by a call to sigaction) # sigcontext address is in the sigcontext structure (3rd arg, sc_badvaddr) # arg4 address is delivered to handler as argument #4 # aix use an AIX-specific hack to get hold of the bad address # hpux use a HP-UX-specific hack if false; then $as_echo "#define SIGSEGV_SIGINFO 1" >>confdefs.h fi if false; then $as_echo "#define SIGSEGV_SIGCONTEXT 1" >>confdefs.h fi if false; then $as_echo "#define SIGSEGV_ARG4 1" >>confdefs.h fi if false; then $as_echo "#define SIGSEGV_AIX 1" >>confdefs.h fi if false; then $as_echo "#define SIGSEGV_HPUX 1" >>confdefs.h fi # Does the system support the alloca library function, and does this # function actually extend the stack? If in doubt, extract alloca.o # from the C library and check if it contains the symbols malloc and free. # If this is the case, forget it. # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 $as_echo_n "checking for working alloca.h... " >&6; } if ${ac_cv_working_alloca_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { char *p = (char *) alloca (2 * sizeof (int)); if (p) return 0; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_working_alloca_h=yes else ac_cv_working_alloca_h=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 $as_echo "$ac_cv_working_alloca_h" >&6; } if test $ac_cv_working_alloca_h = yes; then $as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 $as_echo_n "checking for alloca... " >&6; } if ${ac_cv_func_alloca_works+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __GNUC__ # define alloca __builtin_alloca #else # ifdef _MSC_VER # include # define alloca _alloca # else # ifdef HAVE_ALLOCA_H # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ void *alloca (size_t); # endif # endif # endif # endif #endif int main () { char *p = (char *) alloca (1); if (p) return 0; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_func_alloca_works=yes else ac_cv_func_alloca_works=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 $as_echo "$ac_cv_func_alloca_works" >&6; } if test $ac_cv_func_alloca_works = yes; then $as_echo "#define HAVE_ALLOCA 1" >>confdefs.h else # The SVR3 libPW and SVR4 libucb both contain incompatible functions # that cause trouble. Some versions do not even contain alloca or # contain a buggy version. If you still want to use their alloca, # use ar to extract alloca.o from them instead of compiling alloca.c. ALLOCA=\${LIBOBJDIR}alloca.$ac_objext $as_echo "#define C_ALLOCA 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5 $as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } if ${ac_cv_os_cray+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined CRAY && ! defined CRAY2 webecray #else wenotbecray #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "webecray" >/dev/null 2>&1; then : ac_cv_os_cray=yes else ac_cv_os_cray=no fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5 $as_echo "$ac_cv_os_cray" >&6; } if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define CRAY_STACKSEG_END $ac_func _ACEOF break fi done fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 $as_echo_n "checking stack direction for C alloca... " >&6; } if ${ac_cv_c_stack_direction+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_c_stack_direction=0 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int find_stack_direction () { static char *addr = 0; auto char dummy; if (addr == 0) { addr = &dummy; return find_stack_direction (); } else return (&dummy > addr) ? 1 : -1; } int main () { return find_stack_direction () < 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_c_stack_direction=1 else ac_cv_c_stack_direction=-1 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 $as_echo "$ac_cv_c_stack_direction" >&6; } cat >>confdefs.h <<_ACEOF #define STACK_DIRECTION $ac_cv_c_stack_direction _ACEOF fi # Must be included to use alloca? Is "#pragma alloca" required? for ac_header in alloca.h do : ac_fn_c_check_header_mongrel "$LINENO" "alloca.h" "ac_cv_header_alloca_h" "$ac_includes_default" if test "x$ac_cv_header_alloca_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ALLOCA_H 1 _ACEOF fi done if false; then $as_echo "#define PRAGMA_ALLOCA 1" >>confdefs.h fi # Does the system (or compiler) require certain objects (e.g. doubles) # to be aligned at 8-byte boundaries? If not, 4-byte alignment will # be assumed. if false; then $as_echo "#define ALIGN_8BYTE 1" >>confdefs.h fi # The name of the linker. This is usually just "ld", or /usr/ccs/bin/ld # in SVR4-based systems. $as_echo "#define LD_NAME \"ld\"" >>confdefs.h # Does your C preprocessor support the ANSI-C ## operator, although # __STDC__ is not defined? $as_echo "#define ANSI_CPP 1" >>confdefs.h # Element type of the gidset argument of getgroups(); typically int # or gid_t. Only needed by the UNIX extension. $as_echo "#define GETGROUPS_TYPE gid_t" >>confdefs.h # Do you want to use the generational garbage collector? If not, the # stop-and-copy garbage collector will be used. $as_echo "#define GENERATIONAL_GC 1" >>confdefs.h # The default heap size of the Scheme interpreter in KBytes (if the # stop-and-copy garbage collector is used). $as_echo "#define HEAP_SIZE 1024" >>confdefs.h # The directory where all files are installed by running "make install". We # cannot use AC_DEFINE_UNQUOTED here because ${prefix} is not set until the # end of the configure script. Thanks to Phillip Rulon for spotting that. CPPFLAGS="${CPPFLAGS} -DSCM_DIR=\"\\\"\$(prefix)/share/elk\\\"\"" CPPFLAGS="${CPPFLAGS} -DLIB_DIR=\"\\\"\$(prefix)/lib/elk\\\"\"" #define FIND_AOUT defined(USE_LD) || defined(CAN_DUMP) || defined(INIT_OBJECTS) $as_echo "#define FIND_AOUT 1" >>confdefs.h CFLAGS_save="${CFLAGS}" LDFLAGS_save="${LDFLAGS}" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if \$CXX really works" >&5 $as_echo_n "checking if \$CXX really works... " >&6; } if ${ac_cv_my_have_cxx+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_my_have_cxx=yes else ac_cv_my_have_cxx=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_my_have_cxx" >&5 $as_echo "$ac_cv_my_have_cxx" >&6; } if test "${ac_cv_my_have_cxx}" = "yes"; then HAVE_CXX_TRUE= HAVE_CXX_FALSE='#' else HAVE_CXX_TRUE='#' HAVE_CXX_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if \$CC accepts -Wall" >&5 $as_echo_n "checking if \$CC accepts -Wall... " >&6; } if ${ac_cv_c_Wall+:} false; then : $as_echo_n "(cached) " >&6 else CFLAGS="-Wall ${CFLAGS_save}" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_Wall=yes else ac_cv_c_Wall=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_Wall" >&5 $as_echo "$ac_cv_c_Wall" >&6; } if test "x${ac_cv_c_Wall}" != "xno"; then CFLAGS_save="-Wall ${CFLAGS_save}" fi # Code qui fait des warnings == code de porc == deux baffes dans ta gueule CFLAGS_warn="-Wpointer-arith -Wcast-align -Wcast-qual -Wshadow -Wmissing-prototypes -Wnested-externs -Wsign-compare" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if \$CC accepts ${CFLAGS_warn}" >&5 $as_echo_n "checking if \$CC accepts ${CFLAGS_warn}... " >&6; } if ${ac_cv_c_Wwarn+:} false; then : $as_echo_n "(cached) " >&6 else CFLAGS="${CFLAGS_warn} ${CFLAGS_save}" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_Wwarn=yes else ac_cv_c_Wwarn=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_Wwarn" >&5 $as_echo "$ac_cv_c_Wwarn" >&6; } if test "x${ac_cv_c_Wwarn}" != "xno"; then CFLAGS_save="${CFLAGS_warn} ${CFLAGS_save}" fi CFLAGS="${CFLAGS_save}" LDFLAGS="${LDFLAGS_save}" if false; then HAVE_MONITOR_TRUE= HAVE_MONITOR_FALSE='#' else HAVE_MONITOR_TRUE='#' HAVE_MONITOR_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gdbm_open in -lgdbm" >&5 $as_echo_n "checking for gdbm_open in -lgdbm... " >&6; } if ${ac_cv_lib_gdbm_gdbm_open+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgdbm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gdbm_open (); int main () { return gdbm_open (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_gdbm_gdbm_open=yes else ac_cv_lib_gdbm_gdbm_open=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gdbm_gdbm_open" >&5 $as_echo "$ac_cv_lib_gdbm_gdbm_open" >&6; } if test "x$ac_cv_lib_gdbm_gdbm_open" = xyes; then : ac_cv_my_have_gdbm=yes else ac_cv_my_have_gdbm=no fi if test "${ac_cv_my_have_gdbm}" = "yes"; then HAVE_GDBM_TRUE= HAVE_GDBM_FALSE='#' else HAVE_GDBM_TRUE='#' HAVE_GDBM_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5 $as_echo_n "checking for X... " >&6; } # Check whether --with-x was given. if test "${with_x+set}" = set; then : withval=$with_x; fi # $have_x is `yes', `no', `disabled', or empty when we do not yet know. if test "x$with_x" = xno; then # The user explicitly disabled X. have_x=disabled else case $x_includes,$x_libraries in #( *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #( *,NONE | NONE,*) if ${ac_cv_have_x+:} false; then : $as_echo_n "(cached) " >&6 else # One or both of the vars are not set, and there is no cached value. ac_x_includes=no ac_x_libraries=no rm -f -r conftest.dir if mkdir conftest.dir; then cd conftest.dir cat >Imakefile <<'_ACEOF' incroot: @echo incroot='${INCROOT}' usrlibdir: @echo usrlibdir='${USRLIBDIR}' libdir: @echo libdir='${LIBDIR}' _ACEOF if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. for ac_var in incroot usrlibdir libdir; do eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" done # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. for ac_extension in a so sl dylib la dll; do if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && test -f "$ac_im_libdir/libX11.$ac_extension"; then ac_im_usrlibdir=$ac_im_libdir; break fi done # Screen out bogus values from the imake configuration. They are # bogus both because they are the default anyway, and because # using them would break gcc on systems where it needs fixed includes. case $ac_im_incroot in /usr/include) ac_x_includes= ;; *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; esac case $ac_im_usrlibdir in /usr/lib | /usr/lib64 | /lib | /lib64) ;; *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; esac fi cd .. rm -f -r conftest.dir fi # Standard set of common directories for X headers. # Check X11 before X11Rn because it is often a symlink to the current release. ac_x_header_dirs=' /usr/X11/include /usr/X11R7/include /usr/X11R6/include /usr/X11R5/include /usr/X11R4/include /usr/include/X11 /usr/include/X11R7 /usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 /usr/local/X11/include /usr/local/X11R7/include /usr/local/X11R6/include /usr/local/X11R5/include /usr/local/X11R4/include /usr/local/include/X11 /usr/local/include/X11R7 /usr/local/include/X11R6 /usr/local/include/X11R5 /usr/local/include/X11R4 /usr/X386/include /usr/x386/include /usr/XFree86/include/X11 /usr/include /usr/local/include /usr/unsupported/include /usr/athena/include /usr/local/x11r5/include /usr/lpp/Xamples/include /usr/openwin/include /usr/openwin/share/include' if test "$ac_x_includes" = no; then # Guess where to find include files, by looking for Xlib.h. # First, try using that file with no special directory specified. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # We can compile using X headers with no special include directory. ac_x_includes= else for ac_dir in $ac_x_header_dirs; do if test -r "$ac_dir/X11/Xlib.h"; then ac_x_includes=$ac_dir break fi done fi rm -f conftest.err conftest.i conftest.$ac_ext fi # $ac_x_includes = no if test "$ac_x_libraries" = no; then # Check for the libraries. # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS=$LIBS LIBS="-lX11 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { XrmInitialize () ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= else LIBS=$ac_save_LIBS for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! for ac_extension in a so sl dylib la dll; do if test -r "$ac_dir/libX11.$ac_extension"; then ac_x_libraries=$ac_dir break 2 fi done done fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi # $ac_x_libraries = no case $ac_x_includes,$ac_x_libraries in #( no,* | *,no | *\'*) # Didn't find X, or a directory has "'" in its name. ac_cv_have_x="have_x=no";; #( *) # Record where we found X for the cache. ac_cv_have_x="have_x=yes\ ac_x_includes='$ac_x_includes'\ ac_x_libraries='$ac_x_libraries'" esac fi ;; #( *) have_x=yes;; esac eval "$ac_cv_have_x" fi # $with_x != no if test "$have_x" != yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5 $as_echo "$have_x" >&6; } no_x=yes else # If each of the values was on the command line, it overrides each guess. test "x$x_includes" = xNONE && x_includes=$ac_x_includes test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries # Update the cache value to reflect the command line values. ac_cv_have_x="have_x=yes\ ac_x_includes='$x_includes'\ ac_x_libraries='$x_libraries'" { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5 $as_echo "libraries $x_libraries, headers $x_includes" >&6; } fi if test -n "${x_includes}"; then x_cflags="-I${x_includes}"; fi if test -n "${x_libraries}"; then x_libs="-I${x_libraries}"; fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XOpenDisplay in -lX11" >&5 $as_echo_n "checking for XOpenDisplay in -lX11... " >&6; } if ${ac_cv_lib_X11_XOpenDisplay+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lX11 ${x_libs} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XOpenDisplay (); int main () { return XOpenDisplay (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_X11_XOpenDisplay=yes else ac_cv_lib_X11_XOpenDisplay=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_X11_XOpenDisplay" >&5 $as_echo "$ac_cv_lib_X11_XOpenDisplay" >&6; } if test "x$ac_cv_lib_X11_XOpenDisplay" = xyes; then : ac_cv_my_have_x11=yes X_CFLAGS="${x_cflags}" X_LIBS="${x_libs} -lX11" else ac_cv_my_have_x11=no fi if test "${ac_cv_my_have_x11}" = "yes"; then HAVE_X11_TRUE= HAVE_X11_FALSE='#' else HAVE_X11_TRUE='#' HAVE_X11_FALSE= fi if test "${cross_compiling}" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XtFree in -lXt" >&5 $as_echo_n "checking for XtFree in -lXt... " >&6; } if ${ac_cv_lib_Xt_XtFree+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXt -lSM -lICE -lXext -lX11 ${x_libs} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XtFree (); int main () { return XtFree (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xt_XtFree=yes else ac_cv_lib_Xt_XtFree=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xt_XtFree" >&5 $as_echo "$ac_cv_lib_Xt_XtFree" >&6; } if test "x$ac_cv_lib_Xt_XtFree" = xyes; then : ac_cv_my_have_xt=yes { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XmuDrawLogo in -lXmu" >&5 $as_echo_n "checking for XmuDrawLogo in -lXmu... " >&6; } if ${ac_cv_lib_Xmu_XmuDrawLogo+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXmu -lXt -lSM -lICE -lXext -lX11 ${x_libs} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XmuDrawLogo (); int main () { return XmuDrawLogo (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xmu_XmuDrawLogo=yes else ac_cv_lib_Xmu_XmuDrawLogo=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xmu_XmuDrawLogo" >&5 $as_echo "$ac_cv_lib_Xmu_XmuDrawLogo" >&6; } if test "x$ac_cv_lib_Xmu_XmuDrawLogo" = xyes; then : XT_CFLAGS="${x_cflags}" XT_LIBS="${x_libs} -lXmu -lXt -lSM -lICE -lXext -lX11" else XT_CFLAGS="${x_cflags}" XT_LIBS="${x_libs} -lXt -lSM -lICE -lXext -lX11" fi else ac_cv_my_have_xt=no fi else ac_cv_my_have_xt=no fi if test "${ac_cv_my_have_xt}" = "yes"; then HAVE_XT_TRUE= HAVE_XT_FALSE='#' else HAVE_XT_TRUE='#' HAVE_XT_FALSE= fi if test "${cross_compiling}" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XawTextSearch in -lXaw" >&5 $as_echo_n "checking for XawTextSearch in -lXaw... " >&6; } if ${ac_cv_lib_Xaw_XawTextSearch+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXaw ${XT_LIBS} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XawTextSearch (); int main () { return XawTextSearch (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xaw_XawTextSearch=yes else ac_cv_lib_Xaw_XawTextSearch=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xaw_XawTextSearch" >&5 $as_echo "$ac_cv_lib_Xaw_XawTextSearch" >&6; } if test "x$ac_cv_lib_Xaw_XawTextSearch" = xyes; then : ac_cv_my_have_xaw=yes XAW_CFLAGS="${x_cflags}" XAW_LIBS="${x_libs} -lXaw ${XT_LIBS}" else ac_cv_my_have_xaw=no fi else ac_cv_my_have_xaw="no (cross-compiling)" fi if test "${ac_cv_my_have_xaw}" = "yes"; then HAVE_XAW_TRUE= HAVE_XAW_FALSE='#' else HAVE_XAW_TRUE='#' HAVE_XAW_FALSE= fi if test "${cross_compiling}" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XmStringConcat in -lXm" >&5 $as_echo_n "checking for XmStringConcat in -lXm... " >&6; } if ${ac_cv_lib_Xm_XmStringConcat+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXm ${XT_LIBS} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XmStringConcat (); int main () { return XmStringConcat (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xm_XmStringConcat=yes else ac_cv_lib_Xm_XmStringConcat=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xm_XmStringConcat" >&5 $as_echo "$ac_cv_lib_Xm_XmStringConcat" >&6; } if test "x$ac_cv_lib_Xm_XmStringConcat" = xyes; then : ac_cv_my_have_motif=yes MOTIF_CFLAGS="${x_cflags} -I/usr/include/Xm" MOTIF_LIBS="${x_libs} -lXm ${XT_LIBS}" else ac_cv_my_have_motif=no fi else ac_cv_my_have_motif="no (cross-compiling)" fi if test "${ac_cv_my_have_motif}" = "yes"; then HAVE_MOTIF_TRUE= HAVE_MOTIF_FALSE='#' else HAVE_MOTIF_TRUE='#' HAVE_MOTIF_FALSE= fi INCLUDES="${INCLUDES} -I\$(top_srcdir)/include -I\$(top_builddir)/include" for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for groff -ms" >&5 $as_echo_n "checking for groff -ms... " >&6; } if echo foo | groff -ms >/dev/null 2>&1; then ac_cv_my_have_groff=yes else ac_cv_my_have_groff=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ac_cv_my_have_groff}" >&5 $as_echo "${ac_cv_my_have_groff}" >&6; } if test "${ac_cv_my_have_groff}" = "yes"; then HAVE_GROFF_TRUE= HAVE_GROFF_FALSE='#' else HAVE_GROFF_TRUE='#' HAVE_GROFF_FALSE= fi ac_config_files="$ac_config_files Makefile doc/Makefile doc/bitstring/Makefile doc/cprog/Makefile doc/kernel/Makefile doc/man/Makefile doc/oops/Makefile doc/record/Makefile doc/regexp/Makefile doc/unix/Makefile doc/usenix/Makefile doc/util/Makefile doc/xlib/Makefile doc/xt/Makefile examples/Makefile include/Makefile lib/Makefile lib/misc/Makefile lib/unix/Makefile lib/xlib/Makefile lib/xwidgets/Makefile lib/xwidgets/xaw/Makefile lib/xwidgets/motif/Makefile scm/Makefile src/Makefile test/Makefile" ac_config_files="$ac_config_files scm/slib.scm include/site.h" ac_config_files="$ac_config_files test/check-gc" ac_config_files="$ac_config_files test/check-gc2" ac_config_files="$ac_config_files test/check-r4rs" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${NATIVE_BUILD_TRUE}" && test -z "${NATIVE_BUILD_FALSE}"; then as_fn_error $? "conditional \"NATIVE_BUILD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_LIBELF_TRUE}" && test -z "${HAVE_LIBELF_FALSE}"; then as_fn_error $? "conditional \"HAVE_LIBELF\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_CXX_TRUE}" && test -z "${HAVE_CXX_FALSE}"; then as_fn_error $? "conditional \"HAVE_CXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_MONITOR_TRUE}" && test -z "${HAVE_MONITOR_FALSE}"; then as_fn_error $? "conditional \"HAVE_MONITOR\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_GDBM_TRUE}" && test -z "${HAVE_GDBM_FALSE}"; then as_fn_error $? "conditional \"HAVE_GDBM\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_X11_TRUE}" && test -z "${HAVE_X11_FALSE}"; then as_fn_error $? "conditional \"HAVE_X11\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_XT_TRUE}" && test -z "${HAVE_XT_FALSE}"; then as_fn_error $? "conditional \"HAVE_XT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_XAW_TRUE}" && test -z "${HAVE_XAW_FALSE}"; then as_fn_error $? "conditional \"HAVE_XAW\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_MOTIF_TRUE}" && test -z "${HAVE_MOTIF_FALSE}"; then as_fn_error $? "conditional \"HAVE_MOTIF\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_GROFF_TRUE}" && test -z "${HAVE_GROFF_FALSE}"; then as_fn_error $? "conditional \"HAVE_GROFF\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" Copyright (C) 2010 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_ld_CXX='`$ECHO "$hardcode_libdir_flag_spec_ld_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in AS \ DLLTOOL \ OBJDUMP \ SHELL \ ECHO \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib \ compiler_lib_search_dirs \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ LD_CXX \ reload_flag_CXX \ compiler_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_static_CXX \ lt_cv_prog_compiler_c_o_CXX \ export_dynamic_flag_spec_CXX \ whole_archive_flag_spec_CXX \ compiler_needs_object_CXX \ with_gnu_ld_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_flag_spec_ld_CXX \ hardcode_libdir_separator_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX \ file_list_spec_CXX \ compiler_lib_search_dirs_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec \ reload_cmds_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ export_symbols_cmds_CXX \ prelink_cmds_CXX \ postlink_cmds_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "doc/bitstring/Makefile") CONFIG_FILES="$CONFIG_FILES doc/bitstring/Makefile" ;; "doc/cprog/Makefile") CONFIG_FILES="$CONFIG_FILES doc/cprog/Makefile" ;; "doc/kernel/Makefile") CONFIG_FILES="$CONFIG_FILES doc/kernel/Makefile" ;; "doc/man/Makefile") CONFIG_FILES="$CONFIG_FILES doc/man/Makefile" ;; "doc/oops/Makefile") CONFIG_FILES="$CONFIG_FILES doc/oops/Makefile" ;; "doc/record/Makefile") CONFIG_FILES="$CONFIG_FILES doc/record/Makefile" ;; "doc/regexp/Makefile") CONFIG_FILES="$CONFIG_FILES doc/regexp/Makefile" ;; "doc/unix/Makefile") CONFIG_FILES="$CONFIG_FILES doc/unix/Makefile" ;; "doc/usenix/Makefile") CONFIG_FILES="$CONFIG_FILES doc/usenix/Makefile" ;; "doc/util/Makefile") CONFIG_FILES="$CONFIG_FILES doc/util/Makefile" ;; "doc/xlib/Makefile") CONFIG_FILES="$CONFIG_FILES doc/xlib/Makefile" ;; "doc/xt/Makefile") CONFIG_FILES="$CONFIG_FILES doc/xt/Makefile" ;; "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; "lib/misc/Makefile") CONFIG_FILES="$CONFIG_FILES lib/misc/Makefile" ;; "lib/unix/Makefile") CONFIG_FILES="$CONFIG_FILES lib/unix/Makefile" ;; "lib/xlib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/xlib/Makefile" ;; "lib/xwidgets/Makefile") CONFIG_FILES="$CONFIG_FILES lib/xwidgets/Makefile" ;; "lib/xwidgets/xaw/Makefile") CONFIG_FILES="$CONFIG_FILES lib/xwidgets/xaw/Makefile" ;; "lib/xwidgets/motif/Makefile") CONFIG_FILES="$CONFIG_FILES lib/xwidgets/motif/Makefile" ;; "scm/Makefile") CONFIG_FILES="$CONFIG_FILES scm/Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; "scm/slib.scm") CONFIG_FILES="$CONFIG_FILES scm/slib.scm" ;; "include/site.h") CONFIG_FILES="$CONFIG_FILES include/site.h" ;; "test/check-gc") CONFIG_FILES="$CONFIG_FILES test/check-gc" ;; "test/check-gc2") CONFIG_FILES="$CONFIG_FILES test/check-gc2" ;; "test/check-r4rs") CONFIG_FILES="$CONFIG_FILES test/check-r4rs" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010 Free Software Foundation, # Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="CXX " # ### BEGIN LIBTOOL CONFIG # Assembler program. AS=$lt_AS # DLL creation program. DLLTOOL=$lt_DLLTOOL # Object dumper program. OBJDUMP=$lt_OBJDUMP # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and in which our libraries should be installed. lt_sysroot=$lt_sysroot # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # If ld is used when linking, flag to hardcode \$libdir into a binary # during linking. This must work even if \$libdir does not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects postdep_objects=$lt_postdep_objects predeps=$lt_predeps postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain="$ac_aux_dir/ltmain.sh" # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) if test x"$xsi_shell" = xyes; then sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ func_dirname ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ } # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_basename ()$/,/^} # func_basename /c\ func_basename ()\ {\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ func_dirname_and_basename ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ func_stripname ()\ {\ \ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ \ # positional parameters, so assign one to ordinary parameter first.\ \ func_stripname_result=${3}\ \ func_stripname_result=${func_stripname_result#"${1}"}\ \ func_stripname_result=${func_stripname_result%"${2}"}\ } # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ func_split_long_opt ()\ {\ \ func_split_long_opt_name=${1%%=*}\ \ func_split_long_opt_arg=${1#*=}\ } # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ func_split_short_opt ()\ {\ \ func_split_short_opt_arg=${1#??}\ \ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ } # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ func_lo2o ()\ {\ \ case ${1} in\ \ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ \ *) func_lo2o_result=${1} ;;\ \ esac\ } # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_xform ()$/,/^} # func_xform /c\ func_xform ()\ {\ func_xform_result=${1%.*}.lo\ } # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_arith ()$/,/^} # func_arith /c\ func_arith ()\ {\ func_arith_result=$(( $* ))\ } # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_len ()$/,/^} # func_len /c\ func_len ()\ {\ func_len_result=${#1}\ } # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$lt_shell_append" = xyes; then sed -e '/^func_append ()$/,/^} # func_append /c\ func_append ()\ {\ eval "${1}+=\\${2}"\ } # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ func_append_quoted ()\ {\ \ func_quote_for_eval "${2}"\ \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ } # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 $as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} fi mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" cat <<_LT_EOF >> "$ofile" # ### BEGIN LIBTOOL TAG CONFIG: CXX # The linker used to build libraries. LD=$lt_LD_CXX # How to create reloadable object files. reload_flag=$lt_reload_flag_CXX reload_cmds=$lt_reload_cmds_CXX # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_CXX # A language specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU compiler? with_gcc=$GCC_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object_CXX # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld_CXX # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # If ld is used when linking, flag to hardcode \$libdir into a binary # during linking. This must work even if \$libdir does not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute_CXX # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic_CXX # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath_CXX # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_CXX # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds_CXX # Specify filename containing input files. file_list_spec=$lt_file_list_spec_CXX # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects_CXX postdep_objects=$lt_postdep_objects_CXX predeps=$lt_predeps_CXX postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # ### END LIBTOOL TAG CONFIG: CXX _LT_EOF ;; "test/check-gc":F) chmod 0755 test/check-gc ;; "test/check-gc2":F) chmod 0755 test/check-gc2 ;; "test/check-r4rs":F) chmod 0755 test/check-r4rs ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi cat << EOF Elk configuration summary ------------------------- build C++ plugins: ${ac_cv_my_have_cxx} libgdbm support: ${ac_cv_my_have_gdbm} X11 support: ${ac_cv_my_have_x11} Xaw support: ${ac_cv_my_have_xaw} Motif support: ${ac_cv_my_have_motif} build documentation: ${ac_cv_my_have_groff} EOF elk-3.99.8/examples/0000755000175000017500000000000011577110020011210 500000000000000elk-3.99.8/examples/xlib/0000755000175000017500000000000011577110020012146 500000000000000elk-3.99.8/examples/xlib/wm-delete.scm0000644000175000017500000000125611577076306014503 00000000000000;;; -*-Scheme-*- ;;; ;;; Demonstrate use of the WM_DELETE_WINDOW protocol. (require 'xlib) (let* ((dpy (open-display)) (del-atom (intern-atom dpy 'WM_DELETE_WINDOW)) (prot-atom (intern-atom dpy 'WM_PROTOCOLS)) (win (create-window 'parent (display-root-window dpy) 'width 100 'height 100 'background-pixel (white-pixel dpy)))) (set-wm-name! win '(fine)) (set-wm-protocols! win (vector del-atom)) (map-window win) (unwind-protect (handle-events dpy #t #f (client-message (lambda (event w type data) (and (eq? type prot-atom) (vector? data) (eq? (make-atom (vector-ref data 0)) del-atom))))) (close-display dpy))) elk-3.99.8/examples/xlib/poly.scm0000644000175000017500000000172111577076306013600 00000000000000;;; -*-Scheme-*- (require 'xlib) (define (poly) (let* ((dpy (open-display)) (black (black-pixel dpy)) (white (white-pixel dpy)) (width 400) (height 400) (win (create-window 'parent (display-root-window dpy) 'width width 'height height 'background-pixel white 'event-mask '(exposure))) (gc (create-gcontext 'window win 'function 'xor 'background white 'foreground black)) (l '(#f #f #f)) (rand (lambda (x) (modulo (random) x)))) (map-window win) (handle-events dpy #t #f (else (lambda args (set! width (window-width win)) (set! height (window-height win)) #t))) (unwind-protect (let loop ((n 0)) (if (= n 200) (begin (clear-window win) (display-wait-output dpy #f) (set! n 0))) (fill-polygon win gc (list->vector (map (lambda (x) (cons (rand width) (rand height))) l)) #f 'convex) (loop (1+ n))) (close-display dpy)))) (poly) elk-3.99.8/examples/xlib/map-all.scm0000644000175000017500000000054211577076306014140 00000000000000;;; -*-Scheme-*- ;;; ;;; Map all windows. (require 'xlib) (define (foreach-window root fun) (let ((l (vector->list (car (query-tree root))))) (for-each (lambda (w) (fun w) (foreach-window w fun)) l))) (let ((dpy (open-display))) (unwind-protect (foreach-window (display-root-window dpy) map-window) (close-display dpy))) elk-3.99.8/examples/xlib/lines.scm0000644000175000017500000000211211577076306013722 00000000000000;;; -*-Scheme-*- (require 'xlib) (define (lines) (let* ((dpy (open-display)) (black (black-pixel dpy)) (white (white-pixel dpy)) (win (create-window 'parent (display-root-window dpy) 'width 400 'height 400 'background-pixel white 'event-mask '(exposure button-press enter-window leave-window))) (gc (create-gcontext 'window win 'background white 'foreground black)) (draw (lambda (inc) (clear-window win) (with win (let ((width (window-width win)) (height (window-height win))) (do ((x 0 (+ x inc))) ((> x width)) (draw-line win gc x 0 (- width x) height)) (do ((y height (- y inc))) ((< y 0)) (draw-line win gc 0 y width (- height y)))))))) (map-window win) (unwind-protect (handle-events dpy #t #f (button-press (lambda args #t)) (expose (lambda args (draw 2) #f)) ((enter-notify leave-notify) (lambda (e . args) (set-window-border-pixel! win (if (eq? e 'enter-notify) white black)) #f))) (close-display dpy)))) (lines) elk-3.99.8/examples/xlib/hello.scm0000644000175000017500000000201011577076306013710 00000000000000;;; -*-Scheme-*- (require 'xlib) (define (hello-world) (let* ((dpy (open-display)) (black (black-pixel dpy)) (white (white-pixel dpy)) (font (open-font dpy "*-new century schoolbook-bold-r*24*")) (text (translate-text "Hello world!")) (width (+ 2 (text-width font text '1-byte))) (height (+ 2 (max-char-ascent font) (max-char-descent font))) (win (create-window 'parent (display-root-window dpy) 'width width 'height height 'background-pixel white 'event-mask '(exposure button-press))) (gc (create-gcontext 'window win 'background white 'foreground black 'font font))) (map-window win) (unwind-protect (handle-events dpy #t #f (button-press (lambda ignore #t)) (expose (lambda ignore (let ((x (truncate (/ (- (window-width win) width) 2))) (y (truncate (/ (- (+ (window-height win) (max-char-ascent font)) (max-char-descent font)) 2)))) (draw-poly-text win gc x y text '1-byte)) #f))) (close-display dpy)))) (hello-world) elk-3.99.8/examples/xlib/useful.scm0000644000175000017500000000106011577076306014114 00000000000000;;; -*-Scheme-*- (require 'xlib) (define dpy (open-display)) (define (f) (display-wait-output dpy #t)) (define root (display-root-window dpy)) (define cmap (display-colormap dpy)) (define white (white-pixel dpy)) (define black (black-pixel dpy)) (define rgb-white (query-color cmap white)) (define rgb-black (query-color cmap black)) (define win (create-window 'parent root 'width 300 'height 300 'background-pixel white)) (define gc (create-gcontext 'window win 'background white 'foreground black)) (map-window win) elk-3.99.8/examples/xlib/picture.scm0000644000175000017500000000457311577076306014300 00000000000000;;; -*-Scheme-*- ;;; -*- Mode:Lisp; Package:XLIB; Syntax:COMMON-LISP; Base:10; Lowercase:T -*- ;;; CLX - Point Graphing demo program ;;; Copyright (C) 1988 Michael O. Newton (newton@csvax.caltech.edu) ;;; Permission is granted to any individual or institution to use, copy, ;;; modify, and distribute this software, provided that this complete ;;; copyright and permission notice is maintained, intact, in all copies and ;;; supporting documentation. ;;; The author provides this software "as is" without express or ;;; implied warranty. ;;; This routine plots the recurrance ;;; x <- y(1+sin(0.7x)) - 1.2(|x|)^.5 ;;; y <- .21 - x ;;; As described in a ?? 1983 issue of the Mathematical Intelligencer ;;; It has ONLY been tested under X.V11R2 on a Sun3 running KCL (require 'xlib) (define (picture point-count) (let* ((dpy (open-display)) (width 600) (height 600) (black (black-pixel dpy)) (white (white-pixel dpy)) (root (display-root-window dpy)) (win (create-window 'parent root 'background-pixel white 'event-mask '(exposure button-press) 'width width 'height height)) (gc (create-gcontext 'window win 'background white 'foreground black))) (map-window win) (unwind-protect (handle-events dpy #t #f (expose (lambda ignore (clear-window win) (draw-points win gc point-count 0.0 0.0 (* width 0.5) (* height 0.5)) (draw-poly-text win gc 10 10 (translate "Click a button to exit") '1-byte) #f)) (else (lambda ignore #t))) (close-display dpy)))) ;;; Draw points. These should maybe be put into a an array so that they do ;;; not have to be recomputed on exposure. X assumes points are in the range ;;; of width x height, with 0,0 being upper left and 0,H being lower left. ;;; x <- y(1+sin(0.7x)) - 1.2(|x|)^.5 ;;; y <- .21 - x ;;; hw and hh are half-width and half-height of screen (define (draw-points win gc count x y hw hh) (if (zero? (modulo count 100)) (display-flush-output (window-display win))) (if (not (zero? count)) (let ((xf (floor (* (+ 1.2 x) hw ))) ; These lines center the picture (yf (floor (* (+ 0.5 y) hh )))) (draw-point win gc xf yf) (draw-points win gc (1- count) (- (* y (1+ (sin (* 0.7 x)))) (* 1.2 (sqrt (abs x)))) (- 0.21 x) hw hh)))) (define (translate string) (list->vector (map char->integer (string->list string)))) (picture 10000) elk-3.99.8/examples/xlib/track.scm0000644000175000017500000000203511577076306013720 00000000000000;;; -*-Scheme-*- (require 'xlib) (define (track) (let* ((dpy (open-display)) (root (display-root-window dpy)) (gc (create-gcontext 'window root 'function 'xor 'foreground (black-pixel dpy) 'subwindow-mode 'include-inferiors)) (where (query-pointer root)) (lx (car where)) (ly (cadr where)) (lw 300) (lh 300) (move-outline (lambda (x y) (if (not (and (= x lx) (= y ly))) (begin (draw-rectangle root gc lx ly lw lh) (draw-rectangle root gc x y lw lh) (set! lx x) (set! ly y)))))) (unwind-protect (case (grab-pointer root #f '(pointer-motion button-press) #f #f 'none 'none 'now) (success (with-server-grabbed dpy (draw-rectangle root gc lx ly lw lh) (display-flush-output dpy) (handle-events dpy #t #f (motion-notify (lambda (event root win subwin time x y . rest) (move-outline x y) #f)) (else (lambda args #t))))) (else (format #t "Not grabbed!~%"))) (draw-rectangle root gc lx ly lw lh) (close-display dpy)))) (track) elk-3.99.8/examples/xlib/properties.scm0000644000175000017500000000211111577076306015003 00000000000000;;; -*-Scheme-*- ;;; ;;; Display all properties of all windows (with name, type, format, ;;; and data). (require 'xlib) (define (properties) (define (tab obj n) (let* ((s (format #f "~s" obj)) (n (- n (string-length s)))) (display s) (if (positive? n) (do ((i 0 (1+ i))) ((= i n)) (display #\space))))) (define (do-window w prop) (format #t "Window ~s:~%" w) (for-each (lambda (p) (tab (atom-name (window-display w) p) 20) (display "= ") (let ((p (get-property w p #f 0 20 #f))) (tab (atom-name (window-display w) (car p)) 18) (tab (cadr p) 3) (format #t "~s~%" (caddr p)))) (vector->list prop)) (newline)) (define (do-children root) (for-each (lambda (w) (do-window w (list-properties w)) (do-children w)) (vector->list (car (query-tree root))))) (let* ((dpy (open-display)) (root (display-root-window dpy))) (unwind-protect (begin (do-window root (list-properties root)) (do-children root)) (close-display dpy)))) (properties) elk-3.99.8/examples/Makefile.in0000644000175000017500000004530311577103434013215 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = examples DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(c__dir)" "$(DESTDIR)$(motifdir)" \ "$(DESTDIR)$(regexpdir)" "$(DESTDIR)$(schemedir)" \ "$(DESTDIR)$(unixdir)" "$(DESTDIR)$(xawdir)" \ "$(DESTDIR)$(xlibdir)" DATA = $(c___DATA) $(motif_DATA) $(regexp_DATA) $(scheme_DATA) \ $(unix_DATA) $(xaw_DATA) $(xlib_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ELK_CFLAGS = @ELK_CFLAGS@ ELK_LDFLAGS = @ELK_LDFLAGS@ ELK_LIBS = @ELK_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INCLUDES = @INCLUDES@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOTIF_CFLAGS = @MOTIF_CFLAGS@ MOTIF_LIBS = @MOTIF_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STDINT_HEADER = @STDINT_HEADER@ STRIP = @STRIP@ VERSION = @VERSION@ XAW_CFLAGS = @XAW_CFLAGS@ XAW_LIBS = @XAW_LIBS@ XMKMF = @XMKMF@ XT_CFLAGS = @XT_CFLAGS@ XT_LIBS = @XT_LIBS@ X_CFLAGS = @X_CFLAGS@ X_LIBS = @X_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ NULL = EXTRA_DIST = $(DATA) examplesdir = $(datadir)/doc/@PACKAGE@/examples c__dir = $(examplesdir)/c++ c___DATA = \ c++/class.cpp \ c++/constructor.cpp \ $(NULL) regexpdir = $(examplesdir)/regexp regexp_DATA = \ regexp/match.scm \ $(NULL) schemedir = $(examplesdir)/scheme scheme_DATA = \ scheme/ramanujan.scm \ scheme/hanoi.scm \ scheme/fib.scm \ scheme/co.scm \ scheme/meissel.scm \ scheme/perm.scm \ scheme/prim.scm \ scheme/Y.scm \ scheme/kons.scm \ scheme/mondo.scm \ scheme/billiard.scm \ scheme/cell.scm \ scheme/work.scm \ scheme/rungekutta.scm \ scheme/flame.scm \ scheme/dynamic.scm \ scheme/cc.scm \ scheme/cps.scm \ scheme/acker.scm \ scheme/fix.scm \ scheme/compile.scm \ scheme/sqrt.scm \ scheme/unify.scm \ $(NULL) unixdir = $(examplesdir)/unix unix_DATA = \ unix/pipsiz.scm \ unix/ls.scm \ unix/timeout.scm \ unix/calc.scm \ unix/lock.scm \ unix/copy.scm \ $(NULL) xawdir = $(examplesdir)/xaw xaw_DATA = \ xaw/clickcount.scm \ xaw/tree.scm \ xaw/dialog.scm \ xaw/grip.scm \ xaw/popup.scm \ xaw/pulldown.scm \ xaw/scrollbox.scm \ xaw/accel.scm \ xaw/list.scm \ xaw/viewport.scm \ xaw/panner.scm \ xaw/scrollbar.scm \ xaw/stripchart.scm \ xaw/text.scm \ xaw/paned.scm \ xaw/porthole.scm \ $(NULL) xlibdir = $(examplesdir)/xlib xlib_DATA = \ xlib/wm-delete.scm \ xlib/map-all.scm \ xlib/useful.scm \ xlib/poly.scm \ xlib/hello.scm \ xlib/properties.scm \ xlib/track.scm \ xlib/lines.scm \ xlib/picture.scm \ $(NULL) motifdir = $(examplesdir)/motif motif_DATA = \ motif/scroll-bar.scm \ motif/radio.scm \ motif/message-dialog.scm \ motif/drawing-area.scm \ motif/radio-stuff.scm \ motif/popup-menu.scm \ motif/pulldown-menu.scm \ motif/main-window.scm \ motif/menu-stuff.scm \ motif/vcr.scm \ motif/option-menu.scm \ motif/list.scm \ motif/selection-box.scm \ $(NULL) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign examples/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign examples/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-c__DATA: $(c___DATA) @$(NORMAL_INSTALL) test -z "$(c__dir)" || $(MKDIR_P) "$(DESTDIR)$(c__dir)" @list='$(c___DATA)'; test -n "$(c__dir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(c__dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(c__dir)" || exit $$?; \ done uninstall-c__DATA: @$(NORMAL_UNINSTALL) @list='$(c___DATA)'; test -n "$(c__dir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(c__dir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(c__dir)" && rm -f $$files install-motifDATA: $(motif_DATA) @$(NORMAL_INSTALL) test -z "$(motifdir)" || $(MKDIR_P) "$(DESTDIR)$(motifdir)" @list='$(motif_DATA)'; test -n "$(motifdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(motifdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(motifdir)" || exit $$?; \ done uninstall-motifDATA: @$(NORMAL_UNINSTALL) @list='$(motif_DATA)'; test -n "$(motifdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(motifdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(motifdir)" && rm -f $$files install-regexpDATA: $(regexp_DATA) @$(NORMAL_INSTALL) test -z "$(regexpdir)" || $(MKDIR_P) "$(DESTDIR)$(regexpdir)" @list='$(regexp_DATA)'; test -n "$(regexpdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(regexpdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(regexpdir)" || exit $$?; \ done uninstall-regexpDATA: @$(NORMAL_UNINSTALL) @list='$(regexp_DATA)'; test -n "$(regexpdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(regexpdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(regexpdir)" && rm -f $$files install-schemeDATA: $(scheme_DATA) @$(NORMAL_INSTALL) test -z "$(schemedir)" || $(MKDIR_P) "$(DESTDIR)$(schemedir)" @list='$(scheme_DATA)'; test -n "$(schemedir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(schemedir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(schemedir)" || exit $$?; \ done uninstall-schemeDATA: @$(NORMAL_UNINSTALL) @list='$(scheme_DATA)'; test -n "$(schemedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(schemedir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(schemedir)" && rm -f $$files install-unixDATA: $(unix_DATA) @$(NORMAL_INSTALL) test -z "$(unixdir)" || $(MKDIR_P) "$(DESTDIR)$(unixdir)" @list='$(unix_DATA)'; test -n "$(unixdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(unixdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(unixdir)" || exit $$?; \ done uninstall-unixDATA: @$(NORMAL_UNINSTALL) @list='$(unix_DATA)'; test -n "$(unixdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(unixdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(unixdir)" && rm -f $$files install-xawDATA: $(xaw_DATA) @$(NORMAL_INSTALL) test -z "$(xawdir)" || $(MKDIR_P) "$(DESTDIR)$(xawdir)" @list='$(xaw_DATA)'; test -n "$(xawdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(xawdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(xawdir)" || exit $$?; \ done uninstall-xawDATA: @$(NORMAL_UNINSTALL) @list='$(xaw_DATA)'; test -n "$(xawdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(xawdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(xawdir)" && rm -f $$files install-xlibDATA: $(xlib_DATA) @$(NORMAL_INSTALL) test -z "$(xlibdir)" || $(MKDIR_P) "$(DESTDIR)$(xlibdir)" @list='$(xlib_DATA)'; test -n "$(xlibdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(xlibdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(xlibdir)" || exit $$?; \ done uninstall-xlibDATA: @$(NORMAL_UNINSTALL) @list='$(xlib_DATA)'; test -n "$(xlibdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(xlibdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(xlibdir)" && rm -f $$files tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(c__dir)" "$(DESTDIR)$(motifdir)" "$(DESTDIR)$(regexpdir)" "$(DESTDIR)$(schemedir)" "$(DESTDIR)$(unixdir)" "$(DESTDIR)$(xawdir)" "$(DESTDIR)$(xlibdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-c__DATA install-motifDATA install-regexpDATA \ install-schemeDATA install-unixDATA install-xawDATA \ install-xlibDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-c__DATA uninstall-motifDATA \ uninstall-regexpDATA uninstall-schemeDATA uninstall-unixDATA \ uninstall-xawDATA uninstall-xlibDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-c__DATA install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-motifDATA install-pdf install-pdf-am install-ps \ install-ps-am install-regexpDATA install-schemeDATA \ install-strip install-unixDATA install-xawDATA \ install-xlibDATA installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-c__DATA uninstall-motifDATA \ uninstall-regexpDATA uninstall-schemeDATA uninstall-unixDATA \ uninstall-xawDATA uninstall-xlibDATA # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: elk-3.99.8/examples/scheme/0000755000175000017500000000000011577110020012454 500000000000000elk-3.99.8/examples/scheme/cps.scm0000644000175000017500000000047111577076306013711 00000000000000;;; -*-Scheme-*- (define (identity value) value) (define (gcd a b) (cps-gcd a b identity)) (define (cps-gcd a b k) (if (= b 0) (k a) (cps-remainder a b (lambda (v) (cps-gcd b v k))))) (define (cps-remainder n d k) (if (< n d) (k n) (cps-remainder (- n d) d k))) (print (gcd 4 6)) elk-3.99.8/examples/scheme/work.scm0000644000175000017500000000265211577076306014111 00000000000000;;; -*-Scheme-*- ;;; ;;; Putting Scheme to Work ;;; By Olivier Danvy ;;; Bigre special edition "Putting Scheme to Work" (define fix (let ((z (lambda (P) (lambda (u) (lambda (t) (lambda (t) (lambda (i) (lambda (n) (lambda (g) (lambda (S) (lambda (c) (lambda (h) (lambda (e) (lambda (m) (lambda (e) (lambda (t) (lambda (o) (lambda (W) (lambda (o) (lambda (r) (lambda (k) (lambda (!) (! (lambda (break) (((((((((((((((((((((W o) r) k) W) o) r) k) W) o) r) k) W) o) r) k) W) o) r) k) !) break))))))))))))))))))))))))) (let ((Z z)) (((((((((((((((((((z z) z) z) z) z) Z) Z) Z) Z) Z) Z) Z) z) z) z) z) z) z) z)))) (print ((fix (lambda (f) (lambda (n) (if (zero? n) 1 (* n (f (- n 1))))))) 9)) elk-3.99.8/examples/scheme/meissel.scm0000644000175000017500000000145111577076306014564 00000000000000;;; -*-Scheme-*- (define (partial-sum i n e ee base) (- (quotient base (* i e)) (quotient base (* (+ 2 i) ee)))) (define (a n base) ; atan(1/n) (do ((i 1 (+ 4 i)) (delta 1 (partial-sum i n e (* e n n) base)) (e n (* e n n n n)) (sum 0 (+ sum delta))) ((zero? delta) sum))) (define (calc-pi base) (- (* 32 (a 10 base)) (* 16 (a 515 base)) (* 4 (a 239 base)))) (define (run) (format #t "How many digits of pi do you want (0 to exit): ") (let ((num (read))) (if (and (not (eof-object? num)) (positive? num)) (let* ((extra (+ 5 (truncate (log num)))) (base (expt 10 (+ num extra))) (pi (calc-pi base))) (format #t "~a.~a~%" (quotient pi base) (quotient (remainder pi base) (expt 10 extra))) (run))))) (run) elk-3.99.8/examples/scheme/flame.scm0000644000175000017500000002136211577076306014212 00000000000000;;; -*-Scheme-*- ;;; ;;; flame -- print a flame (ported from the Gnu-Emacs flame.el) (define flame) (let ((pos) (end-margin 55) (margin 65)) (set! flame (lambda n (cond ((null? n) (set! n '(1))) ((or (not (integer? (car n))) (negative? (car n))) (error 'flame "positive integer argument expected"))) (set! pos 0) (fluid-let ((garbage-collect-notify? #f)) (do ((i (car n) (1- i))) ((zero? i)) (if (> pos end-margin) (begin (set! pos 0) (newline))) (flame-print #t (flatten (flame-expand '(sentence)))) (display " ")) (newline)) #v)) (define (flame-expand x) (if (pair? x) (map flame-expand ((eval (car x)))) x)) (define (flatten x) (if (pair? x) (apply append (map flatten x)) (list x))) (define (capitalize w) (display (char-upcase (string-ref w 0))) (if (> (string-length w) 1) (display (substring w 1 (string-length w))))) (define (flame-print first x) (if (not (null? x)) (begin (let* ((w (symbol->string (car x))) (len (string-length w))) ((if first capitalize display) w) (set! pos (+ 1 pos len)) (if (not (null? (cdr x))) (begin (if (not (memq (cadr x) '(? \. \, s! ! s \'s -loving))) (if (< pos margin) (display " ") (set! pos 0) (newline))) (flame-print #f (cdr x)))))))) (define (choose class) (list-ref class (modulo (random) (length class)))) (define (sentence) (choose sentences)) (define sentences '((how can you say that (statement) ?) (I can't believe how (adjective) you are.) (only a (der-term) like you would say that (statement) \.) ((statement) \, huh?) (so, (statement) ?) ((statement) \, right?) (I mean, (sentence)) (don't you realise that (statement) ?) (I firmly believe that (statement) \.) (let me tell you something, you (der-term) \, (statement) \.) (furthermore, you (der-term) \, (statement) \.) (I couldn't care less about your (thing) \.) (How can you be so (adjective) ?) (you make me sick.) (it's well known that (statement) \.) ((statement) \.) (it takes a (group-adj) (der-term) like you to say that (statement) \.) (I don't want to hear about your (thing) \.) (you're always totally wrong.) (I've never heard anything as ridiculous as the idea that (statement) \.) (you must be a real (der-term) to think that (statement) \.) (you (adjective) (group-adj) (der-term) !) (you're probably (group-adj) yourself.) (you sound like a real (der-term) \.) (why, (statement) !) (I have many (group-adj) friends.) (save the (thing) s!) (no nukes!) (ban (thing) s!) (I'll bet you think that (thing) s are (adjective) \.) (you know, (statement) \.) (your (quality) reminds me of a (thing) \.) (you have the (quality) of a (der-term) \.) ((der-term) !) ((adjective) (group-adj) (der-term) !) (you're a typical (group-adj) person, totally (adjective) \.) (man, (sentence)))) (define (quality) (choose qualities)) (define qualities '((ignorance) (stupidity) (worthlessness) (prejudice) (lack of intelligence) (lousiness) (bad grammar) (lousy spelling) (lack of common decency) (ugliness) (nastiness) (subtlety) (dishonesty) ((adjective) (quality)))) (define (adjective) (choose adjectives)) (define adjectives '((ignorant) (crass) (pathetic) (sick) (bloated) (malignant) (perverted) (sadistic) (stupid) (unpleasant) (lousy) (abusive) (bad) (braindamaged) (selfish) (improper) (nasty) (disgusting) (foul) (intolerable) (primitive) (depressing) (dumb) (phoney) ((adjective) and (adjective)) (as (adjective) as a (thing)))) (define (der-term) (choose der-terms)) (define der-terms '(((adjective) (der-term)) (sexist) (fascist) (weakling) (coward) (beast) (peasant) (racist) (cretin) (fool) (jerk) (ignoramus) (idiot) (wanker) (rat) (slimebag) (DAF driver) (Neanderthal) (sadist) (drunk) (capitalist) (wimp) (dogmatist) (wally) (maniac) (whimpering scumbag) (pea brain) (arsehole) (moron) (goof) (incompetant) (lunkhead) (Nazi) (SysThug) ((der-term) (der-term)))) (define (thing) (choose things)) (define things '(((adjective) (thing)) (computer) (Honeywell DPS8) (whale) (operation) (sexist joke) (ten-incher) (dog) (MicroVAX II) (source license) (real-time clock) (mental problem) (sexual fantasy) (venereal disease) (Jewish grandmother) (cardboard cut-out) (punk haircut) (surfboard) (system call) (wood-burning stove) (graphics editor) (right wing death squad) (disease) (vegetable) (religion) (cruise missile) (bug fix) (lawyer) (copyright) (PAD))) (define (group-adj) (choose group-adjs)) (define group-adjs '((gay) (old) (lesbian) (young) (black) (Polish) ((adjective)) (white) (mentally retarded) (Nicaraguan) (homosexual) (dead) (underpriviledged) (religious) ((thing) -loving) (feminist) (foreign) (intellectual) (crazy) (working) (unborn) (Chinese) (short) ((adjective)) (poor) (rich) (funny-looking) (Puerto Rican) (Mexican) (Italian) (communist) (fascist) (Iranian) (Moonie))) (define (statement) (choose statements)) (define statements '((your (thing) is great) ((thing) s are fun) ((person) is a (der-term)) ((group-adj) people are (adjective)) (every (group-adj) person is a (der-term)) (most (group-adj) people have (thing) s) (all (group-adj) dudes should get (thing) s) ((person) is (group-adj)) (trees are (adjective)) (if you've seen one (thing) \, you've seen them all) (you're (group-adj)) (you have a (thing)) (my (thing) is pretty good) (the Martians are coming) (the (paper) is always right) (just because you read it in the (paper) that doesn't mean it's true) ((person) was (group-adj)) ((person) \'s ghost is living in your (thing)) (you look like a (thing)) (the oceans are full of dirty fish) (people are dying every day) (a (group-adj) man ain't got nothing in the world these days) (women are inherently superior to men) (the system staff is fascist) (there is life after death) (the world is full of (der-term) s) (you remind me of (person)) (technology is evil) ((person) killed (person)) (the Russians are tapping your phone) (the Earth is flat) (it's OK to run down (group-adj) people) (Multics is a really (adjective) operating system) (the CIA killed (person)) (the sexual revolution is over) (Lassie was (group-adj)) (the (group-adj) s have really got it all together) (I was (person) in a previous life) (breathing causes cancer) (it's fun to be really (adjective)) ((quality) is pretty fun) (you're a (der-term)) (the (group-adj) culture is fascinating) (when ya gotta go ya gotta go) ((person) is (adjective)) ((person) \'s (quality) is (adjective)) (it's a wonderful day) (everything is really a (thing)) (there's a (thing) in (person) \'s brain) ((person) is a cool dude) ((person) is just a figment of your imagination) (the more (thing) s you have, the better) (life is a (thing)) (life is (quality)) ((person) is (adjective)) ((group-adj) people are all (adjective) (der-term) s) ((statement) \, and (statement)) ((statement) \, but (statement)) (I wish I had a (thing)) (you should have a (thing)) (you hope that (statement)) ((person) is secretly (group-adj)) (you wish you were (group-adj)) (you wish you were a (thing)) (I wish I were a (thing)) (you think that (statement)) ((statement) \, because (statement)) ((group-adj) people don't get married to (group-adj) people because (reason)) ((group-adj) people are all (adjective) because (reason)) ((group-adj) people are (adjective) \, and (reason)) (you must be a (adjective) (der-term) to think that (person) said (statement)) ((group-adj) people are inherently superior to (group-adj) people) (God is Dead))) (define (paper) (choose papers)) (define papers '((Daily Mail) (Daily Express) (Centre Bulletin) (Sun) (Daily Mirror) (Daily Telegraph) (Beano) (Multics Manual))) (define (person) (choose persons)) (define persons '((Reagan) (Ken Thompson) (Dennis Ritchie) (JFK) (the Pope) (Gadaffi) (Napoleon) (Karl Marx) (Groucho) (Michael Jackson) (Caesar) (Nietzsche) (Heidegger) (Henry Kissinger) (Nixon) (Castro) (Thatcher) (Attilla the Hun) (Alaric the Visigoth) (Hitler))) (define (reason) (choose reasons)) (define reasons '((they don't want their children to grow up to be too lazy to steal) (they can't tell them apart from (group-adj) dudes) (they're too (adjective)) ((person) wouldn't have done it) (they can't spray paint that small) (they don't have (thing) s) (they don't know how) (they can't afford (thing) s))) ) (flame 15) elk-3.99.8/examples/scheme/ramanujan.scm0000644000175000017500000000224311577076306015077 00000000000000;;; -*-Scheme-*- (define (sqrt-of a base) (do ((old 0) (xn (* a base base)) (an (* a base base))) ((equal? old xn) xn) (begin (set! old xn) (set! xn (quotient (+ xn (quotient an xn)) 2))))) ; pi = 9801/(sqrt(8) * sum(...)) (define (rama base) (define (step n) (quotient (* base (* (fact (* 4 n)) (+ 1103 (* 26390 n)))) (* (expt (fact n) 4) (expt 396 (* 4 n))))) (do ((i 0 (+ i 1)) (sum 0 (+ sum delta)) (delta 1 (step i))) ((zero? delta) sum))) (define (calc-pi-ramanujan base) (quotient (* base base base 9801) (* (sqrt-of 8 base) (rama base)))) (define (fact n) (let f ((i n) (a 1)) (if (zero? i) a (f (- i 1) (* a i))))) (define (square x) (* x x)) (define base (let ((d (format #t "How many decimals of pi do you want (0 to exit): ")) (num (read))) (if (and (not (eof-object? num)) (positive? num)) (let* ((extra (+ 5 (truncate (log num))))) (cons (expt 10 (+ num extra)) extra)) #f))) (define (print-pi pi base) (format #t "~a.~a~%" (quotient pi (car base)) (quotient (remainder pi (car base)) (expt 10 (cdr base))))) (if base (print-pi (calc-pi-ramanujan (car base)) base)) elk-3.99.8/examples/scheme/perm.scm0000644000175000017500000000061711577076306014071 00000000000000;;; -*-Scheme-*- (define (perm x) (if (null? x) (list x) (let ((res '())) (for-each (lambda (e) (set! res (append res (map (lambda (p) (cons e p)) (perm (del e x)))))) x) res))) (define (del e l) (let loop ((r l)) (if (pair? r) (if (eq? e (car r)) (loop (cdr r)) (cons (car r) (loop (cdr r)))) '()))) (print (perm '(a b c d))) elk-3.99.8/examples/scheme/sqrt.scm0000644000175000017500000000065711577076306014123 00000000000000;;; -*-Scheme-*- (define (sqrt x) (define (good-enough? guess) (< (abs (- (square guess) x)) 0.001)) (define (improve guess) (average guess (/ x guess))) (define (sqrt-iter guess) (if (good-enough? guess) guess (sqrt-iter (improve guess)))) (sqrt-iter 1)) (define (square x) (* x x)) (define (average x y) (/ (+ x y) 2)) (define (abs x) (if (negative? x) (- x) x)) (print (sqrt 2)) (print (sqrt 4)) elk-3.99.8/examples/scheme/cell.scm0000644000175000017500000000106311577076306014041 00000000000000;;; -*-Scheme-*- (define (make-cell) (call-with-current-continuation (lambda (return-from-make-cell) (letrec ((state (call-with-current-continuation (lambda (return-new-state) (return-from-make-cell (lambda (op) (case op ((set) (lambda (value) (call-with-current-continuation (lambda (return-from-access) (return-new-state (list value return-from-access)))))) ((get) (car state))))))))) ((cadr state) 'done))))) (define c (make-cell)) (print ((c 'set) 99)) (print (c 'get)) elk-3.99.8/examples/scheme/dynamic.scm0000644000175000017500000000103611577076306014546 00000000000000;;; -*-Scheme-*- (define cont #f) (define done #f) (define (pr msg) (display msg) (newline)) (define (doit) (dynamic-wind (lambda () (pr " 1:in")) (lambda () (set! done (call-with-current-continuation (lambda (c) (set! cont c) (pr " catch") #f)))) (lambda () (pr " 1:out"))) (if (not done) (dynamic-wind (lambda () (pr " 2:in")) (lambda () (pr " throw") (cont #t)) (lambda () (pr " 2:out"))))) (dynamic-wind (lambda () (pr "0:in")) doit (lambda () (pr "0:out"))) elk-3.99.8/examples/scheme/compile.scm0000644000175000017500000002432411577076306014557 00000000000000(require 'cscheme) ; ; Optimizing scheme compiler ; supports quote, set!, if, lambda special forms, ; constant refs, variable refs and proc applications ; ; Using Clusures for Code Generation ; Marc Feeley and Guy LaPalme ; Computer Language, Vol. 12, No. 1, pp. 47-66 ; 1987 ; (define (compile expr) ((gen expr nil '()))) (define (gen expr env term) (cond ((symbol? expr) (ref (variable expr env) term)) ((not (pair? expr)) (cst expr term)) ((eq? (car expr) 'quote) (cst (cadr expr) term)) ((eq? (car expr) 'set!) (set (variable (cadr expr) env) (gen (caddr expr) env '()) term)) ((eq? (car expr) 'if) (gen-tst (gen (cadr expr) env '()) (gen (caddr expr) env term) (gen (cadddr expr) env term))) ((eq? (car expr) 'lambda) (let ((p (cadr expr))) (prc p (gen (caddr expr) (allocate p env) #t) term))) (else (let ((args (map (lambda (x) (gen x env '())) (cdr expr)))) (let ((var (and (symbol? (car expr)) (variable (car expr) env)))) (if (global? var) (app (cons var args) #t term) (app (cons (gen (car expr) env '()) args) '() term))))))) (define (allocate parms env) (cond ((null? parms) env) ((symbol? parms) (cons parms env)) (else (cons (car parms) (allocate (cdr parms) env))))) (define (variable symb env) (let ((x (memq symb env))) (if x (- (length env) (length x)) (begin (if (not (assq symb -glo-env-)) (define-global symb '-undefined-)) (assq symb -glo-env-))))) (define (global? var) (pair? var)) (define (cst val term) (cond ((eqv? val 1) ((if term gen-1* gen-1))) ((eqv? val 2) ((if term gen-2* gen-2))) ((eqv? val nil) ((if term gen-null* gen-null))) (else ((if term gen-cst* gen-cst) val)))) (define (ref var term) (cond ((global? var) ((if term gen-ref-glo* gen-ref-glo) var)) ((= var 0) ((if term gen-ref-loc-1* gen-ref-loc-1))) ((= var 1) ((if term gen-ref-loc-2* gen-ref-loc-2))) ((= var 2) ((if term gen-ref-loc-3* gen-ref-loc-3))) (else ((if term gen-ref* gen-ref) var)))) (define (set var val term) (cond ((global? var) ((if term gen-set-glo* gen-set-glo) var val)) ((= var 0) ((if term gen-set-loc-1* gen-set-loc-1) val)) ((= var 1) ((if term gen-set-loc-2* gen-set-loc-2) val)) ((= var 2) ((if term gen-set-loc-3* gen-set-loc-3) val)) (else ((if term gen-set* gen-set) var val)))) (define (prc parms body term) ((cond ((null? parms) (if term gen-pr0* gen-pr0)) ((symbol? parms) (if term gen-pr1/rest* gen-pr1/rest)) ((null? (cdr parms)) (if term gen-pr1* gen-pr1)) ((symbol? (cdr parms)) (if term gen-pr2/rest* gen-pr2/rest)) ((null? (cddr parms)) (if term gen-pr2* gen-pr2)) ((symbol? (cddr parms)) (if term gen-pr3/rest* gen-pr3/rest)) ((null? (cdddr parms)) (if term gen-pr3 gen-pr3)) (else (error "too many parameters in a lambda-expression"))) body)) (define (app vals glo term) (apply (case (length vals) ((1) (if glo (if term gen-ap0-glo* gen-ap0-glo) (if term gen-ap0* gen-ap0))) ((2) (if glo (if term gen-ap1-glo* gen-ap1-glo) (if term gen-ap1* gen-ap1))) ((3) (if glo (if term gen-ap2-glo* gen-ap2-glo) (if term gen-ap2* gen-ap2))) ((4) (if glo (if term gen-ap3-glo* gen-ap3-glo) (if term gen-ap3* gen-ap3))) (else (error "too many arguments in a proc application"))) vals)) ; ; code generation for non-terminal evaluations ; ; ; constants ; (define (gen-1) (lambda () 1)) (define (gen-2) (lambda () 2)) (define (gen-null) (lambda () '())) (define (gen-cst a) (lambda () a)) ; ; variable reference ; (define (gen-ref-glo a) (lambda () (cdr a))) ; global var (define (gen-ref-loc-1) (lambda () (cadr *env*))) ; first local var (define (gen-ref-loc-2) (lambda () (caddr *env*))) ; second local var (define (gen-ref-loc-3) (lambda () (cadddr *env*))) ; third local var (define (gen-ref a) (lambda () (do ((i 0 (1+ i)) ; any non-global (env (cdr *env*) (cdr env))) ((= i a) (car env))))) ; ; assignment ; (define (gen-set-glo a b) (lambda () (set-cdr! a (b)))) (define (gen-set-loc-1 a) (lambda () (set-car! (cdr *env*) (a)))) (define (gen-set-loc-2 a) (lambda () (set-car! (cddr *env*) (a)))) (define (gen-set-loc-3 a) (lambda () (set-car! (cdddr *env*) (a)))) (define (gen-set a b) (lambda () (do ((i 0 (1+ i)) (env (cdr *env*) (cdr env))) ((= i a) (set-car! env (b)))))) ; ; conditional ; (define (gen-tst a b c) (lambda () (if (a) (b) (c)))) ; ; procedure application ; (define (gen-ap0-glo a) (lambda () ((cdr a)))) (define (gen-ap1-glo a b) (lambda () ((cdr a) (b)))) (define (gen-ap2-glo a b c) (lambda () ((cdr a) (b) (c)))) (define (gen-ap3-glo a b c d) (lambda () ((cdr a) (b) (c) (d)))) (define (gen-ap0 a) (lambda () ((a)))) (define (gen-ap1 a b) (lambda () ((a) (b)))) (define (gen-ap2 a b c) (lambda () ((a) (b) (c)))) (define (gen-ap3 a b c d) (lambda () ((a) (b) (c) (d)))) ; ; lambda expressions ; (define (gen-pr0 a) ; without "rest" parameter (lambda () (let ((def (cdr *env*))) (lambda () (set! *env* (cons *env* def)) (a))))) (define (gen-pr1 a) (lambda () (let ((def (cdr *env*))) (lambda (x) (set! *env* (cons *env* (cons x def))) (a))))) (define (gen-pr2 a) (lambda () (let ((def (cdr *env*))) (lambda (x y) (set! *env* (cons *env* (cons x (cons y def)))) (a))))) (define (gen-pr3 a) (lambda () (let ((def (cdr *env*))) (lambda (x y z) (set! *env* (cons *env* (cons x (cons y (cons z def))))) (a))))) (define (gen-pr1/rest a) (lambda () (let ((def (cdr *env*))) (lambda x (set! *env* (cons *env* (cons x def))) (a))))) (define (gen-pr2/rest a) (lambda () (let ((def (cdr *env*))) (lambda (x . y) (set! *env* (cons *env* (cons x (cons y def)))) (a))))) (define (gen-pr3/rest a) (lambda () (let ((def (cdr *env*))) (lambda (x y . z) (set! *env* (cons *env* (cons x (cons y (cons z def))))) (a))))) ; ; code generation for terminal evaluations ; ; ; constants ; (define (gen-1*) (lambda () (set! *env* (car *env*)) 1)) (define (gen-2*) (lambda () (set! *env* (car *env*)) 2)) (define (gen-null*) (lambda () (set! *env* (car *env*)) ())) (define (gen-cst* a) (lambda () (set! *env* (car *env*)) a)) ; ; variable reference ; (define (gen-ref-glo* a) (lambda () (set! *env* (car *env*)) (cdr a))) (define (gen-ref-loc-1*) (lambda () (let ((val (cadr *env*))) (set! *env* (car *env*)) val))) (define (gen-ref-loc-2*) (lambda () (let ((val (caddr *env*))) (set! *env* (car *env*)) val))) (define (gen-ref-loc-3*) (lambda () (let ((val (cadddr *env*))) (set! *env* (car *env*)) val))) (define (gen-ref* a) (lambda () (do ((i 0 (1+ i)) (env (cdr *env*) (cdr env))) ((= i a) (set! *env* (car *env*)) (car env))))) ; ; assignment ; (define (gen-set-glo* a b) (lambda () (set! *env* (car *env*)) (set-cdr! a (b)))) (define (gen-set-loc-1* a) (lambda () (set! *env* (car *env*)) (set-car! (cdr *env*) (a)))) (define (gen-set-loc-2* a) (lambda () (set! *env* (car *env*)) (set-car! (cddr *env*) (a)))) (define (gen-set-loc-3* a) (lambda () (set! *env* (car *env*)) (set-car! (cdddr *env*) (a)))) (define (gen-set* a b) (lambda () (do ((i 0 (1+ i)) (env (cdr *env*) (cdr env))) ((= i 0) (set! *env* (car *env*)) (set-car! env (b)))))) ; ; procedure application ; (define (gen-ap0-glo* a) (lambda () (set! *env* (car *env*)) ((cdr a)))) (define (gen-ap1-glo* a b) (lambda () (let ((x (b))) (set! *env* (car *env*)) ((cdr a) x)))) (define (gen-ap2-glo* a b c) (lambda () (let ((x (b)) (y (c))) (set! *env* (car *env*)) ((cdr a) x y)))) (define (gen-ap3-glo* a b c d) (lambda () (let ((x (b)) (y (c)) (z (d))) (set! *env* (car *env*)) ((cdr a) x y z)))) (define (gen-ap0* a) (lambda () (let ((w (a))) (set! *env* (car *env*)) (w)))) (define (gen-ap1* a b) (lambda () (let ((w (a)) (x (b))) (set! *env* (car *env*)) (w x)))) (define (gen-ap2* a b c) (lambda () (let ((w (a)) (x (b)) (y (c))) (set! *env* (car *env*)) (w x y)))) (define (gen-ap3* a b c d) (lambda () (let ((w (a)) (x (b)) (y (c)) (z (d))) (set! *env* (car *env*)) (w x y z)))) ; ; lambda ; (define (gen-pr0* a) (lambda () (let ((def (cdr *env*))) (set! *env* (car *env*)) (lambda () (set! *env* (cons *env* def)) (a))))) (define (gen-pr1* a) (lambda () (let ((def (cdr *env*))) (set! *env* (car *env*)) (lambda (x) (set! *env* (cons *env* (cons x def))) (a))))) (define (gen-pr2* a) (lambda () (let ((def (cdr *env*))) (set! *env* (car *env*)) (lambda (x y) (set! *env* (cons *env* (cons x (cons y def)))) (a))))) (define (gen-pr3* a) (lambda () (let ((def (cdr *env*))) (set! *env* (car *env*)) (lambda (x y z) (set! *env* (cons *env* (cons x (cons y (cons z def))))) (a))))) (define (gen-pr1/rest* a) (lambda () (let ((def (cdr *env*))) (set! *env* (car *env*)) (lambda x (set! *env* (cons *env* (cons x def))) (a))))) (define (gen-pr2/rest* a) (lambda () (let ((def (cdr *env*))) (set! *env* (car *env*)) (lambda (x . y) (set! *env* (cons *env* (cons x (cons y def)))) (a))))) (define (gen-pr1/rest* a) (lambda () (let ((def (cdr *env*))) (set! *env* (car *env*)) (lambda (x y . z) (set! *env* (cons *env* (cons x (cons y (cons z def))))) (a))))) ; ; global defs ; (define (define-global var val) (if (assq var -glo-env-) (set-cdr! (assq var -glo-env-) val) (set! -glo-env- (cons (cons var val) -glo-env-)))) (define -glo-env- (list (cons 'define define-global))) (define-global 'cons cons) (define-global 'car car) (define-global 'cdr cdr) (define-global 'null? null?) (define-global 'not not) (define-global '< <) (define-global '-1+ -1+) (define-global '+ +) (define-global '- -) ; ; current environment ; (define *env* '(dummy)) ; ; environment manipulation ; (define (restore-env) (set! *env* (car *env*))) ; ; evaluator ; (define (evaluate expr) ((compile (list 'lambda '() expr)))) (evaluate '(define 'fib (lambda (x) (if (< x 2) x (+ (fib (- x 1)) (fib (- x 2))))))) (print (evaluate '(fib 10))) elk-3.99.8/examples/scheme/cc.scm0000644000175000017500000000073211577076306013511 00000000000000;;; -*-Scheme-*- (define acc) (define bcc) (define n 5) (define (a) (if (not (= 0 (call-with-current-continuation (lambda (cc) (set! acc cc) 0)))) (if (> n 0) (begin (set! n (- n 1)) (display "resume b") (newline) (bcc 1)) #v) acc)) (define (b) (if (not (= 0 (call-with-current-continuation (lambda (cc) (set! bcc cc) 0)))) (begin (display "resume a") (newline) (acc 1))) bcc) (a) (b) (acc 1) elk-3.99.8/examples/scheme/mondo.scm0000644000175000017500000000036011577076306014235 00000000000000;;; -*-Scheme-*- (let ((k (call-with-current-continuation (lambda (c) c)))) (display 1) (call-with-current-continuation (lambda (c) (k c))) (display 2) (call-with-current-continuation (lambda (c) (k c))) (display 3) (newline)) elk-3.99.8/examples/scheme/co.scm0000644000175000017500000000517511577076306013533 00000000000000;;; -*-Scheme-*- (require 'cscheme) (define (displayLine . someArgs) (for-each (lambda (aTerm) (display aTerm) (display " ")) someArgs) (newline)) (define (Monitor) (define stopAtMonitorLevel #f) (define clock 0) (define stopTime 0) (define processIndicators '()) (define (setInitialProcessState! aContinuation) (set! processIndicators (cons (list 0 aContinuation) processIndicators)) (stopAtMonitorLevel #f)) (define (startSimulation! aDuration) (set! stopTime aDuration) (if (not (null? processIndicators)) (let ((firstIndicatorOnList (car processIndicators))) (set! processIndicators (remove firstIndicatorOnList processIndicators)) (resumeSimulation! firstIndicatorOnList)) (displayLine "*** no active process recorded!"))) (define (resumeSimulation! aProcessState) (set! processIndicators (cons aProcessState processIndicators)) (let ((nextProcessState aProcessState)) (for-each (lambda (aStatePair) (if (< (car aStatePair) (car nextProcessState)) (set! nextProcessState aStatePair))) processIndicators) (let ((time (car nextProcessState)) (continuation (cadr nextProcessState))) (set! processIndicators (remove nextProcessState processIndicators)) (if (<= time stopTime) (begin (set! clock time) (continuation #f)) (begin (displayLine "*** simulation stops at:" clock) (stopAtMonitorLevel #f)))))) (define (dispatch aMessage . someArguments) (cond ((eq? aMessage 'initialize) (setInitialProcessState! (car someArguments))) ((eq? aMessage 'startSimulation) (startSimulation! (car someArguments))) ((eq? aMessage 'proceed) (resumeSimulation! (car someArguments))) ((eq? aMessage 'time) clock) ((eq? aMessage 'processIndicators) processIndicators) (else "Sorry, I don't know how to do this!"))) (call-with-current-continuation (lambda (anArg) (set! stopAtMonitorLevel anArg))) dispatch) (define (Tourist aName aMonitor) (call-with-current-continuation (lambda (anArg) (aMonitor 'initialize anArg))) (displayLine aName "starts at" (aMonitor 'time)) (while #t (displayLine aName "walks on at" (aMonitor 'time)) (call-with-current-continuation (lambda (anArg) (aMonitor 'proceed (list (+ (aMonitor 'time) 1) anArg)))) (displayLine aName "arrives at new attraction at" (aMonitor 'time)) (call-with-current-continuation (lambda (anArg) (aMonitor 'proceed (list (+ (aMonitor 'time) 2) anArg)))))) (define Gallery (Monitor)) (Tourist 'Jane Gallery) (Tourist 'Bruce Gallery) (Gallery 'startSimulation 5) elk-3.99.8/examples/scheme/acker.scm0000644000175000017500000000033511577076306014210 00000000000000;;; -*-Scheme-*- ;;; ;;; The Ackermann function (define (acker x y) (cond ((zero? x) (+ y 1)) ((zero? y) (acker (- x 1) 1)) (else (acker (- x 1) (acker x (- y 1)))))) (print (acker 3 2)) elk-3.99.8/examples/scheme/kons.scm0000644000175000017500000000034011577076306014071 00000000000000;;; -*-Scheme-*- (define (kons left right) (lambda (op) (case op (a left) (d right)))) (define (kar cell) (cell 'a)) (define (kdr cell) (cell 'd)) (let ((k (kons 1 2))) (print (cons (kar k) (kdr k)))) elk-3.99.8/examples/scheme/hanoi.scm0000644000175000017500000000061711577076306014224 00000000000000;;; -*-Scheme-*- ;;; ;;; Towers of Hanoi (define (hanoi n) (if (zero? n) (display "Huh?\n") (transfer 'A 'B 'C n))) (define (print-move from to) (format #t "Move disk from ~s to ~s~%" from to)) (define (transfer from to via n) (if (= n 1) (print-move from to) (transfer from via to (1- n)) (print-move from to) (transfer via to from (1- n)))) (hanoi 3) elk-3.99.8/examples/scheme/unify.scm0000644000175000017500000000250411577076306014255 00000000000000;;; -*-Scheme-*- ;;; ;;; From Kent Dybvig's book on Chez Scheme (define unify) (letrec ((occurs? (lambda (u v) (and (pair? v) (define (f l) (and (not (null? l)) (or (eq? u (car l)) (occurs? u (car l)) (f (cdr l))))) (f (cdr v))))) (sigma (lambda (u v s) (lambda (x) (define (f x) (if (symbol? x) (if (eq? x u) v x) (cons (car x) (map f (cdr x))))) (f (s x))))) (try-subst (lambda (u v s ks kf) (let ((u (s u))) (if (not (symbol? u)) (uni u v s ks kf) (let ((v (s v))) (cond ((eq? u v) (ks s)) ((occurs? u v) (kf "loop")) (else (ks (sigma u v s))))))))) (uni (lambda (u v s ks kf) (cond ((symbol? u) (try-subst u v s ks kf)) ((symbol? v) (try-subst v u s ks kf)) ((and (eq? (car u) (car v)) (= (length u) (length v))) (define (f u v s) (if (null? u) (ks s) (uni (car u) (car v) s (lambda (s) (f (cdr u) (cdr v) s)) kf))) (f (cdr u) (cdr v) s)) (else (kf "clash")))))) (set! unify (lambda (u v) (uni u v (lambda (x) x) (lambda (s) (s u)) (lambda (msg) msg))))) (print (unify 'x 'y)) (print (unify '(f x y) '(g x y))) (print (unify '(f x (h)) '(f (h) y))) (print (unify '(f (g x) y) '(f y x))) (print (unify '(f (g x) y) '(f y (g x)))) elk-3.99.8/examples/scheme/Y.scm0000644000175000017500000001354111577076306013336 00000000000000; Date: 15 Nov 88 23:03:24 GMT ; From: uoregon!markv@beaver.cs.washington.edu (Mark VandeWettering) ; Organization: University of Oregon, Computer Science, Eugene OR ; Subject: The Paradoxical Combinator -- Y (LONG) ; ; Alternatively entitled: ; "Y? Why Not?" :-) ; ; The discussion that has been going on in regards to the Y combinator as ; the basic operation in implementing recursive functions are interesting. ; The practical tests that people have made have shown that the Y ; combinator is orders of magnitude slower for implementing recursion than ; directly compiling it. ; ; This is true for Scheme. I hold that for an interesting set of ; languages, (lazy languages) that this result will not necessarily hold. ; ; The problem with Y isn't its complexity, it is the fact that it is an ; inherently lazy operation. Any implementation in Scheme is clouded by ; the fact that Scheme is an applicative order evaluator, while Y prefers ; to be evaluated in normal order. ; ; (define Y (lambda (g) ((lambda (h) (g (lambda (x) ((h h) x)))) (lambda (h) (g (lambda (x) ((h h) x))))))) ; (define fact (lambda (f) (lambda (n) (if (= n 1) 1 (* n (f (- n 1))))))) ; ; ; Evaluating (Y fact) 2 results in the following operations in ; Scheme: ; ; The argument is (trivially) evaluated, and returns two. ; (Y fact) must be evaluated. What is it? Y and fact each evaluate ; to closures. When applied, Y binds g to fact, and executes the ; body. ; ; The body is an application of a closure to another closure. The ; operator binds h to the operand, and executes its body which.... ; ; Evaluates (g (lambda (x) ((h h) x))). The operand is a closure, ; which gets built and then returns. g evaluates to fact. We ; substitute the closure (lambda (x) ((h h) x)) in for the function ; f in the definition of fact, giving... ; ; (lambda (n) ; (if (= n 1) ; 1 ; (* n ((lambda (x) ((h h) x)) (- n 1))))) ; ; Which we return as the value of (Y fact). When we apply this to 2, we get ; ; (* 2 ((lambda (x) ((h h) x)) 1)) ; ; We then have to evaluate ; ((lambda (x) ((h h) x)) 1) ; ; or ; ((h h) 1) ; ; But remembering that h was (lambda (h) (g (lambda (x) ((h h) x)))), ; we have ; ; (((lambda (h) (g (lambda (x) ((h h) x)))) ; (lambda (h) (g (lambda (x) ((h h) x))))) ; 1) .... ; ; So, we rebind h to be the right stuff, and evaluate the body, which is ; ; ((g (lambda (x) ((h h) x))) 1) ; ; Which by the definition of g (still == fact) is just 1. ; ; (* 2 1) = 2. ; ; ######################################################################## ; ; Summary: If you didn't follow this, performing this evaluation ; was cumbersome at best. As far as compiler or interpreter is ; concerned, the high cost of evaluating this function is related ; to two different aspects: ; ; It is necessary to create "suspended" values. These suspended ; values are represented as closures, which are in general heap ; allocated and expensive. ; ; For every level of recursion, new closures are created (h gets ; rebound above). While this could probably be optimized out by a ; smart compiler, it does seem like the representation of suspended ; evaluation by lambdas is inefficient. ; ; ; ######################################################################## ; ; You can try to figure out how all this works. It is complicated, I ; believe I understand it. The point in the derivation above is that in ; Scheme, to understand how the implementation of Y works, you have to ; fall back on the evaluation mechanism of Scheme. Suspended values must ; be represented as closures. It is the creation of these closures that ; cause the Scheme implementation to be slow. ; ; If one wishes to abandon Scheme (or at least applicative order ; evaluators of Scheme) one can typically do much better. My thesis work ; is in graph reduction, and trying to understand better the issues having ; to do with implementation. ; ; In graph reduction, all data items (evaluated and unevaluated) have the ; same representation: as graphs in the heap. We choose to evaluate using ; an outermost, leftmost strategy. This allows the natural definition of ; (Y h) = (h (Y h)) to be used. An application node of the form: ; ; @ ; / \ ; / \ ; Y h ; ; can be constructed in the obvious way: ; @ ; / \ ; / \ ; h @ ; / \ ; / \ ; Y h ; ; costing one heap allocation per level of recursion, which is ; certainly cheaper than the multiple allocations of scheme ; closures above. More efficiently, we might choose to implement ; it using a "knot tying" version: ; ; ; /\ ; / \ ; @ | ; / \ / ; / \/ ; h ; ; Which also works quite well. Y has been eliminated, and will ; cause no more reductions. ; ; The basic idea is somehow that recursion in functional languages ; is analogous to cycles in the graph in a graph reduction engine. ; Therefore, the Y combinator is a specific "textual" indicator of ; the graph. ; ; The G-machine (excellently described in Peyton Jones' book "The ; Implementation of Functional Programming Languages") also ; described the Y combinator as being efficient. He chose letrecs ; as being a primitive in the extended lambda calculus. His ; methodology behind compiling these recursive definitions was ; basically to compile fixed code which directly built these cyclic ; structures, rather than having them built at runtime. ; ; I think (and my thesis work is evolving into this kind of ; argument) that Y is overlooked for trivial reasons. Partial ; evaluation and smarter code generation could make an SK based ; compiler generate code which is equal in quality to that produced ; by supercombinator based compilation. ; ; ; This is too long already, ciao for now. ; ; Mark VandeWettering (print ((Y fact) 10)) elk-3.99.8/examples/scheme/prim.scm0000644000175000017500000000034611577076306014074 00000000000000;;; -*-Scheme-*- (define (p n) (let f ((n n) (i 2)) (cond ((> i n) '()) ((integer? (/ n i)) (cons i (f (/ n i) i))) (else (f n (+ i 1)))))) (print (p 12)) (print (p 3628800)) (print (p 4194304)) elk-3.99.8/examples/scheme/billiard.scm0000644000175000017500000013205511577076306014712 00000000000000;;; BILLIARD.SCM: This file contains code for a very simple billiard ball ;;; simulator. The simulation takes place in two dimensions. ;;; The balls are really disks in that their height is not taken ;;; into account. All interactions are assumed to be ;;; frictionless so spin in irrelevant and not accounted for. ;;; (See section on limitations.) ;;; ;;; NOTES: A simulation is initiated by creating a number of balls and bumpers ;;; and and specifying a duration for the simulation. For each ball, ;;; its mass, radius, initial position, and initial velocity must be ;;; specified. For each bumper, the location of its two ends must be ;;; specified. (Bumpers are assumed to have zero width.) ;;; ;;; A sample run might be started as follows: ;;; (simulate ;;; (list (make-ball 2 1 9 5 -1 -1) ;;; (make-ball 4 2 2 5 1 -1)) ;;; (list (make-bumper 0 0 0 10) ;;; (make-bumper 0 0 10 0) ;;; (make-bumper 0 10 10 10) ;;; (make-bumper 10 0 10 10)) ;;; 30) ;;; ;;; It would create one billiard ball of mass 2 and radius 1 at position ;;; (9, 5) with initial velocity (-1, -1) and a second ball of mass 4 ;;; and radius 2 at position (2, 5) with initial velocity (1, -1). The ;;; table would be a 10X10 square. (See diagram below) ;;; ;;; +---------------------------+ ;;; | | ;;; | | ;;; | XXXX | ;;; | XXXXXXXX XX | ;;; |XXXXXX4XXXXX XXX2XX| ;;; | XXXXXXXX /XX | ;;; | XXXX \ | ;;; | | ;;; | | ;;; +---------------------------+ ;;; ;;; LIMITATIONS: This simulator does not handle 3 body problems correctly. If ;;; 3 objects interact at one time, only the interactions of 2 of ;;; the bodies will be accounted for. This can lead to strange ;;; effects like balls tunneling through walls and other balls. ;;; It is also possible to get balls bouncing inside of each ;;; other in this way. ;;; ;;MAKE-QUEUE-RECORD returns a queue record with the given next, previous, and ;;value values ;;NEXT = The next record pointer ;;PREV = The previous record pointer ;;REST = A list of values for any optional fields (this can be used for ;; creating structure inheritance) (define-macro (make-queue-record next prev . rest) `(vector ,next ,prev ,@rest)) ;;QUEUE-RECORD-NEXT returns the next field of the given queue record ;;QUEUE-RECORD = The queue record whose next field is to be returned (define-macro (queue-record-next queue-record) `(vector-ref ,queue-record 0)) ;;SET-QUEUE-RECORD-NEXT! sets the next field of the given queue record ;;QUEUE-RECORD = The queue record whose next field is to be set ;;VALUE = The value to which the next field is to be set (define-macro (set-queue-record-next! queue-record value) `(vector-set! ,queue-record 0 ,value)) ;;QUEUE-RECORD-PREV returns the prev field of the given queue record ;;QUEUE-RECORD = The queue record whose prev field is to be returned (define-macro (queue-record-prev queue-record) `(vector-ref ,queue-record 1)) ;;SET-QUEUE-RECORD-PREV! sets the prev field of the given queue record ;;QUEUE-RECORD = The queue record whose prev field is to be set ;;VALUE = The value to which the prev field is to be set (define-macro (set-queue-record-prev! queue-record value) `(vector-set! ,queue-record 1 ,value)) ;;QUEUE-RECORD-LEN returns the length of a queue record which has no optional ;;fields (define-macro (queue-record-len) 2) ;;QUEUE-HEAD returns a dummy record at the end of the queue with the record ;;with the smallest key. ;;QUEUE = the queue whose head record is to be returned (define-macro (queue-head queue) `(vector-ref ,queue 0)) ;;QUEUE-TAIL returns a dummy record at the end of the queue with the record ;;with the largest key. ;;QUEUE = the queue whose tail record is to be returned (define-macro (queue-tail queue) `(vector-ref ,queue 1)) ;;QUEUE- dot-product bumper-length-squared)) '() ;Return infinity (+ delta-t ;Else, return the contact time (ball-collision-time ball)))))))))))) ;;BALL-COLLISION-PROCEDURE calculates the new velocities of the given balls ;;based on their collision at the given time. Also, tells all other balls ;;about the new trajectories of these balls so they can update their event ;;queues ;;BALL1 = The first ball ;;BALL2 = The second ball ;;COLLISION-TIME = The collision time ;;GLOBAL-EVENT-QUEUE = The global queue of earliest events for each ball (define (ball-collision-procedure ball1 ball2 collision-time global-event-queue) (queue-remove ;Remove the earliest event associated (ball-global-event-queue-record ;with each ball from the global event ball1)) ;queue (queue-remove (ball-global-event-queue-record ball2)) (let ((ball1-collision-x-position ;Calculate the positions of both balls (+ (ball-collision-x-position ;when they collide ball1) (* (ball-x-velocity ball1) (- collision-time (ball-collision-time ball1))))) (ball1-collision-y-position (+ (ball-collision-y-position ball1) (* (ball-y-velocity ball1) (- collision-time (ball-collision-time ball1))))) (ball2-collision-x-position (+ (ball-collision-x-position ball2) (* (ball-x-velocity ball2) (- collision-time (ball-collision-time ball2))))) (ball2-collision-y-position (+ (ball-collision-y-position ball2) (* (ball-y-velocity ball2) (- collision-time (ball-collision-time ball2)))))) (let ((delta-x ;Calculate the displacements of the (- ball2-collision-x-position ;centers of the two balls ball1-collision-x-position)) (delta-y (- ball2-collision-y-position ball1-collision-y-position))) (let* ((denominator ;Calculate the angle of the line (sqrt (+ (square ;joining the centers at the collision delta-x) ;time with the x-axis (this line is (square ;the normal to the balls at the delta-y)))) ;collision point) (cos-theta (/ delta-x denominator)) (sin-theta (/ delta-y denominator))) (let ((ball1-old-normal-velocity ;Convert the velocities of the balls (+ (* (ball-x-velocity ;into the coordinate system defined by ball1) ;the normal and tangential lines at cos-theta) ;the collision point (* (ball-y-velocity ball1) sin-theta))) (ball1-tang-velocity (- (* (ball-y-velocity ball1) cos-theta) (* (ball-x-velocity ball1) sin-theta))) (ball2-old-normal-velocity (+ (* (ball-x-velocity ball2) cos-theta) (* (ball-y-velocity ball2) sin-theta))) (ball2-tang-velocity (- (* (ball-y-velocity ball2) cos-theta) (* (ball-x-velocity ball2) sin-theta))) (mass1 (ball-mass ball1)) (mass2 (ball-mass ball2))) (let ((ball1-new-normal-velocity ;Calculate the new velocities (/ ;following the collision (the (+ ;tangential velocities are unchanged (* ;because the balls are assumed to be (* 2 ;frictionless) mass2) ball2-old-normal-velocity) (* (- mass1 mass2) ball1-old-normal-velocity)) (+ mass1 mass2))) (ball2-new-normal-velocity (/ (+ (* (* 2 mass1) ball1-old-normal-velocity) (* (- mass2 mass1) ball2-old-normal-velocity)) (+ mass1 mass2)))) (set-ball-x-velocity! ;Store data about the collision in the ball1 ;structure for each ball after (- (* ball1-new-normal-velocity ;converting the information back cos-theta) ;to the x,y frame (* ball1-tang-velocity sin-theta))) (set-ball-y-velocity! ball1 (+ (* ball1-new-normal-velocity sin-theta) (* ball1-tang-velocity cos-theta))) (set-ball-x-velocity! ball2 (- (* ball2-new-normal-velocity cos-theta) (* ball2-tang-velocity sin-theta))) (set-ball-y-velocity! ball2 (+ (* ball2-new-normal-velocity sin-theta) (* ball2-tang-velocity cos-theta))) (set-ball-collision-time! ball1 collision-time) (set-ball-collision-time! ball2 collision-time) (set-ball-collision-x-position! ball1 ball1-collision-x-position) (set-ball-collision-y-position! ball1 ball1-collision-y-position) (set-ball-collision-x-position! ball2 ball2-collision-x-position) (set-ball-collision-y-position! ball2 ball2-collision-y-position)))))) (newline) (display "Ball ") (display (ball-number ball1)) (display " collides with ball ") (display (ball-number ball2)) (display " at time ") (display (ball-collision-time ball1)) (newline) (display " Ball ") (display (ball-number ball1)) (display " has a new velocity of ") (display (ball-x-velocity ball1)) (display ",") (display (ball-y-velocity ball1)) (display " starting at ") (display (ball-collision-x-position ball1)) (display ",") (display (ball-collision-y-position ball1)) (newline) (display " Ball ") (display (ball-number ball2)) (display " has a new velocity of ") (display (ball-x-velocity ball2)) (display ",") (display (ball-y-velocity ball2)) (display " starting at ") (display (ball-collision-x-position ball2)) (display ",") (display (ball-collision-y-position ball2)) (recalculate-collisions ball1 global-event-queue) (recalculate-collisions ball2 global-event-queue)) ;;BUMPER-COLLISION-PROCEDURE calculates the new velocity of the given ball ;;following its collision with the given bumper at the given time. Also, tells ;;other balls about the new trajectory of the given ball so they can update ;;their event queues. ;;BALL = The ball ;;BUMPER = The bumper ;;COLLISION-TIME = The collision time ;;GLOBAL-EVENT-QUEUE = The global queue of earliest events for each ball (define (bumper-collision-procedure ball bumper collision-time global-event-queue) (queue-remove ;Remove the earliest event associated (ball-global-event-queue-record ;with the ball from the global event ball)) ;queue (let ((delta-x-bumper ;Compute the bumper's delta-x (- (bumper-x2 bumper) (bumper-x1 bumper))) (delta-y-bumper ;delta-y (- (bumper-y2 bumper) (bumper-y1 bumper)))) (let ((bumper-length ;length (sqrt (+ (square delta-x-bumper) (square delta-y-bumper))))) (let ((cos-theta ;and cosine and sine of its angle with (/ delta-x-bumper ;respect to the positive x-axis bumper-length)) (sin-theta (/ delta-y-bumper bumper-length)) (x-velocity ;Cache the ball's velocity in the x,y (ball-x-velocity ball)) ;frame (y-velocity (ball-y-velocity ball))) (let ((tang-velocity ;Calculate the ball's velocity in the (+ (* x-velocity ;bumper frame cos-theta) (* y-velocity sin-theta))) (normal-velocity (- (* y-velocity cos-theta) (* x-velocity sin-theta)))) (set-ball-collision-x-position! ;Store the collision position ball (+ (ball-collision-x-position ball) (* (- collision-time (ball-collision-time ball)) (ball-x-velocity ball)))) (set-ball-collision-y-position! ball (+ (ball-collision-y-position ball) (* (- collision-time (ball-collision-time ball)) (ball-y-velocity ball)))) (set-ball-x-velocity! ;Calculate the new velocity in the ball ;x,y frame based on the fact that (+ (* tang-velocity ;tangential velocity is unchanged and cos-theta) ;the normal velocity is inverted when (* normal-velocity ;the ball collides with the bumper sin-theta))) (set-ball-y-velocity! ball (- (* tang-velocity sin-theta) (* normal-velocity cos-theta))) (set-ball-collision-time! ball collision-time))))) (newline) (display "Ball ") (display (ball-number ball)) (display " collides with bumper ") (display (bumper-number bumper)) (display " at time ") (display (ball-collision-time ball)) (newline) (display " Ball ") (display (ball-number ball)) (display " has a new velocity of ") (display (ball-x-velocity ball)) (display ",") (display (ball-y-velocity ball)) (display " starting at ") (display (ball-collision-x-position ball)) (display ",") (display (ball-collision-y-position ball)) (recalculate-collisions ball global-event-queue)) ;;RECALCULATE-COLLISIONS removes all old collisions for the given ball from ;;all other balls' event queues and calcultes new collisions for these balls ;;and places them on the event queues. Also, updates the global event queue if ;;the recalculation of the collision effects the earliest collision for any ;;other balls. ;;BALL = The ball whose collisions are being recalculated ;;GLOBAL-EVENT-QUEUE = The global queue of earliest events for each ball (define (recalculate-collisions ball global-event-queue) (clear-queue (ball-event-queue ;Clear the queue of events for this ball)) ;ball as they have all changed (let ((event-queue ;Calculate all ball collision events (ball-event-queue ball))) ;with balls of lower number (let ((ball-vector (ball-ball-vector ball))) (do ((i (-1+ (ball-number ball)) (-1+ i))) ((negative? i)) (let ((ball2-queue-record (vector-ref ball-vector i))) (set-event-queue-record-collision-time! ball2-queue-record (ball-ball-collision-time ball (event-queue-record-object ball2-queue-record))) (queue-insert event-queue ball2-queue-record)))) (let ((bumper-vector ;Calculate all bumper collision events (ball-bumper-vector ball))) (do ((i (-1+ (vector-length bumper-vector)) (-1+ i))) ((negative? i)) (let ((bumper-queue-record (vector-ref bumper-vector i))) (set-event-queue-record-collision-time! bumper-queue-record (ball-bumper-collision-time ball (event-queue-record-object bumper-queue-record))) (queue-insert event-queue bumper-queue-record)))) (let ((global-queue-record ;Get the global event queue record (ball-global-event-queue-record ;for this ball ball))) (set-event-queue-record-collision-time! ;Set the new earliest event time global-queue-record ;for this ball (if (empty-queue? event-queue) '() (event-queue-record-collision-time (queue-smallest event-queue)))) (queue-insert ;Enqueue on the global event queue global-event-queue ;the earliest event between this ball global-queue-record))) ;and any ball of lower number or any ;bumper (for-each ;For each ball on the ball list: (lambda (ball2) (let ((ball2-event-queue (ball-event-queue ball2))) (let ((alter-global-event-queue? ;Set flag to update global event queue (and ;if the earliest event for ball2 was (not (empty-queue? ;with the deflected ball ball2-event-queue)) (eq? ball (event-queue-record-object (queue-smallest ball2-event-queue))))) (ball-event-queue-record ;Get the queue record for the deflected (vector-ref ;ball for this ball (ball-ball-vector ball2) (ball-number ball)))) (queue-remove ;Remove the queue record for the ball-event-queue-record) ;deflected ball (set-event-queue-record-collision-time! ;Recalculate the collision ball-event-queue-record ;time for this ball and the deflected (ball-ball-collision-time ;ball ball ball2)) (queue-insert ;Enqueue the new collision event ball2-event-queue ball-event-queue-record) (if (or alter-global-event-queue? ;If the earliest collision event for (eq? ball ;this ball has changed: (event-queue-record-object (queue-smallest ball2-event-queue)))) (let ((queue-record ;Remove the old event from the global (ball-global-event-queue-record ;event queue and replace it ball2))) ;with the new event (set-event-queue-record-collision-time! queue-record (event-queue-record-collision-time (queue-smallest ball2-event-queue))) (queue-remove queue-record) (queue-insert global-event-queue queue-record)))))) (ball-ball-list ball))) ;;SIMULATE performs the billiard ball simulation for the given ball list and ;;bumper list until the specified time. ;;BALL-LIST = A list of balls ;;BUMPER-LIST = A list of bumpers ;;END-TIME = The time at which the simulation is to terminate (define (simulate ball-list bumper-list end-time) (let ((num-of-balls ;Cache the number of balls and bumpers (length ball-list)) (num-of-bumpers (length bumper-list)) (global-event-queue ;Build the global event queue (make-sorted-queue collision-time-symbol (string-append "dialog-" type))))) (unless (car (get-values ok 'set)) (unmanage-child (name->widget box 'OK))) (unless (car (get-values cancel 'set)) (unmanage-child (name->widget box 'Cancel))) (unless (car (get-values help 'set)) (unmanage-child (name->widget box 'Help))) (manage-child box))) (realize-widget top) (context-main-loop (widget-context top)) elk-3.99.8/examples/motif/popup-menu.scm0000644000175000017500000000141511577076306015102 00000000000000;;; -*-Scheme-*- ;;; ;;; Popup menu demo (require 'motif) (load 'menu-stuff.scm) (define top (application-initialize 'popup)) (define w (create-managed-widget (find-class 'drawing-area) top)) (set-values! w 'width 350 'height 100) (define menu (create-popup-menu w 'which-button 1)) (menu-add-label! menu 'label-string "Popup menu" 'font-list "9x15") (menu-add-separator! menu) (menu-add-button! menu 'label-string "item 1") (menu-add-button! menu 'label-string "item 2") (menu-add-button! menu 'label-string "item 3") (menu-add-separator! menu) (define quit-button (menu-add-button! menu 'label-string "quit")) (add-callback quit-button 'activate-callback (lambda args (exit))) (popup-menu-attach-to! menu w) (realize-widget top) (context-main-loop (widget-context top)) elk-3.99.8/examples/motif/menu-stuff.scm0000644000175000017500000000304211577076306015064 00000000000000;;; -*-Scheme-*- ;;; ;;; Auxiliary definitions for the menu demos (define (create-menu-bar parent) (create-managed-widget (find-class 'row-column) parent 'row-column-type 'menu-bar)) (define (create-menu type parent args) (define grand-parent (widget-parent parent)) (if (and (not (eq? grand-parent 'none)) (eq? (widget-class grand-parent) (find-class 'menu-shell))) (set! parent grand-parent)) (let ((shell (create-popup-shell (find-class 'menu-shell) parent 'width 100 'height 100))) (apply create-widget (find-class 'row-column) shell 'row-column-type type args))) (define (create-popup-menu parent . args) (create-menu 'menu-popup parent args)) (define (create-pulldown-menu parent . args) (create-menu 'menu-pulldown parent args)) (define (create-option-menu parent . args) (apply create-managed-widget (find-class 'row-column) parent 'row-column-type 'menu-option args)) (define (create-cascade-pulldown parent pulldown . args) (let ((button (create-managed-widget (find-class 'cascade-button) parent))) (set-values! button 'sub-menu-id pulldown) (apply set-values! button args) button)) (define (menu-add-item! type menu args) (let ((item (create-managed-widget (find-class type) menu))) (apply set-values! item args) item)) (define (menu-add-label! menu . args) (menu-add-item! 'label menu args)) (define (menu-add-separator! menu . args) (menu-add-item! 'separator menu args)) (define (menu-add-button! menu . args) (menu-add-item! 'push-button menu args)) elk-3.99.8/examples/motif/option-menu.scm0000644000175000017500000000203711577076306015250 00000000000000;;; -*-Scheme-*- ;;; ;;; Option menu demo (require 'motif) (load 'menu-stuff.scm) (define top (application-initialize 'option)) (define rc (create-managed-widget (find-class 'row-column) top)) (set-values! rc 'orientation "horizontal") (define menu-1 (create-pulldown-menu rc)) (define b1 (menu-add-button! menu-1 'label-string "Option 1")) (define b2 (menu-add-button! menu-1 'label-string "Option 2")) (define b3 (menu-add-button! menu-1 'label-string "Option 3")) (define b4 (menu-add-button! menu-1 'label-string "Option 4")) (define menu-2 (create-pulldown-menu rc)) (define ba (menu-add-button! menu-2 'label-string "Option A")) (define bb (menu-add-button! menu-2 'label-string "Option B")) (define bc (menu-add-button! menu-2 'label-string "Option C")) (create-option-menu rc 'sub-menu-id menu-1 'menu-history b3 'label-string "first option" 'mnemonic #\f) (create-option-menu rc 'sub-menu-id menu-2 'menu-history ba 'label-string "second option" 'mnemonic #\s) (realize-widget top) (context-main-loop (widget-context top)) elk-3.99.8/examples/motif/radio.scm0000644000175000017500000000333711577076306014100 00000000000000;;; -*-Scheme-*- ;;; ;;; Radio box and button demo (require 'motif) (load 'radio-stuff.scm) (define top (application-initialize 'radio)) (define rc (create-managed-widget (find-class 'row-column) top)) ;;; Create a button box containing arrow buttons; add callbacks ;;; to each button: (define box1 (create-radio-box 'arrow-button rc)) (define buttons1 (map (lambda (dir) (radio-box-add-button! box1 'width 50 'height 30 'arrow-direction dir)) '(arrow_up arrow_down arrow_left arrow_right))) (for-each (lambda (w) (for-each (lambda (cb) (add-callback w cb (lambda (w r) (print (list w (car r)))))) '(activate-callback arm-callback disarm-callback))) buttons1) ;;; Create a button box containing push buttons; define an ;;; entry callback: (define box2 (create-radio-box 'push-button rc)) (add-callback box2 'entry-callback (lambda (w args) (print (car (get-values (caddr args) 'label-string))))) (define buttons2 (map (lambda (label) (radio-box-add-button! box2 'label-string label 'alignment "alignment_center")) '(Play Stop Record Rewind Forward))) ;;; Create a button box containing toggle buttons; add a callback ;;; to each button: (define box3 (create-radio-box 'toggle-button rc)) (define buttons3 (map (lambda (label) (radio-box-add-button! box3 'label-string label)) '(KMQX WMQY WHFX KWIT))) (for-each (lambda (w) (add-callback w 'value-changed-callback (lambda r (let ((station (car (get-values w 'label-string))) (set? (car (get-values w 'set)))) (print (list station set?)) (if (and (string=? station "KWIT") set?) (exit)))))) buttons3) (realize-widget top) (context-main-loop (widget-context top)) elk-3.99.8/examples/motif/radio-stuff.scm0000644000175000017500000000114111577076306015214 00000000000000;;; -*-Scheme-*- ;;; ;;; Auxiliary definitions for button boxes (define (create-radio-box type parent . args) (let ((box (create-managed-widget (find-class 'row-column) parent))) (set-values! box 'packing "pack_column" 'orientation "horizontal" 'is-homogeneous #t 'entry-class (find-class type) 'radio-behavior #t 'radio-always-one #t) (if args (apply set-values! box args)) box)) (define (radio-box-add-button! box . args) (let* ((type (car (get-values box 'entry-class))) (button (create-managed-widget type box))) (if args (apply set-values! button args)) button)) elk-3.99.8/examples/c++/0000755000175000017500000000000011577110020011560 500000000000000elk-3.99.8/examples/c++/constructor.cpp0000644000175000017500000000372011577076306014615 00000000000000/*---------------------------------------------------------------------- This simple C++ program demonstrates that static constructors (destructors) are invoked by Elk when loading a compiled C++ file (when exiting). o Compile the shared object, for instance: CC -pic -shared constructor.cpp -o constructor.so -lelk or: g++ -fPIC -shared constructor.ppc -o constructor.so -lelk o Now "(load 'constructor.so)", observe the "invoking constructor" message, and evaluate "(test)", which should return 3. Terminate the interpreter and observe the "invoking destructor" message. o If you get a message from the linker complaining about `Text relocation remains against symbol _GLOBAL_.D.P_Test__Fv', you have probably run into a known bug in g++ on ELF-based systems (such as Solaris 2.x). In this case you have to link your C++ extensions with Elk statically or use a different C++ compiler. o If static constructors don't get called when loading compiled C++ files, your C++ compiler is probably using a naming convention for static constructors and destructors that is not anticipated by the current version of Elk. In this case, you may want to find out what kind of names are used (by applying "nm" to an object file) and add the name prefixes to the Init_Prefixes and Finit_Prefixes lists in src/stab.c in the Elk source tree. Then recompile Elk. Send me mail. ----------------------------------------------------------------------*/ #include #include class C { public: int i; C() { std::cerr << "[invoking constructor]" << std::endl; i = 3; } ~C() { std::cerr << "[invoking destructor]" << std::endl; } }; C c; Object P_Test() { return Make_Integer(c.i); } extern "C" void elk_init_constructor() { Define_Primitive((Object (*)(...))P_Test, "test", 0, 0, EVAL); } extern "C" void elk_finit_constructor() { std::cerr << "Goodbye." << std::endl; } elk-3.99.8/examples/c++/class.cpp0000644000175000017500000000412711577076306013337 00000000000000/*----------------------------------------------------------------------------- This trivial Elk extension demonstrates encapsulation of a C++ class in a first-class Scheme type, and encapsulation of member functions in Scheme primitives. See constructor.cpp in this directory for compilation instructions. Here is a transcript showing a test run under Linux using the GNU g++ compiler: % g++ -shared -fPIC class.cpp -o class.so -lelk % % scheme > (load 'class.so) > (define x (make-foo)) x > (read-val x) 1234 > (write-val! x 11) > (read-val x) 11 > (exit) % -----------------------------------------------------------------------------*/ class foo { int val; public: int read_val(void); void write_val(int); foo() { val = 1234; }; }; int foo::read_val(void) { return val; } void foo::write_val(int newval) { val = newval; } /* ---------------------------------- */ #include struct S_Foo { Object tag; class foo foo; }; int T_Foo; #define FOO(x) ((struct S_Foo *)POINTER(x)) Object P_Make_Foo(void) { Object f = Alloc_Object(sizeof (struct S_Foo), T_Foo, 0); FOO(f)->foo.write_val(1234); /* FOO(f)->foo.foo() is not allowed?! */ return f; } Object P_Read_Val(Object x) { Check_Type(x, T_Foo); return Make_Integer(FOO(x)->foo.read_val()); } Object P_Write_Val(Object x, Object y) { Check_Type(x, T_Foo); FOO(x)->foo.write_val(Get_Integer(y)); return Void; } int Foo_Print(Object h, Object port, int raw, int depth, int length) { Printf(port, "#[foo %d]", FOO(h)->foo.read_val()); return 0; } int Foo_Equal(Object x, Object y) { return FOO(x)->foo.read_val() == FOO(y)->foo.read_val(); } extern "C" void elk_init_foo() { T_Foo = Define_Type(0, "foo", NOFUNC, sizeof(struct S_Foo), Foo_Equal, Foo_Equal, Foo_Print, NOFUNC); Define_Primitive((Object(*)(...))P_Make_Foo, "make-foo", 0, 0, EVAL); Define_Primitive((Object(*)(...))P_Read_Val, "read-val", 1, 1, EVAL); Define_Primitive((Object(*)(...))P_Write_Val, "write-val!", 2, 2, EVAL); } elk-3.99.8/examples/regexp/0000755000175000017500000000000011577110020012502 500000000000000elk-3.99.8/examples/regexp/match.scm0000644000175000017500000000140611577076306014245 00000000000000;;; -*-Scheme-*- ;;; ;;; Demonstrate the regular expression primitives. (require 'regexp) ;; Returns a list of substrings of string `str' that match the ;; pattern `pat' (define (matches str pat) (let loop ((r (make-regexp pat '(extended))) (result '()) (from 0)) (let ((m (regexp-exec r str from))) (if (regexp-match? m) (loop r (cons (substring str (+ from (regexp-match-start m 0)) (+ from (regexp-match-end m 0))) result) (+ from (regexp-match-end m 0))) (reverse result))))) (cond ((feature? ':regular-expressions) (print (matches "Hello, world!" "[a-zA-z]+")) (print (matches "Hello, world!" "."))) (else (format #t "Regular expressions not supported by ~a-~a~%" site-machine site-os))) elk-3.99.8/examples/unix/0000755000175000017500000000000011577110020012173 500000000000000elk-3.99.8/examples/unix/pipsiz.scm0000644000175000017500000000153111577076306014157 00000000000000;;; -*-Scheme-*- ;;; ;;; Demonstrate non-blocking I/O ;;; ;;; (pipe-size) -- Calculate capacity of pipe. (require 'unix) (define (pipe-size) (let* ((pipe (unix-pipe)) (flags (unix-filedescriptor-flags (cdr pipe))) (len 32) ; assumes capacity is multiple of len (noise (make-string len)) (flag (if (memq 'nonblock (unix-list-filedescriptor-flags)) 'nonblock 'ndelay))) ;; enable non-blocking I/O for write end of pipe: (unix-filedescriptor-flags (cdr pipe) (cons flag flags)) (unwind-protect (let loop ((size 0)) (if (unix-error? (unix-errval (unix-write (cdr pipe) noise))) (if (memq (unix-errno) '(eagain ewouldblock edeadlk)) size (error 'pipe-size "~E")) (loop (+ size 32)))) (unix-close (car pipe)) (unix-close (cdr pipe))))) (print (pipe-size)) elk-3.99.8/examples/unix/lock.scm0000644000175000017500000000124111577076306013567 00000000000000;;; -*-Scheme-*- ;;; ;;; Demonstrate locking ;;; ;;; (lock-vi file) -- Starts vi on file, providing exclusive access. (require 'unix) (define (lock-vi file) (let* ((fd (unix-open file '(read write))) (lock ((record-constructor lock-record) #t 'set 0 0))) ;; attempt to apply lock to file; print a message and go ;; to sleep if lock is held by somebody else: (let loop () (if (not (unix-set-lock fd lock #f)) (begin (format #t "Someone else is editing ~s...~%" file) (unix-sleep 10) (loop)))) ;; invoke vi; remove lock when done: (unix-system (format #f "vi ~a" file)) (unix-remove-lock fd lock))) elk-3.99.8/examples/unix/ls.scm0000644000175000017500000000463111577076306013263 00000000000000(require 'unix) ;; Map file type to letter (define type-char-map '((regular . #\-) (directory . #\d) (symlink . #\l) (socket . #\=) (fifo . #\p) (character-special . #\c) (block-special . #\b) (unknown . #\?))) ;; Map file mode to /bin/ls-style mode string without/with taking ;; setuid/setgid bit into account (define perm-tab '#("---" "--x" "-w-" "-wx" "r--" "r-x" "rw-" "rwx")) (define perm-tab1 '#("--S" "--s" "-wS" "-ws" "r-S" "r-s" "rwS" "rws")) ;; Right justify string within field of `n' spaces (define (rjust str n) (let* ((y (string-append (make-string n #\space) str)) (l (string-length y))) (substring y (- l n) l))) ;; Left justify string within field of `n' spaces (define (ljust str n) (let* ((y (string-append str (make-string n #\space))) (l (string-length y))) (substring y 0 n))) (define (print-type type) (display (cdr (assq type type-char-map)))) (define (print-perm perm setid?) (let ((bits (vector-ref (if setid? perm-tab1 perm-tab) perm))) (display bits))) ;; This could probably be made more efficient by using Elk's bitstring ;; extension (define (print-mode mode) (let ((owner 0) (group 0) (world (modulo mode 8))) (set! mode (quotient mode 8)) (set! group (modulo mode 8)) (set! mode (quotient mode 8)) (set! owner (modulo mode 8)) (set! mode (quotient mode 8)) (print-perm owner (>= mode 4)) (print-perm group (odd? (quotient mode 2))) (print-perm world #f))) (define (print-nlink nlink) (display (rjust (number->string nlink) 3)) (display #\space)) (define (print-owner uid) (display (ljust (passwd-name (unix-get-passwd uid)) 8))) (define (print-size size) (display (rjust (number->string size) 9))) (define (print-mtime mtime) (display (substring (unix-time->string mtime) 3 16)) (display #\space)) (define (print-name name) (display name)) (define (print-link name) (display " -> ") (display (unix-readlink name))) (define (list-entry name) (if (not (char=? (string-ref name 0) #\.)) (let ((s (unix-lstat name))) (print-type (stat-type s)) (print-mode (stat-mode s)) (print-nlink (stat-nlink s)) (print-owner (stat-uid s)) (print-size (stat-size s)) (print-mtime (stat-mtime s)) (print-name name) (if (eq? (stat-type s) 'symlink) (print-link name)) (newline)))) (define (ls) (for-each list-entry (unix-read-directory "."))) (ls) elk-3.99.8/examples/unix/copy.scm0000644000175000017500000000330711577076306013616 00000000000000;;; -*-Scheme-*- ;;; ;;; Demonstrate open, stat, read, write. (require 'unix) (define copy-buffer-size 8192) (define (copy-file from to) (let ((from-stat (unix-stat from)) (to-stat (unix-errval (unix-stat to)))) (if (eq? (stat-type from-stat) 'directory) ; complain if "from" (error 'copy-file "~s is a directory" from)) ; is a directory (if (and (not (unix-error? to-stat)) ; destination exists (eq? (stat-type to-stat) 'directory)) ; and is a directory? (set! to (format #f "~a/~a" to (pathname-tail from)))) (let* ((to-fd (unix-open to '(write create exclusive) (stat-mode from-stat))) (from-fd (unix-open from '(read))) (buf (make-string copy-buffer-size))) (let loop ((num-chars (unix-read-string-fill! from-fd buf))) (if (positive? num-chars) (begin (unix-write to-fd buf num-chars) (loop (unix-read-string-fill! from-fd buf))))) (unix-close from-fd) (unix-close to-fd)))) (define (string-rindex s c) (let loop ((i (string-length s))) (cond ((zero? i) #f) ((char=? (string-ref s (1- i)) c) (1- i)) (else (loop (1- i)))))) (define (pathname-tail s) (let ((i (string-rindex s #\/))) (if i (substring s (1+ i) (string-length s)) s))) ;;; Test -- copy /bin/date into a temporary file (let ((tmp (unix-tempname))) (unwind-protect (begin (format #t "Copying /bin/date to ~a.~%" tmp) (copy-file "/bin/date" tmp) (format #t "Comparing files... ") (if (zero? (unix-system (format #f "cmp -s /bin/date ~s" tmp))) (format #t "OK.~%") (format #t "Oops, files differ.~%"))) (format #t "Removing ~a.~%" tmp) (unix-unlink tmp))) elk-3.99.8/examples/unix/calc.scm0000644000175000017500000000332611577076306013547 00000000000000;;; -*-Scheme-*- ;;; ;;; Demonstrate pipes, fork, exec. ;;; ;;; (calc-open) -- Open two pipes to/from UNIX dc command ;;; (calc expr) -- Send expression to dc, return result as a string ;;; (calc-close) -- Close pipes, wait for child process ;;; ;;; ;;; This program requires vanilla UNIX dc. It does not work with GNU dc, ;;; because GNU dc uses buffered output even if standard output points to ;;; a pipe. This means that GNU dc does not produce any output until the ;;; pipe is closed; the call to read-string therefore just hangs. (require 'unix) (define calc-from-dc) ; input port: standard output of dc command (define calc-to-dc) ; output port: standard input of dc command (define calc-dc-pid) ; process-ID of child process running dc (define calc-dc-command "/usr/bin/dc") (define (calc-open) (let* ((from (unix-pipe)) (to (unix-pipe)) (redirect-fd (lambda (a b) (unix-dup a b) (unix-close a)))) (set! calc-dc-pid (unix-fork)) (if (zero? calc-dc-pid) (begin (unix-close (car from)) (unix-close (cdr to)) (redirect-fd (car to) 0) (redirect-fd (cdr from) 1) (unix-exec calc-dc-command '("dc"))) (begin (unix-close (cdr from)) (unix-close (car to)) (set! calc-to-dc (unix-filedescriptor->port (cdr to) "w")) (set! calc-from-dc (unix-filedescriptor->port (car from) "r")))))) (define (calc expr) (format calc-to-dc "~a~%" expr) (flush-output-port calc-to-dc) (read-string calc-from-dc)) (define (calc-close) (close-output-port calc-to-dc) (close-input-port calc-from-dc) (if (feature? 'unix:wait-process) (unix-wait-process calc-dc-pid) (unix-wait))) ;;; Test -- print sqrt(2): (calc-open) (display (calc "10k 2v p")) (newline) (calc-close) elk-3.99.8/examples/unix/timeout.scm0000644000175000017500000000150411577076306014327 00000000000000;;; -*-Scheme-*- ;;; ;;; Demonstrate signals and alarm ;;; ;;; (timeout-read fdescr seconds) -- read with timeout (require 'unix) ;;; Read a string from file descriptor fd and return it (maximum length ;;; 1000 characters). Return #f on timeout (2nd arg, in seconds). (define (timeout-read fd sec) (let ((str (make-string 1000)) (old-handler 'default)) (call/cc (lambda (tmo) (dynamic-wind (lambda () (set! old-handler (unix-signal 'sigalrm (lambda _ (tmo #f)))) (unix-alarm sec)) (lambda () (substring str 0 (unix-read-string-fill! fd str))) (lambda () (unix-alarm 0) (unix-signal 'sigalrm old-handler))))))) ;;; Test (display "Enter a line (timeout 5 seconds): ") (let ((ret (timeout-read 0 5))) (if ret (format #t "Got ~s~%" ret) (format #t "~%Got timeout~%"))) elk-3.99.8/examples/Makefile.am0000644000175000017500000000351511577076306013212 00000000000000NULL = EXTRA_DIST = $(DATA) examplesdir = $(datadir)/doc/@PACKAGE@/examples c__dir = $(examplesdir)/c++ c___DATA = \ c++/class.cpp \ c++/constructor.cpp \ $(NULL) regexpdir = $(examplesdir)/regexp regexp_DATA = \ regexp/match.scm \ $(NULL) schemedir = $(examplesdir)/scheme scheme_DATA = \ scheme/ramanujan.scm \ scheme/hanoi.scm \ scheme/fib.scm \ scheme/co.scm \ scheme/meissel.scm \ scheme/perm.scm \ scheme/prim.scm \ scheme/Y.scm \ scheme/kons.scm \ scheme/mondo.scm \ scheme/billiard.scm \ scheme/cell.scm \ scheme/work.scm \ scheme/rungekutta.scm \ scheme/flame.scm \ scheme/dynamic.scm \ scheme/cc.scm \ scheme/cps.scm \ scheme/acker.scm \ scheme/fix.scm \ scheme/compile.scm \ scheme/sqrt.scm \ scheme/unify.scm \ $(NULL) unixdir = $(examplesdir)/unix unix_DATA = \ unix/pipsiz.scm \ unix/ls.scm \ unix/timeout.scm \ unix/calc.scm \ unix/lock.scm \ unix/copy.scm \ $(NULL) xawdir = $(examplesdir)/xaw xaw_DATA = \ xaw/clickcount.scm \ xaw/tree.scm \ xaw/dialog.scm \ xaw/grip.scm \ xaw/popup.scm \ xaw/pulldown.scm \ xaw/scrollbox.scm \ xaw/accel.scm \ xaw/list.scm \ xaw/viewport.scm \ xaw/panner.scm \ xaw/scrollbar.scm \ xaw/stripchart.scm \ xaw/text.scm \ xaw/paned.scm \ xaw/porthole.scm \ $(NULL) xlibdir = $(examplesdir)/xlib xlib_DATA = \ xlib/wm-delete.scm \ xlib/map-all.scm \ xlib/useful.scm \ xlib/poly.scm \ xlib/hello.scm \ xlib/properties.scm \ xlib/track.scm \ xlib/lines.scm \ xlib/picture.scm \ $(NULL) motifdir = $(examplesdir)/motif motif_DATA = \ motif/scroll-bar.scm \ motif/radio.scm \ motif/message-dialog.scm \ motif/drawing-area.scm \ motif/radio-stuff.scm \ motif/popup-menu.scm \ motif/pulldown-menu.scm \ motif/main-window.scm \ motif/menu-stuff.scm \ motif/vcr.scm \ motif/option-menu.scm \ motif/list.scm \ motif/selection-box.scm \ $(NULL) elk-3.99.8/examples/xaw/0000755000175000017500000000000011577110020012007 500000000000000elk-3.99.8/examples/xaw/popup.scm0000644000175000017500000000175511577076306013630 00000000000000;;; -*-Scheme-*- ;;; ;;; Popup menu demo (require 'xaw) (define top (application-initialize 'popup)) (define l (create-managed-widget (find-class 'label) top)) (set-values! l 'label "Press left button") (augment-translations l ": XawPositionSimpleMenu(the-menu) MenuPopup(the-menu)") ;; Due to a bug in the X11R5 SimpleMenu widget the `label' resource ;; can only be set at widget creation time: ;; (define menu (create-popup-shell 'the-menu (find-class 'simplemenu) l 'label 'menu)) (define (selected _) (print (widget-name (simplemenu-get-active-entry menu)))) (define entries (map (lambda (e) (create-managed-widget e (find-class 'smebsb) menu 'vert-space 40 'label e 'callback (list selected))) '("hamburger" "fishburger" "pommes frites" "chicken nuggets" "chicken wings" "milk shake"))) ; (set-values! menu 'popup-on-entry (cadr entries) 'label 'menu ; 'menu-on-screen #t) (realize-widget top) (context-main-loop (widget-context top)) elk-3.99.8/examples/xaw/accel.scm0000644000175000017500000000164311577076306013530 00000000000000;;; -*-Scheme-*- ;;; ;;; Demonstrate usage of accelerators ;;; ;;; Based on an example program (xtryaccel.c) from the O'Reilly ;;; book `X Toolkit Intrinsics Programming Manual' (require 'xaw) (define top (application-initialize 'accel "*bye.label: Goodbye" "*hello.label: Hello" "*font: *courier-bold-r*18*iso8859-1")) (define box (create-managed-widget (find-class 'box) top)) (define bye (create-managed-widget 'bye (find-class 'command) box 'accelerators "q: set() notify()")) (add-callback bye 'callback (lambda _ (exit))) (define hello (create-managed-widget 'hello (find-class 'command) box 'accelerators "p: set() notify() reset()")) (add-callback hello 'callback (lambda _ (display "Hello world!\n"))) (install-accelerators box bye) (install-accelerators box hello) (realize-widget top) (display "Press 'p' for Hello, 'q' for Goodbye.\n") (context-main-loop (widget-context top)) elk-3.99.8/examples/xaw/list.scm0000644000175000017500000000375411577076306013441 00000000000000;;; -*-Scheme-*- ;;; ;;; List widget demo (directory browser) (require 'xaw) (require 'unix) (require 'sort 'qsort.scm) (define top (application-initialize 'list)) (set-values! top 'allow-shell-resize #t) (define form (create-managed-widget (find-class 'form) top)) (define quit (create-managed-widget (find-class 'command) form)) (set-values! quit 'label "quit") (add-callback quit 'callback (lambda x (exit))) (define back (create-managed-widget (find-class 'command) form)) (set-values! back 'label "back" 'from-horiz quit) (add-callback back 'callback (lambda x (goto ".."))) (define lab (create-managed-widget (find-class 'label) form)) (set-values! lab 'border-width 0 'from-horiz back 'resizable #t) ;; List widget is broken; ``list'' resource *must* be initialized: (define lst (create-managed-widget (find-class 'list) form 'list '())) (set-values! lst 'from-vert lab 'resizable #t 'vertical-list #t) (add-callback lst 'callback (lambda (w i) (let ((type (stat-type (unix-stat (string-append where "/" (car i)))))) (set-values! lab 'label type) (if (eq? type 'directory) (goto (car i)))))) (define (goto dir) (if (string=? dir "..") (begin (if (not (string=? where "/")) (begin (set! where (substring where 0 (do ((i (- (string-length where) 2) (1- i))) ((char=? (string-ref where i) #\/) i)))) (if (eqv? where "") (set! where "/"))))) (if (not (or (string=? dir "/") (string=? where "/"))) (set! where (string-append where "/"))) (set! where (string-append where dir))) (set-values! lab 'label where) (define l '()) (for-each (lambda (d) (if (not (member d '("." ".."))) (set! l (cons d l)))) (unix-read-directory where)) (set-values! lst 'default-columns (max 2 (ceiling (/ (length l) 40)))) (list-change! lst (sort l stringlist s)))))) (realize-widget top) (context-main-loop (widget-context top)) elk-3.99.8/examples/xaw/pulldown.scm0000644000175000017500000000272011577076306014322 00000000000000;;; -*-Scheme-*- ;;; ;;; Pulldown menu demo (require 'xaw) (define top (application-initialize 'pulldown)) (define mb (create-managed-widget (find-class 'menubutton) top)) (set-values! mb 'label "Please press left button" 'menu-name 'the-menu) ;; Due to a bug in the X11R5 SimpleMenu widget the `label' resource ;; can only be set at widget creation time: ;; (define menu (create-popup-shell 'the-menu (find-class 'simplemenu) mb 'label 'menu)) (define data "\0\0\0\6\0\3\0\3\200\1\206\1\316\0\314\0\170\0\160\0\40\0\0\0") (define bm (create-bitmap-from-data (display-root-window (widget-display top)) data 12 12)) (define (selected w) (format #t "~s selected~%" (widget-name w))) (for-each (lambda (e) (if e (if (eqv? e "") (create-managed-widget (find-class 'sme) menu 'height 10) (create-managed-widget e (find-class 'smebsb) menu 'vert-space 40 'label e 'callback (list selected))) (create-managed-widget (find-class 'smeline) menu))) '("hamburger" "fishburger" "pommes frites" "" "chicken nuggets" "chicken wings" #f "cola" "milk shake" #f)) (define w (create-managed-widget (find-class 'smebsb) menu)) (set-values! w 'vert-space 50 'left-bitmap bm 'label "eat here" 'left-margin 16) (add-callback w 'callback (lambda (w) (set-values! w 'left-bitmap (if (eq? (car (get-values w 'left-bitmap)) 'none) bm 'none)))) (realize-widget top) (context-main-loop (widget-context top)) elk-3.99.8/examples/xaw/grip.scm0000644000175000017500000000101011577076306013406 00000000000000;;; -*-Scheme-*- ;;; ;;; Grip widget demo (require 'xaw) (define top (application-initialize 'grip)) (set-values! top 'width 50 'height 50) (define g (create-managed-widget (find-class 'grip) top)) (augment-translations g " : GripAction(press) : GripAction(move) : GripAction(release,done)") (add-callback g 'callback (lambda (w x) (format #t "Action: ~s Event: ~s~%" (cdr x) (caar x)))) (realize-widget top) (context-main-loop (widget-context top)) elk-3.99.8/examples/xaw/tree.scm0000644000175000017500000000153111577076306013414 00000000000000;;; -*-Scheme-*- ;;; ;;; Tree widget demo (define (make-tree tree parent x) (let ((p (create-managed-widget (find-class 'label) tree 'label (car x)))) (if parent (set-values! p 'tree-parent parent)) (do ((l (cdr x) (cdr l))) ((null? l)) (if (pair? (car l)) (make-tree tree p (car l)) (let ((w (create-managed-widget (find-class 'label) tree 'label (car l)))) (set-values! w 'tree-parent p)))))) (require 'xaw) (define top (application-initialize 'tree)) (define tree (create-managed-widget (find-class 'tree) top)) (make-tree tree #f '(world (america (north usa canada) (middle mexico cuba) (south brasilia ecuador chile)) (europe france britain germany) (asia japan korea) (antarctica))) (realize-widget top) (context-main-loop (widget-context top)) elk-3.99.8/examples/xaw/porthole.scm0000644000175000017500000000207411577076306014314 00000000000000;;; -*-Scheme-*- ;;; ;;; Porthole widget demo ;;; This only works with X11R5; there is no clock widget in X11R6-Xaw. (require 'xaw) (define top (application-initialize 'porthole)) (define form (create-managed-widget (find-class 'form) top)) (define panner (create-managed-widget (find-class 'panner) form)) (set-values! panner 'background-stipple 'grid2 'default-scale 15) (define porthole (create-managed-widget (find-class 'porthole) form)) (set-values! porthole 'width 150 'height 150 'from-vert panner) (define clock (create-managed-widget (find-class 'clock) porthole)) (set-values! clock 'width 300 'height 300) (add-callback panner 'report-callback (lambda (w xy) (set-values! clock 'x (- (car xy)) 'y (- (cdr xy))))) (add-callback porthole 'report-callback (lambda (w args) (multiple-value-bind (what x y sw sh cw ch) args (set-values! panner 'slider-x x 'slider-y y) (set-values! panner 'slider-width sw 'slider-height sh 'canvas-width cw 'canvas-height ch)))) (realize-widget top) (context-main-loop (widget-context top)) elk-3.99.8/examples/xaw/clickcount.scm0000644000175000017500000000132011577076306014607 00000000000000;;; -*-Scheme-*- ;;; ;;; Demonstrate usage of translations and actions. ;;; ;;; Based on an example program (xclickcount.c) from the O'Reilly ;;; collection of Xt example programs. (require 'xaw) (define top (application-initialize 'clickcount)) (define con (widget-context top)) (define increment-count (let ((count 0)) (lambda (w event . args) (set! count (1+ count)) (set-values! w 'label (format #f "# of clicks: ~s" count))))) (context-add-action con 'increment-count increment-count) (define label (create-managed-widget (find-class 'label) top 'width 150 'label "Click here")) (set-values! label 'translations ": increment-count()") (realize-widget top) (context-main-loop con) elk-3.99.8/examples/xaw/stripchart.scm0000644000175000017500000000063311577076306014642 00000000000000;;; -*-Scheme-*- ;;; ;;; Stripchart widget demo (require 'xaw) (define top (application-initialize 'stripchart)) (define s (create-managed-widget (find-class 'stripchart) top)) (set-values! s 'update 1 'jump-scroll 2) (define id (stripchart-set-sampler s (let ((x -.1)) (lambda () (set! x (+ x .1)) (1+ (sin x)))))) (realize-widget top) (context-main-loop (widget-context top)) elk-3.99.8/examples/xaw/dialog.scm0000644000175000017500000000353711577076306013724 00000000000000;;; -*-Scheme-*- ;;; ;;; Dialog box demo (require 'xaw) (define top (application-initialize 'dialog)) (define dpy (widget-display top)) (define f (open-font dpy "*courier-bold-r-normal--14*")) (define gray-bits "\10\2\10\2") (define gray (create-pixmap-from-bitmap-data (display-root-window dpy) gray-bits 4 4 (black-pixel dpy) (white-pixel dpy) (display-default-depth dpy))) (define bb (create-managed-widget (find-class 'box) top)) (define quit (create-managed-widget (find-class 'command) bb 'label "Quit")) (define p (create-managed-widget (find-class 'command) bb 'label "Press me")) (define pshell (create-popup-shell (find-class 'transient-shell) top)) (set-values! pshell 'width 150 'height 100) (add-callback quit 'callback (lambda _ (exit))) (add-callback p 'callback (lambda _ (let* ((width (car (get-values top 'width))) (height (car (get-values top 'height))) (pos (widget-translate-coordinates top (truncate (/ width 2)) (truncate (/ height 2))))) (set-values! pshell 'x (car pos) 'y (cdr pos))) (set-sensitive! p #f) (set-sensitive! quit #f) (popup pshell 'grab-nonexclusive))) (define (dialog-popdown . _) (popdown pshell) (set-sensitive! p #t) (set-sensitive! quit #t)) (define dialog (create-managed-widget (find-class 'dialog) pshell)) (set-values! dialog 'background-pixmap gray) (set-values! dialog 'value "/tmp/test" 'label "Filename:") (set-values! (name->widget dialog 'value) 'font f) (define b (create-managed-widget (find-class 'command) dialog 'label "cancel")) (add-callback b 'callback dialog-popdown) (define b2 (create-managed-widget (find-class 'command) dialog 'label "write")) (add-callback b2 'callback (lambda (w) (format #t "Filename is ~s~%" (car (get-values (widget-parent w) 'value))) (dialog-popdown))) (realize-widget top) (context-main-loop (widget-context top)) elk-3.99.8/examples/xaw/scrollbar.scm0000644000175000017500000000102611577076306014437 00000000000000;;; -*-Scheme-*- ;;; ;;; Scrollbar widget demo (require 'xaw) (define top (application-initialize 'scrollbar)) (define scroll (create-managed-widget (find-class 'scrollbar) top 'thickness 35 'length 400)) (define (sp w x) (format #t "(scroll-proc ~s)~%" x)) (define (jp w x) (format #t "(jump-proc ~s)~%" x)) (add-callback scroll 'scroll-proc sp) (set-values! scroll 'jump-proc (list jp)) (scrollbar-set-thumb! scroll 0.3 0.2) (realize-widget top) (context-main-loop (widget-context top)) elk-3.99.8/examples/xaw/viewport.scm0000644000175000017500000000075411577076306014342 00000000000000;;; -*-Scheme-*- ;;; ;;; Viewport widget demo ;;; This only works with X11R5; there is no clock widget in X11R6-Xaw. (require 'xaw) (define top (application-initialize 'viewport)) (define v (create-managed-widget (find-class 'viewport) top 'force-bars #t 'allow-horiz #t 'allow-vert #t)) (set-values! v 'width 120 'height 120) (define c (create-managed-widget (find-class 'clock) v)) (set-values! c 'width 200 'height 200) (realize-widget top) (context-main-loop (widget-context top)) elk-3.99.8/examples/xaw/scrollbox.scm0000644000175000017500000000201111577076306014456 00000000000000;;; -*-Scheme-*- ;;; ;;; Scroll box demo (require 'xaw) (define items (list 'Helvetica 'Courier 'Times 'Palatino 'Zapf\ Chancery 'Zapf\ Dingbats)) (set-cdr! (last-pair items) items) (define top (application-initialize 'scrollbox)) (define dpy (widget-display top)) (define dia-bits "\0\0\100\0\340\0\360\1\370\3\374\7\376\17\374\7\370\3\360\1\340\0\100\0\0\0") (define dia (create-bitmap-from-data (display-root-window dpy) dia-bits 13 13)) (define box (create-managed-widget (find-class 'box) top)) (set-values! box 'width 200) (define button (create-managed-widget (find-class 'command) box)) (set-values! button 'bitmap dia) (define label (create-managed-widget (find-class 'label) box)) (set-values! label 'width 130 'label (car items) 'resize #f 'justify 'left 'font (open-font dpy "*courier-bold-r-normal--14*")) (add-callback button 'callback (lambda (w) (set! items (cdr items)) (set-values! label 'label (car items)))) (realize-widget top) (context-main-loop (widget-context top)) elk-3.99.8/examples/xaw/panner.scm0000644000175000017500000000102611577076306013737 00000000000000;;; -*-Scheme-*- ;;; ;;; Panner widget demo (require 'xaw) (define top (application-initialize 'panner)) (set-values! top 'width 150 'height 150) (define panner (create-managed-widget (find-class 'panner) top)) (set-values! panner 'background-stipple 'grid2 'allow-off #t 'canvas-width 150 'canvas-height 150 'slider-width 60 'slider-height 60) (add-callback panner 'report-callback (lambda (w slider) (format #t "(~s,~s)~%" (car slider) (cdr slider)))) (realize-widget top) (context-main-loop (widget-context top)) elk-3.99.8/TODO0000644000175000017500000000357611577076306010037 00000000000000$Id$ Interpreter kernel o Documentation strings. Put them into an extra field in S_Compound. New primitives: procedure-documentation, macro-documentation. o It should not matter to an extension writer whether a primitive is written in Scheme or in C -- primitives should not be invoked directly via the P_ functions. Instead, a more general mechanism is needed. o include/misc.h: Reader_Tweak_Stream() should call Primitive_Error() if ferror() is true. o Implement a pure heap for constant objects (should be placed into read-only text segment by "dump"). o Generic print, equal, etc. functions should be provided for extensions. o Treat # as comment character if file starts with #! (hard to implement, as this requires the reader to detect beginning of line). o map and for-each should also work for other data structures (such as vectors). o Dump for NEXT-OS/MACH. Extensions o Motif: add support for new widgets and new functions. o A socket/networking extension. o A UNIX process interface, like that in GNU Emacs. o A foreign function interface generator as described in the CFI's ``A Scheme-Based Extension Language Environment''. Projects o Symbol completion would be very useful (but hard to implement). o A reasonable debugger and a better trace facility are needed. o An interface to Tcl/Tk. o The error-handler should be invoked with a symbol identifying the error as an argument. The symbol has an error text property holding the full text. o Ports: the accessor functions should be part of the port object. o Hash tables. Need to be rehashed on each GC. Table object holds hash function, compare function, etc. o It should be possible to define new types in Scheme (not only in extensions). New primitive: define-type (similar to define-structure?). elk-3.99.8/build-win320000755000175000017500000000136411577076306011325 00000000000000#! /bin/sh ## Win32 cross-compilation for Elk -- Sam Hocevar ## $Id$ set -x set -e # Clean up our working directory DIRNAME="elk-`sed -ne '/^VERSION/s/[^0-9]*//p' Makefile`" DESTDIR="`pwd`/${DIRNAME}" rm -Rf "${DIRNAME}" rm -f "${DIRNAME}.zip" mkdir "${DIRNAME}" # To build for win32, I use: # ./configure --host=i586-mingw32msvc --prefix=/ --bindir=/ --libdir=/ # make pkglibdir=/lib pkgdatadir=/scm make install DESTDIR="${DESTDIR}" pkglibdir=/lib pkgdatadir=/scm mv "${DESTDIR}/share/doc/elk/examples" "${DESTDIR}/examples" mv "${DESTDIR}/share/doc/elk/ps" "${DESTDIR}/doc" rm -Rf "${DESTDIR}/share" cp "src/.libs/libelk-0.dll" "${DESTDIR}" # Pack the directory zip "${DIRNAME}.zip" `find "${DIRNAME}"` rm -Rf "${DIRNAME}" elk-3.99.8/NEWS0000644000175000017500000005440111577103377010036 00000000000000$Id$ Changes between 3.0 and 4.0: ---------------------------- * New in 3.99.8 prerelease: + Maintenance release with minor bugfixes. * New in 3.99.7 prerelease: + Last known garbage collector bug was fixed. * New in 3.99.6 prerelease: + Many portability checks added to the configure script. + Fix for an installation bug that prevented extension loading. + BeOS dynamic plugin support. * New in 3.99.5 prerelease: + R4RS compliance fixes (r4rstest.scm successful passes): - Allow for empty (begin) and (cond) statements. - Fixed scope of named let variables. - (eqv? 1 1.0) now properly returns #f. + Mac OS X compilation fixes. + Fixed the detection of environ on Solaris. * New in 3.99.4 prerelease: + Proper plugin support under Win32 and HP-UX. + Compilation fixes. + Minor bugs fixed. * New in 3.99.3 prerelease: + Minor bugs fixed. * New in 3.99.2 prerelease: + Ported to HP-UX. + Ported to Windows (both Cygwin and Mingw32) except the plugin system. + More bugs fixed. * New in 3.99.1 prerelease: + Ported to Mac OS X. + Added proper checks for the libraries (libgdbm, X11, Motif, ...). + Added a ChangeLog file. + libelf is no longer an absolute requirement, though it is still strongly recommended. * New in 3.99.0 prerelease: + libelk, a shared library containing all the Elk scheme interpreter features. + Properly builds with GCC 3. + 64 bits clean. + Uses autoconf, automake and libtool for greater portability and a simpler build and installation process. + Support for dynamically loadable plugins. Previous versions used the system's linker to build shared objects at runtime. + Massive bugfixing. + Dump support was removed because it was too platform-specific and could not be thoroughly tested. I may enable it again in the future. Changes between 2.2 and 3.0: ---------------------------- General: * A new C/C++ Programmer's Manual for Elk is now available (60+ pages with many examples). See doc/README (item `cprog') and doc/cprog. * The documentation has been prepared for translation to HTML using the (Elk-based) `unroff' package. * Elk now uses a new Scheme object representation (a `struct' rather than an `unsigned long') to make it work on 64-bit architectures and to allow for larger heaps, a wider range of fixnums, and more first-class Scheme types. * As a consequence, the `pointer_constant_high_bits' are gone, as is util/pchb.c. * Elk has been ported to and tested on these new platforms (config files are included in the distribution): DEC/Alpha, OSF/1 HP 9000, HP-UX 10.0 i386/486, BSDI BSD/OS i386/486, Linux IBM PowerPC, AIX 4.1 * A number of config files for obsolete platforms have been removed from the distribution; config files for platforms where Elk 3.0 could not be tested are in config/untested. util/sgihack.c is gone. * Extension initialization and finalization functions now begin with `elk_init_' rather than just `init_' to avoid name conflicts. * The directory `contrib' has been removed from the distribution, as most of the contributions either were no longer maintained or have been made an official part of the distribution. contrib/eval-string is now available as lib/misc/elk-eval.c. * Site/platform-specific information such as the various X11 `load libraries', machine name, operating system name, as well as the Elk version number are now available as Scheme variables in scm/siteinfo.scm. The file is created automatically and can be loaded via `(require 'siteinfo)'. * Most of the improvements in scm/debug-new.scm have been merged into the baseline debug.scm and the former has been removed. The inspector now starts at the correct frame when called after an error. * examples/CC/class.c is a simple Elk extension demonstrating encapsulation of a C++ class in a Scheme type. * The file README has been renamed ROADMAP; RELEASE is now README. Interpreter kernel: * Many bugs have been fixed, and the code has been made `64-bit clean'. * New functions for application writers to read/set the `error tag' displayed in error messages and the application name (Get_Error_Tag, Set_Error_Tag, Set_App_Name). * When dynamically loading objects, the C++ static constructors are now called _before_ all extension initializers. Ditto for C++ destructors and extension finalizers. * New function for application/extension writers to load a file whose name is given as a C string (Load_File). * Load_Source_Port has been made `official' and may be used from outside the interpreter. * New functions for application/extension writers to convert Scheme numbers to C unsigned int/long: Get_Unsigned, Get_Unsigned_Long, Get_Exact_Unsigned, Get_Exact_Unsigned_Long. New function Get_Exact_Long. * The `round' primitive now rounds to even for numbers halfway between two integers. * The reader doesn't impose a limit on the length of strings and symbols any longer. * The dynamic loading implementations now use the environment variable TMPDIR if present. * `dump' now works under SGI Irix 5.x. * New constants ELK_MINOR and ELK_MAJOR for application/extension writers. * Symbols containing special characters now print correctly when output with `write'. * Various optimizations in the interpreter's inner loop to compensate for the performance loss caused by the struct-based object representation on some platforms. Extensions: * The X11 extensions now work with X11 Release 6, Sun OpenWindows 3.x, and Sun Motif. * Extension-specific include files (unix.h, xlib.h, xt.h) are now installed in a subdirectory $install_dir/include/extensions for use by applications. * The object files for Athena or Motif widgets are now loaded by means of `require'. * New POSIX-style regular expression extension (see doc/regexp and examples/regexp). * The file hunk.c has been removed from lib/misc, as it no longer serves any purpose. * Several bugs have been fixed in the UNIX and X11 extensions. Changes between 2.1 and 2.2: ---------------------------- General: * Elk ported to new platforms: SGI Irix 5.1, HP-UX 9.0 * All Scheme files now end with the suffix `.scm' * Introduced new symbols in the config files to be used by the UNIX extension * Reorganized the include files. Split external declarations into `private' (intern.h) and `public' (extern.h) declarations to be used by extensions * It's no longer necessary to specify multiple destination directories in the site file (only install_dir; subdirectories are created automatically) * `init_objects' is gone from the site file, see INSTALL for a new, simpler way to link extensions or an application with Elk statically * New directory $install_dir/lib is created with files module.o, standalone.o and shell scripts linkscheme, makedl, and ldflags (see INSTALL) * Elk can now be used by applications that must have their own main() function. See INSTALL for details. Interpreter kernel: * New primitives to allow blocking of signals from within Scheme code: disable-interrupts, enable-interrupts * Changed Disable_Interrupts and Enable_Interrupts macros to allow nesting and to handle signals used by extensions (specifically by the new UNIX extension) * Extended representation of continuations to carry current interrupt nesting level and restore it when being called * (Re-)enable interrupts in toplevel on error * Added default signal handlers for SIGPIPE and SIGHUP to clean up temporary files * New primitive: `features' * `require' now appends .scm to feature name to obtain file name (if no file name has been specified and if the feature name doesn't have a suffix yet) * Features elk:dump and elk:load-object are provided by the interpreter if dump and dynamic loading are supported * Implemented Register_Onfork() and Call_Onfork() to provide `fork handlers' (used, for instance, by the UNIX extension) * Added fork handlers to the dynamic loading implementations to create links for the temporary files * Added a close function to I/O ports to allow for pipe-based ports * New primitive: char-ready? * Added a check to the code that restarts a dumped interpreter to detect that the start address of the stack has been moved with respect to the original invocation (this happens between Sun-4c and Sun-4m architectures, for instance) * Modified math.c to implement the distinction between exact and inexact numbers as required by the language definition * New primitives: exact->inexact, inexact->exact * The number prefixes #e and #i are now supported * Floating point numbers are no longer automatically reduced to integers; new conversion function Make_Flonum(double) in addition to Make_Reduced_Flonum(double) * Added new conversion functions to cleanly distinguish between C ints and longs: Get_Long(Object), Make_Long(long), Make_Unsigned_Long(unsigned long), and functions to convert bignums from/to C longs * New conversion functions for exact integers: Get_Exact_Integer(Object) and Get_Exact_Long(Object) * Removed the unique `void' type; #v is now converted into the empty symbol by the reader; void? remains for compatibility * Implemented reader table for #-syntax * New function Define_Reader() to allow extensions to register their own read syntaxes (used by the new bitstring extension) * Exported parts of the reader to simplify writing new reader functions in extensions * New functions/macros to convert Scheme strings and/or symbols into C strings (to be used by extension writers): Get_String, Get_Strsym, Get_String_Stack, Get_Strsym_Stack; see src/cstring.c * Now obsolete: Declare_C_Strings, Dispose_C_Strings, Make_C_String * Bug fixes: o fixed a few bugs in the implementation of continuations and tail call optimization and in the generational, incremental garbage collector o there was a bug in the interaction between the garbage collector and `dump' o identified additional critical sections to be protected from delivery of signals o initscheme.scm wasn't resolved against the load-path o quasiquotation now also works for vectors (kudos to Tor Lillqvist for suggesting a simple fix) o a bug in src/load-ld.c could cause the first static variable in a dynamically loaded .o file to not be zeroed Extensions: * New UNIX extension; see doc/unix for the reference manual and examples/unix for a few demonstration programs * New record extension; see doc/record for the reference manual. The `struct' extension is now obsolete * New arbitrary-length bitstring extension; see doc/bitstring for the manual Changes between 2.0 and 2.1: ---------------------------- General: * New configuration files for the 386/486-PC running 386BSD and DOS/DJGPP, for Suns running Solaris 2.1 (SunOS 5.1, and for the Convex C230 running ConvexOS. * Reorganized the config files and the site file to allow for configuration of the generational, incremental garbage collector * Introduced several new symbols in the config files to simplify installation on several systems * Added new targets to all Makefiles to allow `cross-localization' of the source tree (see comments in DOS section in MACHINES) Interpreter kernel: * Added a generational, incremental garbage collector * New primitives: garbage-collect-status, collect-incremental * Reorganized the source files to accommodate the new garbage collector and to separate garbage collector specific code from code common to both garbage collectors * Empty list no longer counts as false; added primitive `empty-list-is-false-for-backward-compatibility' * Changed delimiter character in load-path argument of -p option from comma to colon * Initialize load-path from ELK_LOADPATH environment variable (if present) * Added argument to -v option to control which messages to print (linker command, init/finit functions) * It's no longer considered an error if an object file contains no initializers * Completely rewritten implementations of `dump' for ELF (SysVR4, Solaris 2.x), ECOFF (Ultrix, Irix), and HP9000 a.out formats; the HP version now correctly handles shared libraries * Added support for dynamic loading under SysVR4 and Solaris 2.x (see comments in MACHINES) * Added code to read symbol table of object files on the Convex * Bug fixes: o dynamic-wind was completely broken; fixed it o fixed a bug in the code that checks for the stack growing direction (caused dumped images to crash on startup) o fixed a bug in the equal? predicate (could enter an infinite loop when applied to environments) * Fixed a number of portability problems, among them: o added O_BINARY flag to open() calls and "b" mode to fopen() calls where necessary o added support for the many different ways to purge a file pointer and tty file descriptor (src/read.c, src/print.c) * Integrated the functionality of the `libutil.a' library from older releases into the interpreter kernel (conversion of symbols and lists of symbols to bit masks and vice versa; routines to manage a pool of weak pointers to objects, used mainly by the Elk X extensions Extensions: * Removed libutil.a (lib/util/*); moved the code into the interpreter kernel (src/terminate.c; src/symbol.c); removed libutil.a from the default load-libraries * Renamed lib/misc/c++.[co] to lib/misc/newhandler.[co] (c++.c isn't a valid filename under DOS) * Added finit function to lib/misc/monitor.c to switch off monitoring and write mon.out on exit Elk/X: * The X extensions are no longer pre-linked against the required X libraries (by means of ld -r); resolving against system libs now always takes place at load time * make-gcontext and copy-gcontext now can be called with a drawable (i.e. pixmap or window) * New primitives: alloc-color alloc-named-color * Removed window-unique-id primitive * Fixed a few bugs in the Xt extension (editres now works with Scheme programs); removed an artificial limitation * Defined a GC visit function for widgets that visits each widget's parents and the children of composite widgets * Added support for Motif gadgets Changes between 1.5 and 2.0: ---------------------------- General: * The build and install process has been improved significantly (see file INSTALL) * Added a new directory "config" that holds the system-specific configuration files and the site-file * Added a build shell script and a unified Makefile to all directories; "build" creates the ``real'' Makefiles containing system- and site-specific details during the make process * Added install, lint, clean, and distclean targets to all Makefiles * Placed files that are needed during runtime (dynamically loadable object files, Scheme files, the interpreter itself) into separate directories; added "make install" to put files there * Simplified porting Elk to new systems (assembly language support and a stack-extending version of "alloca" are no longer required) * Tested on several new systems (IBM RS/6000, HP9000/700, SGI, Sony; see the file MACHINES) * Placed new files CONTRIBUTORS, MIGRATE, and TODO into the toplevel directory of the distribution * Added a directory "util" that contains tools to simplify porting Elk to new environments and other utilities that are useful on some systems * Added a directory "scripts" that holds the shell scripts used to link instances of the interpreter and extensions. * Removed "stk" directory with test programs (no longer needed) * Added ANSI C prototypes and C++ "extern C" to all include files Interpreter kernel: * Placed include files into a separate directory (include) * Reorganized the source files (separate source files for different a.out formats and different dynamic loading mechanisms) * Changed the way new Scheme objects are allocated to support the generational garbage collector (not yet present in Elk) * Rewrote the code implementing continuations to support full call/cc on all machines * Fixed tail recursion optimization * Added support for POSIX signals (as alternative to BSD reliable signals) * Removed several artificial limitations (such as max. number of before-GC and after-GC functions and statically GC-linked objects) * Removed code that depended on max. number of open files per process * Added bi-directional ports (input-output-ports); new primitive: open-input-output-port * New primitive: port-line-number * Reader now prints line number on syntax error * Max. length of a pathname is now determined correctly (using the POSIX incantations if applicable) * Added code to support dynamic loading under HP-UX (src/load-shl.c) * Added code to call extension finalization functions and C++ destructors on termination * Fixed and improved the code to call extension initialization functions and C++ constructors on startup or when loading extensions * Improved the mechanism to suppress initialization of statically linked extensions on startup ("dont_init_if_name" in config/site) * Can use ANSI "atexit" as alternative to redefining "exit" * Added option -p to specify load path * Scheme file "initscheme" is now loaded before the toplevel is loaded * Changed "rand" to use rand() if random() isn't there * re-entrant-continuations? primitive is no longer needed (returns always #t now) * Added a general mechanism to register termination functions for individual objects (e.g. to close files on GC); see src/terminate.c * linkscheme shell script improved; added code to support the stupid AIX linker * Fixed numerous things that caused lint or "gcc -ansi" to complain * Changed the dynamic loading, "dump", and a.out symbol table reading code in numerous places to make it work on new systems and to make it more readable and maintainable Extensions: * Combined lib/util/symbol.o and lib/util/objects.o into new library libutil.a; put this library into the default "load-libraries" * Moved lib/util/string.c and lib/util/string.h into the interpreter * Moved files from lib directory into new subdirectory "misc" * Added POSIX sysconf stuff to unix.c to determine max. number of open files per process Elk/X: * Made the code mostly "lint clean" and "gcc -ansi clean" * Fixed bogus variable definitions in xlib.h and xt.h * Xlib: added support for client-message event * Xt: added code to avoid a bug in Motif 1.1.4 * Xt: added optional "mask" argument to context-add-input * Removed site-dependent information from scm/xwidgets (file is now created from scm/xwidgets.src during the build process) * Renamed widget .d files that were longer than 14 characters; added ALIASES file for each widget set containing mappings from real widget names to short names Documentation: * Added sub-directory "paper" containing a draft version of a paper about Elk User-contributed extensions: * A foreign function interface, an Elk Shell, and a vector extension have been contributed by J. P. Lewis (contrib/zelk). Changes between 1.4 and 1.5: ---------------------------- General: * Added a "contrib" directory for user-contributed extensions that I have not fully tested and/or integrated into Elk * Renamed ORIGIN to COPYRIGHT Interpreter kernel: * Added support for the Amiga, A/UX and System V Release 4 (ELF a.out format) * Added special load-library for MIPS (-lc_G0) * Extension-interface: replaced Val() by Var_Set()/Var_Get() * Modified load, autoload, and require so that multiple .o-files can be loaded simultaneously * Added -1+ as a synonym for 1- * Bug fixes: o fixed a GC-related bug o fixed a bug that occurred when allocating a very large heap o fixed a bug in case-insensitive string comparison o fixed a bug in macro "when" o changed and clarified semantics of print-depth/print-length * IEEE 1178/R^4RS compatibility: o replaced close-port by close-input-port and close-output-port o added primitives caaaar .. cddddr o added peek-char primitive o added -i option for case-insensitive operation * Removed -bc option * Removed CBREAK-hack in read-char Elk/X: * Fixed several GC-related bugs (objects belonging to Xlib/Xt are no longer terminated by garbage collector when unreferenced) * Fixed a bug in the interface to the Grip widget * Modified code to load widgets to make use of new capability to load multiple .o-files Documentation: * Interpreter kernel: documented new functions, clarified some sections * Xlib/Xt: documented X-related behavior of garbage collector, pointed out GC-related pitfalls Changes between 1.3 and 1.4: ---------------------------- Interpreter kernel: * Support for the NeXT machines added * New primitive list? provided * Two bugs in the tail recursion code fixed * -v option to trace /bin/ld-calls * man-page written Elk/X: * Tested under X11R5 * X11R3 and earlier versions are no longer supported * The HP-widget code has been removed from the distribution * New Xlib-primitives: install-colormap uninstall-colormap list-installed-colormaps xlib-release-5-or-later? * Xt interface now supports actions and accelerator tables * Bug in set-context-fallback-resources! fixed * New Xt-functions: widget-name widget-translate-coordinates application-initialize context-add-action install-accelerators install-all-accelerators xt-release-5-or-later? * Support for new widget classes: menubutton panner porthole repeater simplemenu sme smebsb smeline stripchart tree * vpaned renamed to paned * Example programs have been moved into a new examples directory with sub-directories for Scheme, Xlib, Xaw, Motif * New Xaw example programs that demonstrate the new widget classes, accelerators, actions, etc. Other extensions: * Interface to the GNU gdbm-library elk-3.99.8/doc/0000755000175000017500000000000011577110017010145 500000000000000elk-3.99.8/doc/README0000644000175000017500000000563711577076306010774 00000000000000This directory tree contains the documentation for Elk as troff source and PostScript hardcopy files. You need a troff and the ms macro package to build the documentation from the troff source (see the Makefile in each subdirectory). The files ending in .ps are pre-generated PostScript files; you can send them directly to a PostScript printer or browse them with a PostScript previewer. The PostScript file have been generated with GNU groff. As a courtesy to our US audience, the PostScript files are in US letter format. If you don't like this (and your groff default is A4), deactivate the ".pl 11i" directives in util/tmac.scheme, usenix/usenix.ms, and man/elk.1 (i.e. insert a comment token before it) and rebuild the document(s). All the documents have been prepared for translation to HTML using the Elk-based `unroff' package (see ../README for availability information). kernel/ The Scheme Reference for Elk. It describes the Scheme language dialect implemented by the Scheme interpreter included in Elk (a superset of the official language). usenix/ A paper about Elk that has appeared in USENIX Computing Systems (vol. 7, no. 4, pp. 419-449, 1994). man/ This directory holds a brief online manual page for the Scheme interpreter component. You may want to install in `/usr/share/man' on your system. The manual page essentially describes the command line options of the interpreter. xlib/ The reference manual for the Xlib extension to Elk. xt/ The reference manual for the Xt (X11 Toolkit Intrinsics) extension to Elk. unix/ The reference manual for the UNIX extension. record/ The reference manual for the record extension. bitstring/ The reference manual for the bit string extension. regexp/ The reference manual for the regular expression extension. oops/ A manual for the simple Scheme-based object oriented programming tool included in Elk (oops.scm). cprog/ The C/C++ Programmer's Manual for Elk. This comprehensive manual describes the facilities of the C/C++ interface of Elk. Topics range from the general architecture of Elk-based applications and defining application-specific Scheme types and primitives, to more advanced subjects such as interacting with the garbage collector. The audience are authors of Elk-based applications and extension writers. This manual is a replacement for the document that lived in a subdirectory `ex' in earlier version of Elk. util/ A collection of troff macro files and other utilities needed for typesetting the documentation in the above directories. There is a small C program `mkindex.c' that is required to build the C/C++ Programmer's Manual (cprog/cprog.ms); you will have to compile it by calling "make" if you must typeset the manual. See the comment at the beginning of util/mkindex.c for a brief explanation of what it does. elk-3.99.8/doc/xlib/0000755000175000017500000000000011577110020011075 500000000000000elk-3.99.8/doc/xlib/xlib.ms0000644000175000017500000016130411577076306012343 00000000000000.so ../util/tmac.scheme .Ul .TL Elk/Xlib Reference Manual .AU Oliver Laumann . .Ch "Introduction" .PP This manual lists the functions, special forms, and variables defined by the Xlib extension included in the Elk distribution. Most of the functions are directly equivalent to a function of the Xlib C library, so that the description need not be repeated. In such cases, only the name of the corresponding Xlib function is mentioned. Thus, you should have the \f2Xlib \- C Language X Interface\fP manual within reach when using this reference manual. .PP The functions listed in this document can be loaded by evaluating the expression .DS .ft 5 (require 'xlib). .ft .DE .Ix xlib in the interpreter's top level or in a Scheme program. .PP The types of arguments of the procedures listed below are not described when they are obvious from the context or from the name. For instance, an argument named \f2window\fP is always of type \f2window\fP, an argument named \f2atom\fP is an object of type \f2atom\fP, etc. Arguments the names of which end in ``?'' are always of type \f2boolean\fP. .PP If a function returns several items of the same type (for instance, a list of windows), the return value is a vector of objects of this type. If a function returns a collection of items of different types or of different semantics, the return value is a list of objects (or a pair). In this case, \f2multiple-value-bind\fP .Ix multiple-value-bind can be used to bind variables to the return values. .if !\n(.U \{\ .PP In the following, each description of a procedure, special form, or variable lists the kind of object in boldface. Here, \f3procedure\fP denotes either a primitive procedure or a compound procedure, \f3syntax\fP denotes a special form or a macro, and \f3variable\fP denotes a global variable that has some initial value and can be re-assigned a new value by the user (by means of \f2set!\fP or \f2fluid-let\fP). .\} . .Ch "Display Functions" . .Pr display? x .LP Returns #t iff \f2x\fP is an object of type \f2display\fP. . .Pr open-display . name-of-display .LP See \f2XOpenDisplay\fP. \f2name-of-display\fP is a string or a symbol. If no name is specified, a NULL name will be passed to \f2XOpenDisplay\fP. . .Pr close-display display .LP See \f2XCloseDisplay\fP. Finalizes all objects associated with the display, then closes the display. . .[[ .Pr display-default-root-window display .Pr display-root-window display .]] .LP See \f2XDefaultRootWindow\fP. . .[[ .Pr display-default-colormap display .Pr display-colormap display .]] .LP See \f2XDefaultColormap\fP. Returns the default colormap of the display's default screen. . .Pr display-default-gcontext display .LP See \f2XDefaultGC\fP. Returns the default graphics context of the display's default screen. . .Pr display-default-depth display .LP See \f2XDefaultDepth\fP. Returns the default depth of the display's default screen. . .Pr display-default-screen-number display .LP See \f2XDefaultScreen\fP. Returns an integer. . .Pr display-cells display screen-number .LP See \f2XDisplayCells\fP. Returns an integer. . .Pr display-planes display screen-number .LP See \f2XDisplayPlanes\fP. Returns an integer. . .Pr display-string display .LP See \f2XDisplayString\fP. Returns a string. . .Pr display-vendor display .LP See \f2XServerVendor\fP, \f2XVendorRelease\fP. Returns a pair; the car is a string (the vendor identification), and the cdr is an integer (the vendor release number). . .Pr display-protocol-version display .LP See \f2XProtocolVersion\fP, \f2XProtocolRevision\fP. Returns a pair of integers (the X protocol's major and minor version numbers). . .Pr display-screen-count display .LP See \f2XScreenCount\fP. Returns an integer. . .Pr display-image-byte-order display .LP See \f2XImageByteOrder\fP. Returns a symbol (\f5lsb-first\fP or \f5msb-first\fP). . .Pr display-bitmap-unit display .LP See \f2XBitmapUnit\fP. Returns an integer. . .Pr display-bitmap-bit-order display .LP See \f2XBitmapBitOrder\fP. Returns a symbol (\f5lsb-first\fP or \f5msb-first\fP). . .Pr display-bitmap-pad display .LP See \f2XBitmapPad\fP. Returns an integer. . .[[ .Pr display-width display .Pr display-height display .]] .LP See \f2XDisplayWidth\fP, \f2XDisplayHeight\fP. Returns the width/height of the display's default screen. . .[[ .Pr display-width-mm display .Pr display-height-mm display .]] .LP See \f2XDisplayWidthMM\fP, \f2XDisplayHeightMM\fP. Returns the width/height of the display's default screen in millimeters. . .Pr display-motion-buffer-size display .LP See \f2XDisplayMotionBufferSize\fP. Returns an integer. . .Pr display-flush-output display .LP See \f2XFlush\fP. . .Pr display-wait-output display discard-events? .LP See \f2XSync\fP. . .Pr no-op display .LP See \f2XNoOp\fP. . .Pr list-depths display screen-number .LP See \f2XListDepths\fP. Returns a vector of integers. . .Pr list-pixmap-formats display .LP See \f2XListPixmapFormats\fP. Returns a vector of lists of three integers (depth, bits per pixel, and scanline pad). . .Pr set-after-function! display procedure .LP See \f2XSetAfterFunction\fP. Returns the old after function. If \f2procedure\fP is #f, the current after function is disassociated from the display. . .Pr after-function display .LP Returns the after function currently associated with the given display (#f if there is none). . .Pr synchronize display .LP Sets the display's after function to \f2display-wait-output\fP. . .Ch "Window Functions" . .Pr window? x .LP Returns #t iff \f2x\fP is an object of type \f2window\fP. . .Pr drawable? x .LP Returns #t iff \f2x\fP is a ``drawable'' (window or pixmap). . .Pr window-display window .LP Returns the display associated with the window. . .Pr create-window . args .LP See \f2XCreateWindow\fP. This function is used to create a new window. .LP The number of arguments must be even. The 1st, 3rd, etc. argument is the name (a symbol) of an attribute to be set when the window is created, the 2nd, 4th, etc.\& argument is the corresponding value. The attributes can be specified in any order. .LP Attributes are \f2x\fP, \f2y\fP, \f2width\fP, \f2height\fP, \f2border\fP (each of which has an integer value), \f2parent\fP (the parent window), and all attributes that can be set by means of the \f5set-window-\fP\f2attribute\fP\f5!\fP functions below except \f2sibling\fP and \f2stack-mode\fP. The attributes \f2parent\fP, \f2width\fP, and \f2height\fP are mandatory. The default for \f2x\fP and \f2y\fP is 0, the default for \f2border\fP is 2. . .[[ .Pr set-window-x! window value .Pr set-window-y! window value .Pr set-window-width! window value .Pr set-window-height! window value .Pr set-window-border-width! window value .Pr set-window-sibling! window value .Pr set-window-stack-mode! window value .Pr set-window-background-pixmap! window value .Pr set-window-background-pixel! window value .Pr set-window-border-pixmap! window value .Pr set-window-border-pixel! window value .Pr set-window-bit-gravity! window value .Pr set-window-gravity! window value .Pr set-window-backing-store! window value .Pr set-window-backing-planes! window value .Pr set-window-backing-pixel! window value .Pr set-window-save-under! window value .Pr set-window-event-mask! window value .Pr set-window-do-not-propagate-mask! window value .Pr set-window-override-redirect! window value .Pr set-window-colormap! window value .Pr set-window-cursor! window value .]] .LP See \f2XConfigureWindow\fP, \f2XChangeWindowAttributes\fP. Set the sibling window, stacking mode, background pixmap, background pixel, border pixel, cursor, and other attributes (see the \f5window-\fP functions below) of the specified window. .LP The stacking mode is a symbol (\f5above\fP, \f5below\fP, \f5top-if\fP, \f5bottom-if\fP, \f5opposite\fP). The \f2value\fP argument to \f2set-window-sibling!\fP must be a window, \f2set-window-background-pixmap!\fP expects a pixmap, \f2set-window-background-pixel!\fP and \f2set-window-border-pixel!\fP expect a pixel, and \f2set-window-cursor!\fP expects a cursor argument. For the types of the \f2value\fP argument of the other functions see the return values of the \f2window-\fP functions below. . .[[ .Pr window-x window .Pr window-y window .Pr window-width window .Pr window-height window .Pr window-border-width window .Pr window-depth window .Pr window-visual window .Pr window-root window .Pr window-class window .Pr window-bit-gravity window .Pr window-gravity window .Pr window-backing-store window .Pr window-backing-planes window .Pr window-backing-pixel window .Pr window-save-under window .Pr window-colormap window .Pr window-map-installed window .Pr window-map-state window .Pr window-all-event-masks window .Pr window-your-event-mask window .Pr window-do-not-propagate-mask window .Pr window-override-redirect window .Pr window-screen window .]] .LP See \f2XGetWindowAttributes\fP. Returns the x and y coordinates, width, height, border width, depth, visual, root window, class, bit gravity, window gravity, backing store availability, backing planes, backing pixel, save under availability, colormap, colormap installation information, map state, global event mask, local event mask, ``do-not-propagate'' mask, override redirect attribute, and screen of the specified window. .LP \f2window-visual\fP and \f2window-screen\fP always return the empty list in the current release of the software. \f2window-root\fP returns a window. \f2window-class\fP returns a symbol (\f5input-output\fP, \f5input-only\fP). \f2window-bit-gravity\fP returns a symbol (\f5forget\fP, \f5north-west\fP, \f5north\fP, \f5north-east\fP, \f5west\fP, \f5center\fP, \f5east\fP, \f5south-west\fP, \f5south\fP, \f5south-east\fP, \f5static\fP). \f2window-gravity\fP returns a symbol (same as \f2window-bit-gravity\fP with \f5unmap\fP instead of \f5forget\fP). \f2window-backing-store\fP returns a symbol (\f5not-useful\fP, \f5when-mapped\fP, \f5always\fP). \f2window-backing-planes\fP and \f2window-backing-pixel\fP return a pixel. \f2window-save-under\fP, \f2window-map-installed\fP and \f2window-override-redirect\fP return #t or #f. \f2window-colormap\fP returns a colormap. \f2window-map-state\fP returns a symbol (\f5unmapped\fP, \f5unviewable\fP, \f5viewable\fP). \f2window-all-event-masks\fP, \f2window-your-event-mask\fP, and \f2window-do-not-propagate-mask\fP return a list of symbols (event mask names such as \f5enter-window\fP, \f5pointer-motion\fP, etc.). All other functions return an integer. . .[[ .Pr drawable-root drawable .Pr drawable-x drawable .Pr drawable-y drawable .Pr drawable-width drawable .Pr drawable-height drawable .Pr drawable-border-width drawable .Pr drawable-depth drawable .]] .LP See \f2XGetGeometry\fP. Returns the root window, x and y coordinates, width, height, border width, and depth of the specified drawable. \f2drawable-root\fP returns a window, all other functions return an integer. . .Pr map-window window .LP See \f2XMapWindow\fP. . .Pr unmap-window window .LP See \f2XUnmapWindow\fP. . .Pr destroy-window window .LP See \f2XDestroyWindow\fP. . .Pr destroy-subwindows window .LP See \f2XDestroySubwindows\fP. . .Pr map-subwindows window .LP See \f2XMapSubwindows\fP. . .Pr unmap-subwindows window .LP See \f2XUnmapSubwindows\fP. . .Pr circulate-subwindows window direction .LP See \f2XCirculateSubwindows\fP. \f2direction\fP is a symbol (\f5raise-lowest\fP or \f5lower-highest\fP). . .Pr clear-window window .LP Performs a \f2clear-area\fP on the entire window. . .Pr raise-window window .LP See \f2XRaiseWindow\fP. . .Pr lower-window window .LP See \f2XLowerWindow\fP. . .Pr restack-windows list-of-windows .LP See \f2XRestackWindows\fP. . .Pr query-tree window .LP See\f2 XQueryTree\fP. Returns a list of three elements: root window, parent window, and children (a vector of windows). . .Pr translate-coordinates src-window x y dst-window .LP See \f2XTranslateCoordinates\fP. Returns a list of three elements: destination x and y, and child window. . .Pr query-pointer window .LP See \f2XQueryPointer\fP. Returns a list of eight elements: x and y, a boolean indicating whether the pointer is on the same screen as the specified window, the root window, the root window's x and y coordinates, the child window, and a list of modifier names (see \f2grab-button\fP .Ix grab-button below). . .Ch "Window Property and Selection Functions" . .Pr atom? x .LP Returns #t iff \f2x\fP is an object of type \f2atom\fP. . .Pr make-atom value .LP Returns an atom with the given \f2value\fP. \f2value\fP is an integer. . .Pr intern-atom display name .LP See \f2XInternAtom\fP. \f2name\fP is a string or a symbol. The atom is created if it does not yet exist. . .Pr find-atom display name .LP See \f2XInternAtom\fP. \f2name\fP is a string or a symbol. If the atom does not exist, the symbol \f5none\fP is returned. . .Pr atom-name display atom .LP See \f2XGetAtomName\fP. Returns a string. . .Pr list-properties window .LP See \f2XListProperties\fP. Returns a vector of atoms. . .Pr get-property window property request-type offset length delete? .LP See \f2XGetWindowProperty\fP. \f2property\fP is an object of type \f2atom\fP. \f2request-type\fP is an atom or #f in which case \f2AnyPropertyType\fP will be used. \f2offset\fP and \f2length\fP are integers. An error is signaled if \f2XGetWindowProperty\fP fails. .LP \f2get-property\fP returns a list of four items: the ``actual type'' (an atom), the format (an integer), the data (if any, the empty list otherwise), and the number of bytes left (an integer). .LP The data returned is either a string (if the format indicates 8-bit data) or a vector of integers. . .Pr change-property window property type format mode data .LP See \f2XChangeProperty\fP. \f2property\fP and \f2type\fP are atoms. \f2format\fP is an integer (8, 16, or 32). If \f2format\fP is 8 \f2data\fP must be a string, otherwise a vector of integers of the appropriate size. An error is signaled if the value of \f2format\fP is invalid or if \f2data\fP holds an integer that exceeds the size indicated by \f2format\fP. \f2mode\fP is a symbol (\f5replace\fP, \f5prepend\fP, or \f5append\fP). . .Pr delete-property window property .LP See \f2XDeleteProperty\fP. . .Pr rotate-properties window vector-of-atoms delta .LP See \f2XRotateWindowProperties\fP. \f2delta\fP is the amount to rotate (an integer). . .Pr set-selection-owner! display selection owner time .LP See \f2XSetSelectionOwner\fP. \f2selection\fP is an atom; \f2owner\fP is a window; \f2time\fP is an integer or the symbol \f5now\fP (for \f2CurrentTime\fP). . .Pr selection-owner display selection .LP See \f2XGetSelectionOwner\fP. . .Pr convert-selection selection target property requestor-window time .LP See \f2XConvertSelection\fP. \f2selection\fP and \f2target\fP are atoms; \f2property\fP is an atom or the symbol \f5none\fP. . .Ch "Colormap Functions" . .Pr color? x .LP Returns #t iff \f2x\fP is an object of type \f2color\fP. . .Pr make-color r g b .LP Returns an object of type \f2color\fP with the specified RGB components. \f2r\fP, \f2g\fP, and \f2b\fP are reals in the range 0.0 to 1.0. . .Pr color-rgb-values color .LP Returns a list of three elements, the RGB components of the given color (see \f2make-color\fP .Ix make-color above). . .Pr query-color colormap pixel .LP See \f2XQueryColor\fP. . .Pr query-colors colormap pixels .LP See \f2XQueryColors\fP. \f2pixels\fP is a vector of pixels. Returns a vector of colors of the same size as \f2pixels\fP. . .Pr lookup-color colormap color-name .LP See \f2XLookupColor\fP. \f2color-name\fP is a string or a symbol. Returns a pair of colors. . .Pr alloc-color colormap color .LP See \f2XAllocColor\fP. Returns a pixel (or #f in case of an error). . .Pr alloc-named-color colormap color-name .LP See \f2AllocNamedColor\fP. \f2color-name\fP is a string or a symbol. Returns a list of three elements: a pixel, and two colors (the closest color and the exact color); or #f in case of an error. . .Pr colormap? x .LP Returns #t iff \f2x\fP is an object of type \f2colormap\fP. . .Pr colormap-display colormap .LP Returns the display associated with the given colormap. . .Pr free-colormap colormap .LP See \f2XFreeColormap\fP. . .Ch "Pixel Functions" . .Pr pixel? x .LP Returns #t iff \f2x\fP is an object of type \f2pixel\fP. . .Pr pixel-value pixel .LP Returns the value of the pixel as an unsigned integer. . .[[ .Pr black-pixel display .Pr white-pixel display .]] .LP See \f2XBlackPixel\fP, \f2XWhitePixel\fP. Returns the black/white pixel of the display's default screen. . .Ch "Pixmap Functions" . .Pr pixmap? x .LP Returns #t iff \f2x\fP is an object of type \f2pixmap\fP. . .Pr pixmap-display pixmap .LP Returns the display associated with the pixmap. . .Pr free-pixmap pixmap .LP See \f2XFreePixmap\fP. . .Pr create-pixmap drawable width height depth .LP See \f2XCreatePixmap\fP. . .Pr create-bitmap-from-data window data width height .LP See \f2XCreateBitmapFromData\fP. \f2data\fP is a string. \f5(* width height)\fP must not exceed the number of bits in \f2string\fP. . .Pr create-pixmap-from-bitmap-data win data width height foregrnd backgrnd depth .LP See \f2XCreatePixmapFromBitmapData\fP. \f2data\fP is a string. \f5(* width height)\fP must not exceed the number of bits in \f2string\fP. . .Pr read-bitmap-file drawable filename .LP See \f2XReadBitmapFile\fP. \f2filename\fP is a string or a symbol. If \f2XReadBitmapFile\fP signals an error, \f2read-bitmap-file\fP returns a symbol (\f5open-failed\fP, \f5file-invalid\fP, or \f5no-memory\fP). If it succeeds, \f2read-bitmap-file\fP returns a list of five elements: the bitmap (an object of type \f2pixmap\fP), the width and height of the bitmap, and the x and y coordinates of the hotspot. . .Pr write-bitmap-file filename pixmap width height x-hot y-hot .LP See \f2XWriteBitmapFile\fP. \f2filename\fP is a string or a symbol. \f2x-hot\fP and \f2y-hot\fP are optional (\(mi1 is used if they are omitted), but either both or none of them must be given. \f2write-bitmap-file\fP returns a symbol (\f5success\fP, \f5open-failed\fP, \f5file-invalid\fP, or \f5no-memory\fP). . .Ch "Graphics Context Functions" . .Pr gcontext? x .LP Returns #t iff \f2x\fP is an object of type \f2gcontext\fP. . .Pr gcontext-display gcontext .LP Returns the display associated with the given GC. . .Pr create-gcontext . args .LP See \f2XCreateGC\fP. This function is used to create a new GC. .LP The number of arguments must be even. The 1st, 3rd, etc. argument is the name (a symbol) of an attribute to be set when the graphics context is created, the 2nd, 4th, etc.\& argument is the corresponding value. The attributes can be specified in any order. .LP Attributes are \f2window\fP (a drawable; mandatory) and all the attributes that can be set by the \f5set-gcontext-\fP\f2attribute\fP\f5!\fP functions below. . .Pr copy-gcontext gcontext drawable .LP See \f2XCopyGC\fP. Returns a copy of \f2gcontext\fP (associated with the specified drawable). . .Pr free-gcontext gcontext .LP See \f2XFreeGC\fP. . .Pr query-best-size display width height shape .LP See \f2XQueryBestSize\fP. \f2shape\fP is a symbol (\f5cursor\fP, \f5tile\fP, or \f5stipple\fP). Returns a pair of integers (result width and result height). . .[[ .Pr query-best-cursor display width height .Pr query-best-tile display width height .Pr query-best-stipple display width height .]] .LP See \f2XQueryBestSize\fP. Invokes \f2query-best-size\fP with the given arguments and a shape of \f5cursor\fP, \f5tile\fP, or \f5stipple\fP, respectively. . .[[ .Pr gcontext-function gcontext .Pr gcontext-plane-mask gcontext .Pr gcontext-foreground gcontext .Pr gcontext-background gcontext .Pr gcontext-line-width gcontext .Pr gcontext-line-style gcontext .Pr gcontext-cap-style gcontext .Pr gcontext-join-style gcontext .Pr gcontext-fill-style gcontext .Pr gcontext-fill-rule gcontext .Pr gcontext-arc-mode gcontext .Pr gcontext-tile gcontext .Pr gcontext-stipple gcontext .Pr gcontext-ts-x gcontext .Pr gcontext-ts-y gcontext .Pr gcontext-subwindow-mode gcontext .Pr gcontext-exposures gcontext .Pr gcontext-clip-x gcontext .Pr gcontext-clip-y gcontext .Pr gcontext-dash-offset gcontext .]] .LP See \f2XGetGCValues\fP. Returns the logical operation, plane mask, foreground and background pixel value, line width and style, cap and join style, fill style and rule, arc mode, tiling and stippling pixmap, tiling x- and y-origin, subwindow mode, clipping x- and y-origin, and dashed line information of the specified graphics context. .LP \f2gcontext-function\fP returns a symbol (\f5clear\fP, \f5and\fP, \f5and-reverse\fP, \f5copy\fP, \f5and-inverted\fP, \f5no-op\fP, \f5xor\fP, \f5or\fP, \f5nor\fP, \f5equiv\fP, \f5invert\fP, \f5or-reverse\fP, \f5copy-inverted\fP, \f5nand\fP, or \f5set\fP). \f2gcontext-plane-mask\fP, \f2gcontext-foreground\fP, and \f2gcontext-background\fP return a pixel. \f2gcontext-tile\fP and \f2gcontext-stipple\fP return a pixmap. The line style is a symbol (\f5solid\fP, \f5dash\fP, \f5double-dash\fP); the cap style is a symbol (\f5not-last\fP, \f5butt\fP, \f5round\fP, \f5projecting\fP); the join style is a symbol (\f5miter\fP, \f5round\fP, \f5bevel\fP); the fill style is a symbol (\f5solid\fP, \f5tiled\fP, \f5stippled\fP, \f5opaque-stippled\fP); the fill rule is a symbol (\f5even-odd\fP, \f5winding\fP); the arc mode is a symbol (\f5chord\fP, \f5pie-slice\fP); the subwindow-mode is a symbol (\f5clip-by-children\fP, \f5include-inferiors\fP). \f2gcontext-exposures\fP returns a boolean. All other functions return an integer. . .[[ .Pr set-gcontext-function! gcontext value .Pr set-gcontext-plane-mask! gcontext value .Pr set-gcontext-foreground! gcontext value .Pr set-gcontext-background! gcontext value .Pr set-gcontext-line-width! gcontext value .Pr set-gcontext-line-style! gcontext value .Pr set-gcontext-cap-style! gcontext value .Pr set-gcontext-join-style! gcontext value .Pr set-gcontext-fill-style! gcontext value .Pr set-gcontext-fill-rule! gcontext value .Pr set-gcontext-arc-mode! gcontext value .Pr set-gcontext-tile! gcontext value .Pr set-gcontext-stipple! gcontext value .Pr set-gcontext-ts-x! gcontext value .Pr set-gcontext-ts-y! gcontext value .Pr set-gcontext-font! gcontext value .Pr set-gcontext-subwindow-mode! gcontext value .Pr set-gcontext-exposures! gcontext value .Pr set-gcontext-clip-x! gcontext value .Pr set-gcontext-clip-y! gcontext value .Pr set-gcontext-clip-mask! gcontext value .Pr set-gcontext-dash-offset! gcontext value .]] .LP See \f2XChangeGC\fP. Sets the logical operation, plane mask, foreground and background pixel value, line width and style, cap and join style, fill style and rule, arc mode, tiling and stippling pixmap, tiling x- and y-origin, font, subwindow mode, clipping x- and y-origin, clipping bitmap, and dashed line information for the specified graphics context. .LP The \f2value\fP argument to \f2set-gcontext-font!\fP is a font, and the \f2value\fP argument to \f2set-gcontext-clip-mask!\fP is a pixmap. For the types of the \f2value\fP argument of the other functions see the return values of the \f2gcontext-\fP functions above. . .Pr set-gcontext-clip-rectangles! gcontext x y rectangles ordering .LP See \f2XSetClipRectangles\fP. \f2x\fP and \f2y\fP are integers (the coordinates of the clip-mask origin). \f2rectangles\fP is a vector of lists of four integers (x, y, width, and height of each rectangle). \f2ordering\fP is a symbol (\f5unsorted\fP, \f5y-sorted\fP, \f5yx-sorted\fP, or \f5yx-banded\fP). . .Pr set-gcontext-dashlist! gcontext dash-offset dash-list .LP See \f2XSetDashes\fP. \f2dash-offset\fP is an integer. \f2dash-list\fP is a vector of integers between 0 and 255. . .Ch "Graphics Functions" . .Pr clear-area window x y width height exposures? .LP See \f2XClearArea\fP. . .Pr copy-area src-drawable gcontext src-x src-y width height dst-drawable "dst-x dst-y" .LP See \f2XCopyArea\fP. . .Pr copy-plane src-drawable gcontext plane src-x src-y width height "dst-drawable dst-x dst-y" .LP See \f2XCopyPlane\fP. \f2plane\fP is an integer. An error is signaled unless exactly one bit is set in \f2plane\fP. . .Pr draw-point drawable gcontext x y .LP See \f2XDrawPoint\fP. . .Pr draw-points drawable gcontext vector-of-points relative? .LP See \f2XDrawPoints\fP. \f2vector-of-points\fP is a vector of pairs consisting of two integers (the x and y coordinates). If \f2relative?\fP is #t, \f2CoordModePrevious\fP is passed to \f2XDrawPoints\fP, otherwise \f2CoordModeOrigin\fP is used. . .Pr draw-line drawable gcontext x1 y1 x2 y2 .LP See \f2XDrawLine\fP. . .Pr draw-lines drawable gcontext vector-of-points relative? .LP See \f2XDrawLines\fP. See \f2draw-points\fP .Ix draw-points above. . .Pr draw-segments drawable gcontext vector-of-points .LP See \f2XDrawSegments\fP. \f2vector-of-points\fP is a vector of lists of four integers (x1, y1, x2, and y2). . .Pr draw-rectangle drawable gcontext x y width height .LP See \f2XDrawRectangle\fP. . .Pr fill-rectangle drawable gcontext x y width height .LP See \f2XFillRectangle\fP. . .Pr draw-rectangles drawable gcontext vector-of-rectangles .LP See \f2XDrawRectangles\fP. \f2vector-of-rectangles\fP is a vector of lists of four integers (x, y, width, and height of each rectangle). . .Pr fill-rectangles drawable gcontext vector-of-rectangles .LP See \f2XFillRectangles\fP. See \f2draw-rectangles\fP .Ix draw-rectangles above. . .Pr draw-arc drawable gcontext x y width height angle1 angle2 .LP See \f2XDrawArc\fP. . .Pr fill-arc drawable gcontext x y width height angle1 angle2 .LP See \f2XFillArc\fP. . .Pr draw-arcs drawable gcontext vector-of-data .LP See \f2XDrawArcs\fP. \f2vector-of-data\fP is a vector of lists of six integers (x, y, width, height, angle1, and angle2). . .Pr fill-arcs drawable gcontext vector-of-data .LP See \f2XFillArcs\fP. See \f2draw-arcs\fP .Ix draw-arcs above. . .Pr fill-polygon drawable gcontext vector-of-points relative? shape .LP See \f2XFillPolygon\fP. See \f2draw-points\fP .Ix draw-points above. \f2shape\fP is a symbol (\f5complex\fP, \f5non-convex\fP, or \f5convex\fP). . .Ch "Font Functions" . .Pr font? x .LP Returns #t iff \f2x\fP is an object of type \f2font\fP. . .Pr font-display .LP Returns the display associated with the given font. . .Pr open-font display font-name .LP See \f2XLoadQueryFont\fP. \f2font-name\fP is a string or a symbol. . .Pr close-font font .LP See \f2XUnloadFont\fP. . .Pr font-name font .LP Returns the name of the specified font (a string) or #f if the name could not be determined (e.\|g.\& when the font has been obtained by a call to \f2gcontext-font\fP). . .Pr gcontext-font gcontext .LP Calls \f2XQueryFont\fP with the GC obtained by \f2XGContextFromGC\fP. Only a limited number of functions can be applied to a font returned by \f2gcontext-font\fP, since it has neither a name nor a font-ID. . .Pr list-font-names display pattern .LP See \f2XListFonts\fP. \f2pattern\fP is a string or a symbol. Returns a vector of font names (strings). . .Pr list-fonts display pattern .LP See \f2XListFontsWithInfo\fP. \f2pattern\fP is a string or a symbol. Returns a vector of fonts. These fonts are ``pseudo fonts'' which do not have a font-ID. A pseudo font is loaded automatically and turned into a ``real'' font the first time it is passed to a function that makes use of the font-ID. . .[[ .Pr font-direction font .Pr font-min-byte2 font .Pr font-max-byte2 font .Pr font-min-byte1 font .Pr font-max-byte1 font .Pr font-all-chars-exist? font .Pr font-default-char font .Pr font-ascent font .Pr font-descent font .]] .LP These functions return the font direction as a symbol (\f5left-to-right\fP or \f5right-to-left\fP), the first and last character (as an integer), the first and last row (integer), an indication whether all characters have non-zero size (boolean), the default character (integer), and the ascent and descent (integer) of the specified font. . .[[ .Pr char-rbearing font index .Pr char-lbearing font index .Pr char-width font index .Pr char-ascent font index .Pr char-descent font index .]] .LP These functions return the metrics of the character specified by the integer \f2index\fP of the given font. Each function returns an integer. \f2font\fP can be a 1-byte as well as a 2-byte font. . .[[ .Pr max-char-lbearing font .Pr max-char-rbearing font .Pr max-char-width font .Pr max-char-ascent font .Pr max-char-descent font .]] .LP These functions return the maximum metrics over all characters in the specified font. Each function returns an integer. . .[[ .Pr min-char-lbearing font .Pr min-char-rbearing font .Pr min-char-width font .Pr min-char-ascent font .Pr min-char-descent font .]] .LP These functions return the minimum metrics over all characters in the specified font. Each function returns an integer. . .Pr font-properties font .LP Returns a vector of font properties; each element of the vector is a pair consisting of the property name (an atom) and an unsigned integer (the value of the property). . .Pr font-property font property-name .LP Returns the value of the specified property associated with the specified font. \f2property-name\fP is a string or a symbol. . .Pr font-path display .LP See \f2XGetFontPath\fP. Returns the current font path as a vector of strings. . .Pr set-font-path! display path .LP See \f2XSetFontPath\fP. \f2path\fP is a list; each element is a string or a symbol. . .Ch "Text Metrics and Text Drawing Functions" . .Pr text-width font text format .LP See \f2XTextWidth\fP, \f2XTextWidth16\fP. \f2format\fP indicates whether 8-bit or 16-bit text is used; it is either the symbol \f51-byte\fP or the symbol \f52-byte\fP. \f2text\fP is a vector of integers; the integers must not exceed the size indicated by the format. . .[[ .Pr extents-lbearing font text format .Pr extents-rbearing font text format .Pr extents-width font text format .Pr extents-ascent font text format .Pr extents-descent font text format .]] .LP See \f2XTextExtents\fP, \f2XTextExtents16\fP. These functions are used to compute the overall metrics of an 8-bit or 16-bit character string. Each function returns an integer. For the format of \f2text\fP and \f2format\fP see \f2text-width\fP .Ix text-width above. . .Pr draw-image-text drawable gcontext x y text format .LP See \f2XDrawImageString\fP, \f2XDrawImageString16\fP. See \f2text-width\fP .Ix text-width above. . .Pr draw-poly-text drawable gcontext x y text format .LP See \f2XDrawText\fP, \f2XDrawText16\fP. See \f2text-width\fP .Ix text-width above. \f2text\fP is a vector of integers with intermixed objects of type \f2font\fP. . .Pr translate-text string .LP Converts the string into a representation suitable as an argument to \f2text-width\fP, \f2draw-image-text\fP, or \f2draw-poly-text\fP (a vector of integers obtained by applying \f2char\(mi>integer\fP to the characters of the string argument). . .Ch "Cursor Functions" . .Pr cursor? x .LP Returns #t iff \f2x\fP is an object of type \f2cursor\fP. . .Pr cursor-display cursor .LP Returns the display associated with the given cursor. . .Pr free-cursor .LP See \f2XFreeCursor\fP. . .Pr create-cursor src mask x y foreground background .LP See \f2XCreatePixmapCursor\fP. \f2src\fP and \f2mask\fP are pixmaps. \f2mask\fP can be the symbol \f5none\fP. . .Pr create-glyph-cursor src src-char mask mask-char foreground background .LP See \f2XCreateGlyphCursor\fP. \f2src\fP and \f2mask\fP are fonts. \f2mask\fP can be the symbol \f5none\fP. The display is obtained from \f2src\fP. \f2src-char\fP and \f2mask-char\fP are integers. . .Pr create-font-cursor display src-char .LP See \f2XCreateGlyphCursor\fP. Calls \f2create-glyph-cursor\fP with the font named ``cursor'', the specified \f2src-char\fP, a \f2mask-char\fP of \f5(1+ src-char)\fP, black foreground, and white background. . .Pr recolor-cursor cursor foreground background .LP See \f2XRecolorCursor\fP . .Pr define-cursor window cursor .LP Synonym for \f5(set-window-cursor! window cursor)\fP. . .Pr undefine-cursor window .LP Synonym for \f5(set-window-cursor! window 'none)\fP. . .Ch "Grab Functions" . .Pr grab-pointer window owner? events ptr-sync? kbd-sync? confine-to cursor time .LP See \f2XGrabPointer\fP. \f2window\fP and \f2confine-to\fP are windows. \f2events\fP is a list of symbols (event mask names, such as \f5enter-window\fP, \f5pointer-motion\fP, etc.). \f2ptr-sync?\fP and \f2kbd-sync?\fP determine whether synchronous or asynchronous grab mode is to be used. \f2time\fP is an integer or the symbol \f5now\fP (for \f2CurrentTime\fP). \f2grab-pointer\fP returns a symbol (\f5success\fP, \f5not-viewable\fP, \f5already-grabbed\fP, \f5frozen\fP, or \f5invalid-time\fP). . .Pr ungrab-pointer display time .LP See \f2XUngrabPointer\fP. . .Pr grab-button win button mod owner? events ptr-sync? kbd-sync? "confine-to cursor" .LP See \f2XGrabButton\fP. \f2button\fP is a symbol (\f5button1\fP ... \f5button5\fP, or \f5any-button\fP). \f5mod\fP (modifiers) is a list of symbols (\f5shift\fP, \f5lock\fP, \f5control\fP, \f5mod1\fP ... \f5mod5\fP, \f5button1\fP ... \f5button5\fP, or \f5any-modifier\fP). For the other arguments see \f2grab-pointer\fP .Ix grab-pointer above. . .Pr ungrab-button window button modifiers .LP See \f2XUngrabButton\fP. See \f2grab-button\fP .Ix grab-button above. . .Pr change-active-pointer-grab display events cursor time .LP See \f2XChangeActivePointerGrab\fP. \f2events\fP is a list of symbols (event mask names, such as \f5enter-window\fP, \f5pointer-motion\fP, etc.). . .Pr grab-keyboard window owner? pointer-sync? keyboard-sync? time .LP See \f2XGrabKeyboard\fP. For a description of the arguments and the return value see \f2grab-pointer\fP .Ix grab-pointer above. . .Pr ungrab-keyboard display time .LP See \f2XUngrabKeyboard\fP. . .Pr grab-key window key modifiers owner? pointer-sync? keyboard-sync? .LP See \f2XGrabKey\fP. \f2key\fP is a keycode (an integer) or the symbol \f5any\fP. For the other arguments see \f2grab-pointer\fP .Ix grab-pointer above. . .Pr ungrab-key window key modifiers .LP See \f2XUngrabKey\fP. See \f2grab-key\fP .Ix grab-key above. . .Pr allow-events display mode time .LP See \f2XAllowEvents\fP. \f2mode\fP is a symbol (\f5async-pointer\fP, \f5sync-pointer\fP, \f5replay-pointer\fP, \f5async-keyboard\fP, \f5sync-keyboard\fP, \f5replay-keyboard\fP, \f5async-both\fP, or \f5sync-both\fP). . .Pr grab-server display .LP See \f2XGrabServer\fP. . .Pr ungrab-server display .LP See \f2XUngrabServer\fP. . .Sy with-server-grabbed display . body-forms .LP This macro performs a \f2grab-server\fP on the specified display, evaluates the \f2body-forms\fP in order, and then ungrabs the server. The macro body is guarded by a \f2dynamic-wind\fP to ensure that the \f2ungrab-server\fP is performed when a body-form calls a continuation created outside the macro, and that it is grabbed again when the body is re-entered at a later point in time. \f2with-server-grabbed\fP returns the value of the last body-form. . .Ch "Window Manager Functions" . .Pr reparent-window window parent-window x y .LP See \f2XReparentWindow\fP. . .Pr install-colormap colormap .LP See \f2XInstallColormap\fP. . .Pr uninstall-colormap colormap .LP See \f2XUninstallColormap\fP. . .Pr list-installed-colormaps window .LP See \f2XListInstalledColormaps\fP. Returns a vector of colormaps. . .Pr set-input-focus display window revert-to time .LP See \f2XSetInputFocus\fP. \f2window\fP can be the symbol \f5pointer-root\fP. \f2revert-to\fP is a symbol (\f5none\fP, \f5pointer-root\fP, or \f5parent\fP). \f2time\fP is an integer or the symbol \f5now\fP. . .Pr input-focus display .LP See \f2XGetInputFocus\fP. Returns a pair the car of which is a window, and the cdr is a symbol (\f5none\fP, \f5pointer-root\fP, or \f5parent\fP). . .Pr general-warp-pointer display dst-win dst-x dst-y src-win src-x src-y "src-width src-height" .LP See \f2XWarpPointer\fP. . .Pr warp-pointer dst-window dst-x dst-y .LP See \f2XWarpPointer\fP. Invokes \f2general-warp-pointer\fP with the display associated with the \f2dst-window\fP, the \f2dst-window\fP, \f2dst-x\fP, \f2dst-y\fP, a \f2src-window\fP of \f5none\fP, and zero source coordinates and dimensions. . .Pr warp-pointer-relative display x-offset y-offset .LP See \f2XWarpPointer\fP. Invokes \f2general-warp-pointer\fP with the specified \f2display\fP, a \f2dst-window\fP of \f5none\fP, \f2x-offset\fP, \f2y-offset\fP, a \f2src-window\fP of \f5none\fP, and zero source coordinates and dimensions. . .Pr bell display . percent .LP See \f2XBell\fP. \f2percent\fP is an integer between -100 and 100. If \f2percent\fP is omitted, 0 is used. . .Pr set-access-control display enable? .LP See \f2XSetAccessControl\fP. . .Pr change-save-set window mode .LP See \f2XChangeSaveSet\fP. \f2mode\fP is a symbol (\f5insert\fP or \f5delete\fP). . .Pr set-close-down-mode display mode .LP See \f2XSetCloseDownMode\fP. \f2mode\fP is a symbol (\f5destroy-all\fP, \f5retain-permanent\fP, or \f5retain-temporary\fP). . .Pr get-pointer-mapping display .LP See \f2XGetPointerMapping\fP. Returns a vector of 256 integers. . .Pr set-pointer-mapping display mapping .LP See \f2XSetPointerMapping\fP. \f2mapping\fP is a vector of integers. Returns #t if \f2XSetPointerMapping\fP succeeds, #f otherwise. . .Ch "Event Handling Functions" . .Pr event-listen display wait? .LP See \f2XPending\fP, \f2XPeekEvent\fP. Returns the size of the display's event queue. If \f2wait?\fP is true and the event queue is empty, \f2event-listen\fP flushes the output buffer and blocks until an event is received from the server. . .Pr get-motion-events window from-time to-time .LP See \f2XGetMotionEvents\fP. \f2from-time\fP and \f2to-time\fP are integers or the symbol \f5now\fP. \f2get-motion-events\fP returns a vector of lists of three elements: a time stamp (an integer or the symbol \f5now\fP), and the x and y coordinates (integers). . .Sy handle-events display discard? peek? . clauses .LP See \f2XNextEvent\fP, \f2XPeekEvent\fP, \f2XIfEvent\fP, \f2XPeekIfEvent\fP. \f2handle-events\fP is a special form. Each \f2clause\fP is of the form \f2(guard function)\fP; \f2guard\fP is either an event name (a symbol, e.\|g.\& \f5key-press\fP or \f5exposure\fP), a list of event names, or the symbol \f5else\fP. \f2handle-events\fP gets the next event from the specified display. Then the event type is matched against each event name in each guard in order. When a match occurs, the corresponding function is invoked with the name of the event being dispatched (a symbol) and other, event specific arguments (see below). When no clause matches and an \f5else\fP clause is present, the function from this clause is invoked. \f2handle-events\fP loops until a function returns a value not equal to #f in which case handle-events returns this value. .LP If \f2discard?\fP is true, unprocessed events (i.\|e.\& events for which no matching clause has been found) are removed from the event queue, otherwise they are left in place. If \f2peek?\fP is true, processed events are not removed from the event queue. .LP The following list gives all event specific arguments for each event type. The first argument is always the event type (a symbol). .LP In the following list, arguments with names of the form \f2something-window\fP (or simply \f2window\fP) are always of type \f2window\fP; arguments with names of the form \f2something-atom\fP (or simply \f2atom\fP) are always of type \f2atom\fP. \f2time\fP is an integer or the symbol \f5now\fP. \f2x\fP, \f2y\fP, \f2width\fP, \f2height\fP, \f2border-width\fP, \f2x-root\fP, \f2y-root\fP, \f2count\fP, \f2major-code\fP, \f2minor-code\fP, and \f2keycode\fP are integers. \f2state\fP is a list of symbols (\f5shift\fP, \f5lock\fP, \f5control\fP, \f5mod1\fP ... \f5mod5\fP, \f5button1\fP ... \f5button5\fP). \f2button\fP is one of the symbols \f5button1\fP ... \f5button5\fP, \f2button-mask\fP is a list of one or more of these symbols. \f2cross-mode\fP is a symbol (\f5normal\fP, \f5grab\fP, \f5ungrab\fP). \f2place\fP is a symbol (\f5top\fP or \f5bottom\fP). . .IP "\f3key-press, key-release:\fP" .Ix "Event types" key-press .Ix "Event types" key-release \f2window\fP, \f2root-window\fP, \f2sub-window\fP, \f2time\fP, \f2x\fP, \f2y\fP, \f2x-root\fP, \f2y-root\fP, \f2state\fP, \f2keycode\fP, \f2same-screen?\fP. . .IP "\f3button-press, button-release:\fP" .Ix "Event types" button-press .Ix "Event types" button-release \f2window\fP, \f2root-window\fP, \f2sub-window\fP, \f2time\fP, \f2x\fP, \f2y\fP, \f2x-root\fP, \f2y-root\fP, \f2state\fP, \f2button\fP, \f2same-screen?\fP. . .IP "\f3motion-notify:\fP" .Ix "Event types" motion-notify \f2window\fP, \f2root-window\fP, \f2sub-window\fP, \f2time\fP, \f2x\fP, \f2y\fP, \f2x-root\fP, \f2y-root\fP, \f2state\fP, \f2is-hint?\fP, \f2same-screen?\fP. . .IP "\f3enter-notify, leave-notify:\fP" .Ix "Event types" enter-notify .Ix "Event types" leave-notify \f2window\fP, \f2root-window\fP, \f2sub-window\fP, \f2time\fP, \f2x\fP, \f2y\fP, \f2x-root\fP, \f2y-root\fP, \f2cross-mode\fP, \f2cross-detail\fP (one of the symbols \f5ancestor\fP, \f5virtual\fP, \f5inferior\fP, \f5nonlinear\fP, \f5nonlinear-virtual\fP), \f2same-screen?\fP, \f2focus?\fP, \f2button-mask\fP. . .IP "\f3focus-in, focus-out:\fP" .Ix "Event types" focus-in .Ix "Event types" focus-out \f2window\fP, \f2cross-mode\fP, \f2focus-detail\fP (one of the symbols \f5ancestor\fP, \f5virtual\fP, \f5inferior\fP, \f5nonlinear\fP, \f5nonlinear-virtual\fP, \f5pointer\fP, \f5pointer-root\fP, \f5none\fP). . .IP "\f3keymap-notify:\fP" .Ix "Event types" keymap-notify \f2window\fP, \f2keymap\fP (a string of length 32). . .IP "\f3expose:\fP" .Ix "Event types" expose \f2window\fP, \f2x\fP, \f2y\fP, \f2width\fP, \f2height\fP, \f2count\fP. . .IP "\f3graphics-expose:\fP" .Ix "Event types" graphics-expose \f2window\fP, \f2x\fP, \f2y\fP, \f2width\fP, \f2height\fP, \f2count\fP, \f2major-code\fP, \f2minor-code\fP. . .IP "\f3no-expose:\fP" .Ix "Event types" no-expose \f2window\fP, \f2major-code\fP, \f2minor-code\fP. . .IP "\f3visibility-notify:\fP" .Ix "Event types" visibility-notify \f2window\fP, \f2visibility-state\fP (one of the symbols \f5unobscured\fP, \f5partially-obscured\fP, \f5fully-obscured\fP). . .IP "\f3create-notify:\fP" .Ix "Event types" create-notify \f2parent-window\fP, \f2window\fP, \f2x\fP, \f2y\fP, \f2width\fP, \f2height\fP, \f2border-width\fP, \f2override-redirect?\fP. . .IP "\f3destroy-notify:\fP" .Ix "Event types" destroy-notify \f2event-window\fP, \f2window\fP. . .IP "\f3unmap-notify:\fP" .Ix "Event types" unmap-notify \f2event-window\fP, \f2window\fP, \f2from-configure\fP. . .IP "\f3map-notify:\fP" .Ix "Event types" map-notify \f2event-window\fP, \f2window\fP, \f2override-redirect\fP. . .IP "\f3map-request:\fP" .Ix "Event types" map-request \f2parent-window\fP, \f2window\fP. . .IP "\f3reparent-notify:\fP" .Ix "Event types" reparent-notify \f2event-window\fP, \f2parent-window\fP, \f2window\fP, \f2x\fP, \f2y\fP, \f2override-redirect\fP. . .IP "\f3configure-notify:\fP" .Ix "Event types" configure-notify \f2event-window\fP, \f2window\fP, \f2x\fP, \f2y\fP, \f2width\fP, \f2height\fP, \f2border-width\fP, \f2above-window\fP, \f2override-redirect?\fP. . .IP "\f3configure-request:\fP" .Ix "Event types" configure-request \f2parent-window\fP, \f2window\fP, \f2x\fP, \f2y\fP, \f2width\fP, \f2height\fP, \f2border-width\fP, \f2above-window\fP, \f2stack-mode\fP (see \f2set-window-stack-mode!\fP above), \f2value-mask\fP (an integer). . .IP "\f3gravity-notify:\fP" .Ix "Event types" gravity-notify \f2event-window\fP, \f2window\fP, \f2x\fP, \f2y\fP. . .IP "\f3resize-request:\fP" .Ix "Event types" resize-request \f2window\fP, \f2width\fP, \f2height\fP. . .IP "\f3circulate-notify:\fP" .Ix "Event types" circulate-notify \f2event-window\fP, \f2window\fP, \f2place\fP. . .IP "\f3circulate-request:\fP" .Ix "Event types" circulate-request \f2parent-window\fP, \f2window\fP, \f2place\fP. . .IP "\f3property-notify:\fP" .Ix "Event types" property-notify \f2window\fP, \f2atom\fP, \f2time\fP, \f2property-state\fP (one of the symbols \f5new-value\fP, \f5deleted\fP). . .IP "\f3selection-clear:\fP" .Ix "Event types" selection-clear \f2window\fP, \f2selection-atom\fP, \f2time\fP. . .IP "\f3selection-request:\fP" .Ix "Event types" selection-request \f2owner-window\fP, \f2requestor-window\fP, \f2selection-atom\fP, \f2target-atom\fP, \f2property-atom\fP, \f2time\fP. . .IP "\f3selection-notify:\fP" .Ix "Event types" selection-notify \f2requestor-window\fP, \f2selection-atom\fP, \f2target-atom\fP, \f2property-atom\fP, \f2time\fP. . .IP "\f3colormap-notify:\fP" .Ix "Event types" colormap-notify \f2window\fP, \f2colormap\fP, \f2new?\fP, \f2colormap-installed?\fP. . .IP "\f3client-message:\fP" .Ix "Event types" client-message \f2window\fP, \f2message type\fP (an atom), \f2message data\fP (a string of length 20, or a vector of 10 or 5 integer numbers, or, if the format field of the event is wrong, the format as a number). . .IP "\f3mapping-notify:\fP" .Ix "Event types" mapping-notify \f2window\fP, \f2request\fP (one of the symbols \f5modifier\fP, \f5keyboard\fP, \f5pointer\fP), \f2keycode\fP, \f2count\fP. . .Ch "Inter-Client Communication Functions" . .Pr iconify-window window screen-number .LP See \f2XIconifyWindow\fP. . .Pr withdraw-window window screen-number .LP See \f2XWithdrawWindow\fP. . .Pr reconfigure-wm-window . args .LP See \f2XReconfigureWMWindow\fP. .LP For the format of the arguments see \f2create-window\fP .Ix create-window above. Mandatory attributes are \f2window\fP and \f2screen-number\fP (an integer). Optional attributes are \f2x\fP, \f2y\fP, \f2width\fP, \f2height\fP \f2border-width\fP (integers), \f2sibling\fP (a window), and \f2stack-mode\fP (a symbol; one of \f5above\fP, \f5below\fP, \f5top-if\fP, \f5bottom-if\fP, \f5opposite\fP). . .Pr get-text-property window atom .LP See \f2XGetTextProperty\fP. Returns a text property as a list of strings or #f if the specified property does not exist. . .Pr set-text-property! window value atom .LP See \f2XSetTextProperty\fP. \f2value\fP is a list holding the items of the text property (strings or symbols). . .Pr wm-protocols window .LP See \f2XGetWMProtocols\fP. Returns a vector of atoms. . .Pr set-wm-protocols! window protocols .LP See \f2XSetWMProtocols\fP. \f2protocols\fP is a vector of atoms. . .Pr wm-name window .LP See \f2XGetTextProperty\fP. Returns the WM_NAME property as a list of strings or #f if it does not exist. . .Pr set-wm-name! window name .LP See \f2XSetTextProperty\fP. \f2name\fP is a list of strings or symbols. . .Pr wm-icon-name window .LP See \f2XGetTextProperty\fP. Returns the WM_ICON_NAME property as a list of strings or #f if it does not exist. . .Pr set-wm-icon-name! window name .LP See \f2XSetTextProperty\fP. \f2name\fP is a list of strings or symbols. . .Pr wm-client-machine window .LP See \f2XGetTextProperty\fP, \f2XGetWMClientMachine\fP. Returns the WM_CLIENT_MACHINE property as a list of strings or #f if it does not exist. . .Pr set-wm-client-machine! window value .LP See \f2XSetTextProperty\fP, \f2XSetWMClientMachine\fP. \f2value\fP is a list of strings or symbols. . .Pr wm-class window .LP See \f2XGetClassHint\fP. Returns a pair (name and class) each component of which is either a string or #f. . .Pr set-wm-class! window name class .LP See\f2 XSetClassHint\fP. \f2name\fP and \f2class\fP are strings or symbols. . .Pr wm-command window .LP See \f2XGetCommand\fP (in X11 Release 4 or newer releases). Returns the value of the WM_COMMAND property of the given window as a list of strings. . .Pr set-wm-command! window command .LP See \f2XSetCommand\fP. \f2command\fP is a list; each element is either a string or a symbol. . .Pr transient-for window .LP See \f2XGetTransientForHint\fP. Returns a window. . .Pr set-transient-for! window property-window .LP See \f2XSetTransientForHint\fP. . .Pr wm-normal-hints window .LP See \f2XGetWMSizeHints\fP. Returns a list of hints. Each element is set to the empty list if the corresponding hint has not been set for the specified window. .LP The elements of the list correspond to the following hints (in this order): \f2x\fP, \f2y\fP, \f2width\fP, and \f2height\fP (program specified); \f2x\fP, \f2y\fP, \f2width\fP and \f2height\fP (user specified); \f2min-width\fP and \f2min-height\fP; \f2max-width\fP and \f2max-height\fP; \f2width-inc\fP and \f2height-inc\fP; \f2min-aspect-x\fP, \f2min-aspect-y\fP, \f2max-aspect-x\fP and \f2max-aspect-y\fP; \f2base-width\fP and \f2base-height\fP; and \f2gravity\fP. All elements are integers except for the value of \f2gravity\fP which is a symbol (see the \f2window-gravity\fP .Ix window-gravity procedure above). . .Pr set-wm-normal-hints! . args .LP See \f2XSetWMSizeHints\fP. For the format of the arguments see \f2create-window\fP .Ix create-window above. Attributes are \f2window\fP (mandatory) and the names of the hints listed under \f2wm-normal-hints\fP .Ix wm-normal-hints above. . .Pr wm-hints window .LP See \f2XGetWMHints\fP. Returns a list of hints. Each element is set to the empty list if the corresponding hint has not been set for the specified window. .LP The elements of the list correspond to the following hints (in this order): \f2input?\fP, \f2initial-state\fP, \f2icon-pixmap\fP, \f2icon-window\fP, \f2icon-x\fP, \f2icon-y\fP, \f2icon-mask\fP, and \f2window-group\fP. The value of \f2input?\fP is a boolean. \f2initial-state\fP is a symbol (\f5dont-care\fP, \f5normal\fP, \f5zoom\fP, \f5iconic\fP, \f5inactive\fP). The values of \f2icon-pixmap\fP and \f2icon-mask\fP are pixmaps. \f2icon-window\fP and \f2window-group\fP are windows. \f2icon-x\fP and \f2icon-y\fP are integers. . .Pr set-wm-hints! . args .LP See \f2XSetWMHints\fP. For the format of the arguments see \f2create-window\fP .Ix create-window above. Attributes are \f2window\fP (mandatory) and the names of the hints listed under \f2wm-hints\fP .Ix wm-hints above. . .Pr icon-sizes window .LP See \f2XGetIconSizes\fP. Returns a vector of lists of six integers (\f2min-width\fP, \f2min-height\fP, \f2max-width\fP, \f2max-height\fP, \f2width-inc\fP, and \f2height-inc\fP). . .Pr set-icon-sizes! window icon-sizes .LP See \f2XSetIconSizes\fP. \f2icon-sizes\fP is a vector of lists of six integers (see \f2icon-sizes\fP .Ix icon-sizes above). . .Ch "Keyboard Utility Functions" . .[[ .Pr display-min-keycode display .Pr display-max-keycode display .]] .LP Returns the minimum/maximum keycode (an integer) for the given display. . .Pr display-keysyms-per-keycode display Returns the number of keysyms per keycode for the given display. . .Pr string\(mi>keysym string .LP See \f2XStringToKeysym\fP. \f2string\fP is a string or a symbol. Returns an integer if \f2XStringToKeysym\fP succeeds, #f otherwise. . .Pr keysym\(mi>string keysym .LP See \f2XKeysymToString\fP. \f2keysym\fP is an integer. Returns #f if \f2XKeysymToString\fP fails. . .Pr keycode\(mi>keysym display keycode index .LP See \f2XKeycodeToKeysym\fP. \f2keycode\fP and \f2index\fP are integers. . .Pr keysym\(mi>keycode display keysym .LP See \f2XKeysymToKeycode\fP. \f2keysym\fP is an integer. . .Pr lookup-string display keycode mask .LP See \f2XLookupString\fP. \f2keycode\fP is an integer. \f2mask\fP is a list of symbols (\f5shift\fP, \f5lock\fP, \f5control\fP, \f5mod1\fP ... \f5mod5\fP, \f5button1\fP ... \f5button5\fP, or \f5any-modifier\fP). . .Pr rebind-keysym display keysym modifiers string .LP See \f2XRebindKeysym\fP. \f2keysym\fP is an integer. \f2modifiers\fP is a vector of integers. . .Pr refresh-keyboard-mapping window type .LP See \f2XRefreshKeyboardMapping\fP. \f2type\fP is a symbol (\f5modifier\fP, \f5keyboard\fP, or \f5pointer\fP). Invokes \f2XRefreshKeyboardMapping\fP with a faked event structure holding the specified window and request type. . .Ch "Other Utility Functions" . .Pr xlib-release-4-or-later? .LP Returns always #t. . .Pr xlib-release-5-or-later? .LP Returns #t iff the Xlib extension is linked together with the X11 Release 5 Xlib or later versions of the Xlib. . .Pr xlib-release-6-or-later? .LP Returns #t iff the Xlib extension is linked together with the X11 Release 6 Xlib or later versions of the Xlib. . .Pr get-default display program option .LP See \f2XGetDefault\fP. \f2program\fP and \f2option\fP are strings or symbols. Returns a string of #f if the option does not exist for the specified program. . .Pr resource-manager-string display .LP See \f2XResourceManagerString\fP. Returns a string or #f if the RESOURCE_MANAGER property does not exist on the root window. . .Pr parse-geometry string .LP See \f2XParseGeometry\fP. Returns a list of six elements: two booleans indicating whether x or or y are negative and four integers (x, y, width, and height). Each of the elements can be #f to indicate that the respective value was not found in the string. . .Pr parse-color colormap string .LP See \f2XParseColor\fP. Returns an object of type \f2color\fP or #f if \f2XParseColor\fP fails. . .Pr store-buffer display bytes buffer .LP See \f2XStoreBuffer\fP. \f2bytes\fP is a string; \f2buffer\fP is an integer between 0 and 7. . .Pr store-bytes display bytes .LP See \f2XStoreBytes\fP. \f2bytes\fP is a string. . .Pr fetch-buffer display buffer .LP See \f2XFetchBuffer\fP. \f2buffer\fP is an integer between 0 and 7. Returns a string. . .Pr fetch-bytes display .LP See \f2XFetchBytes\fP. Returns a string. . .Pr rotate-buffers display delta .LP See \f2XRotateBuffers\fP. \f2delta\fP is an integer (the amount to rotate the buffers). . .Sy with object . body-forms .LP \f2with\fP is a macro. \f2object\fP must be a drawable, a graphics context, or a font. The \f2body-forms\fP are evaluated in order; \f2with\fP returns the value of the last body-form. .LP Within the scope of the \f2with\fP, the first call to an accessor function accessing \f2object\fP (such as \f5window-\fP\f2attribute\fP or \f5font-\fP\f2attribute\fP) causes the result of the corresponding Xlib function to be retained in a cache; subsequent calls just return the value from the cache. Likewise, calls to Xlib functions for mutator functions modifying \f2object\fP (such as \f5set-window-\fP\f2attribute\fP\f5!\fP) are delayed until exit of the \f2with\fP body or until an accessor function is called and the cached data for this accessor function has been invalidated by the call to a mutator function. . .Ch "Server Extension Functions" . .Pr list-extensions display .LP See \f2XListExtensions\fP. Returns a vector of strings. . .Pr query-extension display name .LP See \f2XQueryExtension\fP. \f2name\fP is a string or a symbol. Returns a list of three elements: the major opcode (an integer) or #f if the extension has no major opcode, the base event type code (an integer) of #f if the extension has no additional event types, and the base error code (an integer) of #f if the extension has no additional error codes. \f2query-extension\fP returns #f if the specified extension is not present. . .Ch "Error Handling" . .Va x-error-handler .LP See \f2XSetErrorHandler\fP. If an error event is received and the global variable \f2x-error-handler\fP is bound to a compound procedure, this procedure is invoked with the following arguments: a display, the serial number of the failed request (an integer), the error code (either an integer or one of the symbols \f5bad-request\fP, \f5bad-value\fP, \f5bad-window\fP, \f5bad-pixmap\fP, \f5bad-atom\fP, \f5bad-cursor\fP, \f5bad-font\fP, \f5bad-match\fP, \f5bad-drawable\fP, \f5bad-access\fP, \f5bad-alloc\fP, \f5bad-color\fP, \f5bad-gcontext\fP, \f5bad-id-choice\fP, \f5bad-name\fP, \f5bad-length\fP, or \f5bad-implementation\fP), the major and minor op-code of the failed request (integers), and a resource-ID (an integer). .LP If an error event is received and this variable is not bound to a compound procedure, the Xlib default error handler is invoked. The initial value of this variable is the empty list. . .Va x-fatal-error-handler .LP See \f2XSetIOErrorHandler\fP. If a fatal I/O error occurs and the global variable \f2x-fatal-error-handler\fP is bound to a compound procedure, this procedure is invoked with a display as argument. The procedure must invoke \f2exit\fP. If a fatal error occurs and this variable is not bound to a compound procedure, or if the procedure returns, the Xlib default fatal error handler is invoked and the interpreter terminates with an exit code of 1. The initial value of this variable is the empty list. . .Ch "Interaction with the Garbage Collector" . .PP .Ix "garbage collector" The Scheme garbage collector destroys objects of type \f2colormap\fP, \f2cursor\fP, \f2display\fP, \f2font\fP, \f2gcontext\fP, \f2pixmap\fP, or \f2window\fP that are not longer accessible from within the Scheme program. This is done by invoking the function \f2free-colormap\fP, \f2free-cursor\fP, \f2close-display\fP, \f2close-font\fP, \f2free-gcontext\fP, \f2free-pixmap\fP, or \f2destroy-window\fP, respectively, with the object to be destroyed as an argument. .PP The garbage collector only destroys objects that have been created from with the Scheme program (by functions like \f2create-pixmap\fP or \f2open-display\fP). Objects that have been obtained from the Xlib through functions like \f2display-default-colormap\fP (and are owned by the Xlib internals), are ignored by the garbage collector. .PP Programmers must make sure that an object is accessible during the object's entire lifetime, otherwise future runs of the garbage collector can result in undesired termination of the object. One must be especially careful when results of functions that create new objects (such as \f2create-window\fP) are ignored or assigned to local variables as in .Ss (define dpy (open-display)) (define root (display-root-window dpy)) .sp .5 (do ((x 0 (+ x 10)) (y 0 (+ y 10))) ((= x 50)) (let ((win (create-window 'parent root 'x x 'y y 'width 20 'height 20))) (manage-window win))) .Se .PP In this example, after termination of the do-loop, the garbage collector will destroy the newly created windows, as they are not accessible from within the program. If this is not desired, the windows could be put into a variable (for instance, be \f2consed\fP into a list) that is defined outside of the body of the loop. elk-3.99.8/doc/xlib/Makefile.in0000644000175000017500000003063211577103434013101 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = doc/xlib DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(docsdir)" DATA = $(docs_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ELK_CFLAGS = @ELK_CFLAGS@ ELK_LDFLAGS = @ELK_LDFLAGS@ ELK_LIBS = @ELK_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INCLUDES = @INCLUDES@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOTIF_CFLAGS = @MOTIF_CFLAGS@ MOTIF_LIBS = @MOTIF_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STDINT_HEADER = @STDINT_HEADER@ STRIP = @STRIP@ VERSION = @VERSION@ XAW_CFLAGS = @XAW_CFLAGS@ XAW_LIBS = @XAW_LIBS@ XMKMF = @XMKMF@ XT_CFLAGS = @XT_CFLAGS@ XT_LIBS = @XT_LIBS@ X_CFLAGS = @X_CFLAGS@ X_LIBS = @X_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = xlib.ms CLEANFILES = index.raw index.ms xlib.ps xlib.html @HAVE_GROFF_TRUE@docs_DATA = xlib.ps @HAVE_GROFF_TRUE@docsdir = $(datadir)/doc/@PACKAGE@/ps MANUAL = $(srcdir)/xlib.ms TROFF = groff -ms -t UNROFF = unroff -ms all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/xlib/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/xlib/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-docsDATA: $(docs_DATA) @$(NORMAL_INSTALL) test -z "$(docsdir)" || $(MKDIR_P) "$(DESTDIR)$(docsdir)" @list='$(docs_DATA)'; test -n "$(docsdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(docsdir)" || exit $$?; \ done uninstall-docsDATA: @$(NORMAL_UNINSTALL) @list='$(docs_DATA)'; test -n "$(docsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(docsdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(docsdir)" && rm -f $$files tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(docsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-docsDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-docsDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-docsDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-docsDATA xlib.ps: $(MANUAL) index.ms (cat $(MANUAL) $(srcdir)/../util/tmac.index index.ms; echo ".Tc") \ | $(TROFF) 2> /dev/null > xlib.ps xlib.html: $(MANUAL) (cat $?; echo ".Tc") | $(UNROFF) document=xlib index.ms: $(MANUAL) index.raw sort -f -t'#' +1 -3 +0n index.raw \ | $(AWK) -f $(srcdir)/../util/fixindex.awk \ | $(AWK) -f $(srcdir)/../util/block.awk >index.ms index.raw: $(MANUAL) $(TROFF) $(MANUAL) 2> index.raw >/dev/null #check: # checknr -c.Ul.Pr.Sy.Va.Sh.Ix.Id.Ch -a.Ss.Se.[[.]] $(MANUAL) \ # | grep -v "Empty command" # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: elk-3.99.8/doc/xlib/Makefile.am0000644000175000017500000000140311577076306013071 00000000000000EXTRA_DIST = xlib.ms CLEANFILES = index.raw index.ms xlib.ps xlib.html if HAVE_GROFF docs_DATA = xlib.ps docsdir = $(datadir)/doc/@PACKAGE@/ps endif MANUAL = $(srcdir)/xlib.ms TROFF = groff -ms -t UNROFF = unroff -ms xlib.ps: $(MANUAL) index.ms (cat $(MANUAL) $(srcdir)/../util/tmac.index index.ms; echo ".Tc") \ | $(TROFF) 2> /dev/null > xlib.ps xlib.html: $(MANUAL) (cat $?; echo ".Tc") | $(UNROFF) document=xlib index.ms: $(MANUAL) index.raw sort -f -t'#' +1 -3 +0n index.raw \ | $(AWK) -f $(srcdir)/../util/fixindex.awk \ | $(AWK) -f $(srcdir)/../util/block.awk >index.ms index.raw: $(MANUAL) $(TROFF) $(MANUAL) 2> index.raw >/dev/null #check: # checknr -c.Ul.Pr.Sy.Va.Sh.Ix.Id.Ch -a.Ss.Se.[[.]] $(MANUAL) \ # | grep -v "Empty command" elk-3.99.8/doc/kernel/0000755000175000017500000000000011577110020011417 500000000000000elk-3.99.8/doc/kernel/Makefile.in0000644000175000017500000003066211577103433013425 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = doc/kernel DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(docsdir)" DATA = $(docs_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ELK_CFLAGS = @ELK_CFLAGS@ ELK_LDFLAGS = @ELK_LDFLAGS@ ELK_LIBS = @ELK_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INCLUDES = @INCLUDES@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOTIF_CFLAGS = @MOTIF_CFLAGS@ MOTIF_LIBS = @MOTIF_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STDINT_HEADER = @STDINT_HEADER@ STRIP = @STRIP@ VERSION = @VERSION@ XAW_CFLAGS = @XAW_CFLAGS@ XAW_LIBS = @XAW_LIBS@ XMKMF = @XMKMF@ XT_CFLAGS = @XT_CFLAGS@ XT_LIBS = @XT_LIBS@ X_CFLAGS = @X_CFLAGS@ X_LIBS = @X_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = kernel.ms CLEANFILES = index.raw index.ms kernel.ps kernel.html @HAVE_GROFF_TRUE@docs_DATA = kernel.ps @HAVE_GROFF_TRUE@docsdir = $(datadir)/doc/@PACKAGE@/ps MANUAL = $(srcdir)/kernel.ms TROFF = groff -ms -t UNROFF = unroff -ms all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/kernel/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/kernel/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-docsDATA: $(docs_DATA) @$(NORMAL_INSTALL) test -z "$(docsdir)" || $(MKDIR_P) "$(DESTDIR)$(docsdir)" @list='$(docs_DATA)'; test -n "$(docsdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(docsdir)" || exit $$?; \ done uninstall-docsDATA: @$(NORMAL_UNINSTALL) @list='$(docs_DATA)'; test -n "$(docsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(docsdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(docsdir)" && rm -f $$files tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(docsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-docsDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-docsDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-docsDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-docsDATA kernel.ps: $(MANUAL) index.ms (cat $(MANUAL) $(srcdir)/../util/tmac.index index.ms; echo ".Tc") \ | $(TROFF) 2> /dev/null > kernel.ps kernel.html: $(MANUAL) (cat $?; echo ".Tc") | $(UNROFF) document=kernel index.ms: $(MANUAL) index.raw sort -f -t'#' +1 -3 +0n index.raw \ | $(AWK) -f $(srcdir)/../util/fixindex.awk \ | $(AWK) -f $(srcdir)/../util/block.awk >index.ms index.raw: $(MANUAL) $(TROFF) $(MANUAL) 2> index.raw >/dev/null #check: # checknr -c.Ul.Pr.Sy.Va.Sh.Ix.Id.Ch -a.Ss.Se.[[.]] $(MANUAL) \ # | grep -v "Empty command" # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: elk-3.99.8/doc/kernel/kernel.ms0000644000175000017500000012705711577076306013216 00000000000000.so ../util/tmac.scheme .Ul .ds R "R\*(^4RS .TL Elk \*- The Extension Language Kit .sp .5 Scheme Reference .AU Oliver Laumann . .Ch "Introduction" . .PP This reference manual lists the primitive procedures, special forms, and other facilities implemented by the Scheme interpreter included in Elk. This \f2kernel\fP functionality can be augmented by applications using Elk as their extension language implementation or by reusable Elk extensions (such as the UNIX or X11 extensions included in the distribution). The predefined Elk extensions and the C/C++ programmer's interface to Elk are described in separate documents. .PP Only the procedures and special forms that are not defined by the official Scheme language specification ``\*R'' (William Clinger and Jonathan Rees (editors), \f2Revised\*(^4 Report on the Algorithmic Language Scheme\fP, 1991) are described in detail. The language features that are part of the official language are only mentioned without a description or examples. . .Ch "Lambda Expressions, Procedures" . .Sy lambda formals body .LP See \*R. . .Pr procedure-lambda procedure .LP Returns a copy of the \f2lambda\fP expression which has been evaluated to create the given procedure. .br Example: .Ss (define (square x) (* x x)) (procedure-lambda square) ==> (lambda (x) (* x x)) .Se . .Pr procedure? obj .LP See \*R. . .Pr primitive? obj .LP Returns #t if \f2obj\fP is a primitive procedure, #f otherwise. . .Pr compound? obj .LP Returns #t if \f2obj\fP is a compound procedure (a procedure that has been created by evaluating a lambda expression), #f otherwise. . .Ch "Local Bindings" . .[[ .Sy let bindings body .Sy let* bindings body .Sy letrec bindings body .]] .LP See \*R. . .Ch "Fluid Binding" . .Sy fluid-let bindings body .LP \f2bindings\fP is of the form ((\f2variable\*1\fP \f2init1\fP) ...). The \f2init\fPs are temporarily assigned to the \f2variable\fPs and the \f2body\fP is executed. The variables must be bound in an enclosing scope. When the body is exited normally or by invoking a control point, the old values of the variables are restored. In the latter case, when the control returns back to the body of the fluid-let by invocation of a control point created within the body, the bindings are changed again to the values they had when the body exited. .br Examples: .Ss ((lambda (x) (+ x (fluid-let ((x 3)) x))) 1) ==> 4 .Se .Ss (fluid-let ((print-length 2)) (write '(a b c d))) ==> '(a b ...) .Se .Ss (define (errset thunk) (call-with-current-continuation (lambda (catch) (fluid-let ((error-handler (lambda msg (catch #f)))) (list (thunk)))))) .sp (errset (lambda () (+ 1 2))) ==> (3) (errset (lambda () (/ 1 0))) ==> #f .Se . .Ch "Definitions" . .[[ .Sy define variable expression .Sy define (variable formals) body .Sy define (variable . formal) body .]] .LP See \*R. .br Returns a symbol, the identifier that has been bound. Definitions may appear anywhere within a local body (e.\|g.\& a lambda body or a \f2let\fP). If the \f2expression\fP is omitted, \f2void\fP (the non-printing object) is used. .br Examples: .Ss (define nil #f) .Se .Ss (define ((f x) y) (cons x y)) (define (g x) ((f x) 5)) (g 'a) ==> (a . 5) .Se . .Ch "Assignment" . .Sy set! variable expression .LP See \*R. .br Returns the previous value of \f2variable\fP. .br Examples: .Ss (define-macro (swap x y) `(set! ,x (set! ,y ,x))) .Se . .Ch "Procedure Application" . .Sy operator operand\*1 ... .LP See \*R. \f2operator\fP can be a macro (see below). . .Pr apply arg\*1 ... args .LP See \*R. . .Ch "Quotation, Quasiquotation" . .[[ .Sy quote datum .br .ie \n(.U \f3'\fP\f2datum\fP .el .tl ,\f3'\fP\f2datum\fP,,\f3syntax\fP, .br .ie \n(.U \f2constant\fP .el .tl ,\f2constant\fP,,\f3syntax\fP .]] .Id constant .LP See \*R. . .[[ .Sy quasiquote expression .Sy unquote expression .Sy unquote-splicing expression .]] .LP See \*R. . .Ch "Sequencing" . .Sy begin expression\*1 expression\*2 ... .LP See \*R. . .Sy begin1 expression\*1 expression\*2 ... .LP Identical to \f2begin\fP, except that the result of the first \f2expression\fP is returned. . .Ch "Conditionals" . .[[ .Sy if test consequent alternate .Sy if test consequent .]] .LP See \*R. .br In the first form, \f2alternate\fP can be a sequence of expressions (implicit \f2begin\fP). . .Sy case key clause\*1 clause\*2 ... .LP See \*R. .br Each \f2clause\fP not beginning with \f2else\fP can be of the form .DS ((\f2datum\*1\fP ...) \f2expression\*1\fP \f2expression\*2\fP ...) .DE or .DS (\f2datum\fP \f2expression\*1\fP \f2expression\*2\fP ...) .DE In the latter case, the \f2key\fP is matched against the \f2datum\fP. . .Sy cond clause\*1 clause\*2 ... .LP See \*R. . .[[ .Sy and test\*1 ... .Sy or test\*1 ... .]] .LP See \*R. . .Ch "Booleans" . .Pr not obj .LP See \*R. . .Pr boolean? obj .LP See \*R. . .Ch "Iteration" . .Sy let variable bindings body .LP ``Named \f2let\fP''. See \*R. . .[[ .Pr map procedure list\*1 list\*2 ... .Pr for-each procedure list\*1 list\*2 ... .]] .LP See \*R. \f2for-each\fP returns the empty list. . .Sy do initializations test body .LP See \*R. . .Ch "Continuations" . .Pr call-with-current-continuation procedure .LP See \*R. . .Pr control-point? obj .LP Returns #t if \f2obj\fP is a control point (a continuation), #f otherwise. . .Pr dynamic-wind thunk thunk thunk .LP \f2dynamic-wind\fP is a generalization of the .Ix unwind-protect \f2unwind-protect\fP facility provided by many Lisp systems. .br All three arguments are procedures of no arguments. In the normal case, all three thunks are applied in order. The first thunk is also applied when the body (the second thunk) is entered by the application of a control point created within the body (by means of .Ix call-with-current-continuation \f2call-with-current-continuation\fP). Similarly, the third thunk is also applied whenever the body is exited by invocation of a control point created outside the body. .br Examples: .Ss (define-macro (unwind-protect body . unwind-forms) `(dynamic-wind (lambda () #f) (lambda () ,body) (lambda () ,@unwind-forms))) .Se .Ss (let ((f (open-input-file "foo"))) (dynamic-wind (lambda () #f) (lambda () \f2do something with\fP f) (lambda () (close-input-port f)))) .Se . .Ch "Delayed Evaluation" . .[[ .Sy delay expression .Pr force promise .]] .LP See \*R. . .Pr promise? obj .LP Returns #t if \f2obj\fP is a promise, an object returned by the application of \f2delay\fP. Otherwise #f is returned. . .Ch "Equivalence Predicates" . .[[ .Pr eq? obj\*1 obj\*2 .Pr eqv? obj\*1 obj\*2 .Pr equal? obj\*1 obj\*2 .]] .LP See \*R. . .Ch "Pairs and Lists" . .Pr cons obj\*1 obj\*2 .LP See \*R. . .[[ .Pr car pair .Pr cdr pair .]] .LP See \*R. . .Pr cxr pair pattern .LP \f2pattern\fP is either a symbol or a string consisting of a combination of the characters `a' and `d'. It encodes a sequence of \f2car\fP and \f2cdr\fP operations; each `a' denotes the application of \f2car\fP, and each `d' denotes the application of \f2cdr\fP. For example, \f2(cxr p "ada")\fP is equivalent to \f2(cadar p)\fP. . .Pr caar pair .br ... .br .Pr cddddr pair .LP See \*R. . .[[ .Pr set-car! pair obj .Pr set-cdr! pair obj .]] .LP See \*R. .br Both procedures return \f2obj\fP. . .Pr make-list k obj .LP Returns a list of length \f2k\fP initialized with \f2obj\fP. .br Examples: .Ss (make-list 0 'a) ==> () (make-list 2 (make-list 2 1)) ==> ((1 1) (1 1)) .Se . .Pr list obj ... .LP See \*R. . .Pr length list .LP See \*R. . .Pr list-ref list k .LP See \*R. . .Pr list-tail list k .LP See \*R. . .Pr last-pair list .LP See \*R. . .Pr append list ... .LP See \*R. . .Pr append! list ... .LP Like \f2append\fP, except that the original arguments are modified (destructive \f2append\fP). The cdr of each argument is changed to point to the next argument. .br Examples: .Ss (define x '(a b)) (append x '(c d)) ==> (a b c d) x ==> (a b) (append! x '(c d)) ==> (a b c d) x ==> (a b c d) .Se . .Pr reverse list .LP See \*R. . .Pr reverse! list .LP Destructive \f2reverse\fP. . .[[ .Pr memq obj list .Pr memv obj list .Pr member obj list .]] .LP See \*R. . .[[ .Pr assq obj alist .Pr assv obj alist .Pr assoc obj alist .]] .LP See \*R. . .[[ .Pr null? obj .Pr pair? obj .]] .LP See \*R. . .Pr list? obj .LP See \*R. . .Ch "Numbers" . .[[ .Pr = z\*1 z\*2 ... .Pr < z\*1 z\*2 ... .Pr > z\*1 z\*2 ... .Pr <= z\*1 z\*2 ... .Pr >= z\*1 z\*2 ... .]] .LP See \*R. . .[[ .Pr 1+ z .Pr -1+ z .]] .LP Returns \f2z\fP plus 1 or \f2z\fP minus 1, respectively. . .Pr 1- z .LP A synonym for \f2-1+\fP (for backwards compatibility). . .[[ .Pr + z\*1 ... .Pr * z\*1 ... .]] .LP See \*R. . .[[ .Pr - z\*1 z\*2 ... .Pr / z\*1 z\*2 ... .]] .LP See \*R. . .[[ .Pr zero? z .Pr positive? z .Pr negative? z .Pr odd? z .Pr even? z .Pr exact? z .Pr inexact? z .]] .LP See \*R. . .Pr abs z .LP See \*R. . .[[ .Pr quotient n\*1 n\*2 .Pr remainder n\*1 n\*2 .Pr modulo n\*1 n\*2 .]] .LP See \*R. . .[[ .Pr gcd n\*1 ... .Pr lcm n\*1 ... .]] .LP See \*R. . .[[ .Pr floor x .Pr ceiling x .Pr truncate x .Pr round x .]] .LP See \*R. . .Pr sqrt z .LP See \*R. . .Pr expt z\*1 z\*2 .LP See \*R. . .[[ .Pr exp z .Pr log z .Pr sin z .Pr cos z .Pr tan z .Pr asin z .Pr acos z .Pr atan z .Pr atan y x .]] .LP See \*R. . .[[ .Pr min x\*1 x\*2 ... .Pr max x\*1 x\*2 ... .]] .LP See \*R. . .Pr random .LP Returns an integer pseudo-random number in the range from 0 to .ie \n(.U 2^31-1. .el 2\v'-.3m'\s-131\s0\v'.3m'-1. . .Pr srandom n .LP Sets the random number generator to the starting point \f2n\fP. \f2srandom\fP returns \f2n\fP. . .[[ .Pr number? obj .Pr complex? obj .Pr real? obj .Pr rational? obj .Pr integer? obj .]] .LP See \*R. . .[[ .Pr exact\(mi>inexact z .Pr inexact\(mi>exact z .]] .LP See \*R. . .[[ .Pr number\(mi>string number .Pr number\(mi>string number radix .]] .LP See \*R. . .[[ .Pr string\(mi>number string .Pr string\(mi>number string radix .]] .LP See \*R. . .Ch "Characters" . .[[ .Pr char\(mi>integer char .Pr integer\(mi>char n .]] .LP See \*R. . .[[ .Pr char-upper-case? char .Pr char-lower-case? char .]] .LP See \*R. . .[[ .Pr char-alphabetic? char .Pr char-numeric? char .Pr char-whitespace? char .]] .LP See \*R. . .[[ .Pr char-upcase char .Pr char-downcase char .]] .LP See \*R. . .[[ .Pr char=? char\*1 char\*2 .Pr char? char\*1 char\*2 .Pr char<=? char\*1 char\*2 .Pr char>=? char\*1 char\*2 .]] .LP See \*R. . .[[ .Pr char-ci=? char\*1 char\*2 .Pr char-ci? char\*1 char\*2 .Pr char-ci<=? char\*1 char\*2 .Pr char-ci>=? char\*1 char\*2 .]] .LP See \*R. . .Pr char? obj .LP See \*R. . .Ch "Strings" . .Pr string char ... .LP Returns a string containing the specified characters. .br Examples: .Ss (string) ==> "" (string #\ea #\espace #\eb) ==> "a b" .Se . .Pr string? obj .LP See \*R. . .Pr make-string k char .LP See \*R. . .Pr string-length string .LP See \*R. . .Pr string-ref string k .LP See \*R. . .Pr string-set! string k char .LP See \*R. .br Returns the previous value of element \f2k\fP of the given string. . .Pr substring string start end .LP See \*R. . .Pr string-copy string .LP See \*R. . .Pr string-append string ... .LP See \*R. . .[[ .Pr list\(mi>string chars .Pr string\(mi>list string .]] .LP See \*R. . .Pr string-fill! string char .LP See \*R. .br Returns \f2string\fP. . .Pr substring-fill! string start end char .LP Stores \f2char\fP in every element of \f2string\fP from \f2start\fP (inclusive) to \f2end\fP (exclusive). Returns \f2string\fP. . .[[ .Pr string=? string\*1 string\*2 .Pr string? string\*1 string\*2 .Pr string<=? string\*1 string\*2 .Pr string>=? string\*1 string\*2 .]] .LP See \*R. . .[[ .Pr string-ci=? string\*1 string\*2 .Pr string-ci? string\*1 string\*2 .Pr string-ci<=? string\*1 string\*2 .Pr string-ci>=? string\*1 string\*2 .]] .LP See \*R. . .[[ .Pr substring? string\*1 string\*2 .Pr substring-ci? string\*1 string\*2 .]] .LP If \f2string\*1\fP is a substring of \f2string\*2\fP, these procedures return the starting position of the first occurrence of the substring within \f2string\*2\fP. Otherwise #f is returned. \f2substring-ci?\fP is the case insensitive version of \f2substring?\fP. .br Examples: .Ss (define s "Hello world") (substring? "foo" x) ==> #f (substring? "hello" x) ==> #f (substring-ci? "hello" x) ==> 0 (substring? "!" x) ==> 11 .Se . .Ch "Vectors" . .Pr vector? obj .LP See \*R. . .[[ .Pr make-vector k .Pr make-vector k fill .]] .LP See \*R. . .Pr vector obj ... .LP See \*R. . .Pr vector-length vector .LP See \*R. . .Pr vector-ref vector k .LP See \*R. . .Pr vector-set! vector k obj .LP See \*R. .br Returns the previous value of element \f2k\fP of the vector. . .[[ .Pr vector\(mi>list vector .Pr list\(mi>vector list .]] .LP See \*R. . .Pr vector-fill! vector fill .LP See \*R. .br Returns \f2vector\fP. . .Pr vector-copy vector .LP Returns a copy of \f2vector\fP. . .Ch "Symbols" . .[[ .Pr string\(mi>symbol string .Pr symbol\(mi>string symbol .]] .LP See \*R. . .[[ .Pr put symbol key value .Pr put symbol key .]] .LP Associates \f2value\fP with \f2key\fP in the .Ix "property list" property list of the given symbol. \f2key\fP must be a symbol. Returns \f2key\fP. .br If \f2value\fP is omitted, the property is removed from the symbol's property list. . .Pr get symbol key .LP Returns the value associated with \f2key\fP in the .Ix "property list" property list of \f2symbol\fP. \f2key\fP must be a symbol. If no value is associated with \f2key\fP in the symbol's property list, #f is returned. .br Examples: .Ss (put 'norway 'capital "Oslo") (put 'norway 'continent "Europe") (get 'norway 'capital) ==> "Oslo" .Se . .Pr symbol-plist symbol .LP Returns a copy of the .Ix "property list" property list of \f2symbol\fP as an \f2alist\fP. .br Examples: .Ss (put 'norway 'capital "Oslo") (put 'norway 'continent "Europe") (symbol-plist 'norway) ==> ((capital . "Oslo") (continent . "Europe")) (symbol-plist 'foo) ==> () .Se . .Pr symbol? obj .LP See \*R. . .Pr oblist .LP Returns a list of lists containing all currently interned symbols. Each sublist represents a bucket of the interpreters internal hash array. .br Examples: .Ss (define (apropos what) (let ((ret ())) (do ((tail (oblist) (cdr tail))) ((null? tail)) (do ((l (car tail) (cdr l))) ((null? l)) (if (substring? what (symbol->string (car l))) (set! ret (cons (car l) ret))))) ret)) .Se .Ss (apropos "let") ==> (let* let letrec fluid-let) (apropos "make") ==> (make-list make-vector make-string) (apropos "foo") ==> () .Se . .Ch "Environments" . .Pr the-environment .LP Returns the current environment. . .Pr global-environment .LP Returns the global environment (the ``root'' environment in which all predefined procedures are bound). . .Pr environment\(mi>list environment .LP Returns a list representing the specified environment. The list is a list of \f2frames\fP, each frame is a list of bindings (an \f2alist\fP). The car of the list represents the most recently established environment. The list returned by \f2environment\(mi>list\fP can contain cycles. .br Examples: .Ss (let ((x 1) (y 2)) (car (environment->list (the-environment)))) ==> ((y . 2) (x . 1)) .Se .Ss ((lambda (foo) (caar (environment->list (the-environment)))) "abc") ==> (foo . "abc") .Se .Ss (eq? (car (last-pair (environment->list (the-environment)))) (car (environment->list (global-environment)))) ==> #t .Se . .[[ .Pr procedure-environment procedure .Pr promise-environment promise .Pr control-point-environment control-point .]] .LP Returns the environment in which the the body of the \f2procedure\fP is evaluated, the environment in which a value for the \f2promise\fP is computed when \f2force\fP is applied to it, or the environment in which the \f2control-point\fP has been created, respectively. . .Pr environment? obj .LP Returns #t if \f2obj\fP is an environment, #f otherwise. . .Ch "Ports and Files" .LP Generally, a .Ix "file name" file name can either be a string or a symbol. If a symbol is given, it is converted into a string by applying .Ix symbol\(mi>string \f2symbol\(mi>string\fP. A .Ix tilde tilde at the beginning of a file name is expanded according to the rules employed by the C-Shell (see \f2csh\fP(1)). .LP Elk adds a third type of ports, \f2input-output\fP (bidirectional) ports. Both \f2input-port?\fP and \f2output-port?\fP return #t when applied to an input-output port, and both input primitives and output primitives may be applied to input-output ports. An input-output port (in fact, \f2any\fP port) may be closed with any of the primitives \f2close-input-port\fP and \f2close-output-port\fP. .LP The only way to create an input-output-port is by means of the procedure .Ix open-input-output-file \f2open-input-output-file\fP. Extensions may provide additional means to create bidirectional ports. . .[[ .Pr call-with-input-file file procedure .Pr call-with-output-file file procedure .]] .LP See \*R. . .[[ .Pr input-port? obj .Pr output-port? obj .]] .LP See \*R. . .[[ .Pr current-input-port .Pr current-output-port .]] .LP See \*R. . .[[ .Pr with-input-from-file file thunk .Pr with-output-to-file file thunk .]] .LP See \*R. .br \f2file\fP can be a string as well as a symbol. . .[[ .Pr open-input-file file .Pr open-output-file file .Pr open-input-output-file file .]] .LP See \*R. .br \f2file\fP can be a string as well as a symbol. \f2open-input-output-file\fP opens the file for reading and writing and returns an input-output port; the file must exist and is not truncated. . .[[ .Pr close-input-port port .Pr close-output-port port .]] .LP See \*R. .br Calls to \f2close-input-port\fP and \f2close-output-port\fP are ignored when applied to string ports or to ports connected with the standard input or standard output of the process. . .[[ .Pr clear-output-port .Pr clear-output-port output-port .]] .LP If the argument is omitted, it defaults to the current output port. .br In case of ``buffered'' output, this procedure is used to discard all characters that have been output to the port but have not yet been sent to the file associated with the port. . .[[ .Pr flush-output-port .Pr flush-output-port output-port .]] .LP If the argument is omitted, it defaults to the current output port. .br In case of ``buffered'' output, this procedure is used to force all characters that have been output to the port to be printed immediately. This may be necessary to force output that is not terminated with a newline to appear on the terminal. An output port is flushed automatically when it is closed. . .[[ .Pr clear-input-port .Pr clear-input-port input-port .]] .LP If the argument is omitted, it defaults to the current input port. .br In case of ``buffered'' input, this procedure discards all characters that have already been read from the file associated with the port but have not been processed using \f2read\fP or similar procedures. . .Pr port-file-name port .LP Returns the name of the file associated with \f2port\fP if it is a file port, #f otherwise. . .Pr port-line-number .LP Returns the current line number of a file input port or string input port, i.\|e.\& the number of newline characters that have been read from this port plus one. ``Unreading'' a newline character decrements the line number, but it never drops below one. The result of applying \f2port-line-number\fP to an output port is undefined. . .Pr tilde-expand file .LP If \f2file\fP starts with a tilde, performs tilde expansion as described above and returns the result of the expansion (a string); returns \f2file\fP otherwise. \f2file\fP is a string or a symbol. . .Pr file-exists? file .LP Returns #t if \f2file\fP is accessible, #f otherwise. \f2file\fP is a string or a symbol; tilde expansion is not performed. . .Ch "Input" . .[[ .Pr read .Pr read input-port .]] .LP See \*R. . .[[ .Pr read-char .Pr read-char input-port .]] .LP See \*R. . .[[ .Pr read-string .Pr read-string input-port .]] .LP If the argument is omitted, it defaults to the current input port. .br Returns the rest of the current input line as a string (not including the terminating newline). . .[[ .Pr unread-char char .Pr unread-char char input-port .]] .LP If the second argument is omitted, it defaults to the current input port. .br Pushes \f2char\fP back on the stream of input characters. It is \f2not\fP an error for \f2char\fP not to be the last character read from the port. It is undefined whether more than one character can be pushed back without an intermittent read operation, and whether a character can be pushed back before something has been read from the port. The procedure returns \f2char\fP. . .[[ .Pr peek-char .Pr peek-char input-port .]] .LP See \*R. .LP \f2peek-char\fP uses \f2unread-char\fP to push back the character. . .Pr eof-object? obj .LP See \*R. . .Pr char-ready? input-port .LP See \*R. .LP \f2char-ready\fP cannot be implemented correctly based on C FILE pointers. In the current version, \f2char-ready\fP can return #f although a call to \f2read-char\fP would not block. . .Ch "Output" . .[[ .Va print-length .Va print-depth .]] .LP These variables are defined in the global environment. They control the maximum length and maximum depth, respectively, of a list or vector that is printed. If one of the variables is not bound to an integer, or if its value exceeds a certain, large maximum value (which is at least 2^20), a default value is taken. The default value for \f2print-length\fP is 1000, and the default value for \f2print-depth\fP is 20. Negative values of \f2print-length\fP and \f2print-depth\fP are treated as ``unlimited'', i.\|e.\& output is not truncated. . .[[ .Pr write obj .Pr write obj output-port .]] .LP See \*R. . .[[ .Pr display obj .Pr display obj output-port .]] .LP See \*R. . .[[ .Pr write-char char .Pr write-char char output-port .]] .LP See \*R. . .[[ .Pr newline .Pr newline output-port .]] .LP See \*R. . .[[ .Pr print obj .Pr print obj output-port .]] .LP If the second argument is omitted, it defaults to the current output port. .br Prints \f2obj\fP using \f2write\fP and then prints a newline. \f2print\fP returns \f2void\fP. . .Pr format destination format-string obj ... .LP Prints the third and the following arguments according to the specifications in the string \f2format-string\fP. Characters from the format string are copied to the output. When a tilde is encountered in the format string, the tilde and the immediately following character are replaced in the output as follows: .IP "~s" is replaced by the printed representation of the next \f2obj\fP in the sense of \f2write\fP. .IP "~a" is replaced by the printed representation of the next \f2obj\fP in the sense of \f2display\fP. .IP "~~" is replaced by a single tilde. .IP "~%" is replaced by a newline. .LP An error is signaled if fewer \f2obj\fPs are provided than required by the given format string. If the format string ends in a tilde, the tilde is ignored. .LP If \f2destination\fP is #t, the output is sent to the current output port; if #f is given, the output is returned as a string; otherwise, \f2destination\fP must be an output or input-output port. .br Examples: .Ss (format #f "Hello world!") ==> "Hello world" (format #f "~s world!" "Hello") ==> "\e"Hello\e" world" (format #f "~a world!" "Hello") ==> "Hello world" (format #f "Hello~a") ==> "Hello!" .Se .Ss (define (flat-size s) (fluid-let ((print-length 1000) (print-depth 100)) (string-length (format #f "~a" s)))) .Se .Ss (flat-size 1.5) ==> 3 (flat-size '(a b c)) ==> 7 .Se . .Ch "String Ports" .LP .Ix "string ports" String ports are similar to file ports, except that characters are appended to a string instead of being sent to a file, or taken from a string instead of being read from a file. It is not necessary to close string ports. When an string input port has reached the end of the input string, successive read operations return end-of-file. . .Pr open-input-string string .LP Returns a new string input port initialized with \f2string\fP. .br Examples: .Ss (define p (open-input-string "Hello world!")) (read-char p) ==> #\eH (read p) ==> ello (read p) ==> world! (read p) ==> \f2end of file\fP .Se .Ss (define p (open-input-string "(cons 'a 'b)")) (eval (read p)) ==> (a . b) .Se . .Pr open-output-string .LP Returns a new string output port. . .Pr get-output-string string-output-port .LP Returns the string currently associated with the specified string output port. As a side-effect, the string is reset to zero length. .br Examples: .Ss (define p (open-output-string)) (display '(a b c) p) (get-output-string p) ==> "(a b c)" (get-output-string p) ==> "" .Se .Ss (define (flat-size s) (let ((p (open-output-string))) (display s p) (string-length (get-output-string p)))) .Se . .Ch "Loading" . .[[ .Pr load file .Pr load file environment .]] .LP Loads a source file or one or more object files. If the file contains source code, the expressions in the file are read and evaluated. If a file contains .Ix "object code" object code, the contents of the file is linked together with the running interpreter and with additional libraries that are specified by the variable .Ix load-libraries \f2load-libraries\fP (see below). Names of .Ix "object files" object files must have the .Ix suffix suffix ``.o''. \f2load\fP returns \f2void\fP. .LP \f2file\fP must be either a string or a symbol or a list of strings or symbols. If it is a list, all elements of the list must be the names of object files. In this case, all object files are linked by a single run of the .Ix linker linker. .br If an optional \f2environment\fP is specified, the contents of the file is evaluated in this environment instead of the current environment. .LP Loading of object files is not supported on some platforms. On the platforms where it is supported, the feature .Ix feature .Ix elk:load-object \f2elk:load-object\fP is provided by the interpreter on startup (see ``Features'' below). .br Example: .Ss (fluid-let ((load-noisily? #t)) (load 'test.scm)) .Se . .Va load-path .LP This variable is defined in the global environment. It is bound to a list of directories in which files to be loaded are searched for. Each element of the list (a string or a symbol) is used in turn as a prefix for the file name passed to \f2load\fP until opening succeeds. Elements of \f2load-path\fP that are not of type string or symbol are ignored. .LP If the value of \f2load-path\fP is not a list of at least one valid component, or if the name of the file to be loaded starts with ``/'' or with ``~'', it is opened directly. .LP The initial value of \f2load-path\fP is a list of the three elements ``.'' (i.\|e.\& the current directory), ``$scheme_dir'', and ``$lib_dir''; $scheme_dir and $lib_dir are the directories into which the runtime Scheme files and object files are installed (typically ``/usr/elk/runtime/scm'' and ``/usr/elk/runtime/obj''; defined in the installation's .Ix "site file" site file). . .Va load-noisily? .LP This variable is defined in the global environment. When a file is loaded and the value of \f2load-noisily?\fP is true, the result of the evaluation of each expression is printed. The initial value of \f2load-noisily?\fP is #f. . .Va load-libraries .LP This variable is defined in the global environment. If \f2load-libraries\fP is bound to a string, its value specifies additional load libraries to be linked together with an .Ix "object file" object file that is loaded into the interpreter (see \f2load\fP above). Its initial value is ``\-lc''. . .Pr autoload symbol file .LP Binds \f2symbol\fP in the current environment (as with \f2define\fP). When \f2symbol\fP is evaluated the first time, \f2file\fP is loaded. The definitions loaded from the file must provide a definition for \f2symbol\fP different from \f2autoload\fP, otherwise an error is signaled. .LP \f2file\fP must be either a string or a symbol or a list of strings or symbols, in which case all elements of the list must be the names of .Ix "object file" object files (see \f2load\fP above). . .Va autoload-notify? .LP This variable is defined in the global environment. If the value of \f2autoload-notify?\fP is true, a message is printed whenever evaluation of a symbol triggers autoloading of a file. \f2autoload-notify?\fP is bound to #t initially. . .Ch "Macros" . .Sy macro formals body .LP This special form creates a macro. The syntax is identical to the syntax of \f2lambda\fP expressions. When a macro is called, the actual arguments are bound to the formal arguments of the \f2macro\fP expression \f2in the current environment\fP (they are \f2not\fP evaluated), then the \f2body\fP is evaluated. The result of this evaluation is considered the \f2macro expansion\fP and is evaluated in place of the macro call. . .[[ .Sy define-macro (variable formals) body .Sy define-macro (variable . formal) body .]] .LP Like \f2define\fP, except that \f2macro\fP is used instead of \f2lambda\fP. .br Examples: .Ss (define-macro (++ x) `(set! ,x (1+ ,x))) (define foo 5) foo ==> 5 (++ foo) foo ==> 6 .Se .Ss (define-macro (while test . body) `(let loop () (cond (,test ,@body (loop))))) .Se . .Pr macro? obj .LP Returns #t if \f2obj\fP is a macro, #f otherwise. . .Pr macro-body macro .LP Returns a copy of the \f2macro\fP expression which has been evaluated to created the given macro (similar to .Ix procedure-lambda \f2procedure-lambda\fP). .br Examples: .Ss (define-macro (++ x) `(set! ,x (1+ ,x))) .sp (macro-body ++) ==> (macro (x) (quasiquote (set! (unquote x) (1+ (unquote x))))) .Se . .Pr macro-expand list .LP If the expression \f2list\fP is a macro call, the macro call is expanded. .br Examples: .Ss (define-macro (++ x) `(set! ,x (1+ ,x))) .sp (macro-expand '(++ foo)) ==> (set! foo (1+ foo)) .Se .sp The following function can be used to expand \f2all\fP macro calls in an expression, i.\|e.\& not only at the outermost level: .Ss (define (expand form) (if (or (not (pair? form)) (null? form)) form (let ((head (expand (car form))) (args (expand (cdr form))) (result)) (if (and (symbol? head) (bound? head)) (begin (set! result (macro-expand (cons head args))) (if (not (equal? result form)) (expand result) result)) (cons head args))))) .Se . .Ch "Error and Exception Handling" . .Va error-handler .LP This variable is defined in the global environment. When an error occurs or when the procedure \f2error\fP is invoked and the variable \f2error-handler\fP is bound to a compound procedure (the \f2error handler\fP), the interpreter invokes this procedure. The error handler is called with an object (either the first argument that has been passed to \f2error\fP or a symbol identifying the primitive procedure that has caused the error), and an error message consisting of a format string and a list of objects suitable to be passed to .Ix format \f2format\fP. .LP Typically, a user-defined error handler prints the error message and then calls a control point that has been created outside the error handler. If the error handler terminates normally or if \f2error-handler\fP is not bound to a procedure, the error message is printed in a default way, and then a .Ix reset \f2reset\fP is performed. . .Va interrupt-handler .LP This variable is defined in the global environment. When an interrupt occurs (typically as a result of typing the interrupt character on the keyboard), and the variable \f2interrupt-handler\fP is bound to a procedure (the \f2interrupt handler\fP), this procedure is called with no arguments. If \f2interrupt-handler\fP is not bound to a procedure or if the procedure terminates normally, a message is printed, and a .Ix reset \f2reset\fP is performed. .br Examples: .Ss (set! interrupt-handler (lambda () (newline) (backtrace) (reset))) .Se . .[[ .Pr disable-interrupts .Pr enable-interrupts .]] .LP \f2disable-interrupts\fP causes .Ix signals signals to be blocked from delivery to the interpreter; \f2enable-interrupts\fP enables delivery of signals. These functions control delivery of keyboard-generated interrupt signals (see \f2interrupt-handler\fP above) as well as additional signals used by extensions (such as the alarm signal). The interpreter automatically blocks delivery of signals during critical operations, such as garbage collection. Signals are enabled on startup after initialization has completed. .LP A call to \f2enable-interrupts\fP immediately delivers signals that have been generated while signals were disabled, but blocked signals are not queued. On platforms that support neither POSIX-style nor BSD-style reliable signals, \f2disable-interrupts\fP causes signals to be ignored (as opposed to blocking them until the next call to \f2enable-interrupts\fP). .LP Calls to \f2disable-interrupts\fP and \f2enable-interrupts\fP can be nested. The functions maintain a count indicating the number of calls to \f2enable-interrupts\fP that it takes to return from a nested \f2disable-interrupts\fP invocation to the topmost level (i.\|e.\& to actually enable delivery of signals again). Both functions return this nesting level as an integer. .LP Example: the following loop ensures that delivery of signals is enabled, regardless of the current nesting depth of \f2disable-interrupts\fP calls: .Ss (let loop ((intr-level (enable-interrupts))) (if (positive? intr-level) (loop (enable-interrupts)))) .Se .LP .Ix dynamic-wind \f2dynamic-wind\fP can be used to write a macro .Ix with-interrupts-disabled \f2with-interrupts-disabled\fP to protect a .Ix "critical section" critical section of code from being interrupted by a signal: .Ss (define-macro (with-interrupts-disabled . body) `(dynamic-wind (lambda () (disable-interrupts)) (lambda () ,@body) (lambda () (enable-interrupts)))) .Se . .Pr error obj string obj ... .LP Signals an error. The arguments of \f2error\fP are passed to the .Ix error-handler \f2error-handler\fP. .br Examples: .Ss (define (foo sym) (if (not (symbol? sym)) (error 'foo "argument not a symbol: ~s" sym)) ... .Se . .[[ .Va top-level-control-point .Pr reset .]] .LP \f2reset\fP performs a reset by calling the control point to which the variable \f2top-level-control-point\fP is bound in the global environment. The control point is called with the argument #t. If \f2top-level-control-point\fP is not bound to a control point, or does not exist at all, an error message is printed and the interpreter is terminated. .br Examples: .Ss (if (call-with-current-continuation (lambda (x) (fluid-let ((top-level-control-point x)) \0\0\0\0\0\0\0\0\0\0\f2do\0something\fP #f))) (print "Got a reset!")) .Se . .[[ .Pr exit .Pr exit n .]] .LP Terminates the interpreter. The optional argument \f2n\fP indicates the .Ix "exit code" exit code; it defaults to zero. . .Ch "Garbage Collection" .LP The interpreter supports two .Ix "garbage collector" garbage collectors: the .Ix "garbage collector, stop-and-copy" stop-and-copy garbage collector that was part of older versions of Elk, and a .Ix "garbage collector, generational" .Ix "garbage collector, incremental" generational, incremental garbage collector. .LP If generational garbage collection has been selected, Scheme objects surviving two garbage collections will not be touched again until there is only a certain amount of memory left on the heap, triggering a full garbage collection. Particularly in applications with large amounts of Scheme code or constant data, partial garbage collections run much faster than full garbage collections. In contrast to the stop-and-copy garbage collector, the generational garbage collector is not limited to a pre-allocated amount of heap; it will expand the heap in steps of 1 MB if the free space left after a full garbage collection falls below a certain amount. .LP Another feature of the generational garbage collector (available on some platforms only) is the ability to do incremental garbage collection. Starting a garbage collection does not interrupt the application until the garbage collector is done. Instead, the collector returns control to the application almost immediately. To synchronize between the garbage collection and the running application, the code makes use of the \f2mprotect\fP system call. . .Pr garbage-collect-status strategy mode .LP \f2garbage-collect-status\fP is used to select a garbage collector and an optional, garbage collector specific mode of operation, and to query the currently enabled garbage collector and mode. .LP \f2strategy\fP is a symbol identifying a garbage collector. Permitted values are \f2stop-and-copy\fP and \f2generational\fP (future version of Elk may support additional garbage collectors). The optional \f2mode\fP argument may be specified if the \f2strategy\fP argument is equal to \f2generational\fP. Currently, only the symbol \f2incremental\fP may be used for the \f2mode\fP argument to enable incremental garbage collection. .LP The current version of the interpreter does not support dynamic switching between the stop-and-copy and the generational, incremental garbage collector at runtime. Instead, a garbage collector has to be selected at compile time (by setting the \f2generational_gc\fP variable in the installation's .Ix "site file" site file to either \f2yes\fP or \f2no\fP). Thus, \f2garbage-collect-status\fP can currently only be used to query the garbage collector and, if the generational, incremental garbage collector has been selected, to enable and disable incremental garbage collection (this restriction may be removed in future versions). .LP \f2garbage-collect-status\fP returns a list of symbols indicating the currently enabled garbage collector and mode. This list resembles the arguments to \f2garbage-collect-status\fP, i.\|e.\& the first element of the list one of the symbols \f2stop-and-copy\fP and \f2generational\fP, and an optional, second symbol (\f2incremental\fP) may be present if the first symbol is equal to \f2generational\fP. .LP If \f2garbage-collect-status\fP is invoked with no arguments, or if the desired garbage collector or mode of operation cannot be enabled (either because selection of a strategy at runtime is not supported, of because the mode of operation cannot be supported), the primitive just returns the currently active strategy and mode. . .Pr collect .LP Causes a garbage collection. Even if incremental garbage collection has been enabled, \f2collect\fP always performs a full garbage collection run. . .Pr collect-incremental .LP This primitive is only present if the generational garbage collector has been selected. An error is signaled if \f2collect-incremental\fP is invoked and incremental garbage collection has not been enabled, i.\|e.\& if a call to \f2garbage-collect-status\fP would return the list \f2(generational)\fP. .LP \f2collect-incremental\fP starts an incremental garbage collection and then returns immediately. If an incremental garbage collection is already in progress, \f2collect-incremental\fP triggers one incremental garbage collection step, i.\|e.\& scans a few more pages of memory, and then returns immediately. The primitive returns true if the incremental garbage collection has been finished, false otherwise. .LP If incremental garbage collection is disabled by a call to \f2(garbage-collect-status 'generational)\fP while an incremental garbage collection run is in progress, the next call to \f2collect-incremental\fP finishes the incremental garbage collection run and returns #t; further calls to \f2collect-incremental\fP will signal an error. . .Va garbage-collect-notify? .LP This variable is defined in the global environment. If the value of \f2garbage-collect-notify?\fP is true, a message indicating the amount of free memory on the heap and the size of the heap are displayed whenever a stop-and-copy garbage collection is performed. If the generational, incremental garbage collector has been enabled, the amount of reclaimed memory is displayed on each garbage collection run, and a message is displayed each time the heap is expanded by the garbage collector. \f2garbage-collect-notify?\fP is bound to #t initially. . .Ch "Features" . .Pr feature? symbol .LP Returns #t if \f2symbol\fP is a feature, i.\|e.\& \f2provide\fP has been called to indicate that the feature \f2symbol\fP is present; #f otherwise. . .Pr provide symbol .LP Indicates that the feature \f2symbol\fP is present. Returns \f2void\fP. . .[[ .Pr require symbol .Pr require symbol file .Pr require symbol file environment .]] .LP If the feature \f2symbol\fP is not present (i.\|e. (feature? \f2symbol\fP) evaluates to #f), \f2file\fP is loaded. A message is displayed prior to loading the file if the value of the global variable \f2autoload-notify?\fP is true. If the feature is still not present after the file has been loaded, an error is signaled. .LP If the \f2file\fP argument is omitted, it defaults to \f2symbol\fP; if \f2symbol\fP does not end in a .Ix suffix suffix (i.\|e.\& does not contain a dot character), the suffix \f2.scm\fP is appended to obtain a file name. .LP If an \f2environment\fP argument is supplied, the file is loaded into given environment. If the \f2environment\fP argument is omitted, it defaults to the current environment. .LP \f2file\fP must be either a string or a symbol or a list of strings or symbols, in which case all elements of the list must be the names of object files (see \f2load\fP above). . .Pr features .LP Returns the currently provided features a list of symbols. . .Ch "Miscellaneous" . .Pr dump file .LP Writes a snapshot of the running interpreter to \f2file\fP and returns #f. When \f2file\fP is executed, execution of the interpreter resumes such that the call to \f2dump\fP returns #t (i.e., \f2dump\fP actually returns twice). \f2dump\fP closes all ports except the current input and current output port. .LP This primitive is not supported on platforms that are not capable of creating an executable file from the memory image of the running process. If \f2dump\fP is available, the .Ix feature .Ix elk:dump feature \f2elk:dump\fP is provided by the interpreter on startup (see ``Features'' above). . .[[ .Pr eval list .Pr eval list environment .]] .LP Evaluates the expression \f2list\fP in the specified environment. If \f2environment\fP is omitted, the expression is evaluated in the current environment. .br Examples: .Ss (let ((car 1)) (eval 'car (global-environment))) ==> \f2primitive\fP \f1car\fP .Se .Ss (define x 1) (define env (let ((x 2)) (the-environment))) (eval 'x) ==> 1 (eval 'x env) ==> 2 .Se . .Pr bound? symbol .LP Returns #t if \f2symbol\fP is bound in the current environment, #f otherwise. . .Pr type obj .LP Returns a symbol indicating the type of \f2obj\fP. .br Examples: .Ss (type 13782343423544) ==> integer (type 1.5e8) ==> real (type (lambda (x y) (cons x y))) ==> compound (type #\ea) ==> character (type '(a b c)) ==> pair (type '()) ==> null (type (read (open-input-string ""))) ==> end-of-file .Se . .Pr void? obj .LP Returns true if \f2obj\fP is the non-printing object, false otherwise. . .Pr command-line-args .LP Returns the command line arguments of the interpreter's invocation, a list of strings. . .Ch "\*R Language Features not Implemented by Elk" .IP \(bu Rational and complex numbers are not supported. .IP \(bu Radix prefixes (#b, #o, #d, and #x) for real numbers are currently not implemented. .IP \(bu The exponent markers \f2s\fP, \f2f\fP, \f2d\fP, and \f2l\fP are not implemented; the character \f2#\fP is not permitted in place of digits in numerical constants. .IP \(bu \f2char-ready\fP .Ix char-ready is not implemented correctly (see above). .IP \(bu \f2transcript-on\fP and \f2transcript-off\fP are not implemented. .LP elk-3.99.8/doc/kernel/Makefile.am0000644000175000017500000000142511577076306013417 00000000000000EXTRA_DIST = kernel.ms CLEANFILES = index.raw index.ms kernel.ps kernel.html if HAVE_GROFF docs_DATA = kernel.ps docsdir = $(datadir)/doc/@PACKAGE@/ps endif MANUAL = $(srcdir)/kernel.ms TROFF = groff -ms -t UNROFF = unroff -ms kernel.ps: $(MANUAL) index.ms (cat $(MANUAL) $(srcdir)/../util/tmac.index index.ms; echo ".Tc") \ | $(TROFF) 2> /dev/null > kernel.ps kernel.html: $(MANUAL) (cat $?; echo ".Tc") | $(UNROFF) document=kernel index.ms: $(MANUAL) index.raw sort -f -t'#' +1 -3 +0n index.raw \ | $(AWK) -f $(srcdir)/../util/fixindex.awk \ | $(AWK) -f $(srcdir)/../util/block.awk >index.ms index.raw: $(MANUAL) $(TROFF) $(MANUAL) 2> index.raw >/dev/null #check: # checknr -c.Ul.Pr.Sy.Va.Sh.Ix.Id.Ch -a.Ss.Se.[[.]] $(MANUAL) \ # | grep -v "Empty command" elk-3.99.8/doc/record/0000755000175000017500000000000011577110020011415 500000000000000elk-3.99.8/doc/record/Makefile.in0000644000175000017500000003066211577103433013423 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = doc/record DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(docsdir)" DATA = $(docs_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ELK_CFLAGS = @ELK_CFLAGS@ ELK_LDFLAGS = @ELK_LDFLAGS@ ELK_LIBS = @ELK_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INCLUDES = @INCLUDES@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOTIF_CFLAGS = @MOTIF_CFLAGS@ MOTIF_LIBS = @MOTIF_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STDINT_HEADER = @STDINT_HEADER@ STRIP = @STRIP@ VERSION = @VERSION@ XAW_CFLAGS = @XAW_CFLAGS@ XAW_LIBS = @XAW_LIBS@ XMKMF = @XMKMF@ XT_CFLAGS = @XT_CFLAGS@ XT_LIBS = @XT_LIBS@ X_CFLAGS = @X_CFLAGS@ X_LIBS = @X_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = record.ms CLEANFILES = index.raw index.ms record.ps record.html @HAVE_GROFF_TRUE@docs_DATA = record.ps @HAVE_GROFF_TRUE@docsdir = $(datadir)/doc/@PACKAGE@/ps MANUAL = $(srcdir)/record.ms TROFF = groff -ms -t UNROFF = unroff -ms all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/record/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/record/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-docsDATA: $(docs_DATA) @$(NORMAL_INSTALL) test -z "$(docsdir)" || $(MKDIR_P) "$(DESTDIR)$(docsdir)" @list='$(docs_DATA)'; test -n "$(docsdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(docsdir)" || exit $$?; \ done uninstall-docsDATA: @$(NORMAL_UNINSTALL) @list='$(docs_DATA)'; test -n "$(docsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(docsdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(docsdir)" && rm -f $$files tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(docsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-docsDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-docsDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-docsDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-docsDATA record.ps: $(MANUAL) index.ms (cat $(MANUAL) $(srcdir)/../util/tmac.index index.ms; echo ".Tc") \ | $(TROFF) 2> /dev/null > record.ps record.html: $(MANUAL) (cat $?; echo ".Tc") | $(UNROFF) document=record index.ms: $(MANUAL) index.raw sort -f -t'#' +1 -3 +0n index.raw \ | $(AWK) -f $(srcdir)/../util/fixindex.awk \ | $(AWK) -f $(srcdir)/../util/block.awk >index.ms index.raw: $(MANUAL) $(TROFF) $(MANUAL) 2> index.raw >/dev/null #check: # checknr -c.Ul.Pr.Sy.Va.Sh.Ix.Id.Ch -a.Ss.Se.[[.]] $(MANUAL) \ # | grep -v "Empty command" # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: elk-3.99.8/doc/record/record.ms0000644000175000017500000002340511577076306013202 00000000000000.so ../util/tmac.scheme .Ul .TL Reference Manual for the .sp .5 Elk Record Extension .AU Oliver Laumann . .Ch "Introduction" . .PP The record extension to Elk allows Scheme applications to define .Ix "record data type" record data types (similar to, although less powerful than, Common Lisp .Ix structures \f2structures\fP). .PP A record type can be instantiated to obtain a new .Ix record record (a member of the given record type). Each record is a collection of named .Ix fields fields that can hold arbitrary Scheme objects. Records are first-class Scheme objects; they are members of the \f2record\fP data type that is disjoint from all other Scheme types. Record types are first-class objects as well; each record type is a member of the \f2record-type\fP Scheme data type. .PP The record extension provides facilities to define new record types, create .Ix instances instances of existing record types, define .Ix accessor accessor and .Ix modifier modifier functions to read and write the fields of records of a given type, and .Ix "type predicate" type predicates for the \f2record\fP and \f2record-type\fP data types. .PP In addition, the extension provides .Ix macros macros that simplify the definition of .Ix constructor constructor, accessor and modifier functions for a newly defined record type. . .Ch "Using the Record Extension" . .PP The record extension is loaded by evaluating .Ss (require 'record) .Se in the interactive toplevel or in a Scheme program. .PP This causes the files .Ix record.scm \f2record.scm\fP and .Ix record.o \f2record.o\fP to be loaded into the interpreter (\f2record.o\fP has to be linked with the interpreter on platforms that do not support dynamic loading of object files). .PP Loading the record extension causes the .Ix feature features \f2record\fP and \f2record.o\fP to be provided. . .Ch "Record Types" . .Pr make-record-type type-name fields .LP \f2make-record-type\fP creates a new .Ix "record type" record type. \f2type-name\fP (a string or a symbol) is the name of the record type; it is used in the printed representation of the record type and of records belonging to the new type. If \f2type-name\fP is a symbol, it is converted into a string first. .Ix fields \f2fields\fP is a list of symbols naming the fields of a record of the new type. An error is signaled of the list contains duplicate names. .LP \f2make-record-type\fP returns the new record type (an object of the Scheme type \f2record-type\fP). .LP Example: .Ss (define time-record (make-record-type 'time '(hours minutes seconds))) .Se . .Pr record-type? obj .LP This .Ix "type predicate" type predicate returns #t if \f2obj\fP is a \f2record-type\fP object (i.\|e.\& the return value of a call to \f2make-record-type\fP), #f otherwise. . .Pr record-type-name rt .LP This procedure returns the .Ix "type name" type name (a string) of the record type \f2rt\fP, i.\|e.\& the \f2type-name\fP argument that was supplied to the call to \f2make-record-type\fP that created the record type \f2rt\fP. . .Pr record-type-field-names rt .LP \f2record-type-field-names\fP returns the list of .Ix "field names" field names associated with the record type \f2rt\fP (a list of symbols), i.\|e.\& the \f2fields\fP argument that was given in the call to .Ix make-record-type \f2make-record-type\fP that created \f2rt\fP. . .[[ .Pr record-constructor rt fields .Pr record-constructor rt .]] .LP \f2record-constructor\fP returns a procedure for creating .Ix instances instances of the record type \f2rt\fP. .LP The returned procedure accepts as many arguments as there are symbols in the list \f2fields\fP; these arguments are used as the initial values of those .Ix fields fields in the newly created record instance. The values of any fields for which no .Ix "initial value" initial value is specified (i.\|e. that are not present in \f2fields\fP) are undefined. If the \f2fields\fP argument is omitted, the field names that were given as an argument in the call to .Ix make-record-type \f2make-record-type\fP that created the record type \f2rt\fP are used instead. .LP Example: .Ss (define make-time (record-constructor time-record)) (define noon (make-time 12 0 0)) .sp .5 (define make-uninitialized-time (record-constructor time-record '())) .Se . .Pr record-predicate rt .LP \f2record-predicate\fP returns a procedure for testing membership in the record type \f2rt\fP. The returned procedure accepts one argument and returns #t if the argument is a member of the record type \f2rt\fP (i.\|e.\& if it has been created by invoking a constructor returned by calling .Ix record constructor \f2record-constructor\fP with \f2rt\fP as an argument), #f otherwise. . .Pr record-accessor rt field .LP \f2record-accessor\fP returns a procedure for reading the value of the .Ix field field named by \f2field\fP of a member of the record type \f2rt\fP. The returned procedure accepts one argument, which must be a record of the record type \f2rt\fP; it returns the current value of the specified field in that record. \f2field\fP must be a member of the list of field names that was supplied to the call to .Ix make-record-type \f2make-record-type\fP that created \f2rt\fP. .LP Example: .Ss (define time-hours (record-accessor time-record 'hours)) .sp .5 (define noon ((record-constructor time-record) 12 0 0)) (time-hours noon) \f2\(-> 12\fP .Se . .Pr record-modifier rt field .LP \f2record-modifier\fP returns a procedure for writing the value of the .Ix field field named by \f2field\fP of a member of the record type \f2rt\fP. The returned procedure accepts two arguments: a record of the record type \f2rt\fP and an arbitrary object; it stores the given object into the specified field in that record and returns the previous value of the field. \f2field\fP must be a member of the list of field names that was supplied to the call to .Ix make-record-type \f2make-record-type\fP that created \f2rt\fP. .LP Example .Ss (define set-time-hours! (record-modifier time-record 'hours)) .Se . .Pr describe-record-type rt .LP This procedure prints the names of the .Ix fields fields associated with the record type \f2rt\fP; it is automatically invoked by the standard .Ix describe \f2describe\fP procedure of Elk if \f2describe\fP is invoked with a record type. . .Ch "Records" . .Pr record? obj .LP This .Ix "type predicate" type predicate returns #t if \f2obj\fP is an object of type \f2record\fP (i.\|e.\& the return value of a call to a record .Ix constructor constructor of any record type), #f otherwise. . .Pr record-type-descriptor record .LP This procedure returns the .Ix "record type" record type representing the type of the given record. The returned record type object is equal (in the sense of \f2eq?\fP) to the record type argument that was passed to .Ix record-constructor \f2record-constructor\fP in the call that created the constructor procedure that created \f2record\fP. .LP Example: evaluating the expression .Ss ((record-predicate (record-type-descriptor r)) r) .Se always yields #t for any given record \f2r\fP. . .Pr record-values record .LP \f2record-values\fP returns the current contents of the fields of \f2record\fP as a .Ix vector vector. The \f2n\fPth element of the vector corresponds to the field with the name given as the \f2n\fPth element of the \f2fields\fP argument in the call to .Ix make-record-type \f2make-record-type\fP that created the type to which \f2record\fP belongs. .LP The returned vector is not a copy of the actual fields; i.\|e.\& modifying the contents of the vector directly writes the corresponding fields of the record. . .Pr describe-record record .LP This procedure prints the names and current values of the .Ix fields fields of the given record; it is automatically invoked by the standard .Ix describe \f2describe\fP procedure of Elk if \f2describe\fP is invoked with a record. . .Ch "Convenience Macros" .PP The .Ix macros macros described in this section are loaded by evaluating .Ss (require 'recordutil) .Se after having loaded the record extension. This causes the file .Ix recordutil.scm \f2recordutil.scm\fP to be loaded and defines the .Ix feature .Ix recordutil feature \f2recordutil\fP. . .Sy define-record-type name fields .LP This macro defines a variable \f2-record\fP, invokes the procedure .Ix make-record-type \f2make-record-type\fP with the given \f2name\fP and \f2fields\fP, and assigns the result to this variable. In addition, \f2define-record-type\fP defines a .Ix "type predicate" type predicate for the new record type as \f2\-record?\fP and a .Ix constructor constructor function as \f2make\-\-record\fP. The constructor function accepts no arguments and returns an uninitialized record of the newly defined record type. .LP Example: .Ss (require 'record) (require 'recordutil) .sp .5 (define-record-type time (hours minutes seconds)) .sp .3 (record-type? time-record) \f2\(-> #t\fP .sp .3 (define t (make-time-record)) .sp .3 (time-record? t) \f2\(-> #t\fP .Se . .[[ .Sy define-record-accessors rt .Sy define-record-modifiers rt .]] .LP The macro \f2define-record-accessors\fP (\f2define-record-modifiers\fP) defines .Ix accessor .Ix modifier accessor (modifier) functions for the fields of the record type \f2rt\fP. For each field named \f2field\fP, \f2define-record-accessors\fP (\f2define-record-modifiers\fP) defines a function \f2\-\fP (\f2set\-\-!\fP), where \f2name\fP is the type name of the given record type. Each of the functions is the result of a call to .Ix record-accessor .Ix record-modifier \f2record-accessor\fP (\f2record-modifier\fP) as described above, with the arguments \f2rt\fP and the name of the field. .LP Example: .Ss (define-record-type time (hours minutes seconds)) (define-record-modifiers time-record) .sp .3 (define noon (make-time-record)) (set-time-hours! noon 12) (set-time-minutes! noon 0) (set-time-seconds! noon 0) .sp .5 (define-record-accessors time-record) .sp .3 (time-hours noon) \f2\(-> 12\fP .Se elk-3.99.8/doc/record/Makefile.am0000644000175000017500000000142511577076306013415 00000000000000EXTRA_DIST = record.ms CLEANFILES = index.raw index.ms record.ps record.html if HAVE_GROFF docs_DATA = record.ps docsdir = $(datadir)/doc/@PACKAGE@/ps endif MANUAL = $(srcdir)/record.ms TROFF = groff -ms -t UNROFF = unroff -ms record.ps: $(MANUAL) index.ms (cat $(MANUAL) $(srcdir)/../util/tmac.index index.ms; echo ".Tc") \ | $(TROFF) 2> /dev/null > record.ps record.html: $(MANUAL) (cat $?; echo ".Tc") | $(UNROFF) document=record index.ms: $(MANUAL) index.raw sort -f -t'#' +1 -3 +0n index.raw \ | $(AWK) -f $(srcdir)/../util/fixindex.awk \ | $(AWK) -f $(srcdir)/../util/block.awk >index.ms index.raw: $(MANUAL) $(TROFF) $(MANUAL) 2> index.raw >/dev/null #check: # checknr -c.Ul.Pr.Sy.Va.Sh.Ix.Id.Ch -a.Ss.Se.[[.]] $(MANUAL) \ # | grep -v "Empty command" elk-3.99.8/doc/Makefile.in0000644000175000017500000004155311577103433012146 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = doc DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ELK_CFLAGS = @ELK_CFLAGS@ ELK_LDFLAGS = @ELK_LDFLAGS@ ELK_LIBS = @ELK_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INCLUDES = @INCLUDES@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOTIF_CFLAGS = @MOTIF_CFLAGS@ MOTIF_LIBS = @MOTIF_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STDINT_HEADER = @STDINT_HEADER@ STRIP = @STRIP@ VERSION = @VERSION@ XAW_CFLAGS = @XAW_CFLAGS@ XAW_LIBS = @XAW_LIBS@ XMKMF = @XMKMF@ XT_CFLAGS = @XT_CFLAGS@ XT_LIBS = @XT_LIBS@ X_CFLAGS = @X_CFLAGS@ X_LIBS = @X_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = README SUBDIRS = bitstring cprog kernel man oops record regexp unix usenix xlib xt DIST_SUBDIRS = $(SUBDIRS) util all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: elk-3.99.8/doc/cprog/0000755000175000017500000000000011577110017011257 500000000000000elk-3.99.8/doc/cprog/Makefile.in0000644000175000017500000003102011577103433013244 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = doc/cprog DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(docsdir)" DATA = $(docs_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ELK_CFLAGS = @ELK_CFLAGS@ ELK_LDFLAGS = @ELK_LDFLAGS@ ELK_LIBS = @ELK_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INCLUDES = @INCLUDES@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOTIF_CFLAGS = @MOTIF_CFLAGS@ MOTIF_LIBS = @MOTIF_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STDINT_HEADER = @STDINT_HEADER@ STRIP = @STRIP@ VERSION = @VERSION@ XAW_CFLAGS = @XAW_CFLAGS@ XAW_LIBS = @XAW_LIBS@ XMKMF = @XMKMF@ XT_CFLAGS = @XT_CFLAGS@ XT_LIBS = @XT_LIBS@ X_CFLAGS = @X_CFLAGS@ X_LIBS = @X_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = cprog.ms CLEANFILES = side side.ref side.inx cprog.ps cprog.html @HAVE_GROFF_TRUE@docs_DATA = cprog.ps @HAVE_GROFF_TRUE@docsdir = $(datadir)/doc/@PACKAGE@/ps MANUAL = $(srcdir)/cprog.ms TROFF = groff -ms -t UNROFF = unroff -ms MKINDEX = $(AWK) -f $(srcdir)/../util/mkindex.awk all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/cprog/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/cprog/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-docsDATA: $(docs_DATA) @$(NORMAL_INSTALL) test -z "$(docsdir)" || $(MKDIR_P) "$(DESTDIR)$(docsdir)" @list='$(docs_DATA)'; test -n "$(docsdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(docsdir)" || exit $$?; \ done uninstall-docsDATA: @$(NORMAL_UNINSTALL) @list='$(docs_DATA)'; test -n "$(docsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(docsdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(docsdir)" && rm -f $$files tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(docsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-docsDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-docsDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-docsDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-docsDATA cprog.ps: $(MANUAL) side.ref side.inx $(MKINDEX) $(MANUAL) | sed -f side.ref | $(TROFF) 2> /dev/null > $@ side.ref: side grep '^[sS]' < side | sed -e 's/\.\//\//' > side.ref side.inx: side egrep -v '^s' side | sort -f -t'#' +1 -3 +0n | \ $(AWK) -f $(srcdir)/../util/fixindex.awk | \ $(AWK) -f $(srcdir)/../util/block.awk \ > side.inx side: $(MANUAL) rm -f side side.inx && printf "" > side.inx $(MKINDEX) $? | $(TROFF) 2>side >/dev/null cprog.html: $(MANUAL) side.ref $(MKINDEX) $(MANUAL) | sed -f side.ref | $(UNROFF) document=cprog #check: # cknr -c.Tc -a.Es.Ee.Cs.Ce $(MANUAL) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: elk-3.99.8/doc/cprog/cprog.ms0000644000175000017500000045147611577076306012707 00000000000000.\" $Revision: 1.25 $ .\" .ds Vs 3.0 .\" .so ../util/tmac.scheme .\" .\" Courier bold; used for system output in transcripts. .ie \n(.U .fp 6 B .el .fp 6 CB .\" .\" Code start. .de Cs .nr sF \\n(.f .ft 5 .ps -1 .vs -1 .ie \n(.U .RS .el .in 1c .nf .if !\n(.U .sp .3c .. .\" Code end. .de Ce .fi .ie \n(.U .RE .el .in .vs .ps .ft \\n(sF .. .\" Newline in code. .de Cl .sp .6 .. .\" Same as .Cl .de El .Cl .. .\" Example start/end. As floating keeps (used for figures .\" in this document) and regular keeps cannot be mixed, the .\" functionality must be simulated here. This sucks... .de Es .Cs .if !\n(.U .di EE .. .de Ee .Ce .if !\n(.U \{\ .di .if \\n(dn-\\n(.t .sp 1000 .nf .EE .fi .sp .5 .\} .. .\" .K1 header-text .\" Major heading with TOC entry. .de K1 .NH \\$1 .XS \\*(SN \\$1 .XE .. .\" .K2 header-text .\" Level-2 heading with TOC entry. .de K2 .NH 2 \\$1 .XS \\n(PN 2n \\*(SN \\$1 .XE .. .\" .K3 header-text .\" Level-3 heading with TOC entry. .de K3 .NH 3 \\$1 .XS \\n(PN 4n \\*(SN \\$1 .XE .. .\" .AP appendix-text .\" Appendix with TOC entry. .de AP .ie \\n(.U .NH .el .SH \\$1 .XS \\$1 .XE .. .\" .Rf name value .\" Reference anchor. Each occurrence of `name' anywhere in .\" the document will be replaced by `value'. .de Rf .if !\n(.U .tm s/@(\\$1)/\\$2/g .. .\" .\" Counter for Figures (auto-pre-increment). .nr fS 0 1 .\" .\" Figure start. .de Fs .br .ie \\n(.$ .KS .el .KF .sp 1.2 \u\l'\\n(.lu_'\d .nr sF \\n(.f .ft 5 .ps -1 .vs -1 .nf .. .\" .Fc caption-text .\" Figure caption. Used at end of Figure, before .Fe. .de Fc .sp .2 .fi .ps .vs .ft \\n(sF .ce 999 \s-1\f3Figure \\n+(fS:\fP \c \\$1\s0 .if \\n(.$=2 \s-1\&\\$2\s0 .ce 0 .. .\" .Fe name .\" Figure end. Defines a reference anchor `name' with the .\" number of the Figure as value. .de Fe .Rf \\$1 \\n(fS .LP \l'\\n(.lu_' .sp .KE .. .\" Relative indent start. .de Rs .if !\\n(.U .RS .. .\" Relative indent end. .de Re .if !\\n(.U .RE .. .\" .TL Building Extensible Applications with Elk \*- .sp .3 C/C++ Programmer's Manual .AU Oliver Laumann .AB Elk (\f2Extension Language Kit\fP) is a Scheme implementation designed as an embeddable, reusable extension language subsystem for integration into existing and future applications written in C or C++. The programmer's interface to Elk provides for a close interworking of the C/C++ parts of Elk-based, \f2hybrid\fP applications with extensible Scheme code. This manual describes the facilities of the C/C++ programmer's interface that can be used by authors of extensible applications and Scheme extensions. Topics range from the architecture of Elk-based applications and the definition of application-specific Scheme types and primitives to more advanced subjects such as weak data structures and interacting with the garbage collector. Many examples throughout the text illustrate the facilities and techniques discussed in this manual. .AE .\" --------------------------------------------------------------------------- .K1 "Additional Documentation" .PP The official specification of the Scheme programming language is the @[.``R\*(^4RS''] (William Clinger and Jonathan Rees (editors), \f2Revised\*(^4 Report on the Algorithmic Language Scheme\fP, 1991). A slightly modified version of an earlier revision of this report was adopted as an IEEE an ANSI standard in 1990 (IEEE\|Std\|1178-1990, \f2IEEE Standard for the Scheme Programming Language\fP, 1991). .PP The dialect of Scheme implemented by Elk (a superset of the official language) is described in the \f2Reference Manual for the Elk Extension Language Interpreter\fP that is included in the Elk distribution as troff source and preformatted PostScript files. Reference manuals for the various predefined Elk extensions (such as the UNIX and X11 extensions) are also part of the distribution; see the file ``doc/README'' for an overview of the available documentation. .PP This manual supersedes the document \f2Interfacing Scheme to the ``Real World''\fP that was included in earlier versions of Elk. .PP An article about Elk has appeared in USENIX Computing Systems in 1994 (Oliver Laumann and Carsten Bormann, Elk: The Extension Language Kit, \f2USENIX Computing Systems\fP, vol.\& 7, no.\& 4, pp.\& 419\-449). .PP A recent example of an application that uses Elk as its extension language implementation is freely available in source and binary form as \f2http://www.informatik.uni-bremen.de/~net/unroff\fP. @[.\f2unroff\fP] is a programmable, extensible troff translator with Scheme-based back-ends for the Hypertext Markup Language. The source code shown in Appendix B has been directly taken from the \f2unroff\fP source; authors of Elk-based applications are encourage to reuse this and other parts of the \f2unroff\fP source for their own projects. .\" --------------------------------------------------------------------------- .K1 "Introduction" .PP This manual can be roughly divided into two parts. The first part (chapters\ @(ch-arch) to\ @(ch-static)) describes the architectural aspects of Elk-based applications and Elk extensions. Facilities and tools for building extensible applications with Elk are introduced here. Readers who are already familiar with the concepts explained in this part of the document may want to skip it and begin reading at chapter\ @(ch-notes) or later. The second part (covering chapters\ @(ch-notes) to\ @(ch-advanced)) specifies the C functions and types available to application programmers and describes techniques for building data structures that can be interfaced to Scheme in an efficient way. Appendix C briefly summarizes all the functions, macros, types, and variables exported by the Elk kernel to the C/C++ programmer. .PP Here is a short overview of the remaining chapters of this manual. Chapter\ @(ch-arch) discusses the architecture of extensible applications based on Elk and their relation to Elk extensions. Chapter\ @(ch-linking) provides an overview of the two basic methods for integrating an application (or extensions) with Elk: dynamic loading and static linking. Chapter\ @(ch-dynl) describes use of dynamic loading in more detail; topics include automatic extension initialization and C++ static constructors embedded in dynamically loaded modules. Chapter\ @(ch-static) describes several forms of linking user-supplied code with Elk statically and how these affect the structure of an application's \f2main()\fP function. .PP The remaining chapters are a complete specification of the functions and types of the C/C++ programmer's interface to Elk. Chapter\ @(ch-notes) provides introductory notes and advice for programmers of C/C++ code interfacing to Elk (use of include files, predefined preprocessor symbols, etc.). Chapter\ @(ch-anatomy) describes the anatomy of Scheme objects from the C/C++ programmer's point of view. Chapter\ @(ch-defprim) explains how applications and extensions can define new Scheme primitives. Chapter\ @(ch-types) presents the standard, built-in Scheme types implemented by Elk (numbers, pairs, vectors, etc.) and functions for creating and accessing Scheme objects of these types from within C/C++ code. The facilities for defining new, first-class Scheme data types are described in chapter\ @(ch-deftype). Finally, chapter\ @(ch-advanced) deals with a number of more advanced topics, such as functions for interacting with the garbage collector, automatic finalization of inaccessible objects, definition of user-supplied reader functions, error handling, etc. .PP A note on the naming conventions followed by the C identifiers used throughout this document: the names of all functions, macros, types, and variables exported by Elk have their components separated by underscores and capitalized (as in \f2Register_Object()\fP, for example). In contrast, the names defined by examples shown in this manual only use lower case letters, so that they can be distinguished easily from predefined functions exported by Elk. .\" --------------------------------------------------------------------------- .K1 "The Architecture of Extensible Applications" @[.=application architecture]@[.=extensible application] .Rf ch-arch \*(SN .PP Extensible applications built with Elk are @[.=hybrid application] \f2hybrid\fP in that they consist of code written in a mixture of languages\*-code written in the application's @[.\f2implementation language\fP] (C or C++) and code written in the @[.\f2extension language\fP] (Scheme). An application of this kind is usually composed of two layers, a low-level C/C++ layer that provides the basic, performance-critical functionality of the application, and on top of that a higher-level layer which is written in Scheme and interpreted at runtime. .PP The Scheme-language portion of an Elk-based application may range from just a few dozen lines of Scheme code (if a simple form of customization is sufficient) to fifty percent of the application or more (if a high degree of extensibility is required). As Scheme code is interpreted at runtime by an interpreter embedded in the application, users can customize and modify the application's Scheme layer or add and test their own Scheme procedures; recompilation, access to the C/C++ source, or knowledge of the implementation language are not required. Therefore, an application can achieve highest extensibility by restricting its low-level part to just a small core of time-critical C/C++ code. .PP To enable extensions to ``work on'' an application's internal data structures and state, the application core exports a set of new, application-specific Scheme data types and primitives operating on them to the Scheme layer. These types and primitives can be thought of as a ``wrapper'' around some of the C/C++ types and functions used by the application's core. For example, the core of an Elk-based newsreader program would export first-class Scheme types representing \f2newsgroups\fP, \f2subscriptions\fP, and \f2news articles\fP; these types would encapsulate the corresponding low-level C ``structs'' or C++ classes. In addition, it would export a number of Scheme primitives to operate on these types\*-to create members of them (e.\|g.\& by reading a news article from disk), to present them to the user through the application's user-interface, etc. Each of these primitives would recur on one or more corresponding C or C++ functions implementing the functionality in an efficient way. .PP Another job of the low-level C/C++ layer of an application is to hide platform-specific or system-specific details by providing suitable abstractions, so that the Scheme part can be kept portable and simple. For example, in case of the newsreader program, extension writers should not have to care about whether the news articles are stored in a local file system or retrieved from a network server, or about the idiosyncrasies of the system's networking facilities. Most of these system-specific details can be better dealt with in a language oriented towards systems programming, such as C, than in Scheme. .PP To decide whether to make a function part of the low-level part of an application or to write it in the extension language, you may ask yourself the following questions: .IP \(bu \f2Is the function performance-critical?\&\fP .RS .LP If the answer to this question is \f2yes\fP, put the function into the C/C++ core. For example, in case of the newsreader application, a primitive to search all articles in a given newsgroup for a pattern is certainly performance-critical and would therefore be written in the implementation language, while a function to ask the user to select an item from a list of newsgroups is not time-critical and could be written Scheme. .RE .IP \(bu \f2Does the function have to deal with platform-specific details?\&\fP .RS .LP For example, a function that needs to allocate and open a UNIX pseudo-tty or to establish a network connection needs to care about numerous system-specific details and different kinds of operating system facilities and will therefore be written in C/C++ rather than in Scheme. .RE .IP \(bu \f2In which language can the function be expressed more ``naturally''?\&\fP .RS .LP A function that parses and tokenizes a string can be expressed more naturally (that is, in a significantly more concise and efficient way) in a language such as C than in Scheme. On the other hand, functions to construct trees of news articles, to traverse them, and to apply a function to each node are obvious candidates for writing them in a Lisp-like language (Scheme). .RE .IP \(bu \f2Are customizability and extensibility important?\&\fP .RS .LP If it is likely that the application's users will want to customize or augment a function or even replace it with their own versions, write it in the extension language. If, for some reason, this is impossible or not practicable, at least provide suitable @[.``hooks''] that enable users to influence the function's operation from within Scheme code. .RE .\" --------------------------------------------------------------------------- .K2 "Scheme Extensions" @[.=Scheme extensions] .PP In addition to the Scheme interpreter component, Elk consists of a number of \f2Scheme extensions\fP. These extensions are not specific to any kind application and are therefore reusable. They provide the ``glue'' between Scheme and a number of external libraries, in particular the X11 libraries and the UNIX C library (exceptions are the @[.record extension] and the @[.bitstring extension] which provide a functionality of their own). The purpose of these extensions is to make the functionality of the external libraries (for example, the UNIX system calls) available to Scheme as Scheme data types and primitives operating on them. .PP While the Scheme extensions are useful for writing freestanding Scheme programs (e.\|g.\& for @[.rapid prototyping] of X11-based Scheme programs), their main job is to help building applications that need to interface to external libraries on the extension language level. The @[.X11 extension]s, for instance, are intended to be used by applications with a graphical user interface based on the X window system. By linking the X11 extensions (in addition to the Scheme interpreter) with an Elk-based application, the application's user interface can be written entirely in Scheme and will therefore be inherently customizable and extensible. As the Scheme extensions are reusable and can be shared between applications, extension language code can be written in a portable manner. .\" --------------------------------------------------------------------------- .K2 "Applications versus Extensions" .PP As far as the C/C++ programmer's interface to Elk (that is, the subject of this manual) is concerned, there is not really a technical difference between Scheme \f2extensions\fP on the one hand (such as the X11 extensions), and Elk-based, extensible \f2applications\fP on the other hand. Both are composed of an efficient, low-level C/C++ core and, above that, a higher-level layer written in Scheme. In both cases, the C/C++ layer exports a set of Scheme types and primitives to the Scheme layer (that is, to the Scheme \f2programmer\fP) and thus needs to interact with the Scheme interpreter. Because of this analogy, the rest of the manual will mostly drop the distinction between applications and extensions and concentrate on the interface between C/C++ and Elk. .PP The only noteworthy difference between applications and extensions is that the former tend to have their own @[.\f2main()\fP] function that gains control on startup, while Scheme extensions do not have a \f2main()\fP entry point\*-they are usually loaded into the interpreter (or application) during runtime. This distinction will become important in the next chapter, when the different ways of joining Elk and C/C++ code will be discussed. .\" --------------------------------------------------------------------------- .K1 "Linking Applications and Extensions with Elk" .Rf ch-linking \*(SN .PP There are two different mechanisms for integrating compiled C/C++ code (extensions or an application) with Elk: @[.\f2static linking\fP] and @[.\f2dynamic loading\fP]. The object files that make up an Elk-based application are usually linked statically with the Scheme interpreter in the normal way to produce an executable program. Compiled extensions, on the other hand, are usually dynamically loaded into the running Scheme interpreter as they are needed. These conventions reflect the normal case; Scheme extensions may as well be linked statically with the interpreter .IP \(bu to produce a ``specialized'' instance of the interpreter (for example, when developing X11-based Scheme code, an extended version of the interpreter may be produced by linking it statically with the X11 extensions); .IP \(bu if a particular extension is required by an application from the beginning (an application with an X-based user-interface would be linked with the X11 extensions statically, as loading on-demand would not be useful in this case); .IP \(bu on the (few) platforms where dynamic loading is not supported or where dynamic loading has a large performance overhead. .PP Likewise, dynamic loading is not only useful for on-demand loading of reusable Scheme extensions; \f2applications\fP can benefit from this facility as well. To reduce the size of the final executable, parts of an application may loaded dynamically rather than linked statically if they are used infrequently or if only a few of them are used at a time. Dynamic loading enables the author of an extensible application to decompose it into an arbitrary number of individual parts as an alternative to combining them statically into a large, monolithic executable. An extensible newsreader program, for example, may include a separate spelling check module that is dynamically loaded the first time it is needed (i.\|e.\& when a newly written news article is to be spell-checked). .PP The capability to dynamically load compiled C/C++ code into a running application enables users to write @[.\f2hybrid extension]s\fP which consist of a low-level C/C++ part and a high-level part written in Scheme. As a result, extensions can execute much faster (extensions to the Emacs editor, for example, must be entirely written in Emacs-Lisp and can therefore become slow if sufficiently complex); and extensions can deal more easily with low-level, platform-specific details. .\" --------------------------------------------------------------------------- .K1 "Dynamic Loading" .Rf ch-dynl \*(SN @[.=dynamic loading] .PP Object files (compiled C/C++ code) are loaded by means of the standard @[.\f2load\fP primitive] of Scheme, just like ordinary Scheme files. All you need to do is to compile your C or C++ source file, apply the @[.\f2makedl\fP script] that comes with the Elk distribution to the resulting object file, and load it into the interpreter or application. \f2makedl\fP prepares object files for dynamic loading (which is a no-op on most platforms) and combines several object files into one to speed up loading; arguments are the output file and one or more input files or additional libraries (input and output file may be identical): .Es \f6%\fP cc \-c \-I/usr/elk/include file.c \f6%\fP /usr/elk/lib/makedl file.o file.o \f6%\fP scheme \f6>\fP (load 'file.o) \f6>\fP .Ee (This examples assumes that Elk has been installed under ``/usr/elk'' on your site. Additional arguments may be required for the call to \f2cc\fP.) .PP Elk does not attempt to discriminate object code and Scheme code based on the files' contents; the names of object files are required to end in ``.o'', the standard suffix for object modules in UNIX. Scheme files, on the other hand, end in ``.scm'' by convention. This convention is not enforced by Elk\*-everything that is not an object file is considered to be a Scheme file. A list of object files may be passed to the \f2load\fP primitive which may save time on platforms where a call to the system linker is involved. .PP Loading object files directly as shown above is uncommon. Instead, the Scheme part of a @[.hybrid extension] usually loads its corresponding object file (and all the other files that are required) automatically, so that one can write, for example, .Es (require 'unix) .Ee to load the @[.UNIX extension]. This expression causes the file \f2unix.scm\fP to be loaded, which then loads the object file \f2unix.o\fP\*-the UNIX extension's low-level part\*-automatically on startup. Additional \f2load-libraries\fP (as explained in the next section) may be set by the Scheme file immediately before loading the extension's object file. .PP When an object file is loaded, @[.unresolved reference]s are resolved against the symbols exported by the running interpreter or by the combination of an application and the interpreter (the \f2base program\fP). This is an essential feature, as dynamically loaded extensions must be able to reference the elementary Scheme primitives defined by the interpreter core and all the other functions that are available to the extension/application programmer. In addition, references are resolved against the symbols exported by all previously loaded object files. The term @[.\f2incremental loading\fP] is used for this style of dynamic loading, as it allows building complex applications from small components incrementally. .\" --------------------------------------------------------------------------- .K2 "Load Libraries" .PP Dynamically loadable object files usually have unresolved references into one or more libraries, most likely at least into the standard @[.C library]. Therefore, when loading an object file, references are resolved not only against the base program and previously loaded object files, but also against a number of user-supplied @[.\f2load libraries\fP]. The @[.X11 extension]s of Elk, for instance, need to be linked against the respective libraries of the @[.X window system], such as \f2libX11\fP and \f2libXt\fP. These load libraries can be assigned to the Scheme variable \f2load-libraries\fP which is bound in the top-level environment of Elk. Typically, \f2load-libraries\fP is dynamically assigned a set of library names by means of @[.\f2fluid-let\fP] immediately before calling \f2load\fP. For example, the @[.Xlib extension] (\f2xlib.scm\fP) contains code such as .Es (fluid-let ((load-libraries (string-append "\-L/usr/X11/lib \-lX11 " load-libraries))) (load 'xlib.o)) .Ee to load the accompanying object file (\f2xlib.o\fP), linking it against the system's X library in addition to whatever libraries were already in use at that point. The default value of \f2load-libraries\fP is ``\-lc'' (i.\|e.\& the C library), as extensions are likely to use functions from this library in addition to those C library functions that have already been linked into the base program or have been pulled in by previously loaded object files. By using \f2string-append\fP in the example above, the specified libraries are added to the default value of \f2load-libraries\fP rather than overwriting it. The exact syntax of the load libraries is platform specific. For instance, ``\-L/usr/X11/lib'' as used above is recognized by the system linker of most UNIX variants as an option indicating in which directory the libraries reside on the system, but different options or additional libraries are required on certain platforms (as specified by the platform's ``config/site'' file in the Elk distribution). .\" --------------------------------------------------------------------------- .K2 "Extension Initializers and Finalizers" .PP When loading an object file, Elk scans the file's symbol table for the names of @[.extension initialization function]s or @[.\f2extension initializer\fP]s. These extension initializers are the initial entry points to the newly loaded extension; their names must have the prefix @[.``elk_init_''] (earlier the prefix ``init_'' was used; it was changed in Elk \*(Vs to avoid name conflicts). Each extension initializer found in the object file is invoked to pass control to the extension. The job of the extension initializers is to register the Scheme types and primitives defined by the extension with the interpreter and to perform any dynamic initializations. .PP As each extension may have an arbitrary number of initialization functions rather than one single function with a fixed name, extension writers can divide their extensions into a number of independent modules, each of which provides its own initialization function. The compiled modules can then be combined into one dynamically loadable object file without having to lump all initializations into a central initialization function. .PP In the same manner, extension can define an arbitrary number of @[.\f2extension finalization function]s\fP which are called on termination of the Scheme interpreter or application. The names of finalization functions begin with @[.``elk_finit_'']. Extension finalization functions are typically used for clean-up operations such as removing temporary files. .PP The extension initializers (as well as the finalizers) are called in an unspecified order. .\" --------------------------------------------------------------------------- .K2 "C++ Static Constructors and Destructors" .PP In addition to calling extension initialization functions, the \f2load\fP primitives invokes all @[.C++ static constructor]s that are present in the dynamically loaded object file in case it contains compiled C++ code. Likewise, @[.C++ static destructor]s are called automatically on termination. The constructors and destructors are called in an unspecified order, but all constructors (destructors) are called before calling any extension initializers (finalizers). Elk recognizes the function name prefixes of static constructor and destructor functions used by all major UNIX @[.C++ compiler]s; new prefixes can be added if required. .\" --------------------------------------------------------------------------- .K1 "Static Linking" @[.=static linking] .Rf ch-static \*(SN .PP Linking user-supplied code with Elk statically can be used as an alternative to dynamic loading on platforms that do not support it, for applications with their own @[.\f2main()\fP], and to avoid the overhead of loading frequently used Elk extensions. Dynamic loading and static linking may be used in combination\*- additional object files can be loaded in a running executable formed by linking the Scheme interpreter with extensions or with an application (or parts thereof). .PP When making the Scheme interpreter component of Elk, these executables and object files get installed (relative to your \f2install_dir\fP which usually is ``/usr/elk'' or ``/usr/local/elk''): .Rs .IP \f2bin/scheme\fP The freestanding, plain Scheme interpreter. .IP \f2lib/standalone.o\fP @[.=standalone.o] The Scheme interpreter as a relocatable object file which can be linked with user-supplied object files to form an executable. This object file contains a \f2main()\fP function; thus the Scheme interpreter starts up in the normal way when the executable is invoked. .IP \f2lib/module.o\fP @[.=module.o] Like \f2standalone.o\fP, except that the object file does not export its own \f2main()\fP function. Therefore, the object files linked with it have to supply a \f2main()\fP. .Re .PP The object file \f2standalone.o\fP is typically linked with a number of Elk extensions (e.\|g.\& the X11 extensions), while \f2module.o\fP is used by Elk-based applications which contribute their own \f2main()\fP and need to be ``in control'' on startup. .\" --------------------------------------------------------------------------- .K2 "Linking the Scheme Interpreter with Extensions" .PP A shell script @[.\f2linkscheme\fP] (installed as ``lib/linkscheme'') simplifies combining the Scheme interpreter with a number of\*-user-supplied or predefined\*-extensions statically. This script is called with the name of the output file (the resulting executable) and any number of object files and libraries. It basically links the object files and libraries with ``standalone.o'' and supplies any additional libraries that may be required by the interpreter. In general, this can be done just as well by calling the linker or compiler directly, but \f2linkscheme\fP also takes care of additional processing that needs to be performed on at least one platform (currently AIX). .PP To create an instance of Elk including the Xlib, Xt, and Xaw extensions, \f2linkscheme\fP would be used as follows (again assuming you have installed the software under ``/usr/elk''): .Es \f6%\fP cd /usr/elk \f6%\fP lib/linkscheme x11scheme runtime/obj/xt.o runtime/obj/xaw/*.o \e \-lXaw \-lXmu \-lXt \-lSM \-lICE \-lX11 \-lXext .Ee .PP The exact form of the libraries depends on your platform and X11 version; for example, additional options may be required if X11 is not installed in a standard location at your site. \f2xlib.o\fP is the @[.Xlib extension], \f2xt.o\fP is the X toolkit intrinsics (Xt) extension, and the subdirectory \f2xaw\fP holds the object files for all the @[.Athena widgets]. The executable \f2x11scheme\fP can now be used to run arbitrary X11 applications using the Athena widgets without requiring any runtime loading of object files belonging to the @[.X11 extension]s: .Es \f6%\fP x11scheme \f6>\fP (load '../examples/xaw/dialog.scm) [Autoloading xwidgets.scm] [Autoloading xt.scm] [Autoloading siteinfo.scm] \&... .Ee .PP In the same way, \f2linkscheme\fP can be used to link the Scheme interpreter with any new, user-supplied extensions, with parts of an Elk-based application, or with any combination thereof. .\" --------------------------------------------------------------------------- .K3 "Automatic Extension Initialization" .Rf ch-autoinit \*(SN .PP When linking Elk with extensions, it is \f2not\fP necessary to add calls to the @[.extension initializer]s to the Scheme interpreter's \f2main()\fP function and recompile the interpreter; all extensions are initialized automatically on startup. To accomplish this kind of automatic initialization, Elk scans its own symbol table on startup, invoking any @[.``elk_init_''] functions and @[.C++ static constructor]s, in the same way the symbol table of object files is scanned when they are dynamically loaded. @[.Extension finalizer]s and @[.C++ static destructor]s are saved for calling on exit. Automatic extension initialization only works if .Rs .IP \(bu the executable file has a symbol table (i.\|e.\& you must not strip it) .IP \(bu the executable file can be opened for reading .IP \(bu the interpreter can locate its executable file by scanning the shell's directory search path. .Re .PP The performance overhead caused by the initial scanning of the symbol is small; the program's symbol table can be read or mapped into memory efficiently (it it has not been automatically mapped into the address space by the operating system in the first place). .\" --------------------------------------------------------------------------- .K2 "Linking the Scheme Interpreter with an Application" .PP Elk-based applications that have their own \f2main()\fP are linked with the Scheme interpreter installed as \f2module.o\fP which, unlike \f2standalone.o\fP, does not export a \f2main()\fP function. No special \f2linkscheme\fP script is required to link with \f2module.o\fP; application writers usually will add ``/usr/elk/lib/module.o'' (or whatever the correct path is) to the list of object files in their Makefile. To simplify linking with Elk, a trivial script @[.\f2ldflags\fP] (which lives in ``lib'' along with \f2linkscheme\fP) is supplied that just echoes any additional libraries required by the Scheme interpreter. Application developers may use \f2ldflags\fP in their Makefiles. .PP As \f2module.o\fP does not have a \f2main()\fP entry point, an application using it must initialize the interpreter from within its own \f2main()\fP. This is done by calling .@[.\f2Elk_Init()\fP]: .Es void Elk_Init(int argc, char **argv, int init_flag, char *filename); .Ee .PP \f2Elk_Init()\fP is only defined by \f2module.o\fP and is essentially a ``wrapper'' around the Scheme interpreter's \f2main()\fP. \f2argc\fP and \f2argv\fP are the arguments to be passed to the Scheme interpreter's \f2main()\fP. These may or may not be the calling program's original arguments; however, @[.\f2argv[0\]\fP] must be that from the calling program in any case (because its address is used by Elk to determine the program's stack base). If \f2init_flag\fP is nonzero, the interpreter scans its symbol table to invoke @[.extension initializer]s as described in @(ch-autoinit). @[.C++ static constructor]s, however, are never invoked by \f2module.o\fP (regarless of \f2init_flag\fP), because they are already taken care of by the runtime startup in this case. If \f2filename\fP is nonzero, it is the name of Scheme file to be loaded by \f2Elk_Init()\fP. .\" --------------------------------------------------------------------------- .K3 "An Example ``main()'' Function" .PP Figure @(main) shows a realistic (yet somewhat simplified) example \f2main()\fP function of an application using Elk. .Fs char *directory; .El int main(int ac, char **av) { char **eav; int eac = 1, c; .El Set_App_Name(av[0]); eav = safe_malloc((ac+2+1) * sizeof(char *)); /* ac + -p xxx + 0 */ eav[0] = av[0]; while ((c = getopt(ac, av, "gh:o")) != EOF) switch (c) { case 'o': \f2process option...\fP case 'g': eav[eac++] = "-g"; break; case 'h': eav[eac++] = "-h"; eav[eac++] = optarg; break; case '?': usage(); return 1; } if ((directory = getenv("APP_DIR")) == 0) directory = DEFAULT_DIR; eav[eac++] = "-p"; eav[eac] = safe_malloc(strlen(directory) + 11); sprintf(eav[eac++], ".:%s/elk/scm", directory); eav[eac] = 0; Elk_Init(eac, eav, 0, 0); .El \f2initialize application's modules...\fP .El boot_code(); .El \f2application's main loop (if written in C)\fP ... .Fc "Example \f2main()\fP of an Elk-based application (simplified)" .Fe main .PP The code shown in the example must construct a new argument vector to be passed to \f2Elk_Init()\fP, because the application has command line options of its own (just \f2\-o\fP in the example). Two Elk-options (\f2\-g\fP and \f2\-h\fP) are handed to \f2Elk_Init()\fP if present, so that a mixture of Elk-specific and application-specific options can be given (see the manual page for the Scheme interpreter for the meaning of Elk's options). (\f2safe_malloc()\fP is assumed to be a wrapper around \f2malloc()\fP with proper error-checking.) @[.\f2Set_App_Name()\fP] is provided by Elk and is called with a name to be displayed in front of fatal error messages by the interpreter. .PP When all the options have been parsed, an additional option \f2\-p\fP is synthesized to provide a minimal initial @[.\f2load-path\fP] for Elk. This load-path consists of the current directory and a subdirectory of the directory under which the application expects its files that are needed during runtime. An environment variable can be used to set this directory. Defining a load-path like this has the benefit that a minimal, self-contained Elk runtime environment (e.\|g.\& a toplevel and the debugger) can be shipped with binary distributions of the application so that users are not required to have Elk installed at their sites. .PP When Elk has been initialized by calling \f2Elk_Init()\fP, the application may initialize all its other modules and finally load an initial Scheme file that ``boots'' the Scheme part of the application (which may involve loading further Scheme files). This initial Scheme file may be quite simple and just define a few functions used later, or it main contain the application's entire ``driving logic'' or interactive user-interface. This is accomplished by a function \f2boot_code()\fP which may as simple as this: .Es void boot_code(void) { char *fn = safe_malloc(strlen(directory) + 30); .El sprintf(fn, "%s/scm/app.scm", directory); Set_Error_Tag("initial load"); Load_File(fn); free(fn); } .Ee .PP @[.\f2Load_File()\fP] is defined by Elk and loads a Scheme file whose name is supplied as a C string. @[.\f2Set_Error_Tag()\fP] may be used by extensions and applications to define the symbol that is passed as the first argument to the standard @[.error handler] when a Scheme error is signaled (see section @(ch-error)). .\" --------------------------------------------------------------------------- .K2 "Who is in Control?" .Rf ch-control \*(SN .PP When an application's object files are loaded into the interpreter dynamically or are linked with the interpreter using @[.\f2linkscheme\fP], control initially rests in the interpreter. In contrast, when the application is linked using @[.\f2module.o\fP] and @[.\f2Elk_Init()\fP] as shown in the previous section, it defines its own \f2main()\fP function, and hence the application is ``in control'' on startup. .PP From a technical point of view, it does not really make a difference whether control rests in the interpreter or in the application initially. In the first case, the main ``driving logic'' (or ``main loop'') of the application can simply be wrapped in a Scheme primitive which is then called by the Scheme toplevel on startup to pass control back to the application, if this is desired. In any case, control usually changes frequently between the Scheme interpreter and the actual application anyway\*-the Scheme interpreter invokes callback functions or Scheme primitives provided by the application, which may in turn invoke Scheme procedures or load Scheme files, and so on. .PP The @[.Tcl]-like style of use, where control rests in the C-part of the application most of the time, and where this C code ``calls out'' to the interpreter occasionally by passing it an extension language expression or a small script, is not typical for Elk. It is supported, though; Elk provides a simple extension to pass a Scheme expression to the interpreter as a C string and receive the result in the same form, similar to what \f2Tcl_Eval()\fP does in Tcl (see section @(ch-funcall)). In a typical Elk-based application the extension language serves as the ``backbone'' of the application: the application's driving logic or main loop is written entirely in Scheme, and this Scheme code calls out to the application's C layer, using the data types, primitives, and other callbacks exported to the extension language by the application. With the help of the @[.X11 extension]s, the entire (graphical) user interface of an application can be written in Scheme easily; control can then passed to the application's C/C++ layer whenever an Xt callback is triggered. In this case, the application's ``main loop'' consists of a call to the Scheme primitive corresponding to the X toolkit function \f2XtAppMainLoop()\fP (the main event dispatch loop). .\" --------------------------------------------------------------------------- .K1 "Notes for Writing C/C++ Code Using Elk" .Rf ch-notes \*(SN .PP This chapter describes general conventions and usage notes for Elk-based C/C++ code and introduces a few useful facilities that are not directly related to Scheme. .\" --------------------------------------------------------------------------- .K2 "Elk Include Files" .PP Every C or C++ file using functions, macros, or variables defined by Elk must @[.=include files]include the file @[.\f2scheme.h\fP]: .Es #include \f1or:\fP #include "scheme.h" .Ee .PP This include file resides in a subdirectory \f2include\fP of the directory where Elk has been installed on your system. You must insert a suitable \-I option into your Makefiles to add this directory to the C compiler's search path. ``scheme.h'' includes several other Elk-specific include files from the same directory and, in addition, the standard C include files @[.\f2\fP] and @[.\f2\%\fP]. .\" --------------------------------------------------------------------------- .K2 "Standard C and Function Prototypes" .PP All the examples shown in this manual are written in @[.ANSI/ISO C]. This assumes that the Elk include files have been installed with @[.function prototypes] enabled. Whether or not function prototypes are enabled is controlled by a definition in the platform- and compiler-specific ``config/system'' file that has been selected for configuring Elk. However, if the include files have function prototypes disabled, prototypes are enable automatically if you are compiling your code with a @[.C compiler] that defines the symbol @[.``_\^_STDC_\^_]'' as non-zero, or with a @[.C++ compiler] that defines @[.``_\^_cplusplus'']\**. .FS Although the public include files provided by Elk can be used by C++ code, Elk itself cannot be compiled with a C++ compiler. The interpreter has been written in C to maximize portability. .FE .PP Elk include files that have been installed with function prototypes disabled can also be ``upgraded'' by defining the symbol @[.``WANT_PROTOTYPES''] before including ``scheme.h''. Similarly, include files installed without function prototypes can be used with a non-ANSI C compiler by defining the symbol @[.``NO_PROTOTYPES''] before including ``scheme.h''. .\" --------------------------------------------------------------------------- .K2 "External Symbols Defined by Elk" .PP As extensions or applications are linked with Elk (regarless of whether dynamic loading or static linking is used), they can in general reference all external symbols exported by Elk. Of these, only the symbols described in this manual may be used safely. Use of other (private) symbols results in non-portable code, as the symbols may change their meaning or may even be removed from future releases of Elk. The same restriction applies to the macros and types defined by the include files of Elk. .PP In addition to the symbols defined by the Scheme interpreter kernel, those exported by other @[.Scheme extensions] that are present in the same executable (or have been loaded earlier) can be referenced from within C/C++ code. These extensions are not subject of this manual; you should refer to the relevant documentation and the public include files that are part of the extensions. .PP If Elk is linked with an application that has its own \f2main()\fP function, none of the functions exported by Elk must be used before the initial call to @[.\f2Elk_Init()\fP] (except \f2Set_App_Name()\fP). .\" --------------------------------------------------------------------------- .K2 "Calling Scheme Primitives" .Rf ch-prims \*(SN .PP A large subset of the symbols exported by the Scheme interpreter is the set of functions implementing the @[.Scheme primitives]. These may be used safely by extensions and applications. There exists one C function for each Scheme primitive. Its name is that of the corresponding primitive with the following conversions applied: .Rs .IP \(bu dashes are replaced by underscores, and the initial letters of the resulting word components are capitalized; .IP \(bu the prefix ``P_'' is prepended; .IP \(bu ``\(mi>'' is replaced by ``_To_'' (as in \f2vector\(mi>list\fP); .IP \(bu a trailing exclamation mark is deleted, except for \f2append!\fP and \f2reverse!\fP, where ``_Set'' is appended; .IP \(bu a trailing question mark is replaced by the letter `p' (except for \f2eq?, eqv?, equal?\&\fP and the string and character comparison primitives, where it is deleted); .Re .LP The names of a few functions are derived differently as shown by this table: .RS .TS box, tab(~); c c c l. Scheme Primitive~C Function _ <~P_Generic_Less() >~P_Generic_Greater() \&=~P_Generic_Equal() <=~P_Generic_Eq_Less() >=~P_Generic_Eq_Greater() 1+~P_Inc() 1\(mi and \(mi1+~P_Dec() +~P_Generic_Plus() \(mi~P_Generic_Minus() *~P_Generic_Multiply() /~P_Generic_Divide() let*~P_Letseq() .TE .RE .PP According to these rules, the primitive \f2exact\(mi>inexact\fP can be used from within C as \f2P_Exact_To_Inexact()\fP, the predicate \f2integer?\&\fP is available as \f2P_Integerp()\fP, etc. Authors of reusable Scheme extensions are encouraged to follow these (or similar) naming conventions in their code. .PP All the functions implementing Scheme primitives (as well as special forms, which are treated as primitives in Elk) receive Scheme objects or arrays thereof as their arguments and return Scheme objects as their values. The underlying C type will be described in the next chapter. For the semantics of the non-standard Scheme primitives defined by Elk refer to the Reference Manual for the interpreter. .\" --------------------------------------------------------------------------- .K2 "Portable alloca()" .Rf ch-alloca \*(SN .PP Elk provides a portable variant of @[.\f2alloca()\fP] as a set of macros that can be used by extensions and applications. \f2alloca()\fP, which is supported by most modern UNIX systems and C compilers, allocates memory in the caller's stack frame; the memory is automatically released when the function returns. Elk simulates this functionality on the (rare) platforms where \f2alloca()\fP is not available. .PP To allocate memory, the macro @[.\f2Alloca()\fP] is called with a variable to which the newly allocated memory is assigned, the type of that variable, and the number of bytes that are requested. The macro @[.\f2Alloca_End\fP] must be called (without an argument list) before returning from a function or block that uses @[.\f2Alloca()\fP]; this macro is empty on those platforms that support the ordinary \f2alloca()\fP. Finally, a call to the macro @[.\f2Alloca_Begin\fP] must be placed in the function's declarations. \f2Alloca()\fP usually is more efficient than \f2malloc()\fP and \f2free()\fP, and the memory need not be freed when the function is left prematurely because of an interrupt or by calling a @[.continuation]. .LP As an example, here is the skeleton of a function that is called with a filename prefix and a suffix, concatenates them (separated by a period), and opens the resulting file: .Es int some_function(char *prefix, char *suffix) { char *name; int len, fd; Alloca_Begin; .El len = strlen(prefix) + 1 + strlen(suffix) + 1; Alloca(name, char*, len); sprintf(name, "%s.%s", prefix, suffix); fd = open(name, ...); ... Alloca_End; } .Ee .\" --------------------------------------------------------------------------- .K2 "Other Useful Macros and Functions" .PP The preprocessor symbols @[.ELK_MAJOR] and @[.ELK_MINOR] expand to the major and minor version number of the current release of Elk. They did not exist in versions older than Elk \*(Vs. .PP @[.\f2index()\fP], @[.\f2bcopy()\fP], @[.\f2bcmp()\fP], and @[.\f2bzero()\fP] are defined as suitable macros on systems that do not have them in their C library; they may be used by source files that include ``scheme.h'', regardless of the actual platform. .LP Code linked with Elk may use the two functions .Es @[.=Safe_Malloc()]@[.=Safe_Realloc()] char *Safe_Malloc(unsigned size); char *Safe_Realloc(char *old_pointer, unsigned size); .Ee as alternatives to \f2malloc()\fP and \f2realloc()\fP. If the request for memory cannot be satisfied, the standard Elk error handler is called with a suitable error message. .\" --------------------------------------------------------------------------- .K1 "The Anatomy of Scheme Objects" .Rf ch-anatomy \*(SN .PP All Scheme objects, regarless of their Scheme type, are represented as instances of the type @[.\f2Object\fP] in C. \f2Object\fP is implemented as a small C \f2struct\fP in newer Elk releases and was an integral type earlier. However, code using Elk should not assume a specific representation, as it may change again in future revisions. An \f2Object\fP consists of three components: .Rs .IP \(bu the type of the corresponding Scheme object as a small integer (the @[.``type field''] or @[.``tag field'']), .IP \(bu the contents of the object, either directly (for small objects) or as a pointer into the Scheme @[.heap] (the @[.``pointer field'']), .IP \(bu a @[.``const bit''] which, if set, indicates that the object is read-only and cannot be modified by destructive Scheme primitives. .Re .PP Elk defines a few macros to retrieve and modify the fields of an \f2Object\fP independent of its representation: .Es @[.=TYPE()]@[.=POINTER()]@[.=ISCONST()]@[.=SETCONST()]@[.=SET()] TYPE(obj) ISCONST(obj) SET(obj,t,ptr) POINTER(obj) SETCONST(obj) .Ee .PP \f2TYPE()\fP returns the contents of the type field of an \f2Object\fP; \f2POINTER()\fP returns the contents of the pointer field as an \f2unsigned long\fP (different macros are provided for types which have their values stored directly in the \f2Object\fP rather than in the heap); \f2ISCONST()\fP returns the value of the const bit; and \f2SETCONST()\fP sets the const bit to 1 (it cannot be cleared once it has been set). \f2ISCONST()\fP and \f2SETCONST()\fP may only be applied to \f2Objects\fP that have their value stored on the heap (such as vectors, strings, etc.); all other types of Scheme objects are \f2ipso facto\fP read-only. Another macro, \f2SET()\fP, can be used to set both the type and pointer field of a new object. .PP Two objects can be compared by means of the macro @[.=EQ()] \f2EQ()\fP, which is also used as the basis for the Scheme predicate @[.\f2eq?\fP]: .Es EQ(obj1,obj2) .Ee \f2EQ()\fP expands to a non-zero value if the type fields and the pointer fields of the two objects are identical, else zero (regardless of whether the pointer field really holds a pointer or the object's actual value). As \f2EQ()\fP may evaluate its arguments twice, it should not be invoked with function calls or complex expressions. .\" --------------------------------------------------------------------------- .K2 "Type-specific Macros" .PP For each predefined Scheme type, there exists a preprocessor symbol that expands to the integer value of that type (the contents of the type field of members of the type). The name of each such symbol is the name of the type with the prefix ``T_'': .Es T_Boolean T_Pair T_Vector \f1etc...\fP .Ee These symbols are typically used as case labels in switch-statements to discriminate the possible types of a given object, or in if-statements to check whether a Scheme object is of a given type: .Es if (TYPE(obj) == T_Vector) ... .Ee In addition, each type defines a macro to extract the contents of an object of that type and to convert it to the correct C type. For example, the macro .Es @[.=CHAR()] CHAR(obj) .Ee is used to fetch the character value (a C \f2int\fP) from members of the Scheme type \f2character\fP, that is, from objects whose type field contains the value \f2T_Character\fP. Similarly, the macro .Es @[.=VECTOR()] VECTOR(obj) .Ee gets the heap pointer conveyed in objects of the Scheme type @[.\f2vector\fP]. For objects such as vectors, pairs, and procedures, the heap address is coerced to a pointer to a C \f2struct\fP defining the layout of the object. There exists one structure type declaration for each such Scheme type; their names are that of the type with ``S_'' prepended. For example, \f2VECTOR()\fP returns a pointer to a structure with the components \f2size\fP (the number of elements in the vector) and \f2data\fP (the elements as an array of \f2Objects\fP). These can be used from within C code like this: .Es int i, num = VECTOR(obj)->size; .El for (i = 0; i < num; i++) VECTOR(obj)->data[i] = ...; .Ee Similarly, the structure underlying the Scheme type @[.\f2pair\fP] is defined as: .Es struct S_Pair { Object car, cdr; }; .Ee and the macro \f2PAIR()\fP returns a (heap) pointer to a member of the structure \f2S_Pair\fP. Macros such as \f2VECTOR()\fP and \f2PAIR()\fP just convert the contents of the pointer field to a pointer of the correct type: .Es #define VECTOR(obj) ((struct S_Vector *)POINTER(obj)) #define PAIR(obj) ((struct S_Pair *)POINTER(obj)) .Ee .PP Authors of Scheme extensions and Elk-based applications are encouraged to follow these conventions in their code and, for each new type \f2xyz\fP, store the new type value (which is allocated by the interpreter when the type is registered) in a variable \f2T_Xyz\fP, and define a structure or class \f2S_Xyz\fP, and a macro \f2XYZ()\fP that makes a pointer to this structure from a member of the type. Capitalization may vary according to personal preference. .\" --------------------------------------------------------------------------- .K1 "Defining New Scheme Primitives" @[.=Scheme primitives] .Rf ch-defprim \*(SN .PP In Elk, there exists a one-to-one relationship between Scheme primitives and C functions: each Scheme primitive\*-whether predefined or user-defined\*-is implemented by a corresponding C function. This includes @[.special forms], which are treated as a special kind of primitives in Elk. Extensions and applications use the function @[.\f2Define_Primitive()\fP] to register a new Scheme primitive with the interpreter, supplying its name and the C function that implements it. In case of dynamically loadable extensions or application modules, the calls to \f2Define_Primitive()\fP are placed in the @[.extension initialization function]s that are called automatically as the object file is loaded. \f2Define_Primitive()\fP is declared as .Es void Define_Primitive((Object (*func)()), const char *name, int minargs, int maxargs, enum discipline disc); .Ee The arguments are: .Rs .IP \f2func\fP a pointer to the C function implementing the new primitive; .IP \f2name\fP the name of the primitive as a null-terminated C string; .IP \f2minargs\fP the minimum number of arguments accepted by the primitive; .IP \f2maxargs\fP the maximum number of arguments (identical to \f2minargs\fP in most cases); .IP \f2disc\fP the @[.\f2calling discipline\fP] (usually \f2EVAL\fP). .Re .PP \f2Define_Primitive()\fP creates a Scheme variable of the specified name in the current (i.\|e.\& the caller's) lexical environment and binds it to the newly created procedure. Each C function that implements a primitive has a return type of \f2Object\fP and, for a calling discipline of \f2EVAL\fP, zero or more arguments of type \f2Object\fP which are bound to the evaluated arguments passed to the Scheme primitive when it is called. The calling discipline must be one of the following: .Rs .IP \f2EVAL\fP\0\0 @[.=EVAL] The primitive expects a fixed number of arguments; \f2minargs\fP and \f2maxargs\fP must be identical\**. .FS Because of a limitation in the C language, primitives of type \f2EVAL\fP can only have a fixed maximum number of arguments (currently 10). If more arguments are required, \f2VARARGS\fP must be used instead. .FE .IP \f2VARARGS\fP @[.=VARARGS] The primitive has a variable number of arguments, and the underlying C function is called with an argument count and an array of arguments. Defining primitives with a variable number of arguments will explained in more detail in section @(ch-varargs). .IP \f2NOEVAL\fP @[.=NOEVAL] The arguments are passed as a Scheme list of unevaluated objects\*-a single argument of the type \f2Object\fP. Primitives using this discipline will then use \f2Eval()\fP as described in section @(ch-funcall) to evaluate some or all of the arguments. \f2NOEVAL\fP is only rarely used (with the exception of the built-in @[.special forms] of Elk); extensions and applications mostly use macros as a more convenient way to defined new syntactical forms. .Re .LP Figure @(defprim) shows a simple example for defining a new Scheme primitive. .Fs #include "scheme.h" .El Object p_vector_reverse(Object vec) { Object tmp, *s, *t; .El Check_Type(vec, T_Vector); for (s = VECTOR(vec)->data, t = s+VECTOR(vec)->size; --t > s; s++) tmp = *s, *s = *t, *t = tmp; return vec; } .El void elk_init_vector(void) { Define_Primitive(p_vector_reverse, "vector-reverse!", 1, 1, EVAL); } .Fc "Defining a new Scheme Primitive" .Fe defprim .PP The primitive @[.\f2vector-reverse!\fP] defined by the example extension reverses the elements of a Scheme @[.vector] in place and returns its argument (note the final exclamation mark indicating the destructive operation). @[.\f2Check_Type()\fP] is a simple macro that compares the type field of the first argument (an \f2Object\fP) with the second argument and signals and error if they do not match. This macro is used primarily for type-checking the arguments to Scheme primitives. A call to the macro @[.\f2Check_Mutable()\fP] with the vector as an argument could have been inserted before the loop to check whether the vector is read-only and to automatically raise an error if this is the case. The example code forms a complete extension including an @[.extension initialization function] and could be linked with the interpreter, or loaded dynamically into the interpreter as follows: .Es \f6%\fP cc \-c \-I/usr/elk/include vec.c; makedl vec.o vec.o \f6%\fP scheme \f6>\fP (load 'vec.o) \f6>\fP (define v '#(hello word)) \f6v >\fP (vector-reverse! v) \f6#(world hello) >\fP v \f6#(world hello) >\fP .Ee .\" --------------------------------------------------------------------------- .K2 "Making Objects Known to the Garbage Collector" .Rf ch-gc \*(SN @[.=garbage collector] .PP Consider the non-destructive version of the primitive @[.\f2vector-reverse\fP] shown in Figure @(vecrev1), which returns a new vector instead of altering the contents of the original vector. .Fs Object p_vector_reverse(Object vec) { Object ret; int i, j; .El Check_Type(vec, T_Vector); ret = Make_Vector(VECTOR(vec)->size, False); for (i = 0, j = VECTOR(vec)->size; --j >= 0; i++) VECTOR(ret)->data[i] = VECTOR(vec)->data[j]; return ret; } .Fc "Non-destructive Scheme primitive \f2vector-reverse\fP" .Fe vecrev1 .PP The code in Figure @(vecrev1) is identical to that shown in Figure @(defprim), except that a new vector is allocated, filled with the contents of the original vector in reverse order, and returned as the result of the primitive. @[.\f2Make_Vector()\fP] is declared by Elk: .Es Object Make_Vector(int size, Object fill); .Ee \f2size\fP is the length of the vector, and all elements are initialized to the Scheme object \f2fill\fP. In the example, the predefined global variable @[.\f2False\fP] is used as the \f2fill\fP object; it holds the boolean Scheme constant #f (any \f2Object\fP could have been used here). .PP Although the C function may look right, there is a problem when it comes to garbage collection. To understand the problem and its solution, it may be helpful to have a brief look at how the garbage collector\** .FS Elk actually employs two garbage collectors, one based on the traditional stop-and-copy strategy, and a generational, incremental garbage collector which is less disruptive but not supported on all platforms. .FE works (the following description presents a simplified view; the real algorithm is more complex). In Elk, a @[.garbage collection] is triggered automatically whenever a request for heap space cannot be satisfied because the @[.heap] is full, or explicitly by calling the primitive @[.\f2collect\fP] from within Scheme code. The garbage collector traces all ``live'' objects starting with a known @[.\f2root set\fP] of pointers to reachable objects (basically the interpreter's global lexical environment and its symbol table). Following these pointers, all accessible Scheme objects are located and copied to a new heap space in memory (``forwarded''), thereby compacting the heap. Whenever an object is relocated in memory during garbage collection, the contents of the @[.pointer field] of the corresponding C \f2Object\fP is updated to point to the new location. After that, any constituent objects (e.\|g.\& the elements of a vector) are forwarded in the same way. .PP As live objects are relocated in memory, \f2all\fP pointers to an object need to be updated properly when that object is forwarded during garbage collection. If a pointer to a live object were not in the root set (that is, not reachable by the garbage collector), the object would either become garbage erroneously during the next garbage collection, or, if it had been reached through some other pointer, the original pointer would now point to an invalid location.\** .FS The problem of managing an ``exact root set'' can be avoided by a technique called \f2conservative\fP garbage collection. A conservative garbage collector treats the data segment, stack, and registers of the running program as \f2ambiguous roots\fP. If the set of ambiguous roots is a superset of the \f2actual\fP roots, then a pointer that looks like a heap pointer can safely be considered as pointing to an accessible object that cannot be reclaimed. At the time Elk was designed, conservative GC was still in its infancy and sufficient experience did not exist. For this reason, and because of the implied risks on certain machine architectures, the inherent portability problems, and the inability to precisely determine the actual memory utilization, a traditional GC strategy was chosen for Elk. .FE This is exactly what happens in the example shown in Figure @(vecrev1). .PP The call to \f2Make_Vector()\fP in the example triggers a garbage collection if the heap is too full to satisfy the request for heap space. As the \f2Object\fP pointer stored in the argument \f2vec\fP is invisible to the garbage collector, its pointer field cannot be updated when the vector to which it points is forwarded during the garbage collection started inside \f2Make_Vector()\fP. As a result, all further references to \f2VECTOR(vec)\fP will return an invalid address and may cause the program to crash (immediately or, worse, at a later point). The solution is simple: the primitive just needs to add \f2vec\fP to the set of initial pointers used by the garbage collector. This is done by inserting the line .Es GC_Link(vec); .Ee at the beginning of the function before the call to \f2Make_Vector()\fP. @[.\f2GC_Link()\fP] is a macro. Another macro, @[.\f2GC_Unlink\fP], must be called later (e.\|g.\& at the end of the function) without an argument list to remove the object from the root set again. In addition, a call to @[.\f2GC_Node\fP] (again without an argument list) must be placed in the declarations at the beginning of the enclosing function or block. Figure @(vecrev2) shows the revised, correct code. .Fs Object p_vector_reverse(Object vec) { Object ret; int i, j; GC_Node; .El GC_Link(vec); Check_Type(vec, T_Vector); ret = Make_Vector(VECTOR(vec)->size, False); for (i = 0, j = VECTOR(vec)->size; --j >= 0; i++) VECTOR(ret)->data[i] = VECTOR(vec)->data[j]; GC_Unlink; return ret; } .Fc "Non-destructive Scheme primitive \f2vector-reverse\fP, corrected version" .Fe vecrev2 .PP Appendix A lists the C functions which can trigger a garbage collection. Any @[.local variable] or argument of type \f2Object\fP must be protected in the manner shown above if one of these functions is called during its lifetime. This may sound more burdensome than it really is, because most of the ``dangerous'' functions are rarely or never used from within C/C++ extensions or applications in practice. Most primitives that require calls to \f2GC_Link()\fP use some function that creates a new Scheme object, such as \f2Make_Vector()\fP in the example above. .PP To simplify GC protection of more than a single argument or variable, additional macros @[.\f2GC_Link2()\fP], @[.\f2GC_Link3()\fP], and so on up to \f2GC_Link7()\fP are provided. Each of these can be called with as many arguments of type \f2Object\fP as is indicated by the digit (separate macros are required, because macros with a variable number of arguments cannot be defined in C). A corresponding macro @[.\f2GC_Node2\fP], @[.\f2GC_Node3\fP], and so on, must be placed in the declarations. Different \f2GC_Link*()\fP calls cannot be mixed. All @[.local variable]s passed to one of the macros must have been initialized. GC protection is not required for ``pointer-less'' objects such as booleans and small integers, and for the arguments of primitives with a variable number of arguments (as described in section @(ch-varargs)). Section @(ch-gcglobal) will describe how global (external) \f2Object\fP variables can be added to the root set. .PP Here is how the implementation of the primitive @[.\f2cons\fP] uses \f2GC_Link2()\fP to protect its arguments (the @[.car] and the @[.cdr] of the new pair): .Es Object P_Cons(Object car, Object cdr) { Object new_pair; GC_Node2; .El GC_Link2(car, cdr); new_pair = \f2allocate heap space and initialize object\fP; GC_Unlink; return new_pair; } .Ee .PP There are a few pitfalls to be aware of when using ``dangerous'' functions from within your C/C++ code. For example, consider this code fragment which fills a Scheme vector with the program's environment strings that are available through the null-terminated string array \f2environ[]\fP: .Es Object vec = \f2new vector of the right size\fP; int i; GC_Node; .El GC_Link(vec); for (i = 0; environ[i] != 0; i++) VECTOR(vec)->data[i] = Make_String(environ[i], strlen(environ[i])); .Ee (\f2Make_String()\fP creates and initializes a new Scheme string.) The body of the for-loop contains a subtle bug: depending on the compiler used, the left hand side of the assignment (the expression involving \f2vec\fP) may be evaluated before @[.\f2Make_String()\fP] is invoked. As a result, a copy of the contents of \f2vec\fP might be, for instance, stored in a register before a garbage collection is triggered while evaluating the right hand side of the assignment. The garbage collector would then move the vector object in memory, updating the\*-properly GC-protected\*-variable \f2vec\fP, but not the temporary copy in the register, which is now a dangling reference. To avoid this, the loop must be modified along these lines: .Es for (i = 0; environ[i]; i++) { Object temp = Make_String(environ[i], strlen(environ[i])); VECTOR(vec)->data[i] = temp; } .Ee A related pitfall to watch out for is exemplified by this code fragment: .Es Object obj; \&... GC_Link(obj); \&... some_function(obj, P_Cons(car, cdr)); .Ee Here, the call to @[.\f2P_Cons()\fP]\*-just like \f2Make_String()\fP above\*-can trigger a garbage collection. Depending on the C compiler, the properly GC-protected object pointer \f2obj\fP may be pushed on the argument stack before \f2P_Cons()\fP is invoked, as the order in which function arguments\*-just like the operands of the assignment operator\*-are evaluated is undefined in the C language. In this case, if a garbage collection takes place and the heap object to which \f2obj\fP points is moved, \f2obj\fP will be updated properly, but the copy on the stack will not. Again, the problem can be avoided easily by assigning the result of the nested function call to a temporary \f2Object\fP variable and use this variable in the enclosing function call: .Es temp = P_Cons(car, cdr); some_function(obj, temp); .Ee .\" --------------------------------------------------------------------------- .K2 "Primitives with Variable-Length Argument Lists" .Rf ch-varargs \*(SN .PP Primitives with a variable number of arguments are registered with the interpreter by calling @[.\f2Define_Primitive()\fP] with the @[.calling discipline] @[.\f2VARARGS\fP] and with different values for \f2minargs\fP and \f2maxargs\fP. The special symbol @[.\f2MANY\fP] can be given as the maximum number of arguments to indicate that there is no upper limit on the primitive's number of actual arguments. The C/C++ function implementing a primitive with a variable number of arguments is called with two arguments: an integer count that specifies the number of actual arguments, and the Scheme arguments as an array of \f2Objects\fP (that is, a pointer to \f2Object\fP). The objects passed as the argument vector of \f2VARARGS\fP primitives are already registered with the garbage collector; calls to \f2GC_Link()\fP are not required. As an example for a primitive with an arbitrary number of arguments, here is the definition of a simplified variant of @[.\f2append!\fP] (which does not handle empty lists): .Es Object p_append_set (int argc, Object *argv); { int i; .El for (i = 0; i < argc-1; i++) (void)P_Set_Cdr (P_Last_Pair (argv[i]), argv[i+1]); return *argv; } .Ee The corresponding call to \f2Define_Primitive()\fP would read: .Es Define_Primitive(p_append_set, "append!", 0, MANY, VARARGS); .Ee .PP Besides implementing primitives with an indefinite maximum number of arguments, the \f2VARARGS\fP discipline is frequently used for primitives with an optional argument. For example, a primitive encapsulating the UNIX \f2open()\fP system call, which has two fixed arguments (filename, flags) and an optional third argument (the mode for newly created files, i.\|e.\& calls with the flag \f2O_CREAT\fP), could be defined as follows: .Es Object p_unix_open(int argc, Object *argv) { char *name = get_file_name(argv[0]); int flags = get_flags(argv[1]); mode_t mode; .El if (flags & O_CREAT) { if (argc < 3) \f2error--too few arguments\fP mode = get_mode(argv[2]); ... .Ee The call to \f2Define_Primitive()\fP could then be written as: .Es Define_Primitive(p_unix_open, "unix-open", 2, 3, VARARGS); .Ee .\" --------------------------------------------------------------------------- .K1 "Predefined Scheme Types" .Rf ch-types \*(SN .PP This chapter introduces the Scheme types predefined by Elk. It begins with the ``pointer-less'' types such as boolean, whose values are stored directly in the pointer field of an \f2Object\fP; followed by the types whose members are C \f2structs\fP that reside on the Scheme heap. .\" --------------------------------------------------------------------------- .K2 "Booleans (T_Boolean)" @[.=T_Boolean] .PP \f2Objects\fP of type \f2T_Boolean\fP can hold the values #t and #f. Two \f2Objects\fP initialized to #t and #f, respectively, are available as the external C variables \f2True\fP and \f2False\fP. The macro .Es @[.=Truep()] Truep(obj) .Ee can be used to check whether an arbitrary Scheme object is regarded as true. Use of \f2Truep()\fP is not necessarily equivalent to .Es !EQ(obj,False) .Ee because the empty list may count as false in addition to #f if backwards compatibility to older Scheme language versions has been enabled. \f2Truep()\fP may evaluate its argument twice and should therefore not be invoked with a function call or a complex expression. .LP The two functions .Es @[.=Eqv()]@[.=Equal()] int Eqv(Object, Object); int Equal(Object, Object); .Ee are identical to the primitives \f2P_Eqv()\fP and \f2P_Equal()\fP, except that they return a C integer rather than a Scheme boolean and therefore can be used more conveniently in C/C++. .\" --------------------------------------------------------------------------- .K2 "Characters (T_Character)" @[.=T_Character] .PP The character value stored in an \f2Object\fP of type \f2T_Character\fP can be obtained by the macro .Es @[.=CHAR()] CHAR(char_obj) .Ee as a non-negative \f2int\fP. A new character object is created by calling the function .Es @[.=Make_Char()] Object Make_Char(int c); .Ee The predefined external C variable @[.\f2Newline\fP] holds the newline character as a Scheme \f2Object\fP. .\" --------------------------------------------------------------------------- .K2 "Empty List (T_Null)" @[.=T_Null] .PP The type \f2T_Null\fP has exactly one member\*-the empty list; hence all \f2Objects\fP of this type are identical. The empty list is available as the external C variable @[.\f2Null\fP]. This variable is often used to initialize \f2Objects\fP that will be assigned their real values later, for example, as the fill element for newly created vectors or to initialize \f2Objects\fP in order to \f2GC_Link()\fP them. A macro \f2Nullp()\fP is provided as a shorthand for checking if an \f2Object\fP is the empty list: .Es @[.=Nullp()] #define Nullp(obj) (TYPE(obj) == T_Null) .Ee This macro is used frequently in the termination condition of for-loops that scan a Scheme list: .Es Object tail; \&... for (tail = some_list; !Nullp(tail); tail = Cdr(tail)) process_element(Car(tail)); .Ee (\f2Car()\fP and \f2Cdr()\fP essentially are shorthands for \f2P_Car()\fP and \f2P_Cdr()\fP and will be revisited in the section on pairs). .\" --------------------------------------------------------------------------- .K2 "End of File (T_End_Of_File)" @[.=T_End_Of_File] .PP The type \f2T_End_Of_File\fP has one member\*-the @[.end-of-file object]\*-and is only rarely used from within user-supplied C/C++ code. The external C variable @[.\f2Eof\fP] is initialized to the end-of-file object. .\" --------------------------------------------------------------------------- .K2 "Integers (T_Fixnum and T_Bignum)" @[.=T_Fixnum]@[.=T_Bignum] .PP Integers come in two flavors: @[.\f2fixnums\fP] and @[.\f2bignums\fP]. The former have their value stored directly in the pointer field and are wide enough to hold most C \f2ints\fP. Bignums can hold integers of arbitrary size and are stored in the heap. Two macros are provided to test whether a given signed (or unsigned, respectively) integer fits into a fixnum: .Es @[.=FIXNUM_FITS()]@[.=UFIXNUM_FITS()] FIXNUM_FITS(integer) UFIXNUM_FITS(unsigned_integer) .Ee The former always returns 1 in Elk \*(Vs, but the range of integer values that can be represented as a fixnum may be restricted in future revisions. It is guaranteed, however, that at least two bits less than the machine's word size will be available for fixnums in future versions of Elk. .LP The value stored in a fixnum can be obtained as a C \f2int\fP by calling the macro .Es @[.=FIXNUM()] FIXNUM(fixnum_obj) .Ee A macro .Es @[.=Check_Integer()] Check_Integer(obj) .Ee can be used as a shorthand for checking whether an \f2Object\fP is a fixnum or a bignum and raising an error otherwise. .LP The following functions are provided to convert C integers to Scheme integers: .Es @[.=Make_Integer()]@[.=Make_Unsigned()] @[.=Make_Long()]@[.=Make_Unsigned_Long()] Object Make_Integer(int); Object Make_Unsigned(unsigned); Object Make_Long(long); Object Make_Unsigned_Long(unsigned long); .Ee \f2Make_Integer()\fP returns a fixnum object if \f2FIXNUM_FITS()\fP returns true for the argument, otherwise a bignum. Likewise, \f2Make_Long()\fP usually returns a fixnum but may have to resort to bignums on architectures where a C \f2long\fP is wider than an \f2int\fP. \f2Make_Unsigned()\fP returns a bignum if the specified integer is larger than the largest positive \f2int\fP that fits into a fixnum (\f2UFIXNUM_FITS()\fP returns zero in this case). Another set of functions convert a Scheme number to a C integer: .Es @[.=Get_Integer()]@[.=Get_Exact_Integer()] int Get_Integer(Object); int Get_Exact_Integer(Object); .El @[.=Get_Unsigned()]@[.=Get_Exact_Unsigned()] unsigned Get_Unsigned(Object); unsigned Get_Exact_Unsigned(Object); .El @[.=Get_Long()]@[.=Get_Exact_Long()] long Get_Long(Object); long Get_Exact_Long(Object); .El @[.=Get_Unsigned_Long()]@[.=Get_Exact_Unsigned_Long()] unsigned long Get_Unsigned_Long(Object); unsigned long Get_Exact_Unsigned_Long(Object); .Ee These functions signal an error if one of the following conditions is true: .Rs .IP \(bu the argument is neither a fixnum, nor a bignum, nor a flonum (real number) with a fractional part of zero (more about @[.flonums] in the next section); .IP \(bu the function is one of the ``unsigned'' variants and the argument is a negative number; .IP \(bu the argument is a bignum too large for the respective return type; .IP \(bu the function is one of the ``exact'' variants and the argument is neither a fixnum nor a bignum; .IP \(bu the argument is a flonum that cannot be coerced to the respective return type. .Re .LP As all of the above functions include suitable type-checks, primitives receiving integer arguments can be written in a simple and straightforward way. For example, a primitive encapsulating the UNIX \f2dup\fP system call (which returns an integer file descriptor pointing to the same file as the original one) can be written as: .Es Object p_unix_dup(Object fd) { return Make_Integer(dup(Get_Exact_Unsigned(fd))); .Ee Note that if \f2Get_Unsigned()\fP (or \f2Get_Integer()\fP) had been used here in place of the ``exact'' conversion function, it would be possible to write expressions such as: .Es (define fd (unix-dup (truncate 1.2))) .Ee .\" --------------------------------------------------------------------------- .K2 "Floating Point Numbers (T_Flonum)" @[.=T_Flonum] .PP @[.=real numbers] Real and @[.inexact number]s are represented as \f2Objects\fP of type \f2T_Flonum\fP. Each such object holds a pointer to a structure on the heap with a component \f2val\fP of type \f2double\fP, so that the expression .Es @[.=FLONUM()] FLONUM(flonum_obj)->val .Ee can be used to obtain the \f2double\fP value. To convert a Scheme number to a \f2double\fP regardless of its type, the more general function .Es @[.=Get_Double()] double Get_Double(Object); .Ee can be used. It raises an error if the argument is not a fixnum, bignum, or flonum, or if it is a bignum too large to fit into a \f2double\fP. .LP The functions .Es @[.=Make_Flonum()]@[.=Make_Reduced_Flonum()] Object Make_Flonum(double); Object Make_Reduced_Flonum(double); .Ee convert a C \f2double\fP to a flonum; the latter returns a fixnum if the \f2double\fP is small enough to fit into a fixnum and has a fractional part of zero. The macro .Es @[.=Check_Number()] Check_Number(obj) .Ee checks whether the given \f2Object\fP is a number (that is, a fixnum, bignum, or flonum in the current revision of Elk) and raises an error otherwise. .\" --------------------------------------------------------------------------- .K2 "Pairs (T_Pair)" @[.=T_Pair] .PP Pairs have two components of type \f2Object\fP, the @[.car] and the @[.cdr], that can be accessed as: .Es @[.=PAIR()] PAIR(pair_obj)->car PAIR(pair_obj)->cdr .Ee Two macros @[.\f2Car()\fP] and @[.\f2Cdr()\fP] are provided as shorthands for these expressions, and another macro @[.\f2Cons()\fP] can be used in place of @[.\f2P_Cons()\fP] to create a new pair. The macro .Es @[.=Check_List()] Check_List(obj) .Ee checks whether the specified \f2Object\fP is either a pair or the empty list and signals an error otherwise. The predefined function .Es @[.=Fast_Length()] int Fast_Length(Object list); .Ee can be used to compute the length of the given Scheme list. This function is more efficient than the primitive \f2P_Length()\fP, because it neither checks the type of the argument nor whether the given list is proper, and the result need not be converted to a Scheme number. The function .Es @[.=Copy_List()] Object Copy_List(Object list); .Ee returns a copy of the specified list (including all its sublists). .PP As explained in section @(ch-gc), care must be taken when mixing calls to these macros, because \f2Cons()\fP may trigger a garbage collection: an expression such as .Es Car(x) = Cons(y, z); .Ee is wrong, even if \f2x\fP is properly ``GC_Linked'', and should be replaced by .Es tmp = Cons(x, y); Car(x) = tmp; .Ee or a similar sequence. .\" --------------------------------------------------------------------------- .K2 "Symbols (T_Symbol)" @[.=T_Symbol] .PP \f2Objects\fP of type \f2T_Symbol\fP have one public component\*-the symbol's name as a Scheme string (that is, an \f2Object\fP of type \f2T_String\fP): .Es @[.=SYMBOL] SYMBOL(symbol_obj)->name .Ee A new symbol can be created by calling one of the functions .Es @[.=Intern()]@[.=CI_Intern()] Object Intern(const char *); Object CI_Intern(const char *); .Ee with the new symbol's name as the argument. \f2CI_Intern()\fP is the case-insensitive variant of \f2Intern()\fP; it maps all upper case characters to lower case. \f2EQ()\fP yields true for all \f2Objects\fP returned by calls to \f2Intern()\fP with strings with the same contents (or calls to \f2CI_Intern()\fP with strings that are identical after case conversion). This is the main property that distinguishes symbols from strings in Scheme. .PP A symbol that is used by more than one function can be stored in a global variable to save calls to \f2Intern()\fP. This can be done using the convenience function .Es @[.=Define_Symbol()] void Define_Symbol(Object *var, const char *name); .Ee \f2Define_Symbol()\fP is called with the address of a variable where the newly-interned symbol is stored and the name of the symbol to be handed to \f2Intern()\fP. The function adds the new symbol to the garbage collector's @[.root set] to make it reachable (as described in section @(ch-gcglobal). Example: .Es static Object sym_else; \&... void elk_init_example(void) { Define_Symbol(&sym_else, "else"); ... } .Ee .\" --------------------------------------------------------------------------- .K3 "The Non-Printing Symbol" .PP By convention, Scheme primitives that do not have a useful return value (for example the output primitives) return the @[.``non-printing symbol''] in Elk. The name of this symbol consists of the empty string; it does not produce any output when it is printed, for example, by the toplevel read-eval-print loop. In Scheme code, the non-printing symbol can be generated by using the reader syntax ``#v'' or by calling \f2string\(mi>symbol\fP with the empty string. On the C language level, the non-printing symbol is available as the external variable @[.\f2Void\fP], so that primitives lacking a useful return value can use .Es return Void; .Ee .\" --------------------------------------------------------------------------- .K2 "Strings (T_String)" @[.=T_String] .PP \f2Objects\fP of type string have two components\*-the length and the contents of the string as a pointer to \f2char\fP: .Es STRING(string_obj)->size STRING(string_obj)->data .Ee The \f2data\fP component is not null-terminated, as a string itself may contain a null-byte as a valid character in Elk. A Scheme string is created by calling the function .Es @[.=Make_String()] Object Make_String(const char *init, int size); .Ee \f2size\fP is the length of the newly-created string. \f2init\fP is either the null-pointer or a pointer to \f2size\fP characters that are copied into the new Scheme string. For example, the sequence .Es Object str; \&... str = Make_String(0, 100); bzero(STRING(str)->data, 100); .Ee generates a string holding 100 null-bytes. .PP Most primitives that receive a Scheme string as one of their arguments pass the string's contents to a C function (for example a C library function) that expects an ordinary, null-terminated C string. For this purpose Elk provides a function .Es @[.=Get_String()] char *Get_String(Object); .Ee that returns the contents of the Scheme string argument as a null-terminated C string. An error is raised if the argument is not a string. \f2Get_String()\fP has to create a copy of the contents of the Scheme string in order to append the null-character. To avoid requiring the caller to provide and release space for the copy, \f2Get_String()\fP operates on and returns @[.NUMSTRBUFS] internal, cyclically reused buffers (the value of NUMSTRBUFS is 3 in Elk \*(Vs). Consequently, no more than NUMSTRBUFS results of \f2Get_String()\fP can be used simultaneously (which is rarely a problem in practice). As an example, a Scheme primitive that calls the C library function \f2getenv()\fP and returns #f on error can be written as .Es Object p_getenv(Object name) { char *ret = getenv(Get_String(name)); return ret ? Make_String(ret, strlen(ret)) : False; } .Ee .PP If more strings are to be used simultaneously, the macro @[.\f2Get_String_Stack()\fP] can be used instead. It is called with the Scheme object and the name of a variable of type ``char*'' to which the C string will be assigned. \f2Get_String_Stack()\fP allocates space by means of @[.\f2Alloca()\fP] (as explained in section @(ch-alloca)); hence a call to @[.\f2Alloca_Begin\fP] must be placed in the declarations of the enclosing function or block, and @[.\f2Alloca_End\fP] must be called before returning from it. .PP An additional function @[.\f2Get_Strsym()\fP] and an additional macro @[.\f2Get_Strsym_Stack()\fP] are provided by Elk; these are identical to \f2Get_String()\fP and \f2Get_String_Stack()\fP, respectively, except that the Scheme object may also be a symbol. In this case, the symbol's name is taken as the string to be converted. .PP As an example for the use of \f2Get_String_Stack()\fP, here is a simple Scheme primitive \f2exec\fP that is called with the name of a program and one more more arguments and passes them to the \f2execv()\fP system call: .Es Object p_exec(int argc, Object *argv) { char **argp; int i; Alloca_Begin; .El Alloca(argp, char**, argc*sizeof(char *)); for (i = 1; i < argc; i++) Get_String_Stack(argv[i], argp[i-1]); argp[i-1] = 0; execv(Get_String(*argv), argp); /* must not return */ \f2error...\fP } .El elk_init_example() { Define_Primitive(p_exec, "exec", 2, MANY, VARARGS); } .Ee The primitive can be used as follows: .Es (exec "/bin/ls" "ls" "-l") .Ee \f2Get_String()\fP could not be used in this primitive, because the number of string arguments may exceed the number of static buffers maintained by \f2Get_String()\fP. .\" --------------------------------------------------------------------------- .K2 "Vectors (T_Vector)" @[.=T_Vector] .PP The layout of \f2Objects\fP of type vector is identical to that of strings, except that the \f2data\fP component is an array of \f2Objects\fP. A function @[.\f2Make_Vector()\fP] creates a new vector as has been explained in section @(ch-gc) above. .\" --------------------------------------------------------------------------- .K2 "Ports (T_Port)" @[.=T_Port] .PP The components of \f2Objects\fP of type \f2T_Port\fP are not normally accessed directly from within C/C++ code, except for .Es PORT(port_obj)->closefun .Ee which is a pointer to a function receiving an argument of type ``FILE*'' (for example, a pointer to \f2fclose()\fP), provided that the port is a file port. It is called automatically whenever the port is closed, either because \f2close-input-port\fP or \f2close-output-port\fP is applied to it or because the garbage collector has determined that the port is no longer reachable. .LP A new file port is created by calling .Es @[.=Make_Port()] Object Make_Port(int flags, FILE *f, Object name); .Ee with a first argument of either zero (output port), \f2P_INPUT\fP (input port) or \f2P_BIDIR\fP (bidirectional port), the file pointer, and the name of the file as a Scheme string. The macros .Es @[.=Check_Input_Port()]@[.=Check_Output_Port()] Check_Input_Port(obj) Check_Output_Port(obj) .Ee check whether the specified port is open and is capable of input (or output, respectively); an error is raised otherwise. .PP To arrange for a newly-created port to be closed automatically when it becomes garbage, it must be passed to the function \f2Register_Object()\fP as follows: .Es @[.=Register_Object()]@[.=Terminate_File()] Register_Object(the_port, 0, Terminate_File, 0); .Ee \f2Register_Object()\fP will be described in section @(ch-term). The current input and output port as well as ports pointing to the program's initial standard input and output are available as four external variables of type \f2Object\fP: .Es @[.=Curr_Input_Port]@[.=Curr_Output_Port] @[.=Standard_Input_Port]@[.=Standard_Output_Port] Curr_Input_Port Standard_Input_Port Curr_Output_Port Standard_Output_Port .Ee The function .Es @[.=Reset_IO()] void Reset_IO(int destructive_flag); .Ee clears any input queued at the current input port, then flushes the current output port (if \f2destructive_flag\fP is zero) or discards characters queued at the output port (if \f2destructive_flag\fP is non-zero), and finally resets the current input and current output port to their initial values (the program's standard input and standard output). This function is typically used in error situations to reset the current ports to a defined state. .PP In addition to the standard Scheme primitives for output, extensions and applications can use a function .Es @[.=Printf()] void Printf(Object port, char *fmt, ...); .Ee to send output to a Scheme port using C \f2printf\fP. The first argument to \f2Printf()\fP is the Scheme port to which the output will be sent (it must be an output port); the remaining arguments are that of the C library function \f2printf()\fP. .LP To output a Scheme object, the following function can be used in addition to the usual primitives: .Es @[.=Print_Object()] void Print_Object(Object obj, Object port, int raw_flag, int print_depth, int print_length); .Ee The arguments to \f2Print_Object()\fP are identical to the arguments of the ``print function'' that must be supplied for each user-defined Scheme type (as described in section @(ch-deftype): the \f2Object\fP to be printed, the output port, a flag indicating that the object should be printed in human-readable form (\f2display\fP sets the flag, \f2write\fP does not), and the ``print depth'' and ``print length'' for that operation. For debugging purposes, the macro .Es @[.=Print()] Print(obj); .Ee may be used to output an \f2Object\fP to the current output port. .LP A function .Es @[.=Load_Source_Port()] void Load_Source_Port(Object port); .Ee can be used to load Scheme expressions from a file that has already been opened as a Scheme port. .\" --------------------------------------------------------------------------- .K2 "Miscellaneous Types" .PP Other built-in Scheme types are lexical environments, primitive procedures, compound procedures, macros, continuations (also called ``control points'' at a few places in Elk), and promises. These types are not normally created or manipulated from within C or C++ code. If you are writing a specialized extension that depends on the C representation of these types, refer to the declarations in the public include file ``object.h'' (which is included automatically via ``scheme.h''). .PP Lexical environments are identical to pairs except that the type is @[.\f2T_Environment\fP] rather than \f2T_Pair\fP. The current environment and the initial (gobal) environment are available as the external C variables @[.\f2The_Environment\fP] and @[.\f2Global_Environment\fP]. The predefined type constants for primitives, compound procedures (the results of evaluating lambda expressions), and macros are @[.\f2T_Primitive\fP], @[.\f2T_Compound\fP], and @[.\f2T_Macro\fP], respectively. The function .Es @[.=Check_Procedure()] void Check_Procedure(Object); .Ee checks whether the specified object is either a compound procedure or a primitive procedure with a calling discipline different from \f2NOEVAL\fP and raises an error otherwise. The type constant for continuations is @[.\f2T_Control\fP]. ``Promise'' is the type of object returned by the special form \f2delay\fP; the corresponding type constant is named @[.\f2T_Promise\fP]. .\" --------------------------------------------------------------------------- .K1 "Defining New Scheme Types" .Rf ch-deftype \*(SN .PP A new, disjoint Scheme type is registered with Elk by calling the function @[.\f2Define_Type()\fP], similar to \f2Define_Primitive()\fP for new primitives. Making a new type known to Elk involves passing it information about the underlying C/C++ representation of the type and a number of C or C++ functions that are ``called back'' by the interpreter in various situations to pass control to the code that implements the type. The prototype of \f2Define_Type()\fP is: .Es int Define_Type(int zero, const char *name, int (*size)(Object), int const_size, int (*eqv)(Object, Object), int (*equal)(Object, Object), int (*print)(Object, Object, int, int, int), int (*visit)(Object*, int (*)(Object*))); .Ee The arguments to \f2Define_Primitive()\fP are in detail: .Rs .IP \f2zero\fP 1 The first argument must be zero (in early versions of Elk it could be used to request a fixed, predefined type number for the new type); .IP \f2name\fP 1 The name of the new type. .IP "\f2size, const_size\fP" 1 The size of the corresponding C type (usually a \f2struct\fP) in bytes, given as one of two, mutually-exclusive arguments: \f2size\fP, a pointer to a function called by the interpreter to determine the size of an object (for types whose individual members are of different sizes, such as the \f2vector\fP type); and \f2const_size\fP, the size as a constant (for all other types). A null-pointer is given for \f2const_size\fP if \f2size\fP is to be used instead. .IP "\f2eqv, equal\fP" 1 Pointers to (callback) functions that are invoked by the interpreter whenever the Scheme predicate \f2equal?\&\fP, or \f2eqv?\&\fP respectively, is applied to members of the newly defined type. As an application-defined type is opaque from the interpreter's point of view, the equality predicates have to be supplied by the application or extension. Each of these (boolean) functions is passed two objects of the new type as arguments when called back. .IP \f2print\fP 1 A pointer to a function that is used by the interpreter to print a member of this type. When calling the print function, the interpreter passes as arguments the Scheme object to be printed, a Scheme \f2port\fP to which the output is to be sent, a flag indicating whether output is to be rendered in human-readable form (\f2display\fP Scheme primitive) or machine-readable, read-write-invariance preserving form (\f2write\fP), and finally the current remainders of the maximum \f2print depth\fP and \f2print length\fP. The return value of this function is not used (the type is \f2int\fP for historical reasons). .IP \f2visit\fP 1 A pointer to a @[.``visit'' function] called by the @[.garbage collector] when tracing the set of all currently accessible objects. This function is only required if other Scheme objects are reachable from objects of the newly defined type (a null pointer can be given otherwise). It is invoked with two arguments: a pointer to the object being visited by the garbage collector, and a pointer to another function to be called once with the address of each object accessible through the original object. For example, the implementation of pairs would supply a visit function that invokes its second argument twice\*-once with the address of the car of the original object, and once with the address of the cdr. .Re .PP The return value of \f2Define_Type()\fP is a small, unique integer identifying the type; it is usually stored in a ``T_*'' (or ``t_*'') variable following the convention used for the built-in types. .PP In the current version of Elk, \f2Define_Type()\fP cannot be used to define new ``pointer-less'' types resembling built-in types such as \f2fixnum\fP or \f2boolean\fP. .PP The first component of the C structure implementing a user-defined Scheme type must be an \f2Object\fP; its space is used by the @[.garbage collector] to store a special tag indicating that the object has been forwarded. If you are defining a type that has several components one of which is an \f2Object\fP, just move the \f2Object\fP to the front of the \f2struct\fP declaration. Otherwise insert an additional \f2Object\fP component. .PP The Scheme primitive that instantiates a new type can request heap space for the new object by calling the function @[.\f2Alloc_Object()\fP]: .Es Object Alloc_Object(int size, int type, int const_flag); .Ee The arguments to \f2Alloc_Object()\fP are the size of the object in bytes (usually obtained by applying \f2sizeof\fP to the underlying \f2struct\fP), the type of which the new object is a member (i.\|e.\& the return value of \f2Define_Type()\fP), and a flag indicating whether the newly created object is to be made read-only. The return value is a fully initialized \f2Object\fP. .\" --------------------------------------------------------------------------- .K2 "Example for a User-Defined Scheme Type" .PP Figure @(ndbm1) shows the skeleton of an extension that provides a simple Scheme interface to the UNIX \f2ndbm\fP library; it can be loaded dynamically into the Scheme interpreter, or into an Elk-based application that needs access to a simple database from within the extension language. Please refer to your system's documentation if you are not familiar with \f2ndbm\fP. The extension defines a new, first-class Scheme type \f2dbm-file\fP corresponding to the \f2DBM\fP type defined by the C library. Again, note the naming convention to use lower-case for new identifiers (in contrast to the predefined ones). .Fs #include #include .El int t_dbm; .El struct s_dbm { Object unused; DBM *dbm; char alive; /* 0: has been closed, else 1 */ }; .El #define DBMF(obj) ((struct s_dbm *)POINTER(obj)) .El int dbm_equal(Object a, Object b) { return DBMF(a)->alive && DBMF(b)->alive && DBMF(a)->dbm == DBMF(b)->dbm; } .El int dbm_print(Object d, Object port, int raw, int length, int depth) { Printf(port, "#[dbm-file %lu]", DBMF(d)->dbm); return 0; } .El Object p_is_dbm(Object d) { return TYPE(d) == t_dbm ? True : False; } .El void elk_init_dbm(void) { t_dbm = Define_Type(0, "dbm-file", 0, sizeof(struct s_dbm), dbm_equal, dbm_equal, dbm_print, 0); .El Define_Primitive(p_is_dbm, "dbm-file?", 1, 1, EVAL); Define_Primitive(p_dbm_open, "dbm-open", 2, 3, VARARGS); Define_Primitive(p_dbm_close, "dbm-close", 1, 1, EVAL); } .Fc "Skeleton of a UNIX ndbm extension" .Fe ndbm1 .PP The code shown in Figure @(ndbm1) declares a variable \f2t_dbm\fP to hold the return value of \f2Define_Primitive()\fP, and the C structure \f2s_dbm\fP that represents the new type. The structure is composed of the required initial \f2Object\fP, the \f2DBM\fP pointer returned by the C library function \f2dbm_open()\fP, and a flag indicating whether the database pointed to by this object has already been closed (in this case the flag is cleared). As a \f2dbm-file\fP Scheme object can still be passed to primitives after the \f2DBM\fP handle has been closed by a call to \f2dbm_close()\fP, the \f2alive\fP flag had to be added to avoid further use of a ``stale'' object: the ``dbm'' primitives include an initial check for the flag and raise an error if it is zero. .PP The macro \f2DBMF\fP is used to cast the pointer field of an \f2Object\fP of type \f2t_dbm\fP to a pointer to the correct structure type. \f2dbm_equal()\fP implements both the \f2eqv?\&\fP and the \f2equal?\&\fP predicates; it returns true if the \f2Objects\fP compared point to an open database and contain identical \f2DBM\fP pointers. The print function just prints the numeric value of the \f2DBM\fP pointer; this could be improved by printing the name of the database file instead, which must then be included in each Scheme object. The primitive \f2p_is_dbm()\fP provides the usual @[.type predicate]. Finally, an @[.extension initialization function] is supplied to enable @[.dynamic loading] of the compiled code; it registers the new type and three primitives operating on it. Note that a @[.visit function] (the final argument to \f2Define_Type()\fP) is not required here, as the new type does not include any components of type \f2Object\fP that the garbage collector must know of\*-the required initial \f2Object\fP is not used here and therefore can be neglected. The type constructor primitive \f2dbm-open\fP and the primitive \f2dbm-close\fP are shown in Figure @(ndbm2). .PP .Fs Object p_dbm_open(int argc, Object *argv) { DBM *dp; int flags = O_RDWR|O_CREAT; Object d, sym = argv[1]; .El Check_Type(sym, T_Symbol); if (EQ(sym, Intern("reader"))) flags = O_RDONLY; else if (EQ(sym, Intern("writer"))) flags = O_RDWR; else if (!EQ(sym, Intern("create"))) Primitive_Error("invalid argument: ~s", sym); if ((dp = dbm_open(Get_String(argv[0]), flags, argc == 3 ? Get_Integer(argv[2]) : 0666)) == 0) return False; d = Alloc_Object(sizeof(struct s_dbm), t_dbm, 0); DBMF(d)->dbm = dp; DBMF(d)->alive = 1; return d; } .El Object p_dbm_close(Object d) { Check_Type(d, t_dbm); if (!DBMF(d)->alive) Primitive_Error("invalid dbm-file: ~s", d); DBMF(d)->alive = 0; dbm_close(DBMF(d)->dbm); return Void; } .Fc "Implementation of \f2dbm-open\fP and \f2dbm-close\fP" .Fe ndbm2 .PP The primitive \f2dbm-open\fP shown in Figure @(ndbm2) is called with the name of the database file, a symbol indicating the type of access (\f2reader\fP for read-only access, \f2writer\fP for read/write access, and \f2create\fP for creating a new file with read/write access), and an optional third argument specifying the file permissions for a newly-created database file. A default of 0666 is used for the file permissions if the primitive is invoked with just two arguments. Section @(ch-symbits) will introduce a set of functions that avoid clumsy if-cascades such as the one at the beginning of \f2p_dbm_open()\fP. @[.\f2Primitive_Error()\fP] is called with a @[.``format string''] and zero or more arguments and signals a Scheme error (see section @(ch-error)). \f2dbm-open\fP returns #f if the database file could not be opened, so that the caller can deal with the error. .PP Note that \f2dbm-close\fP first checks the \f2alive\fP bit to raise an error if the database pointer is no longer valid because of an earlier call to \f2dbm-close\fP. This check needs to be performed by all primitives working on \f2dbm-file\fP objects; it may be useful to wrap it in a separate function\*-together with the initial type-check. Ideally, database objects should be closed automatically during @[.garbage collection] when they become inaccessible; section @(ch-term) will introduce functions to accomplish this. .PP At least two primitives \f2dbm-store\fP and \f2dbm-fetch\fP need to be added to the database extension to make it really useful; these are not shown here (their implementation is fairly simple and straightforward). Using these primitives, the extension discussed in this section can be used to write Scheme code such as this procedure (which looks up an electronic mailbox name in the mail alias database maintained on most UNIX systems): .Es (define expand-mail-alias (lambda (alias) (let ((d (dbm-open "/etc/aliases" 'reader))) (if (not d) (error 'expand-mail-alias "cannot open database")) (unwind-protect (dbm-fetch d alias) (dbm-close d))))) .El (define address-of-staff (expand-mail-alias "staff")) .Ee .\" --------------------------------------------------------------------------- .K1 "Advanced Topics" .Rf ch-advanced \*(SN .\" --------------------------------------------------------------------------- .K2 "Converting between Symbols, Integers, and Bitmasks" .Rf ch-symbits \*(SN .PP Symbols are frequently used as the arguments to Scheme primitives which call an underlying C or C++ function with some kind of @[.bitmask] or with a predefined enumeration constant or preprocessor symbol. For example, the primitive \f2dbm-open\fP shown in Figure @(ndbm2) above uses symbols to represent the symbolic constants passed to \f2dbm_open()\fP. Similarly, a Scheme primitive corresponding to the UNIX system call \f2open()\fP could receive a list of symbols represending the logical OR of the usual \f2open()\fP flags, so that one can write Scheme code such as: .Es (let ((tty-fd (unix-open "/dev/ttya" '(read write exclusive))) (tmp-fd (unix-open "/tmp/somefile '(write create)))) ... .Ee .PP To facilitate conversion of symbols to C integers or enumeration constants and vice versa, these two functions are provided: .Es @[.=Symbols_To_Bits()]@[.=Bits_To_Symbols()] unsigned long Symbols_To_Bits(Object syms, int mask_flag, SYMDESCR *table); Object Bits_To_Symbols(unsigned long bits, int mask_flag, SYMDESCR *table); .Ee The type @[.\f2SYMDESCR\fP] is defined as: .Es typedef struct { char *name; unsigned long val; } SYMDESCR; .Ee .PP \f2Symbols_To_Bits()\fP converts a symbol or a list of symbols to an integer; \f2Bits_To_Symbols()\fP is the reverse operation and is usually applied to the return value of a C/C++ function to convert it to a Scheme representation. Both functions receive as the third argument a table specifying the correspondence between symbols and C constants; each table entry is a pair consisting of the \f2name\fP of a symbol as a C string and an integer \f2val\fP (typically an enumeration constant or a \f2#define\fP constant). Each \f2SYMDESCR\fP array is terminated by an entry with a zero \f2name\fP component: .Es SYMDESCR lseek_syms[] = { { "set", SEEK_SET }, { "current", SEEK_CUR }, { "end", SEEK_END }, { 0, 0 } }; .Ee .PP The second argument to the conversion functions controls whether a single symbol is converted to an integer or vice versa (\f2mask_flag\fP is zero), or whether a list of symbols is converted to the logical OR of a set of matching values or vice versa (\f2mask_flag\fP is non-zero). \f2Symbols_To_Bits()\fP signals an error if the symbol does not match any of the names in the given table or, if \f2mask_flag\fP is non-zero, if any of the list elements does not match. The empty list is converted to zero. If \f2Bits_To_Symbols()\fP is called with a non-zero \f2mask_flag\fP, it matches the \f2val\fP components against the \f2bits\fP argument using logical AND. Regardless of \f2mask_flag\fP, \f2Bits_To_Symbols\fP returns the empty list if no match occurs. Figure @(ndbm3) shows an improved version of \f2p_dbm_open()\fP using \f2Symbols_To_Bits()\fP in place of nested if-statements. .Fs static SYMDESCR flag_syms[] = { { "reader", O_RDONLY }, { "writer", O_RDWR }, { "create", O_RDWR|O_CREAT }, { 0, 0 } }; .El Object p_dbm_open(int argc, Object *argv) { DBM *dp; Object d; .El dp = dbm_open(Get_String(argv[0]), Symbols_To_Bits(argv[1], 0, flag_syms), argc == 3 ? Get_Integer(argv[2]) : 0666); if (dp == 0) return False; d = Alloc_Object(sizeof(struct s_dbm), t_dbm, 0); DBMF(d)->dbm = dp; DBMF(d)->alive = 1; return d; } .Fc "Improved version of \f2dbm-open\fP using \f2Symbols_To_Bits()\fP" .Fe ndbm3 .PP A Scheme primitive calling the UNIX system call \f2access()\fP could use \f2Symbols_To_Bits()\fP with a non-zero \f2mask_flag\fP to construct a bitmask: .Es Object p_access(Object fn, Object mode) { access(Get_String(fn), (int)Symbols_To_Bits(mode, 1, access_syms)); ... .Ee where \f2access_syms\fP is defined as: .Es static SYMDESCR access_syms[] = { { "read", R_OK }, { "write", W_OK }, { "execute", X_OK }, { 0, 0 } }; .Ee Note that in this example the empty list can be passed as the \f2mode\fP argument to test for existence of the file, because in this case \f2Symbols_To_Bits()\fP returns zero (the value of \f2F_OK\fP). .\" --------------------------------------------------------------------------- .K2 "Calling Scheme Procedures, Evaluating Scheme Code" .Rf ch-funcall \*(SN .PP A Scheme procedure can be called from within C or C++ code using the function .Es @[.=Funcall()] Object Funcall(Object fun, Object argl, int eval_flag); .Ee The first argument is the Scheme procedure\*-either a primitive procedure (\f2T_Primitive\fP) or a compound procedure (\f2T_Compound\fP). The second argument is the list of arguments to be passed to the procedure, as a Scheme list. The third argument, if non-zero, specifies that the arguments need to be evaluated before calling the Scheme procedure. This is usually not the case (except in some special forms). The return value of \f2Funcall()\fP is the result of the Scheme procedure. .PP \f2Funcall()\fP is frequently used from within C callback functions that can be registered for certain events, such as the user-supplied X11 error handlers, X11 event handlers, timeout handlers, the C++ \f2new\fP handler, etc. Here, use of \f2Funcall()\fP allows to register a user-defined Scheme procedure for this event from within a Scheme program. As an example, Figure @(funcall) shows the generic signal handler that is associated with various UNIX signals by the UNIX extension. .Fs void scheme_signal_handler(int sig) { Object fun, args; .El Set_Error_Tag("signal-handler"); Reset_IO(1); args = Bits_To_Symbols((unsigned long)sig, 0, signal_syms); args = Cons(args, Null); fun = VECTOR(handlers)->data[sig]; if (TYPE(fun) != T_Compound) Fatal_Error("no handler for signal %d", sig); (void)Funcall(fun, args, 0); Printf(Curr_Output_Port, "\en\e7Signal!\en"); (void)P_Reset(); /*NOTREACHED*/ } .Fc "Using \f2Funcall()\fP to call a Scheme procedure" .Fe funcall .PP The signal handler shown in Figure @(funcall) uses the signal number supplied by the system to index a vector of user-defined Scheme procedures (that is, \f2Objects\fP of type \f2T_Compound\fP). @[.\f2Reset_IO()\fP] is used here to ensure that the current input and output port are in defined state when the Scheme signal handler starts executing. The argument list is constructed by calling @[.\f2Cons()\fP]; it consists of a single element\*-the signal number as a Scheme symbol. \f2signal_syms\fP is an array of @[.\f2SYMDESCR\fP] records that maps the UNIX signal names (\f2sighup\fP, \f2sigint\fP, etc.) to corresponding Scheme symbols of the same names. The Scheme procedure called from the signal handler is not supposed to return (it usually invokes a continuation); therefore the result of \f2Funcall()\fP is ignored. In case the Scheme handler (and thus the call to \f2Funcall()\fP) does return, a message is printed and the primitive \f2reset\fP is called to return to the application's toplevel or standard Scheme toplevel. .PP An S-expression can be evaluated by calling the function .Es @[.=Eval()] Object Eval(Object expr); .Ee which is identical to the primitive \f2eval\fP (\f2P_Eval()\fP in C), except that no optional environment can be supplied. \f2Eval()\fP is very rarely used by extensions or applications, mainly by implementations of new special forms. Both \f2Eval()\fP and \f2Funcall()\fP can trigger a @[.garbage collection]; all @[.local variable]s holding Scheme \f2Objects\fP with heap pointers must be properly registered with the garbage collector to survive calls to these functions. .PP Occasionally an S-expression needs to be evaluated that exists as a C string, for example, when a Scheme expression has been entered through a ``text widget'' in a graphical user interface. Here, evaluation requires calling the Scheme reader to parse the expression; therefore a straightforward solution is to create a @[.string port] holding the string and then just ``load'' the contents of the port: .Es void eval_string(char *expr) { Object port; GC_Node; .El port = P_Open_Input_String(Make_String(expr, strlen(expr))); GC_Link(port); Load_Source_Port(port); GC_Unlink; (void)P_Close_Input_Port(port); } .Ee If a more sophisticated function is required, the \f2eval-string\fP extension included in the Elk distribution can be used (``lib/misc/elk-eval.c''). This extension provides a function .Es @[.=Elk_Eval()] char *Elk_Eval(char *expr); .Ee that converts the result of evaluating the stringized expression back to a C string and returns it as a result. A null pointer is returned if an error occurs during evaluation. .PP Applications should not use this function as the primary interface to the extension language. In contrast to languages such as @[.Tcl], the semantic concepts and data structures of Scheme are not centered around strings, and strings are not a practicable representation for S-expressions. Instead, applications should pass control to the extension language by calling Scheme procedures (using @[.\f2Funcall()\fP]) or by loading files containing Scheme code. The extension language then calls back into the application's C/C++ layer by invoking application-supplied Scheme primitives and other forms of callbacks as explained in section @(ch-control). .\" --------------------------------------------------------------------------- .K2 "GC-Protecting Global Objects" .Rf ch-gcglobal \*(SN .PP Section @(ch-gc) explained when\*-and how\*-to register with the @[.garbage collector] function-local \f2Object\fP variables holding heap pointers. Similarly, @[.global variable]s must usually be added to the set of reachable objects as well if they are to survive garbage collections (a useful exception to this rule will be introduced in section @(ch-term)). In contrast to local variables, global variables are only made known to the garbage collector once\*-after initialization\*-as their lifetime is that of the entire program. To add a global variable to the garbage collector's root set, the macro .Es @[.=Global_GC_Link()] Global_GC_Link(obj) .Ee must be called with the properly initialized variable of type \f2Object\fP. The macro takes the address of the specified object. If that is a problem, an equivalent functional interface can be used: .Es @[.=Func_Global_GC_Link()] void Func_Global_GC_Link(Object *obj_ptr); .Ee This function must be supplied the address of the global variable to be registered with the garbage collector. .PP When writing extensions that maintain global \f2Object\fP variables, \f2Global_GC_Link()\fP (or \f2Func_Global_GC_Link()\fP) is usually called from within the @[.extension initialization function] right after each variable is assigned a value. For instance, the global Scheme vector \f2handlers\fP that was used in Figure @(funcall) to associate procedures with UNIX signals is initialized and GC-protected as follows: .Es void elk_init_unix_signal(void) { handlers = Make_Vector(NSIG, False); Global_GC_Link(handlers); ... } .Ee \f2NSIG\fP is the number of UNIX signal types as defined by the system include file. The signal handling Scheme procedures that are inserted into the vector later need not be registered with the garbage collector, because they are now reachable through another object which itself is reachable. .\" --------------------------------------------------------------------------- .K3 "Dynamic C Data Structures" .PP Dynamic data structures, such as the nodes of a linked list containing Scheme \f2Objects\fP, cannot be easily registered with the garbage collector. The simplest solution is to build these data structures in Scheme rather than in C or C++ in the first place. For example, a linked list of Scheme objects can be built from Scheme pairs much more naturally and more straightforward than from C structures or the like, in particular if the list will be traversed and manipulated using Scheme primitives anyway. Besides, data structures programmed in Scheme benefit from automatic memory management, whereas use of \f2malloc()\fP and \f2free()\fP in C frequently is a source of memory leaks and related errors. .PP If for some reason a dynamic data structure must be built in C or C++ rather than in Scheme, reachability problems can be avoided by inserting all \f2Objects\fP into a global, GC-protected vector (such as \f2handlers\fP in Figure @(funcall)) and then use the corresponding vector indexes rather than the actual \f2Objects\fP. This sounds more difficult than it really is; Appendix B shows the complete source code of a small module to register \f2Objects\fP in a Scheme vector. The module exports three functions: \f2register_object()\fP inserts an \f2Object\fP into the vector and returns the index as an \f2int\fP; \f2deregister_object()\fP removes an \f2Object\fP with a given index from the vector; and \f2get_object()\fP returns the \f2Object\fP stored under a given index. \f2register_object()\fP dynamically grows the vector to avoid artificial limits. .PP A dynamic data structure (e.\|g.\& linked list) implementation using this module would call \f2register_object()\fP when inserting a new \f2Object\fP into the list and then use the integer return value in place of the \f2Object\fP itself. Similarly, it would call \f2deregister_object()\fP whenever a node is removed from the list. \f2get_object()\fP would be used to retrieve the \f2Object\fP associated with a given list element. Note that with these functions the same \f2Object\fP can be registered multiple times (each time under a new index) without having to maintain reference counts: the garbage collector does not care how often a particular \f2Object\fP is traversed during garbage collection, as long as it will be reached at least once. .\" --------------------------------------------------------------------------- .K2 "Weak Pointers and Object Termination" .Rf ch-term \*(SN .PP A data structure implementation may deliberately use \f2Objects\fP that are not added to the global set of reachable pointers (as described in the previous section) and are thus invisible to the @[.garbage collector]. In this case, it becomes possible to determine whether or not garbage collection has found any \f2other\fP pointers to the same Scheme objects. This property can be exploited in several ways by extensions or applications using Elk. .PP Pointers that are not included in the garbage collector's reachability search are called @[.``weak pointers'']. The memory occupied by a Scheme object that is only referenced by weak pointers will be reclaimed. The term \f2weak\fP expresses the notion that the pointer is not strong enough to prevent the object it points to from being garbage collected. Code using weak pointers can scan the pointers immediately after each garbage collection and check whether the target object has been visited by the just-finished garbage collection. If this is the case, normal (strong) pointers to the object must exist (which can therefore be considered ``live''), and the weak pointer is updated manually to point to the object's new location. On the other hand, if the object has not been visited, no more (normal) references to it exist and the memory occupied by it has been reclaimed. .PP Weak pointers are useful in implementing certain types of data structures where the sole existence of a (weak) pointer to an object from within this data structure should not keep the object alive (\f2weak sets\fP, \f2populations\fP, certain kinds of hash tables, etc.). Objects that are not reachable through @[.strong pointers] are then removed from the @[.weak data structure] after garbage collection. In this case, it is frequently useful to invoke a @[.``termination function''] for each such object, e.\|g.\& for objects that contain resources of which only a finite amount is available, such as UNIX file descriptors (or FILE structures), X displays and windows, etc. The termination function for Scheme ports closes the file pointer encapsulated in a port object if it is still open; likewise, the termination function for X windows closes the window and thereby removes it from the display, and so on. Thus, should an object holding some kind of resource go inaccessible before it was terminated ``properly'' by calling the respective Scheme primitive (\f2close-input-port\fP, \f2close-output-port\fP, \f2destroy-window\fP, etc.), then resource will be reclaimed after the next garbage collection run. .\" --------------------------------------------------------------------------- .K3 "Using Weak Pointers" .PP Code using @[.weak pointers] must scan the pointers immediately after each @[.garbage collection], but \f2before\fP the interpreter resumes normal operation, because the memory referenced by the weak pointers can be reused the next time heap space is requested. This can be accomplished by registering a so-called @[.``after-GC function]. Elk's garbage collector invokes all after-GC functions (without arguments) upon completion. To register an after-GC functions, the function .Es @[.=Register_After_GC()] void Register_After_GC((void (*func)(void))); .Ee is used, typically in an @[.extension initializer]. Similarly, extensions and applications can register @[.=before-GC function]``before-GC functions'' using .Es @[.=Register_Before_GC()] void Register_Before_GC((void (*func)(void))); .Ee These functions are called immediately before each garbage collection and may be used, for instance, to change the application's cursor to an hourglass symbol. After-GC and before-GC functions must not trigger another garbage collection. .PP An after-GC function scanning a set of weak pointers makes use of the three macros @[.\f2IS_ALIVE()\fP], @[.\f2WAS_FORWARDED()\fP], and @[.\f2UPDATE_OBJ()\fP]. For example, an after-GC function scanning a table of elements holding \f2Objects\fP with weak pointers could be written as shown in Figure @(aftergc). .Fs void scan_weak_table(void) { int i; .El for (i = 0; i < table_size; i++) { Object obj = table[i].obj; if (IS_ALIVE(obj)) { /* object is still reachable */ if (WAS_FORWARDED(obj)) UPDATE_OBJ(obj); } else { terminate_object(obj); /* object is dead; finalize... */ table[i] = 0; /* and remove it from the table */ } } } .Fc "After-GC function that scans a table containing weak pointers" .Fe aftergc .PP The function \f2scan_weak_table()\fP shown in Figure @(aftergc) can then be registered as an after-GC function by invoking .Es Register_After_GC(scan_weak_table); .Ee .PP The then-part of the if-statement in \f2scan_weak_table()\fP is entered if the just-completed garbage collection has encountered any pointers to the Scheme object pointed to by \f2obj\fP; in this case the pointer conveyed in \f2obj\fP is updated manually using \f2UPDATE_OBJ()\fP (when using the generational garbage collector included in Elk, reachability of an object does not necessarily imply that it was forwarded, hence the additional call to \f2WAS_FORWARDED()\fP). If \f2IS_ALIVE()\fP returns false, no more strong pointers to the object exist and it can be terminated and removed from the weak data structure. \f2terminate_object()\fP typically would release any external resources contained in the Scheme object, but it must neither create any new objects nor attempt to ``revive'' the dead object in any way (e.\|g.\& create a new strong pointer to it by inserting it into another, live object). .\" --------------------------------------------------------------------------- .K3 "Functions for Automatic Object Termination" .PP As automatic termination of Scheme objects using user-supplied @[.termination function]s is the most frequent use of @[.weak pointers], Elk offers a set of convenience functions for this purpose. Extensions and applications can insert \f2Objects\fP into a @[.weak list] maintained by Elk and remove them from the list using the two functions .Es @[.=Register_Object()]@[.=Deregister_Object()] void Register_Object(Object obj, char *group, (Object (*term)(Object)), int leader_flag); void Deregister_Object(Object obj); .Ee .PP \f2term\fP is the termination function that is called automatically with \f2obj\fP when the object becomes unreachable (its result is not used); \f2group\fP is an opaque ``cookie'' associated with \f2obj\fP and can be used to explicitly terminate all objects with the same value for \f2group\fP; a non-zero \f2leader_flag\fP indicates that \f2obj\fP is the ``leader'' of the specified \f2group\fP. Elk automatically registers an @[.after-GC function] to scan the weak list maintained by these two functions and to call the \f2term\fP function for all objects that could be proven unreachable by the garbage collector, similar to the function shown in Figure @(aftergc). .PP Object termination takes place in two phases: first all objects registered with a zero \f2leader_flag\fP are terminated, after that the termination functions of the leaders are invoked. This group and leader notion is used, for example, by the @[.Xlib extension] to associate windows (and other resources) with an X display: the ID of the display to which a window belongs is used as the window's group, and the display is marked as the group leader. Thus, if a display becomes unreachable or is closed by the program, all its windows are closed before the display is finally destroyed\**. .FS This interface has evolved in a slightly \f2ad hoc\fP way; the two-stage relationship expressed by groups and group leaders may not be sufficient for more complex hierarchies than those used in X. .FE .LP Two additional functions are provided for explicitly calling the termination functions: .Es @[.=Terminate_Type()]@[.=Terminate_Group()] void Terminate_Type(int type); void Terminate_Group(char *group); .Ee \f2Terminate_Type()\fP invokes the termination function (if any) for all objects of a given type and deletes them from the weak list. For example, to close all ports currently held open by Elk (and thus apply \f2fclose()\fP to the FILE pointers embedded in them), one would call .Es @[.=T_Port] Terminate_Type(T_Port) .Ee \f2Terminate_Group()\fP calls the termination functions of all non-leader objects belonging to the specified \f2group\fP. .LP Finally, another function, @[.\f2Find_Object()\fP], locates an object in the weak list: .Es Object Find_Object(int type, char *group, (int (*match_func)(Object, ...)), ...); .Ee Arguments are a Scheme type, a group, and a match function called once for each object in the weak list that has the specified type and group. The match function is passed the \f2Object\fP and the remaining arguments to \f2Find_Object()\fP, if any. If the match function returns true for an object, this object becomes the return value of \f2Find_Object()\fP; otherwise it returns \f2Null\fP. .PP Complicated as it may seem, \f2Find_Object()\fP is quite useful\*-extensions can check whether a Scheme object with certain properties has already been registered with the weak list earlier and, if this is the case, return \f2this\fP object instead of creating a new one. This is critical for Scheme objects encapsulating some kind of external resource, such as file descriptors or X windows. Consider, for example, a Scheme primitive that obtains the topmost window on a given X display and returns it as a Scheme \f2window\fP object. If the primitive just were to instantiate a Scheme object encapsulating the corresponding X window ID for each call, it would become possible for two or more distinct Scheme \f2window\fP objects to reference the same real X window. This is not acceptable, because two Scheme objects pointing to the same X object should certainly be equal in the sense of \f2eq?\&\fP, not to mention the problems that would ensue if one of the Scheme \f2window\fP objects were closed (thereby destroying the underlying X window) and the second one were still be operated on afterwards. Example uses of \f2Find_Object()\fP can be found in the @[.Xlib extension] and in the @[.Xt extension] that are included in the Elk distribution. .\" --------------------------------------------------------------------------- .K2 "Errors" .Rf ch-error \*(SN .PP User-supplied code can signal an error by calling @[.\f2Primitive_Error()\fP] with a @[.format string] and as many additional arguments (\f2Objects\fP) as there are @[.format specifier]s in the format string: .Es void Primitive_Error(char *fmt, ...); .Ee \f2Primitive_Error()\fP calls the default or user-defined @[.error handler] as described in the Elk Reference Manual, passing it an @[.``error tag''] identifying the source of the error, the format string, and the remaining arguments. A special format specifier ``~E'' can be used to interpolate the standard error message text corresponding to the UNIX error number @[.\f2errno\fP]; this is useful for primitives that invoke UNIX system calls or certain C library functions (if ``~e'' is used, the first character of the text is converted to lower case). If this format specifier is used, the current \f2errno\fP must be assigned to a variable @[.\f2Saved_Errno\fP] prior to calling \f2Primitive_Error()\fP to prevent it from being overwritten by the next system call or C library function. \f2Primitive_Error()\fP does not return. .PP Applications that need to supply their own error handler by redefining \f2error-handler\fP usually do so in Scheme, typically at the beginning of the initial Scheme file loaded in \f2main()\fP. .PP If \f2Primitive_Error()\fP is called from within a C function that implements a Scheme primitive, an error tag is supplied by Elk (the name of the primitive). Applications may set the error tag explicitly at the beginning of sections of C/C++ code that reside outside of primitives, for example, before loading an initial Scheme file in the application's \f2main()\fP. Two functions are provided to set and query the current error tag: .Es @[.=Set_Error_Tag()]@[.=Get_Error_Tag()] void Set_Error_Tag(const char *tag); char *Get_Error_Tag(void); .Ee The following three functions can be used by primitives to signal errors with standardized messages in certain situations: .Es @[.=Range_Error()]@[.=Wrong_Type()]@[.=Wrong_Type_Combination()] void Range_Error(Object offending_obj); void Wrong_Type(Object offending_obj, int expected_type); void Wrong_Type_Combination(Object offending_obj, char *expected_type); .Ee \f2Range_Error()\fP can be used when an argument to a primitive is out of range (typically some kind of index). \f2Wrong_Type()\fP signals a failed type-check for the given \f2Object\fP; the second argument is the expected type of the \f2Object\fP. This function is used, for example, by @[.\f2Check_Type()\fP]. \f2Wrong_Type_Combination()\fP is similar to \f2Wrong_Type()\fP; the expected type is specified as a string. This is useful if an \f2Object\fP can be a member of one out of two or more types, e.\|g.\& a string or a symbol. .LP Fatal errors can be signaled using the functions .Es @[.=Fatal_Error()]@[.=Panic()] void Fatal_Error(char *fmt, ...); void Panic(char *msg); .Ee \f2Fatal_Error()\fP passes its arguments to \f2printf()\fP and then terminates the program. \f2Panic()\fP is used in situations that ``cannot happen'' (failed consistency checks or failed assertions); it prints the specified message and terminates the program with a core dump. .\" --------------------------------------------------------------------------- .K2 "Exceptions" .PP As explained in the Elk Reference Manual, a user-supplied Scheme procedure is called each time an @[.\f2exception\fP] is raised. Currently, the set of UNIX @[.signals] that are caught by the interpreter or an extension (at least \f2interrupt\fP and \f2alarm\fP) are used as exceptions. As signals occur asynchronously, extensions and applications must be able to protect non-reentrant or otherwise critical code sections from the delivery of signals. In particular, calls to external library functions are frequently not reentrant\** and need to be protected from being disrupted. .FS Fortunately, with the advent of multithreading, vendors are now beginning to provide reentrant versions of their system libraries. .FE .PP Extensions may call the macros @[.\f2Disable_Interrupts\fP] and @[.\f2Enable_Interrupts\fP] (without arguments) to enclose code fragments that must be protected from exceptions. Calls to these macros can be nested, and they are also available as Scheme primitives on the Scheme-language level. As all modern UNIX versions provide a facility to temporarily block the delivery of signals, a signal that occurs after a call to \f2Disable_Interrupts\fP will be delayed until the outermost matching \f2Enable_Interrupts\fP is executed. Two additional macros, @[.\f2Force_Disable_Interrupts\fP] and @[.\f2Force_Enable_Interrupts\fP] can be used to enable and disable signal delivery regarless of the current nesting level. Extensions that use additional signals (such as the \f2alarm\fP signal) must register these with the interpreter core to make sure they are included in the \f2mask\fP of signals that is maintained by \f2Disable_Interrupts\fP and \f2Enable_Interrupts\fP (the interface for registering signals is still being revised; refer to the source code of the UNIX extension for an example). .PP The ability to protect code from exceptions is particularly useful for primitives that temporarily open a file or allocate some other kind of resource that must subsequently be released again. If the relevant code fragment were not enclosed by calls to \f2Disable_Interrupts\fP and \f2Enable_Interrupts\fP, an exception handler could abandon execution of the code section by calling a continuation, thus causing the file to remain open forever. While situations like this can be handled by \f2dynamic-wind\fP on the Scheme level, some form of \f2try/catch\fP facility is not available on the C-language level, and using the C function implementing the \f2dynamic-wind\fP primitive would be cumbersome. .LP The function .Es @[.=Signal_Exit()] void Signal_Exit(int signal_number); .Ee may be used as the handler for signals that must terminate the application; it ensures that the temporary files maintained by Elk are removed and calls the @[.extension finalization functions] in the normal way. .\" --------------------------------------------------------------------------- .K2 "Defining Scheme Variables" .PP User-supplied C/C++ code can define global Scheme variables that are maintained as corresponding \f2Object\fP C variables. The Scheme interpreter itself defines several such variables, for example, the variable @[.\f2load-path\fP] (see section @(ch-dynl)) which can be modified and read both from Scheme and from C. The function @[.\f2Define_Variable()\fP] is used to define a Scheme variable and bind an initial value to it: .Es void Define_Variable(Object *var, const char *name, Object init); .Ee \f2var\fP is the address of the C variable corresponding to the newly-created Scheme variable, \f2name\fP is the name of the Scheme variable, and \f2init\fP is its initial value. \f2Define_Variable()\fP calls @[.\f2Intern()\fP] to create the variable name included in the new binding and @[.\f2Func_Global_GC_Link()\fP] to properly register the C variable with the garbage collector. .LP The C side of a Scheme variable cannot be accessed directly; the functions .Es @[.=Var_Set()]@[.=Var_Get()] Var_Set(Object variable, Object value); Var_Get(Object variable) Var_Is_True(Object variable) .Ee must be used instead to assign a value to the variable and to read its current value; the first argument to each function is the \f2Object\fP whose address was passed to \f2Define_Variable()\fP. \f2Var_Is_True()\fP is convenient for boolean variables and tests whether the contents of the variable is true in the sense of \f2Truep()\fP. As an example, Figure @(defvar) shows how the @[.Xt extension] defines a Scheme variable that is associated with the user-defined ``warning handler'' called by the Xt library to output warning messages. .Fs Object V_Xt_Warning_Handler; .El void Xt_Warning(char *msg) { Object args, fun; .El args = Cons(Make_String(msg, strlen(msg)), Null); fun = Var_Get(V_Xt_Warning_Handler); if (TYPE(fun) == T_Compound) (void)Funcall(fun, args, 0); else Printf(Curr_Output_Port, "%s\en", msg); } .El void elk_init_xt_error(void) { Define_Variable(&V_Xt_Warning_Handler, "xt-warning-handler", Null); XtSetWarningHandler(Xt_Warning); } .Fc "The Xt extension defines a Scheme variable holding a ``warning handler''" .Fe defvar .PP In the example in Figure @(defvar), the function \f2Xt_Warning()\fP is registered as the Xt ``warning handler'' by passing it to \f2XtSetWarningHandler()\fP. It is invoked by Xt with a warning message. The message is converted to a Scheme string, and, if the Scheme variable \f2xt-warning-handler\fP has been assigned a procedure, this procedure is called with the string using @[.\f2Funcall()\fP]. Otherwise the string is just sent to the current output port. The call to \f2Define_Variable()\fP in the extension initialization function associates the Scheme variable \f2xt-warning-handler\fP with the C variable \f2V_Xt_Warning_Handler\fP (as a convention, Elk uses the prefix ``V_'' for variables of this kind). .\" --------------------------------------------------------------------------- .K2 "Defining Readers" .PP In addition or as an alternative to the constructor primitive for a new Scheme type, applications and extensions may define a @[.\f2reader\fP function] for each new type. The @[.bitstring extension], for example, defines a reader to allow input of bitstring literals using the \f2#*10110001\fP syntax. Each user-defined read syntax is introduced by the `#' symbol followed by one more character, identifying the type of the object. To define a reader, the following function is called (typically from within an @[.extension initialization function]): .Es @[.=Define_Reader()] void Define_Reader(int c, (Object (*func)(Object port, int c, int const_flag))); .Ee .PP The arguments to \f2Define_Reader()\fP are the as yet unused character identifying the type (e.\|g.\& `*' for bitstrings) and a pointer to a \f2reader function\fP that is invoked by the Scheme parser whenever the newly defined syntax is encountered. This reader function is passed a Scheme input port from which it reads the next token, the character following the `#' symbol (to facilitate using the same reader for different types), and a flag indicating whether the newly-created object is expected to be made read-only (this is true when expressions are loaded from a file). The reader function must return a new object of the given type. .PP You may want to refer to the bitstring extension included in the Elk distribution for an example definition of a reader function (``lib/misc/bitstring.c''), and for the macros that can be used by reader functions to efficiently read characters from a port. .\" --------------------------------------------------------------------------- .K2 "Fork Handlers" .PP Extensions may need to be notified when a copy of the running interpreter (or application) is created by means of the \f2fork()\fP UNIX system call. For example, consider an extension that stores information in a temporary file and removes this file on termination of the program. If another extension created a copy of the running interpreter by calling \f2fork()\fP, the child process would remove the temporary file on exit\*-the file would not be available to the original instance of the interpreter (i.\|e.\& the parent process) any longer. To prevent premature removal of the file, the extension that owns it can define a @[.\f2fork handler\fP] by calling @[.\f2Register_Onfork()\fP] with a pointer to a C function: .Es void Register_Onfork((void (*func)(void))); .Ee The function could create an additional link to the file, so that a child process would just remove this link on exit, leaving the original link intact. .PP Extensions that use \f2fork()\fP without executing a new program in the child process (e.\|g.\& the @[.UNIX extension] which defines a \f2unix-fork\fP primitive) are required to call the function @[.\f2Call_Onfork()\fP] in the newly created child process to invoke all currently defined fork handlers: .Es void Call_Onfork(void); .Ee .\" --------------------------------------------------------------------------- .AP "Appendix A: Functions that can Trigger a Garbage Collection" .PP This appendix lists the functions exported by Elk that may trigger a @[.garbage collection]. Within C/C++ code, local Scheme objects must be protected as shown in section @(ch-gc) when one of these functions is called during the objects' lifetime. .PP The C functions corresponding to the following Scheme primitives can cause a garbage collection: .Es append load read-string apply macro-body require autoload macro-expand reverse backtrace-list make-list string call-with-input-file make-string string->list call-with-output-file make-vector string->number call/cc map string->symbol command-line-args oblist string-append cons open-input-file string-copy dump open-input-output-file substring dynamic-wind open-input-string symbol-plist eval open-output-file tilde-expand for-each open-output-string type force port-line-number vector get-output-string procedure-lambda vector->list list provide vector-copy list->string put with-input-from-file list->vector read with-output-to-file .El .ft 2 all special forms all mathematical primitives except predicates all output primitives if output is sent to a string port .ft .Ee .PP In practice, most of these functions, in particular the special forms, are rarely or never used in extensions or Elk-based applications. In addition to these primitives, the following C functions can trigger a garbage collection: .Es Alloc_Object() Make_Reduced_Flonum() Make_String() Make_Port() Make_Flonum() Make_Const_String() Load_Source_Port() Define_Primitive() Intern() Load_File() Printf() CI_Intern() Copy_List() Print_Object() Define_Variable() Const_Cons() General_Print_Object() Define_Symbol() Make_Integer() Format() Bits_To_Symbols() Make_Unsigned() Eval() Make_Vector() Make_Long() Funcall() Make_Const_Vector() Make_Unsigned_Long() .Ee .LP Note: \f2Make_Integer()\fP, \f2Make_Unsigned()\fP, \f2Make_Long()\fP, and \f2Make_Unsigned_Long()\fP can only trigger a garbage collection if \f2FIXNUM_FITS()\fP (or \f2UFIXNUM_FITS()\fP, respectively) returns zero for the given argument. .\" --------------------------------------------------------------------------- .AP "Appendix B: Convenience Functions for GC-Safe Data Structures" .PP Figure @(gcroot) shows the source code for a set of functions to insert Scheme objects into a vector that has been registered with the garbage collector, to delete objects from the vector, and to retrieve the object stored under a given vector index. These functions help building dynamic data structures (such as linked lists or hash tables) containing Scheme objects. There is nothing application-specific in the code; if you find it useful, you can directly include it in your Elk extension or Elk-based application without any changes. See section @(ch-gcglobal) for a detailed description. .Fs nofloat static int max_objects = 32; /* initial size */ static int num_objects; static Object objects; static int inx; .El int register_object(Object x) { Object v; int n; GC_Node; .El if (num_objects == max_objects) { max_objects *= 2; GC_Link(x); v = Make_Vector(max_objects, Null); GC_Unlink; memcpy(VECTOR(v)->data, VECTOR(objects)->data, num_objects * sizeof(Object)); objects = v; inx = num_objects; } for (n = 0; !Nullp(VECTOR(objects)->data[inx]); inx++, inx %= max_objects) { n++; assert(n < max_objects); } VECTOR(objects)->data[inx] = x; num_objects++; return inx; } .El void deregister_object(int i) { VECTOR(objects)->data[i] = Null; --num_objects; assert(num_objects >= 0); } .El Object get_object(int i) { return VECTOR(objects)->data[i]; } .El void elk_init_gcroot(void) { objects = Make_Vector(max_objects, Null); Global_GC_Link(objects); } .Fc "Functions to map Scheme objects to indexes into a GC-safe vector" .Fe gcroot .\" --------------------------------------------------------------------------- .AP "Appendix C: Summary of Functions, Macros, Types, and Variables" .PP This appendix provides a quick overview of the functions and other definitions exported by the Elk kernel. The list is divided in groups of definitions with related functionality; the entries are presented in roughly the same order in which they are introduced in the above chapters. Full function prototypes are given for functions; in some prototypes, arguments are given names for clarification. The initial keywords \f3function\fP, \f3macro\fP, \f3typedef\fP, and \f3variable\fP indicate the type of each entry (function, preprocessor symbol with or without arguments, type definition, and external variable defined by Elk, respectively). The functions corresponding to Scheme primitives (as described in section @(ch-prims)) have been omitted from the list. .SH Accessing the Scheme Object Representation .LP .Cs \f3typedef\fP Object .Cl \f3macro\fP TYPE(obj) \f3macro\fP POINTER(obj) \f3macro\fP ISCONST(obj) \f3macro\fP SETCONST(obj) \f3macro\fP SET(obj, type, ptr) \f3macro\fP EQ(obj1, obj2) .Ce .SH Defining Scheme Primitives .LP .Cs \f3function\fP void Define_Primitive((Object (*func)()), const char *name, int minargs, int maxargs, enum discipline disc); .Ce .SH Making Objects Known to the Garbage Collector .LP .Cs \f3macro\fP GC_Node, GC_Node2, ... \f3macro\fP GC_Link(obj), GC_Link2(obj1, obj2), ... \f3macro\fP GC_Unlink \f3macro\fP Global_GC_Link(obj) \f3function\fP void Func_Global_GC_Link(obj_ptr); .Ce .SH Booleans .LP .Cs \f3macro\fP T_Boolean \f3macro\fP Truep(obj) .Cl \f3variable\fP Object True \f3variable\fP Object False .Cl \f3function\fP int Eqv(Object, Object); \f3function\fP int Equal(Object, Object); .Ce .SH Characters .LP .Cs \f3macro\fP T_Character \f3macro\fP CHAR(char_obj) \f3function\fP Object Make_Char(int); \f3variable\fP Object Newline .Ce .SH Pairs and Lists .LP .Cs \f3macro\fP T_Null \f3macro\fP Nullp(obj) \f3variable\fP Null .Cl \f3macro\fP T_Pair \f3macro\fP PAIR(pair_obj) \f3macro\fP Car(obj) \f3macro\fP Cdr(obj) \f3macro\fP Cons(obj1, obj2) .Cl \f3macro\fP Check_List(obj) \f3function\fP int Fast_Length(Object); \f3function\fP Object Copy_List(Object); .Ce .SH Integers (Fixnums and Bignums) .LP .Cs \f3macro\fP T_Fixnum \f3macro\fP T_Bignum \f3macro\fP FIXNUM_FITS(integer) \f3macro\fP UFIXNUM_FITS(unsigned_integer) \f3macro\fP FIXNUM(fixnum_obj) \f3macro\fP BIGNUM(bignum_obj) .Cl \f3macro\fP Check_Integer(obj) \f3macro\fP Check_Number(obj) .Cl \f3function\fP Object Make_Integer(int); \f3function\fP Object Make_Unsigned(unsigned); \f3function\fP Object Make_Long(long); \f3function\fP Object Make_Unsigned_Long(unsigned long); .Cl \f3function\fP int Get_Integer(Object); \f3function\fP unsigned Get_Unsigned(Object); \f3function\fP long Get_Long(Object); \f3function\fP unsigned long Get_Unsigned_Long(Object); .Cl \f3function\fP int Get_Exact_Integer(Object); \f3function\fP unsigned Get_Exact_Unsigned(Object); \f3function\fP long Get_Exact_Long(Object); \f3function\fP unsigned long Get_Exact_Unsigned_Long(Object); .Ce .SH Floating Point Numbers (Reals) .LP .Cs \f3macro\fP T_Flonum \f3macro\fP FLONUM(flonum_obj) \f3function\fP Object Make_Flonum(double); \f3function\fP Object Make_Reduced_Flonum(double); \f3function\fP double Get_Double(Object); .Ce .SH Symbols .LP .Cs \f3macro\fP T_Symbol \f3macro\fP SYMBOL(symbol_obj) \f3function\fP Object Intern(const char *); \f3function\fP Object CI_Intern(const char *); \f3function\fP void Define_Symbol(Object *var, const char *name); \f3variable\fP Object Void .Cl \f3typedef\fP SYMDESCR \f3function\fP unsigned long Symbols_To_Bits(Object syms, int mask_flag, SYMDESCR *table); \f3function\fP Object Bits_To_Symbols(unsigned long bits, int mask_flag, SYMDESCR *table); .Ce .SH Strings .LP .Cs \f3macro\fP T_String \f3macro\fP STRING(string_obj) \f3function\fP Object Make_String(const char *init, int size); \f3function\fP char *Get_String(Object); \f3function\fP char *Get_Strsym(Object); \f3macro\fP Get_String_Stack(obj, char_ptr) \f3macro\fP Get_Strsym_Stack(obj, char_ptr) .Ce .SH Vectors .LP .Cs \f3macro\fP T_Vector \f3macro\fP VECTOR(vector_obj) \f3function\fP Object Make_Vector(int size, Object fill); .Ce .SH Ports .LP .Cs \f3macro\fP T_Port \f3macro\fP PORT(port_obj) \f3function\fP Object Make_Port(int flags, FILE *f, Object name); \f3function\fP Object Terminate_File(Object port); \f3macro\fP Check_Input_Port(obj) \f3macro\fP Check_Output_Port(obj) \f3variable\fP Object Curr_Input_Port, Curr_Output_Port \f3variable\fP Object Standard_Input_Port, Standard_Output_Port \f3function\fP void Reset_IO(int destructive_flag); \f3function\fP void Printf(Object port, char *fmt, ...); \f3function\fP void Print_Object(Object obj, Object port, int raw_flag, int print_depth, int print_length); \f3macro\fP Print(obj) \f3function\fP void Load_Source_Port(Object port); \f3function\fP void Load_File(char *filename); .Ce .SH Miscellaneous Types .LP .Cs \f3macro\fP T_End_Of_File \f3variable\fP Object Eof .Cl \f3macro\fP T_Environment \f3variable\fP Object The_Environment, Global_Environment .Cl \f3macro\fP T_Primitive \f3macro\fP T_Compound \f3function\fP void Check_Procedure(Object); .Cl \f3macro\fP T_Control_Point \f3macro\fP T_Promise \f3macro\fP T_Macro .Ce .SH Defining Scheme Types and Allocating Objects .LP .Cs \f3function\fP int Define_Type(int zero, const char *name, int (*size)(Object), int const_size, int (*eqv)(Object, Object), int (*equal)(Object, Object), int (*print)(Object, Object, int, int, int), int (*visit)(Object*, int (*)(Object*))); \f3function\fP Object Alloc_Object(int size, int type, int const_flag); .Ce .SH Calling Scheme Procedures and Evaluating Scheme Code .LP .Cs \f3function\fP Object Funcall(Object fun, Object argl, int eval_flag); \f3function\fP Object Eval(Object expr); \f3function\fP char *String_Eval(char *expr); .Ce .SH Weak Pointers and Object Termination .LP .Cs \f3function\fP void Register_Before_GC((void (*func)(void))); \f3function\fP void Register_After_GC((void (*func)(void))); .Cl \f3macro\fP IS_ALIVE(obj) \f3macro\fP WAS_FORWARDED(obj) \f3macro\fP UPDATE_OBJ(obj) .Cl \f3function\fP void Register_Object(Object obj, char *group, (Object (*term)(Object)), int leader_flag); \f3function\fP void Deregister_Object(Object obj); \f3function\fP void Terminate_Type(int type); \f3function\fP void Terminate_Group(char *group); \f3function\fP Object Find_Object(int type, char *group, (int (*match_func)(Object, ...)), ...); .Ce .SH Signaling Errors .LP .Cs \f3function\fP void Primitive_Error(char *fmt, ...); \f3function\fP void Set_Error_Tag(const char *tag); \f3function\fP char *Get_Error_Tag(void); \f3function\fP void Set_App_Name(char *name); \f3function\fP void Range_Error(Object offending_obj); \f3function\fP void Wrong_Type(Object offending_obj, int expected_type); \f3function\fP void Wrong_Type_Combination(Object offending_obj, char *expected_type); \f3function\fP void Fatal_Error(char *fmt, ...); \f3function\fP void Panic(char *msg); \f3variable\fP int Saved_Errno .Ce .SH Exceptions (Signals) .LP .Cs \f3macro\fP Disable_Interrupts, Enable_Interrupts \f3macro\fP Force_Disable_Interrupts, Force_Enable_Interrupts \f3function\fP void Signal_Exit(int signal_number); .Ce .SH Defining and Using Scheme Variables .LP .Cs \f3function\fP void Define_Variable(Object *var, const char *name, Object init); \f3function\fP void Var_Set(Object var, Object val); \f3function\fP Object Var_Get(Object var); \f3function\fP int Var_Is_True(Object var); .Ce .SH Defining Reader Functions .LP .Cs \f3function\fP void Define_Reader(int c, (Object (*func)(Object port, int c, int const_flag))); .Ce .SH Fork Handlers .LP .Cs \f3function\fP void Register_Onfork((void (*func)(void))); \f3function\fP void Call_Onfork(void); .Ce .SH Allocating Memory .LP .Cs \f3function\fP char *Safe_Malloc(unsigned size); \f3function\fP char *Safe_Realloc(char *old_pointer, unsigned size); .Cl \f3macro\fP Alloca_Begin, Alloca_End \f3macro\fP Alloca(char_ptr, type, size) .Ce .SH Initializing Elk from an Application's main() .LP .Cs \f3function\fP void Elk_Init(int argc, char **argv, int init_flag, char *filename); .Ce .SH Miscellaneous Macros .LP .Cs \f3macro\fP ELK_MAJOR, ELK_MINOR \f3macro\fP NO_PROTOTYPES, WANT_PROTOTYPES .Ce .\" --------------------------------------------------------------------------- .\" XXX: dynamic loading + dump .\" --------------------------------------------------------------------------- .if !\n(.U .so ../util/tmac.index .if !\n(.U .so side.inx .Tc elk-3.99.8/doc/cprog/Makefile.am0000644000175000017500000000156611577076306013257 00000000000000EXTRA_DIST = cprog.ms CLEANFILES = side side.ref side.inx cprog.ps cprog.html if HAVE_GROFF docs_DATA = cprog.ps docsdir = $(datadir)/doc/@PACKAGE@/ps endif MANUAL = $(srcdir)/cprog.ms TROFF = groff -ms -t UNROFF = unroff -ms MKINDEX = $(AWK) -f $(srcdir)/../util/mkindex.awk cprog.ps: $(MANUAL) side.ref side.inx $(MKINDEX) $(MANUAL) | sed -f side.ref | $(TROFF) 2> /dev/null > $@ side.ref: side grep '^[sS]' < side | sed -e 's/\.\//\//' > side.ref side.inx: side egrep -v '^s' side | sort -f -t'#' +1 -3 +0n | \ $(AWK) -f $(srcdir)/../util/fixindex.awk | \ $(AWK) -f $(srcdir)/../util/block.awk \ > side.inx side: $(MANUAL) rm -f side side.inx && printf "" > side.inx $(MKINDEX) $? | $(TROFF) 2>side >/dev/null cprog.html: $(MANUAL) side.ref $(MKINDEX) $(MANUAL) | sed -f side.ref | $(UNROFF) document=cprog #check: # cknr -c.Tc -a.Es.Ee.Cs.Ce $(MANUAL) elk-3.99.8/doc/bitstring/0000755000175000017500000000000011577110017012152 500000000000000elk-3.99.8/doc/bitstring/Makefile.in0000644000175000017500000003072611577103433014153 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = doc/bitstring DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(docsdir)" DATA = $(docs_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ELK_CFLAGS = @ELK_CFLAGS@ ELK_LDFLAGS = @ELK_LDFLAGS@ ELK_LIBS = @ELK_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INCLUDES = @INCLUDES@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOTIF_CFLAGS = @MOTIF_CFLAGS@ MOTIF_LIBS = @MOTIF_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STDINT_HEADER = @STDINT_HEADER@ STRIP = @STRIP@ VERSION = @VERSION@ XAW_CFLAGS = @XAW_CFLAGS@ XAW_LIBS = @XAW_LIBS@ XMKMF = @XMKMF@ XT_CFLAGS = @XT_CFLAGS@ XT_LIBS = @XT_LIBS@ X_CFLAGS = @X_CFLAGS@ X_LIBS = @X_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = bitstring.ms CLEANFILES = index.raw index.ms bitstring.ps bitstring.html @HAVE_GROFF_TRUE@docs_DATA = bitstring.ps @HAVE_GROFF_TRUE@docsdir = $(datadir)/doc/@PACKAGE@/ps MANUAL = $(srcdir)/bitstring.ms TROFF = groff -ms -t UNROFF = unroff -ms all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/bitstring/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/bitstring/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-docsDATA: $(docs_DATA) @$(NORMAL_INSTALL) test -z "$(docsdir)" || $(MKDIR_P) "$(DESTDIR)$(docsdir)" @list='$(docs_DATA)'; test -n "$(docsdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(docsdir)" || exit $$?; \ done uninstall-docsDATA: @$(NORMAL_UNINSTALL) @list='$(docs_DATA)'; test -n "$(docsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(docsdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(docsdir)" && rm -f $$files tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(docsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-docsDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-docsDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-docsDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-docsDATA bitstring.ps: $(MANUAL) index.ms (cat $(MANUAL) $(srcdir)/../util/tmac.index index.ms; echo ".Tc") \ | $(TROFF) 2> /dev/null > bitstring.ps bitstring.html: $(MANUAL) (cat $?; echo ".Tc") | $(UNROFF) document=bitstring index.ms: $(MANUAL) index.raw sort -f -t'#' +1 -3 +0n index.raw \ | $(AWK) -f $(srcdir)/../util/fixindex.awk \ | $(AWK) -f $(srcdir)/../util/block.awk >index.ms index.raw: $(MANUAL) $(TROFF) $(MANUAL) 2> index.raw >/dev/null #check: # checknr -c.Ul.Pr.Sy.Va.Sh.Ix.Id.Ch -a.Ss.Se.[[.]] $(MANUAL) \ # | grep -v "Empty command" # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: elk-3.99.8/doc/bitstring/Makefile.am0000644000175000017500000000146011577076306014143 00000000000000EXTRA_DIST = bitstring.ms CLEANFILES = index.raw index.ms bitstring.ps bitstring.html if HAVE_GROFF docs_DATA = bitstring.ps docsdir = $(datadir)/doc/@PACKAGE@/ps endif MANUAL = $(srcdir)/bitstring.ms TROFF = groff -ms -t UNROFF = unroff -ms bitstring.ps: $(MANUAL) index.ms (cat $(MANUAL) $(srcdir)/../util/tmac.index index.ms; echo ".Tc") \ | $(TROFF) 2> /dev/null > bitstring.ps bitstring.html: $(MANUAL) (cat $?; echo ".Tc") | $(UNROFF) document=bitstring index.ms: $(MANUAL) index.raw sort -f -t'#' +1 -3 +0n index.raw \ | $(AWK) -f $(srcdir)/../util/fixindex.awk \ | $(AWK) -f $(srcdir)/../util/block.awk >index.ms index.raw: $(MANUAL) $(TROFF) $(MANUAL) 2> index.raw >/dev/null #check: # checknr -c.Ul.Pr.Sy.Va.Sh.Ix.Id.Ch -a.Ss.Se.[[.]] $(MANUAL) \ # | grep -v "Empty command" elk-3.99.8/doc/bitstring/bitstring.ms0000644000175000017500000001421211577076306014454 00000000000000.so ../util/tmac.scheme .Ul .TL Reference Manual for the .sp .5 Elk Bit String Extension .AU Oliver Laumann . .Ch "Introduction" . .PP The bit string extension to Elk defines a new data type \f2bitstring\fP (a sequence of zero or more bits) and functions to create and manipulate bit strings. The bits in a bit string are numbered beginning from zero up to the number of bits minus one; bit number 0 is the .Ix "least significant bit" .Ix LSB least significant bit (LSB), and the highest numbered bit is the .Ix "most significant bit" .Ix MSB most significant bit (MSB). .PP The .Ix "print representation" print representation of bit strings is introduced by the sequence `#*'; the bits are printed starting with the most significant bit. Likewise, in the reader the sequence `#*' introduces a bit string constant. .LP Example: .Ss #*0100110111 .sp .5 #* \f2(empty bit string)\fP .Se . .Ch "Using the Bit String Extension" . .PP To load the bit string extension, evaluate the expression .Ss (require 'bitstring) .Se .PP This causes the files .Ix bitstring.scm \f2bitstring.scm\fP and .Ix bitstring.o \f2bitstring.o\fP to be loaded (\f2bitstring.o\fP must be statically linked with the interpreter on platforms that do not support dynamic loading of object files). .PP Loading the bit string extension causes the .Ix feature features \f2bitstring\fP and \f2bitstring.o\fP to be provided. . .Ch "Creating Bit Strings" . .Pr make-bitstring length init .LP \f2make-bitstring\fP returns a new bit string of the given length. If init is #t, all bits are initialized to 1; if init is #f, all bits are initialized to 0. . .Pr bitstring-copy bitstring .LP This procedure returns a copy of the specified bit string. . .Pr bitstring-append bitstring\*1 bitstring\*2 .LP \f2bitstring-append\fP returns a new bit string holding the .Ix concatenation concatenation of the specified bit string arguments. . .Ch "Bit String Predicates" . .Pr bitstring? obj .LP This .Ix "type predicate" type predicate returns #t if \f2obj\fP is a bit string, #f otherwise. . .Pr bitstring=? bitstring\*1 bitstring\*2 .LP This procedure returns #t if the bit string arguments are of the same length and contain the same bits, #f otherwise. . .Pr bitstring-zero? bitstring .LP \f2bitstring-zero?\fP returns #t if the specified bit string contains only 0 bits, #f otherwise. . .Ch "Integer Conversions" . .[[ .Pr unsigned-integer\(mi>bitstring length i .Pr signed-integer\(mi>bitstring length i .]] .LP Both procedures convert the exact integer argument \f2i\fP into a bit string of \f2length\fP bits and return the bit string. \f2length\fP must be large enough to hold the bit string representation of \f2i\fP. The integer argument to \f2unsigned-integer->bitstring\fP must be non-negative. \f2signed-integer->bitstring\fP uses .Ix "two's complement" two's complement representation for negative integers. . .[[ .Pr bitstring\(mi>unsigned-integer bitstring .Pr bitstring\(mi>signed-integer bitstring .]] .LP Both procedures convert the given bit string into an integer. \f2bitstring->signed-integer\fP interprets the bit string as the .Ix "two's complement" two's complement representation of a signed integer. . .Ch "Selecting Components of Bit Strings" . .Pr bitstring-length bitstring .LP This procedure returns the number of bits in the specified bit string. . .Pr bitstring-ref bitstring index .LP \f2bitstring-ref\fP returns #t if the \f2index\fP-th bit in the given bit string is 1, #f otherwise. . .Pr bitstring-substring bitstring from to .LP This procedure returns a new bit string initialized with the bits of \f2bitstring\fP starting at the index \f2from\fP (inclusive) and ending at the index \f2to\fP (exclusive). . .Ch "Modifying Bit Strings" . .Pr bitstring-fill! bitstring init .LP This procedure sets all bits in the specified bit string to 1 if \f2init\fP is #t, or to 0 if \f2init\fP is #f. It returns the non-printing object. . .Pr bitstring-set! bitstring index init .LP \f2bitstring-set!\fP sets the \f2index\fP-th bit in the specified bit string to 1 if \f2init\fP is #t, or to 0 if \f2init\fP is #f. It returns the non-printing object. . .Pr bitstring-move! dst-bitstring src-bitstring .LP \f2bitstring-move!\fP destructively copies the contents of the bit string \f2src-bitstring\fP into \f2dst-bitstring\fP. Both bit strings must have the same length. It returns the non-printing object. . .Pr bitstring-substring-move! src-bitstring from\*1 to\*1 dst-bitstring from\*2 .LP This procedure destructively copies the bits from \f2src-bitstring\fP starting at index \f2from\*1\fP (inclusive) and ending at index \f2to\*1\fP (exclusive) into \f2dst-bitstring\fP starting at index \f2from\*2\fP (inclusive). .Ix overlapping Overlapping is handled correctly. The procedure returns the non-printing object. . .Ch "Bitwise Logical Operations" . .Pr bitstring-not bitstring .LP This procedure returns a new bit string initialized to the bitwise logical negation of the given bit string. . .Pr bitstring-not! dst-bitstring src-bitstring .LP This procedure destructively overwrites the contents of \f2dst-bitstring\fP with the bitwise logical negation of the bits in \f2src-bitstring\fP. Both bit strings must have the same length. \f2bitstring-not!\fP returns the non-printing object. . .[[ .Pr bitstring-and bitstring\*1 bitstring\*2 .Pr bitstring-andnot bitstring\*1 bitstring\*2 .Pr bitstring-or bitstring\*1 bitstring\*2 .Pr bitstring-xor bitstring\*1 bitstring\*2 .]] .LP These procedures return a new bit string initialized to the bitwise logical \f2and\fP (logical \f2and\fP with the negation, logical \f2or\fP, logical exclusive \f2or\fP, respectively) of the two bit string arguments. The two bit strings must have the same length. . .[[ .Pr bitstring-and! dst-bitstring src-bitstring .Pr bitstring-or! dst-bitstring src-bitstring .Pr bitstring-andnot! dst-bitstring src-bitstring .Pr bitstring-xor! dst-bitstring src-bitstring .]] .LP These procedures are the destructive versions of the four bitwise logical procedures described above. They perform the corresponding logical operation on the two bit string arguments and overwrite the contents of \f2dst-bitstring\fP with the result. Both bit strings must have the same length. These procedures return the non-printing object. elk-3.99.8/doc/oops/0000755000175000017500000000000011577110020011117 500000000000000elk-3.99.8/doc/oops/Makefile.in0000644000175000017500000003063211577103433013122 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = doc/oops DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(docsdir)" DATA = $(docs_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ELK_CFLAGS = @ELK_CFLAGS@ ELK_LDFLAGS = @ELK_LDFLAGS@ ELK_LIBS = @ELK_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INCLUDES = @INCLUDES@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOTIF_CFLAGS = @MOTIF_CFLAGS@ MOTIF_LIBS = @MOTIF_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STDINT_HEADER = @STDINT_HEADER@ STRIP = @STRIP@ VERSION = @VERSION@ XAW_CFLAGS = @XAW_CFLAGS@ XAW_LIBS = @XAW_LIBS@ XMKMF = @XMKMF@ XT_CFLAGS = @XT_CFLAGS@ XT_LIBS = @XT_LIBS@ X_CFLAGS = @X_CFLAGS@ X_LIBS = @X_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = oops.ms CLEANFILES = index.raw index.ms oops.ps oops.html @HAVE_GROFF_TRUE@docs_DATA = oops.ps @HAVE_GROFF_TRUE@docsdir = $(datadir)/doc/@PACKAGE@/ps MANUAL = $(srcdir)/oops.ms TROFF = groff -ms -t UNROFF = unroff -ms all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/oops/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/oops/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-docsDATA: $(docs_DATA) @$(NORMAL_INSTALL) test -z "$(docsdir)" || $(MKDIR_P) "$(DESTDIR)$(docsdir)" @list='$(docs_DATA)'; test -n "$(docsdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(docsdir)" || exit $$?; \ done uninstall-docsDATA: @$(NORMAL_UNINSTALL) @list='$(docs_DATA)'; test -n "$(docsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(docsdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(docsdir)" && rm -f $$files tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(docsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-docsDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-docsDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-docsDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-docsDATA oops.ps: $(MANUAL) index.ms (cat $(MANUAL) $(srcdir)/../util/tmac.index index.ms; echo ".Tc") \ | $(TROFF) 2> /dev/null > oops.ps oops.html: $(MANUAL) (cat $?; echo ".Tc") | $(UNROFF) document=oops index.ms: $(MANUAL) index.raw sort -f -t'#' +1 -3 +0n index.raw \ | $(AWK) -f $(srcdir)/../util/fixindex.awk \ | $(AWK) -f $(srcdir)/../util/block.awk >index.ms index.raw: $(MANUAL) $(TROFF) $(MANUAL) 2> index.raw >/dev/null #check: # checknr -c.Ul.Pr.Sy.Va.Sh.Ix.Id.Ch -a.Ss.Se.[[.]] $(MANUAL) \ # | grep -v "Empty command" # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: elk-3.99.8/doc/oops/oops.ms0000644000175000017500000002406411577076306012410 00000000000000.so ../util/tmac.scheme .Ul .TL The \s-1OOPS\s0 Package for Elk Scheme .AU Oliver Laumann . .Ch "Introduction" . .PP The \s-1OOPS\s0 package provides a minimal set of tools that enables a Scheme programmer to program in an object oriented style. The functionality of \s-1OOPS\s0 is similar to that of packages like \s-1CLOS\s0 and \s-1SCOOPS\s0, although the current version does not support multiple inheritance. The rest of this memo serves as a reference guide to the \s-1OOPS\s0 package; the reader is assumed to be familiar with the terminology of object oriented programming. . .Ch "Using \s-1OOPS\s0" .LP Programs that make use of the \s-1OOPS\s0 package should include the line .Ss (require 'oops) .Se .Ix oops Since this involves autoloading of an object file, it may be desirable to dump Scheme after the \s-1OOPS\s0 package has been loaded. . .Ch "Defining Classes" .PP New classes are defined by means of the .S define-class .Id define-class macro. The syntax of .S define-class is .Ss (define-class \f2class-name\fP . \f2options\fP) .Se where \f2class-name\fP is a symbol. \f2options\fP can be of the form .Ss (super-class \f2class-name\fP) .Se .Id super-class where \f2class-name\fP is the name of the super-class (a symbol), or .Ss (class-vars . \f2var-specs\fP) .Se .Id class-vars or .Ss (instance-vars . \f2var-specs\fP) .Se .Id instance-vars to specify the class variables .Ix "class variables" and instance variables .Ix "instance variables" of the newly defined class. Each \f2var-spec\fP is either a symbol (the name of the variable) or of the form .Ss (\f2symbol\fP \f2initializer\fP). .Se Variables for which no initializer has been specified are initialized to the empty list. The initializers .Ix initializers for class variables are evaluated immediately; initializers for instance variables are evaluated each time an instance of the newly defined class is created. Evaluation of initializers is performed in a way that the initializer of a variable can reference all variables appearing at the left of the variable being initialized; for instance .Ss (define-class foo (class-vars (a 10) (b (* a 2)))) .Se would initialize the class variable .S b to 20. .PP A class inherits all class variables, instance variables, and methods of its super-class. When a class and its super-class each have an instance variable with the same name, the corresponding \f2var-specs\fP must either both have no initializer or initializers with the same value, otherwise an ``initializer mismatch'' error is signaled by .S define-class . .PP Each instance of a class has an instance variable named .S self . .Id self The value of .S self is the instance with respect to which .S self is evaluated. .S self can be used by methods as the argument to .S send .Ix send (see below) to invoke another method within the current instance. .PP .S define-class does not have a meaningful return value, instead it has a side-effect on the environment in which it is invoked. . .Ch "Creating Instances of a Class" .PP The macro .S make-instance .Id make-instance is used to create an instance of a class; it returns the instance as its value. The syntax is .Ss (make-instance \f2class\fP . \f2args\fP) .Se where \f2class\fP is the class of which an instance is to be created. Each \f2arg\fP of the form .Ss (\f2symbol\fP\ \f2initializer\fP) .Se where \f2symbol\fP is the name of an instance variable of the class, is used to initialize the specified instance variable in the newly created instance. In this case the \f2initializer\fP supersedes any initializer specified in the call to .S define-class . Thus it is possible to have instance variables with a \f2default initializer\fP that can be overridden for individual instances. The initializers are evaluated in the current environment. .PP .S make-instance initializes the newly created instance by invoking the .S initialize-instance .Id initialize-instance method for the class and all super-classes in super-class to sub-class order. That is, the .S initialize-instance method of the class specified in the call to .S make-instance is called after all other .S initialize-instance methods. The arguments passed to the .S initialize-instance method of a class are those arguments of the call to .S make-instance that do not represent an initialization form for an instance variable. These arguments are evaluated in the current environment. It is not required for a class to have an .S initialize-instance method. .PP Consider the following example: .Ss (require 'oops) .sp .5 (define-class c (instance-vars a)) (define-class d (instance-vars (b 10)) (super-class c)) .sp .5 (define-method c (initialize-instance . args) (print (cons 'c args))) .sp .5 (define-method d (initialize-instance . args) (print (cons 'd args))) .sp .5 .Se In this example evaluation of .Ss (define x 99) (define i (make-instance d (a 20) 'foo (b x) x)) .Se would print .Ss (c foo 99) (d foo 99) .Se .PP Note that first the .S initialize-instance method of .S c is invoked and then that of the class .S d . The instance variables .S a and .S b would be initialized to 20 and 99, respectively. . .Ch "Defining Methods" .PP A new method can be defined by means of the .S define-method .Id define-method macro. The syntax is .Ss (define-method \f2class\fP \f2lambda-list\fP . \f2body\fP) .Se where \f2class\fP is the class to which the method is to be added, \f2lambda-list\fP is a list specifying the method's name and formal arguments (having the same syntax as the argument of .S define ). .PP .S define-method simply creates a class-variable with the name of the method, creates a lambda closure using the \f2lambda-list\fP and the \f2body\fP forms, and binds the resulting procedure to the newly-created variable. When a message with the name of the method is sent to an instance of the class, the method is invoked, and the \f2body\fP is evaluated in the scope of the instance (so that it can access all instance and class variables). . .Ch "Sending Messages" .PP A message can be sent to an instance by means of the function .S send . .Id send The syntax of .S send is .Ss (send \f2instance\fP \f2message\fP . \f2args\fP) .Se where \f2instance\fP is the instance to which the message is to be sent, \f2message\fP is the name of the method to be invoked (a symbol), and \f2args\fP are the arguments to be passed to the method. Example: .Ss (define-class c (instance-vars a) (class-vars (b 10))) .sp .5 (define-method c (foo x) (cons (set! a x) b)) ; set! returns previous value .sp .5 (define i (make-instance c (a 99))) .sp (send i 'foo 1) \f1returns (99 . 10)\fP (send i 'foo 2) \f1returns (1 . 10)\fP .Se .PP When a message is sent to an instance for which no method has been defined, a ``message not understood'' error is signaled. .PP The function .S send-if-handles .Id send-if-handles is identical to .S send , except that it returns a list of one element, the return value of the method, or .S #f when the message is not understood by the instance. . .Ch "Evaluating Expressions within an Instance" .PP The macro .S with-instance .Id with-instance can be used to evaluate expressions within the scope of an instance. The syntax is .Ss (with-instance \f2instance\fP . \f2body\fP). .Se The \f2body\fP forms are evaluated in the same environment in which a method of \f2instance\fP would be evaluated, i.\|e. they can access all and class and instance variables (including .S self ). .S with-instance returns the value of the last \f2body\fP form. Example: .Ss (define-class c (class-vars (x 5)) (instance-vars y)) .sp .5 (define i (make-instance c (y 1))) .sp .5 (define x 10) (with-instance i (cons x y)) \f1returns (5 . 1)\fP .Se . .Ch "Setting Instance and Class Variables" .PP Generally class and instance variables are manipulated by methods or, if applicable, from within a .S with-instance form. In addition, values can be assigned to class and instance variables without involving a message send by means of the .S instance-set! .Id instance-set! macro. The syntax of .S instance-set! is .Ss (instance-set! \f2instance\fP \f2variable\fP \f2value\fP) .Se where \f2variable\fP is a symbol, the name of the class or instance variable. .S instance-set! returns the previous value of the variable (like .S set! ). .PP Class variables can be modified without involving an instance of the class by means of the macro .S class-set! : .Id class-set! .Ss (class-set! \f2class\fP \f2variable\fP \f2value\fP). .Se \f2variable\fP must be the name of a class variable of \f2class\fP. Note that one difference between .Ss (instance-set! i 'var x) .Se and .Ss (with-instance i (set! var x)) .Se is that in the former case .S x is evaluated in the current environment while in the latter case .S x is evaluated within the scope of the instance (here .S x might be a class or instance variable). . .Ch "Obtaining Information about Classes and Instances" .PP The function .S class-name .Id class-name returns the name of a class (a symbol) or, when applied to an instance, the name of the class of which it is an instance. .PP The predicate .S method-known? .Id method-known? can be used to check whether a method of a given name is known to a class. The syntax is .Ss (method-known? \f2method\fP \f2class\fP) .Se where \f2method\fP is a symbol. .PP The type predicates .S class? .Id class? and .S instance? .Id instance? can be used to check whether an object is a class or an instance, respectively. .PP The functions .Ss (check-class \f2symbol\fP \f2object\fP) .Se .Id check-class and .Ss (check-instance \f2symbol\fP \f2object\fP) .Se .Id check-instance check whether \f2object\fP is a class (i.\|e. satisfies the predicate .S class? ) or an instance, respectively, and, if not, signal an error; in this case \f2symbol\fP is used as the first argument to .S error . .PP The functions .S describe-class .Id describe-class and .S describe-instance .Id describe-instance print the components (name, class/instance variables, etc.) of a class or instance, respectively. The function .S describe .Id describe has been extended in way that when .S "(feature? 'oops)" is true, .S describe-class or .S describe-instance are called when .S describe is applied to an object that satisfies .S class? or .S instance? , respectively. elk-3.99.8/doc/oops/Makefile.am0000644000175000017500000000140311577076306013113 00000000000000EXTRA_DIST = oops.ms CLEANFILES = index.raw index.ms oops.ps oops.html if HAVE_GROFF docs_DATA = oops.ps docsdir = $(datadir)/doc/@PACKAGE@/ps endif MANUAL = $(srcdir)/oops.ms TROFF = groff -ms -t UNROFF = unroff -ms oops.ps: $(MANUAL) index.ms (cat $(MANUAL) $(srcdir)/../util/tmac.index index.ms; echo ".Tc") \ | $(TROFF) 2> /dev/null > oops.ps oops.html: $(MANUAL) (cat $?; echo ".Tc") | $(UNROFF) document=oops index.ms: $(MANUAL) index.raw sort -f -t'#' +1 -3 +0n index.raw \ | $(AWK) -f $(srcdir)/../util/fixindex.awk \ | $(AWK) -f $(srcdir)/../util/block.awk >index.ms index.raw: $(MANUAL) $(TROFF) $(MANUAL) 2> index.raw >/dev/null #check: # checknr -c.Ul.Pr.Sy.Va.Sh.Ix.Id.Ch -a.Ss.Se.[[.]] $(MANUAL) \ # | grep -v "Empty command" elk-3.99.8/doc/man/0000755000175000017500000000000011577110020010712 500000000000000elk-3.99.8/doc/man/Makefile.in0000644000175000017500000003510411577103433012714 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = doc/man DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' man1dir = $(mandir)/man1 am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(docsdir)" NROFF = nroff MANS = $(man_MANS) DATA = $(docs_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ELK_CFLAGS = @ELK_CFLAGS@ ELK_LDFLAGS = @ELK_LDFLAGS@ ELK_LIBS = @ELK_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INCLUDES = @INCLUDES@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOTIF_CFLAGS = @MOTIF_CFLAGS@ MOTIF_LIBS = @MOTIF_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STDINT_HEADER = @STDINT_HEADER@ STRIP = @STRIP@ VERSION = @VERSION@ XAW_CFLAGS = @XAW_CFLAGS@ XAW_LIBS = @XAW_LIBS@ XMKMF = @XMKMF@ XT_CFLAGS = @XT_CFLAGS@ XT_LIBS = @XT_LIBS@ X_CFLAGS = @X_CFLAGS@ X_LIBS = @X_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = $(man_MANS) CLEANFILES = elk.ps elk.1.html man_MANS = elk.1 @HAVE_GROFF_TRUE@docs_DATA = elk.ps @HAVE_GROFF_TRUE@docsdir = $(datadir)/doc/@PACKAGE@/ps TROFF = groff -man -t UNROFF = unroff -man all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/man/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/man/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" @list=''; test -n "$(man1dir)" || exit 0; \ { for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ test -z "$$files" || { \ echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(man1dir)" && rm -f $$files; } install-docsDATA: $(docs_DATA) @$(NORMAL_INSTALL) test -z "$(docsdir)" || $(MKDIR_P) "$(DESTDIR)$(docsdir)" @list='$(docs_DATA)'; test -n "$(docsdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(docsdir)" || exit $$?; \ done uninstall-docsDATA: @$(NORMAL_UNINSTALL) @list='$(docs_DATA)'; test -n "$(docsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(docsdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(docsdir)" && rm -f $$files tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @list='$(MANS)'; if test -n "$$list"; then \ list=`for p in $$list; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ if test -n "$$list" && \ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ echo " typically \`make maintainer-clean' will remove them" >&2; \ exit 1; \ else :; fi; \ else :; fi @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(MANS) $(DATA) installdirs: for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(docsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-docsDATA install-man @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-docsDATA uninstall-man uninstall-man: uninstall-man1 .MAKE: install-am install-data-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-data-hook \ install-docsDATA install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-man1 install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ uninstall-docsDATA uninstall-man uninstall-man1 elk.ps: $(srcdir)/elk.1 $(TROFF) $? > $@ elk.1.html: $(srcdir)/elk.1 $(UNROFF) $? install-data-hook: rm -f "$(DESTDIR)$(mandir)/man1/scheme-elk.1" ln -s elk.1 "$(DESTDIR)$(mandir)/man1/scheme-elk.1" # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: elk-3.99.8/doc/man/elk.10000644000175000017500000000570511577076306011520 00000000000000.pl 11i \" US letter format .TH ELK 1 "15 January 1991" .UC 4 .SH NAME elk, scheme-elk \- extensible Scheme interpreter .SH SYNOPSIS .B elk [ .B \-l \f2file\fP ] [ .B \-h \f2KBytes\fP ] [ .B \-p \f2load-path\fP ] [ .B \-g ] [ .B \-i ] [ .B \-v \f2type\fP ] [[ .B \-\^\- ] \f2args\fP] .LP .BR elk .\|.\|. .SH DESCRIPTION .I Elk (Extension Language Kit) is a Scheme implementation designed as a general extension language for applications written in C or C++. Normally, .I Elk is linked with the application it serves, but a stand-alone version of the Scheme interpreter is installed as well (usually under the name .BR elk ). This interpreter, together with the standard Scheme toplevel, .I Elk can be used as an ordinary, stand-alone implementation of the Scheme language. .LP When called without the .B \-l option, .I Elk loads the standard \*(lqtoplevel\*(rq to start an interactive session. When called with .BR "\-l \f2file\fP" , the contents of the specified file is loaded instead. If a `\-' is given as a filename argument, .I Elk loads from standard input. .LP The option .B \-p \f2load-path\fP can be used to override the standard \f2load-path\fP. The argument is a colon-separated list of directories. If this option is not present and the environment variable ELK_LOADPATH is defined, the value of this variable is used to initialize the \f2load-path\fP. The value of ELK_LOADPATH has the same format as the argument to the .B -p option. .LP The .B \-h \f2KBytes\fP option is used to specify a non-standard heap size. The default heap size is 512 KBytes. .LP If the option .B \-i is specified, symbols are mapped to lower case. Normally, .I Elk is case-sensitive. .LP The .B \-g option causes the interpreter to run the garbage collector each time memory is allocated on the heap. This is useful for writers of extensions who want to test the garbage collect behavior of an extension. Running .I Elk with the .B \-g option is likely to reveal GC-related bugs in extensions (such as not properly protected local objects), as it triggers a garbage collection each time an object is allocated on the Scheme heap. A dot is written to standard output each time a garbage collection is performed when .B \-g has been specified. .LP When called with one or more .B \-v \f2type\fP (``verbose'') options, the interpreter prints additional informational messages to standard output, depending on the value of the \f2type\fP argument. If \f2type\fP is \f2load\fP, the linker command and options are printed each time an object file is loaded; if \f2type\fP is \f2init\fP, the names of extension initialization and finalization functions are printed as they are called. .LP The remaining .I args are put into a list of strings, and the Scheme variable .B command-line-args is bound to this list in the global environment. If arguments could be interpreted as options, `\-\^-\' can be used to indicate the end of the options. .SH FILES .nf $TMPDIR/ldXXXXXX Temporary files .fi .SH AUTHOR Oliver Laumann elk-3.99.8/doc/man/Makefile.am0000644000175000017500000000062111577076306012707 00000000000000EXTRA_DIST = $(man_MANS) CLEANFILES = elk.ps elk.1.html man_MANS = elk.1 if HAVE_GROFF docs_DATA = elk.ps docsdir = $(datadir)/doc/@PACKAGE@/ps endif TROFF= groff -man -t UNROFF= unroff -man elk.ps: $(srcdir)/elk.1 $(TROFF) $? > $@ elk.1.html: $(srcdir)/elk.1 $(UNROFF) $? install-data-hook: rm -f "$(DESTDIR)$(mandir)/man1/scheme-elk.1" ln -s elk.1 "$(DESTDIR)$(mandir)/man1/scheme-elk.1" elk-3.99.8/doc/regexp/0000755000175000017500000000000011577110020011431 500000000000000elk-3.99.8/doc/regexp/Makefile.in0000644000175000017500000003066211577103434013440 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = doc/regexp DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(docsdir)" DATA = $(docs_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ELK_CFLAGS = @ELK_CFLAGS@ ELK_LDFLAGS = @ELK_LDFLAGS@ ELK_LIBS = @ELK_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INCLUDES = @INCLUDES@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOTIF_CFLAGS = @MOTIF_CFLAGS@ MOTIF_LIBS = @MOTIF_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STDINT_HEADER = @STDINT_HEADER@ STRIP = @STRIP@ VERSION = @VERSION@ XAW_CFLAGS = @XAW_CFLAGS@ XAW_LIBS = @XAW_LIBS@ XMKMF = @XMKMF@ XT_CFLAGS = @XT_CFLAGS@ XT_LIBS = @XT_LIBS@ X_CFLAGS = @X_CFLAGS@ X_LIBS = @X_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = regexp.ms CLEANFILES = index.raw index.ms regexp.ps regexp.html @HAVE_GROFF_TRUE@docs_DATA = regexp.ps @HAVE_GROFF_TRUE@docsdir = $(datadir)/doc/@PACKAGE@/ps MANUAL = $(srcdir)/regexp.ms TROFF = groff -ms -t UNROFF = unroff -ms all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/regexp/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/regexp/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-docsDATA: $(docs_DATA) @$(NORMAL_INSTALL) test -z "$(docsdir)" || $(MKDIR_P) "$(DESTDIR)$(docsdir)" @list='$(docs_DATA)'; test -n "$(docsdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(docsdir)" || exit $$?; \ done uninstall-docsDATA: @$(NORMAL_UNINSTALL) @list='$(docs_DATA)'; test -n "$(docsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(docsdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(docsdir)" && rm -f $$files tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(docsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-docsDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-docsDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-docsDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-docsDATA regexp.ps: $(MANUAL) index.ms (cat $(MANUAL) $(srcdir)/../util/tmac.index index.ms; echo ".Tc") \ | $(TROFF) 2> /dev/null > regexp.ps regexp.html: $(MANUAL) (cat $?; echo ".Tc") | $(UNROFF) document=regexp index.ms: $(MANUAL) index.raw sort -f -t'#' +1 -3 +0n index.raw \ | $(AWK) -f $(srcdir)/../util/fixindex.awk \ | $(AWK) -f $(srcdir)/../util/block.awk >index.ms index.raw: $(MANUAL) $(TROFF) $(MANUAL) 2> index.raw >/dev/null #check: # checknr -c.Ul.Pr.Sy.Va.Sh.Ix.Id.Ch -a.Ss.Se.[[.]] $(MANUAL) \ # | grep -v "Empty command" # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: elk-3.99.8/doc/regexp/regexp.ms0000644000175000017500000001235411577076306013233 00000000000000.so ../util/tmac.scheme .Ul .TL Reference Manual for the .sp .5 Elk Regular Expression Extension .AU Oliver Laumann . .Ch "Introduction" . .PP The regular expression extension defines Scheme language bindings for the .Ix POSIX POSIX regular expression functions that are provided by most modern .Ix UNIX UNIX versions (\f2regcomp()\fP and \f2regexec()\fP). You may want to refer to your UNIX system's .Ix regcomp \f2regcomp(3)\fP manual for details. The Scheme interface to the regular expression functions makes the entire functionality of the usual C language interface available to the Scheme programmer. To load the regular expression extension, evaluate the expression .Ss (require 'regexp) .Se .PP This causes the files .Ix regexp.scm \f2regexp.scm\fP and .Ix regexp.o \f2regexp.o\fP to be loaded (\f2regexp.o\fP must be statically linked with the interpreter on platforms that do not support dynamic loading of object files). .PP Loading the extension provides the .Ix feature features \f2regexp\fP and \f2regexp.o\fP. On systems that do not support the regular expression library functions, loading the extension succeeds, but no further primitives or features are defined. Otherwise, the additional feature .Ix :regular-expressions \f2:regular-expressions\fP is provided, so that the expression .Ss (feature? ':regular-expressions) .Se can be used in Scheme programs to check whether regular expressions are available on the local platform. . .Ch "Creating Regular Expressions" . .[[ .Pr make-regexp pattern .Pr make-regexp pattern flags .]] .LP \f2make-regexp\fP returns an object of the new Scheme type \f2regexp\fP representing the regular expression specified by the string argument \f2pattern\fP. An error is signaled if the underlying call to the C library function .Ix regcomp \f2regcomp(3)\fP fails. The optional .Ix flags \f2flags\fP argument is a list of zero or more of the symbols \f2extended, ignore-case, no-subexpr,\fP and \f2newline\fP; these correspond to the C constants \s-1\f2REG_EXTENDED, REG_ICASE, REG_NOSUB,\fP\s0 and \s-1\f2REG_NEWLINE\fP\s0. .PP .Ix equality Two objects of the type \f2regexp\fP are equal in the sense of \f2equal?\fP if their flags are identical and if their patterns are equal in the sense of \f2string=?\fP. Two regular expressions are \f2eq?\fP if their flags are identical and if they share the same pattern string. . .Pr regexp? obj .LP This .Ix "type predicate" type predicate returns #t if \f2obj\fP is a regular expression, #f otherwise. . .[[ .Pr regexp-pattern regexp .Pr regexp-flags regexp .]] .LP These primitives return the pattern (or .Ix flags flags, respectively) specified in the call to .Ix make-regexp \f2make-regexp\fP that has created the regular expression object. . .Ch "Matching Regular Expressions" . .[[ .Pr regexp-exec regexp string offset .Pr regexp-exec regexp string offset flags .]] .LP This primitive applies the specified regular expression to the given string starting at the given offset. \f2offset\fP is an integer larger than or equal to zero and less than or equal to the length of \f2string\fP. If the match succeeds, \f2regexp-exec\fP returns an object of the new Scheme type .Ix regexp-match \f2regexp-match\fP, otherwise #f. The optional .Ix flags \f2flags\fP argument is a list of zero or more of the symbols \f2not-bol\fP and \f2not-eol\fP which correspond to the constants \s-1\f2REG_NOTBOL\fP\s0 and \s-1\f2NOT_EOL\fP\s0 in the C language interface. . .Pr regexp-match? obj .LP This .Ix "type predicate" type predicate returns #t if \f2obj\fP is a regular expression match (that is, the return value of a successful call to \f2regexp-match\fP), #f otherwise. . .Pr regexp-match-number match .LP This primitive returns the number of substrings that matched parenthetic .Ix subexpression subexpressions in the original pattern when the given match was created, plus one (the first substring corresponds to the entire regular expression rather than a subexpression; see .Ix regexec \f2regexec(3)\fP for details). A value of zero is returned if the match has been created by applying a regular expression with the .Ix no-subexpr \f2no-subexpr\fP flag set. . .[[ .Pr regexp-match-start match number .Pr regexp-match-end match number .]] .LP These primitives return the start offset (or end offset, respectively) of the substring denoted by the integer \f2number\fP. A \f2number\fP argument of zero refers to the substring corresponding to the entire pattern. The offsets returned by these primitives can be directly used as arguments to the .Ix "substring primitive" \f2\%substring\fP primitive of Elk. . .KS .Ch "Example" . .PP The following program demonstrates a simple Scheme procedure \f2matches\fP that returns a list of substrings of a given string that match a given pattern. An error message is displayed if regular expressions are not supported by the local platform. .Ss .in (require 'regexp) .sp .4 (define (matches str pat) (let loop ((r (make-regexp pat '(extended))) (result '()) (from 0)) (let ((m (regexp-exec r str from))) (if (regexp-match? m) (loop r (cons (substring str (+ from (regexp-match-start m 0)) (+ from (regexp-match-end m 0))) result) (+ from (regexp-match-end m 0))) (reverse result))))) .Se .KE elk-3.99.8/doc/regexp/Makefile.am0000644000175000017500000000142511577076306013431 00000000000000EXTRA_DIST = regexp.ms CLEANFILES = index.raw index.ms regexp.ps regexp.html if HAVE_GROFF docs_DATA = regexp.ps docsdir = $(datadir)/doc/@PACKAGE@/ps endif MANUAL = $(srcdir)/regexp.ms TROFF = groff -ms -t UNROFF = unroff -ms regexp.ps: $(MANUAL) index.ms (cat $(MANUAL) $(srcdir)/../util/tmac.index index.ms; echo ".Tc") \ | $(TROFF) 2> /dev/null > regexp.ps regexp.html: $(MANUAL) (cat $?; echo ".Tc") | $(UNROFF) document=regexp index.ms: $(MANUAL) index.raw sort -f -t'#' +1 -3 +0n index.raw \ | $(AWK) -f $(srcdir)/../util/fixindex.awk \ | $(AWK) -f $(srcdir)/../util/block.awk >index.ms index.raw: $(MANUAL) $(TROFF) $(MANUAL) 2> index.raw >/dev/null #check: # checknr -c.Ul.Pr.Sy.Va.Sh.Ix.Id.Ch -a.Ss.Se.[[.]] $(MANUAL) \ # | grep -v "Empty command" elk-3.99.8/doc/usenix/0000755000175000017500000000000011577110020011452 500000000000000elk-3.99.8/doc/usenix/Makefile.in0000644000175000017500000003013111577103434013450 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = doc/usenix DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(docsdir)" DATA = $(docs_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ELK_CFLAGS = @ELK_CFLAGS@ ELK_LDFLAGS = @ELK_LDFLAGS@ ELK_LIBS = @ELK_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INCLUDES = @INCLUDES@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOTIF_CFLAGS = @MOTIF_CFLAGS@ MOTIF_LIBS = @MOTIF_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STDINT_HEADER = @STDINT_HEADER@ STRIP = @STRIP@ VERSION = @VERSION@ XAW_CFLAGS = @XAW_CFLAGS@ XAW_LIBS = @XAW_LIBS@ XMKMF = @XMKMF@ XT_CFLAGS = @XT_CFLAGS@ XT_LIBS = @XT_LIBS@ X_CFLAGS = @X_CFLAGS@ X_LIBS = @X_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = usenix.ms CLEANFILES = tmp.ref usenix.ps @HAVE_GROFF_TRUE@docs_DATA = usenix.ps @HAVE_GROFF_TRUE@docsdir = $(datadir)/doc/@PACKAGE@/ps MANUAL = $(srcdir)/usenix.ms TROFF = groff -ms UNROFF = unroff -ms all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/usenix/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/usenix/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-docsDATA: $(docs_DATA) @$(NORMAL_INSTALL) test -z "$(docsdir)" || $(MKDIR_P) "$(DESTDIR)$(docsdir)" @list='$(docs_DATA)'; test -n "$(docsdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(docsdir)" || exit $$?; \ done uninstall-docsDATA: @$(NORMAL_UNINSTALL) @list='$(docs_DATA)'; test -n "$(docsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(docsdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(docsdir)" && rm -f $$files tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(docsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-docsDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-docsDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-docsDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-docsDATA usenix.ps: $(MANUAL) tmp.ref sed -f tmp.ref $(MANUAL) | $(TROFF) 2> /dev/null > usenix.ps usenix.html: $(MANUAL) tmp.ref sed -f tmp.ref $(MANUAL) | $(UNROFF) document=usenix tmp.ref: $(MANUAL) $(TROFF) $(MANUAL) 2> tmp.ref >/dev/null # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: elk-3.99.8/doc/usenix/usenix.ms0000644000175000017500000023233711577076306013302 00000000000000.if \n(.g .do char \[a:] \[:a] .\" \(a: is a lower case a with diaeresis (a umlaut) .\" \(-> is an arrow pointing to the right .\" \(mu is a multiplication sign (cross) .\" \*- is an em dash . .\" .fp 1 PR .\" .fp 2 PI .\" .fp 3 PB .nr VS 20 .fp 5 C .fp 6 CO .ie \n(.U .ds ^4 ^4 .el .ds ^4 \u\s-1\|4\s0\d . \" Second level section .de P .NH 2 .. . \" Scheme code start .de Ss .KS .ta 8.5c .nr sF \\n(.f .ft 5 .ps -2 .\".vs -2 .vs 13 .nf .in 1c .if !\n(.U .sp .3c .. . \" Scheme code end .de Se .in .fi .vs .ps .ft \\n(sF .KE .if !\n(.U .sp .5 .. . \" Newline in Scheme code .de Sl .sp .52 .. .nr lS 0 1 . \" Listing start .de Ls .br .KF .sp .5 .LP \l'\\n(.lu_' .. . \" Listing caption: .Lc caption .de Lc .sp .2 .ce 999 \f3\s-1Listing \\n+(lS:\fP \c \\$1\s0 .if !\\$2 \s-1\&\\$2\s0 .ce 0 .. . \" Listing end: .Le reference .de Le .tm s/@L(\\$1)/\\n(lS/g .LP \l'\\n(.lu_' .sp .KE .. . \" Notes start (at end of listing) .de Ns .sp .ps -2 .vs -2 .in 1c .ll -1c .. . \" Notes end .de Ne .ll .in .vs .ps .sp -.3 .. .ds E Elk .TL \*E: The Extension Language Kit .AU Oliver Laumann* and Carsten Bormann\v'-.2m'\(dg\v'.2m' .AI * Technische Universit\(a:t Berlin, Germany .br \(dg Universit\(a:t Bremen, Germany .AB In the past, users of an application generally were at the mercy of its authors when it came to adapting it to their individual needs and tastes. Fitting an application with an \f2extension language\fP (or \f2embedded language\fP) enables users to customize and enhance it without having to modify its source code. Recently, variants of Lisp have become increasingly popular for this purpose, to the point where the abundance of different dialects has grown into a problem. Of the two standardized dialects of Lisp, only \f2Scheme\fP is suitably modest, yet sufficiently general, to serve as an extension language. .PP \f2\*E\fP, the \f2Extension Language Kit\fP, is a Scheme implementation that is intended to be used as a general, reusable extension language subsystem for integration into existing and future applications. Applications can define their own Scheme data types and primitives, providing for a tightly-knit integration of the C/C++ parts of the application with Scheme code. Library interfaces, for example to the UNIX operating system and to various X Window System libraries, show the effectiveness of this approach. Several features of \*E such as dynamic loading of object files and freezing of fully customized applications into executables (implemented for those UNIX environments where it was feasible) increase its usability as the backbone of a complex application. \*E has been used in this way for seven years within a locally-developed ODA-based multimedia document editor; it has been used in numerous other projects after it could be made freely available five years ago. .AE .NH Introduction .PP The designers and implementors of a large or complex application can rarely anticipate all requirements future users will have on the application. Typically, users wish to be able to customize the user interfaces of applications according to their personal tastes or requirements, or they want to extend the functionality of an application (either by combining existing functions into new ones or by adding entirely new capabilities). This is especially true for applications used routinely, such as text editors, and for applications with a high degree of user interaction or with complex graphical user interfaces. .PP Certainly any application can be customized by modifying its source code and recompiling it. But this approach is often not feasible, as the source code of the application or the tools needed to recompile it may not be available. Even if it were feasible, it would be a time-consuming process; it would be hard to keep up with new releases of the application; and the coexistence of multiple, similar versions of the same application would become a general maintenance headache. .PP The alternative to this approach is not to ``hard-wire'' the entire functionality and all external aspects of an application in the source code at all, but to provide means to customize the application's behavior later by its users. .P Early Customization and Extension Languages .PP Many applications support at least simple methods for customization, such as command line options or configuration files. More powerful tools for customization are \f2macro languages\fP, \f2command languages\fP, or \f2scripting languages\fP that are typically found in text editors and word processors. Prominent examples of such customization and extension languages are the macro language of the now legendary TECO editor and, in UNIX, the macro language of the \f2troff\fP text formatter [Ossanna 1979] and the configuration language of the \f2sendmail\fP program. .PP Although many of these classic extension languages are quite powerful (some of them are full-fledged programming languages), they have a reputation of being ``cryptic'' and hard to understand and use by untrained users. The prevailing opinion seems to be that only experts can actually benefit from these types of extension languages (for example, people who have mastered the \f2sendmail\fP configuration language in all details are commonly appointed the status of a ``guru''). In fact, it can be observed that only very few users of the \f2troff\fP text formatter (whose macro language is reputed to be particularly cryptic) are using macro packages written by themselves; many users give up after some time and fall back on vendor-supplied macro packages or packages written by a ``troff guru.'' .PP Experience also indicates that simplified or specialized extension languages often have more features added and grow until they resemble a full programming language. Such ``organically grown'' extension languages are likely to be contorted designs as they will consist of several levels of extensions glued on to their initial, more limited design. .P High-Level Extension Languages .PP Recently application designers have begun to abandon specialized and cryptic macro-style extension languages in favor of extension languages that resemble usual high-level programming languages, mainly languages with Algol/Pascal-style or Lisp-style syntax and semantics. Prominent examples of such high-level extension languages are TPU developed by DEC, the \f2Ness\fP language of the Andrew Toolkit [Hansen 1990], AutoDesk's CAD extension language (a dialect of Lisp), and \f2Emacs-Lisp\fP, the extension language of Richard Stallman's popular GNU Emacs editor [Stallman 1981, Lewis et al. 1990]. .PP Emacs was the first wide-spread application to employ an already existing and widely used high-level programming language as its extension and customization language. Emacs-Lisp is a dynamically scoped dialect of Lisp with additional operations for text-editing. The approach taken by Emacs has been tremendously successful; users of Emacs have contributed a wealth of extensions written in Emacs-Lisp. .PP Note that Emacs-Lisp is not a \f2scripting language\fP. It is tightly interwoven with the application for which it provides extensibility. It also is somewhat inaccessible to the casual user, who is unlikely to have previous experience with Lisp-like languages. This can be contrasted with languages such as Tcl [Ousterhout 1990] and REXX [Cowlishaw 1985], whose underlying models are no less complex, but which are similar enough to well-known languages such as BASIC to present less of an obstacle to casual users. On the other hand, non-trivial extensions benefit from the structuring functionality inherent in general purpose programming languages such as Lisp. .P \*E as a General, Reusable Extension Language .PP Using Lisp or Lisp-style languages as extension languages seems to enjoy growing popularity; several applications besides Emacs now use dialects of Lisp as their extension language. This development has one disadvantage: the number of incompatible (but similar) extension languages is continually growing. Users have to learn a new language for each new application, and application writers keep implementing new extension language interpreters instead of reusing existing ones. .PP These problems can be solved by a general, reusable extension language implementation that application writers can include into their applications, an \f2extension language kit\fP. The main objective of the \f2\*E\fP project was to develop such an extension language kit and to make it freely available to encourage use by application writers. .NH Overview of the Extension Language Kit .P The Evolution of \*E .PP We were prompted to develop \*E when a search for a suitable extension language implementation for ISOTEXT [Bormann et al. 1988, Bormann 1991] was fruitless. ISOTEXT, a document processing system with a graphical user interface, is almost entirely written in C++; its user interface is based on the X window system [Scheifler et al. 1986, Scheifler et al. 1992] and the OSF/Motif widget set. Customizability and extensibility through a full extension language were basic requirements on the design of ISOTEXT. .PP As we consider language design to be the domain of a ``selected few'' and did not want to act as amateurs in this field, we decided to use an existing programming language as the basis for the extension language of ISOTEXT. This decision was also influenced by our desire to develop a general, reusable extension language implementation that is not hard-wired into one specific application. For a number of reasons an interpreted language seemed preferable: extensions can be added to (or modified in) a running application without re-linking it; bugs in extensions can be caught in the interpreter and do not crash the application; interpreted languages usually offer better debugging facilities; and implementing an interpreter generally is easier than implementing a compiler. .PP From the beginning we favored Lisp or a dialect of Lisp as the basis for a general extension language. Most dialects of the Lisp family are ``small'', easy to implement, general-purpose languages with simple syntax and powerful semantics, and the suitability of Lisp as an extension language had already been demonstrated by several applications, among them GNU Emacs. Early in the project we considered to use Emacs-Lisp, but it appeared infeasible to isolate the Lisp interpreter from the rest of Emacs. In addition, at the time we investigated Emacs-Lisp it was lacking several desirable language features, such as support for floating point and arbitrary precision numbers (\f2bignums\fP). We also considered using MIT Scheme [MIT 1984], but due to the enormous size of its implementation it would have dominated the size of the application. .P Scheme as an Extension Language .PP As other implementations of Lisp or Lisp-like languages available did not meet our requirements, we finally decided to write an interpreter for the Lisp dialect \f2Scheme\fP [Clinger et al. 1991, Dybvig 1987, Springer et al. 1989, Abelson et al. 1985]. This Scheme interpreter is the main component of the \*E package. Scheme is a simplified, ``cleaned-up'' dialect of Lisp with first-class procedures and static scoping rules. The Scheme language is based on only a few language features and semantic concepts; it consists of a small core of syntactic forms, a set of extended forms derived from them, and a number of standard procedures (\f2primitive\fP procedures) that operate on a comprehensive set of types of objects (among them numbers, lists, vectors, symbols, characters, and strings). In 1990 Scheme became an IEEE standard [IEEE\|Std\|1178-1990] (the standard document, although only 50 pages long, includes the formal semantics of the language). .PP The standardization effort has increased the acceptance of Scheme; for instance, the Extension Language Working Group of the CAD Framework Initiative has recently selected Scheme as the extension language for future CAD applications [CFI 1991a, CFI 1991b]. Among the established programming languages we consider Scheme the ideal candidate for a general extension language \*- it is standardized; its semantics are well-defined; it has a simple syntax and is easy to implement; and it is sufficiently small to not dwarf the application it makes extensible. .P Extending the Extension Language .PP The implementation of an extension language must itself be extensible. Extension language code that manipulates objects or state of the application requires adding application-specific primitive procedures to the base extension language. To allow \*E programs to be expressive in the context of a given application, application writers are encouraged (and expected) to extend standard Scheme by a rich set of application-specific data types and Scheme primitives to operate on objects of these types. In fact, easy extensibility of the language has been the primary design consideration in the development of \*E (as opposed to performance or number of language features). Adding new types and primitives to \*E is an inexpensive operation; it is not uncommon for an application to define hundreds of application-specific Scheme primitives. .\" .\" implementation must fit well to `host language' (schreibt cabo...) .PP All primitive procedures of \*E are implemented as C or C++ functions. This is true for both built-in primitives (such as \f2car\fP and \f2cdr\fP) and primitives defined by extensions. From the Scheme programmers' point of view, primitives and types from the base set of the language are indistinguishable from application-specific primitives and types. Extensions ``register'' new primitives with the interpreter by supplying the name of the primitive along with a pointer to the function implementing the primitive and information about the arguments and calling style. New types are defined in a similar way. Registration of new primitives and types usually takes place on startup of the interpreter or when a compiled extension is loaded into the running interpreter. .PP Another way to use the extension mechanisms of \*E is to provide interfaces to libraries, such as the C library or the libraries of the X window system (e.\|g.\& \f2Xlib\fP). \*E has no facility to directly import ``foreign'' functions (although one such facility has been contributed as an extension to \*E). Therefore, a small amount of code acting as ``glue'' between \*E and the library has to be written to make the contents of a library available to Scheme programmers. The main purpose of this interface code is to check the arguments supplied to the library functions, to convert Scheme objects into C types, and to convert the results of library functions back into Scheme objects. Such \f2library extensions\fP often act as an additional layer between the application to be extended and the libraries used by the application; they allow the application writers to abstract from the details of the libraries. Although it is useful to distinguish between \f2library\fP extensions and extensions interfacing to \f2applications\fP, there is no technical difference \*- in both cases a collection of types and functions is made available to the Scheme world. .PP Since many of today's applications need to interact with the X Window System, library extensions are included with \*E that interface to the X11 ``Xlib'' (similar in its functionality to ``CLX'' [CLX 1991], but implemented on top of Xlib), to the X11 toolkit intrinsics (``Xt''), and to the Athena and OSF/Motif widget sets. .PP In addition, the \*E UNIX extension provides Scheme access to most UNIX system calls and operating system interface C library functions\**. .FS The UNIX extension defines procedures for low-level, file-descriptor-based I/O; creation of pipes; file/record locking; file and directory system calls; process creation and control; signal handling; error handling; and obtaining information about date, time, users, limits, process resources, etc. .FE The extension supports a wide range of different UNIX platforms without restricting its functionality to the lowest common denominator or the POSIX 1003.1 functions. To facilitate writing portable Scheme programs, the extension attempts to hide differences between the types of supported UNIX flavors. .\"(Two examples are appended: one forks off a process .\"and communicates with it through pipes; the other one measure the maximum .\"capacity of a pipe using non-blocking I/O.) .NH Using \*E in Applications .\" .P .\" Bringing Everything Together .PP In contrast to other extension language implementations (e.\|g.\& Tcl), \*E does not provide its functionality in the form of a library that is statically linked into an application to be extended. Instead, the object modules comprising the application and all required library extensions are dynamically linked with and loaded into the running Scheme interpreter. To accomplish this, the \f2load\fP primitive of \*E has been extended to load not only files containing Scheme code, but also object files \*- compiled extensions written in C or C++. Dynamic loading enables applications to load less frequently used modules into the running program only on demand; such an application is initially smaller than the equivalent statically linked application (where all modules must be combined into one large executable file). .PP Dynamic loading of object files is often used together with the \f2dump\fP primitive that creates an executable file from the running interpreter, similar to \f2unexec\fP of GNU Emacs or \f2dump\%lisp\fP in some Lisp systems. The \f2dump\fP primitive of \*E differs from existing, similar mechanisms in that the newly created executable, when called, starts at the point where \f2dump\fP was called in the original invocation (as opposed to the program's \f2main\fP entry point). Here the return value of \f2dump\fP is ``true'', while in the original invocation it returns ``false'' \*- not unlike the UNIX \f2fork\fP system call. .P Dynamic Loading and Dump in Cooperation .PP To generate a new instance of an application one would typically invoke the Scheme interpreter, load all object modules and all Scheme code required initially, perform all initializations that can survive a \f2dump\fP, and finally dump an image of the running interpreter containing all the loaded code into a new executable on disk. The use of \f2dump\fP avoids time-consuming activities such as loading of object files and other initializations on each startup. The dumped executable, when started, resumes after the call to \f2dump\fP; at this point one would perform the remaining, environment-dependent initializations and finally invoke the application's ``main program'' (e.\|g.\& enter the X toolkit's event processing main loop). Listing @L(dump) shows a (slightly simplified) Scheme program that generates and starts a new instance of an application. .Ls .Ss ;;; Load initially required object files and Scheme files of ;;; application and dump image into executable file. ;;; Dumped file enters application's main loop on startup. .Sl (load 'main.o) ; initial object modules (load 'edit.o) (load 'x11.o) ; (a library extension) \&... (load 'ui.scm) ; initial Scheme files (load 'custom.scm) (load 'x11.scm) \&... (initialize-application) .Sl (if (dump 'a.out) (begin ; dumped a.out starts execution here (initialize-depending-on-environment) (main-loop-of-application) (exit))) .Sl ;; Original invocation gets here when dump is finished. We're done. .Se .Lc "Scheme code to generate and start an application" .Ns \f2Note:\fP Filenames can be given as symbols (besides the usual string literals). A more meaningful name than a.out would probably be chosen in practice. .Ne .Le dump .PP On systems that do not support dynamic linking and loading of object files (such as older versions of UNIX System V) or where \f2dump\fP cannot be implemented, the interpreter kernel and the application and library extensions are linked statically and combined into one executable. .PP In any event, in an application using \*E, the control initially rests in the Scheme interpreter. The interpreter acts as the ``main program'' of the application; it is the interpreter's \f2main()\fP function which is invoked on startup of the program. Therefore the first code to execute in an application is Scheme code; this Scheme code provides the shell functionality of the application (hence it is called \f2shell code\fP). The shell code may perform a few simple tasks, for instance, load a user-provided initialization file containing customization code for the application and then enter the application's main loop, or it may be as complex as in ISOTEXT, where the entire X-based user interface is written in Scheme. .P Making Oneself Known to the Extension Language .PP The application, as it is linked with the extension language interpreter, has full access to all external functions and variables of the interpreter kernel. The interpreter, on the other hand, does not have any knowledge of the contents of dynamically linked and loaded object modules; all it sees of an object file being loaded is the file's symbol table. To obtain ``hooks'' into a newly loaded extension, the interpreter searches the symbol table of each object file being loaded for functions whose names start with the prefix ``elk_init_'' (\f2extension initialization functions\fP) and invokes these functions as they are encountered. Likewise, to support extensions written in C++, any C++ static constructors found in the symbol table are called. When linked statically with its extensions, the interpreter must scan its own symbol table on startup to find and invoke the initialization functions. (Similar support is available for calling extension finalization functions and C++ static destructors on termination.) .PP Besides initializing private data of the modules being loaded, these initialization functions register with the interpreter the Scheme primitives and Scheme data types implemented by the extensions. To enable extensions to register new primitive procedures and types, the interpreter kernel exports two functions: \f2Define_Primitive()\fP to register a new Scheme primitive and \f2Define_Type()\fP to register a new Scheme data type. Both functions take pointers to C functions as arguments that implement the new primitive or the basic access functions of the type (such as the print function and the equality predicates). .PP A simple example for a library extension is presented in Appendix A. .NH Notes on the Implementation .PP Designing \*E, not as another Scheme implementation, but as an extension language kit, provided a design space different from that traditionally available for Lisp implementations. The necessary deviations from the treaded paths of UNIX programming uncovered limitations in portability, aggravated by badly tested corners of standard UNIX facilities. This section discusses the more interesting examples of such issues. .P Implementing Continuations .PP Finding a way to efficiently implement Scheme's \f2continuations\fP called for considerable efforts during the design phase of \*E. Continuations are a powerful language feature; they support the definition of arbitrary control structures such as non-local loop and procedure exits, \f2break\fP and \f2return\fP as in C, exception handling facilities, explicit backtracking, co-routines, or multitasking based on \f2engines\fP [Dybvig 1987]. .PP The primitive procedure .Ss \s+1(call-with-current-continuation \f2receiver\fP)\s0 .Se packages up the current execution state of the program into an object (the \f2continuation\fP or \f2escape procedure\fP) and passes this object as an argument to \f2receiver\fP (which is a procedure of one argument). Continuations are first-class objects in Scheme; they are represented as procedures of one argument (not to be confused with the \f2receiver\fP procedure). Each time a continuation procedure is called with a value, it causes this value to be returned as the result of the \f2call-with-current-continuation\fP expression which created this continuation. If the procedure \f2receiver\fP terminates normally (i.\|e.\& does not invoke the continuation given to it), the value returned by \f2call-with-current-continuation\fP is the return value of \f2receiver\fP. .PP As long as the use of a continuation is confined to the runtime of the \f2receiver\fP procedure, \f2call-with-current-continuation\fP is similar in its functionality to \f2catch/throw\fP in most Lisp dialects or \f2setjmp/longjmp\fP in C. However, continuations, like all procedures in Scheme, have indefinite extent (unlimited lifetime); they can be stored in variables and called an arbitrary number of times, even after the \f2receiver\fP and the enclosing \f2call-with-current-continuation\fP have already terminated. Listing @L(call-cc) shows a program fragment where continuations are used to get back an arbitrary number of times into the middle of an expression whose computation has already been completed. While not particularly useful, this example demonstrates that continuations can be used to build control structures that cannot be implemented by means of less general language features like catch/throw or setjmp/longjmp. .Ls .Ss (define my-function (lambda (n m) (+ n (mark m))) ; return n+m .Sl (define get-back "uninitialized") .Sl (define mark ; identity function, but also (lambda (value) ; assign current continuation (call-with-current-continuation ; to a global variable (lambda (continuation) (set! get-back continuation) ; (assign it) value)))) .Sl .Sl (my-function 10 20) ; invoke my-function \f2prints 30\fP (get-back 5) ; resume with new value \f2prints 15\fP (get-back 0) ; ...once more \f2prints 10\fP .Se .Lc "Using continuations with unlimited extent" .Le call-cc .PP The different approaches applicable to implementing continuations are intimately tied to the strategies used for interpreting the language itself. Scheme interpreters generally employ a lexical analyzer and parser \*- the \f2reader\fP \*- to read and parse the Scheme source code and produce an intermediate representation of the program. During this phase, symbols are collected in a global hash table (in Lisp jargon, the symbols are \f2interned\fP), and a tree structure representing the program's S-expressions is built up on the heap of the interpreter. The majority of interpreters compile this intermediate representation into an abstract machine language (such as \f2byte code\fP). The evaluator is then implemented as an abstract machine which interprets the low-level language; this machine \*- usually a simple stack machine \*- may even be implemented in hardware. .PP In an abstract machine implementation, the straightforward approach to implement \f2call-with-current-continuation\fP is to package up the contents of the abstract machine's registers (program counter, stack pointer, etc.) and runtime stack. Since continuations have indefinite extent, it would not suffice to just capture its registers (as the C library function \f2setjmp\fP does for the real machine). To be able to continue the evaluation of procedures that have already returned and whose frames are therefore no longer on the stack, a continuation must also embody the contents of the abstract machine's stack at the time it is created. When a continuation is applied, the machine resumes the ``frozen'' computation by restoring the saved registers and stack contents of the abstract machine. .PP Just saving the abstract machine's state would not work in \*E, because at the time a continuation is created, arbitrary library functions may be active in addition to Scheme primitives. For instance, consider the \*E interface to the ``Xt'' toolkit intrinsics of the X window system. Here, a typical scenario is that some Scheme procedure invokes the primitive that enters the toolkit's event dispatching main loop (\f2XtAppMainLoop()\fP). When an event arrives (for example, a mouse button press event), the toolkit's main loop invokes a callback function, which in turn calls a user-supplied Scheme procedure to be executed when a mouse button is pressed. This Scheme procedure might in turn invoke yet another function from the ``Xt'' library, and so on. A similar example would be a \f2qsort\fP or \f2ftw\fP extension to \*E, where the user-supplied function called by the \f2qsort()\fP or \f2ftw()\fP C library function would invoke a procedure written in Scheme. .PP The interpreter's thread of execution at any time obviously involves both Scheme primitives and library functions (such as \f2XtAppMainLoop()\fP and \f2qsort()\fP in the examples above) in an arbitrary combination. Therefore, a continuation must embody not only the execution state of the active Scheme procedures, but also that of the currently active library functions (such as local variables used by the library functions). In the approach used by \*E, a continuation is created by capturing the machine's registers \*- like \f2setjmp\fP in C does \*- and the C runtime stack. When a continuation is applied later, the registers and the saved stack contents are copied back. Actually, we did not follow the usual ``abstract machine'' technique in \*E at all; instead, the Scheme evaluator directly interprets the intermediate representation produced by the reader. In a sense, it is the ``real'' machine (the hardware on which \*E is executed) that plays the role the abstract machine plays in implementations with byte-code compilation. .PP Although the abstract machine technique usually yields faster execution of Scheme code, the performance of \*E resembles that of existing interpreters employing this technique, and the implementation of \*E is simpler than that of comparable interpreters using byte-code compilation. While the technique to implement continuations in \*E is not strictly portable \*- it is based on certain assumptions on the machine's stack layout and the C compiler and runtime environment \*- .\"implementations of the small machine-dependent part now exist for it works on most major machine architectures (with two exceptions, which are supported using \f2asm\fP statements). .P The Implementation of ``dump'' .PP Continuations provide a natural basis for implementing the execution-state preserving semantics of the \f2dump\fP primitive. When called, \f2dump\fP invokes \f2call-with-current-continuation\fP. The real work is done in the \f2receiver\fP procedure; it stores the newly created continuation into a global variable, sets a global \f2was-dumped\fP flag to indicate that a dump has taken place, creates an executable file from the image of the running process, and finally returns ``false''. The return value of the \f2dump\fP primitive is the return value of this call to \f2call-with-current-continuation\fP, i.\|e.\& ``false'' if a dump has just been performed. .PP When the interpreter \*- either the original program or a dumped executable \*- is started, it examines the \f2was-dumped\fP flag as its very first action. If the flag is set, the running interpreter was started from a dumped executable. In this case the interpreter immediately invokes, with an argument of ``true'', the continuation that was saved away by a call to \f2dump\fP; this causes that call to \f2dump\fP to finish and return ``true'' to its caller. If, on the other hand, the \f2was-dumped\fP flag is not set (i.\|e.\& the running process was not started from a dumped image), the interpreter initializes and starts up as usual. .PP Before writing an image of the running process to disk, \f2dump\fP has to close all open Scheme file ports, as open file descriptors would not survive a \f2dump\fP \*- they would no longer be valid in the dumped executable. Generally, this is true for all objects pointing to information maintained by the UNIX kernel, such as the current directory, the current signal dispositions, resource limits, or interval timers. Users and implementors of \*E extensions must be aware of this particular restriction. For instance, users of the X11 extensions have to make sure that, if \f2dump\fP is to be used, connections to X-displays are only established in the dumped invocation. .PP To be able to create an executable from the running process, \f2dump\fP has to open and read the a.out file from which the running process was started (actually, if the system linker has been called to dynamically load object files, the output of the most recent invocation of the linker is used instead of the original a.out). The symbol table of the new executable is copied from the a.out file of the running program; in addition, the a.out header has to be read to obtain the length of the text segment and the start of the data segment of the running process. To do so, \f2dump\fP has to determine the filename of the a.out file from which the process was started based on the information in \f2argv[0]\fP and in the PATH environment variable. This approach is obviously based on several prerequisites: \f2dump\fP must be able to access its a.out file (\f2argv[0]\fP must carry meaningful information; the file must be readable) and the running program's a.out file must not have been stripped. It would have been advantageous for the implementation of \f2dump\fP if the entire a.out file were automatically mapped into memory on startup, like it is done, for instance, in NeXT-OS/Mach. .PP \f2dump\fP combines the data segment and the ``bss'' segment of the running process into the data segment of the new executable. If \*E had a separate heap for storing constant objects (future versions may have one), \f2dump\fP could place this read-only part of the memory into the new executable's text segment to make it sharable. When the interpreter's heap is written to disk, \f2dump\fP seeks over the unused portions of the heap, so that fake blocks (holes) can be used for these parts of the file. This results in a considerable conservation of disk space in the final executable, as at least half of the interpreter's heap is unused at any time due to the garbage collection algorithm of \*E. .PP Since the a.out formats used in the numerous versions of UNIX differ vastly, \*E has to include separate implementations of \f2dump\fP for the currently supported a.out formats. Version 2.2 of \*E handles the BSD-style a.out format used in BSD and ``derived'' UNIX versions (such as SunOS 4.1), the COFF a.out format (used in older releases of UNIX System V and in A/UX), Convex SOFF, Extended COFF of MIPS-based computers (DEC, SGI), and the ELF a.out format of System V Release 4 and related UNIX versions (Solaris 2.x, OSF/1). .P Dynamic Loading of Object Files .PP When loading an object file during runtime, addresses within this object file must be relocated to their new location in the program's address space. To allow extensions to directly reference objects of the interpreter kernel, such as the heap and the built-in primitives, unresolved references into the \f2base program\fP must be resolved during dynamic loading. Finally, the object file needs to be able to export its entry points (such as \*E's extension initialization functions) to the base program. .PP More than one object file may have to be loaded into one invocation of \*E. To manage non-trivial, hierarchically structured sets of extensions, where a number of high-level extensions require one or more lower-level extensions to be loaded, it is essential that object files loaded later can make use of the symbols defined by previously loaded object files. As this style of dynamic loading allows building complex systems from small components incrementally, we will use the term \f2incremental loading\fP. .PP With the advent of 4.0\|BSD in 1980 [Joy 1980], support for incremental loading was added to the system linker and has since been supported by most major UNIX variants: when the \-A option and the name of the base executable are supplied to the linker, linking is performed in a way that the object file produced by the linker can be read into the already running executable. The symbol table of the resulting object file is a combination of the symbols defined by the base program and the newly defined symbols added by the linking process, from the object file or from libraries used in linking. Only this newly linked code and data is entered into the resulting object file. The incremental style of dynamic loading is achieved by saving the resulting output file each time the linker is invoked and using this file as the base program for the next incremental loading step, such that both old and new symbols can be referenced. .PP Incremental loading is generally supported by the linkers of UNIX versions that use the BSD-style a.out format and by those of several UNIX systems based on more modern a.out formats (e.\|g.\& Ultrix). It is not supported by any existing release of UNIX System V. Some newer UNIX versions that have shared libraries and dynamic linking (such as System V Release 4 or SunOS) offer a library interface to the dynamic linker. In some systems this kind of interface is intended to replace the incremental loading functionality of the system linker. These dynamic linker interfaces usually come in the form of a library that exports functions such as \f2dlopen()\fP to map a shared object module or shared library into the address space of the caller (the base program) and \f2dlsym()\fP to obtain the address of a function or data item in the newly attached object module. .PP In some implementations, object files attached through \f2dlopen()\fP may directly reference symbols in the base program; in other implementations they may not. In any case, object files cannot directly reference symbols defined by objects that have been placed into the program by previous calls to \f2dlopen()\fP (only, if at all, indirectly by calling \f2dlsym()\fP). Thus, these dynamic linker interfaces are clearly inferior to incremental loading, as they lack the important capability to load a set of object files \f2incrementally\fP. Many vendors who have replaced ``/bin/ld \-A'' by a \f2dlopen\fP-style library in their UNIX systems, or who intend to do so, do not seem to be aware of the fact that this change will break applications that rely on incremental loading. .PP For \*E, the consequence of being restricted to dynamic linker interfaces of that kind is that, except for the simplest applications, one must pre-link all possible combinations of extensions that are not completely independent of each other. In general, given a set of \f2n\fP extensions each of which can be based on one out of \f2m\fP other extensions, this means having to prepare and keep around \f2n\|\(mu\|m\fP pre-linked object files; not to mention the contortions one has to go through when the hierarchy of extensions has a depth greater than two (not an unlikely scenario in practice). If the number of extensions and relations between them is larger than trivial, or if the extensions are large or require large libraries, keeping around all pre-linked combinations of object modules will cause a maintenance problem and may waste a considerable amount of disk space. .PP Another, although minor, problem with these dynamic linker interfaces is that they usually offer only a simple-minded function (such as \f2dlsym()\fP) to look up the address of a specific symbol of a newly accessed object module (typically some kind of module initialization function); but they do not provide a way to scan all newly defined symbols. This functionality is insufficient to implement extension initialization in \*E, where a dynamically loadable extension often is composed from a number of small modules, each defining its own initialization function. Requiring a single, common initialization function name for the entire object file implies that (often configuration-dependent) ``glue code'' must be added to call all the individual initialization functions, including the C++ static constructors. .PP Version 2.2 of \*E supports dynamic loading in environments with ``ld\|\|\-A'' (such as BSD, SunOS 4, Ultrix, and certain versions of SGI Irix and HP-UX), in HP-UX 9 (based on \f2shl_load\fP), and in MACH/NeXT-OS (\f2rld_load\fP). By generating shared objects on the fly, System V Release 4 and SunOS 5 (Solaris 2) are also supported, although in a limited and not yet satisfactory way. .P Non-Standard Language Features .PP As the current version of the Scheme standard (deliberately) does not specify several important language issues, such as error handling or syntactic extensions, we have added a number of non-standard language features to the Scheme interpreter of \*E to fill some of the holes. .PP A proposal for a macro extension has only recently been added as an addendum to the \f2Revised\*(^4 Report on the Algorithmic Language Scheme\fP [Clinger et al. 1991] and is still being discussed controversially within the Scheme community. To avoid having to wait for a final version of a macro system to evolve and be included in the Scheme standard, we implemented a simple-minded macro mechanism in \*E that resembles the macro facilities offered by various existing Scheme and Lisp systems. .PP One area where the Scheme standard does not specify any language features yet is error and exception handling; the standard merely states which error situations a conforming implementation is required to detect and report. Since it is essential for a non-trivial application to be able to gracefully handle error situations (such as failures in interactions with the operating system) and other exceptional conditions, we have added a simple error and exception handling facility to \*E. .PP When an error is detected by the interpreter, a user-supplied error handling procedure is invoked with arguments identifying the type and source of the error. The standard interactive environment (top-level) of \*E provides a default error handler that prints an error message and then resumes the main read-eval-print loop by means of a \f2reset\fP primitive. Most primitives of \*E and the extensions use this error handling facility to signal an error, as opposed to indicating failure by a distinctive return value (which would be prone to being ignored). To by-pass the standard error handler and ``catch'' failure of a particular primitive, programs may enclose the call to the primitive by \f2call-with-current-continuation\fP and dynamically bind the error handler to the continuation (as shown in listing @L(errset)). .Ls .Ss (define (open-input-file-or-not name) (call-with-current-continuation (lambda (return) ; \f6return\fP becomes escape procedure (fluid-let ((error-handler ; rebind \f6error-handler\fP (lambda args (return #f)))) (open-input-file name))))) .Se .Lc "A version of open-input-file that returns the newly opened port \ on success, #f on error" .Le errset .PP \*E provides a similar facility to handle an \f2interrupt\fP exception: a user-supplied interrupt handler is invoked when a SIGINT signal is sent to the interpreter (usually by typing the interrupt character on the keyboard). Support for other exceptions, such as timer interrupts, may be provided in future versions. .PP Another non-standard primitive that facilitates handling of errors is \f2dynamic-wind\fP, a generalization of the \f2unwind-protect\fP form offered by many Lisp dialects. \f2dynamic-wind\fP is used to implement the \f2fluid-let\fP special form (to create \f2fluid\fP or dynamic variable bindings). Both \f2dynamic-wind\fP and \f2fluid-let\fP are also provided by several other Scheme dialects [MIT 1984, Dybvig 1987]. .PP The current version of the Scheme standard does not provide any language features that would make it possible to implement a useful Scheme debugger (apart from a debugger based on source code instrumentation). To compensate for this shortcoming, we have added a few primitives that aid the implementation of a simple interactive debugger, among them an \f2eval\fP primitive (although, in theory, \f2eval\fP could be implemented by writing an expression into a temporary file and then loading this file). In addition, \*E, like a few other Scheme dialects, provides lexical environments as first class (but immutable) objects. Other non-standard primitives that aid writing debuggers are \f2procedure-lambda\fP to obtain the lambda expression that evaluated to a given procedure, and a primitive that returns the list of currently active procedures together with their actual arguments and the lexical environments in which the procedure calls took place (a \f2backtrace\fP). .\" .\" provide, require; autoloading .P Garbage Collection .PP The garbage collector of \*E is based on the \f2stop-and-copy\fP algorithm (see e.\|g. [Abelson et al. 1985]). The heap area is divided into two \f2semispaces\fP, only one of which is active during normal operation. In a garbage collection, all objects that are still reachable are moved into the unused semispace; the previously used semispace then remains unused until the next garbage collection. An incremental, generational garbage collector for \*E, inspired by Yip's garbage collector [Yip 1991], has recently been implemented as an alternative to the stop-and-copy garbage collector\**. .FS With a generational garbage collector, objects surviving garbage collections will not be touched again until there is only a certain amount of memory left on the heap, triggering a full garbage collection. Particularly in applications with large amounts of Scheme code or other constant data, partial GCs run much faster than full GCs. With incremental garbage collection, starting a garbage collection does not suspend the application until the GC is done; instead, the collector returns control to the application almost immediately (after having marked pages of interest unreadable with the \f2mprotect\fP system call) and regains control with a SIGSEGV signal. .FE .PP Extensions to \*E can register \f2before-GC\fP and \f2after-GC\fP functions with the interpreter; these functions are invoked by the garbage collector immediately before and after each garbage collection run. Within \f2after-GC\fP functions, extensions can determine whether a particular Scheme object has become garbage, i.\|e. no references to the object exist any longer. In this case, an extension may perform some kind of clean-up action; for example, if the now unreferenced object contains a handle to an open file, close this file. .PP The \*E distribution contains a library based on this mechanism that enables extensions to register a \f2termination function\fP for objects of a particular type. The termination function associated with an object is then invoked by the garbage collector automatically when this object has been detected to be unused. The Xlib extension of \*E uses this library to perform suitable finalization operations on objects created by the extensions, for example, close windows, unload fonts, and free colormap objects that have become unreferenced. This mechanism is slightly complicated by the fact that objects may have to be terminated in a predefined order; for instance, when an X11 display becomes garbage, all objects associated with this display must be terminated before the display itself is finally closed. .P Library Extensions .PP The problems we encountered when designing and implementing \*E's interfaces to the C libraries of X11 are likely to apply to a wide range of similar APIs. The X11 libraries, especially Xlib, are quite complex; the core Xlib alone exports more than 600 functions and macros, with numerous different mechanisms for passing arguments and for manipulating objects, some of which could be considered rather verbose and error-prone. This complexity is, at least partly, caused by the semantic restrictiveness of the C programming language. Thus, when designing the Scheme language interface, we had the opportunity to eliminate some of the ``warts.'' .PP If integration of a library with an extension language (or interactive language in general) is not anticipated at the time the programmer's interface of the library is designed, writing a properly functioning extension language interface to this library can become rather challenging or even impossible. This problem is exemplified by the ``Xt'' toolkit intrinsics library of X11, in particular by earlier versions of this library. The following example illustrates a typical difficulty caused by the ``static'' nature of the programmer's interface to ``Xt'': .PP Each class of graphical objects (\f2widgets\fP in ``Xt'' terminology) exports a list of attributes (\f2resources\fP) that are associated with objects of this class. A function is provided by ``Xt'' to obtain the list of resources of a widget class together with the name and C type (integer, string, pixmap, color, etc.) of each resource. On this basis, operations like setting the value of a widget's resource from within Scheme can be implemented in a straightforward way. The ``Xt'' extension just has to check if the user-supplied Scheme value can be converted into a C object of the resource's type, perform this conversion, and call the Xt-function to set the resource, or complain to the user if the value is not suitable for this resource. However, in early versions of Xt, some classes of widgets had a subset of resources (the \f2constraint resources\fP) whose names and types could not be obtained by an ``Xt'' application. While this omission was usually not perceived as a problem for C programmers (who would know each widget's resources \f2a priori\fP from reading the documentation), it had a dramatic effect on \*E's ``Xt'' extension, as now the knowledge about these resources had to be hard-wired into the extension. As a result, the extension's source code had to be modified for each new widget set to be made usable from within Scheme code. .PP This particular problem has been remedied in recent releases of X11, though several similar problems remain; even in the UNIX C library. While design flaws of library interfaces often go unnoticed or are considered minor when writing C or C++ programs (e.\|g.\& the fact that implementations of the \f2qsort()\fP functions are non-reentrant), they become crucial when these libraries are made accessible to an extension language. As the importance of extension languages is growing, it is essential that future library interfaces are designed with the particular requirements of extensions languages in mind. .PP .\" automatic generation of interfaces / foreign functions .NH Practical Experiences with \*E .P \*E and ISOTEXT .PP In developing the document processing system ISOTEXT, \*E proved to be a major asset [Bormann 1991]. Scheme was used as the implementation language for all user interface aspects of ISOTEXT. Apart from providing extensibility to users of ISOTEXT, using \*E as the base for ISOTEXT made it possible to write the shell code in a high level language with all its amenities, e.\|g.\& automatic storage reclamation. As no recompilation and relinking is necessary, it is a quick operation to apply and test changes to the user interface. .PP \*E provides for a strong ``firewall'' in the ISOTEXT system: bugs in the Scheme code give rise to errors at the Scheme level, which can easily be debugged using the (primitive, but functional) built-in debugger of \*E, while conditions such as core dumps always are the result of bugs in the ISOTEXT kernel implementation. .PP All this assistance for the development of ISOTEXT could be obtained without sacrificing the performance of the ISOTEXT kernel system, which is still written in efficient C++. .PP \*E also allowed us to isolate the ISOTEXT kernel from the choice of an X toolkit: the ISOTEXT kernel is unaware of the toolkit being used (``Xt'' with OSF/Motif). The Scheme code builds a user interface using the Motif library interface and provides X windows to the ISOTEXT kernel. Input is processed by the Scheme code which calls editor primitives provided by the ISOTEXT kernel and schedules redisplay operations. Replacing Xt and OSF/Motif by e.\|g.\& \f2Xview\fP would require no changes in the ISOTEXT kernel. .\".PP .\"As extensions and the \*E kernel are effectively linked together, the .\"current interface between the two allows extensions to call every .\"global function in the \*E kernel. .\"This makes it difficult to rewrite in Scheme primitives that originally .\"were written in C. .PP The work on ISOTEXT clearly identified one single main problem in writing non-trivial extensions: as any request for new heap space can trigger a garbage collection, extensions must register local or temporary Scheme objects with the garbage collector to protect them from being discarded during a GC run caused by any nested procedure call. While this scheme has the advantage that maximum utilization of the available heap space is guaranteed, it imposes a strict discipline on the extension programmer. Failure to properly protect temporary Scheme objects usually results in delayed crashes of the application that are hard to trace back to the actual source of the problem. For instance, when developing the X11 extensions to \*E, most of the time spent for debugging was due to GC-related bugs. .\" Similarly, the following bug in the interpreter kernel went unnoticed for years: .\" .Ss .\" \s+1newframe = Add_Binding(newframe, Car(b), Eval(val));\s0 .\" .Se .\" Depending on the C compiler used, \f2newframe\fP is pushed on the argument .\" stack before \f2Eval\fP, which may trigger a GC, is called. .\" The GC generally moves the object to which \f2newframe\fP points, .\" updating the variable \f2newframe\fP, but not the copy .\" on the argument stack, which is now a dangling reference. .\" When the GNU C compiler uncovered this problem, the line was changed to .\" the proper: .\" .Ss .\" \s+1temp = Eval(val);\s0 .\" \s+1newframe = Add_Binding(newframe, Car(b), temp);\s0 .\" .Se .\" .\"(cabo: recruiting problems) .P \*E and TELES.VISION .PP Another example for using Elk and its X interface as the basis for a user interface subsystem is the TELES.VISION desktop video conferencing system [TELES 1991]. First, a somewhat generalized User Interface Management System was built in about 1500 lines of Scheme, which was then instantiated to build a number of revisions of the TELES.VISION user interface. The user interface communicates with the rest of the conferencing system via a remote procedure call C library, using Scheme continuations as a basis for a simple form of multithreading. According to the TELES.VISION implementors [Bastian 1993], Elk was a ``perfect fit'' for this application, with the single exception that its initial garbage collector placed too heavy a burden on the memory starved initial environment (where 8 MB of memory had to be shared between an operating system, various realtime device drivers, drivers for video codec hardware, and an MS-Windows emulation subsystem). This has since been remedied by adding memory. Using Elk also helped when TELES.VISION was ported to OS/2 \*- in particular, its continuations ported easily. Also, Elk was used in the TELES.VISION project to build a rapid prototype of the central conference management subsystem (again using continuations to provide multithreading) within less than two weeks. .P Other Projects .PP While \*E has been used in the ISOTEXT project since 1987, legal issues prevented making it publicly available until the fall of 1989. Since, \*E has gained acceptance, in fact sufficient momentum to encourage others to contribute software. Elk has been used successfully as an extension language for a hypertext database, a distributed version management system, various CAD programs, testing and simulation systems for digital circuits as well as environmental models. It also has found use simply as a Scheme programming environment, in particular for its X and Motif interface. .PP The X extensions have proven useful in particular for writers of applications with graphical user interfaces based on X; \*E enables them to write their user interfaces or parts thereof in Scheme to achieve a high degree of customizability. .PP \*E also has found use as a free-standing Scheme implementation. In combination with the X extensions it is well-suited for teaching X to beginners, as a tool for interactively exploring X, and as a platform for rapid prototyping of X-based applications. .PP Outside of the UNIX world, we are aware of user-done ports to DOS (both 16 bit and 32 bit using DJGPP), OS/2, and MacOS. .PP Users cited the following features as significant for their choice of Elk: dynamic object code loading, dumping of ready-to-run executables, Elk's performance, its legally unencumbered availability, and finally its simplicity and adaptability (and, as users say, its consistent, clean and well-structured code). .PP Users are not happy with various artificial limitations still in the system (such as the static heap size which with the stop-and-copy garbage collector needs to be fixed at invocation time), with Elk's performance, and with the fact that Elk ``likes to be in control'' (i.e.\&, supplies the main program). In addition, prospective users tend to ponder acceptance problems with their fellow workers and customers (who might not be well versed in Lisp/Scheme) before committing to Elk. Finally, for many extension language applications, Elk is ``too big'', and users have asked for versions without the more expensive Elk features such as arbitrary size number support or continuations. On the other hand, users have asked for additional features such as an inter-process communication interface, or a better debugger. Also, a port to MS-Windows has been actively sought. .NH Conclusions .PP Since the \*E project began, both the research community and significant industry projects have generated increasing numbers of ``embeddable language'' implementations. While many such languages inherit the syntactic flavor of BASIC, those projects that focus on the ability to build non-trivial extensions recently seem to almost exclusively turn to the Scheme language. .PP Scheme has proven to be an effective language for extension language purposes. In the beginning of the ISOTEXT project, there were concerns that an implementation of the full Scheme language would be both too large and too slow. These reservations proved to be unfounded: the binary code size of \*E is still significantly below that of a medium size application such as \f2vi\fP. While the performance of \*E may be uninspiring (no compiler is available), this turned out not to be a critical issue, as any bottlenecks can easily be replaced by a primitive recoded in C or C++. .PP There also were concerns that Scheme was going to be hard to learn for UNIX users familiar with, say, the Bourne Shell and C. This seems to be more of a problem with initial acceptance than with a steep learning curve: after having overcome the initial barrier (which generally had to do mainly with perceiving the syntax as queer), users reported the same rapid increase in productivity they already knew from shell programming. It certainly has not been necessary to recruit Lisp programmers to be able to extend applications with \*E. .PP .ds Tx "T\v'.2m'E\v'-.2m'X Finally, \*E was an exercise in writing portable software without being restricted to what is considered portable today. Apart from the well-known problem that true portability between current relevant platforms cannot be attained by just picking one of the proclaimed ``standards'', and the unwieldy situation that there are too many standards for (auto-)configuration of software, a significant part of the effort in generating \*E was consumed by devising support for each new platform for dynamic loading, generation of executables from running programs, and switching between threads of control (continuations). Note that many non-trivial applications of today (apart from Lisp programming environments, GNU emacs and \*(Tx come to mind) need one or more of these features; also note that most relevant current platforms can be made to support these features quite well \*- just in wildly different ways. .NH Availability .PP \*E is available in legally unencumbered status. The current version as of June 1994 is 2.2. The most recent version of \*E is available via anonymous FTP from ftp.x.org (/contrib) and ftp.fu-berlin.de (/pub/unix/languages/scheme). .NH Acknowledgments .PP An early version of \*E was written while one of us was employed at TELES GmbH, Berlin. We are grateful to Prof.\& Dr.\& Sigram Schindler of TELES and TU Berlin for providing the work environment for ISOTEXT and \*E and for the permission to publish this software. .PP The present version is a result of our research work at Technische Universit\(a:t Berlin, with the benefit of the work of many contributors. In particular, we wish to thank Marco Scheibe who wrote the generational, incremental garbage collector. .NH References .IP "[Abelson et al. 1985] Harold Abelson and Gerald J. Sussman with Julie Sussman, \f2Structure and Interpretation of Computer Programs\fP, MIT Press, Cambridge, Mass., 1985. .\" .IP "[Bastian 1993]" Personal communication with Jan Bastian, TELES. .\" .IP "[Bormann et al. 1988] Ute Bormann, Carsten Bormann, C. Bathe, SDE \*- A WYSIWYG Editing and Formatting System for ODA and SGML Documents, ESPRIT '88, \f2Proceedings of the 5th Annual ESPRIT Conference, Brussels\fP, November 14-17, 1988. .\" .IP "[Bormann 1991]" Carsten Bormann, Open Document Processing and the ISOTEXT System, Doctoral Dissertation, TU-Berlin, 1991. .\" .IP "[CFI 1991a]" CAD Framework Initiative, CFI Extension Language Sub-Committee, \f2CFI Extension Language Selection Document\fP, CFI Document Number 87, CAD Framework Initiative Inc., Austin, Texas, 1991. .\" .IP "[CFI 1991b]" CAD Framework Initiative, Extension Language Working Group: Architecture Technical Sub-Committee, \f2Extension Language: Core Language Selection\fP, Draft Proposal Version 0.7, CFI Document Number ARCH-91-G-1, CAD Framework Initiative Inc., Austin, Texas, 1991. .\" .IP "[Clinger et al. 1991]" William Clinger and Jonathan Rees (Editors), \f2Revised\*(^4 Report on the Algorithmic Language Scheme\fP, November 2, 1991. Available as ftp://cs.indiana.edu/pub/scheme-repository/doc/r4rs.ps.Z. .\" .IP "[CLX 1991]" CLX \*- Common LISP X Interface, 1991. (Part of the X11 Release 5 distribution available from the MIT software distribution center.) .IP "[Cowlishaw 1985]" M. F. Cowlishaw, \f2The REXX Language \*- A Practical Approach to Programming\fP Prentice Hall, Englewood Cliffs, NJ, 1985. .\" .IP "[Dybvig 1987]" R. Kent Dybvig, \f2The Scheme Programming Language\fP, Prentice Hall, Englewood Cliffs, NJ, 1987. .\" .IP "[Hansen 1990]" Wilfred J. Hansen, Enhancing documents with embedded programs: How Ness extends insets in the Andrew ToolKit, \f2Proceedings of IEEE Computer Society 1990 International Conference on Computer Languages\fP, March 12-15, 1990, New Orleans. .\" .IP "[IEEE\|Std\|1178-1990]" \f2IEEE Standard for the Scheme Programming Language\fP, New York, May 28, 1991 (approved December 10, 1990). .\" .IP "[Joy 1980]" Bill Joy, Changes in the VAX system in the Fourth Berkeley Distribution, Computer Systems Research Group, University of California, Berkeley, November 1980. .\" .IP "[Lewis et al. 1990]" Bil Lewis, Dan LaLiberte, the GNU Manual Group, GNU Emacs Lisp Reference Manual, Edition 1.03, Free Software Foundation, Cambridge, Mass., December 1990. .\" .IP "[MIT 1984]" MIT Scheme Manual, Seventh Edition, Department of Electrical Engineering and Computer Science, Massachusetts Institute of Technology, Cambridge, Mass., September 1984. .\" .IP "[Ossanna 1979]" J. F. Ossanna, Nroff/Troff User's Manual, UNIX Programmer's Manual, Seventh Edition, vol. 2, Bell Telephone Laboratories, Murray Hill, NJ, January 1979. .\" .IP "[Ousterhout 1990]" John K. Ousterhout, Tcl: An Embeddable Command Language, \f2Proceedings of the USENIX 1990 Winter Conference\fP, January 1990, pp. 133-146. .\" .IP "[Scheifler et al. 1986]" Robert W. Scheifler and Jim Gettys, The X Window System, \f2ACM Transactions on Graphics\fP, vol. 5, no. 2, pp. 79-109, 1986. .\" .IP "[Scheifler et al. 1992]" Robert Scheifler and James Gettys, \f2X Window System\fP, Third Edition, Digital Press, 1992. .\" .IP "[Springer et al. 1989]" George Springer and Daniel O. Friedman, \f2Scheme and the Art of Programming\fP, MIT Press, Cambridge, Mass., 1989. .\" .IP "[Stallman 1981]" Richard M. Stallman, EMACS \*- The Extensible, Customizable, Self-documenting Display Editor Production System, \f2SIGPLAN Notices\fP, vol. 16, no. 6, pp. 147-156, Association for Computing Machinery, New York, 1981. .\" .IP "[TELES 1991] Das TELES.VISION System \*- Philosophie und Technologie, TELES GmbH, Berlin, 1991 (in German). .\" .IP "[Yip 1991]" G. May Yip, Incremental, Generational Mostly-Copying Garbage Collection in Uncooperative Environments, WRL Research Report 91/8, DEC Western Research Laboratory, Palo Alto, California, 1991. .ie \n(.U \{\ .NH S A Appendix: Extending \*E \*- An Example .\} .el \{\ .bp .SH .nr H1 1 .af H1 A Appendix A: Extending \*E \*- An Example .\} .P The ``ndbm'' Library Extension .PP The extensibility mechanisms of \*E can be demonstrated best by examining a simple library extension. Consider the \f2ndbm\fP library that is available on most versions of UNIX. This library implements functions to maintain a simple database file of key/contents pairs. .PP As shown in Listing @L(ndbm), both the keys and the data to be stored are described by the type \f2datum\fP; it consists of the data (a string of bytes) and the length of the data. \f2dbm_open()\fP opens a database file and returns a handle to that file to be used in subsequent operations on that database (a pointer to an opaque data type, similar to the \f2fopen\fP and \f2readdir\fP interfaces); it returns a null pointer if the file could not be opened. A database is closed by a call to \f2dbm_close()\fP. The data stored under a given key is accessed by the function \f2dbm_fetch()\fP; it returns an object of type \f2datum\fP (with a null \f2dptr\fP if the key could not be found). \f2dbm_store\fP is used to insert an entry into a database and to modify an existing entry; it returns zero on success and a non-zero value on error. .Ls .Ss #include .Sl .Sl typedef struct { char *dptr; int dsize; } datum; .Sl .Sl DBM *dbm_open(char *file, int flags, int mode); .Sl void dbm_close(DBM *db); .Sl datum dbm_fetch(DBM *db, datum key); .Sl int dbm_store(DBM *db, datum key, datum data, int flags); .Se .Lc "The UNIX \f2ndbm\fP library" .Ns \f2Note:\fP For simplicity, several functions have been omitted. The \f2flags\fP and \f2mode\fP arguments of \f2dbm_open\fP are that of the \f2open\fP system call. The \f2flags\fP argument of \f2dbm_store\fP can be DBM_INSERT to insert a new entry into the database or DBM_REPLACE to change an existing entry. .Ne .Le ndbm .PP The straightforward way to write an \f2ndbm\fP extension to \*E is to provide a new Scheme data type \f2dbm-file\fP together with the obligatory type predicate \f2dbm-file?\fP and the Scheme primitive procedures \f2dbm-open\fP, \f2dbm-close\fP, \f2dbm-fetch\fP and \f2dbm-store\fP that operate on objects of type \f2dbm-file\fP. .PP \f2dbm-open\fP receives the filename (a string or a symbol); the second argument is one of the symbols \f2reader\fP (open the file read-only), \f2writer\fP (read and write access), and \f2create\fP (read and write access, create new file if it does not exist). The optional filemode argument is an integer. \f2dbm-open\fP returns an object of type \f2dbm-file\fP or #f (false) if the file could not be opened. \f2dbm-close\fP closes the database file associated with its argument of type \f2dbm-file\fP. As this function is called for its side-effect only, and for lack of a better result, it returns a non-printing object. .PP \f2dbm-fetch\fP expects a \f2dbm-file\fP and a string argument (the key to be searched) and returns a string (the data stored under the key) or #f if the key does not exist. Note that in \*E strings may contain arbitrary 8-bit characters, including the null byte. \f2dbm-store\fP is called with a \f2dbm-file\fP, two strings (key and data) and one of the symbols \f2insert\fP and \f2replace\fP. Its integer return value is the return value of \f2dbm_store()\fP. .PP These procedures and the new \f2dbm-file\fP type can be used by application programmers to manipulate database files in those parts of their applications that are written in Scheme. Listing @L(ndbm-example) shows a small example. .Ls .Ss (define expand-mail-alias (lambda (alias) (let ((d (dbm-open "/etc/aliases" 'reader))) (if (not d) (error 'expand-mail-alias "cannot open database")) (unwind-protect (dbm-fetch d alias) (dbm-close d))))) .Sl (define address-of-staff (expand-mail-alias "staff")) .Se .Lc "Using the ndbm extension" .Ns \f2Note:\fP The \f2unwind-protect\fP and the \f2error\fP form are not present in standard Scheme. .Ne .Le ndbm-example .P The Anatomy of a Scheme Type .PP Listing @L(ndbm-skeleton) shows the part of the extension that deals with the new data type \f2dbm-file\fP and the extension initialization function. The variable \f2T_Dbm\fP will hold the unique identifier of the newly defined type. The structure \f2S_Dbm\fP defines the C representation of the type; one such C structure is declared for each composite Scheme type. Its main component is the handle of the database file that is contained in each object of type \f2dbm-file\fP. .Ls .Ss #include #include .Sl int T_Dbm; .Sl struct S_Dbm { DBM *dbm; char alive; /* 0 or 1 */ }; .Sl #define DBMF(obj) ((struct S_Dbm *)POINTER(obj)) .Sl int Dbm_Equal(a, b) Object a, b; { return DBMF(a)->alive && DBMF(b)->alive && DBMF(a)->dbm == DBMF(b)->dbm; } .Sl void Dbm_Print(d, port) Object d, port; { Printf(port, "#[dbm-file %lu]", DBMF(d)->dbm); } .Sl Object P_Is_Dbm(x) Object x; { return TYPE(x) == T_Dbm ? True : False; } .Sl void elk_init_dbm() { Define_Primitive(P_Is_Dbm, "dbm-file?", 1, 1, EVAL); Define_Primitive(P_Dbm_Open, "dbm-open", 2, 3, VARARGS); Define_Primitive(P_Dbm_Close, "dbm-close", 1, 1, EVAL); Define_Primitive(P_Dbm_Store, "dbm-store", 4, 4, EVAL); Define_Primitive(P_Dbm_Fetch, "dbm-fetch", 2, 2, EVAL); .Sl T_Dbm = Define_Type("dbm-file", sizeof(struct S_Dbm), Dbm_Equal, Dbm_Equal, Dbm_Print, NOFUNC); } .Se .Lc "Skeleton of the ndbm extension" .Ns \f2Note:\fP For simplicity some details have been omitted in this listing, and the calling interface of some functions has been simplified; the program would not compile in this form. A working \f2gdbm\fP (GNU dbm) extension is included in the \*E distribution. .Ne .Le ndbm-skeleton .PP Scheme objects can usually live longer than their underlying C objects. In case of the \f2dbm-file\fP type, a Scheme object of that type can obviously still be referenced after its database handle has been closed by a call to \f2dbm-close\fP. As \*E extensions must not crash the application, we must prevent such stale objects from being used in further calls to \f2dbm-fetch\fP, \f2dbm-store\fP, and \f2dbm-close\fP. One way to achieve this is to record in each Scheme object whether the underlying C object is still alive or has been terminated. The boolean component \f2alive\fP in the \f2dbm-file\fP type serves this purpose. It is initialized with true and is set to false in \f2dbm-close\fP. Further operations on objects with \f2alive\fP being false are rejected. .PP The interpreter stores all Scheme objects in variables of type \f2Object\fP. An \f2Object\fP is typically a 32-bit value; it is composed of a \f2tag\fP part and a \f2pointer\fP part. The \f2tag\fP part indicates the type of the object, and the remaining bits hold the actual memory address of the object (they point into the interpreter's heap). The macros \f2TYPE\fP and \f2POINTER\fP are provided to extract the fields of an \f2Object\fP. Each type definition must define a macro to extract the object's memory address from an \f2Object\fP (by means of \f2POINTER\fP) and then cast it into a pointer to the underlying C structure (see \f2#define DBMF\fP in Listing @L(ndbm-skeleton)). .PP \f2Dbm_Equal()\fP implements both the \f2eqv?\fP and the \f2equal?\fP predicates for \f2dbm-file\fP objects; it returns true if both objects being compared are alive and contain identical \f2DBM\fP handles. .PP \f2Dbm_Print()\fP is called by the interpreter each time an object of type \f2dbm-file\fP is to be printed; it is invoked with the object and the Scheme port to which the output is to be sent. .PP \f2P_Is_Dbm()\fP implements the primitive procedure \f2dbm-file?\fP (the type predicate). As with all primitives, it receives arguments of type \f2Object\fP and returns an \f2Object\fP, and it has a name beginning with ``P_''. .PP The definition of the initialization function \f2elk_init_dbm()\fP is straightforward; it invokes \f2Define_Primitive()\fP once for each primitive procedure and finally \f2Define_Type()\fP to make the new type known to the interpreter. .PP The arguments that can be supplied to \f2Define_Primitive()\fP are a pointer to the function implementing the primitive procedure, the Scheme name of the primitive, the minimum and maximum number of arguments, and a symbol indicating the \f2calling discipline\fP of the primitive. For most of the functions in this example, the calling discipline is \f2EVAL\fP, indicating a normal procedure with a fixed number of arguments, such as \f2car\fP. Elk also supports procedures with variable argument list, such as \f2list\fP (\f2VARARGS\fP); and \f2NOEVAL\fP for \f2special forms\fP (variable number of unevaluated arguments). .PP \f2Define_Type()\fP is invoked with the Scheme name of the type, the size of the type's representation in C or C++ (given as a constant or as a function), two functions implementing the \f2eqv?\fP and \f2equal?\fP predicates for objects of this type, a function that is called by the interpreter to print an object of the new type (the type's \f2print function\fP), and a function providing information about the type to the garbage collector. The return value of \f2Define_Type()\fP is a ``handle'' to the newly defined type (a small, unique integer); its main uses are to check the type of arguments supplied to primitive procedures and to instantiate objects of this type. .P Primitive Procedures \*- The Details .PP Listing @L(dbm-open) gives the definitions of the primitives \f2dbm-open\fP and \f2dbm-close\fP. .Ls .Ss static SYMDESCR Flag_Syms[] = { { "reader", O_RDONLY }, { "writer", O_RDWR }, { "create", O_RDWR|O_CREAT }, { 0, 0 } }; .Sl Object P_Dbm_Open(argc, argv) int argc; Object *argv; { char *p; DBM *dp; Object d; .Sl Make_C_String(argv[0], p); dp = dbm_open(p, Symbols_To_Bits(argv[1], 0, Flag_Syms), argc == 3 ? Get_Integer(argv[2]) : 0666); if (dp == 0) return False; d = Alloc_Object(sizeof(struct S_Dbm), T_Dbm, 0); DBMF(d)->dbm = dp; DBMF(d)->alive = 1; return d; } .Sl void Check_Dbm(d) Object d; { Check_Type(d, T_Dbm); if (!DBMF(d)->alive) Primitive_Error("invalid dbm-file: ~s", d); } .Sl Object P_Dbm_Close(d) Object d; { Check_Dbm(d); DBMF(d)->alive = 0; dbm_close(DBMF(d)->dbm); return Void; } .Se .Lc "ndbm extension \*- implementation of \f2dbm-open\fP and \f2dbm-close\fP .Le dbm-open .PP \f2dbm-open\fP, as it has an optional argument, is a function with \f2VARARGS\fP calling discipline (not to be confused with the C language feature of the same name), as indicated by the last argument to the \f2Define_Primitive\fP call. Primitives of this type receive an array of \f2Objects\fP and a count. .PP The initial call to the macro \f2Make_C_String\fP checks if the first argument to \f2dbm-open\fP is a string (or a symbol) and converts it to a C string. To obtain the second argument to \f2dbm_open()\fP, the symbol passed to the Scheme primitive (\f2reader\fP, \f2writer\fP, etc.) has to be mapped to a corresponding flags combination (\f2O_RDONLY\fP, \f2O_RDWR\fP, etc.). This is accomplished by the \*E function \f2Symbols_To_Bits()\fP; it is invoked with a Scheme symbol, a flag indicating whether a single symbol or a list of symbols (a mask) is to be converted, and a table of pairs of symbol names and C integers. The third argument to \f2dbm_open\fP is the filemode; \f2Get_Integer()\fP converts a Scheme number to a C integer. \f2dbm-open\fP finally allocates a new Scheme object of type \f2T_Dbm\fP on the heap, initializes the components of the object, and returns it. .PP The auxiliary function \f2Check_Dbm()\fP is used by the remaining primitives to check whether a given object is of type \f2dbm-file\fP and if so, whether it is stale. In this case an error is signaled; \f2Primitive_Error()\fP enters the error handler of \*E. .PP \f2P_Dbm_Close()\fP just marks the object as stale by setting \f2alive\fP to false and closes the database file. .PP Listing @L(dbm-store) shows the implementation of \f2dbm-store\fP and \f2dbm-fetch\fP. \f2Make_Integer()\fP is the counterpart to \f2Get_Integer()\fP; it converts a C integer into a Scheme number. Likewise, \f2Make_String()\fP converts a C string into a Scheme string. .bp .Ls .Ss static SYMDESCR Store_Syms[] = { { "insert", DBM_INSERT }, { "replace", DBM_REPLACE }, { 0, 0 } }; .Sl Object P_Dbm_Store(d, key, content, flag) Object d, key, content, flag; { datum k, c; int result; .Sl Check_Dbm(d); Check_Type(key, T_String); Check_Type(content, T_String); k.dptr = STRING(key)->data; k.dsize = STRING(key)->size; c.dptr = STRING(content)->data; c.dsize = STRING(content)->size; result = dbm_store(DBMF(d)->dbm, k, c, Symbols_To_Bits(flag, 0, Store_Syms)); return Make_Integer(result); } .Sl Object P_Dbm_Fetch(d, key) Object d, key; { datum k, c; .Sl Check_Dbm(d); Check_Type(key, T_String); k.dptr = STRING(key)->data; k.dsize = STRING(key)->size; c = dbm_fetch(DBMF(d)->dbm, k); return c.dptr ? Make_String(c.dptr, c.dsize) : False; } .Se .Lc "ndbm extension \*- implementation of \f2dbm-store\fP and \f2dbm-fetch\fP .Le dbm-store .\" ---------- .\" Erwaehnen: Little Languages .\" ---------- .\" Read the CFI papers again elk-3.99.8/doc/usenix/Makefile.am0000644000175000017500000000067411577076306013457 00000000000000EXTRA_DIST = usenix.ms CLEANFILES = tmp.ref usenix.ps if HAVE_GROFF docs_DATA = usenix.ps docsdir = $(datadir)/doc/@PACKAGE@/ps endif MANUAL = $(srcdir)/usenix.ms TROFF = groff -ms UNROFF = unroff -ms usenix.ps: $(MANUAL) tmp.ref sed -f tmp.ref $(MANUAL) | $(TROFF) 2> /dev/null > usenix.ps usenix.html: $(MANUAL) tmp.ref sed -f tmp.ref $(MANUAL) | $(UNROFF) document=usenix tmp.ref: $(MANUAL) $(TROFF) $(MANUAL) 2> tmp.ref >/dev/null elk-3.99.8/doc/unix/0000755000175000017500000000000011577110020011122 500000000000000elk-3.99.8/doc/unix/unix.ms0000644000175000017500000013613611577076306012422 00000000000000.so ../util/tmac.scheme .Ul .TL Reference Manual for the .sp .5 Elk UNIX Extension .AU Oliver Laumann . .Ch "Introduction" . .PP This reference manual describes the primitive procedures and record types defined by the UNIX extension to Elk. .PP The UNIX extension provides easy access to most widely available UNIX system calls and C library functions from within Scheme programs. The extension supports a wide range of different UNIX platforms without restricting its functionality to the lowest common denominator or the .Ix POSIX POSIX 1003.1 functions. To simplify writing portable Scheme programs, the extension attempts to hide differences between the types of supported UNIX flavors. For example, programmers do not have to deal with the idiosyncrasies of the \f2wait()\fP, \f2waitpid()\fP, \f2wait3()\fP, and \f2wait4()\fP system calls or the \f2mktemp()\fP, \f2tmpnam()\fP, and \f2tempnam()\fP functions. .PP The UNIX extension defines procedures for low-level, file-descriptor-based I/O; creation of pipes; file/record locking; file and directory system calls; process creation and control; signal handling; error handling; and obtaining information about date, time, users, limits, process resources, etc. Terminal control is not yet supported by the current version. .PP The reference manual assumes that you are familiar with the most common UNIX system calls and C library functions; this document does not attempt to duplicate the contents of the standard UNIX documentation. Detailed descriptions are provided for functions that differ from the standard UNIX semantics. . .Ch "Using the UNIX Extension" . .PP The UNIX extension is loaded by evaluating .Ss (require 'unix) .Se in the interactive toplevel or in a Scheme program. .PP This causes the files \f2unix.scm\fP and \f2unix.o\fP to be loaded into the interpreter (\f2unix.o\fP has to be linked with the interpreter on platforms that do not support dynamic loading of object files). In addition, the .Ix "record extension" \f2record\fP extension is automatically loaded if it is not yet present. The record extension is documented in a separate reference manual. .PP Loading the UNIX extension causes the .Ix features features \f2unix\fP and \f2unix.o\fP to be provided. Optionally, one or more of the following features (described below) may be provided by the extension to indicate that certain UNIX features are available: .Ss unix:wait-options unix:wait-process unix:record-locks unix:file-locking unix:symlinks unix:reliable-signals .Se .Ix unix:wait-options .Ix unix:wait-process .Ix unix:record-locks .Ix unix:file-locking .Ix unix:symlinks .Ix unix:reliable-signals . .Ch "Record Types" . .PP Several procedures return their results as Scheme .Ix records records. All record types defined by the UNIX extension are stored in variables with names of the form \f2-record\fP (such as \f2system-record\fP or \f2passwd-record\fP). In addition, a type predicate, a record constructor, and accessor functions .Ix "type predicate" .Ix "record constructor" .Ix "accessor functions" for all record fields are defined for each record type. For example, a \f2system\fP record type with the fields \f2hostname\fP, \f2sysname\fP, and \f2osname\fP is defined, resulting in variable \f2system-record\fP holding the record type descriptor, and the functions .Ss (system-record? obj) (make-system-record) .sp .5 (system-hostname system-record) (system-sysname system-record) (system-osname system-record) .Se Use \f2define-record-modifiers\fP if you need the .Ix "modifier functions" modifier functions for any of the records as well (see the record extension reference manual for details). .LP The following .Ix "record types" record types are defined by the UNIX extension: .sp .5 .KS .TS allbox, tab(~); c c lf5 lf5. Record Type~Fields _ stat~type mode ino dev nlink uid gid size atime mtime ctime time~T{ seconds minutes hours day-of-month month year weekday .br day-of-year dst T} nanotime~nanoseconds minuteswest dst system~hostname sysname osname passwd~name password uid gid gecos homedir shell group~name password gid members resources~user-time system-time (...) lock~exclusive? whence start length wait~pid status code core-dump? resources .TE .KE .Ix stat-record .Ix time-record .Ix nanotime-record .Ix system-record .Ix passwd-record .Ix group-record .Ix resources-record .Ix lock-record .Ix wait-record . .Ch "Error Handling" . .PP The default error behavior of the primitive procedures defined by the UNIX extension is to invoke the standard Scheme .Ix "error handler" error handler if a UNIX system call or library function fails. As an alternative, if a specific error action is to be performed by the application, a primitive procedure can be invoked under control of the .Ix unix-errval \f2unix-errval\fP form. In this case, a unique .Ix "error object" \f2error object\fP is returned if a UNIX function signals an error. The standard UNIX system error message and the UNIX error number are made available to the application in any case. Details of the error handling facilities are described in the section ``Error Functions'' below. . .Ch "Conventions" . .PP In the following sections, the names of procedure arguments can dictate that the arguments are of specific types. If an argument name is also the name of a Scheme data type, the argument must be an object of that type. For example, a procedure with an argument named \f2string\fP must be invoked with a string. File descriptor arguments (named \f2fdescr\fP, or \f2fdescr\*1\fP, \f2fdescr\*2\fP, etc.) and arguments named \f2length\fP are always non-negative integers; filename arguments (\f2filename\fP) are strings or symbols; and arguments with the suffix ``?'' are booleans. . .Ch "Low-Level I/O, File Descriptors" . .Pr unix-close fdescr .LP .Ix close The UNIX \f2close()\fP system call. \f2unix-close\fP returns the non-printing object. . .[[ .Pr unix-dup fdescr .Pr unix-dup fdescr\*1 fdescr\*2 .]] .LP .Ix dup .Ix dup2 \f2unix-dup\fP invokes the \f2dup()\fP (first form) or \f2dup2()\fP (second form) system call. The result is a new file descriptor (an integer). . .[[ .Pr unix-open filename flags .Pr unix-open filename flags mode .]] .LP .Ix open The UNIX \f2open()\fP system call. \f2flags\fP is a list of one or more symbols specifying the bitmask argument of the \f2open()\fP system call. .LP At least the flag symbols \f2read\fP, \f2write\fP, \f2append\fP, \f2create\fP, \f2truncate\fP, and \f2exclusive\fP are supported; additional symbols (such as \f2ndelay\fP) may be permitted on certain platforms. The procedure \f2unix-list-open-modes\fP can be used to obtain the list of flag symbols that are supported (see below). If \f2create\fP is present in the \f2flags\fP argument, the \f2mode\fP argument (an integer) must be supplied. At least one of the symbols \f2read\fP or \f2write\fP must be present in \f2flags\fP. .LP \f2unix-open\fP returns a new file descriptor (an integer). .LP Example: .Ss (let ((f1 (unix-open "/etc/passwd" '(read)) (f2 (unix-open "temp" '(read write create truncate) #o666)))) ...) .Se . .Pr unix-list-open-modes .LP This procedure returns the list of \f2flag\fP symbols for the \f2unix-open\fP procedure that are supported on the local platform. . .Pr unix-lseek fdescr offset whence .LP .Ix lseek The UNIX \f2lseek()\fP system call. \f2offset\fP is an integer; \f2whence\fP is one of the symbols \f2set\fP, \f2current\fP, and \f2end\fP. \f2unix-lseek\fP returns the new file position as an integer. . .Pr unix-pipe .LP .Ix pipe The \f2pipe()\fP system call. \f2unix-pipe\fP returns two file descriptors as a pair of integers. . .[[ .Pr unix-read-string-fill! fdescr string .Pr unix-read-string-fill! fdescr string length .]] .LP .Ix read The \f2read()\fP system call. \f2unix-read-string-fill\fP invokes \f2read()\fP with the Scheme string as input buffer and the length of the string argument (first form) or the length supplied as a third argument (second form). If \f2length\fP is specified, it must be an integer between 0 and the length of \f2string\fP. .LP \f2unix-read-string-fill!\fP destructively overwrites the contents of the \f2string\fP argument. It returns the number of characters actually read (0 on EOF). . .[[ .Pr unix-write fdescr string .Pr unix-write fdescr string length .]] .LP .Ix write The \f2write()\fP system call. For a description of the arguments see \f2unix-read-string-fill!\fP above. \f2unix-write\fP returns the number of characters actually written. . .[[ .Pr unix-close-on-exec fdescr .Pr unix-close-on-exec fdescr on? .]] .LP \f2unix-close-on-exec\fP returns the value of the .Ix close-on-exec \f2close-on-exec\fP flag for the given file descriptor as a boolean. If invoked with a second argument, the procedure sets the \f2close-on-exec\fP flag to the specified value and returns the previous value. . .[[ .Pr unix-filedescriptor-flags fdescr .Pr unix-filedescriptor-flags fdescr flags .]] .LP \f2unix-file-descriptor-flags\fP obtains the flags currently active for the given file descriptor (by means of the .Ix fcntl \f2fcntl()\fP system call) and returns them as a list of symbols. If invoked with a second arguments (a list of symbols), the procedure sets the flags to that argument and returns the previous value. .LP At least the flag symbol \f2append\fP is supported; additional symbols (such as \f2ndelay\fP or \f2sync\fP) may be permitted on certain platforms. The procedure \f2unix-list-filedescriptor-flags\fP can be used to obtain the list of file descriptor flags that are supported (see below). .LP Example: .Ss ;;; Enable non-blocking I/O for file descriptor (assumes POSIX) .sp .4 (define (set-non-blocking fd) (let ((flags (unix-filedescriptor-flags fd))) (unix-filedescriptor-flags fd (cons 'nonblock flags)))) .Se . .Pr unix-list-filedescriptor-flags .LP This procedure returns the list of file descriptor \f2flag\fP symbols that can be returned and set by \f2unix-filedescriptor-flags\fP on the local platform. . .Pr unix-num-filedescriptors .LP \f2unix-num-filedescriptors\fP returns the maximum number of file descriptors per process in the local system. Depending on the UNIX flavor, the procedure invokes .Ix getdtablesize .Ix sysconf \f2getdtablesize()\fP or \f2sysconf()\fP or uses a static (compile-time) limit. . .Pr unix-isatty? fdescr .LP Returns #t if the specified file descriptor points to a terminal device, #f otherwise (the UNIX .Ix isatty \f2isatty()\fP library function). . .Pr unix-ttyname fdescr .LP .Ix ttyname The UNIX \f2ttyname()\fP function. Returns the name of a terminal device as a string, or #f if the file descriptor is not associated with a terminal. . .Pr unix-port-filedescriptor port .LP This procedure returns the file descriptor associated with the .Ix "file pointer" file pointer conveyed in the specified Scheme port. An error is signaled if the port has already been closed or if it is a string port. \f2unix-port-filedescriptor\fP invokes the UNIX .Ix fileno \f2fileno()\fP library function. .LP Manipulating a file descriptor obtained by \f2unix-port-filedescriptor\fP can cause unexpected interactions with the standard Scheme I/O functions and with the stdio buffering mechanism. In particular, it is not a good idea to close the file descriptor associated with the Scheme system's current input port or current output port. .LP Example: .Ss (let ((stdout-fileno (unix-port-filedescriptor (current-output-port)))) (if (unix-isatty? stdout-fileno) (begin (display (unix-ttyname stdout-fileno)) (newline)))) .Se . .Pr unix-filedescriptor\(mi>port fdescr type .LP Creates a Scheme port with a file pointer containing the specified file descriptor. \f2unix-filedescriptor\(mi>port\fP is based on the .Ix fdopen \f2fdopen()\fP stdio function. \f2type\fP is a string and is used as the second argument for \f2fdopen()\fP. .LP The type of the newly created Scheme port is determined by the \f2type\fP argument. If \f2type\fP begins with the character #\\r, an input port is created; #\\w and #\\a indicate an output port. If the second character of \f2type\fP is #\\+ (\f2update\fP), an input-output (bidirectional) port is created. .LP No filename is associated with a Scheme port created by a call to \f2unix-filedescriptor\(mi>port\fP. Instead, the string \f2unix-filedescriptor[%d]\fP (where \f2%d\fP is replaced by the numerical value of the file descriptor) will be returned by calls to \f2port-file-name\fP and displayed when printing the port. .LP Note that the file descriptor is closed by the .Ix "garbage collector" garbage collector when the Scheme port becomes inaccessible. . .Ch "Files and Directories" . .Pr unix-stat file .LP .Ix stat .Ix fstat The UNIX \f2stat()\fP/\f2fstat()\fP system call. \f2file\fP is either a filename or a file descriptor. .LP \f2unix-stat\fP returns a .Ix stat-record \f2stat-record\fP with the following fields: .sp .5 .KS .TS allbox, tab(~); c c c lf5 l l. Field~Type~Contents _ type~symbol~file type mode~integer~file access mode ino~integer~inode number dev~integer~device number nlink~integer~number of links to file uid~integer~file owner's user-ID gid~integer~file owner's group-ID size~integer~file size atime~integer~last access time mtime~integer~last modified time ctime~integer~last inode change time .TE .KE .LP The file type is one of the symbols \f2directory\fP, \f2character-special\fP, \f2block-special\fP, \f2regular\fP, \f2symlink\fP, \f2socket\fP, \f2fifo\fP, or \f2unknown\fP. . .Pr unix-access? filename mode .LP \f2unix-access?\fP is based on the .Ix access \f2access()\fP system call. \f2mode\fP is a list of zero or more of the symbols \f2read\fP, \f2write\fP, and \f2execute\fP. The empty list can be used to test for existence of the file. The procedure returns #t if the specified access is granted, #f otherwise. . .Pr unix-chdir filename .LP .Ix chdir The UNIX \f2chdir()\fP system call. \f2unix-chdir\fP returns the non-printing object. . .Pr unix-chmod filename mode .LP .Ix chmod The UNIX \f2chmod()\fP system call. \f2mode\fP is an integer. \f2unix-chmod\fP returns the non-printing object. . .Pr unix-chown filename uid gid .LP .Ix chown The UNIX \f2chown()\fP system call. \f2uid\fP and \f2gid\fP are integers. \f2unix-chown\fP returns the non-printing object. . .Pr unix-unlink filename .LP .Ix unlink The UNIX \f2unlink()\fP system call. \f2unix-unlink\fP returns the non-printing object. . .Pr unix-link filename\*1 filename\*2 .LP .Ix link The UNIX \f2link()\fP system call. \f2unix-link\fP returns the non-printing object. . .Pr unix-rename filename\*1 filename\*2 .LP .Ix rename The UNIX \f2rename()\fP system call. \f2unix-rename\fP returns the non-printing object. .LP On platforms where the \f2rename()\fP function is not available, the operation is performed by the equivalent sequence of .Ix link .Ix unlink \f2link()\fP and \f2unlink()\fP calls with interrupts disabled (certain restrictions apply in this case, e.\|g.\& directories cannot be renamed). . .Pr unix-mkdir filename mode .LP .Ix mkdir The UNIX \f2mkdir()\fP system call. \f2mode\fP is an integer. \f2unix-mkdir\fP returns the non-printing object. . .Pr unix-rmdir filename .LP .Ix rmdir The UNIX \f2rmdir()\fP system call. \f2unix-rmdir\fP returns the non-printing object. . .[[ .Pr unix-utime filename .Pr unix-utime filename atime mtime .]] .LP .Ix utime The UNIX \f2utime()\fP function. \f2unix-utime\fP sets the last access and last modification time of the given file to the current time (first form) or to the specified times (second form). \f2atime\fP and \f2mtime\fP are integers. \f2unix-utime\fP returns the non-printing object. . .Pr unix-read-directory filename .LP This procedure returns the contents of the specified directory as a list of filenames (strings). \f2filename\fP must be the name of a directory. \f2unix-read-directory\fP is based on the .Ix opendir .Ix readdir .Ix closedir \f2opendir()\fP, \f2readdir()\fP, and \f2closedir()\fP functions. .LP Example: .Ss ;;; Return directory contents as list of (filename . filetype) pairs .sp .4 (define (get-files-and-types directory) (map (lambda (file) (cons file (stat-type (unix-stat file)))) (unix-read-directory directory))) .sp .6 (pp (get-files-and-types ".")) .Se . .KS .[[ .Pr unix-tempname .Pr unix-tempname directory .Pr unix-tempname directory prefix .]] .KE .LP \f2unix-tempname\fP returns a pathname that can be used as the name of a .Ix "temporary file" temporary file (typically in .Ix /tmp .Ix /usr/tmp /tmp or /usr/tmp). The newly created pathname is not the name of an existing file. .LP \f2directory\fP (a string or symbol) can be used to specify the directory component of the pathname; \f2prefix\fP (string or symbol), if present, may be used as a prefix for the filename component of the pathname. However, both arguments may be ignored by \f2unix-tempname\fP. .LP \f2unix-tempname\fP is based on one of the UNIX functions .Ix tempnam .Ix mktemp .Ix tmpnam \f2tempnam()\fP, \f2mktemp()\fP, and \f2tmpnam()\fP (in that order); if none of these functions is available, an algorithm similar to the one employed by UNIX \f2mktemp()\fP is used. . .Ch "Symbolic Links" . .PP The following procedures are only defined on platforms that support .Ix "symbolic links" symbolic links. In this case, the feature .Ix unix:symlinks \f2unix:symlinks\fP is provided when the UNIX extension is loaded. . .Pr unix-lstat filename .LP .Ix lstat The UNIX \f2lstat()\fP system call. \f2unix-lstat\fP returns a .Ix stat-record \f2stat-record\fP (see \f2unix-stat\fP above). . .Pr unix-readlink filename .LP .Ix readlink The UNIX \f2readlink()\fP system call. \f2unix-readlink\fP returns the contents of specified symbolic link as a string. . .Pr unix-symlink filename\*1 filename\*2 .LP .Ix symlink The UNIX \f2symlink()\fP system call. \f2unix-symlink\fP returns the non-printing object. . .Ch "File and Record Locking" . .PP The procedures described in this section are only defined if some form of file-based .Ix locking locking is available on the local system (either locking of entire files, or .Ix "record locking" record locking). In this case, the feature .Ix unix:file-locking \f2unix:file-locking\fP is provided at the time the UNIX extension is loaded. If the local system supports locking of individual file segments, the feature .Ix unix:record-locks \f2unix:record-locks\fP is provided as well, and the locking primitives are based on the .Ix fcntl \f2fcntl()\fP system call (otherwise the .Ix flock \f2flock()\fP system call is used). . .Pr unix-set-lock fdescr lock wait? .LP The \f2lock\fP argument is a .Ix lock-record \f2lock-record\fP with these fields: .sp .5 .KS .TS allbox, tab(~); c c c lf5 l l. Field~Type~Contents _ exclusive?~boolean~T{ .nf exclusive lock (write lock) if #t, shared lock (read lock) otherwise T} whence~symbol~T{ .nf \f2set\fP, \f2current\fP, or \f2end\fP: interpretation of \f2start\fP (see \f2unix-lseek\fP) T} start~integer~relative offset in bytes length~integer~T{ .nf length in bytes (0 means lock to EOF) T} .TE .KE .LP .Ix "record locks" If record locks are supported, the fields \f2whence\fP, \f2start\fP, and \f2length\fP specify a segment in the file referred to by \f2fdescr\fP that is to be locked or unlocked. If only entire files can be locked, the contents of these fields are ignored by the lock procedures. .LP An arbitrary number of .Ix "shared lock" shared locks for a file or file segment may be active at a given time, but more than one .Ix "exclusive lock" exclusive lock, or both shared and exclusive locks, cannot be set at the same time. \f2fdescr\fP must be opened for reading to be able to set a shared lock; it must be opened with write access for an exclusive lock. A shared lock may be upgraded to an exclusive lock, and vice versa. Mandatory locking may or may not be supported by the local system. .LP If the \f2wait?\fP argument is #t and the specified lock cannot be applied, \f2unix-set-lock\fP blocks until the lock becomes available. .LP \f2unix-set-lock\fP returns #t if the specified lock could be applied, #f otherwise. . .Pr unix-remove-lock fdescr lock .LP This procedure removes the specified file lock or record lock from the file pointed to by \f2fdescr\fP. \f2lock\fP is a \f2lock-record\fP; see \f2unix-set-lock\fP above for a description. \f2unix-remove-lock\fP returns the non-printing object. . .Pr unix-query-lock fdescr lock .LP If record locks are not supported, this procedure always returns #f. If record locks are supported, \f2unix-query-lock\fP returns information about the first lock that would cause a call to \f2unix-set-lock\fP with \f2lock\fP to fail or block, or #f if no such lock exists (i.\|e.\& if claiming the specified lock would succeed). Information about the lock is returned as a pair; the car is an integer (the process-ID of the the process that owns the lock), the cdr is a \f2lock-record\fP. The process-ID may be meaningless in a network environment. . .Ch "Obtaining Password and Group File Entries" . .PP The procedures defined in this section are used to obtain entries from the system's .Ix "passwd database" .Ix "group database" \f2passwd\fP and \f2group\fP databases. . .[[ .Pr unix-get-passwd .Pr unix-get-passwd user .]] .LP If invoked without an argument, this procedure returns the next entry from the \f2passwd\fP database. Successive calls to \f2unix-get-passwd\fP return entries in a random order. The \f2user\fP argument, if present, is either the login name of a user (a string or symbol) or a numeric user-ID (an integer). In this case, the \f2passwd\fP entry for this user is returned. .LP \f2unix-get-passwd\fP returns a .Ix passwd-record \f2passwd-record\fP with the following fields: .sp .5 .KS .TS allbox, tab(~); c c c lf5 l l. Field~Type~Contents _ name~string~login name password~string~login password uid~integer~numeric user-ID gid~integer~numeric primary group-ID gecos~string~contents of GECOS field homedir~string~home directory of user shell~string~login shell of user .TE .KE .LP \f2unix-get-passwd\fP is based on the UNIX .Ix getpwent .Ix getpwuid .Ix getpwnam \f2getpwent()\fP, \f2getpwuid()\fP, and \f2getpwnam()\fP functions. . .[[ .Pr unix-get-group .Pr unix-get-group group .]] .LP \f2unix-get-group\fP is identical to .Ix unix-get-passwd \f2unix-get-passwd\fP (see above), except that the system's \f2group\fP database is used instead of the \f2passwd\fP database. .LP The result value is a .Ix group-record \f2group-record\fP with these fields: .sp .5 .KS .TS allbox, tab(~); c c c lf5 l l. Field~Type~Contents name~string~group's name password~string~group's password gid~integer~numeric group-ID members~list of symbols~group members .TE .KE .LP \f2unix-get-group\fP is based on the UNIX .Ix getgrent .Ix getgrnam .Ix getgrgid \f2getgrent()\fP, \f2getgrgid()\fP, and \f2getgrnam()\fP functions. . .[[ .Pr unix-rewind-passwd .Pr unix-rewind-group .]] .LP These procedures rewind the \f2passwd\fP and \f2group\fP files by calling the .Ix setpwent .Ix setgrent \f2setpwent()\fP and \f2setgrent()\fP UNIX functions. . .[[ .Pr unix-end-passwd .Pr unix-end-group .]] .LP \f2unix-end-passwd\fP and \f2unix-end-group\fP close the \f2passwd\fP and \f2group\fP files by calling the UNIX functions .Ix endpwent .Ix endgrent \f2endpwent()\fP and \f2endgrent()\fP. . .Ch "Process Creation and Control" . .Pr unix-system string .LP \f2unix-system\fP starts .Ix /bin/sh ``/bin/sh'' as a child process with \f2string\fP as input and waits until the .Ix shell shell terminates. All file descriptors except standard input, standard output, and standard error output are closed in the child process. \f2unix-system\fP returns the .Ix "exit code" exit code of the shell as an integer or, if the shell was interrupted by a signal, the .Ix "termination status" termination status as a list of one integer element. If the shell could not be executed, exit code 127 is returned. . .[[ .Pr unix-open-input-pipe string .Pr unix-open-output-pipe string .]] .LP .Ix popen The UNIX \f2popen()\fP function. Both procedures create a .Ix pipe pipe between the caller and a .Ix shell shell executing the command \f2string\fP; they return a Scheme port containing the file pointer associated with the pipe. Closing the Scheme port, or running the garbage collector after the port has become unused, causes the pipe to be closed by a call to the .Ix pclose \f2pclose()\fP function. .LP \f2unix-open-input-pipe\fP returns an input port that can be used to read from the standard output of the specified command; \f2unix-open-output-pipe\fP returns an output port that accepts input to be sent to the standard input of the command. . .Pr unix-fork .LP .Ix fork The UNIX \f2fork()\fP system call. \f2unix-fork\fP returns the process-ID of the newly created process as an integer in the parent process, and the integer 0 in the child process. .LP The child process, as its first action, invokes the .Ix "onfork handlers" \f2onfork handlers\fP that may have been registered by other Elk extensions that are currently active (one purpose of \f2onfork\fP handlers is to make new links to .Ix "temporary files" temporary files in the newly created child process). . .KS .[[ .Pr unix-exec filename arguments .Pr unix-exec filename arguments environment .sp .5 .Pr unix-exec-path filename arguments .Pr unix-exec-path filename arguments environment .]] .KE .LP These procedures are based on the UNIX .Ix execv \f2execv()\fP family of system calls and library functions. The first argument is the name of the file to be executed. \f2arguments\fP is a list of strings to be passed to the program as arguments. The \f2environment\fP argument, if present, is a list of .Ix environment environment variable definitions to be used as the new program's environment. Each element of the list is pair of strings; the car of an element is the name of an environment variable, the cdr is the variable's value (the .Ix unix-environ \f2unix-environ\fP primitive can be used to obtain the current environment of the running program). .LP \f2unix-exec-path\fP searches the specified filename in a list of directories obtained from the calling program's .Ix PATH PATH environment variable. The variant of \f2unix-exec-path\fP that accepts an \f2environment\fP argument is not available on the currently supported platforms (the reason is that there is no \f2execvpe()\fP variant of the \f2execvp()\fP function, although \f2execve()\fP/\f2execle()\fP variants of \f2execv()\fP and \f2execl()\fP usually exist in UNIX). .LP \f2unix-exec\fP and \f2unix-exec-path\fP remove the temporary files used by the dynamic loading module of the interpreter kernel and invoke the finalization functions that may have been registered by extensions. As a result, attempting to load an object file after a call to \f2unix-exec\fP or \f2unix-exec-path\fP has returned (i.\|e.\& failed) may not work correctly. The finalization functions are only invoked once. . .KS .[[ .Pr unix-wait .Pr unix-wait options .sp .5 .Pr unix-wait-process pid .Pr unix-wait-process pid options .]] .KE .LP \f2unix-wait\fP and \f2unix-wait-process\fP are based on the UNIX .Ix wait \f2wait()\fP family of system calls and library functions. Both procedures return a .Ix wait-record \f2wait-record\fP with the following fields: .sp .5 .KS .TS allbox, tab(~); c c c lf5 l l. Field~Type~Contents pid~integer~process-ID of the terminated child process status~symbol~reason for process termination code~integer~exit code or termination status (signal) core-dump?~boolean~#t if a core-dump was produced resources~resources-record~resources of terminated process .TE .KE .LP See \f2unix-process-resources\fP below for a description of the \f2resources-record\fP type. .LP The \f2wait-record\fP result holds the process-ID and termination status of one of the terminated (or stopped) children of the calling process. The value of the \f2status\fP is one of the symbols \f2stopped\fP (if the child process has been stopped), \f2signaled\fP (child process is terminated due to a signal), or \f2exited\fP (child process has invoked \f2exit()\fP). \f2code\fP holds the exit code (if \f2status\fP is \f2exited\fP), or a signal number (if \f2status\fP is either \f2stopped\fP or \f2signaled\fP). The \f2resources\fP field holds the user and system time consumed by the child process and its children in nanoseconds (additional resources may be supplied in future versions). The fields of the \f2resources\fP record are #f on platforms that do not support the .Ix wait3 .Ix wait4 \f2wait3()\fP or \f2wait4()\fP system call. .LP \f2unix-wait-process\fP allows to collect the termination status of an individual process or a group of processes specified by the integer \f2pid\fP argument. This procedure is only defined on platforms where the .Ix waitpid .Ix wait4 \f2waitpid()\fP or \f2wait4()\fP system call is available. In this case, the feature .Ix unix:wait-process \f2unix:wait-process\fP is provided when the UNIX extension is loaded. .LP If no child process is available (or, in case of \f2unix-wait-process\fP, no process as specified by the \f2pid\fP argument), the \f2pid\fP field in the result is set to -1, and the \f2status\fP field is set to the symbol \f2none\fP. .LP The \f2options\fP argument, if present, is a list of one or more of the symbols \f2nohang\fP and \f2untraced\fP. Options are only supported if the feature .Ix unix:wait-options \f2unix:wait-options\fP is provided. . .Pr unix-process-resources .LP This procedure is based on the UNIX .Ix times \f2times()\fP library function. \f2unix-process-resources\fP returns the .Ix "resource usage" resource usage of the calling process and its terminated children as a pair of .Ix resources-record \f2resources-records\fP. Each \f2resources-record\fP has the following fields: .sp .5 .KS .TS allbox, tab(~); c c c lf5 l l. Field~Type~Contents user-time~integer~user time in nanoseconds system-time~integer~system time in nanoseconds .TE .KE .LP Addition fields may be supplied in future versions. . .Pr unix-environ .LP \f2unix-environ\fP returns the program's .Ix environment environment as a list of pairs. The car of each element is the name of an environment variable (a string), the cdr is the value of that variable (a string). . .Pr unix-getenv string .LP This procedure returns the value of the environment variable with the name \f2string\fP as a string, or #f if the specified variable is not defined. . .Pr unix-working-directory .LP \f2unix-working-directory\fP returns the calling program's current .Ix "working directory" working directory as a string. The procedure is based on the .Ix getcwd .Ix getwd \f2getcwd()\fP or \f2getwd()\fP function if any of these is available and invokes the .Ix pwd ``pwd'' command otherwise. . .Pr unix-getlogin .LP \f2unix-getlogin\fP returns the .Ix "login name" login name as a string (obtained by the UNIX .Ix getlogin \f2getlogin()\fP library function). . .[[ .Pr unix-getuids .Pr unix-getgids .]] .LP \f2unix-getuids\fP (\f2unix-getgids\fP) returns the calling program's .Ix "real user-ID" .Ix "effective user-ID" .Ix "real group-ID" .Ix "effective group-ID" real and effective user-IDs (group-IDs) as a pair of integers. . .Pr unix-getpids .LP \f2unix-getpids\fP returns the .Ix process-ID process-ID of the calling process and the .Ix "parent process-ID" parent process-ID as a pair of integers. . .Pr unix-getgroups .LP \f2unix-getgroups\fP returns the current .Ix "supplementary group-IDs" supplementary group-IDs of the process as a list of integers. .LP Example: .Ss ;;; Get list of names of supplementary group-IDs .sp .4 (define (get-group-names) (map (lambda (gid) (group-name (unix-get-group gid))) (unix-getgroups))) .Se . .Pr unix-umask mask .LP .Ix umask The UNIX \f2umask()\fP system call. \f2mask\fP is an integer. The procedure returns the previous value of the umask. . .Pr unix-nice incr .LP .Ix nice The UNIX \f2nice()\fP function. \f2incr\fP is an integer. \f2unix-nice\fP returns the new nice value (or zero on some platforms). . .Pr unix-sleep seconds .LP .Ix sleep The UNIX \f2sleep()\fP function. \f2seconds\fP is a positive integer. The procedure returns the non-printing object. . .Ch "Obtaining System Information" . .Pr unix-system-info .LP This procedure returns a .Ix system-record \f2system-record\fP with these fields: .sp .5 .KS .TS allbox, tab(~); c c c lf5 l l. Field~Type~Contents hostname~string~the system's hostname sysname~string~type of hardware platform osname~string~operating system type and version .TE .KE .LP The hostname is determined by a call to the UNIX .Ix gethostname .Ix uname \f2gethostname()\fP or \f2uname()\fP function; the system name and OS name are obtained from the configuration file that has been used to configure and install Elk. . .Pr unix-file-limit limit file .LP \f2unix-file-limit\fP can be used to query various system .Ix limits limits and options associated with files. \f2limit\fP is a symbol identifying the type of limit; \f2file\fP is a filename or file descriptor. .LP At least the following limits and options can be queried: .sp .5 .KS .TS allbox, tab(~); c c lf5 l. Limit/Option~Meaning _ max-links~maximum number of links to a file or directory max-name~maximum length of a filename max-path~maximum length of a pathname pipe-buf~pipe buffer size no-trunc~T{ .nf filename exceeding maximum length causes error instead of being silently truncated T} .TE .KE .LP Additional limits may be present on some platforms. The list of limits actually supported by this procedure can be obtained by a call to .Ix unix-list-file-limits \f2unix-list-file-limits\fP (see below). .LP If present, the .Ix POSIX .Ix pathconf .Ix fpathconf POSIX \f2pathconf()\fP/\f2fpathconf()\fP function is used to query a limit; in this case the specified filename or file descriptor is supplied as an argument to \f2pathconf()\fP or \f2fpathconf()\fP. If \f2pathconf()\fP is not available, or if calling it is not appropriate for the type of limit, a static (compile-time) value is returned. .LP The result type of \f2unix-file-limit\fP depends on the type of the specified limit (boolean in case of \f2no-trunc\fP, integer otherwise). . .Pr unix-list-file-limits .LP This procedure returns the list of limit symbols that can be supplied as arguments to .Ix unix-file-limit \f2unix-file-limit\fP (see above). . .Pr unix-job-control? .LP This predicate returns #t if UNIX job control is available on the local system, #f otherwise. In a .Ix POSIX POSIX environment, this procedure may call .Ix sysconf \f2sysconf()\fP. . .Ch "Date and Time" . .Pr unix-time .LP .Ix time The UNIX \f2time()\fP function. \f2unix-time\fP returns the number of seconds elapsed since midnight\ UTC,\ January\ 1,\ 1970 (\f2The Epoch\fP) as an integer. . .Pr unix-nanotime .LP This procedure returns the number of nanoseconds elapsed since The Epoch as an integer. \f2unix-nanotime\fP invokes one of the UNIX functions .Ix gettimeofday .Ix ftime .Ix time \f2gettimeofday()\fP, \f2ftime()\fP, \f2time()\fP (in that order, depending on which of these function is available), thus providing up to microsecond resolution. . .[[ .Pr unix-decode-localtime time .Pr unix-decode-utc time .]] .LP Both procedures convert the specified time (a number of seconds as returned by \f2unix-time\fP) into a .Ix time-record \f2time-record\fP; \f2unix-decode-localtime\fP corrects for the local time zone and DST adjustment (based on the UNIX .Ix localtime .Ix gmtime \f2localtime()\fP and \f2gmtime()\fP functions). .LP A \f2time-record\fP has the following fields: .sp .5 .KS .TS allbox, tab(~); c c c lf5 l l. Field~Type~Range _ seconds~integer~0..61 minutes~integer~0..59 hours~integer~0..23 day-of-month~integer~1..31 month~integer~0..11 year~integer~(year - 1900) weekday~integer~0..6 day-of-year~integer~0..365 dst~integer~1 if DST in effect .TE .KE .LP Example: .Ss ;;; Return date as a string of the form "Nov 3, 1993" .sp .4 (define (date-string) (let* ((months "JanFebMarAprMayJunJulAugSepOctNovDec") (time (unix-decode-localtime (unix-time))) (month-inx (* 3 (time-month time)))) .sp .4 (format #f "~a ~a, ~a" (substring months month-inx (+ 3 month-inx)) (time-day-of-month time) (+ 1900 (time-year time))))) .Se . .Pr unix-time->string time .LP This procedure converts the specified time into a string; it is based on the .Ix ctime .Ix asctime \f2ctime()\fP and \f2asctime()\fP UNIX functions. \f2time\fP is either an integer (number of seconds) or a \f2time-record\fP. . .Ch "Signals" . .PP The procedures described in this section (except \f2unix-kill\fP, \f2unix-list-signals\fP, and \f2unix-pause\fP) are only defined if the local system supports .Ix "reliable signals" reliable signals (either .Ix BSD BSD-style or .Ix POSIX POSIX signals). In this case, the feature .Ix unix:reliable-signals \f2unix:reliable-signals\fP is provided when the UNIX extension is loaded. . .Pr unix-kill pid signal .LP .Ix kill The UNIX \f2kill()\fP system call. \f2pid\fP is an integer; \f2sig\fP is either an integer (a signal number) or a symbol (a .Ix "signal name" signal name). At least the following signal names are supported: .sp .5 .KS .TS box, tab(~); c s s lf5 lf5 lf5. Signal names _ sigalrm~sigbus~sigfpe sighup~sigill~sigint sigkill~sigpipe~sigquit sigsegv~sigterm~ .TE .KE .LP The list of signal names actually supported by the local system can be obtained by calling .Ix unix-list-signals \f2unix-list-signals\fP (see below). .LP \f2unix-kill\fP returns the non-printing object. . .Pr unix-list-signals .LP This procedure returns a list of .Ix "signal name" signal names (symbols) that are supported by the system. . .Pr alarm seconds .LP .Ix alarm The UNIX \f2alarm()\fP function. \f2seconds\fP is a positive integer. \f2unix-alarm\fP returns the number of seconds remaining from the previously set alarm. . .Pr unix-pause .LP .Ix pause The UNIX \f2pause()\fP function. This procedure does not return. . .[[ .Pr unix-signal sig action .Pr unix-signal sig .]] .LP \f2unix-signal\fP defines or queries the action to be performed when a .Ix signal signal is delivered to the program. If an \f2action\fP argument is specified, this action is associated with the signal \f2sig\fP, and the previous action for this signal is returned. If no action is given (second form), \f2unix-signal\fP just returns the action currently associated with \f2sig\fP. .LP \f2sig\fP is the name of a signal (see \f2unix-kill\fP for a description). The action associated with \f2sigbus\fP, \f2sigfpe\fP, \f2sigill\fP, \f2sigint\fP, \f2sigkill\fP, \f2sigsegv\fP, and \f2sigabrt\fP (if supported) cannot be altered; either because UNIX does not permit this (\f2sigkill\fP), or because the signal can be generated as the result of an internal fatal error (\f2sigbus\fP etc.), or because it is used by the interpreter internally (\f2sigsegv\fP is used by the incremental garbage collector). The action associated with the .Ix "interrupt signal" \f2interrupt\fP signal can be controlled by redefining the standard Elk .Ix interrupt-handler \f2interrupt-handler\fP (see the Elk reference manual for details). .LP \f2action\fP can be one of the following: .RS .IP "the symbol \f2ignore\fP the specified signal is ignored .IP "the symbol \f2default\fP the default action for this signal is established .IP "the symbol \f2exit\fP cleanup and exit: if the signal is delivered, the interpreter's .Ix "temporary files" temporary files are removed, the .Ix "finalization functions" finalization functions and static C++ destructors of dynamically loaded extensions are invoked, and \f2exit()\fP is called with an exit code of 1 .IP "a compound procedure" the procedure .Ix "signal handler" (signal handler) is invoked on delivery of the specified signal. .IP .RE .LP The procedure specified as a signal handler must accept one or more arguments. When the signal is delivered, the procedure is invoked with the signal name (a symbol) as an argument. Signal handlers must not return (i.\|e.\& they must either exit or call a continuation). If a signal handler returns, a message is displayed and the .Ix reset \f2reset\fP primitive is called. .LP The signal specified as an argument to \f2unix-signal\fP is added to (removed from) the .Ix "signal mask" signal mask maintained by the interpreter, i.\|e.\& calls to the .Ix disable-interrupts \f2disable-interrupts\fP primitive block the signal from delivery. .LP \f2unix-signal\fP returns the previous (current) action for the specified signal (a procedure or \f2ignore\fP, \f2default\fP, or \f2exit\fP) or the symbol \f2handler\fP to indicate that the signal is handled internally by the interpreter. . .Ch "Miscellaneous Functions" . .Pr unix-getpass string .LP \f2unix-getpass\fP displays \f2string\fP on standard output, reads a .Ix password password, and returns the password as a string. The procedure invokes the UNIX .Ix getpass \f2getpass()\fP function. . .Ch "Error Functions" . .Sy unix-errval expression .LP Normally, a Scheme error is signaled by the UNIX extension whenever a UNIX system call or library function invoked by any of the above primitives fails. The macro \f2unix-errval\fP allows an application to handle an error condition in a specific way without the need to redefine the standard .Ix "error handler" error handler of Elk. .LP \f2unix-errval\fP evaluates the specified expression and returns the result of the evaluation. If, during evaluation of the expression, an error is signaled due to failure of a UNIX function, the corresponding primitive procedure returns a unique .Ix "error object" \f2error object\fP instead of performing normal error handling. .LP For example, evaluating the expression .Ss (unix-close 1000) ; close a bad file descriptor .Se would invoke the standard Scheme error handler in the normal way, whereas evaluating .Ss (unix-errval (unix-close 1000)) .Se would return an error object to allow the application to handle the error locally. Note that evaluation of the enclosing expression is not interrupted when an error is signaled, i.\|e.\& the expression .Ss (unix-errval (begin (unix-close 1000) 5)) .Se would return the integer 5. . .Pr unix-error? obj .LP This procedure returns #t if \f2obj\fP is the \f2error object\fP, #f otherwise. \f2unix-error?\fP is typically used to check whether a primitive invoked under control of \f2unix-errval\fP has signaled an error. . .Pr unix-errno .LP .Ix errno Returns the UNIX \f2errno\fP set by the last system call that has failed. .Ix "error codes" Error codes are represented as symbols corresponding to the names of the standard UNIX error numbers with letters converted to lower case, i.\|e. \f2enomem\fP, \f2ebadf\fP, etc. The exact set of error codes that can be returned is platform-dependent. .LP The value returned by \f2unix-errno\fP is not reset when a UNIX system call executes successfully. However, value of \f2unix-errno\fP is also affected by functions from the Elk kernel (such as \f2open-input-file\fP) and possibly other extensions that make use of system calls. . .Pr unix-perror string .LP \f2unix-perror\fP writes \f2string\fP followed by a colon and a short message describing the last UNIX error encountered to the current output port. \f2unix-perror\fP makes use of the ``~E'' format specifier of the .Ix format format primitive. . .bp .Ch "Examples" .LP .Ix examples This program implements a simple program interface to the UNIX .Ix dc \f2dc\fP desktop calculator command. The procedure .Ix calc-open \f2calc-open\fP starts the \f2dc\fP command and establishes two .Ix pipe pipes to/from the child process; the procedure .Ix calc \f2calc\fP sends its argument (a \f2dc\fP expression as a string) as input to \f2dc\fP; .Ix calc-close \f2calc-close\fP closes the pipes and waits for the subprocess to terminate. .Ss (require 'unix) .sp .4 (define calc-from-dc) ; input port: standard output of dc command (define calc-to-dc) ; output port: standard input of dc command (define calc-dc-pid) ; process-ID of child process running dc .sp .4 (define calc-dc-command "/bin/dc") .sp .4 (define (calc-open) (let* ((from (unix-pipe)) (to (unix-pipe)) (redirect-fd (lambda (a b) (unix-dup a b) (unix-close a)))) (set! calc-dc-pid (unix-fork)) (if (zero? calc-dc-pid) (begin (unix-close (car from)) (unix-close (cdr to)) (redirect-fd (car to) 0) (redirect-fd (cdr from) 1) (unix-exec calc-dc-command '("dc"))) (begin (unix-close (cdr from)) (unix-close (car to)) (set! calc-to-dc (unix-filedescriptor->port (cdr to) "w")) (set! calc-from-dc (unix-filedescriptor->port (car from) "r")))))) .sp .4 (define (calc expr) (format calc-to-dc "~a~%" expr) (flush-output-port calc-to-dc) (read-string calc-from-dc)) .sp .4 (define (calc-close) (close-output-port calc-to-dc) (close-input-port calc-from-dc) (unix-wait-process calc-dc-pid)) ;;; Test -- print sqrt(2): .sp .4 (calc-open) (display (calc "10k 2v p")) (newline) (calc-close) .Se .bp .LP The following procedure copies a file; the arguments are the source and target file names. The second argument may name a directory, in this case the file is copied into the directory. The target file must not yet exist. .Ix copy-file \f2copy-file\fP preserves the access mode of the source file. .Ss (require 'unix) .sp .4 (define copy-buffer-size 8192) .sp .4 (define (copy-file from to) (let ((from-stat (unix-stat from)) (to-stat (unix-errval (unix-stat to)))) .sp .3 (if (eq? (stat-type from-stat) 'directory) ; complain if "from" (error 'copy-file "~s is a directory" from)) ; is a directory .sp .3 (if (and (not (unix-error? to-stat)) ; destination exists (eq? (stat-type to-stat) 'directory)) ; and is a directory? (set! to (format #f "~a/~a" to from))) .sp .3 (let* ((to-fd (unix-open to '(write create exclusive) (stat-mode from-stat))) (from-fd (unix-open from '(read))) (buf (make-string copy-buffer-size))) (let loop ((num-chars (unix-read-string-fill! from-fd buf))) (if (positive? num-chars) (begin (unix-write to-fd buf num-chars) (loop (unix-read-string-fill! from-fd buf))))) .sp .3 (unix-close from-fd) (unix-close to-fd)))) .Se .bp .LP \f2lock-vi\fP starts the .Ix vi .Ix editor \f2vi\fP editor with the specified file name. It provides exclusive access to the file during the editing session by applying a write lock to the file and removing it when the editor finishes. A message is displayed periodically if the lock is held by somebody else. .Ss (require 'unix) .sp .4 (define (lock-vi file) (let* ((fd (unix-open file '(read write))) (lock ((record-constructor lock-record) #t 'set 0 0))) .sp .4 (let loop () (if (not (unix-set-lock fd lock #f)) (begin (format #t "Someone else is editing ~s...~%" file) (unix-sleep 10) (loop)))) .sp .4 (unix-system (format #f "vi ~a" file)) (unix-remove-lock fd lock))) .Se .sp .LP \f2pipe-size\fP attempts to determine the capacity of a .Ix pipe pipe. It creates a pipe, places the write end of the pipe into .Ix "non-blocking I/O" non-blocking I/O mode and writes into the pipe until it is full, counting the characters successfully written. .Ss (require 'unix) .sp .4 (define (pipe-size) (let* ((pipe (unix-pipe)) (flags (unix-filedescriptor-flags (cdr pipe))) (len 32) ; assumes capacity is multiple of len (noise (make-string len))) .sp .4 ;; enable non-blocking I/O for write side of pipe: (unix-filedescriptor-flags (cdr pipe) (cons 'ndelay flags)) .sp .4 (unwind-protect (let loop ((size 0)) (if (unix-error? (unix-errval (unix-write (cdr pipe) noise))) (if (memq (unix-errno) '(eagain ewouldblock)) size (error 'pipe-size "~E")) (loop (+ size 32)))) (unix-close (car pipe)) (unix-close (cdr pipe))))) .Se elk-3.99.8/doc/unix/Makefile.in0000644000175000017500000003063211577103434013126 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = doc/unix DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(docsdir)" DATA = $(docs_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ELK_CFLAGS = @ELK_CFLAGS@ ELK_LDFLAGS = @ELK_LDFLAGS@ ELK_LIBS = @ELK_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INCLUDES = @INCLUDES@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOTIF_CFLAGS = @MOTIF_CFLAGS@ MOTIF_LIBS = @MOTIF_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STDINT_HEADER = @STDINT_HEADER@ STRIP = @STRIP@ VERSION = @VERSION@ XAW_CFLAGS = @XAW_CFLAGS@ XAW_LIBS = @XAW_LIBS@ XMKMF = @XMKMF@ XT_CFLAGS = @XT_CFLAGS@ XT_LIBS = @XT_LIBS@ X_CFLAGS = @X_CFLAGS@ X_LIBS = @X_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = unix.ms CLEANFILES = index.raw index.ms unix.ps unix.html @HAVE_GROFF_TRUE@docs_DATA = unix.ps @HAVE_GROFF_TRUE@docsdir = $(datadir)/doc/@PACKAGE@/ps MANUAL = $(srcdir)/unix.ms TROFF = groff -ms -t UNROFF = unroff -ms all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/unix/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/unix/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-docsDATA: $(docs_DATA) @$(NORMAL_INSTALL) test -z "$(docsdir)" || $(MKDIR_P) "$(DESTDIR)$(docsdir)" @list='$(docs_DATA)'; test -n "$(docsdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(docsdir)" || exit $$?; \ done uninstall-docsDATA: @$(NORMAL_UNINSTALL) @list='$(docs_DATA)'; test -n "$(docsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(docsdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(docsdir)" && rm -f $$files tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(docsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-docsDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-docsDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-docsDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-docsDATA unix.ps: $(MANUAL) index.ms (cat $(MANUAL) $(srcdir)/../util/tmac.index index.ms; echo ".Tc") \ | $(TROFF) 2> /dev/null > unix.ps unix.html: $(MANUAL) (cat $?; echo ".Tc") | $(UNROFF) document=unix index.ms: $(MANUAL) index.raw sort -f -t'#' +1 -3 +0n index.raw \ | $(AWK) -f $(srcdir)/../util/fixindex.awk \ | $(AWK) -f $(srcdir)/../util/block.awk >index.ms index.raw: $(MANUAL) $(TROFF) $(MANUAL) 2> index.raw >/dev/null #check: # checknr -c.Ul.Pr.Sy.Va.Sh.Ix.Id.Ch -a.Ss.Se.[[.]] $(MANUAL) \ # | grep -v "Empty command" # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: elk-3.99.8/doc/unix/Makefile.am0000644000175000017500000000140311577076306013116 00000000000000EXTRA_DIST = unix.ms CLEANFILES = index.raw index.ms unix.ps unix.html if HAVE_GROFF docs_DATA = unix.ps docsdir = $(datadir)/doc/@PACKAGE@/ps endif MANUAL = $(srcdir)/unix.ms TROFF = groff -ms -t UNROFF = unroff -ms unix.ps: $(MANUAL) index.ms (cat $(MANUAL) $(srcdir)/../util/tmac.index index.ms; echo ".Tc") \ | $(TROFF) 2> /dev/null > unix.ps unix.html: $(MANUAL) (cat $?; echo ".Tc") | $(UNROFF) document=unix index.ms: $(MANUAL) index.raw sort -f -t'#' +1 -3 +0n index.raw \ | $(AWK) -f $(srcdir)/../util/fixindex.awk \ | $(AWK) -f $(srcdir)/../util/block.awk >index.ms index.raw: $(MANUAL) $(TROFF) $(MANUAL) 2> index.raw >/dev/null #check: # checknr -c.Ul.Pr.Sy.Va.Sh.Ix.Id.Ch -a.Ss.Se.[[.]] $(MANUAL) \ # | grep -v "Empty command" elk-3.99.8/doc/Makefile.am0000644000175000017500000000017711577076306012142 00000000000000EXTRA_DIST = README SUBDIRS = bitstring cprog kernel man oops record regexp unix usenix xlib xt DIST_SUBDIRS = $(SUBDIRS) util elk-3.99.8/doc/util/0000755000175000017500000000000011577110020011114 500000000000000elk-3.99.8/doc/util/block.awk0000644000175000017500000000103011577076306012646 00000000000000BEGIN { firstchar = "@"; a["a"] = "A"; a["b"] = "B"; a["c"] = "C"; a["d"] = "D"; a["e"] = "E"; a["f"] = "F"; a["g"] = "G"; a["h"] = "H"; a["i"] = "I"; a["j"] = "J"; a["k"] = "K"; a["l"] = "L"; a["m"] = "M"; a["n"] = "N"; a["o"] = "O"; a["p"] = "P"; a["q"] = "Q"; a["r"] = "R"; a["s"] = "S"; a["t"] = "T"; a["u"] = "U"; a["v"] = "V"; a["w"] = "W"; a["x"] = "X"; a["y"] = "Y"; a["z"] = "Z"; } { c = substr($2,2,1); if (c >= "a" && c <= "z") c = a[c]; if (c != firstchar) printf(".LB %s\n", c); firstchar = c; print; } elk-3.99.8/doc/util/Makefile.in0000644000175000017500000002340711577103434013122 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = doc/util DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ELK_CFLAGS = @ELK_CFLAGS@ ELK_LDFLAGS = @ELK_LDFLAGS@ ELK_LIBS = @ELK_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INCLUDES = @INCLUDES@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOTIF_CFLAGS = @MOTIF_CFLAGS@ MOTIF_LIBS = @MOTIF_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STDINT_HEADER = @STDINT_HEADER@ STRIP = @STRIP@ VERSION = @VERSION@ XAW_CFLAGS = @XAW_CFLAGS@ XAW_LIBS = @XAW_LIBS@ XMKMF = @XMKMF@ XT_CFLAGS = @XT_CFLAGS@ XT_LIBS = @XT_LIBS@ X_CFLAGS = @X_CFLAGS@ X_LIBS = @X_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = block.awk fixindex.awk mkindex.awk tmac.index tmac.scheme all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/util/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/util/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: elk-3.99.8/doc/util/mkindex.awk0000755000175000017500000000511611577076306013227 00000000000000#! /usr/bin/awk -f # mkindex.awk: Copy named files or standard input (if no arguments are # given) to standard output, replacing @[something] by troff macro calls. # $Id$ # # These replacements are performed: # # @[.something] --> \n.Ix "something"\nsomething # @[!something] --> \n.Id "something"\nsomething # # @[.some|thing] --> \n.Ix "thing, some"\nsome thing # @[!some|thing] --> \n.Id "thing, some"\nsome thing # # @[.=something] --> \n.Ix "something"\n # @[!=something] --> \n.Id "something"\n # # # 1) initial \n is omitted at the beginning of an output line # # 2) initial \n is prefixed by \c if @[ follows "(" in input # # 3) omit final \n if @[...] is at end of input line # # 4) within @[...], \] is replaced by ] # # 5) in the macro argument ("something"), all sequences of the form # `` or '' or \fX or \% are removed { need_nl = 0; line = $0; while(line != "") { nxt = index(line, "@[") if(nxt == 0) { printf "%s", line; break; } if(nxt > 1) { if(substr(line, nxt - 1, 1) == "(") { need_c = 1; } need_nl = 1; printf "%s", substr(line, 1, nxt - 1); line = substr(line, nxt); continue; } tmp = substr(line, 1, 3); if(tmp == "@[.") { macro = "Ix"; } else if(tmp == "@[.") { macro = "Id"; } else { printf "error: invalid index %s\n", tmp > "/dev/stderr"; exit 1; } end = match(line, "[^\\\\]]"); if(end == 0) { printf "error: unfinished @[\n" > "/dev/stderr"; exit 1; } inx = substr(line, 4, end - 3); gsub("\\\\]", "]", inx); arg = inx; gsub("(\\\\f.|''|``|\\\\%)", "", arg); if(arg == "") { printf "error: empty index\n" > "/dev/stderr"; exit 1; } if(need_c) { printf "\\c"; } if(need_nl) { printf "\n"; } printf ".%s ", macro; line = substr(line, end + 2); if(sub("^=", "", arg)) { printf "\"%s\"", arg; if(line != "") { printf "\n"; need_nl = 0; sub("^ ", "", line); } } else if (arg ~ /[|]/) { q = arg; sub("[^|]*[|]", "", q); sub("[|].*", "", arg); printf "\"%s, %s\"\n%s %s", q, arg, arg, q; need_nl = 1; } else { printf "\"%s\"\n%s", arg, inx; need_nl = 1; } } printf "\n"; } elk-3.99.8/doc/util/tmac.index0000644000175000017500000000063311577076306013035 00000000000000. \" Macros for the index .de Ib \" blank major entry .br .ne 2v \\$1# .. .de I> \" major entry .br \\$1, \\$2 .. .de I< \" minor entry .br \\$2, \\$3 .. .de LB \" new letter starts here .di DT \" start diverted text .sp \s+2\f3\\$1\fP\s-2 .sp .di \" end diverted text .ne \\n(dnu+1v \" get enough space for it .DT \" output it .. . .bp .XS Index .XE .rs .sp .5i .tl '\&'\f3\s+2Index\s0\fP'\&' .sp .5i .2C elk-3.99.8/doc/util/tmac.scheme0000644000175000017500000000573111577076306013176 00000000000000.\" Conditional requests using \n(.U have been added to most macros .\" for unroff support; the number register .U is non-zero if the file .\" is processed by unroff, else zero. .\" .\" A font suitable for Scheme keywords and program examples must be .\" mounted on font position 5. .\" For example: .fp 5 TT (Typewriter font) .\" or: .fp 5 HR (Helvetica Roman) .\" or: .fp 5 C (Courier) .\" .fp 5 C .\" .nr PS 11 .nr VS 5i/24u .\" US paper format. .pl 11i .\" The subscripts 1 and 2. .ie \n(.U .ds 1 1 .el .ds 1 "\v'.3m'\s-11\s0\v'-.3m' .ie \n(.U .ds 2 2 .el .ds 2 "\v'.3m'\s-12\s0\v'-.3m' .\" .\" The digit 4 as a superscript (used in R^4RS). .ie \n(.U .ds ^4 ^4 .el .ds ^4 \u\s-2\&4\s0\d .\" .\" Underline page top. .de Ul .am PT .if \\\\n%-1 .tl ?\\\\v'-.6v'\\\\l'\\\\n(LLu\(ru'\\\\v'.6v' \\.. .. .\" Index entry. .de Ix .if !\n(.U .tm \\n%#\\$1#\\$2#\\$3 .. .\" Index entry (definition). .de Id .Ix "\\$1" "\\$2" @DEF@ .. .\" Scheme code start. .de Ss .KS .nr sF \\n(.f .ft 5 .ps -1 .vs -1 .ie \n(.U .RS .el .in 1c .nf .if !\n(.U .sp .3c .. .\" Scheme code end. .de Se .sp .5 .fi .ie \n(.U .RE .el .in .ps .vs .ft \\n(sF .KE .. .\" Scheme keyword in text. Inline font switches to italics .\" should be used instead, but at least one document .\" (oops/oops.ms) still uses this macro. .de S .ft 5 .ps -1 .if \\n(.$=1 \&\\$1 .if \\n(.$>1 \&\\$1\c .ft .ps .if \\n(.$>1 \&\\$2 .. .\" Chapter with TOC entry. .de Ch .br .ne 3c .NH \\$1 .XS \\$1 .XE .. .\" Called before first in a group of .Pr/.Sy/.Va. .de Sh .ie \n(.U .LP .el .SH .. .\" Scheme procedure. .de Pr .ds xx " .if \\n(.$>=2 .as xx " \f2\\$2\fP .if \\n(.$>=3 .as xx " \f2\\$3\fP .if \\n(.$>=4 .as xx " \f2\\$4\fP .if \\n(.$>=5 .as xx " \f2\\$5\fP .if \\n(.$>=6 .as xx " \f2\\$6\fP .if \\n(.$>=7 .as xx " \f2\\$7\fP .if \\n(.$>=8 .as xx " \f2\\$8\fP .if \\n(.$>=9 .as xx " \f2\\$9\fP .if !\\nP .Sh .if \\n+P>2 .br .ie \n(.U (\f3\\$1\fP\|\\*(xx) .el .tl '(\\$1\|\\*(xx)'\&'procedure' .Id "\\$1" .. .\" Scheme syntax form. .de Sy .ds xx " .if \\n(.$>=2 .as xx " \f2\\$2\fP .if \\n(.$>=3 .as xx " \f2\\$3\fP .if \\n(.$>=4 .as xx " \f2\\$4\fP .if \\n(.$>=5 .as xx " \f2\\$5\fP .if \\n(.$>=6 .as xx " \f2\\$6\fP .if \\n(.$>=7 .as xx " \f2\\$7\fP .if \\n(.$>=8 .as xx " \f2\\$8\fP .if \\n(.$>=9 .as xx " \f2\\$9\fP .if !\\nP .Sh .if \\n+P>2 .br .ie \n(.U (\f3\\$1\fP\|\\*(xx) .el .tl '(\\$1\|\\*(xx)'\&'syntax' .Id "\\$1" .. .\" Scheme variable. .de Va .if !\\nP .Sh .if \\n+P>2 .br .ie \n(.U \f3\\$1\fP .el .tl '\\$1'\&'variable' .Id "\\$1" .. .nr P 0 .\" .[[ and .]] enclose a group of .Pr/.Sy/.Va requests. .de [[ .nr P 1 1 .Sh .. .de ]] .nr P 0 0 .. .\" Output the table of contents. .de Tc .de PT \\.. .1C .bp .ie \n(.U .## (if (zero? (option 'split)) (parse-line ".PX")) .el .PX .. elk-3.99.8/doc/util/fixindex.awk0000644000175000017500000000305611577076306013404 00000000000000BEGIN { FS = "#"; BD = "\\s+1\\f3"; ED = "\\fP\\s-1"; } NR == 1 { if ($3 != "") printf(".Ib \"%s\"\n", $2); major = $2; minor = $3; if ($4 == "@DEF@") { pagelist = BD $1 ED; } else { pagelist = $1; } pageno = $1; oldpageno = $1; oldpagelist = ""; } NR != 1 { if ($2 == major && $3 == minor) # neither has changed { if ($1 != pageno) { # new page number, append oldpageno = $1; oldpagelist = pagelist; if ($4 == "@DEF@") { pagelist = pagelist ", " BD $1 ED; } else { pagelist = pagelist ", " $1; } } else { # old page, but check for def if ($4 == "@DEF@") { if (pageno == oldpageno) { if (oldpagelist != "") oldpagelist = oldpagelist ", " } pagelist = oldpagelist BD $1 ED; } } } else # one has changed { if (minor != "") # dump full record printf(".I< \"%s\" \"%s\" \"%s\"\n", major, minor, pagelist); else printf(".I> \"%s\" \"%s\"\n", major, pagelist); if ($4 == "@DEF@") { # restart pagelist pagelist = BD $1 ED; } else { pagelist = $1; } oldpagelist = ""; oldpageno = $1; if ($2 != major && $3 != "") # major has changed, minor not null printf(".Ib \"%s\"\n", $2); } major = $2; minor = $3; pageno = $1; } END { if (minor != "") # dump full record printf(".I< \"%s\" \"%s\" \"%s\"\n", major, minor, pagelist); else printf(".I> \"%s\" \"%s\"\n", major, pagelist); } elk-3.99.8/doc/util/Makefile.am0000644000175000017500000000010711577076306013110 00000000000000EXTRA_DIST = block.awk fixindex.awk mkindex.awk tmac.index tmac.scheme elk-3.99.8/doc/xt/0000755000175000017500000000000011577110020010572 500000000000000elk-3.99.8/doc/xt/xt.ms0000644000175000017500000004141211577076306011532 00000000000000.so ../util/tmac.scheme .Ul .TL Elk/Xt Reference Manual .AU Oliver Laumann . .Ch "Introduction" .PP This manual describes the functions, special forms, and variables defined by the Xt (X Toolkit Intrinsics) extension included in the Elk distribution. Most of the functions are directly equivalent to a function of the X toolkit C library, so that the description need not be repeated. In such cases, only the name of the corresponding Xt function is mentioned. Thus, you should have the \f2X Toolkit Intrinsics \- C Language Interface\fP manual within reach when using this reference manual. .PP The functions listed in this document are loaded when the expression .DS .ft 5 (require 'xwidgets) .ft .DE .Ix xwidgets is evaluated or, when the OSF/Motif software has been installed on your system and you want to use Motif widgets from within Scheme, when .DS .ft 5 (require 'motif) .ft .DE .Ix motif is evaluated in the interpreter's top level or in a Scheme program. If you only want to use the toolkit functionality (and no widgets), evaluate .DS .ft 5 (require 'xt). .ft .DE .Ix xt Note that all of the above forms cause the Elk/Xlib functions to be loaded as well. .LP Individual widgets are loaded by evaluating .DS .ft 5 (load-widgets . \f2widget-names\fP) .ft .DE .LP .Id load-widgets Each \f2widget-name\fP is a symbol (not quoted, since \f2load-widgets\fP is a macro). .PP The widgets are loaded from subdirectories of ``$install_dir/runtime/obj'' (where $install_dir is the directory where you have installed Elk on your system). .PP In the following, the types of arguments of the listed procedures are not specified when they are obvious from the context or from the name. For instance, an argument named \f2widget\fP is always of type \f2widget\fP, an argument named \f2context\fP is an object of type \f2context\fP (application context), etc. Arguments the names of which end in ``?'' are always of type \f2boolean\fP. .if !\n(.U \{\ .PP In the following, each description of a procedure, special form, or variable lists the kind of object in boldface. Here, \f3procedure\fP denotes either a primitive procedure or a compound procedure, \f3syntax\fP denotes a special form or a macro, and \f3variable\fP denotes a global variable that has some initial value and can be re-assigned a new value by the user (by means of \f2set!\fP or \f2fluid-let\fP). .\} . .Ch "Widget Classes" . .Pr class? x .LP Returns #t iff \f2x\fP is an object of type \f2class\fP (widget class). . .Pr find-class name-of-class .LP Returns the widget class of the specified name (an object of type \f2class\fP). \f2name-of-class\fP is a string or a symbol. . .Pr class-resources widget-class .LP See \f2XtGetResourceList\fP. Returns the resource list of the specified widget class. Each element of the list is a list of three symbols \- the resource name, the resource class, and the resource type. . .Pr class-constraint-resources widget-class .LP See \f2XtGetConstraintRespourceList\fP. Returns the list of constraint resources that are defined for the specified widget class. Each element of the list is a list of three symbols \- the resource name, the resource class, and the resource type. . .Pr class-sub-resources widget-class .LP Returns the list of sub-resources (if there are any) of the specified widget class. See \f2class-resources\fP above. . .Pr class-exists? name-of-class .LP Returns #t iff a widget class of the given name exists (i.\|e.\& has been loaded by means of \f2load-widgets\fP). \f2name-of-class\fP is a string or a symbol. . .Ch "Widget Functions" . .Pr widget? x .LP Returns #t iff \f2x\fP is an object of type \f2widget\fP. . .Pr destroy-widget widget .LP See \f2XtDestroyWidget\fP. . .Pr create-shell application-name application-class parent display . args .LP See \f2XtAppCreateShell\fP. \f2application-name\fP and \f2application-class\fP are strings or symbols or #f (NULL is used in the latter case). \f2parent\fP is a widget. The number of \f2args\fP must be even, the 1st, 3rd, etc.\& argument is the name of a resource to be set (a string or a symbol), the 2nd, 4th, etc.\& argument is the corresponding value. . .[[ .Pr create-widget widget-class parent . args .Pr create-widget widget-name widget-class parent . args .]] .LP See \f2XtCreateWidget\fP. \f2widget-name\fP is a string or a symbol; \f2parent\fP is a widget. If no \f2widget-name\fP is given, the name of the widget class is used. The number of \f2args\fP must be even, the 1st, 3rd, etc.\& argument is the name of a resource to be set (a string or a symbol), the 2nd, 4th, etc.\& argument is the corresponding value. . .Pr create-managed-widget . args .LP Applies \f2create-widget\fP to the arguments and then calls \f2manage-child\fP with the newly created widget. . .Pr realize-widget widget .LP See \f2XtRealizeWidget\fP. . .Pr unrealize-widget widget .LP See \f2XtUnrealizeWidget\fP. . .Pr widget-realized? widget .LP See \f2XtIsRealized\fP. . .Pr widget-display widget .LP See \f2XtDisplay\fP. Returns an object of type \f2display\fP. . .Pr widget-parent widget .LP See \f2XtParent\fP. . .Pr widget-name widget .LP See \f2XtName\fP. Returns the name of a widget as a string. . .[[ .Pr widget\(mi>window widget .Pr widget-window widget .]] .LP See \f2XtWindow\fP. Returns an object of type \f2window\fP. . .Pr widget-composite? widget .LP See \f2XtIsComposite\fP. . .Pr manage-children . widgets .LP See \f2XtManageChildren\fP. . .Pr manage-child widget .LP Calls \f2manage-children\fP with the specified widget. . .Pr unmanage-children . widgets .LP See \f2XtUnmanageChildren\fP. . .Pr unmanage-child widget .LP Calls \f2unmanage-children\fP with the specified widget. . .Pr widget-managed? widget .LP See \f2XtIsManaged\fP. . .Pr widget-class widget .LP See \f2XtClass\fP. Returns an object of type \f2class\fP. . .Pr widget-superclass widget .LP See \f2XtSuperclass\fP. Returns an object of type \f2class\fP or the symbol \f5none\fP when the widget's class does not have a super-class. . .Pr widget-subclass? widget class .LP See \f2XtIsSubclass\fP. . .Pr set-mapped-when-managed! widget managed? .LP See \f2XtSetMappedWhenManaged\fP. . .Pr map-widget widget .LP See \f2XtMapWidget\fP. . .Pr unmap-widget widget .LP See \f2XtUnmapWidget\fP. . .Pr set-values! widget . args .LP See \f2XtSetValues\fP. The number of \f2args\fP must be even, the 1st, 3rd, etc.\& argument is the name of a resource to be set (a string or a symbol), the 2nd, 4th, etc.\& argument is the corresponding value. . .Pr get-values widget . args .LP See \f2XtGetValues\fP. Each \f2arg\fP is the name of a resource (a string or a symbol). Returns a list of the values of the specified resources. . .Pr widget-context widget .LP See \f2XtWidgetToApplicationContext\fP. Returns an object of type \f2context\fP. . .Pr set-sensitive! widget sensitive? .LP See \f2XtSetSensitive\fP. . .Pr widget-sensitive? widget .LP See \f2XtIsSensitive\fP. . .Pr window\(mi>widget window .LP See \f2XtWindowToWidget\fP. . .Pr name\(mi>widget root-widget name .LP See \f2XtNameToWidget\fP. \f2name\fP is a string or a symbol. . .Pr widget-translate-coordinates widget x y .LP See \f2XtTranslateCoords\fP. Returns the root-relative x and y coordinates as a pair of integers. . .Ch "Callback Functions" . .Pr add-callbacks widget callback-name . callback-functions .LP See \f2XtAddCallbacks\fP. Adds the functions to a callback list of the specified widget. \f2callback-name\fP is a string or a symbol. Each callback function will be called with at least one argument \- the widget to which the function has been attached. . .Pr add-callback widget callback-name callback-function .LP Calls \f2add-callbacks\fP with the specified function. . .\" .Pr call-callbacks widget callback-name object .\" Calls each callback procedure that is registered in the callback .\" list named \f2callback-name\fP of the given \f2widget\fP with .\" \f2object\fP as an argument. .\" . .Ch "Popup Shells" . .[[ .Pr create-popup-shell widget-class parent-widget . args .Pr create-popup-shell widget-name widget-class parent-widget . args .]] .LP See \f2XtCreatePopupShell\fP. \f2widget-name\fP is a string or a symbol. If no widget name is given, the name of the shell class is used. The number of \f2args\fP must be even, the 1st, 3rd, etc.\& argument is the name of a resource to be set (a string or a symbol), the 2nd, 4th, etc.\& argument is the corresponding value. . .Pr popup shell-widget grab-kind .LP See \f2XtPopup\fP. \f2grab-kind\fP is a symbol (\f5grab-once\fP, \f5grab-nonexclusive\fP, or \f5grab-exclusive\fP). . .Pr popdown shell-widget .LP See \f2XtPopdown\fP. . .Ch "Application Contexts" . .Pr context? x .LP Returns #t iff \f2x\fP is an object of type \f2context\fP (application context). . .Pr create-context .LP See \f2XtCreateApplicationContext\fP. . .Pr destroy-context context .LP See \f2XtDestroyApplicationContext\fP. . .Pr initialize-display context display application-name application-class .LP See \f2XtDisplayInitialize\fP, \f2XtOpenDisplay\fP. If \f2display\fP is an object of type \f2display\fP, \f2XtDisplayInitialize\fP is called. If \f2display\fP is a display name (a string or a symbol) or #f, \f2XtOpenDisplay\fP is called (with a NULL display in the latter case), and the newly opened display is returned. \f2application-name\fP and \f2application-class\fP are strings or symbols or #f (NULL and the empty string are used in the latter case). . .Pr application-initialize name . fallback-resources .LP A convenience function that creates an application context by a call to \f2create-context\fP, sets the fallback resources (if any), initializes the display by a call to \f2initialize-display\fP with the specified \f2name\fP and a class of #f, and creates and returns an application shell with the name \f2name\fP and class #f. .LP Calling \f2application-initialize\fP more than once may cause the application contexts and displays that were created by earlier calls to be closed during a future garbage collection. . .Pr display\(mi>context display .LP See \f2XtDisplayToApplicationContext\fP. . .Pr set-context-fallback-resources! context . resources .LP See \f2XtAppSetFallbackResources\fP. Each \f2resource\fP is a string. . .Pr context-main-loop context .LP See \f2XtAppMainLoop\fP. . .Pr context-pending context .LP See \f2XtAppPending\fP. Returns a list of symbols (\f5x-event\fP, \f5timer\fP, \f5alternate-input\fP). . .Pr context-process-event context . mask .LP See \f2XtProcessEvent\fP. The optional argument \f2mask\fP is a list of symbols (see \f2context-pending\fP above). \f2XtIMAll\fP is used if the \f2mask\fP argument is omitted . .Pr context-add-work-proc context procedure .LP See \f2XtAppAddWorkProc\fP. Returns an \f2identifier\fP that can be used as an argument to \f2remove-work-proc\fP. \f2procedure\fP is a procedure with no arguments. . .Pr remove-work-proc identifier .LP See \f2XtRemoveWorkProc\fP. \f2identifier\fP must be the return value of a previous call to \f2context-add-work-proc\fP. Each such \f2identifier\fP can be used as an argument for \f2remove-work-proc\fP only once. . .Pr context-add-timeout context timer-value procedure .LP See \f2XtAppAddTimeOut\fP. \f2timer-value\fP is an integer. Returns an \f2identifier\fP that can be used as an argument to \f2remove-timeout\fP. The time-out procedure will be called with one argument, the identifier returned by the call to \f2context-add-timeout\fP (i.\|e.\& the object that uniquely identifies the timer). . .Pr remove-timeout identifier .LP See \f2XtRemoveTimeOut\fP. \f2identifier\fP must be the return value of a previous call to \f2context-add-timeout\fP. Each such \f2identifier\fP can be used as an argument for \f2remove-timeout\fP only once. . .Pr context-add-input context source procedure . mask .LP See \f2XtAppAddInput\fP. \f2source\fP is a file port. Returns an \f2identifier\fP that can be used as an argument to \f2context-remove-input\fP. The \f2procedure\fP will be called with two arguments \- \f2source\fP and the identifier returned by the call to \f2context-add-input\fP. .LP The optional \f2mask\fP argument is a list of one or more of the symbols \f2read\fP, \f2write\fP, and \f2exception\fP. It specifies the condition on which the procedure will be called. If no \f2mask\fP argument is given, \f2read\fP is used if \f2source\fP is an input-port, \f2write\fP if it is an output-port, and both \f2read\fP and \f2write\fP if it is an input-output-port. . .Pr remove-input identifier .LP See \f2XtRemoveInput\fP. \f2identifier\fP must be the return value of a previous call to \f2context-add-input\fP. Each such \f2identifier\fP can be used as an argument for \f2remove-input\fP only once. . .Pr identifier? x .LP Returns #t iff \f2x\fP is an \f2identifier\fP (an object returned by functions like \f2context-add-timeout\fP). . .Ch "Translations Management Functions" . .Pr context-add-action context name procedure .LP See \f2XtAppAddActions\fP. \f2name\fP is the name of the action (a string or a symbol). The action procedure will be invoked with three arguments: a widget, a list of event-specific arguments (see \f2handle-events\fP) and a list of strings (the action arguments). . .Pr augment-translations widget translation-table .LP See \f2XtAugmentTranslations\fP. \f2translation-table\fP is a string; \f2XtParseTranslationTable\fP is applied to it. . .Pr override-translations widget translation-table .LP See \f2XtOverrideTranslations\fP. \f2translation-table\fP is a string; \f2XtParseTranslationTable\fP is applied to it. . .Pr uninstall-translations widget .LP See \f2XtUninstallTranslations\fP. . .Pr install-accelerators dst-widget src-widget .LP See \f2XtInstallAccelerators\fP. . .Pr install-all-accelerators dst-widget src-widget .LP See \f2XtInstallAllAccelerators\fP. . .Pr multi-click-time display .LP See \f2XtGetMultiClickTime\fP. Returns an integer. . .Pr set-multi-click-time! display time .LP See \f2XtSetMultiClickTime\fP. \f2time\fP is an integer. . .Ch "Error Handling" . .Va xt-warning-handler .LP See \f2XtSetWarningHandler\fP. When a warning message is to be printed by the Xt intrinsics and the global variable \f2xt-warning-handler\fP is bound to a compound procedure, this procedure is invoked with the error message (a string) as an argument. When this variable is not bound to a compound procedure, the message is sent to the current output port. The initial value of this variable is the empty list. .LP This interface is bogus and will be replaced by a more useful mechanism in future versions of the software. . .Ch "Miscellaneous Functions" . .Pr xt-release-4-or-later? .LP Returns always #t. . .Pr xt-release-5-or-later? .LP Returns #t iff the Xt extension is linked together with the X11 Release 5 toolkit intrinsics or later versions of the intrinsics. . .Pr xt-release-6-or-later? .LP Returns #t iff the Xt extension is linked together with the X11 Release 6 toolkit intrinsics or later versions of the intrinsics. . .Ch "Interaction with the Garbage Collector" . .PP .Ix "garbage collector" The Scheme garbage collector destroys objects of type \f2context\fP or \f2widget\fP that are not longer accessible from within the Scheme program. This is done by invoking the function \f2destroy-context\fP or \f2destroy-widget\fP, respectively, with the unreferenced object as an argument. .PP The garbage collector only destroys objects that have been created from with the Scheme program (by functions like \f2create-context\fP or \f2create-widget\fP). Objects that have been obtained from Xt through functions like \f2widget-context\fP (and are owned by the Xt internals), are ignored by the garbage collector. .PP Programmers must make sure that an object is accessible during the object's entire lifetime, otherwise future runs of the garbage collector can result in undesired termination of the object. One must be especially careful when results of functions that create new objects (such as \f2create-context\fP) are ignored or assigned to local variables as in .Ss (define (initialize) (let* ((con (create-context)) (dpy (initialize-display con #f 'Test #f))) (create-shell 'Test #f (find-class 'application-shell) dpy)))) .Se .PP In this example, after termination of the function, the garbage collector will destroy the application context created by the call to \f2create-context\fP as well as the display, as they are no longer directly accessible from within the program. Bugs like this are often hard to find, since (in the above example) the shell widget returned by \f2initialize\fP can still be used, although its application context and the display associated with the application context have already been destroyed. .PP The problem can be solved by re-writing the above function like this: .Ss (define initialize #f) .sp .5 (let ((con) (dpy)) (set! initialize (lambda () (set! con (create-context)) (set! dpy (initialize-display con #f 'Test #f)) (create-shell 'Test #f (find-class 'application-shell) dpy)))) .Se .PP An alternative solution is to place the application context and display into a global variable, so that they can be terminated explicitly by the program when desired. elk-3.99.8/doc/xt/Makefile.in0000644000175000017500000003060211577103434012573 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = doc/xt DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(docsdir)" DATA = $(docs_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ELK_CFLAGS = @ELK_CFLAGS@ ELK_LDFLAGS = @ELK_LDFLAGS@ ELK_LIBS = @ELK_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INCLUDES = @INCLUDES@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOTIF_CFLAGS = @MOTIF_CFLAGS@ MOTIF_LIBS = @MOTIF_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STDINT_HEADER = @STDINT_HEADER@ STRIP = @STRIP@ VERSION = @VERSION@ XAW_CFLAGS = @XAW_CFLAGS@ XAW_LIBS = @XAW_LIBS@ XMKMF = @XMKMF@ XT_CFLAGS = @XT_CFLAGS@ XT_LIBS = @XT_LIBS@ X_CFLAGS = @X_CFLAGS@ X_LIBS = @X_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = xt.ms CLEANFILES = index.raw index.ms xt.ps xt.html @HAVE_GROFF_TRUE@docs_DATA = xt.ps @HAVE_GROFF_TRUE@docsdir = $(datadir)/doc/@PACKAGE@/ps MANUAL = $(srcdir)/xt.ms TROFF = groff -ms -t UNROFF = unroff -ms all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/xt/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/xt/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-docsDATA: $(docs_DATA) @$(NORMAL_INSTALL) test -z "$(docsdir)" || $(MKDIR_P) "$(DESTDIR)$(docsdir)" @list='$(docs_DATA)'; test -n "$(docsdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(docsdir)" || exit $$?; \ done uninstall-docsDATA: @$(NORMAL_UNINSTALL) @list='$(docs_DATA)'; test -n "$(docsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(docsdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(docsdir)" && rm -f $$files tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(docsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-docsDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-docsDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-docsDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-docsDATA xt.ps: $(MANUAL) index.ms (cat $(MANUAL) $(srcdir)/../util/tmac.index index.ms; echo ".Tc") \ | $(TROFF) 2> /dev/null > xt.ps xt.html: $(MANUAL) (cat $?; echo ".Tc") | $(UNROFF) document=xt index.ms: $(MANUAL) index.raw sort -f -t'#' +1 -3 +0n index.raw \ | $(AWK) -f $(srcdir)/../util/fixindex.awk \ | $(AWK) -f $(srcdir)/../util/block.awk >index.ms index.raw: $(MANUAL) $(TROFF) $(MANUAL) 2> index.raw >/dev/null #check: # checknr -c.Ul.Pr.Sy.Va.Sh.Ix.Id.Ch -a.Ss.Se.[[.]] $(MANUAL) \ # | grep -v "Empty command" # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: elk-3.99.8/doc/xt/Makefile.am0000644000175000017500000000136111577076306012571 00000000000000EXTRA_DIST = xt.ms CLEANFILES = index.raw index.ms xt.ps xt.html if HAVE_GROFF docs_DATA = xt.ps docsdir = $(datadir)/doc/@PACKAGE@/ps endif MANUAL = $(srcdir)/xt.ms TROFF = groff -ms -t UNROFF = unroff -ms xt.ps: $(MANUAL) index.ms (cat $(MANUAL) $(srcdir)/../util/tmac.index index.ms; echo ".Tc") \ | $(TROFF) 2> /dev/null > xt.ps xt.html: $(MANUAL) (cat $?; echo ".Tc") | $(UNROFF) document=xt index.ms: $(MANUAL) index.raw sort -f -t'#' +1 -3 +0n index.raw \ | $(AWK) -f $(srcdir)/../util/fixindex.awk \ | $(AWK) -f $(srcdir)/../util/block.awk >index.ms index.raw: $(MANUAL) $(TROFF) $(MANUAL) 2> index.raw >/dev/null #check: # checknr -c.Ul.Pr.Sy.Va.Sh.Ix.Id.Ch -a.Ss.Se.[[.]] $(MANUAL) \ # | grep -v "Empty command" elk-3.99.8/AUTHORS0000644000175000017500000000375511577076306010416 00000000000000$Id$ Elk was developed from 1990 to 1995 by Oliver Laumann. Sam Hocevar took over development in 2002. Numerous users of the Extension Language Kit (too many to mention them all) have contributed ideas, suggestions for improvements, bug reports, source code, useful feedback, as well as other kinds of support to this and earlier releases. Their help has made the present version of Elk Extension Language Kit a genuinely collective effort. Oliver is especially obliged to his former colleague Carsten Bormann, who has significantly influenced the design of Elk since the beginning of the project in 1987. Carsten also wrote most of the bignum code. Oliver also would like to thank Claus Bathe of NME Berlin for securing the permission from his management to publish Elk 1.2 (from which the present version has been derived), and Prof. Dr. Sigram Schindler for providing the work environment for his research work at Technische Universitaet Berlin. In addition, Oliver would like to thank Nick Betteridge, Stephen Bevan, Alan Bishop, Tim Bradshaw, Paul Breslaw, Dennis Brueni, Thomas Dickey, Ted Dunning, Gerhard Eckel, Walter Eder, Joe Esch, Mikel Evins, Ed Ferguson, Ram Firestone, Robert Forsman, Ken Fox, Thomas Gellekum, Robert Glickstein, George Hartzell, Robert Henry, Don Hopkins, Xiaoli Huang, Bill Janssen, Rob Jellinghaus, Robert Joop, Kazuhiko Kato, Doo-Hwan Kim, Bengt Kleberg, Richard Kreutzer, Richard Kuhns, Dinh Le, John Lewis, Tor Lillqvist, Christopher Maeda, Steven Majewski, Craig McPheeters, Zdzislaw Meglicki, Perry Metzger, Lars Nyman, Richard O'Keefe, Bob Pendelton, Flip Phillips, Norbert Preining, Dave Richards, Robert Sanders, Supreet Singh, Martin Stut, Brian Taylor, Scott Watson, and Mike Wray. Oliver apologizes for any omissions from this--necessarily incomplete--list. Sam would like to thank James Bostock, Sven Hartrumpf, Mark Sapa, Phillip Rulon, Martin Rumori and Sanel Zukan (support for [] delimiters) for their useful bug reports and patches on the road to Elk 4.0. elk-3.99.8/lib/0000755000175000017500000000000011577110017010146 500000000000000elk-3.99.8/lib/misc/0000755000175000017500000000000011577110017011101 500000000000000elk-3.99.8/lib/misc/newhandler.cpp0000644000175000017500000000114711577076306013673 00000000000000#include "scheme.h" #include #ifdef USE_ATTC_PLUS_PLUS # define set_new_handler set_new_handler__FPFv_v #endif static Object New_Handler; static void New_Handler_Proc () { (void)Funcall (New_Handler, Null, 0); } static Object P_Set_New_Handler (Object p) { Object old; Check_Procedure (p); old = New_Handler; New_Handler = p; return old; } extern "C" void elk_init_lib_cplusplus () { New_Handler = Null; Global_GC_Link (New_Handler); std::new_handler (New_Handler_Proc); Define_Primitive ((Object (*)())P_Set_New_Handler, "set-c++-new-handler!", 1, 1, EVAL); } elk-3.99.8/lib/misc/monitor.c0000644000175000017500000000567011577076306012700 00000000000000/* monitor.c: A trivial function to enable and disable execution profiling. * * Evaluate "(monitor #t)" to enable profiling; "(monitor #f)" to * disable profiling and create a mon.out (this is done automatically * on exit by means of an extension finalization function). * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ /* This extension may not work on some platforms. * * On DECstations running Ultrix, you may have to evaluate * (set! load-libraries "/usr/lib/cmplrs/cc/libprof1_G0.a -lc_G0") * before loading monitor.o. * * On older versions of BSD and SunOS you might have to * ar x /lib/libc.a mon.o * and replace in the symbol table of mon.o the symbols mcount and * _moncontrol by something else (e.g. Mcount and _Mcontrol); then * ld -r mon.o monitor.o; mv a.out monitor.o; rm mon.o * Or you might have to * cp /lib/mcrt0.o mon.o, * then, in mon.o, replace start by Start and _environ by _Environ * and call the linker as shown above. You can do the symbol table * hacking by editing mon.o with emacs. */ #include "config.h" #include #include #include "scheme.h" #define MONSTART 2 static int monitoring; static Object P_Monitor (Object on) { char *brk; extern char *sbrk(); Check_Type (on, T_Boolean); Disable_Interrupts; if (Truep (on)) { if (!monitoring) { brk = sbrk (0); monstartup ((int (*)())MONSTART, (int (*)())brk); monitoring = 1; } } else { monitor (0); monitoring = 0; } Enable_Interrupts; return Void; } void elk_init_lib_monitor () { Define_Primitive (P_Monitor, "monitor", 1, 1, EVAL); } void elk_finit_lib_monitor () { if (monitoring) { monitoring = 0; printf ("[writing mon.out]\n"); monitor (0); } } elk-3.99.8/lib/misc/debug.c0000644000175000017500000000267111577076306012275 00000000000000/* debug.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "config.h" #include "scheme.h" static Object P_Debug (Object on) { Check_Type (on, T_Boolean); GC_Debug = EQ(on, True); return Void; } void elk_init_lib_debug () { Define_Primitive (P_Debug, "debug", 1, 1, EVAL); } elk-3.99.8/lib/misc/Makefile.in0000644000175000017500000006164211577103434013104 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = lib/misc DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) bitstring_la_DEPENDENCIES = $(top_builddir)/src/libelk.la am_bitstring_la_OBJECTS = bitstring.lo bitstring_la_OBJECTS = $(am_bitstring_la_OBJECTS) bitstring_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(bitstring_la_LDFLAGS) $(LDFLAGS) -o $@ debug_la_DEPENDENCIES = $(top_builddir)/src/libelk.la am_debug_la_OBJECTS = debug.lo debug_la_OBJECTS = $(am_debug_la_OBJECTS) debug_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(debug_la_LDFLAGS) \ $(LDFLAGS) -o $@ elk_eval_la_DEPENDENCIES = $(top_builddir)/src/libelk.la am_elk_eval_la_OBJECTS = elk-eval.lo elk_eval_la_OBJECTS = $(am_elk_eval_la_OBJECTS) elk_eval_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(elk_eval_la_LDFLAGS) $(LDFLAGS) -o $@ gdbm_la_DEPENDENCIES = $(top_builddir)/src/libelk.la am_gdbm_la_OBJECTS = gdbm.lo gdbm_la_OBJECTS = $(am_gdbm_la_OBJECTS) gdbm_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(gdbm_la_LDFLAGS) \ $(LDFLAGS) -o $@ @HAVE_GDBM_TRUE@am_gdbm_la_rpath = -rpath $(pkglibdir) hack_la_DEPENDENCIES = $(top_builddir)/src/libelk.la am_hack_la_OBJECTS = hack.lo hack_la_OBJECTS = $(am_hack_la_OBJECTS) hack_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(hack_la_LDFLAGS) \ $(LDFLAGS) -o $@ monitor_la_DEPENDENCIES = $(top_builddir)/src/libelk.la am_monitor_la_OBJECTS = monitor.lo monitor_la_OBJECTS = $(am_monitor_la_OBJECTS) monitor_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(monitor_la_LDFLAGS) $(LDFLAGS) -o $@ @HAVE_MONITOR_TRUE@am_monitor_la_rpath = -rpath $(pkglibdir) newhandler_la_DEPENDENCIES = $(top_builddir)/src/libelk.la am_newhandler_la_OBJECTS = newhandler.lo newhandler_la_OBJECTS = $(am_newhandler_la_OBJECTS) newhandler_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(newhandler_la_LDFLAGS) $(LDFLAGS) -o $@ @HAVE_CXX_TRUE@am_newhandler_la_rpath = -rpath $(pkglibdir) record_la_DEPENDENCIES = $(top_builddir)/src/libelk.la am_record_la_OBJECTS = record.lo record_la_OBJECTS = $(am_record_la_OBJECTS) record_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(record_la_LDFLAGS) $(LDFLAGS) -o $@ regexp_la_DEPENDENCIES = $(top_builddir)/src/libelk.la am_regexp_la_OBJECTS = regexp.lo regexp_la_OBJECTS = $(am_regexp_la_OBJECTS) regexp_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(regexp_la_LDFLAGS) $(LDFLAGS) -o $@ struct_la_DEPENDENCIES = $(top_builddir)/src/libelk.la am_struct_la_OBJECTS = struct.lo struct_la_OBJECTS = $(am_struct_la_OBJECTS) struct_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(struct_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/.auto/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(bitstring_la_SOURCES) $(debug_la_SOURCES) \ $(elk_eval_la_SOURCES) $(gdbm_la_SOURCES) $(hack_la_SOURCES) \ $(monitor_la_SOURCES) $(newhandler_la_SOURCES) \ $(record_la_SOURCES) $(regexp_la_SOURCES) $(struct_la_SOURCES) DIST_SOURCES = $(bitstring_la_SOURCES) $(debug_la_SOURCES) \ $(elk_eval_la_SOURCES) $(gdbm_la_SOURCES) $(hack_la_SOURCES) \ $(monitor_la_SOURCES) $(newhandler_la_SOURCES) \ $(record_la_SOURCES) $(regexp_la_SOURCES) $(struct_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ELK_CFLAGS = @ELK_CFLAGS@ ELK_LDFLAGS = @ELK_LDFLAGS@ ELK_LIBS = @ELK_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INCLUDES = @INCLUDES@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOTIF_CFLAGS = @MOTIF_CFLAGS@ MOTIF_LIBS = @MOTIF_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STDINT_HEADER = @STDINT_HEADER@ STRIP = @STRIP@ VERSION = @VERSION@ XAW_CFLAGS = @XAW_CFLAGS@ XAW_LIBS = @XAW_LIBS@ XMKMF = @XMKMF@ XT_CFLAGS = @XT_CFLAGS@ XT_LIBS = @XT_LIBS@ X_CFLAGS = @X_CFLAGS@ X_LIBS = @X_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ NULL = pkglib_LTLIBRARIES = \ bitstring.la \ elk-eval.la \ hack.la \ regexp.la \ debug.la \ $(gdbm_la) \ $(monitor_la) \ record.la \ struct.la \ $(newhandler_la) \ $(NULL) bitstring_la_SOURCES = bitstring.c bitstring_la_LDFLAGS = -module -avoid-version -no-undefined bitstring_la_LIBADD = $(top_builddir)/src/libelk.la elk_eval_la_SOURCES = elk-eval.c elk_eval_la_LDFLAGS = -module -avoid-version -no-undefined elk_eval_la_LIBADD = $(top_builddir)/src/libelk.la hack_la_SOURCES = hack.c hack_la_LDFLAGS = -module -avoid-version -no-undefined hack_la_LIBADD = $(top_builddir)/src/libelk.la regexp_la_SOURCES = regexp.c regexp_la_LDFLAGS = -module -avoid-version -no-undefined regexp_la_LIBADD = $(top_builddir)/src/libelk.la debug_la_SOURCES = debug.c debug_la_LDFLAGS = -module -avoid-version -no-undefined debug_la_LIBADD = $(top_builddir)/src/libelk.la @HAVE_GDBM_TRUE@gdbm_la = gdbm.la gdbm_la_SOURCES = gdbm.c gdbm_la_LDFLAGS = -module -avoid-version -no-undefined gdbm_la_LIBADD = $(top_builddir)/src/libelk.la -lgdbm @HAVE_MONITOR_TRUE@monitor_la = monitor.la monitor_la_SOURCES = monitor.c monitor_la_LDFLAGS = -module -avoid-version -no-undefined monitor_la_LIBADD = $(top_builddir)/src/libelk.la record_la_SOURCES = record.c record_la_LDFLAGS = -module -avoid-version -no-undefined record_la_LIBADD = $(top_builddir)/src/libelk.la struct_la_SOURCES = struct.c struct_la_LDFLAGS = -module -avoid-version -no-undefined struct_la_LIBADD = $(top_builddir)/src/libelk.la @HAVE_CXX_TRUE@newhandler_la = newhandler.la newhandler_la_SOURCES = newhandler.cpp newhandler_la_LDFLAGS = -module -avoid-version -no-undefined newhandler_la_LIBADD = $(top_builddir)/src/libelk.la all: all-am .SUFFIXES: .SUFFIXES: .c .cpp .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign lib/misc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign lib/misc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done bitstring.la: $(bitstring_la_OBJECTS) $(bitstring_la_DEPENDENCIES) $(bitstring_la_LINK) -rpath $(pkglibdir) $(bitstring_la_OBJECTS) $(bitstring_la_LIBADD) $(LIBS) debug.la: $(debug_la_OBJECTS) $(debug_la_DEPENDENCIES) $(debug_la_LINK) -rpath $(pkglibdir) $(debug_la_OBJECTS) $(debug_la_LIBADD) $(LIBS) elk-eval.la: $(elk_eval_la_OBJECTS) $(elk_eval_la_DEPENDENCIES) $(elk_eval_la_LINK) -rpath $(pkglibdir) $(elk_eval_la_OBJECTS) $(elk_eval_la_LIBADD) $(LIBS) gdbm.la: $(gdbm_la_OBJECTS) $(gdbm_la_DEPENDENCIES) $(gdbm_la_LINK) $(am_gdbm_la_rpath) $(gdbm_la_OBJECTS) $(gdbm_la_LIBADD) $(LIBS) hack.la: $(hack_la_OBJECTS) $(hack_la_DEPENDENCIES) $(hack_la_LINK) -rpath $(pkglibdir) $(hack_la_OBJECTS) $(hack_la_LIBADD) $(LIBS) monitor.la: $(monitor_la_OBJECTS) $(monitor_la_DEPENDENCIES) $(monitor_la_LINK) $(am_monitor_la_rpath) $(monitor_la_OBJECTS) $(monitor_la_LIBADD) $(LIBS) newhandler.la: $(newhandler_la_OBJECTS) $(newhandler_la_DEPENDENCIES) $(newhandler_la_LINK) $(am_newhandler_la_rpath) $(newhandler_la_OBJECTS) $(newhandler_la_LIBADD) $(LIBS) record.la: $(record_la_OBJECTS) $(record_la_DEPENDENCIES) $(record_la_LINK) -rpath $(pkglibdir) $(record_la_OBJECTS) $(record_la_LIBADD) $(LIBS) regexp.la: $(regexp_la_OBJECTS) $(regexp_la_DEPENDENCIES) $(regexp_la_LINK) -rpath $(pkglibdir) $(regexp_la_OBJECTS) $(regexp_la_LIBADD) $(LIBS) struct.la: $(struct_la_OBJECTS) $(struct_la_DEPENDENCIES) $(struct_la_LINK) -rpath $(pkglibdir) $(struct_la_OBJECTS) $(struct_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bitstring.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elk-eval.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdbm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hack.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/monitor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/newhandler.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/record.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regexp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/struct.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES echo-sources: ; echo $(SOURCES) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: elk-3.99.8/lib/misc/regexp.c0000644000175000017500000001657311577076306012507 00000000000000/* regexp.c: The regular expression extension. It provides Scheme language * bindings to the POSIX regcomp/regexec functions. * * Inspired by a GNU regular expression extension contributed by * Stephen J. Bevan to an earlier version of Elk. * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "config.h" #include #ifdef HAVE_REGCOMP # include # include #endif #include "scheme.h" #ifdef HAVE_REGCOMP #define REGEXP(x) ((struct S_Regexp *)POINTER(x)) #define MATCH(x) ((struct S_Match *)POINTER(x)) struct S_Regexp { Object pattern; regex_t r; int flags; }; struct S_Match { Object tag; size_t num; regmatch_t matches[1]; }; int T_Regexp, T_Match; static SYMDESCR Compile_Syms[] = { { "extended", REG_EXTENDED }, { "ignore-case", REG_ICASE }, { "no-subexpr", REG_NOSUB }, { "newline", REG_NEWLINE }, { 0, 0 } }; static SYMDESCR Exec_Syms[] = { { "not-bol", REG_NOTBOL }, { "not-eol", REG_NOTEOL }, { 0, 0 } }; static Object P_Regexpp(Object x) { return TYPE(x) == T_Regexp ? True : False; } static Object P_Matchp(Object x) { return TYPE(x) == T_Match ? True : False; } static int Regexp_Eqv(Object a, Object b) { return EQ(REGEXP(a)->pattern, REGEXP(b)->pattern) && REGEXP(a)->flags == REGEXP(b)->flags; } static int Regexp_Equal(Object a, Object b) { return Equal(REGEXP(a)->pattern, REGEXP(b)->pattern) && REGEXP(a)->flags == REGEXP(b)->flags; } static int Match_Equal(Object a, Object b) { size_t i; struct S_Match *ap = MATCH(a), *bp = MATCH(b); if (ap->num != bp->num) return 0; for (i = 0; i < ap->num; i++) { if (ap->matches[i].rm_so != bp->matches[i].rm_so || ap->matches[i].rm_eo != bp->matches[i].rm_eo) return 0; } return 1; } static int Match_Size(Object m) { return sizeof(struct S_Match) + (MATCH(m)->num - 1) * sizeof(regmatch_t); } static int Regexp_Visit(Object *p, int (*f)()) { f(®EXP(*p)->pattern); return 0; } static int Regexp_Print(Object x, Object port, int raw, int depth, int length) { Format(port, "#[regexp ~s]", 12, 1, ®EXP(x)->pattern); return 0; } static int Match_Print(Object x, Object port, int raw, int depth, int length) { Printf(port, "#[regexp-match %lu]", POINTER(x)); return 0; } static Object Terminate_Regexp(Object r) { regfree(®EXP(r)->r); return Void; } static Object P_Make_Regexp(int argc, Object *argv) { Object r; char msg[256]; int flags = 0, ret; Check_Type(argv[0], T_String); if (argc == 2) flags = Symbols_To_Bits(argv[1], 1, Compile_Syms); r = Alloc_Object(sizeof(struct S_Regexp), T_Regexp, 0); REGEXP(r)->pattern = argv[0]; REGEXP(r)->flags = flags; ret = regcomp(®EXP(r)->r, Get_String(argv[0]), flags); if (ret != 0) { #ifdef REG_ENOSYS if (ret == REG_ENOSYS) Primitive_Error("function not supported by operating system"); #endif (void)regerror(ret, ®EXP(r)->r, msg, sizeof(msg)); Primitive_Error("~a", Make_String(msg, strlen(msg))); } Register_Object(r, (GENERIC)0, Terminate_Regexp, 0); return r; } static Object P_Regexp_Pattern(Object r) { Check_Type(r, T_Regexp); return REGEXP(r)->pattern; } static Object P_Regexp_Flags(Object r) { Check_Type(r, T_Regexp); return Bits_To_Symbols((unsigned long)REGEXP(r)->flags, 1, Compile_Syms); } static Object P_Regexp_Exec(int argc, Object *argv) { char *str, msg[256]; Object r, m; size_t num; unsigned int from; int flags, ret; GC_Node; r = argv[0]; Check_Type(r, T_Regexp); Check_Type(argv[1], T_String); str = Get_String(argv[1]); from = Get_Unsigned(argv[2]); if (from > STRING(argv[1])->size) Range_Error(argv[2]); if (argc == 4) flags = (int)Symbols_To_Bits(argv[3], 1, Exec_Syms); else flags = 0; if (REGEXP(r)->flags & REG_NOSUB) num = 1; else num = REGEXP(r)->r.re_nsub + 1; GC_Link(r); m = Alloc_Object(sizeof(struct S_Match) + (num-1) * sizeof(regmatch_t), T_Match, 0); GC_Unlink; MATCH(m)->tag = Null; if (REGEXP(r)->flags & REG_NOSUB) num = 0; MATCH(m)->num = num; ret = regexec(®EXP(r)->r, str+from, num, MATCH(m)->matches, flags); if (ret == 0) return m; if (ret == REG_NOMATCH) return False; (void)regerror(ret, ®EXP(r)->r, msg, sizeof(msg)); Primitive_Error("~a", Make_String(msg, strlen(msg))); /*NOTREACHED*/ } static Object P_Match_Number(Object m) { Check_Type(m, T_Match); return Make_Unsigned_Long((unsigned long)MATCH(m)->num); } static Object P_Match_Start(Object m, Object n) { size_t i; Check_Type(m, T_Match); i = (size_t)Get_Unsigned_Long(n); if (i >= MATCH(m)->num) Range_Error(n); return Make_Unsigned_Long((unsigned long)MATCH(m)->matches[i].rm_so); } static Object P_Match_End(Object m, Object n) { size_t i; Check_Type(m, T_Match); i = (size_t)Get_Unsigned_Long(n); if (i >= MATCH(m)->num) Range_Error(n); return Make_Unsigned_Long((unsigned long)MATCH(m)->matches[i].rm_eo); } #define Def_Prim Define_Primitive #endif /* HAVE_REGCOMP */ void elk_init_lib_regexp() { #ifdef HAVE_REGCOMP T_Regexp = Define_Type(0, "regexp", 0, sizeof(struct S_Regexp), Regexp_Eqv, Regexp_Equal, Regexp_Print, Regexp_Visit); T_Match = Define_Type(0, "regexp-match", Match_Size, 0, Match_Equal, Match_Equal, Match_Print, 0); Def_Prim(P_Regexpp, "regexp?", 1, 1, EVAL); Def_Prim(P_Matchp, "regexp-match?", 1, 1, EVAL); Def_Prim(P_Make_Regexp, "make-regexp", 1, 2, VARARGS); Def_Prim(P_Regexp_Pattern,"regexp-pattern", 1, 1, EVAL); Def_Prim(P_Regexp_Flags, "regexp-flags", 1, 1, EVAL); Def_Prim(P_Regexp_Exec, "regexp-exec", 3, 4, VARARGS); Def_Prim(P_Match_Number, "regexp-match-number", 1, 1, EVAL); Def_Prim(P_Match_Start, "regexp-match-start", 2, 2, EVAL); Def_Prim(P_Match_End, "regexp-match-end", 2, 2, EVAL); P_Provide(Intern(":regular-expressions")); #endif P_Provide(Intern ("regexp.la")); } elk-3.99.8/lib/misc/hack.c0000644000175000017500000000311111577076306012103 00000000000000/* hack.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "config.h" #include "scheme.h" static Object P_Hack_Procedure_Environment (Object p, Object e) { Check_Type (p, T_Compound); Check_Type (e, T_Environment); COMPOUND(p)->env = e; return p; } void elk_init_lib_hack () { Define_Primitive (P_Hack_Procedure_Environment, "hack-procedure-environment!", 2, 2, EVAL); P_Provide (Intern ("hack.la")); } elk-3.99.8/lib/misc/struct.c0000644000175000017500000001121411577076306012524 00000000000000/* struct.c: The `structure' extension is obsolete and should not be used * in applications any longer; it has been replaced by the more powerful * `record' extension. * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "config.h" #include "scheme.h" #define STRUCT(x) ((struct S_Struct *)POINTER(x)) struct S_Struct { Object name; Object slots; Object values; }; int T_Struct; static Object P_Structurep (Object x) { return TYPE(x) == T_Struct ? True : False; } static Object P_Structure_Name (Object x) { Check_Type (x, T_Struct); return STRUCT(x)->name; } static Object P_Structure_Slots (Object x) { Check_Type (x, T_Struct); return P_Vector_To_List (STRUCT(x)->slots); } static Object P_Structure_Values (Object x) { Check_Type (x, T_Struct); return P_Vector_To_List (STRUCT(x)->values); } static void Check_Structure_Type (Object x, Object t) { Check_Type (x, T_Struct); Check_Type (t, T_Symbol); if (!EQ(STRUCT(x)->name, t)) Primitive_Error ("wrong structure type ~s (expected ~s)", STRUCT(x)->name, t); } static Object P_Structure_Ref (Object x, Object t, Object n) { Check_Structure_Type (x, t); return P_Vector_Ref (STRUCT(x)->values, n); } static Object P_Structure_Set (Object x, Object t, Object n, Object obj) { Check_Structure_Type (x, t); return P_Vector_Set (STRUCT(x)->values, n, obj); } static Object P_Make_Structure (Object name, Object slots) { register int n; Object s, vec, *vp; GC_Node3; Check_Type (name, T_Symbol); Check_List (slots); s = Null; GC_Link3 (s, name, slots); s = Alloc_Object (sizeof (struct S_Struct), T_Struct, 0); STRUCT(s)->name = name; STRUCT(s)->values = STRUCT(s)->slots = Null; n = Fast_Length (slots); vec = Make_Vector (n, Null); STRUCT(s)->values = vec; vec = Make_Vector (n, Null); STRUCT(s)->slots = vec; GC_Unlink; for (vp = VECTOR(vec)->data; n--; slots = Cdr (slots)) { Check_Type (Car (slots), T_Symbol); *vp++ = Car (slots); } return s; } static int Structure_Eqv (Object a, Object b) { return EQ(a,b); } static int Structure_Equal (Object a, Object b) { return EQ(STRUCT(a)->name,STRUCT(b)->name) && Equal (STRUCT(a)->slots, STRUCT(b)->slots) && Equal (STRUCT(a)->values, STRUCT(b)->values); } static int Structure_Print (Object x, Object port, int raw, int depth, int length) { struct S_String *s = STRING(SYMBOL(STRUCT(x)->name)->name); Printf (port, "#[%.*s-structure %lu]", s->size, s->data, POINTER(x)); return 0; } static int Structure_Visit (register Object *sp, register int (*f)()) { (*f)(&STRUCT(*sp)->name); (*f)(&STRUCT(*sp)->slots); (*f)(&STRUCT(*sp)->values); return 0; } void elk_init_lib_struct () { T_Struct = Define_Type (0, "structure", NOFUNC, sizeof (struct S_Struct), Structure_Eqv, Structure_Equal, Structure_Print, Structure_Visit); Define_Primitive (P_Structurep, "structure?", 1, 1, EVAL); Define_Primitive (P_Structure_Name, "structure-name", 1, 1, EVAL); Define_Primitive (P_Structure_Slots, "structure-slots", 1, 1, EVAL); Define_Primitive (P_Structure_Values, "structure-values", 1, 1, EVAL); Define_Primitive (P_Structure_Ref, "structure-ref", 3, 3, EVAL); Define_Primitive (P_Structure_Set, "structure-set!", 4, 4, EVAL); Define_Primitive (P_Make_Structure, "make-structure", 2, 2, EVAL); P_Provide (Intern ("struct.la")); } elk-3.99.8/lib/misc/gdbm.c0000644000175000017500000002032411577076306012113 00000000000000/* gdbm.c: Elk/GDBM-interface. * Original version by Martin Stut . * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ /* Functions exported: * * (gdbm-file? obj) * * Type predicate for the newly defined type gdbm-file. * * (gdbm-open filename block-size type [filemode]) * * Opens a gdbm file and returns an object of type gdbm-file. * Returns #f if file cannot be opened. * filename is a string or a symbol, block-size is an integer, * type is one of the symbols 'reader, 'writer, 'create, and 'new, * the optional file mode is an integer (default: #o644). * * (gdbm-close gf) * * Closes a gdbm file. Attempts to use a closed gdbm file as * an argument to any gdbm-function causes the error message * "invalid gdbm-file" to be displayed. * * (gdbm-store gf key data mode) * * Stores an item in the gdbm file pointed to by gf. * key and data are strings, mode is a symbol (either 'insert * or 'replace). * Returns -1 if called by a reader, 1 if called with 'insert and * the key is already stored, 0 otherwise. * * (gdbm-fetch gf key) * * Searches the gdbm file pointed to by gf for data stored under * the given key and returns the data as a string. * Returns #f if nothing is stored under that key. * * (gdbm-delete gf key) * * Removes data stored under the specified key from the gdbm file gf. * Returns #f if the key is not present in the gdbm file, #t otherwise. * * (gdbm-firstkey gf) * (gdbm-nextkey gf key) * * These functions are used to access all items in a gdbm file. * Both return a key. gdbm-firstkey returns #f if the gdbm file * is empty; gdbm-nextkey returns #f if there is no next key. * * (gdbm-reorganize gf) * * Shortens the specified gdbm file (reclaims deleted space). * * (gdbm-error) * * Returns a cons cell; the car is the last error number set by * the gdbm library, the cdr is the current UNIX errno. * * (gdbm-error-text) * * Returns the last error message passed to the fatal error * function by the gdbm library (a string). * * Loading gdbm.o provides the symbol 'gdbm.o. */ #include "config.h" #include #include #include #include "scheme.h" extern gdbm_error gdbm_errno; extern int errno; static char *gdbm_error_message = ""; static SYMDESCR RW_Syms[] = { { "reader", GDBM_READER }, { "writer", GDBM_WRITER }, { "create", GDBM_WRCREAT }, { "new", GDBM_NEWDB }, { 0, 0 } }; static SYMDESCR Flag_Syms[] = { { "insert", GDBM_INSERT }, { "replace", GDBM_REPLACE }, { 0, 0 } }; int T_Gdbm_fh; struct S_gdbm_fh{ Object tag; GDBM_FILE fptr; char free; }; #define GDBM_FH(obj) ((struct S_gdbm_fh *)POINTER(obj)) int Gdbm_fh_Equal (Object a, Object b) { return !GDBM_FH(a)->free && !GDBM_FH(b)->free && GDBM_FH(a)->fptr == GDBM_FH(b)->fptr; } /*ARGSUSED*/ int Gdbm_fh_Print (Object fh, Object port, int raw, int depth, int len) { Printf (port, "#[gdbm-file %lu]", GDBM_FH(fh)->fptr); return 0; } Object P_Gdbm_filep (Object x) { return TYPE(x) == T_Gdbm_fh ? True : False; } static void Fatal_Func (char *s) { gdbm_error_message = s; fprintf (stderr, "gdbm error: %s\n", s); } Object P_Gdbm_Open (int argc, Object *argv) { Object Gdbm_fh; GDBM_FILE dbf; Disable_Interrupts; dbf = gdbm_open (Get_Strsym (argv[0]), Get_Integer (argv[1]), Symbols_To_Bits (argv[2], 0, RW_Syms), argc == 4 ? Get_Integer (argv[3]) : 0644, Fatal_Func); if (dbf == 0) { Enable_Interrupts; return False; } Gdbm_fh = Alloc_Object (sizeof (struct S_gdbm_fh), T_Gdbm_fh, 0); GDBM_FH (Gdbm_fh)->tag = Null; GDBM_FH (Gdbm_fh)->fptr = dbf; GDBM_FH (Gdbm_fh)->free = 0; Enable_Interrupts; return Gdbm_fh; } void Check_Fh (Object fh) { Check_Type (fh, T_Gdbm_fh); if (GDBM_FH(fh)->free) Primitive_Error ("invalid gdbm-file: ~s", fh); } Object P_Gdbm_Close (Object fh) { Check_Fh (fh); GDBM_FH(fh)->free = 1; Disable_Interrupts; gdbm_close (GDBM_FH(fh)->fptr); Enable_Interrupts; return Void; } Object P_Gdbm_Store (Object fh, Object key, Object content, Object flag) { int res; datum k, c; Check_Fh (fh); Check_Type (key, T_String); Check_Type (content, T_String); k.dptr = STRING(key)->data; k.dsize = STRING(key)->size; c.dptr = STRING(content)->data; c.dsize = STRING(content)->size; Disable_Interrupts; res = gdbm_store (GDBM_FH(fh)->fptr, k, c, Symbols_To_Bits (flag, 0, Flag_Syms)); Enable_Interrupts; return Make_Integer (res); } static Object Gdbm_Get (Object fh, Object key, datum (*func)()) { Object res; datum k, c; Check_Fh (fh); Check_Type (key, T_String); k.dptr = STRING(key)->data; k.dsize = STRING(key)->size; Disable_Interrupts; c = (*func) (GDBM_FH(fh)->fptr, k); Enable_Interrupts; if (c.dptr == 0) return False; res = Make_String (c.dptr, c.dsize); free (c.dptr); return res; } Object P_Gdbm_Fetch (Object fh, Object key) { return Gdbm_Get (fh, key, gdbm_fetch); } Object P_Gdbm_Nextkey (Object fh, Object key) { return Gdbm_Get (fh, key, gdbm_nextkey); } Object P_Gdbm_Delete (Object fh, Object key) { int res; datum k; Check_Fh (fh); Check_Type (key, T_String); k.dptr = STRING(key)->data; k.dsize = STRING(key)->size; Disable_Interrupts; res = gdbm_delete (GDBM_FH(fh)->fptr, k); Enable_Interrupts; return res == 0 ? True : False; } Object P_Gdbm_Firstkey (Object fh) { Object res; datum k; Check_Fh (fh); Disable_Interrupts; k = gdbm_firstkey (GDBM_FH(fh)->fptr); Enable_Interrupts; if (k.dptr == 0) return False; res = Make_String (k.dptr, k.dsize); free (k.dptr); return res; } Object P_Gdbm_Reorganize (Object fh) { Check_Fh (fh); Disable_Interrupts; gdbm_reorganize (GDBM_FH(fh)->fptr); Enable_Interrupts; return Void; } Object P_Gdbm_Error () { return Cons (Make_Integer ((int)gdbm_errno), Make_Integer (errno)); } Object P_Gdbm_Error_Text () { return Make_String (gdbm_error_message, strlen (gdbm_error_message)); } void elk_init_lib_gdbm () { Define_Primitive (P_Gdbm_Open, "gdbm-open", 3, 4, VARARGS); Define_Primitive (P_Gdbm_filep, "gdbm-file?", 1, 1, EVAL); Define_Primitive (P_Gdbm_Close, "gdbm-close", 1, 1, EVAL); Define_Primitive (P_Gdbm_Store, "gdbm-store", 4, 4, EVAL); Define_Primitive (P_Gdbm_Fetch, "gdbm-fetch", 2, 2, EVAL); Define_Primitive (P_Gdbm_Delete, "gdbm-delete", 2, 2, EVAL); Define_Primitive (P_Gdbm_Firstkey, "gdbm-firstkey", 1, 1, EVAL); Define_Primitive (P_Gdbm_Nextkey, "gdbm-nextkey", 2, 2, EVAL); Define_Primitive (P_Gdbm_Reorganize, "gdbm-reorganize", 1, 1, EVAL); Define_Primitive (P_Gdbm_Error, "gdbm-error", 0, 0, EVAL); Define_Primitive (P_Gdbm_Error_Text, "gdbm-error-text", 0, 0, EVAL); T_Gdbm_fh = Define_Type (0, "gdbm-file", NOFUNC, sizeof (struct S_gdbm_fh), Gdbm_fh_Equal, Gdbm_fh_Equal, Gdbm_fh_Print, NOFUNC); P_Provide (Intern ("gdbm.la")); } elk-3.99.8/lib/misc/elk-eval.c0000644000175000017500000000522011577076306012700 00000000000000/* elk-eval.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ /* The function * * char *Elk_Eval(char *expr); * * is similar to Tcl_Eval() in Tcl. It is called with a Scheme expression * encoded as a C string and returns the result of evaluating the expression * (as another C string), or a null pointer if an error has occured * during evaluation. * * Elk_Eval() stores its result in a static buffer of fixed size; this * can be improved easily by passing a buffer and a length as additional * arguments. */ #include "config.h" #include #include "scheme.h" static Object in, out; static char *String_Eval(char *expr) { Object str, res; char *p; GC_Node; static char buf[1024]; str = Make_String(expr, strlen(expr)); PORT(in)->name = str; PORT(in)->ptr = 0; res = General_Read(in, 0); GC_Link(res); res = Eval(res); (void)General_Print_Object(res, out, 1); str = P_Get_Output_String(out); p = Get_String(str); if (strlen(p) > sizeof buf - 1) p = "too long"; strcpy(buf, p); GC_Unlink; return buf; } char *Elk_Eval(char *expr) { char *s; s = String_Eval("\ (call-with-current-continuation (lambda (c)\ (set! error-handler (lambda a (print a) (c #f))) #t))\ "); if (strcmp(s, "#f") == 0) return 0; return String_Eval(expr); } void elk_init_eval() { in = P_Open_Input_String(Make_String("", 0)); Global_GC_Link(in); out = P_Open_Output_String(); Global_GC_Link(out); } elk-3.99.8/lib/misc/bitstring.c0000644000175000017500000004172311577076306013215 00000000000000/* bitstring.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "config.h" #include #include #include "scheme.h" #define BITSTRING(x) ((struct S_Bitstring *)POINTER(x)) struct S_Bitstring { Object tag; unsigned len; /* # of used bits; unused bits in MSB always 0 */ unsigned char data[1]; /* data[0] == LSB */ }; #define bits_to_bytes(b) (((b)+7)/8) static int masks[] = { 0, 0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80 }; static int masks2[] = { 0, 0x1, 0x3, 0x7, 0xF, 0x1F, 0x3F, 0x7F, 0xFF }; int T_Bitstring; static Object P_Bitstringp(Object x) { return TYPE(x) == T_Bitstring ? True : False; } static int Bitstring_Size(Object b) { return sizeof(struct S_Bitstring) + bits_to_bytes(BITSTRING(b)->len) - 1; } static int Bitstring_Equal(Object b1, Object b2) { struct S_Bitstring *a = BITSTRING(b1), *b = BITSTRING(b2); if (a->len != b->len) return 0; return !memcmp(a->data, b->data, bits_to_bytes(a->len)); } static Object P_Bitstring_Equalp(Object a, Object b) { return Bitstring_Equal(a, b) ? True : False; } static char *Digits(unsigned char c, int n) { static char buf[9]; int i = 0; for (; n > 0; n--) buf[i++] = c & masks[n] ? '1' : '0'; buf[i] = '\0'; return buf; } /* Print starting with MSB */ static int Bitstring_Print(Object x, Object port, int raw, int depth, int length) { int i, rem; struct S_Bitstring *b = BITSTRING(x); GC_Node2; GC_Link2(x, port); Printf(port, "#*"); i = bits_to_bytes(b->len) - 1; rem = b->len; if (rem % 8) Printf(port, Digits(b->data[i--], rem)); for ( ; i >= 0; i--) Printf(port, Digits(b->data[i], 8)); GC_Unlink; return 0; } static Object Make_Bitstring(unsigned int len) { Object b; int nbytes = bits_to_bytes(len); b = Alloc_Object(sizeof(struct S_Bitstring) + nbytes-1, T_Bitstring, 0); memset((char *)BITSTRING(b)->data, 0, nbytes); BITSTRING(b)->tag = Null; BITSTRING(b)->len = len; return b; } static void Fill_Bitstring(Object bs, int fill) { struct S_Bitstring *b = BITSTRING(bs); int i, rem; unsigned char val = fill ? ~0 : 0; i = bits_to_bytes(b->len) - 1; if (val && (rem = b->len % 8)) b->data[i--] |= masks2[rem]; for ( ; i >= 0; i--) b->data[i] = val; } static Object P_Make_Bitstring(Object len, Object init) { Object ret; int n, fill; if ((n = Get_Integer(len)) < 0) Range_Error(len); Check_Type(init, T_Boolean); fill = Truep(init); ret = Make_Bitstring((unsigned)n); if (fill) Fill_Bitstring(ret, 1); return ret; } static Object P_Bitstring_Length(Object bs) { Check_Type(bs, T_Bitstring); return Make_Unsigned(BITSTRING(bs)->len); } static int Ulong_Size(unsigned long ul) { int n; for (n = 0; ul; ul >>= 1, n++) ; return n; } static Object Ulong_To_Bitstring(unsigned long ul, unsigned int len) { Object ret; struct S_Bitstring *b; unsigned int i, siz = Ulong_Size(ul); char buf[50]; ret = Make_Bitstring(len); b = BITSTRING(ret); if (siz > len) { sprintf(buf, "length %u too small for integer %lu", len, ul); Primitive_Error(buf); } for (i = 0; ul; ul >>= 8, i++) b->data[i] = ul & 0xFF; return ret; } static unsigned int Bigbits(struct S_Bignum *b) { return b->usize ? (Ulong_Size((unsigned long)b->data[b->usize-1]) + (b->usize-1) * sizeof(gran_t) * 8) : 0; } static Object Bignum_To_Bitstring(Object big, unsigned int len) { char buf[50]; Object ret; struct S_Bitstring *b; struct S_Bignum *bn; unsigned int k, i, n; GC_Node; if (Bigbits(BIGNUM(big)) > len) { sprintf(buf, "length %u too small for integer ~s", len); Primitive_Error(buf, big); } GC_Link(big); ret = Make_Bitstring(len); GC_Unlink; b = BITSTRING(ret); bn = BIGNUM(big); n = bits_to_bytes(len); for (i = k = 0; k < bn->usize; k++, i++) { b->data[i] = bn->data[k] & 0xFF; if (i < n) b->data[++i] = bn->data[k] >> 8 & 0xFF; } return ret; } static Object P_Int_To_Bitstring(Object len, Object i) { Object isneg; int ilen; if ((ilen = Get_Integer(len)) < 0) Range_Error(len); Check_Integer(i); isneg = P_Negativep(i); if (Truep(isneg)) Range_Error(i); if (TYPE(i) == T_Fixnum) return Ulong_To_Bitstring((unsigned long)FIXNUM(i), (unsigned)ilen); return Bignum_To_Bitstring(i, (unsigned)ilen); } static Object Bitstring_To_Bignum (Object bs) { struct S_Bitstring *b; Object big; int i, n, k; gran_t digit; GC_Node; n = bits_to_bytes(BITSTRING(bs)->len); GC_Link(bs); big = Make_Uninitialized_Bignum((n+1)/2); /* assume sizeof(gran_t)==2 */ GC_Unlink; b = BITSTRING(bs); for (i = k = 0; i < n; k++, i++) { digit = b->data[i]; if (!(i & 1)) digit |= (unsigned)b->data[++i] << 8; BIGNUM(big)->data[k] = digit; } BIGNUM(big)->usize = k; Bignum_Normalize_In_Place (BIGNUM(big)); return big; } static Object P_Bitstring_To_Int(Object bs) { struct S_Bitstring *b; unsigned int u = 0; int i; Check_Type(bs, T_Bitstring); b = BITSTRING(bs); /* If there are any 1 bits above the position which fits in an * integer, use a bignum */ if (b->len >= FIXBITS) { if (b->data[sizeof(int) - 1] & (1 << 7)) return Bitstring_To_Bignum(bs); for (i = sizeof(int); i < (int)bits_to_bytes(b->len); i++) { if (b->data[i] != 0) return Bitstring_To_Bignum(bs); } } /* Otherwise, use an integer */ for (i = bits_to_bytes(b->len) - 1; i >= 0; i--) u = u << 8 | b->data[i]; return Make_Integer(u); } static Object P_Bitstring_Ref(Object bs, Object inx) { struct S_Bitstring *b; int i; Check_Type(bs, T_Bitstring); b = BITSTRING(bs); i = Get_Integer(inx); if (i < 0 || i >= (int)b->len) Range_Error(inx); return b->data[i/8] & 1 << i % 8 ? True : False; } static Object P_Bitstring_Set(Object bs, Object inx, Object val) { int old, i, j, mask; struct S_Bitstring *b; Check_Type(bs, T_Bitstring); Check_Type(val, T_Boolean); b = BITSTRING(bs); i = Get_Integer(inx); if (i < 0 || i >= (int)b->len) Range_Error(inx); j = i/8; mask = 1 << i%8; old = b->data[j] & mask; if (Truep(val)) b->data[j] |= mask; else b->data[j] &= ~mask; return old ? True : False; } static Object P_Bitstring_Zerop(Object bs) { struct S_Bitstring *b; int i; Check_Type(bs, T_Bitstring); b = BITSTRING(bs); for (i = bits_to_bytes(b->len); --i >= 0 && b->data[i] == 0 ;) ; return i < 0 ? True : False; } static Object P_Bitstring_Fill(Object bs, Object fill) { Check_Type(bs, T_Bitstring); Check_Type(fill, T_Boolean); Fill_Bitstring(bs, Truep(fill)); return Void; } #define bitop(name, op) static void name(struct S_Bitstring *a,\ struct S_Bitstring *b) {\ int i, rem;\ \ if (a->len != b->len) {\ printf("bitstrings must be of same length\n"); exit(1);\ }\ i = bits_to_bytes(a->len) - 1;\ rem = a->len % 8;\ if (rem % 8) {\ a->data[i] op b->data[i];\ a->data[i--] &= masks2[rem];\ }\ for ( ; i >= 0; i--)\ a->data[i] op b->data[i];\ } bitop(bmove, =) bitop(bnot, = ~) bitop(band, &=) bitop(bor, |=) bitop(bandnot, &= ~) bitop(bxor, ^=) static Object Bit_Operation(Object b1, Object b2, void (*fun)()) { struct S_Bitstring *a, *b; Check_Type(b1, T_Bitstring); Check_Type(b2, T_Bitstring); a = BITSTRING(b1); b = BITSTRING(b2); if (a->len != b->len) Primitive_Error("bitstrings must have identical length"); fun(a, b); return Void; } static Object P_Bitstring_Move(Object a, Object b) { return Bit_Operation(a, b, bmove); } static Object P_Bitstring_Not(Object a, Object b) { return Bit_Operation(a, b, bnot); } static Object P_Bitstring_And(Object a, Object b) { return Bit_Operation(a, b, band); } static Object P_Bitstring_Or(Object a, Object b) { return Bit_Operation(a, b, bor); } static Object P_Bitstring_Andnot(Object a, Object b) { return Bit_Operation(a, b, bandnot); } static Object P_Bitstring_Xor(Object a, Object b) { return Bit_Operation(a, b, bxor); } static Object P_Substring_Move(Object b1, Object from, Object to, Object b2, Object dst) { struct S_Bitstring *a, *b; int start1, end1, start2, end2, len, off1, off2, i, j; unsigned char mask; Check_Type(b1, T_Bitstring); Check_Type(b2, T_Bitstring); a = BITSTRING(b1); b = BITSTRING(b2); start1 = Get_Integer(from); end1 = Get_Integer(to); start2 = Get_Integer(dst); len = end1 - start1; end2 = start2 + len; if (start1 < 0 || start1 > end1) Range_Error(from); if (end1 > (int)a->len) Range_Error(to); if (start2 < 0 || end2 > (int)b->len) Range_Error(dst); if (a == b && start2 < start1) { /* copy forward (LSB to MSB) */ off1 = start1 % 8; off2 = start2 % 8; i = start1 / 8; j = start2 / 8; if (off1 == off2) { if (off1) { mask = 0xFF & ~masks2[off1]; if (off1 + len < 8) mask &= masks2[off1+len]; b->data[j] = (b->data[j] & ~mask) | (a->data[i] & mask); len -= 8 - off1; i++; j++; } for (; len >= 8; len -= 8) b->data[j++] = a->data[i++]; if (len > 0) { mask = masks2[len]; b->data[j] = (b->data[j] & ~mask) | (a->data[i] & mask); } } else { unsigned char dmask; int n, delta, shift; while (len > 0) { shift = delta = off2 - off1; if (shift < 0) shift = -shift; n = 8 - off1; mask = 0xFF & ~masks2[off1]; if (len < n) { n = len; mask &= masks2[off1+len]; } if (8 - off2 >= n) { /* rest of src byte fits into dst byte */ if (delta > 0) { dmask = mask << shift; b->data[j] = (b->data[j] & ~dmask) | (a->data[i] & mask) << shift; } else { dmask = mask >> shift; b->data[j] = (b->data[j] & ~dmask) | (unsigned int)(a->data[i] & mask) >> shift; } } else { /* nope, copy as many bits as fit into dst bye */ n = 8 - off2; mask &= masks2[off1+n]; dmask = mask << shift; b->data[j] = (b->data[j] & ~dmask) | (a->data[i] & mask) << shift; } if (off1 + n >= 8) i++; if (off2 + n >= 8) j++; off1 = (off1 + n) % 8; off2 = (off2 + n) % 8; len -= n; } } } else { /* copy backwards (MSB to LSB) */ if ((off1 = end1 % 8 - 1) < 0) off1 = 7; if ((off2 = end2 % 8 - 1) < 0) off2 = 7; i = (end1 - 1) / 8; j = (end2 - 1) / 8; if (off1 == off2) { if (off1 < 7) { if (len <= off1) mask = masks2[len] << (off1-len+1); else mask = masks2[off1+1]; b->data[j] = (b->data[j] & ~mask) | (a->data[i] & mask); len -= off1+1; i--; j--; } for (; len >= 8; len -= 8) b->data[j--] = a->data[i--]; if (len > 0) { mask = masks2[len] << (8 - len); b->data[j] = (b->data[j] & ~mask) | (a->data[i] & mask); } } else { unsigned char dmask; int n, delta, shift; while (len > 0) { shift = delta = off2 - off1; if (shift < 0) shift = -shift; n = off1 + 1; mask = masks2[n]; if (len < n) { mask = masks2[len] << (n-len); n = len; } if (off2 + 1 >= n) { /* rest of src byte fits into dst byte */ if (delta > 0) { dmask = mask << shift; b->data[j] = (b->data[j] & ~dmask) | (a->data[i] & mask) << shift; } else { dmask = mask >> shift; b->data[j] = (b->data[j] & ~dmask) | (unsigned int)(a->data[i] & mask) >> shift; } } else { /* nope, copy as many bits as fit into dst bye */ n = off2 + 1; mask = masks2[n] << (off1-n+1); dmask = mask >> shift; b->data[j] = (b->data[j] & ~dmask) | (unsigned int)(a->data[i] & mask) >> shift; } if (off1 - n < 0) i--; if (off2 - n < 0) j--; if ((off1 -= n) < 0) off1 += 8; if ((off2 -= n) < 0) off2 += 8; len -= n; } } } return Void; } /*ARGSUSED*/ static Object Bitstring_Read(Object port, int chr, int konst) { int c, str, i; FILE *f; char buf[1024], *p = buf; Object ret; f = PORT(port)->file; str = PORT(port)->flags & P_STRING; while (1) { Reader_Getc; if (c == EOF) Reader_Sharp_Eof; if (Whitespace (c) || Delimiter (c)) break; if (p == buf+1024) Reader_Error(port, "bitstring constant too long for reader"); if (c != '0' && c != '1') Reader_Error(port, "bad digit in bitstring constant"); *p++ = c; } Reader_Ungetc; ret = Make_Bitstring(p-buf); for (i = 0; p > buf; i++) if (*--p == '1') BITSTRING(ret)->data[i/8] |= 1 << i%8; return ret; } #define Def_Prim Define_Primitive void elk_init_lib_bitstring() { T_Bitstring = Define_Type(0, "bitstring", Bitstring_Size, 0, Bitstring_Equal, Bitstring_Equal, Bitstring_Print, NOFUNC); Define_Reader('*', Bitstring_Read); Def_Prim(P_Bitstringp, "bitstring?", 1, 1, EVAL); Def_Prim(P_Bitstring_Equalp, "bitstring=?", 2, 2, EVAL); Def_Prim(P_Make_Bitstring, "make-bitstring", 2, 2, EVAL); Def_Prim(P_Bitstring_Length, "bitstring-length", 1, 1, EVAL); Def_Prim(P_Int_To_Bitstring, "unsigned-integer->bitstring", 2, 2, EVAL); Def_Prim(P_Bitstring_To_Int, "bitstring->unsigned-integer", 1, 1, EVAL); Def_Prim(P_Bitstring_Ref, "bitstring-ref", 2, 2, EVAL); Def_Prim(P_Bitstring_Set, "bitstring-set!", 3, 3, EVAL); Def_Prim(P_Bitstring_Zerop, "bitstring-zero?", 1, 1, EVAL); Def_Prim(P_Bitstring_Fill, "bitstring-fill!", 2, 2, EVAL); Def_Prim(P_Bitstring_Move, "bitstring-move!", 2, 2, EVAL); Def_Prim(P_Bitstring_Not, "bitstring-not!", 2, 2, EVAL); Def_Prim(P_Bitstring_And, "bitstring-and!", 2, 2, EVAL); Def_Prim(P_Bitstring_Or, "bitstring-or!", 2, 2, EVAL); Def_Prim(P_Bitstring_Andnot, "bitstring-andnot!", 2, 2, EVAL); Def_Prim(P_Bitstring_Xor, "bitstring-xor!", 2, 2, EVAL); Def_Prim(P_Substring_Move, "bitstring-substring-move!", 5, 5, EVAL); P_Provide (Intern ("bitstring.la")); } elk-3.99.8/lib/misc/Makefile.am0000644000175000017500000000331311577076306013071 00000000000000NULL = pkglib_LTLIBRARIES = \ bitstring.la \ elk-eval.la \ hack.la \ regexp.la \ debug.la \ $(gdbm_la) \ $(monitor_la) \ record.la \ struct.la \ $(newhandler_la) \ $(NULL) bitstring_la_SOURCES = bitstring.c bitstring_la_LDFLAGS = -module -avoid-version -no-undefined bitstring_la_LIBADD = $(top_builddir)/src/libelk.la elk_eval_la_SOURCES = elk-eval.c elk_eval_la_LDFLAGS = -module -avoid-version -no-undefined elk_eval_la_LIBADD = $(top_builddir)/src/libelk.la hack_la_SOURCES = hack.c hack_la_LDFLAGS = -module -avoid-version -no-undefined hack_la_LIBADD = $(top_builddir)/src/libelk.la regexp_la_SOURCES = regexp.c regexp_la_LDFLAGS = -module -avoid-version -no-undefined regexp_la_LIBADD = $(top_builddir)/src/libelk.la debug_la_SOURCES = debug.c debug_la_LDFLAGS = -module -avoid-version -no-undefined debug_la_LIBADD = $(top_builddir)/src/libelk.la if HAVE_GDBM gdbm_la = gdbm.la endif gdbm_la_SOURCES = gdbm.c gdbm_la_LDFLAGS = -module -avoid-version -no-undefined gdbm_la_LIBADD = $(top_builddir)/src/libelk.la -lgdbm if HAVE_MONITOR monitor_la = monitor.la endif monitor_la_SOURCES = monitor.c monitor_la_LDFLAGS = -module -avoid-version -no-undefined monitor_la_LIBADD = $(top_builddir)/src/libelk.la record_la_SOURCES = record.c record_la_LDFLAGS = -module -avoid-version -no-undefined record_la_LIBADD = $(top_builddir)/src/libelk.la struct_la_SOURCES = struct.c struct_la_LDFLAGS = -module -avoid-version -no-undefined struct_la_LIBADD = $(top_builddir)/src/libelk.la if HAVE_CXX newhandler_la = newhandler.la endif newhandler_la_SOURCES = newhandler.cpp newhandler_la_LDFLAGS = -module -avoid-version -no-undefined newhandler_la_LIBADD = $(top_builddir)/src/libelk.la echo-sources: ; echo $(SOURCES) elk-3.99.8/lib/misc/record.c0000644000175000017500000001232611577076306012463 00000000000000/* record.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "config.h" #include "scheme.h" #define RTD(x) ((struct S_Rtd *)POINTER(x)) #define RECORD(x) ((struct S_Record *)POINTER(x)) struct S_Rtd { Object name; Object fields; }; struct S_Record { Object rtd; Object values; }; int T_Rtd, T_Record; static Object P_Rtdp (Object x) { return TYPE(x) == T_Rtd ? True : False; } static Object P_Recordp (Object x) { return TYPE(x) == T_Record ? True : False; } static Object P_Rtd_Name (Object x) { Check_Type (x, T_Rtd); return RTD(x)->name; } static Object P_Rtd_Field_Names (Object x) { Check_Type (x, T_Rtd); return RTD(x)->fields; } static Object P_Make_Record_Type (Object name, Object fields) { Object s, ismem; GC_Node2; if (TYPE(name) == T_Symbol) name = SYMBOL(name)->name; else if (TYPE(name) != T_String) Wrong_Type_Combination (name, "string or symbol"); Check_List (fields); for (s = fields; !Nullp (s); s = Cdr (s)) { Check_Type (Car (s), T_Symbol); ismem = P_Memq (Car (s), Cdr (s)); if (Truep (ismem)) Primitive_Error ("duplicate field name"); } GC_Link2 (name, fields); s = Alloc_Object (sizeof (struct S_Rtd), T_Rtd, 0); RTD(s)->name = name; RTD(s)->fields = fields; GC_Unlink; return s; } static Object P_Record_Type (Object x) { Check_Type (x, T_Record); return RECORD(x)->rtd; } static Object P_Record_Values (Object x) { Check_Type (x, T_Record); return RECORD(x)->values; } static Object P_Make_Record (Object rtd, Object values) { Object s; GC_Node2; Check_Type (rtd, T_Rtd); Check_Type (values, T_Vector); if (VECTOR(values)->size != Fast_Length (RTD(rtd)->fields)) Primitive_Error ("wrong number of fields for record type"); GC_Link2 (rtd, values); s = Alloc_Object (sizeof (struct S_Record), T_Record, 0); RECORD(s)->rtd = rtd; RECORD(s)->values = values; GC_Unlink; return s; } static int Rtd_Eqv (Object a, Object b) { return EQ(a,b); } #define Record_Eqv Rtd_Eqv static int Rtd_Equal (Object a, Object b) { return EQ(RTD(a)->name, RTD(b)->name) && Equal (RTD(a)->fields, RTD(b)->fields); } static int Record_Equal (Object a, Object b) { return EQ(RECORD(a)->rtd, RECORD(b)->rtd) && Equal (RECORD(a)->values, RECORD(b)->values); } static int Rtd_Print (Object x, Object port, int raw, int depth, int length) { struct S_String *s = STRING(RTD(x)->name); Printf (port, "#[%.*s-record-type %lu]", s->size, s->data, POINTER(x)); return 0; } static int Record_Print (Object x, Object port, int raw, int depth, int length) { struct S_String *s = STRING(RTD(RECORD(x)->rtd)->name); Printf (port, "#[%.*s-record-type %lu]", s->size, s->data, POINTER(x)); return 0; } static int Rtd_Visit (register Object *sp, register int (*f)()) { (*f)(&RTD(*sp)->name); (*f)(&RTD(*sp)->fields); return 0; } static int Record_Visit (register Object *sp, register int (*f)()) { (*f)(&RECORD(*sp)->rtd); (*f)(&RECORD(*sp)->values); return 0; } #define Def_Prim Define_Primitive void elk_init_lib_record () { T_Rtd = Define_Type (0, "record-type", NOFUNC, sizeof (struct S_Rtd), Rtd_Eqv, Rtd_Equal, Rtd_Print, Rtd_Visit); Def_Prim (P_Rtdp, "record-type?", 1, 1, EVAL); Def_Prim (P_Rtd_Name, "record-type-name", 1, 1, EVAL); Def_Prim (P_Rtd_Field_Names, "record-type-field-names", 1, 1, EVAL); Def_Prim (P_Make_Record_Type, "make-record-type", 2, 2, EVAL); T_Record = Define_Type (0, "record", NOFUNC, sizeof (struct S_Record), Record_Eqv, Record_Equal, Record_Print, Record_Visit); Def_Prim (P_Recordp, "record?", 1, 1, EVAL); Def_Prim (P_Record_Type, "record-type-descriptor", 1, 1, EVAL); Def_Prim (P_Record_Values, "record-values", 1, 1, EVAL); Def_Prim (P_Make_Record, "make-record", 2, 2, EVAL); P_Provide (Intern ("record.la")); } elk-3.99.8/lib/xlib/0000755000175000017500000000000011577110017011104 500000000000000elk-3.99.8/lib/xlib/MISSING0000644000175000017500000000470411577076306012101 00000000000000send-event? argument to all handler functions No support for screens and visuals yet Missing functions: XNewModifiermap XFreeModifiermap XGetModifierMapping XSetModifierMapping XInsertModifiermapEntry XDeleteModifiermapEntry XCreateImage XGetImage XGetPixel XDestroyImage XPutImage XPutPixel XGetSubImage XAddPixel XSubImage XCreateColormap XAllocColorPlanes XCopyColormapAndFree XAllocColorCells XStoreNamedColor XFreeColors XStoreColors XAddHosts XEnableAccessControl XRemoveHosts XDisableAccessControl XListHosts XGetWMColormapWindows XGetRGBColormaps XWMGeometry XSetWMColormapWindows XSetRGBColormaps XGetErrorDatabaseText XGetErrorText XKillClient XSendEvent XVisualIDFromVisual XGetVisualInfo XMatchVisualInfo XDefaultVisual XDoesBackingStore XDoesSaveUnders XRootWindowOfScreen XDefaultVisualOfScreen XDefaultGCOfScreen XBlackPixelOfScreen XWhitePixelOfScreen XDefaultColormapOfScreen XDisplayOfScreen XEventMaskOfScreen XScreenNumberOfScreen XCellsOfScreen XDefaultDepthOfScreen XHeightMMOfScreen XHeightOfScreen XMaxCmapsOfScreen XMinCmapsOfScreen XPlanesOfScreen XWidthMMOfScreen XWidthOfScreen XScreenOfDisplay XDefaultScreenOfDisplay XActivateScreenSaver XForceScreenSaver XGetScreenSaver XResetScreenSaver XSetScreenSaver XAutoRepeatOff XAutoRepeatOn XChangeKeyboardControl XGetKeyboardControl XChangeKeyboardMapping XGetKeyboardMapping XChangePointerControl XGetPointerControl XQueryKeymap XSupportsLocale XSetLocaleModifiers XCreateFontSet XFreeFontSet XFontsOfFontSet XBaseFontNameListOfFontSet XLocaleOfFontSet XContextDependentDrawing XExtentsOfFontSet XmbTextEscapement XwcTextEscapement XmbTextExtents XwcTextExtents XmbTextPerCharExtents XwcTextPerCharExtents XmbDrawText XwcDrawText XmbDrawString XwcDrawString XmbDrawImageString XwcDrawImageString XmbLookupString XwcLookupString XDefaultString XmbTextListToTextProperty XwcTextListToTextProperty XwcFreeStringList XmbTextPropertyToTextList XwcTextPropertyToTextList XmbSetWMProperties XOpenIM XCloseIM XGetIMValues XDisplayOfIM XLocaleOfIM XCreateIC XDestroyIC XSetICFocus XUnsetICFocus XwcResetIC XmbResetIC XSetICValues XGetICValues XIMOfIC XClipBox XCreateRegion XDestroyRegion XEmptyRegion XEqualRegion XIntersectRegion XOffsetRegion XPointInRegion XPolygonRegion XRectInRegion XSetRegion XShrinkRegion XSubtractRegion XUnionRectWithRegion XUnionRegion XXorRegion elk-3.99.8/lib/xlib/xlib.h0000644000175000017500000002371311577076306012155 00000000000000/* xlib.h * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "config.h" #include #include #include #include #undef True #undef False #ifndef NeedFunctionPrototypes /* Kludge */ #error "X11 Release 3 (or earlier) no longer supported" #endif #if XlibSpecificationRelease >= 5 # define XLIB_RELEASE_5_OR_LATER #endif #if XlibSpecificationRelease >= 6 # define XLIB_RELEASE_6_OR_LATER #endif #include "scheme.h" extern int T_Display; extern int T_Gc; extern int T_Pixel; extern int T_Pixmap; extern int T_Window; extern int T_Font; extern int T_Colormap; extern int T_Color; extern int T_Cursor; extern int T_Atom; #define DISPLAY(x) ((struct S_Display *)POINTER(x)) #define GCONTEXT(x) ((struct S_Gc *)POINTER(x)) #define PIXEL(x) ((struct S_Pixel *)POINTER(x)) #define PIXMAP(x) ((struct S_Pixmap *)POINTER(x)) #define WINDOW(x) ((struct S_Window *)POINTER(x)) #define FONT(x) ((struct S_Font *)POINTER(x)) #define COLORMAP(x) ((struct S_Colormap *)POINTER(x)) #define COLOR(x) ((struct S_Color *)POINTER(x)) #define CURSOR(x) ((struct S_Cursor *)POINTER(x)) #define ATOM(x) ((struct S_Atom *)POINTER(x)) struct S_Display { Object after; Display *dpy; char free; }; struct S_Gc { Object tag; GC gc; Display *dpy; char free; }; struct S_Pixel { Object tag; unsigned long pix; }; struct S_Pixmap { Object tag; Pixmap pm; Display *dpy; char free; }; struct S_Window { Object tag; Window win; Display *dpy; char free; char finalize; }; struct S_Font { Object name; Font id; XFontStruct *info; Display *dpy; }; struct S_Colormap { Object tag; Colormap cm; Display *dpy; char free; }; struct S_Color { Object tag; XColor c; }; struct S_Cursor { Object tag; Cursor cursor; Display *dpy; char free; }; struct S_Atom { Object tag; Atom atom; }; enum Type { T_NONE, T_INT, T_CHAR, T_PIXEL, T_PIXMAP, T_BOOL, T_FONT, T_COLORMAP, T_CURSOR, T_WINDOW, T_MASK, T_SYM, T_SHORT, T_BACKGROUND, T_BORDER }; typedef struct { char *slot; char *name; enum Type type; SYMDESCR *syms; int mask; } RECORD; typedef struct { Window root; int x, y, width, height, border_width, depth; } GEOMETRY; C_LINKAGE_BEGIN extern Colormap Get_Colormap (Object); extern Cursor Get_Cursor (Object); extern Drawable Get_Drawable (Object, Display**); extern Font Get_Font (Object); extern int Get_Screen_Number (Display*, Object); extern Object Get_Event_Args (XEvent*); extern Pixmap Get_Pixmap (Object); extern Time Get_Time (Object); extern Window Get_Window (Object); extern XColor *Get_Color (Object); extern unsigned long int Get_Pixel (Object); extern void Destroy_Event_Args (Object); extern int Encode_Event (Object); extern int Match_X_Obj (Object, va_list); extern void Open_Font_Maybe (Object); extern Object Make_Atom (Atom); extern Object Make_Color (unsigned int, unsigned int, unsigned int); extern Object Make_Colormap (int, Display*, Colormap); extern Object Make_Cursor (Display*, Cursor); extern Object Make_Cursor_Foreign (Display*, Cursor); extern Object Make_Display (int, Display*); extern Object Make_Font (Display*, Object, Font, XFontStruct*); extern Object Make_Font_Foreign (Display*, Object, Font, XFontStruct*); extern Object Make_Gc (int, Display*, GC); extern Object Make_Pixel (unsigned long int); extern Object Make_Pixmap (Display*, Pixmap); extern Object Make_Pixmap_Foreign (Display*, Pixmap); extern Object Make_Window (int, Display*, Window); extern Object P_Close_Display (Object); extern Object P_Close_Font (Object); extern Object P_Destroy_Window (Object); extern Object P_Free_Colormap (Object); extern Object P_Free_Cursor (Object); extern Object P_Free_Gc (Object); extern Object P_Free_Pixmap (Object); extern Object P_Window_Unique_Id (Object); extern Object Record_To_Vector (RECORD*, int, Object, Display*, unsigned long int); extern unsigned long int Vector_To_Record (Object, unsigned int, Object, RECORD*); extern void elk_init_xlib_client (); extern void elk_init_xlib_color (); extern void elk_init_xlib_colormap (); extern void elk_init_xlib_cursor (); extern void elk_init_xlib_display (); extern void elk_init_xlib_error (); extern void elk_init_xlib_event (); extern void elk_init_xlib_extension (); extern void elk_init_xlib_font (); extern void elk_init_xlib_gcontext (); extern void elk_init_xlib_grab (); extern void elk_init_xlib_graphics (); extern void elk_init_xlib_key (); extern void elk_init_xlib_objects (); extern void elk_init_xlib_pixel (); extern void elk_init_xlib_pixmap (); extern void elk_init_xlib_property (); extern void elk_init_xlib_text (); extern void elk_init_xlib_type (); extern void elk_init_xlib_util (); extern void elk_init_xlib_window (); extern void elk_init_xlib_wm (); C_LINKAGE_END extern XSetWindowAttributes SWA; extern XWindowChanges WC; extern XGCValues GCV; extern GEOMETRY GEO; extern XWindowAttributes WA; extern XFontStruct FI; extern XCharStruct CI; extern XWMHints WMH; extern XSizeHints SZH; extern int Set_Attr_Size, Conf_Size, GC_Size, Geometry_Size, Win_Attr_Size, Font_Info_Size, Char_Info_Size, Wm_Hints_Size, Size_Hints_Size; extern RECORD Set_Attr_Rec[], Conf_Rec[], GC_Rec[], Geometry_Rec[], Win_Attr_Rec[], Font_Info_Rec[], Char_Info_Rec[], Wm_Hints_Rec[], Size_Hints_Rec[]; extern SYMDESCR Func_Syms[], Bit_Grav_Syms[], Event_Syms[], Error_Syms[], Grav_Syms[], Backing_Store_Syms[], Class_Syms[], Stack_Mode_Syms[], Line_Style_Syms[], State_Syms[], Cap_Style_Syms[], Join_Style_Syms[], Map_State_Syms[], Fill_Style_Syms[], Fill_Rule_Syms[], Arc_Mode_Syms[], Subwin_Mode_Syms[], Button_Syms[], Cross_Mode_Syms[], Cross_Detail_Syms[], Focus_Detail_Syms[], Place_Syms[], Visibility_Syms[], Prop_Syms[], Mapping_Syms[], Direction_Syms[], Shape_Syms[], Propmode_Syms[], Grabstatus_Syms[], Allow_Events_Syms[], Revert_Syms[], Polyshape_Syms[], Initial_State_Syms[], Bitmapstatus_Syms[], Circulate_Syms[], Ordering_Syms[], Byte_Order_Syms[], Saveset_Syms[], Closemode_Syms[]; extern Object Sym_None, Sym_Now, Sym_Char_Info, Sym_Conf; #if __STDC__ || defined(ANSI_CPP) # define conc(a,b) a##b # define conc3(a,b,c) a##b##c #else # define _identity(x) x # define conc(a,b) _identity(a)b # define conc3(a,b,c) conc(conc(a,b),c) #endif /* Generic_Predicate (Pixmap) generates: * * int T_Pixmap; * * static Object P_Pixmapp (Object x) { * return TYPE(x) == T_Pixmap ? True : False; * } */ #define Generic_Predicate(type) int conc(T_,type);\ \ static Object conc3(P_,type,p) (Object x) {\ return TYPE(x) == conc(T_,type) ? True : False;\ } /* Generic_Equal (Pixmap, PIXMAP, pm) generates: * * static Pixmap_Equal (Object x, Object y) { * return PIXMAP(x)->pm == PIXMAP(y)->field * && !PIXMAP(x)->free && !PIXMAP(y)->free; * } */ #define Generic_Equal(type,cast,field) static int conc(type,_Equal)\ (Object x, Object y) {\ return cast(x)->field == cast(y)->field\ && !cast(x)->free && !cast(y)->free;\ } /* Same as above, but doesn't check for ->free: */ #define Generic_Simple_Equal(type,cast,field) static int conc(type,_Equal)\ (Object x, Object y) {\ return cast(x)->field == cast(y)->field;\ } /* Same as above, but also checks ->dpy */ #define Generic_Equal_Dpy(type,cast,field) static int conc(type,_Equal)\ (Object x, Object y) {\ return cast(x)->field == cast(y)->field && cast(x)->dpy == cast(y)->dpy\ && !cast(x)->free && !cast(y)->free;\ } /* Generic_Print (Pixmap, "#[pixmap %u]", PIXMAP(x)->pm) generates: * * static Pixmap_Print (Object x, Object port, int raw, int depth, int len) { * Printf (port, "#[pixmap %u]", PIXMAP(x)->pm); * } */ #define Generic_Print(type,fmt,how) static int conc(type,_Print)\ (Object x, Object port, int raw, int depth, int len) {\ Printf (port, fmt, (unsigned)how);\ return 0;\ } /* Generic_Define (Pixmap, "pixmap", "pixmap?") generates: * * T_Pixmap = Define_Type (0, "pixmap", NOFUNC, sizeof (struct S_Pixmap), * Pixmap_Equal, Pixmap_Equal, Pixmap_Print, NOFUNC); * Define_Primitive (P_Pixmapp, "pixmap?", 1, 1, EVAL); */ #define Generic_Define(type,name,pred) conc(T_,type) =\ Define_Type (0, name, NOFUNC, sizeof (struct conc(S_,type)),\ conc(type,_Equal), conc(type,_Equal), conc(type,_Print), NOFUNC);\ Define_Primitive (conc3(P_,type,p), pred, 1, 1, EVAL); /* Generic_Get_Display (Pixmap, PIXMAP) generates: * * static Object P_Pixmap_Display (Object x) { * Check_Type (x, T_Pixmap); * return Make_Display (PIXMAP(x)->dpy); * } */ #define Generic_Get_Display(type,cast) static Object conc3(P_,type,_Display)\ (Object x) {\ Check_Type (x, conc(T_,type));\ return Make_Display (0, cast(x)->dpy);\ } elk-3.99.8/lib/xlib/Makefile.in0000644000175000017500000013156511577103434013111 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = lib/xlib DIST_COMMON = $(extensions_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkglibdir)" \ "$(DESTDIR)$(extensionsdir)" LTLIBRARIES = $(lib_LTLIBRARIES) $(pkglib_LTLIBRARIES) libelk_xlib_la_DEPENDENCIES = $(top_builddir)/src/libelk.la am__objects_1 = am_libelk_xlib_la_OBJECTS = libelk_xlib_la-client.lo \ libelk_xlib_la-color.lo libelk_xlib_la-colormap.lo \ libelk_xlib_la-cursor.lo libelk_xlib_la-display.lo \ libelk_xlib_la-error.lo libelk_xlib_la-event.lo \ libelk_xlib_la-extension.lo libelk_xlib_la-font.lo \ libelk_xlib_la-gcontext.lo libelk_xlib_la-grab.lo \ libelk_xlib_la-graphics.lo libelk_xlib_la-key.lo \ libelk_xlib_la-objects.lo libelk_xlib_la-pixel.lo \ libelk_xlib_la-pixmap.lo libelk_xlib_la-property.lo \ libelk_xlib_la-text.lo libelk_xlib_la-type.lo \ libelk_xlib_la-util.lo libelk_xlib_la-window.lo \ libelk_xlib_la-wm.lo $(am__objects_1) libelk_xlib_la_OBJECTS = $(am_libelk_xlib_la_OBJECTS) libelk_xlib_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libelk_xlib_la_CFLAGS) \ $(CFLAGS) $(libelk_xlib_la_LDFLAGS) $(LDFLAGS) -o $@ @HAVE_X11_TRUE@am_libelk_xlib_la_rpath = -rpath $(libdir) xlib_la_DEPENDENCIES = $(top_builddir)/src/libelk.la libelk-xlib.la am_xlib_la_OBJECTS = xlib_la-init.lo xlib_la_OBJECTS = $(am_xlib_la_OBJECTS) xlib_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(xlib_la_CFLAGS) $(CFLAGS) \ $(xlib_la_LDFLAGS) $(LDFLAGS) -o $@ @HAVE_X11_TRUE@am_xlib_la_rpath = -rpath $(pkglibdir) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/.auto/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libelk_xlib_la_SOURCES) $(xlib_la_SOURCES) DIST_SOURCES = $(libelk_xlib_la_SOURCES) $(xlib_la_SOURCES) HEADERS = $(extensions_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ELK_CFLAGS = @ELK_CFLAGS@ ELK_LDFLAGS = @ELK_LDFLAGS@ ELK_LIBS = @ELK_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INCLUDES = @INCLUDES@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOTIF_CFLAGS = @MOTIF_CFLAGS@ MOTIF_LIBS = @MOTIF_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STDINT_HEADER = @STDINT_HEADER@ STRIP = @STRIP@ VERSION = @VERSION@ XAW_CFLAGS = @XAW_CFLAGS@ XAW_LIBS = @XAW_LIBS@ XMKMF = @XMKMF@ XT_CFLAGS = @XT_CFLAGS@ XT_LIBS = @XT_LIBS@ X_CFLAGS = @X_CFLAGS@ X_LIBS = @X_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ NULL = EXTRA_DIST = MISSING lib_LTLIBRARIES = $(libelk_xlib_la) pkglib_LTLIBRARIES = $(xlib_la) @HAVE_X11_TRUE@libelk_xlib_la = libelk-xlib.la @HAVE_X11_TRUE@xlib_la = xlib.la libelk_xlib_la_SOURCES = \ client.c \ color.c \ colormap.c \ cursor.c \ display.c \ error.c \ event.c \ extension.c \ font.c \ gcontext.c \ grab.c \ graphics.c \ key.c \ objects.c \ pixel.c \ pixmap.c \ property.c \ text.c \ type.c \ util.c \ window.c \ wm.c \ $(NULL) libelk_xlib_la_CFLAGS = @X_CFLAGS@ libelk_xlib_la_LDFLAGS = -no-undefined libelk_xlib_la_LIBADD = $(top_builddir)/src/libelk.la @X_LIBS@ xlib_la_SOURCES = init.c xlib_la_CFLAGS = @X_CFLAGS@ xlib_la_LDFLAGS = -module -avoid-version -no-undefined xlib_la_LIBADD = $(top_builddir)/src/libelk.la libelk-xlib.la @X_LIBS@ extensions_HEADERS = xlib.h extensionsdir = $(pkgincludedir)/extensions all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign lib/xlib/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign lib/xlib/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libelk-xlib.la: $(libelk_xlib_la_OBJECTS) $(libelk_xlib_la_DEPENDENCIES) $(libelk_xlib_la_LINK) $(am_libelk_xlib_la_rpath) $(libelk_xlib_la_OBJECTS) $(libelk_xlib_la_LIBADD) $(LIBS) xlib.la: $(xlib_la_OBJECTS) $(xlib_la_DEPENDENCIES) $(xlib_la_LINK) $(am_xlib_la_rpath) $(xlib_la_OBJECTS) $(xlib_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_xlib_la-client.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_xlib_la-color.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_xlib_la-colormap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_xlib_la-cursor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_xlib_la-display.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_xlib_la-error.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_xlib_la-event.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_xlib_la-extension.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_xlib_la-font.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_xlib_la-gcontext.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_xlib_la-grab.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_xlib_la-graphics.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_xlib_la-key.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_xlib_la-objects.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_xlib_la-pixel.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_xlib_la-pixmap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_xlib_la-property.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_xlib_la-text.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_xlib_la-type.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_xlib_la-util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_xlib_la-window.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_xlib_la-wm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xlib_la-init.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< libelk_xlib_la-client.lo: client.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xlib_la_CFLAGS) $(CFLAGS) -MT libelk_xlib_la-client.lo -MD -MP -MF $(DEPDIR)/libelk_xlib_la-client.Tpo -c -o libelk_xlib_la-client.lo `test -f 'client.c' || echo '$(srcdir)/'`client.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_xlib_la-client.Tpo $(DEPDIR)/libelk_xlib_la-client.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='client.c' object='libelk_xlib_la-client.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xlib_la_CFLAGS) $(CFLAGS) -c -o libelk_xlib_la-client.lo `test -f 'client.c' || echo '$(srcdir)/'`client.c libelk_xlib_la-color.lo: color.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xlib_la_CFLAGS) $(CFLAGS) -MT libelk_xlib_la-color.lo -MD -MP -MF $(DEPDIR)/libelk_xlib_la-color.Tpo -c -o libelk_xlib_la-color.lo `test -f 'color.c' || echo '$(srcdir)/'`color.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_xlib_la-color.Tpo $(DEPDIR)/libelk_xlib_la-color.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='color.c' object='libelk_xlib_la-color.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xlib_la_CFLAGS) $(CFLAGS) -c -o libelk_xlib_la-color.lo `test -f 'color.c' || echo '$(srcdir)/'`color.c libelk_xlib_la-colormap.lo: colormap.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xlib_la_CFLAGS) $(CFLAGS) -MT libelk_xlib_la-colormap.lo -MD -MP -MF $(DEPDIR)/libelk_xlib_la-colormap.Tpo -c -o libelk_xlib_la-colormap.lo `test -f 'colormap.c' || echo '$(srcdir)/'`colormap.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_xlib_la-colormap.Tpo $(DEPDIR)/libelk_xlib_la-colormap.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='colormap.c' object='libelk_xlib_la-colormap.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xlib_la_CFLAGS) $(CFLAGS) -c -o libelk_xlib_la-colormap.lo `test -f 'colormap.c' || echo '$(srcdir)/'`colormap.c libelk_xlib_la-cursor.lo: cursor.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xlib_la_CFLAGS) $(CFLAGS) -MT libelk_xlib_la-cursor.lo -MD -MP -MF $(DEPDIR)/libelk_xlib_la-cursor.Tpo -c -o libelk_xlib_la-cursor.lo `test -f 'cursor.c' || echo '$(srcdir)/'`cursor.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_xlib_la-cursor.Tpo $(DEPDIR)/libelk_xlib_la-cursor.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cursor.c' object='libelk_xlib_la-cursor.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xlib_la_CFLAGS) $(CFLAGS) -c -o libelk_xlib_la-cursor.lo `test -f 'cursor.c' || echo '$(srcdir)/'`cursor.c libelk_xlib_la-display.lo: display.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xlib_la_CFLAGS) $(CFLAGS) -MT libelk_xlib_la-display.lo -MD -MP -MF $(DEPDIR)/libelk_xlib_la-display.Tpo -c -o libelk_xlib_la-display.lo `test -f 'display.c' || echo '$(srcdir)/'`display.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_xlib_la-display.Tpo $(DEPDIR)/libelk_xlib_la-display.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='display.c' object='libelk_xlib_la-display.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xlib_la_CFLAGS) $(CFLAGS) -c -o libelk_xlib_la-display.lo `test -f 'display.c' || echo '$(srcdir)/'`display.c libelk_xlib_la-error.lo: error.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xlib_la_CFLAGS) $(CFLAGS) -MT libelk_xlib_la-error.lo -MD -MP -MF $(DEPDIR)/libelk_xlib_la-error.Tpo -c -o libelk_xlib_la-error.lo `test -f 'error.c' || echo '$(srcdir)/'`error.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_xlib_la-error.Tpo $(DEPDIR)/libelk_xlib_la-error.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='error.c' object='libelk_xlib_la-error.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xlib_la_CFLAGS) $(CFLAGS) -c -o libelk_xlib_la-error.lo `test -f 'error.c' || echo '$(srcdir)/'`error.c libelk_xlib_la-event.lo: event.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xlib_la_CFLAGS) $(CFLAGS) -MT libelk_xlib_la-event.lo -MD -MP -MF $(DEPDIR)/libelk_xlib_la-event.Tpo -c -o libelk_xlib_la-event.lo `test -f 'event.c' || echo '$(srcdir)/'`event.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_xlib_la-event.Tpo $(DEPDIR)/libelk_xlib_la-event.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='event.c' object='libelk_xlib_la-event.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xlib_la_CFLAGS) $(CFLAGS) -c -o libelk_xlib_la-event.lo `test -f 'event.c' || echo '$(srcdir)/'`event.c libelk_xlib_la-extension.lo: extension.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xlib_la_CFLAGS) $(CFLAGS) -MT libelk_xlib_la-extension.lo -MD -MP -MF $(DEPDIR)/libelk_xlib_la-extension.Tpo -c -o libelk_xlib_la-extension.lo `test -f 'extension.c' || echo '$(srcdir)/'`extension.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_xlib_la-extension.Tpo $(DEPDIR)/libelk_xlib_la-extension.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='extension.c' object='libelk_xlib_la-extension.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xlib_la_CFLAGS) $(CFLAGS) -c -o libelk_xlib_la-extension.lo `test -f 'extension.c' || echo '$(srcdir)/'`extension.c libelk_xlib_la-font.lo: font.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xlib_la_CFLAGS) $(CFLAGS) -MT libelk_xlib_la-font.lo -MD -MP -MF $(DEPDIR)/libelk_xlib_la-font.Tpo -c -o libelk_xlib_la-font.lo `test -f 'font.c' || echo '$(srcdir)/'`font.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_xlib_la-font.Tpo $(DEPDIR)/libelk_xlib_la-font.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='font.c' object='libelk_xlib_la-font.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xlib_la_CFLAGS) $(CFLAGS) -c -o libelk_xlib_la-font.lo `test -f 'font.c' || echo '$(srcdir)/'`font.c libelk_xlib_la-gcontext.lo: gcontext.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xlib_la_CFLAGS) $(CFLAGS) -MT libelk_xlib_la-gcontext.lo -MD -MP -MF $(DEPDIR)/libelk_xlib_la-gcontext.Tpo -c -o libelk_xlib_la-gcontext.lo `test -f 'gcontext.c' || echo '$(srcdir)/'`gcontext.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_xlib_la-gcontext.Tpo $(DEPDIR)/libelk_xlib_la-gcontext.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gcontext.c' object='libelk_xlib_la-gcontext.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xlib_la_CFLAGS) $(CFLAGS) -c -o libelk_xlib_la-gcontext.lo `test -f 'gcontext.c' || echo '$(srcdir)/'`gcontext.c libelk_xlib_la-grab.lo: grab.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xlib_la_CFLAGS) $(CFLAGS) -MT libelk_xlib_la-grab.lo -MD -MP -MF $(DEPDIR)/libelk_xlib_la-grab.Tpo -c -o libelk_xlib_la-grab.lo `test -f 'grab.c' || echo '$(srcdir)/'`grab.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_xlib_la-grab.Tpo $(DEPDIR)/libelk_xlib_la-grab.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='grab.c' object='libelk_xlib_la-grab.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xlib_la_CFLAGS) $(CFLAGS) -c -o libelk_xlib_la-grab.lo `test -f 'grab.c' || echo '$(srcdir)/'`grab.c libelk_xlib_la-graphics.lo: graphics.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xlib_la_CFLAGS) $(CFLAGS) -MT libelk_xlib_la-graphics.lo -MD -MP -MF $(DEPDIR)/libelk_xlib_la-graphics.Tpo -c -o libelk_xlib_la-graphics.lo `test -f 'graphics.c' || echo '$(srcdir)/'`graphics.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_xlib_la-graphics.Tpo $(DEPDIR)/libelk_xlib_la-graphics.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='graphics.c' object='libelk_xlib_la-graphics.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xlib_la_CFLAGS) $(CFLAGS) -c -o libelk_xlib_la-graphics.lo `test -f 'graphics.c' || echo '$(srcdir)/'`graphics.c libelk_xlib_la-key.lo: key.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xlib_la_CFLAGS) $(CFLAGS) -MT libelk_xlib_la-key.lo -MD -MP -MF $(DEPDIR)/libelk_xlib_la-key.Tpo -c -o libelk_xlib_la-key.lo `test -f 'key.c' || echo '$(srcdir)/'`key.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_xlib_la-key.Tpo $(DEPDIR)/libelk_xlib_la-key.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='key.c' object='libelk_xlib_la-key.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xlib_la_CFLAGS) $(CFLAGS) -c -o libelk_xlib_la-key.lo `test -f 'key.c' || echo '$(srcdir)/'`key.c libelk_xlib_la-objects.lo: objects.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xlib_la_CFLAGS) $(CFLAGS) -MT libelk_xlib_la-objects.lo -MD -MP -MF $(DEPDIR)/libelk_xlib_la-objects.Tpo -c -o libelk_xlib_la-objects.lo `test -f 'objects.c' || echo '$(srcdir)/'`objects.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_xlib_la-objects.Tpo $(DEPDIR)/libelk_xlib_la-objects.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='objects.c' object='libelk_xlib_la-objects.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xlib_la_CFLAGS) $(CFLAGS) -c -o libelk_xlib_la-objects.lo `test -f 'objects.c' || echo '$(srcdir)/'`objects.c libelk_xlib_la-pixel.lo: pixel.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xlib_la_CFLAGS) $(CFLAGS) -MT libelk_xlib_la-pixel.lo -MD -MP -MF $(DEPDIR)/libelk_xlib_la-pixel.Tpo -c -o libelk_xlib_la-pixel.lo `test -f 'pixel.c' || echo '$(srcdir)/'`pixel.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_xlib_la-pixel.Tpo $(DEPDIR)/libelk_xlib_la-pixel.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pixel.c' object='libelk_xlib_la-pixel.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xlib_la_CFLAGS) $(CFLAGS) -c -o libelk_xlib_la-pixel.lo `test -f 'pixel.c' || echo '$(srcdir)/'`pixel.c libelk_xlib_la-pixmap.lo: pixmap.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xlib_la_CFLAGS) $(CFLAGS) -MT libelk_xlib_la-pixmap.lo -MD -MP -MF $(DEPDIR)/libelk_xlib_la-pixmap.Tpo -c -o libelk_xlib_la-pixmap.lo `test -f 'pixmap.c' || echo '$(srcdir)/'`pixmap.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_xlib_la-pixmap.Tpo $(DEPDIR)/libelk_xlib_la-pixmap.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pixmap.c' object='libelk_xlib_la-pixmap.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xlib_la_CFLAGS) $(CFLAGS) -c -o libelk_xlib_la-pixmap.lo `test -f 'pixmap.c' || echo '$(srcdir)/'`pixmap.c libelk_xlib_la-property.lo: property.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xlib_la_CFLAGS) $(CFLAGS) -MT libelk_xlib_la-property.lo -MD -MP -MF $(DEPDIR)/libelk_xlib_la-property.Tpo -c -o libelk_xlib_la-property.lo `test -f 'property.c' || echo '$(srcdir)/'`property.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_xlib_la-property.Tpo $(DEPDIR)/libelk_xlib_la-property.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='property.c' object='libelk_xlib_la-property.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xlib_la_CFLAGS) $(CFLAGS) -c -o libelk_xlib_la-property.lo `test -f 'property.c' || echo '$(srcdir)/'`property.c libelk_xlib_la-text.lo: text.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xlib_la_CFLAGS) $(CFLAGS) -MT libelk_xlib_la-text.lo -MD -MP -MF $(DEPDIR)/libelk_xlib_la-text.Tpo -c -o libelk_xlib_la-text.lo `test -f 'text.c' || echo '$(srcdir)/'`text.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_xlib_la-text.Tpo $(DEPDIR)/libelk_xlib_la-text.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='text.c' object='libelk_xlib_la-text.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xlib_la_CFLAGS) $(CFLAGS) -c -o libelk_xlib_la-text.lo `test -f 'text.c' || echo '$(srcdir)/'`text.c libelk_xlib_la-type.lo: type.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xlib_la_CFLAGS) $(CFLAGS) -MT libelk_xlib_la-type.lo -MD -MP -MF $(DEPDIR)/libelk_xlib_la-type.Tpo -c -o libelk_xlib_la-type.lo `test -f 'type.c' || echo '$(srcdir)/'`type.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_xlib_la-type.Tpo $(DEPDIR)/libelk_xlib_la-type.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='type.c' object='libelk_xlib_la-type.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xlib_la_CFLAGS) $(CFLAGS) -c -o libelk_xlib_la-type.lo `test -f 'type.c' || echo '$(srcdir)/'`type.c libelk_xlib_la-util.lo: util.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xlib_la_CFLAGS) $(CFLAGS) -MT libelk_xlib_la-util.lo -MD -MP -MF $(DEPDIR)/libelk_xlib_la-util.Tpo -c -o libelk_xlib_la-util.lo `test -f 'util.c' || echo '$(srcdir)/'`util.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_xlib_la-util.Tpo $(DEPDIR)/libelk_xlib_la-util.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util.c' object='libelk_xlib_la-util.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xlib_la_CFLAGS) $(CFLAGS) -c -o libelk_xlib_la-util.lo `test -f 'util.c' || echo '$(srcdir)/'`util.c libelk_xlib_la-window.lo: window.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xlib_la_CFLAGS) $(CFLAGS) -MT libelk_xlib_la-window.lo -MD -MP -MF $(DEPDIR)/libelk_xlib_la-window.Tpo -c -o libelk_xlib_la-window.lo `test -f 'window.c' || echo '$(srcdir)/'`window.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_xlib_la-window.Tpo $(DEPDIR)/libelk_xlib_la-window.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='window.c' object='libelk_xlib_la-window.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xlib_la_CFLAGS) $(CFLAGS) -c -o libelk_xlib_la-window.lo `test -f 'window.c' || echo '$(srcdir)/'`window.c libelk_xlib_la-wm.lo: wm.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xlib_la_CFLAGS) $(CFLAGS) -MT libelk_xlib_la-wm.lo -MD -MP -MF $(DEPDIR)/libelk_xlib_la-wm.Tpo -c -o libelk_xlib_la-wm.lo `test -f 'wm.c' || echo '$(srcdir)/'`wm.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_xlib_la-wm.Tpo $(DEPDIR)/libelk_xlib_la-wm.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='wm.c' object='libelk_xlib_la-wm.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xlib_la_CFLAGS) $(CFLAGS) -c -o libelk_xlib_la-wm.lo `test -f 'wm.c' || echo '$(srcdir)/'`wm.c xlib_la-init.lo: init.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xlib_la_CFLAGS) $(CFLAGS) -MT xlib_la-init.lo -MD -MP -MF $(DEPDIR)/xlib_la-init.Tpo -c -o xlib_la-init.lo `test -f 'init.c' || echo '$(srcdir)/'`init.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/xlib_la-init.Tpo $(DEPDIR)/xlib_la-init.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='init.c' object='xlib_la-init.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xlib_la_CFLAGS) $(CFLAGS) -c -o xlib_la-init.lo `test -f 'init.c' || echo '$(srcdir)/'`init.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-extensionsHEADERS: $(extensions_HEADERS) @$(NORMAL_INSTALL) test -z "$(extensionsdir)" || $(MKDIR_P) "$(DESTDIR)$(extensionsdir)" @list='$(extensions_HEADERS)'; test -n "$(extensionsdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(extensionsdir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(extensionsdir)" || exit $$?; \ done uninstall-extensionsHEADERS: @$(NORMAL_UNINSTALL) @list='$(extensions_HEADERS)'; test -n "$(extensionsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(extensionsdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(extensionsdir)" && rm -f $$files ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(extensionsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ clean-pkglibLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-extensionsHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-pkglibLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-extensionsHEADERS uninstall-libLTLIBRARIES \ uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool clean-pkglibLTLIBRARIES \ ctags distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-extensionsHEADERS install-html \ install-html-am install-info install-info-am \ install-libLTLIBRARIES install-man install-pdf install-pdf-am \ install-pkglibLTLIBRARIES install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-extensionsHEADERS uninstall-libLTLIBRARIES \ uninstall-pkglibLTLIBRARIES echo-sources: ; echo $(SOURCES) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: elk-3.99.8/lib/xlib/gcontext.c0000644000175000017500000001466311577076306013051 00000000000000/* gcontext.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "xlib.h" static Object Sym_Gc; Generic_Predicate (Gc) Generic_Equal_Dpy (Gc, GCONTEXT, gc) Generic_Print (Gc, "#[gcontext %lu]", (unsigned int)(uintptr_t)GCONTEXT(x)->gc) Generic_Get_Display (Gc, GCONTEXT) Object Make_Gc (int finalize, Display *dpy, GC g) { Object gc; if (g == None) return Sym_None; gc = Find_Object (T_Gc, (GENERIC)dpy, Match_X_Obj, g); if (Nullp (gc)) { gc = Alloc_Object (sizeof (struct S_Gc), T_Gc, 0); GCONTEXT(gc)->tag = Null; GCONTEXT(gc)->gc = g; GCONTEXT(gc)->dpy = dpy; GCONTEXT(gc)->free = 0; Register_Object (gc, (GENERIC)dpy, finalize ? P_Free_Gc : (PFO)0, 0); } return gc; } static Object P_Create_Gc (Object w, Object g) { unsigned long mask; Display *dpy; Drawable dr; dr = Get_Drawable (w, &dpy); mask = Vector_To_Record (g, GC_Size, Sym_Gc, GC_Rec); return Make_Gc (1, dpy, XCreateGC (dpy, dr, mask, &GCV)); } static Object P_Copy_Gc (Object gc, Object w) { GC dst; Display *dpy; Drawable dr; Check_Type (gc, T_Gc); dr = Get_Drawable (w, &dpy); dst = XCreateGC (dpy, dr, 0L, &GCV); XCopyGC (dpy, GCONTEXT(gc)->gc, ~0L, dst); return Make_Gc (1, dpy, dst); } static Object P_Change_Gc (Object gc, Object g) { unsigned long mask; Check_Type (gc, T_Gc); mask = Vector_To_Record (g, GC_Size, Sym_Gc, GC_Rec); XChangeGC (GCONTEXT(gc)->dpy, GCONTEXT(gc)->gc, mask, &GCV); return Void; } Object P_Free_Gc (Object g) { Check_Type (g, T_Gc); if (!GCONTEXT(g)->free) XFreeGC (GCONTEXT(g)->dpy, GCONTEXT(g)->gc); Deregister_Object (g); GCONTEXT(g)->free = 1; return Void; } static Object P_Query_Best_Size (Object d, Object w, Object h, Object shape) { unsigned int rw, rh; Check_Type (d, T_Display); if (!XQueryBestSize (DISPLAY(d)->dpy, Symbols_To_Bits (shape, 0, Shape_Syms), DefaultRootWindow (DISPLAY(d)->dpy), Get_Integer (w), Get_Integer (h), &rw, &rh)) Primitive_Error ("cannot query best shape"); return Cons (Make_Integer (rw), Make_Integer (rh)); } static Object P_Set_Gcontext_Clip_Rectangles (Object gc, Object x, Object y, Object v, Object ord) { register XRectangle *p; register int i, n; Alloca_Begin; Check_Type (gc, T_Gc); Check_Type (v, T_Vector); n = VECTOR(v)->size; Alloca (p, XRectangle*, n * sizeof (XRectangle)); for (i = 0; i < n; i++) { Object rect; rect = VECTOR(v)->data[i]; Check_Type (rect, T_Pair); if (Fast_Length (rect) != 4) Primitive_Error ("invalid rectangle: ~s", rect); p[i].x = Get_Integer (Car (rect)); rect = Cdr (rect); p[i].y = Get_Integer (Car (rect)); rect = Cdr (rect); p[i].width = Get_Integer (Car (rect)); rect = Cdr (rect); p[i].height = Get_Integer (Car (rect)); } XSetClipRectangles (GCONTEXT(gc)->dpy, GCONTEXT(gc)->gc, Get_Integer (x), Get_Integer (y), p, n, Symbols_To_Bits (ord, 0, Ordering_Syms)); Alloca_End; return Void; } static Object P_Set_Gcontext_Dashlist (Object gc, Object off, Object v) { register char *p; register int i, n, d; Alloca_Begin; Check_Type (gc, T_Gc); Check_Type (v, T_Vector); n = VECTOR(v)->size; Alloca (p, char*, n); for (i = 0; i < n; i++) { d = Get_Integer (VECTOR(v)->data[i]); if (d < 0 || d > 255) Range_Error (VECTOR(v)->data[i]); p[i] = d; } XSetDashes (GCONTEXT(gc)->dpy, GCONTEXT(gc)->gc, Get_Integer (off), p, n); Alloca_End; return Void; } #define ValidGCValuesBits \ (GCFunction | GCPlaneMask | GCForeground | GCBackground | GCLineWidth |\ GCLineStyle | GCCapStyle | GCJoinStyle | GCFillStyle | GCFillRule |\ GCTile | GCStipple | GCTileStipXOrigin | GCTileStipYOrigin | GCFont |\ GCSubwindowMode | GCGraphicsExposures | GCClipXOrigin | GCClipYOrigin |\ GCDashOffset | GCArcMode) static Object P_Get_Gc_Values (Object gc) { unsigned long mask = ValidGCValuesBits; Check_Type (gc, T_Gc); if (!XGetGCValues (GCONTEXT(gc)->dpy, GCONTEXT(gc)->gc, mask, &GCV)) Primitive_Error ("cannot get gcontext values"); return Record_To_Vector (GC_Rec, GC_Size, Sym_Gc, GCONTEXT(gc)->dpy, mask); } void elk_init_xlib_gcontext () { Define_Symbol (&Sym_Gc, "gcontext"); Generic_Define (Gc, "gcontext", "gcontext?"); Define_Primitive (P_Gc_Display, "gcontext-display", 1, 1, EVAL); Define_Primitive (P_Create_Gc, "xlib-create-gcontext",2, 2, EVAL); Define_Primitive (P_Copy_Gc, "copy-gcontext", 2, 2, EVAL); Define_Primitive (P_Change_Gc, "xlib-change-gcontext",2, 2, EVAL); Define_Primitive (P_Free_Gc, "free-gcontext", 1, 1, EVAL); Define_Primitive (P_Query_Best_Size, "query-best-size", 4, 4, EVAL); Define_Primitive (P_Set_Gcontext_Clip_Rectangles, "set-gcontext-clip-rectangles!", 5, 5, EVAL); Define_Primitive (P_Set_Gcontext_Dashlist, "set-gcontext-dashlist!", 3, 3, EVAL); Define_Primitive (P_Get_Gc_Values, "xlib-get-gcontext-values", 1, 1, EVAL); } elk-3.99.8/lib/xlib/key.c0000644000175000017500000001376711577076306012012 00000000000000/* key.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "xlib.h" #include #ifdef XLIB_RELEASE_5_OR_LATER /* I don't know if XDisplayKeycodes() was already there in X11R4. */ static Object P_Display_Min_Keycode (Object d) { int mink, maxk; Check_Type (d, T_Display); XDisplayKeycodes(DISPLAY(d)->dpy, &mink, &maxk); return Make_Integer (mink); } static Object P_Display_Max_Keycode (Object d) { int mink, maxk; Check_Type (d, T_Display); XDisplayKeycodes(DISPLAY(d)->dpy, &mink, &maxk); return Make_Integer (maxk); } #else static Object P_Display_Min_Keycode (Object d) { Check_Type (d, T_Display); return Make_Integer (DISPLAY(d)->dpy->min_keycode); } static Object P_Display_Max_Keycode (Object d) { Check_Type (d, T_Display); return Make_Integer (DISPLAY(d)->dpy->max_keycode); } #endif #ifdef XLIB_RELEASE_5_OR_LATER /* I'm not sure if this works correctly in X11R4: */ static Object P_Display_Keysyms_Per_Keycode (Object d) { KeySym *ksyms; int mink, maxk, ksyms_per_kode; Check_Type (d, T_Display); XDisplayKeycodes(DISPLAY(d)->dpy, &mink, &maxk); ksyms = XGetKeyboardMapping(DISPLAY(d)->dpy, (KeyCode)mink, maxk - mink + 1, &ksyms_per_kode); return Make_Integer (ksyms_per_kode); } #else static Object P_Display_Keysyms_Per_Keycode (Object d) { Check_Type (d, T_Display); /* Force initialization: */ Disable_Interrupts; (void)XKeycodeToKeysym (DISPLAY(d)->dpy, DISPLAY(d)->dpy->min_keycode, 0); Enable_Interrupts; return Make_Integer (DISPLAY(d)->dpy->keysyms_per_keycode); } #endif static Object P_String_To_Keysym (Object s) { KeySym k; k = XStringToKeysym (Get_Strsym (s)); return k == NoSymbol ? False : Make_Unsigned_Long ((unsigned long)k); } static Object P_Keysym_To_String (Object k) { register char *s; s = XKeysymToString ((KeySym)Get_Long (k)); return s ? Make_String (s, strlen (s)) : False; } static Object P_Keycode_To_Keysym (Object d, Object k, Object index) { Object ret; Check_Type (d, T_Display); Disable_Interrupts; ret = Make_Unsigned_Long ((unsigned long)XKeycodeToKeysym (DISPLAY(d)->dpy, Get_Integer (k), Get_Integer (index))); Enable_Interrupts; return ret; } static Object P_Keysym_To_Keycode (Object d, Object k) { Object ret; Check_Type (d, T_Display); Disable_Interrupts; ret = Make_Unsigned (XKeysymToKeycode (DISPLAY(d)->dpy, (KeySym)Get_Long (k))); Enable_Interrupts; return ret; } static Object P_Lookup_String (Object d, Object k, Object mask) { XKeyEvent e; char buf[1024]; register int len; KeySym keysym_return; XComposeStatus status_return; Check_Type (d, T_Display); e.display = DISPLAY(d)->dpy; e.keycode = Get_Integer (k); e.state = Symbols_To_Bits (mask, 1, State_Syms); Disable_Interrupts; len = XLookupString (&e, buf, 1024, &keysym_return, &status_return); Enable_Interrupts; return Make_String (buf, len); } static Object P_Rebind_Keysym (Object d, Object k, Object mods, Object str) { KeySym *p; register int i, n; Alloca_Begin; Check_Type (d, T_Display); Check_Type (str, T_String); Check_Type (mods, T_Vector); n = VECTOR(mods)->size; Alloca (p, KeySym*, n * sizeof (KeySym)); for (i = 0; i < n; i++) p[i] = (KeySym)Get_Long (VECTOR(mods)->data[i]); XRebindKeysym (DISPLAY(d)->dpy, (KeySym)Get_Long (k), p, n, (unsigned char *)STRING(str)->data, STRING(str)->size); Alloca_End; return Void; } static Object P_Refresh_Keyboard_Mapping (Object w, Object event) { static XMappingEvent fake; Check_Type (w, T_Window); fake.type = MappingNotify; fake.display = WINDOW(w)->dpy; fake.window = WINDOW(w)->win; fake.request = Symbols_To_Bits (event, 0, Mapping_Syms); XRefreshKeyboardMapping (&fake); return Void; } void elk_init_xlib_key () { Define_Primitive (P_Display_Min_Keycode, "display-min-keycode", 1, 1, EVAL); Define_Primitive (P_Display_Max_Keycode, "display-max-keycode", 1, 1, EVAL); Define_Primitive (P_Display_Keysyms_Per_Keycode, "display-keysyms-per-keycode", 1, 1, EVAL); Define_Primitive (P_String_To_Keysym, "string->keysym", 1, 1, EVAL); Define_Primitive (P_Keysym_To_String, "keysym->string", 1, 1, EVAL); Define_Primitive (P_Keycode_To_Keysym, "keycode->keysym", 3, 3, EVAL); Define_Primitive (P_Keysym_To_Keycode, "keysym->keycode", 2, 2, EVAL); Define_Primitive (P_Lookup_String, "lookup-string", 3, 3, EVAL); Define_Primitive (P_Rebind_Keysym, "rebind-keysym", 4, 4, EVAL); Define_Primitive (P_Refresh_Keyboard_Mapping, "refresh-keyboard-mapping", 2, 2, EVAL); } elk-3.99.8/lib/xlib/graphics.c0000644000175000017500000002607311577076306013014 00000000000000/* graphics.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "xlib.h" extern int XDrawPoints(), XDrawLines(), XDrawRectangle(), XFillRectangle(); extern int XDrawRectangles(), XFillRectangles(), XDrawArc(), XFillArc(); extern int XDrawArcs(), XFillArcs(), XFillPolygon(); static Object P_Clear_Area (Object win, Object x, Object y, Object w, Object h, Object e) { Check_Type (win, T_Window); Check_Type (e, T_Boolean); XClearArea (WINDOW(win)->dpy, WINDOW(win)->win, Get_Integer (x), Get_Integer (y), Get_Integer (w), Get_Integer (h), EQ(e, True)); return Void; } static Object P_Copy_Area (Object src, Object gc, Object sx, Object sy, Object w, Object h, Object dst, Object dx, Object dy) { Display *dpy; Drawable ddst = Get_Drawable (dst, &dpy), dsrc = Get_Drawable (src, &dpy); Check_Type (gc, T_Gc); XCopyArea (dpy, dsrc, ddst, GCONTEXT(gc)->gc, Get_Integer (sx), Get_Integer (sy), Get_Integer (w), Get_Integer (h), Get_Integer (dx), Get_Integer (dy)); return Void; } static Object P_Copy_Plane (Object src, Object gc, Object plane, Object sx, Object sy, Object w, Object h, Object dst, Object dx, Object dy) { Display *dpy; Drawable ddst = Get_Drawable (dst, &dpy), dsrc = Get_Drawable (src, &dpy); register unsigned long p; Check_Type (gc, T_Gc); p = (unsigned long)Get_Long (plane); if (p & (p-1)) Primitive_Error ("invalid plane: ~s", plane); XCopyPlane (dpy, dsrc, ddst, GCONTEXT(gc)->gc, Get_Integer (sx), Get_Integer (sy), Get_Integer (w), Get_Integer (h), Get_Integer (dx), Get_Integer (dy), p); return Void; } static Object P_Draw_Point (Object d, Object gc, Object x, Object y) { Display *dpy; Drawable dr = Get_Drawable (d, &dpy); Check_Type (gc, T_Gc); XDrawPoint (dpy, dr, GCONTEXT(gc)->gc, Get_Integer (x), Get_Integer (y)); return Void; } static Object Internal_Draw_Points (Object d, Object gc, Object v, Object relative, int (*func)(), Object shape) { Display *dpy; Drawable dr = Get_Drawable (d, &dpy); register XPoint *p; register int i, n; int rel, sh = 0; Alloca_Begin; Check_Type (gc, T_Gc); Check_Type (relative, T_Boolean); rel = EQ(relative, True) ? CoordModePrevious : CoordModeOrigin; if (func == XFillPolygon) sh = Symbols_To_Bits (shape, 0, Polyshape_Syms); n = VECTOR(v)->size; Alloca (p, XPoint*, n * sizeof (XPoint)); for (i = 0; i < n; i++) { Object point; point = VECTOR(v)->data[i]; Check_Type (point, T_Pair); p[i].x = Get_Integer (Car (point)); p[i].y = Get_Integer (Cdr (point)); } if (func == XFillPolygon) XFillPolygon (dpy, dr, GCONTEXT(gc)->gc, p, n, sh, rel); else (*func)(dpy, dr, GCONTEXT(gc)->gc, p, n, rel); Alloca_End; return Void; } static Object P_Draw_Points (Object d, Object gc, Object v, Object relative) { return Internal_Draw_Points (d, gc, v, relative, XDrawPoints, Null); } static Object P_Draw_Line (Object d, Object gc, Object x1, Object y1, Object x2, Object y2) { Display *dpy; Drawable dr = Get_Drawable (d, &dpy); Check_Type (gc, T_Gc); XDrawLine (dpy, dr, GCONTEXT(gc)->gc, Get_Integer (x1), Get_Integer (y1), Get_Integer (x2), Get_Integer (y2)); return Void; } static Object P_Draw_Lines (Object d, Object gc, Object v, Object relative) { return Internal_Draw_Points (d, gc, v, relative, XDrawLines, Null); } static Object P_Draw_Segments (Object d, Object gc, Object v) { Display *dpy; Drawable dr = Get_Drawable (d, &dpy); register XSegment *p; register int i, n; Alloca_Begin; Check_Type (gc, T_Gc); n = VECTOR(v)->size; Alloca (p, XSegment*, n * sizeof (XSegment)); for (i = 0; i < n; i++) { Object seg; seg = VECTOR(v)->data[i]; Check_Type (seg, T_Pair); if (Fast_Length (seg) != 4) Primitive_Error ("invalid segment: ~s", seg); p[i].x1 = Get_Integer (Car (seg)); seg = Cdr (seg); p[i].y1 = Get_Integer (Car (seg)); seg = Cdr (seg); p[i].x2 = Get_Integer (Car (seg)); seg = Cdr (seg); p[i].y2 = Get_Integer (Car (seg)); } XDrawSegments (dpy, dr, GCONTEXT(gc)->gc, p, n); Alloca_End; return Void; } static Object Internal_Draw_Rectangle (Object d, Object gc, Object x, Object y, Object w, Object h, int (*func)()) { Display *dpy; Drawable dr = Get_Drawable (d, &dpy); Check_Type (gc, T_Gc); (*func)(dpy, dr, GCONTEXT(gc)->gc, Get_Integer (x), Get_Integer (y), Get_Integer (w), Get_Integer (h)); return Void; } static Object P_Draw_Rectangle (Object d, Object gc, Object x, Object y, Object w, Object h) { return Internal_Draw_Rectangle (d, gc, x, y, w, h, XDrawRectangle); } static Object P_Fill_Rectangle (Object d, Object gc, Object x, Object y, Object w, Object h) { return Internal_Draw_Rectangle (d, gc, x, y, w, h, XFillRectangle); } static Object Internal_Draw_Rectangles (Object d, Object gc, Object v, int (*func)()) { Display *dpy; Drawable dr = Get_Drawable (d, &dpy); register XRectangle *p; register int i, n; Alloca_Begin; Check_Type (gc, T_Gc); n = VECTOR(v)->size; Alloca (p, XRectangle*, n * sizeof (XRectangle)); for (i = 0; i < n; i++) { Object rect; rect = VECTOR(v)->data[i]; Check_Type (rect, T_Pair); if (Fast_Length (rect) != 4) Primitive_Error ("invalid rectangle: ~s", rect); p[i].x = Get_Integer (Car (rect)); rect = Cdr (rect); p[i].y = Get_Integer (Car (rect)); rect = Cdr (rect); p[i].width = Get_Integer (Car (rect)); rect = Cdr (rect); p[i].height = Get_Integer (Car (rect)); } (*func)(dpy, dr, GCONTEXT(gc)->gc, p, n); Alloca_End; return Void; } static Object P_Draw_Rectangles (Object d, Object gc, Object v) { return Internal_Draw_Rectangles (d, gc, v, XDrawRectangles); } static Object P_Fill_Rectangles (Object d, Object gc, Object v) { return Internal_Draw_Rectangles (d, gc, v, XFillRectangles); } static Object Internal_Draw_Arc (Object d, Object gc, Object x, Object y, Object w, Object h, Object a1, Object a2, int (*func)()) { Display *dpy; Drawable dr = Get_Drawable (d, &dpy); Check_Type (gc, T_Gc); (*func)(dpy, dr, GCONTEXT(gc)->gc, Get_Integer (x), Get_Integer (y), Get_Integer (w), Get_Integer (h), Get_Integer (a1), Get_Integer (a2)); return Void; } static Object P_Draw_Arc (Object d, Object gc, Object x, Object y, Object w, Object h, Object a1, Object a2) { return Internal_Draw_Arc (d, gc, x, y, w, h, a1, a2, XDrawArc); } static Object P_Fill_Arc (Object d, Object gc, Object x, Object y, Object w, Object h, Object a1, Object a2) { return Internal_Draw_Arc (d, gc, x, y, w, h, a1, a2, XFillArc); } static Object Internal_Draw_Arcs (Object d, Object gc, Object v, int (*func)()) { Display *dpy; Drawable dr = Get_Drawable (d, &dpy); register XArc *p; register int i, n; Alloca_Begin; Check_Type (gc, T_Gc); n = VECTOR(v)->size; Alloca (p, XArc*, n * sizeof (XArc)); for (i = 0; i < n; i++) { Object arc; arc = VECTOR(v)->data[i]; Check_Type (arc, T_Pair); if (Fast_Length (arc) != 6) Primitive_Error ("invalid arc: ~s", arc); p[i].x = Get_Integer (Car (arc)); arc = Cdr (arc); p[i].y = Get_Integer (Car (arc)); arc = Cdr (arc); p[i].width = Get_Integer (Car (arc)); arc = Cdr (arc); p[i].height = Get_Integer (Car (arc)); arc = Cdr (arc); p[i].angle1 = Get_Integer (Car (arc)); arc = Cdr (arc); p[i].angle2 = Get_Integer (Car (arc)); } (*func)(dpy, dr, GCONTEXT(gc)->gc, p, n); Alloca_End; return Void; } static Object P_Draw_Arcs (Object d, Object gc, Object v) { return Internal_Draw_Arcs (d, gc, v, XDrawArcs); } static Object P_Fill_Arcs (Object d, Object gc, Object v) { return Internal_Draw_Arcs (d, gc, v, XFillArcs); } static Object P_Fill_Polygon (Object d, Object gc, Object v, Object relative, Object shape) { return Internal_Draw_Points (d, gc, v, relative, XFillPolygon, shape); } void elk_init_xlib_graphics () { Define_Primitive (P_Clear_Area, "clear-area", 6, 6, EVAL); Define_Primitive (P_Copy_Area, "copy-area", 9, 9, EVAL); Define_Primitive (P_Copy_Plane, "copy-plane", 10,10, EVAL); Define_Primitive (P_Draw_Point, "draw-point", 4, 4, EVAL); Define_Primitive (P_Draw_Points, "draw-points", 4, 4, EVAL); Define_Primitive (P_Draw_Line, "draw-line", 6, 6, EVAL); Define_Primitive (P_Draw_Lines, "draw-lines", 4, 4, EVAL); Define_Primitive (P_Draw_Segments, "draw-segments", 3, 3, EVAL); Define_Primitive (P_Draw_Rectangle, "draw-rectangle", 6, 6, EVAL); Define_Primitive (P_Fill_Rectangle, "fill-rectangle", 6, 6, EVAL); Define_Primitive (P_Draw_Rectangles, "draw-rectangles", 3, 3, EVAL); Define_Primitive (P_Fill_Rectangles, "fill-rectangles", 3, 3, EVAL); Define_Primitive (P_Draw_Arc, "draw-arc", 8, 8, EVAL); Define_Primitive (P_Fill_Arc, "fill-arc", 8, 8, EVAL); Define_Primitive (P_Draw_Arcs, "draw-arcs", 3, 3, EVAL); Define_Primitive (P_Fill_Arcs, "fill-arcs", 3, 3, EVAL); Define_Primitive (P_Fill_Polygon, "fill-polygon", 5, 5, EVAL); } elk-3.99.8/lib/xlib/color.c0000644000175000017500000001145611577076306012331 00000000000000/* color.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "xlib.h" Generic_Predicate (Color) static int Color_Equal (Object x, Object y) { register XColor *p = &COLOR(x)->c, *q = &COLOR(y)->c; return p->red == q->red && p->green == q->green && p->blue == q->blue; } Generic_Print (Color, "#[color %lu]", (unsigned int)(uintptr_t)POINTER(x)) Object Make_Color (unsigned int r, unsigned int g, unsigned int b) { Object c; c = Find_Object (T_Color, (GENERIC)0, Match_X_Obj, r, g, b); if (Nullp (c)) { c = Alloc_Object (sizeof (struct S_Color), T_Color, 0); COLOR(c)->tag = Null; COLOR(c)->c.red = r; COLOR(c)->c.green = g; COLOR(c)->c.blue = b; Register_Object (c, (GENERIC)0, (PFO)0, 0); } return c; } XColor *Get_Color (Object c) { Check_Type (c, T_Color); return &COLOR(c)->c; } static unsigned short Get_RGB_Value (Object x) { double d; d = Get_Double (x); if (d < 0.0 || d > 1.0) Primitive_Error ("bad RGB value: ~s", x); return (unsigned short)(d * 65535); } static Object P_Make_Color (Object r, Object g, Object b) { return Make_Color (Get_RGB_Value (r), Get_RGB_Value (g), Get_RGB_Value (b)); } static Object P_Color_Rgb_Values (Object c) { Object ret, t, x; GC_Node3; Check_Type (c, T_Color); ret = t = Null; GC_Link3 (c, ret, t); t = ret = P_Make_List (Make_Integer (3), Null); GC_Unlink; x = Make_Reduced_Flonum ((double)COLOR(c)->c.red / 65535.0); Car (t) = x; t = Cdr (t); x = Make_Reduced_Flonum ((double)COLOR(c)->c.green / 65535.0); Car (t) = x; t = Cdr (t); x = Make_Reduced_Flonum ((double)COLOR(c)->c.blue / 65535.0); Car (t) = x; return ret; } static Object P_Query_Color (Object cmap, Object p) { XColor c; Colormap cm = Get_Colormap (cmap); c.pixel = Get_Pixel (p); Disable_Interrupts; XQueryColor (COLORMAP(cmap)->dpy, cm, &c); Enable_Interrupts; return Make_Color (c.red, c.green, c.blue); } static Object P_Query_Colors (Object cmap, Object v) { Colormap cm = Get_Colormap (cmap); register int i, n; Object ret; register XColor *p; GC_Node; Alloca_Begin; Check_Type (v, T_Vector); n = VECTOR(v)->size; Alloca (p, XColor*, n * sizeof (XColor)); for (i = 0; i < n; i++) p[i].pixel = Get_Pixel (VECTOR(v)->data[i]); Disable_Interrupts; XQueryColors (COLORMAP(cmap)->dpy, cm, p, n); Enable_Interrupts; ret = Make_Vector (n, Null); GC_Link (ret); for (i = 0; i < n; i++, p++) { Object x; x = Make_Color (p->red, p->green, p->blue); VECTOR(ret)->data[i] = x; } GC_Unlink; Alloca_End; return ret; } static Object P_Lookup_Color (Object cmap, Object name) { XColor visual, exact; Colormap cm = Get_Colormap (cmap); Object ret, x; GC_Node; if (!XLookupColor (COLORMAP(cmap)->dpy, cm, Get_Strsym (name), &visual, &exact)) Primitive_Error ("no such color: ~s", name); ret = Cons (Null, Null); GC_Link (ret); x = Make_Color (visual.red, visual.green, visual.blue); Car (ret) = x; x = Make_Color (exact.red, exact.green, exact.blue); Cdr (ret) = x; GC_Unlink; return ret; } void elk_init_xlib_color () { Generic_Define (Color, "color", "color?"); Define_Primitive (P_Make_Color, "make-color", 3, 3, EVAL); Define_Primitive (P_Color_Rgb_Values, "color-rgb-values", 1, 1, EVAL); Define_Primitive (P_Query_Color, "query-color", 2, 2, EVAL); Define_Primitive (P_Query_Colors, "query-colors", 2, 2, EVAL); Define_Primitive (P_Lookup_Color, "lookup-color", 2, 2, EVAL); } elk-3.99.8/lib/xlib/type.c0000644000175000017500000007336511577076306012203 00000000000000/* type.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "xlib.h" static Object Set_Attr_Slots; static Object Conf_Slots; static Object GC_Slots; static Object Geometry_Slots; static Object Win_Attr_Slots; static Object Font_Info_Slots; static Object Char_Info_Slots; static Object Wm_Hints_Slots; static Object Size_Hints_Slots; static Object Sym_Parent_Relative, Sym_Copy_From_Parent; XSetWindowAttributes SWA; RECORD Set_Attr_Rec[] = { { (char *)&SWA.background_pixmap, "background-pixmap", T_BACKGROUND, 0, CWBackPixmap }, { (char *)&SWA.background_pixel, "background-pixel", T_PIXEL, 0, CWBackPixel }, { (char *)&SWA.border_pixmap, "border-pixmap", T_BORDER, 0, CWBorderPixmap }, { (char *)&SWA.border_pixel, "border-pixel", T_PIXEL, 0, CWBorderPixel }, { (char *)&SWA.bit_gravity, "bit-gravity", T_SYM, Bit_Grav_Syms, CWBitGravity }, { (char *)&SWA.win_gravity, "gravity", T_SYM, Grav_Syms, CWWinGravity }, { (char *)&SWA.backing_store, "backing-store", T_SYM, Backing_Store_Syms, CWBackingStore }, { (char *)&SWA.backing_planes, "backing-planes", T_PIXEL, 0, CWBackingPlanes }, { (char *)&SWA.backing_pixel, "backing-pixel", T_PIXEL, 0, CWBackingPixel }, { (char *)&SWA.save_under, "save-under", T_BOOL, 0, CWSaveUnder }, { (char *)&SWA.event_mask, "event-mask", T_MASK, Event_Syms, CWEventMask }, { (char *)&SWA.do_not_propagate_mask, "do-not-propagate-mask", T_MASK, Event_Syms, CWDontPropagate }, { (char *)&SWA.override_redirect, "override-redirect", T_BOOL, 0, CWOverrideRedirect }, { (char *)&SWA.colormap, "colormap", T_COLORMAP, 0, CWColormap }, { (char *)&SWA.cursor, "cursor", T_CURSOR, 0, CWCursor }, { 0, 0, T_NONE, 0, 0 } }; int Set_Attr_Size = sizeof Set_Attr_Rec / sizeof (RECORD); XWindowChanges WC; RECORD Conf_Rec[] = { { (char *)&WC.x, "x", T_INT, 0, CWX }, { (char *)&WC.y, "y", T_INT, 0, CWY }, { (char *)&WC.width, "width", T_INT, 0, CWWidth }, { (char *)&WC.height, "height", T_INT, 0, CWHeight }, { (char *)&WC.border_width, "border-width", T_INT, 0, CWBorderWidth }, { (char *)&WC.sibling, "sibling", T_WINDOW, 0, CWSibling }, { (char *)&WC.stack_mode, "stack-mode", T_SYM, Stack_Mode_Syms, CWStackMode }, { 0, 0, T_NONE, 0, 0 } }; int Conf_Size = sizeof Conf_Rec / sizeof (RECORD); XGCValues GCV; RECORD GC_Rec[] = { { (char *)&GCV.function, "function", T_SYM, Func_Syms, GCFunction }, { (char *)&GCV.plane_mask, "plane-mask", T_PIXEL, 0, GCPlaneMask }, { (char *)&GCV.foreground, "foreground", T_PIXEL, 0, GCForeground }, { (char *)&GCV.background, "background", T_PIXEL, 0, GCBackground }, { (char *)&GCV.line_width, "line-width", T_INT, 0, GCLineWidth }, { (char *)&GCV.line_style, "line-style", T_SYM, Line_Style_Syms, GCLineStyle }, { (char *)&GCV.cap_style, "cap-style", T_SYM, Cap_Style_Syms, GCCapStyle }, { (char *)&GCV.join_style, "join-style", T_SYM, Join_Style_Syms, GCJoinStyle }, { (char *)&GCV.fill_style, "fill-style", T_SYM, Fill_Style_Syms, GCFillStyle }, { (char *)&GCV.fill_rule, "fill-rule", T_SYM, Fill_Rule_Syms, GCFillRule }, { (char *)&GCV.arc_mode, "arc-mode", T_SYM, Arc_Mode_Syms, GCArcMode }, { (char *)&GCV.tile, "tile", T_PIXMAP, 0, GCTile }, { (char *)&GCV.stipple, "stipple", T_PIXMAP, 0, GCStipple }, { (char *)&GCV.ts_x_origin, "ts-x", T_INT, 0, GCTileStipXOrigin }, { (char *)&GCV.ts_y_origin, "ts-y", T_INT, 0, GCTileStipYOrigin }, { (char *)&GCV.font, "font", T_FONT, 0, GCFont }, { (char *)&GCV.subwindow_mode, "subwindow-mode", T_SYM, Subwin_Mode_Syms, GCSubwindowMode }, { (char *)&GCV.graphics_exposures, "exposures", T_BOOL, 0, GCGraphicsExposures }, { (char *)&GCV.clip_x_origin, "clip-x", T_INT, 0, GCClipXOrigin }, { (char *)&GCV.clip_y_origin, "clip-y", T_INT, 0, GCClipYOrigin }, { (char *)&GCV.clip_mask, "clip-mask", T_PIXMAP, 0, GCClipMask }, { (char *)&GCV.dash_offset, "dash-offset", T_INT, 0, GCDashOffset }, { (char *)&GCV.dashes, "dashes", T_CHAR, 0, GCDashList }, {0, 0, T_NONE, 0, 0 } }; int GC_Size = sizeof GC_Rec / sizeof (RECORD); GEOMETRY GEO; RECORD Geometry_Rec[] = { { (char *)&GEO.root, "root", T_WINDOW, 0, 0 }, { (char *)&GEO.x, "x", T_INT, 0, 0 }, { (char *)&GEO.y, "y", T_INT, 0, 0 }, { (char *)&GEO.width, "width", T_INT, 0, 0 }, { (char *)&GEO.height, "height", T_INT, 0, 0 }, { (char *)&GEO.border_width, "border-width", T_INT, 0, 0 }, { (char *)&GEO.depth, "depth", T_INT, 0, 0 }, {0, 0, T_NONE, 0, 0 } }; int Geometry_Size = sizeof Geometry_Rec / sizeof (RECORD); XWindowAttributes WA; RECORD Win_Attr_Rec[] = { { (char *)&WA.x, "x", T_INT, 0, 0 }, { (char *)&WA.y, "y", T_INT, 0, 0 }, { (char *)&WA.width, "width", T_INT, 0, 0 }, { (char *)&WA.height, "height", T_INT, 0, 0 }, { (char *)&WA.border_width, "border-width", T_INT, 0, 0 }, { (char *)&WA.depth, "depth", T_INT, 0, 0 }, { (char *)&WA.visual, "visual", T_NONE, 0, 0 }, { (char *)&WA.root, "root", T_WINDOW, 0, 0 }, #if defined(__cplusplus) || defined(c_plusplus) { (char *)&WA.c_class, "class", T_SYM, #else { (char *)&WA.class, "class", T_SYM, #endif Class_Syms, 0 }, { (char *)&WA.bit_gravity, "bit-gravity", T_SYM, Bit_Grav_Syms, 0 }, { (char *)&WA.win_gravity, "gravity", T_SYM, Grav_Syms, 0 }, { (char *)&WA.backing_store, "backing-store", T_SYM, Backing_Store_Syms, 0 }, { (char *)&WA.backing_planes, "backing-planes", T_PIXEL, 0, 0 }, { (char *)&WA.backing_pixel, "backing-pixel", T_PIXEL, 0, 0 }, { (char *)&WA.save_under, "save-under", T_BOOL, 0, 0 }, { (char *)&WA.colormap , "colormap", T_COLORMAP, 0, 0 }, { (char *)&WA.map_installed, "map-installed", T_BOOL, 0, 0 }, { (char *)&WA.map_state, "map-state", T_SYM, Map_State_Syms, 0 }, { (char *)&WA.all_event_masks, "all-event-masks", T_MASK, Event_Syms, 0 }, { (char *)&WA.your_event_mask, "your-event-mask", T_MASK, Event_Syms, 0 }, { (char *)&WA.do_not_propagate_mask, "do-not-propagate-mask", T_MASK, Event_Syms, 0 }, { (char *)&WA.override_redirect, "override-redirect", T_BOOL, 0, 0 }, { (char *)&WA.screen, "screen", T_NONE, 0, 0 }, {0, 0, T_NONE, 0, 0 } }; int Win_Attr_Size = sizeof Win_Attr_Rec / sizeof (RECORD); XFontStruct FI; RECORD Font_Info_Rec[] = { { (char *)&FI.direction, "direction", T_SYM, Direction_Syms, 0 }, { (char *)&FI.min_char_or_byte2, "min-byte2", T_INT, 0, 0 }, { (char *)&FI.max_char_or_byte2, "max-byte2", T_INT, 0, 0 }, { (char *)&FI.min_byte1, "min-byte1", T_INT, 0, 0 }, { (char *)&FI.max_byte1, "max-byte1", T_INT, 0, 0 }, { (char *)&FI.all_chars_exist, "all-chars-exist?", T_BOOL, 0, 0 }, { (char *)&FI.default_char, "default-char", T_INT, 0, 0 }, { (char *)&FI.ascent, "ascent", T_INT, 0, 0 }, { (char *)&FI.descent, "descent", T_INT, 0, 0 }, {0, 0, T_NONE, 0, 0 } }; int Font_Info_Size = sizeof Font_Info_Rec / sizeof (RECORD); XCharStruct CI; RECORD Char_Info_Rec[] = { { (char *)&CI.lbearing, "lbearing", T_SHORT, 0, 0 }, { (char *)&CI.rbearing, "rbearing", T_SHORT, 0, 0 }, { (char *)&CI.width, "width", T_SHORT, 0, 0 }, { (char *)&CI.ascent, "ascent", T_SHORT, 0, 0 }, { (char *)&CI.descent, "descent", T_SHORT, 0, 0 }, { (char *)&CI.attributes, "attributes", T_SHORT, 0, 0 }, {0, 0, T_NONE, 0, 0 } }; int Char_Info_Size = sizeof Char_Info_Rec / sizeof (RECORD); XWMHints WMH; RECORD Wm_Hints_Rec[] = { { (char *)&WMH.input, "input?", T_BOOL, 0, InputHint }, { (char *)&WMH.initial_state, "initial-state", T_SYM, Initial_State_Syms, StateHint }, { (char *)&WMH.icon_pixmap, "icon-pixmap", T_PIXMAP, 0, IconPixmapHint }, { (char *)&WMH.icon_window, "icon-window", T_WINDOW, 0, IconWindowHint }, { (char *)&WMH.icon_x, "icon-x", T_INT, 0, IconPositionHint }, { (char *)&WMH.icon_y, "icon-y", T_INT, 0, IconPositionHint }, { (char *)&WMH.icon_mask, "icon-mask", T_PIXMAP, 0, IconMaskHint }, { (char *)&WMH.window_group, "window-group", T_WINDOW, 0, WindowGroupHint }, {0, 0, T_NONE, 0, 0 } }; int Wm_Hints_Size = sizeof Wm_Hints_Rec / sizeof (RECORD); XSizeHints SZH; RECORD Size_Hints_Rec[] = { { (char *)&SZH.x, "x", T_INT, 0, PPosition }, { (char *)&SZH.y, "y", T_INT, 0, PPosition }, { (char *)&SZH.width, "width", T_INT, 0, PSize }, { (char *)&SZH.height, "height", T_INT, 0, PSize }, { (char *)&SZH.x, "x", T_INT, 0, USPosition }, { (char *)&SZH.y, "y", T_INT, 0, USPosition }, { (char *)&SZH.width, "width", T_INT, 0, USSize }, { (char *)&SZH.height, "height", T_INT, 0, USSize }, { (char *)&SZH.min_width, "min-width", T_INT, 0, PMinSize }, { (char *)&SZH.min_height, "min-height", T_INT, 0, PMinSize }, { (char *)&SZH.max_width, "max-width", T_INT, 0, PMaxSize }, { (char *)&SZH.max_height, "max-height", T_INT, 0, PMaxSize }, { (char *)&SZH.width_inc, "width-inc", T_INT, 0, PResizeInc }, { (char *)&SZH.height_inc, "height-inc", T_INT, 0, PResizeInc }, { (char *)&SZH.min_aspect.x, "min-aspect-x", T_INT, 0, PAspect }, { (char *)&SZH.min_aspect.y, "min-aspect-y", T_INT, 0, PAspect }, { (char *)&SZH.max_aspect.x, "max-aspect-x", T_INT, 0, PAspect }, { (char *)&SZH.max_aspect.y, "max-aspect-y", T_INT, 0, PAspect }, { (char *)&SZH.base_width, "base-width", T_INT, 0, PBaseSize }, { (char *)&SZH.base_height, "base-height", T_INT, 0, PBaseSize }, { (char *)&SZH.win_gravity, "gravity", T_SYM, Grav_Syms, PWinGravity }, {0, 0, T_NONE, 0, 0 } }; int Size_Hints_Size = sizeof Size_Hints_Rec / sizeof (RECORD); unsigned long Vector_To_Record (Object v, unsigned int len, Object sym, register RECORD *rp) { register Object *p; unsigned long mask = 0; Check_Type (v, T_Vector); p = VECTOR(v)->data; if (VECTOR(v)->size != len && !EQ(p[0], sym)) Primitive_Error ("invalid argument"); for ( ; rp->slot; rp++) { ++p; if (rp->type == T_NONE || Nullp (*p)) continue; switch (rp->type) { case T_INT: *(int *)rp->slot = Get_Integer (*p); break; case T_SHORT: *(short *)rp->slot = Get_Integer (*p); break; case T_CHAR: *(char *)rp->slot = Get_Integer (*p); break; case T_PIXEL: *(unsigned long *)rp->slot = Get_Pixel (*p); break; case T_BACKGROUND: if (EQ(*p, Sym_None)) *(Pixmap *)rp->slot = None; else if (EQ(*p, Sym_Parent_Relative)) *(Pixmap *)rp->slot = ParentRelative; else *(Pixmap *)rp->slot = Get_Pixmap (*p); break; case T_BORDER: if (EQ(*p, Sym_Copy_From_Parent)) { *(Pixmap *)rp->slot = CopyFromParent; break; } /* fall through */ case T_PIXMAP: *(Pixmap *)rp->slot = Get_Pixmap (*p); break; case T_BOOL: Check_Type (*p, T_Boolean); *(Bool *)rp->slot = (Bool)(FIXNUM(*p)); break; case T_FONT: *(Font *)rp->slot = Get_Font (*p); break; case T_COLORMAP: *(Colormap *)rp->slot = Get_Colormap (*p); break; case T_CURSOR: *(Cursor *)rp->slot = Get_Cursor (*p); break; case T_WINDOW: break; case T_MASK: *(long *)rp->slot = Symbols_To_Bits (*p, 1, rp->syms); break; case T_SYM: *(int *)rp->slot = (int)Symbols_To_Bits (*p, 0, rp->syms); break; default: Panic ("vector->record"); } mask |= rp->mask; } return mask; } Object Record_To_Vector (register RECORD *rp, int len, Object sym, Display *dpy, unsigned long flags) { register int i; Object v, x; GC_Node2; v = Null; GC_Link2 (sym, v); v = Make_Vector (len, Null); VECTOR(v)->data[0] = sym; for (i = 1; rp->slot; i++, rp++) { if (rp->type == T_NONE) continue; if (rp->mask && !(flags & rp->mask)) continue; x = Null; switch (rp->type) { case T_INT: x = Make_Integer (*(int *)rp->slot); break; case T_SHORT: x = Make_Integer (*(short *)rp->slot); break; case T_CHAR: x = Make_Integer (*(char *)rp->slot); break; case T_PIXEL: x = Make_Pixel (*(unsigned long *)rp->slot); break; case T_PIXMAP: if (*(unsigned long *)rp->slot == ~0UL) x = Sym_None; else x = Make_Pixmap_Foreign (dpy, *(Pixmap *)rp->slot); break; case T_FONT: if (*(unsigned long *)rp->slot == ~0UL) x = Sym_None; else { register XFontStruct *info; Disable_Interrupts; info = XQueryFont (dpy, *(Font *)rp->slot); Enable_Interrupts; x = Make_Font_Foreign (dpy, False, *(Font *)rp->slot, info); } break; case T_BOOL: x = *(Bool *)rp->slot ? True : False; break; case T_COLORMAP: x = Make_Colormap (0, dpy, *(Colormap *)rp->slot); break; case T_WINDOW: x = Make_Window (0, dpy, *(Window *)rp->slot); break; case T_MASK: x = Bits_To_Symbols (*(long *)rp->slot, 1, rp->syms); break; case T_SYM: x = Bits_To_Symbols ((unsigned long)*(int *)rp->slot, 0, rp->syms); break; default: Panic ("record->vector"); } VECTOR(v)->data[i] = x; } GC_Unlink; return v; } SYMDESCR Func_Syms[] = { { "clear", GXclear }, { "and", GXand }, { "and-reverse", GXandReverse }, { "copy", GXcopy }, { "and-inverted", GXandInverted }, { "no-op", GXnoop }, { "xor", GXxor }, { "or", GXor }, { "nor", GXnor }, { "equiv", GXequiv }, { "invert", GXinvert }, { "or-reverse", GXorReverse }, { "copy-inverted", GXcopyInverted }, { "or-inverted", GXorInverted }, { "nand", GXnand }, { "set", GXset }, { 0, 0 } }; SYMDESCR Bit_Grav_Syms[] = { { "forget", ForgetGravity }, { "north-west", NorthWestGravity }, { "north", NorthGravity }, { "north-east", NorthEastGravity }, { "west", WestGravity }, { "center", CenterGravity }, { "east", EastGravity }, { "south-west", SouthWestGravity }, { "south", SouthGravity }, { "south-east", SouthEastGravity }, { "static", StaticGravity }, { 0, 0 } }; SYMDESCR Grav_Syms[] = { { "unmap", UnmapGravity }, { "north-west", NorthWestGravity }, { "north", NorthGravity }, { "north-east", NorthEastGravity }, { "west", WestGravity }, { "center", CenterGravity }, { "east", EastGravity }, { "south-west", SouthWestGravity }, { "south", SouthGravity }, { "south-east", SouthEastGravity }, { "static", StaticGravity }, { 0, 0 } }; SYMDESCR Backing_Store_Syms[] = { { "not-useful", NotUseful }, { "when-mapped", WhenMapped }, { "always", Always }, { 0, 0 } }; SYMDESCR Stack_Mode_Syms[] = { { "above", Above }, { "below", Below }, { "top-if", TopIf }, { "bottom-if", BottomIf }, { "opposite", Opposite }, { 0, 0 } }; SYMDESCR Line_Style_Syms[] = { { "solid", LineSolid }, { "dash", LineOnOffDash }, { "double-dash", LineDoubleDash }, { 0, 0 } }; SYMDESCR Cap_Style_Syms[] = { { "not-last", CapNotLast }, { "butt", CapButt }, { "round", CapRound }, { "projecting", CapProjecting }, { 0, 0 } }; SYMDESCR Join_Style_Syms[] = { { "miter", JoinMiter }, { "round", JoinRound }, { "bevel", JoinBevel }, { 0, 0 } }; SYMDESCR Fill_Style_Syms[] = { { "solid", FillSolid }, { "tiled", FillTiled }, { "stippled", FillStippled }, { "opaque-stippled", FillOpaqueStippled }, { 0, 0 } }; SYMDESCR Fill_Rule_Syms[] = { { "even-odd", EvenOddRule }, { "winding", WindingRule }, { 0, 0 } }; SYMDESCR Arc_Mode_Syms[] = { { "chord", ArcChord }, { "pie-slice", ArcPieSlice }, { 0, 0 } }; SYMDESCR Subwin_Mode_Syms[] = { { "clip-by-children", ClipByChildren }, { "include-inferiors", IncludeInferiors }, { 0, 0 } }; SYMDESCR Class_Syms[] = { { "input-output", InputOutput }, { "input-only", InputOnly }, { 0, 0 } }; SYMDESCR Map_State_Syms[] = { { "unmapped", IsUnmapped }, { "unviewable", IsUnviewable }, { "viewable", IsViewable }, { 0, 0 } }; SYMDESCR State_Syms[] = { { "shift", ShiftMask }, { "lock", LockMask }, { "control", ControlMask }, { "mod1", Mod1Mask }, { "mod2", Mod2Mask }, { "mod3", Mod3Mask }, { "mod4", Mod4Mask }, { "mod5", Mod5Mask }, { "button1", Button1Mask }, { "button2", Button2Mask }, { "button3", Button3Mask }, { "button4", Button4Mask }, { "button5", Button5Mask }, { "any-modifier", AnyModifier }, { 0, 0 } }; SYMDESCR Button_Syms[] = { { "any-button", AnyButton }, { "button1", Button1 }, { "button2", Button2 }, { "button3", Button3 }, { "button4", Button4 }, { "button5", Button5 }, { 0, 0 } }; SYMDESCR Cross_Mode_Syms[] = { { "normal", NotifyNormal }, { "grab", NotifyGrab }, { "ungrab", NotifyUngrab }, { 0, 0 } }; SYMDESCR Cross_Detail_Syms[] = { { "ancestor", NotifyAncestor }, { "virtual", NotifyVirtual }, { "inferior", NotifyInferior }, { "nonlinear", NotifyNonlinear }, { "nonlinear-virtual", NotifyNonlinearVirtual }, { 0, 0 } }; SYMDESCR Focus_Detail_Syms[] = { { "ancestor", NotifyAncestor }, { "virtual", NotifyVirtual }, { "inferior", NotifyInferior }, { "nonlinear", NotifyNonlinear }, { "nonlinear-virtual", NotifyNonlinearVirtual }, { "pointer", NotifyPointer }, { "pointer-root", NotifyPointerRoot }, { "none", NotifyDetailNone }, { 0, 0 } }; SYMDESCR Visibility_Syms[] = { { "unobscured", VisibilityUnobscured }, { "partially-obscured", VisibilityPartiallyObscured }, { "fully-obscured", VisibilityFullyObscured }, { 0, 0 } }; SYMDESCR Place_Syms[] = { { "top", PlaceOnTop }, { "bottom", PlaceOnBottom }, { 0, 0 } }; SYMDESCR Prop_Syms[] = { { "new-value", PropertyNewValue }, { "deleted", PropertyDelete }, { 0, 0 } }; SYMDESCR Mapping_Syms[] = { { "modifier", MappingModifier }, { "keyboard", MappingKeyboard }, { "pointer", MappingPointer }, { 0, 0 } }; SYMDESCR Direction_Syms[] = { { "left-to-right", FontLeftToRight }, { "right-to-left", FontRightToLeft }, { 0, 0 } }; SYMDESCR Polyshape_Syms[] = { { "complex", Complex }, { "non-convex", Nonconvex }, { "convex", Convex }, { 0, 0 } }; SYMDESCR Propmode_Syms[] = { { "replace", PropModeReplace }, { "prepend", PropModePrepend }, { "append", PropModeAppend }, { 0, 0 } }; SYMDESCR Grabstatus_Syms[] = { { "success", Success }, { "not-viewable", GrabNotViewable }, { "already-grabbed", AlreadyGrabbed }, { "frozen", GrabFrozen }, { "invalid-time", GrabInvalidTime }, { 0, 0 } }; SYMDESCR Bitmapstatus_Syms[] = { { "success", BitmapSuccess }, { "open-failed", BitmapOpenFailed }, { "file-invalid", BitmapFileInvalid }, { "no-memory", BitmapNoMemory }, { 0, 0 } }; SYMDESCR Circulate_Syms[] = { { "raise-lowest", RaiseLowest }, { "lower-highest", LowerHighest }, { 0, 0 } }; SYMDESCR Allow_Events_Syms[] = { { "async-pointer", AsyncPointer }, { "sync-pointer", SyncPointer }, { "replay-pointer", ReplayPointer }, { "async-keyboard", AsyncKeyboard }, { "sync-keyboard", SyncKeyboard }, { "replay-keyboard", ReplayKeyboard }, { "async-both", AsyncBoth }, { "sync-both", SyncBoth }, { 0, 0 } }; SYMDESCR Revert_Syms[] = { { "none", RevertToNone }, { "pointer-root", RevertToPointerRoot }, { "parent", RevertToParent }, { 0, 0 } }; SYMDESCR Shape_Syms[] = { { "cursor", CursorShape }, { "tile", TileShape }, { "stipple", StippleShape }, { 0, 0 } }; SYMDESCR Initial_State_Syms[] = { { "dont-care", DontCareState }, { "normal", NormalState }, { "zoom", ZoomState }, { "iconic", IconicState }, { "inactive", InactiveState }, { 0, 0 } }; SYMDESCR Ordering_Syms[] = { { "unsorted", Unsorted }, { "y-sorted", YSorted }, { "yx-sorted", YXSorted }, { "yx-banded", YXBanded }, { 0, 0 } }; SYMDESCR Byte_Order_Syms[] = { { "lsb-first", LSBFirst }, { "msb-first", MSBFirst }, { 0, 0 } }; SYMDESCR Saveset_Syms[] = { { "insert", SetModeInsert }, { "delete", SetModeDelete }, { 0, 0 } }; SYMDESCR Closemode_Syms[] = { { "destroy-all", DestroyAll }, { "retain-permanent", RetainPermanent }, { "retain-temporary", RetainTemporary }, { 0, 0 } }; SYMDESCR Event_Syms[] = { { "key-press", KeyPressMask }, { "key-release", KeyReleaseMask }, { "button-press", ButtonPressMask }, { "button-release", ButtonReleaseMask }, { "enter-window", EnterWindowMask }, { "leave-window", LeaveWindowMask }, { "pointer-motion", PointerMotionMask }, { "pointer-motion-hint", PointerMotionHintMask }, { "button-1-motion", Button1MotionMask }, { "button-2-motion", Button2MotionMask }, { "button-3-motion", Button3MotionMask }, { "button-4-motion", Button4MotionMask }, { "button-5-motion", Button5MotionMask }, { "button-motion", ButtonMotionMask }, { "keymap-state", KeymapStateMask }, { "exposure", ExposureMask }, { "visibility-change", VisibilityChangeMask }, { "structure-notify", StructureNotifyMask }, { "resize-redirect", ResizeRedirectMask }, { "substructure-notify", SubstructureNotifyMask }, { "substructure-redirect", SubstructureRedirectMask }, { "focus-change", FocusChangeMask }, { "property-change", PropertyChangeMask }, { "colormap-change", ColormapChangeMask }, { "owner-grab-button", OwnerGrabButtonMask }, { "all-events", ~(unsigned long)0 }, { 0, 0 } }; SYMDESCR Error_Syms[] = { { "bad-request", BadRequest }, { "bad-value", BadValue }, { "bad-window", BadWindow }, { "bad-pixmap", BadPixmap }, { "bad-atom", BadAtom }, { "bad-cursor", BadCursor }, { "bad-font", BadFont }, { "bad-match", BadMatch }, { "bad-drawable", BadDrawable }, { "bad-access", BadAccess }, { "bad-alloc", BadAlloc }, { "bad-color", BadColor }, { "bad-gcontext", BadGC }, { "bad-id-choice", BadIDChoice }, { "bad-name", BadName }, { "bad-length", BadLength }, { "bad-implementation", BadImplementation }, { 0, 0 } }; static void Init_Record (RECORD *rec, int size, char *name, Object *var) { Object list, tail, cell; register int i; char buf[128]; GC_Node2; GC_Link2 (list, tail); for (list = tail = Null, i = 1; i < size; tail = cell, i++, rec++) { cell = Intern (rec->name); cell = Cons (cell, Make_Integer (i)); cell = Cons (cell, Null); if (Nullp (list)) list = cell; else P_Set_Cdr (tail, cell); } sprintf (buf, "%s-slots", name); Define_Variable (var, buf, list); GC_Unlink; } void elk_init_xlib_type () { Init_Record (Set_Attr_Rec, Set_Attr_Size, "set-window-attributes", &Set_Attr_Slots); Init_Record (Conf_Rec, Conf_Size, "window-configuration", &Conf_Slots); Init_Record (GC_Rec, GC_Size, "gcontext", &GC_Slots); Init_Record (Geometry_Rec, Geometry_Size, "geometry", &Geometry_Slots); Init_Record (Win_Attr_Rec, Win_Attr_Size, "get-window-attributes", &Win_Attr_Slots); Init_Record (Font_Info_Rec, Font_Info_Size, "font-info", &Font_Info_Slots); Init_Record (Char_Info_Rec, Char_Info_Size, "char-info", &Char_Info_Slots); Init_Record (Wm_Hints_Rec, Wm_Hints_Size, "wm-hints", &Wm_Hints_Slots); Init_Record (Size_Hints_Rec, Size_Hints_Size, "size-hints", &Size_Hints_Slots); Define_Symbol (&Sym_Parent_Relative, "parent-relative"); Define_Symbol (&Sym_Copy_From_Parent, "copy-from-parent"); } elk-3.99.8/lib/xlib/util.c0000644000175000017500000000605111577076306012163 00000000000000/* util.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "xlib.h" #include static Object P_Get_Default (Object d, Object program, Object option) { register char *ret; Check_Type (d, T_Display); ret = XGetDefault (DISPLAY(d)->dpy, Get_Strsym (program), Get_Strsym (option)); if (ret) return Make_String (ret, strlen (ret)); return False; } static Object P_Resource_Manager_String (Object d) { register char *ret; Check_Type (d, T_Display); ret = XResourceManagerString (DISPLAY(d)->dpy); return ret ? Make_String (ret, strlen (ret)) : False; } static Object P_Parse_Geometry (Object string) { Object ret, t; register int mask; int x, y; unsigned w, h; mask = XParseGeometry (Get_Strsym (string), &x, &y, &w, &h); t = ret = P_Make_List (Make_Integer (6), False); if (mask & XNegative) Car (t) = True; t = Cdr (t); if (mask & YNegative) Car (t) = True; t = Cdr (t); if (mask & XValue) Car (t) = Make_Integer (x); t = Cdr (t); if (mask & YValue) Car (t) = Make_Integer (y); t = Cdr (t); if (mask & WidthValue) Car (t) = Make_Unsigned (w); t = Cdr (t); if (mask & HeightValue) Car (t) = Make_Unsigned (h); return ret; } static Object P_Parse_Color (Object d, Object cmap, Object spec) { XColor ret; Check_Type (d, T_Display); if (XParseColor (DISPLAY(d)->dpy, Get_Colormap (cmap), Get_Strsym (spec), &ret)) return Make_Color (ret.red, ret.green, ret.blue); return False; } void elk_init_xlib_util () { Define_Primitive (P_Get_Default, "get-default", 3, 3, EVAL); Define_Primitive (P_Resource_Manager_String, "resource-manager-string", 1, 1, EVAL); Define_Primitive (P_Parse_Geometry, "parse-geometry", 1, 1, EVAL); Define_Primitive (P_Parse_Color, "parse-color", 3, 3, EVAL); } elk-3.99.8/lib/xlib/cursor.c0000644000175000017500000001002511577076306012517 00000000000000/* cursor.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "xlib.h" Generic_Predicate (Cursor) Generic_Equal_Dpy (Cursor, CURSOR, cursor) Generic_Print (Cursor, "#[cursor %lu]", CURSOR(x)->cursor) Generic_Get_Display (Cursor, CURSOR) static Object Internal_Make_Cursor (int finalize, Display *dpy, Cursor cursor) { Object c; if (cursor == None) return Sym_None; c = Find_Object (T_Cursor, (GENERIC)dpy, Match_X_Obj, cursor); if (Nullp (c)) { c = Alloc_Object (sizeof (struct S_Cursor), T_Cursor, 0); CURSOR(c)->tag = Null; CURSOR(c)->cursor = cursor; CURSOR(c)->dpy = dpy; CURSOR(c)->free = 0; Register_Object (c, (GENERIC)dpy, finalize ? P_Free_Cursor : (PFO)0, 0); } return c; } /* Backwards compatibility: */ Object Make_Cursor (Display *dpy, Cursor cursor) { return Internal_Make_Cursor (1, dpy, cursor); } Object Make_Cursor_Foreign (Display *dpy, Cursor cursor) { return Internal_Make_Cursor (0, dpy, cursor); } Cursor Get_Cursor (Object c) { if (EQ(c, Sym_None)) return None; Check_Type (c, T_Cursor); return CURSOR(c)->cursor; } Object P_Free_Cursor (Object c) { Check_Type (c, T_Cursor); if (!CURSOR(c)->free) XFreeCursor (CURSOR(c)->dpy, CURSOR(c)->cursor); Deregister_Object (c); CURSOR(c)->free = 1; return Void; } static Object P_Create_Cursor (Object srcp, Object maskp, Object x, Object y, Object f, Object b) { Pixmap sp = Get_Pixmap (srcp), mp; Display *d = PIXMAP(srcp)->dpy; mp = EQ(maskp, Sym_None) ? None : Get_Pixmap (maskp); return Make_Cursor (d, XCreatePixmapCursor (d, sp, mp, Get_Color (f), Get_Color (b), Get_Integer (x), Get_Integer (y))); } static Object P_Create_Glyph_Cursor (Object srcf, Object srcc, Object maskf, Object maskc, Object f, Object b) { Font sf = Get_Font (srcf), mf; Display *d = FONT(srcf)->dpy; mf = EQ(maskf, Sym_None) ? None : Get_Font (maskf); return Make_Cursor (d, XCreateGlyphCursor (d, sf, mf, Get_Integer (srcc), mf == None ? 0 : Get_Integer (maskc), Get_Color (f), Get_Color (b))); } static Object P_Recolor_Cursor (Object c, Object f, Object b) { Check_Type (c, T_Cursor); XRecolorCursor (CURSOR(c)->dpy, CURSOR(c)->cursor, Get_Color (f), Get_Color (b)); return Void; } void elk_init_xlib_cursor () { Generic_Define (Cursor, "cursor", "cursor?"); Define_Primitive (P_Cursor_Display, "cursor-display", 1, 1, EVAL); Define_Primitive (P_Free_Cursor, "free-cursor", 1, 1, EVAL); Define_Primitive (P_Create_Cursor, "create-cursor", 6, 6, EVAL); Define_Primitive (P_Create_Glyph_Cursor, "create-glyph-cursor", 6, 6, EVAL); Define_Primitive (P_Recolor_Cursor, "recolor-cursor", 3, 3, EVAL); } elk-3.99.8/lib/xlib/text.c0000644000175000017500000001530511577076306012174 00000000000000/* text.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "xlib.h" extern int XDrawText(), XDrawText16(); static Object Sym_1byte, Sym_2byte; static int Two_Byte (Object format) { Check_Type (format, T_Symbol); if (EQ(format, Sym_1byte)) return 0; else if (EQ(format, Sym_2byte)) return 1; Primitive_Error ("index format must be '1-byte or '2-byte"); /*NOTREACHED*/ return 0; } static int Get_1_Byte_Char (Object x) { register int c = Get_Integer (x); if (c < 0 || c > 255) Range_Error (x); return c; } static int Get_2_Byte_Char (Object x) { register int c = Get_Integer (x); if (c < 0 || c > 65535) Range_Error (x); return c; } /* Calculation of text widths and extents should not be done using * the Xlib functions. For instance, the values returned by * XTextExtents() are only shorts and can therefore overflow for * long strings. */ static Object Internal_Text_Metrics (Object font, Object t, Object f, int width) { char *s; XChar2b *s2; XFontStruct *info; Object *data; register int i, n; int dir, fasc, fdesc; Alloca_Begin; Check_Type (font, T_Font); info = FONT(font)->info; Check_Type (t, T_Vector); n = VECTOR(t)->size; data = VECTOR(t)->data; if (Two_Byte (f)) { Alloca (s2, XChar2b*, n * sizeof (XChar2b)); for (i = 0; i < n; i++) { register int c = Get_2_Byte_Char (data[i]); s2[i].byte1 = (c >> 8) & 0xff; s2[i].byte2 = c & 0xff; } if (width) i = XTextWidth16 (info, s2, n); else XTextExtents16 (info, s2, n, &dir, &fasc, &fdesc, &CI); } else { Alloca (s, char*, n); for (i = 0; i < n; i++) s[i] = Get_1_Byte_Char (data[i]); if (width) i = XTextWidth (info, s, n); else XTextExtents (info, s, n, &dir, &fasc, &fdesc, &CI); } Alloca_End; return width ? Make_Integer (i) : Record_To_Vector (Char_Info_Rec, Char_Info_Size, Sym_Char_Info, FONT(font)->dpy, ~0L); } static Object P_Text_Width (Object font, Object t, Object f) { return Internal_Text_Metrics (font, t, f, 1); } static Object P_Text_Extents (Object font, Object t, Object f) { return Internal_Text_Metrics (font, t, f, 0); } static Object P_Draw_Image_Text (Object d, Object gc, Object x, Object y, Object t, Object f) { Display *dpy; Drawable dr = Get_Drawable (d, &dpy); Object *data; register int i, n; char *s; XChar2b *s2; Alloca_Begin; Check_Type (gc, T_Gc); Check_Type (t, T_Vector); n = VECTOR(t)->size; data = VECTOR(t)->data; if (Two_Byte (f)) { Alloca (s2, XChar2b*, n * sizeof (XChar2b)); for (i = 0; i < n; i++) { register int c = Get_2_Byte_Char (data[i]); s2[i].byte1 = (c >> 8) & 0xff; s2[i].byte2 = c & 0xff; } XDrawImageString16 (dpy, dr, GCONTEXT(gc)->gc, Get_Integer (x), Get_Integer (y), s2, n); } else { Alloca (s, char*, n); for (i = 0; i < n; i++) s[i] = Get_1_Byte_Char (data[i]); XDrawImageString (dpy, dr, GCONTEXT(gc)->gc, Get_Integer (x), Get_Integer (y), s, n); } Alloca_End; return Void; } static Object P_Draw_Poly_Text (Object d, Object gc, Object x, Object y, Object t, Object f) { Display *dpy; Drawable dr = Get_Drawable (d, &dpy); Object *data; register int i, n, j, k; int twobyte, nitems; XTextItem *items; int (*func)(); Alloca_Begin; Check_Type (gc, T_Gc); twobyte = Two_Byte (f); func = twobyte ? (int(*)())XDrawText16 : (int(*)())XDrawText; Check_Type (t, T_Vector); if ((n = VECTOR(t)->size) == 0) return Void; for (data = VECTOR(t)->data, i = 0, nitems = 1; i < n; i++) if (TYPE(data[i]) == T_Font) nitems++; Alloca (items, XTextItem*, nitems * sizeof (XTextItem)); items[0].delta = 0; items[0].font = None; for (j = k = i = 0; i <= n; i++) { if (i == n || TYPE(data[i]) == T_Font) { items[j].nchars = i-k; if (twobyte) { register XChar2b *p; Alloca (p, XChar2b*, (i-k) * sizeof (XChar2b)); ((XTextItem16 *)items)[j].chars = p; for ( ; k < i; k++, p++) { register int c = Get_2_Byte_Char (data[k]); p->byte1 = (c >> 8) & 0xff; p->byte2 = c & 0xff; } } else { register char *p; Alloca (p, char*, i-k); items[j].chars = p; for ( ; k < i; k++) *p++ = Get_1_Byte_Char (data[k]); } k++; j++; if (i < n) { items[j].delta = 0; Open_Font_Maybe (data[i]); items[j].font = FONT(data[i])->id; } } } (*func)(dpy, dr, GCONTEXT(gc)->gc, Get_Integer (x), Get_Integer (y), items, nitems); Alloca_End; return Void; } void elk_init_xlib_text () { Define_Primitive (P_Text_Width, "text-width", 3, 3, EVAL); Define_Primitive (P_Text_Extents, "xlib-text-extents", 3, 3, EVAL); Define_Primitive (P_Draw_Image_Text, "draw-image-text", 6, 6, EVAL); Define_Primitive (P_Draw_Poly_Text, "draw-poly-text", 6, 6, EVAL); Define_Symbol (&Sym_1byte, "1-byte"); Define_Symbol (&Sym_2byte, "2-byte"); } elk-3.99.8/lib/xlib/wm.c0000644000175000017500000001530611577076306011634 00000000000000/* wm.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "xlib.h" static Object Sym_Pointer_Root; static Object P_Reparent_Window (Object w, Object parent, Object x, Object y) { Check_Type (w, T_Window); Check_Type (parent, T_Window); XReparentWindow (WINDOW(w)->dpy, WINDOW(w)->win, WINDOW(parent)->win, Get_Integer (x), Get_Integer (y)); return Void; } static Object P_Install_Colormap (Object c) { Check_Type (c, T_Colormap); XInstallColormap (COLORMAP(c)->dpy, COLORMAP(c)->cm); return Void; } static Object P_Uninstall_Colormap (Object c) { Check_Type (c, T_Colormap); XUninstallColormap (COLORMAP(c)->dpy, COLORMAP(c)->cm); return Void; } static Object P_List_Installed_Colormaps (Object w) { int i, n; Colormap *ret; Object v; GC_Node; Check_Type (w, T_Window); ret = XListInstalledColormaps (WINDOW(w)->dpy, WINDOW(w)->win, &n); v = Make_Vector (n, Null); GC_Link (v); for (i = 0; i < n; i++) { Object c; c = Make_Colormap (0, WINDOW(w)->dpy, ret[i]); VECTOR(v)->data[i] = c; } XFree ((char *)ret); GC_Unlink; return v; } static Object P_Set_Input_Focus (Object d, Object win, Object revert_to, Object time) { Window focus = PointerRoot; Check_Type (d, T_Display); if (!EQ(win, Sym_Pointer_Root)) focus = Get_Window (win); XSetInputFocus (DISPLAY(d)->dpy, focus, Symbols_To_Bits (revert_to, 0, Revert_Syms), Get_Time (time)); return Void; } static Object P_Input_Focus (Object d) { Window win; int revert_to; Object ret, x; GC_Node; Check_Type (d, T_Display); XGetInputFocus (DISPLAY(d)->dpy, &win, &revert_to); ret = Cons (Null, Null); GC_Link (ret); x = Make_Window (0, DISPLAY(d)->dpy, win); Car (ret) = x; x = Bits_To_Symbols ((unsigned long)revert_to, 0, Revert_Syms); Cdr (ret) = x; GC_Unlink; return ret; } static Object P_General_Warp_Pointer (Object dpy, Object dst, Object dstx, Object dsty, Object src, Object srcx, Object srcy, Object srcw, Object srch) { Check_Type (dpy, T_Display); XWarpPointer (DISPLAY(dpy)->dpy, Get_Window (src), Get_Window (dst), Get_Integer (srcx), Get_Integer (srcy), Get_Integer (srcw), Get_Integer (srch), Get_Integer (dstx), Get_Integer (dsty)); return Void; } static Object P_Bell (int argc, Object *argv) { register int percent = 0; Check_Type (argv[0], T_Display); if (argc == 2) { percent = Get_Integer (argv[1]); if (percent < -100 || percent > 100) Range_Error (argv[1]); } XBell (DISPLAY(argv[0])->dpy, percent); return Void; } static Object P_Set_Access_Control (Object dpy, Object on) { Check_Type (dpy, T_Display); Check_Type (on, T_Boolean); XSetAccessControl (DISPLAY(dpy)->dpy, EQ(on, True)); return Void; } static Object P_Change_Save_Set (Object win, Object mode) { Check_Type (win, T_Window); XChangeSaveSet (WINDOW(win)->dpy, WINDOW(win)->win, Symbols_To_Bits (mode, 0, Saveset_Syms)); return Void; } static Object P_Set_Close_Down_Mode (Object dpy, Object mode) { Check_Type (dpy, T_Display); XSetCloseDownMode (DISPLAY(dpy)->dpy, Symbols_To_Bits (mode, 0, Closemode_Syms)); return Void; } static Object P_Get_Pointer_Mapping (Object dpy) { unsigned char map[256]; register int i, n; Object ret; Check_Type (dpy, T_Display); n = XGetPointerMapping (DISPLAY(dpy)->dpy, map, 256); ret = Make_Vector (n, Null); for (i = 0; i < n; i++) VECTOR(ret)->data[i] = Make_Integer (map[i]); return ret; } static Object P_Set_Pointer_Mapping (Object dpy, Object map) { register int i, n; register unsigned char *p; Object ret; Alloca_Begin; Check_Type (dpy, T_Display); Check_Type (map, T_Vector); n = VECTOR(map)->size; Alloca (p, unsigned char*, n); for (i = 0; i < n; i++) p[i] = Get_Integer (VECTOR(map)->data[i]); ret = XSetPointerMapping (DISPLAY(dpy)->dpy, p, n) == MappingSuccess ? True : False; Alloca_End; return ret; } void elk_init_xlib_wm () { Define_Primitive (P_Reparent_Window, "reparent-window", 4, 4, EVAL); Define_Primitive (P_Install_Colormap, "install-colormap", 1, 1, EVAL); Define_Primitive (P_Uninstall_Colormap, "uninstall-colormap", 1, 1, EVAL); Define_Primitive (P_List_Installed_Colormaps, "list-installed-colormaps", 1, 1, EVAL); Define_Primitive (P_Set_Input_Focus, "set-input-focus", 4, 4, EVAL); Define_Primitive (P_Input_Focus, "input-focus", 1, 1, EVAL); Define_Primitive (P_General_Warp_Pointer, "general-warp-pointer", 9, 9, EVAL); Define_Primitive (P_Bell, "bell", 1, 2, VARARGS); Define_Primitive (P_Set_Access_Control, "set-access-control", 2, 2, EVAL); Define_Primitive (P_Change_Save_Set, "change-save-set", 2, 2, EVAL); Define_Primitive (P_Set_Close_Down_Mode, "set-close-down-mode", 2, 2, EVAL); Define_Primitive (P_Get_Pointer_Mapping, "get-pointer-mapping", 1, 1, EVAL); Define_Primitive (P_Set_Pointer_Mapping, "set-pointer-mapping", 2, 2, EVAL); Define_Symbol(&Sym_Pointer_Root, "pointer-root"); } elk-3.99.8/lib/xlib/colormap.c0000644000175000017500000000715511577076306013030 00000000000000/* colormap.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "xlib.h" Generic_Predicate (Colormap) Generic_Equal_Dpy (Colormap, COLORMAP, cm) Generic_Print (Colormap, "#[colormap %lu]", COLORMAP(x)->cm) Generic_Get_Display (Colormap, COLORMAP) Object Make_Colormap (int finalize, Display *dpy, Colormap cmap) { Object cm; if (cmap == None) return Sym_None; cm = Find_Object (T_Colormap, (GENERIC)dpy, Match_X_Obj, cmap); if (Nullp (cm)) { cm = Alloc_Object (sizeof (struct S_Colormap), T_Colormap, 0); COLORMAP(cm)->tag = Null; COLORMAP(cm)->cm = cmap; COLORMAP(cm)->dpy = dpy; COLORMAP(cm)->free = 0; Register_Object (cm, (GENERIC)dpy, finalize ? P_Free_Colormap : (PFO)0, 0); } return cm; } Colormap Get_Colormap (Object c) { Check_Type (c, T_Colormap); return COLORMAP(c)->cm; } Object P_Free_Colormap (Object c) { Check_Type (c, T_Colormap); if (!COLORMAP(c)->free) XFreeColormap (COLORMAP(c)->dpy, COLORMAP(c)->cm); Deregister_Object (c); COLORMAP(c)->free = 1; return Void; } static Object P_Alloc_Color (Object cmap, Object color) { XColor c; Colormap cm = Get_Colormap (cmap); int r; c = *Get_Color (color); Disable_Interrupts; r = XAllocColor (COLORMAP(cmap)->dpy, cm, &c); Enable_Interrupts; if (!r) return False; return Make_Pixel (c.pixel); } static Object P_Alloc_Named_Color (Object cmap, Object name) { Colormap cm = Get_Colormap (cmap); XColor screen, exact; int r; Object ret, t, x; GC_Node2; Disable_Interrupts; r = XAllocNamedColor (COLORMAP(cmap)->dpy, cm, Get_Strsym (name), &screen, &exact); Enable_Interrupts; if (!r) return False; t = ret = P_Make_List (Make_Integer (3), Null); GC_Link2 (t, ret); x = Make_Pixel (screen.pixel); Car (t) = x; t = Cdr (t); x = Make_Color (screen.red, screen.green, screen.blue); Car (t) = x; t = Cdr (t); x = Make_Color (exact.red, exact.green, exact.blue); Car (t) = x; GC_Unlink; return ret; } void elk_init_xlib_colormap () { Generic_Define (Colormap, "colormap", "colormap?"); Define_Primitive (P_Colormap_Display, "colormap-display", 1, 1, EVAL); Define_Primitive (P_Free_Colormap, "free-colormap", 1, 1, EVAL); Define_Primitive (P_Alloc_Color, "alloc-color", 2, 2, EVAL); Define_Primitive (P_Alloc_Named_Color,"alloc-named-color",2, 2, EVAL); } elk-3.99.8/lib/xlib/error.c0000644000175000017500000000742511577076306012345 00000000000000/* error.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "xlib.h" #include static Object V_X_Error_Handler, V_X_Fatal_Error_Handler; /* Default error handlers of the Xlib */ extern int _XDefaultIOError(); extern int _XDefaultError(); static int X_Fatal_Error (Display *d) { Object args, fun; GC_Node; Reset_IO (0); args = Make_Display (0, d); GC_Link (args); args = Cons (args, Null); GC_Unlink; fun = Var_Get (V_X_Fatal_Error_Handler); if (TYPE(fun) == T_Compound) (void)Funcall (fun, args, 0); _XDefaultIOError (d); exit (1); /* In case the default handler doesn't exit() */ /*NOTREACHED*/ return 0; } static int X_Error (Display *d, XErrorEvent *ep) { Object args, a, fun; GC_Node; Reset_IO (0); args = Make_Unsigned_Long ((unsigned long)ep->resourceid); GC_Link (args); args = Cons (args, Null); a = Make_Unsigned (ep->minor_code); args = Cons (a, args); a = Make_Unsigned (ep->request_code); args = Cons (a, args); a = Bits_To_Symbols ((unsigned long)ep->error_code, 0, Error_Syms); if (Nullp (a)) a = Make_Unsigned (ep->error_code); args = Cons (a, args); a = Make_Unsigned_Long (ep->serial); args = Cons (a, args); a = Make_Display (0, ep->display); args = Cons (a, args); GC_Unlink; fun = Var_Get (V_X_Error_Handler); if (TYPE(fun) == T_Compound) (void)Funcall (fun, args, 0); else _XDefaultError (d, ep); return 0; } static int X_After_Function (Display *d) { Object args; GC_Node; args = Make_Display (0, d); GC_Link (args); args = Cons (args, Null); GC_Unlink; (void)Funcall (DISPLAY(Car (args))->after, args, 0); return 0; } static Object P_Set_After_Function (Object d, Object f) { Object old; Check_Type (d, T_Display); if (EQ(f, False)) { (void)XSetAfterFunction (DISPLAY(d)->dpy, (int (*)())0); } else { Check_Procedure (f); (void)XSetAfterFunction (DISPLAY(d)->dpy, X_After_Function); } old = DISPLAY(d)->after; DISPLAY(d)->after = f; return old; } static Object P_After_Function (Object d) { Check_Type (d, T_Display); return DISPLAY(d)->after; } void elk_init_xlib_error () { Define_Variable (&V_X_Fatal_Error_Handler, "x-fatal-error-handler", Null); Define_Variable (&V_X_Error_Handler, "x-error-handler", Null); (void)XSetIOErrorHandler (X_Fatal_Error); (void)XSetErrorHandler (X_Error); Define_Primitive (P_Set_After_Function, "set-after-function!", 2, 2, EVAL); Define_Primitive (P_After_Function, "after-function", 1, 1, EVAL); } elk-3.99.8/lib/xlib/objects.c0000644000175000017500000000460711577076306012644 00000000000000/* objects.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include #include "xlib.h" Object Sym_None; int Match_X_Obj (Object x, va_list v) { register int type = TYPE(x); if (type == T_Display) { return 1; } else if (type == T_Gc) { return va_arg (v, GC) == GCONTEXT(x)->gc; } else if (type == T_Pixel) { return va_arg (v, unsigned long) == PIXEL(x)->pix; } else if (type == T_Pixmap) { return va_arg (v, Pixmap) == PIXMAP(x)->pm; } else if (type == T_Window) { return va_arg (v, Window) == WINDOW(x)->win; } else if (type == T_Font) { return va_arg (v, Font) == FONT(x)->id; } else if (type == T_Colormap) { return va_arg (v, Colormap) == COLORMAP(x)->cm; } else if (type == T_Color) { return va_arg (v, unsigned int) == COLOR(x)->c.red && va_arg (v, unsigned int) == COLOR(x)->c.green && va_arg (v, unsigned int) == COLOR(x)->c.blue; } else if (type == T_Cursor) { return va_arg (v, Cursor) == CURSOR(x)->cursor; } else if (type == T_Atom) { return va_arg (v, Atom) == ATOM(x)->atom; } else Panic ("Match_X_Obj"); return 0; } void elk_init_xlib_objects () { Define_Symbol (&Sym_None, "none"); } elk-3.99.8/lib/xlib/pixmap.c0000644000175000017500000001401011577076306012476 00000000000000/* pixmap.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "xlib.h" Generic_Predicate (Pixmap) Generic_Equal_Dpy (Pixmap, PIXMAP, pm) Generic_Print (Pixmap, "#[pixmap %lu]", PIXMAP(x)->pm) Generic_Get_Display (Pixmap, PIXMAP) static Object Internal_Make_Pixmap (int finalize, Display *dpy, Pixmap pix) { Object pm; if (pix == None) return Sym_None; pm = Find_Object (T_Pixmap, (GENERIC)dpy, Match_X_Obj, pix); if (Nullp (pm)) { pm = Alloc_Object (sizeof (struct S_Pixmap), T_Pixmap, 0); PIXMAP(pm)->tag = Null; PIXMAP(pm)->pm = pix; PIXMAP(pm)->dpy = dpy; PIXMAP(pm)->free = 0; Register_Object (pm, (GENERIC)dpy, finalize ? P_Free_Pixmap : (PFO)0, 0); } return pm; } /* Backwards compatibility: */ Object Make_Pixmap (Display *dpy, Pixmap pix) { return Internal_Make_Pixmap (1, dpy, pix); } Object Make_Pixmap_Foreign (Display *dpy, Pixmap pix) { return Internal_Make_Pixmap (0, dpy, pix); } Pixmap Get_Pixmap (Object p) { Check_Type (p, T_Pixmap); return PIXMAP(p)->pm; } Object P_Free_Pixmap (Object p) { Check_Type (p, T_Pixmap); if (!PIXMAP(p)->free) XFreePixmap (PIXMAP(p)->dpy, PIXMAP(p)->pm); Deregister_Object (p); PIXMAP(p)->free = 1; return Void; } static Object P_Create_Pixmap (Object d, Object w, Object h, Object depth) { Display *dpy; Drawable dr = Get_Drawable (d, &dpy); return Make_Pixmap (dpy, XCreatePixmap (dpy, dr, Get_Integer (w), Get_Integer (h), Get_Integer (depth))); } static Object P_Create_Bitmap_From_Data (Object win, Object data, Object pw, Object ph) { register unsigned int w, h; Check_Type (win, T_Window); Check_Type (data, T_String); w = Get_Integer (pw); h = Get_Integer (ph); if (w * h > 8 * STRING(data)->size) Primitive_Error ("bitmap too small"); return Make_Pixmap (WINDOW(win)->dpy, XCreateBitmapFromData (WINDOW(win)->dpy, WINDOW(win)->win, STRING(data)->data, w, h)); } static Object P_Create_Pixmap_From_Bitmap_Data (Object win, Object data, Object pw, Object ph, Object fg, Object bg, Object depth) { register unsigned int w, h; Check_Type (win, T_Window); Check_Type (data, T_String); w = Get_Integer (pw); h = Get_Integer (ph); if (w * h > 8 * STRING(data)->size) Primitive_Error ("bitmap too small"); return Make_Pixmap (WINDOW(win)->dpy, XCreatePixmapFromBitmapData (WINDOW(win)->dpy, WINDOW(win)->win, STRING(data)->data, w, h, Get_Pixel (fg), Get_Pixel (bg), Get_Integer (depth))); } static Object P_Read_Bitmap_File (Object d, Object fn) { Display *dpy; Drawable dr = Get_Drawable (d, &dpy); unsigned width, height; int r, xhot, yhot; Pixmap bitmap; Object t, ret, x; GC_Node2; Disable_Interrupts; r = XReadBitmapFile (dpy, dr, Get_Strsym (fn), &width, &height, &bitmap, &xhot, &yhot); Enable_Interrupts; if (r != BitmapSuccess) return Bits_To_Symbols ((unsigned long)r, 0, Bitmapstatus_Syms); t = ret = P_Make_List (Make_Integer (5), Null); GC_Link2 (ret, t); x = Make_Pixmap (dpy, bitmap); Car (t) = x; t = Cdr (t); Car (t) = Make_Integer (width); t = Cdr (t); Car (t) = Make_Integer (height); t = Cdr (t); Car (t) = Make_Integer (xhot); t = Cdr (t); Car (t) = Make_Integer (yhot); GC_Unlink; return ret; } static Object P_Write_Bitmap_File (int argc, Object *argv) { Pixmap pm; int ret, xhot = -1, yhot = -1; pm = Get_Pixmap (argv[1]); if (argc == 5) Primitive_Error ("both x-hot and y-hot must be specified"); if (argc == 6) { xhot = Get_Integer (argv[4]); yhot = Get_Integer (argv[5]); } Disable_Interrupts; ret = XWriteBitmapFile (PIXMAP(argv[1])->dpy, Get_Strsym (argv[0]), pm, Get_Integer (argv[2]), Get_Integer (argv[3]), xhot, yhot); Enable_Interrupts; return Bits_To_Symbols ((unsigned long)ret, 0, Bitmapstatus_Syms); } void elk_init_xlib_pixmap () { Generic_Define (Pixmap, "pixmap", "pixmap?"); Define_Primitive (P_Pixmap_Display, "pixmap-display", 1, 1, EVAL); Define_Primitive (P_Free_Pixmap, "free-pixmap", 1, 1, EVAL); Define_Primitive (P_Create_Pixmap, "create-pixmap", 4, 4, EVAL); Define_Primitive (P_Create_Bitmap_From_Data, "create-bitmap-from-data", 4, 4, EVAL); Define_Primitive (P_Create_Pixmap_From_Bitmap_Data, "create-pixmap-from-bitmap-data", 7, 7, EVAL); Define_Primitive (P_Read_Bitmap_File, "read-bitmap-file", 2, 2, EVAL); Define_Primitive (P_Write_Bitmap_File, "write-bitmap-file", 4, 6, VARARGS); } elk-3.99.8/lib/xlib/font.c0000644000175000017500000002323111577076306012153 00000000000000/* font.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "xlib.h" #include Object Sym_Char_Info; static Object Sym_Font_Info, Sym_Min, Sym_Max; Generic_Predicate (Font) static int Font_Equal (Object x, Object y) { Font id1 = FONT(x)->id, id2 = FONT(y)->id; if (id1 && id2) return id1 == id2 && FONT(x)->dpy == FONT(y)->dpy; else return 0; } Generic_Print (Font, "#[font %lu]", FONT(x)->id ? FONT(x)->id : (unsigned int)FIXNUM(x)) static int Font_Visit (Object *fp, int (*f)()) { (*f)(&FONT(*fp)->name); return 0; } Generic_Get_Display (Font, FONT) static Object Internal_Make_Font (int finalize, Display *dpy, Object name, Font id, XFontStruct *info) { Object f; GC_Node; GC_Link (name); f = Alloc_Object (sizeof (struct S_Font), T_Font, 0); FONT(f)->dpy = dpy; if (TYPE(name) == T_Symbol) name = SYMBOL(name)->name; FONT(f)->name = name; FONT(f)->id = id; FONT(f)->info = info; if (id) Register_Object (f, (GENERIC)dpy, finalize ? P_Close_Font : (PFO)0, 0); GC_Unlink; return f; } /* Backwards compatibility: */ Object Make_Font (Display *dpy, Object name, Font id, XFontStruct *info) { return Internal_Make_Font (1, dpy, name, id, info); } Object Make_Font_Foreign (Display *dpy, Object name, Font id, XFontStruct *info) { return Internal_Make_Font (0, dpy, name, id, info); } Font Get_Font (Object f) { Check_Type (f, T_Font); Open_Font_Maybe (f); return FONT(f)->id; } static XFontStruct *Internal_Open_Font (Display *d, Object name) { register char *s; XFontStruct *p; Alloca_Begin; Get_Strsym_Stack (name, s); Disable_Interrupts; if ((p = XLoadQueryFont (d, s)) == 0) Primitive_Error ("cannot open font: ~s", name); Enable_Interrupts; Alloca_End; return p; } static Object P_Open_Font (Object d, Object name) { XFontStruct *p; Check_Type (d, T_Display) p = Internal_Open_Font (DISPLAY(d)->dpy, name); return Make_Font (DISPLAY(d)->dpy, name, p->fid, p); } void Open_Font_Maybe (Object f) { Object name; XFontStruct *p; name = FONT(f)->name; if (!Truep (name)) Primitive_Error ("invalid font"); if (FONT(f)->id == 0) { p = Internal_Open_Font (FONT(f)->dpy, name); FONT(f)->id = p->fid; FONT(f)->info = p; Register_Object (f, (GENERIC)(FONT(f)->dpy), P_Close_Font, 0); } } Object P_Close_Font (Object f) { Check_Type (f, T_Font); if (FONT(f)->id) XUnloadFont (FONT(f)->dpy, FONT(f)->id); FONT(f)->id = 0; Deregister_Object (f); return Void; } static Object P_Font_Name (Object f) { Check_Type (f, T_Font); return FONT(f)->name; } static Object P_Gcontext_Font (Object g) { register struct S_Gc *p; register XFontStruct *info; Check_Type (g, T_Gc); p = GCONTEXT(g); Disable_Interrupts; info = XQueryFont (p->dpy, XGContextFromGC (p->gc)); Enable_Interrupts; return Make_Font_Foreign (p->dpy, False, (Font)0, info); } static Object Internal_List_Fonts (Object d, Object pat, int with_info) { char **ret; int n; XFontStruct *iret; register int i; Object f, v; Display *dpy; GC_Node2; Check_Type (d, T_Display); dpy = DISPLAY(d)->dpy; Disable_Interrupts; if (with_info) ret = XListFontsWithInfo (dpy, Get_Strsym (pat), 65535, &n, &iret); else ret = XListFonts (dpy, Get_Strsym (pat), 65535, &n); Enable_Interrupts; v = Make_Vector (n, Null); f = Null; GC_Link2 (f, v); for (i = 0; i < n; i++) { f = Make_String (ret[i], strlen (ret[i])); if (with_info) f = Make_Font (dpy, f, (Font)0, &iret[i]); VECTOR(v)->data[i] = f; } GC_Unlink; if (with_info) XFreeFontInfo (ret, (XFontStruct *)0, 0); else XFreeFontNames (ret); return v; } static Object P_List_Font_Names (Object d, Object pat) { return Internal_List_Fonts (d, pat, 0); } static Object P_List_Fonts (Object d, Object pat) { return Internal_List_Fonts (d, pat, 1); } static Object P_Font_Info (Object f) { Check_Type (f, T_Font); FI = *FONT(f)->info; return Record_To_Vector (Font_Info_Rec, Font_Info_Size, Sym_Font_Info, FONT(f)->dpy, ~0L); } static Object P_Char_Info (Object f, Object index) { register int t = TYPE(index); register unsigned int i; register XCharStruct *cp; register XFontStruct *p; char *msg = "argument must be integer, character, 'min, or 'max"; Check_Type (f, T_Font); Open_Font_Maybe (f); p = FONT(f)->info; cp = &p->max_bounds; if (t == T_Symbol) { if (EQ(index, Sym_Min)) cp = &p->min_bounds; else if (!EQ(index, Sym_Max)) Primitive_Error (msg); } else { if (t == T_Character) i = CHAR(index); else if (t == T_Fixnum || t == T_Bignum) i = (unsigned)Get_Integer (index); else Primitive_Error (msg); if (!p->min_byte1 && !p->max_byte1) { if (i < p->min_char_or_byte2 || i > p->max_char_or_byte2) Range_Error (index); i -= p->min_char_or_byte2; } else { register unsigned int b1 = i & 0xff, b2 = (i >> 8) & 0xff; if (b1 < p->min_byte1 || b1 > p->max_byte1 || b2 < p->min_char_or_byte2 || b2 > p->max_char_or_byte2) Range_Error (index); b1 -= p->min_byte1; b2 -= p->min_char_or_byte2; i = b1 * (p->max_char_or_byte2 - p->min_char_or_byte2 + 1) + b2; } if (p->per_char) cp = p->per_char + i; } CI = *cp; return Record_To_Vector (Char_Info_Rec, Char_Info_Size, Sym_Char_Info, FONT(f)->dpy, ~0L); } static Object P_Font_Properties (Object f) { register int i, n; Object v, a, val, x; GC_Node4; Check_Type (f, T_Font); n = FONT(f)->info->n_properties; v = Make_Vector (n, Null); a = val = Null; GC_Link4 (v, a, val, f); for (i = 0; i < n; i++) { register XFontProp *p = FONT(f)->info->properties+i; a = Make_Atom (p->name); val = Make_Unsigned_Long ((unsigned long)p->card32); x = Cons (a, val); VECTOR(v)->data[i] = x; } GC_Unlink; return v; } static Object P_Font_Path (Object d) { Object v; int i, n; char **ret; GC_Node; Check_Type (d, T_Display); Disable_Interrupts; ret = XGetFontPath (DISPLAY(d)->dpy, &n); Enable_Interrupts; v = Make_Vector (n, Null); GC_Link (v); for (i = 0; i < n; i++) { Object x; x = Make_String (ret[i], strlen (ret[i])); VECTOR(v)->data[i] = x; } GC_Unlink; XFreeFontPath (ret); return P_Vector_To_List (v); } static Object P_Set_Font_Path (Object d, Object p) { register char **path; register int i, n; Object c; Alloca_Begin; Check_Type (d, T_Display); Check_List (p); n = Fast_Length (p); Alloca (path, char**, n * sizeof (char *)); for (i = 0; i < n; i++, p = Cdr (p)) { c = Car (p); Get_Strsym_Stack (c, path[i]); } XSetFontPath (DISPLAY(d)->dpy, path, n); Alloca_End; return Void; } void elk_init_xlib_font () { Define_Symbol (&Sym_Font_Info, "font-info"); Define_Symbol (&Sym_Char_Info, "char-info"); Define_Symbol (&Sym_Min, "min"); Define_Symbol (&Sym_Max, "max"); T_Font = Define_Type (0, "font", NOFUNC, sizeof (struct S_Font), Font_Equal, Font_Equal, Font_Print, Font_Visit); Define_Primitive (P_Fontp, "font?", 1, 1, EVAL); Define_Primitive (P_Font_Display, "font-display", 1, 1, EVAL); Define_Primitive (P_Open_Font, "open-font", 2, 2, EVAL); Define_Primitive (P_Close_Font, "close-font", 1, 1, EVAL); Define_Primitive (P_Font_Name, "font-name", 1, 1, EVAL); Define_Primitive (P_Gcontext_Font, "gcontext-font", 1, 1, EVAL); Define_Primitive (P_List_Font_Names, "list-font-names", 2, 2, EVAL); Define_Primitive (P_List_Fonts, "list-fonts", 2, 2, EVAL); Define_Primitive (P_Font_Info, "xlib-font-info", 1, 1, EVAL); Define_Primitive (P_Char_Info, "xlib-char-info", 2, 2, EVAL); Define_Primitive (P_Font_Properties, "font-properties", 1, 1, EVAL); Define_Primitive (P_Font_Path, "font-path", 1, 1, EVAL); Define_Primitive (P_Set_Font_Path, "set-font-path!", 2, 2, EVAL); } elk-3.99.8/lib/xlib/window.c0000644000175000017500000002320211577076306012512 00000000000000/* window.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "xlib.h" static Object Sym_Set_Attr, Sym_Get_Attr, Sym_Geo; Object Sym_Conf; Generic_Predicate (Window) Generic_Equal_Dpy (Window, WINDOW, win) Generic_Print (Window, "#[window %lu]", WINDOW(x)->win) Generic_Get_Display (Window, WINDOW) Object Make_Window (int finalize, Display *dpy, Window win) { Object w; if (win == None) return Sym_None; if (win == PointerRoot) return Intern ("pointer-root"); w = Find_Object (T_Window, (GENERIC)dpy, Match_X_Obj, win); if (Nullp (w)) { w = Alloc_Object (sizeof (struct S_Window), T_Window, 0); WINDOW(w)->tag = Null; WINDOW(w)->win = win; WINDOW(w)->dpy = dpy; WINDOW(w)->free = 0; WINDOW(w)->finalize = finalize; Register_Object (w, (GENERIC)dpy, finalize ? P_Destroy_Window : (PFO)0, 0); } return w; } Window Get_Window (Object w) { if (EQ(w, Sym_None)) return None; Check_Type (w, T_Window); return WINDOW(w)->win; } Drawable Get_Drawable (Object d, Display **dpyp) { if (TYPE(d) == T_Window) { *dpyp = WINDOW(d)->dpy; return (Drawable)WINDOW(d)->win; } else if (TYPE(d) == T_Pixmap) { *dpyp = PIXMAP(d)->dpy; return (Drawable)PIXMAP(d)->pm; } Wrong_Type_Combination (d, "drawable"); /*NOTREACHED*/ } static Object P_Create_Window (Object parent, Object x, Object y, Object width, Object height, Object border_width, Object attr) { unsigned long mask; Window win; Check_Type (parent, T_Window); mask = Vector_To_Record (attr, Set_Attr_Size, Sym_Set_Attr, Set_Attr_Rec); if ((win = XCreateWindow (WINDOW(parent)->dpy, WINDOW(parent)->win, Get_Integer (x), Get_Integer (y), Get_Integer (width), Get_Integer (height), Get_Integer (border_width), CopyFromParent, CopyFromParent, CopyFromParent, mask, &SWA)) == 0) Primitive_Error ("cannot create window"); return Make_Window (1, WINDOW(parent)->dpy, win); } static Object P_Configure_Window (Object w, Object conf) { unsigned long mask; Check_Type (w, T_Window); mask = Vector_To_Record (conf, Conf_Size, Sym_Conf, Conf_Rec); XConfigureWindow (WINDOW(w)->dpy, WINDOW(w)->win, mask, &WC); return Void; } static Object P_Change_Window_Attributes (Object w, Object attr) { unsigned long mask; Check_Type (w, T_Window); mask = Vector_To_Record (attr, Set_Attr_Size, Sym_Set_Attr, Set_Attr_Rec); XChangeWindowAttributes (WINDOW(w)->dpy, WINDOW(w)->win, mask, &SWA); return Void; } static Object P_Get_Window_Attributes (Object w) { Check_Type (w, T_Window); XGetWindowAttributes (WINDOW(w)->dpy, WINDOW(w)->win, &WA); return Record_To_Vector (Win_Attr_Rec, Win_Attr_Size, Sym_Get_Attr, WINDOW(w)->dpy, ~0L); } static Object P_Get_Geometry (Object d) { Display *dpy; Drawable dr = Get_Drawable (d, &dpy); /* GEO.width, GEO.height, etc. should really be unsigned, not int. */ XGetGeometry (dpy, dr, &GEO.root, &GEO.x, &GEO.y, (unsigned *)&GEO.width, (unsigned *)&GEO.height, (unsigned *)&GEO.border_width, (unsigned *)&GEO.depth); return Record_To_Vector (Geometry_Rec, Geometry_Size, Sym_Geo, dpy, ~0L); } static Object P_Map_Window (Object w) { Check_Type (w, T_Window); XMapWindow (WINDOW(w)->dpy, WINDOW(w)->win); return Void; } static Object P_Unmap_Window (Object w) { Check_Type (w, T_Window); XUnmapWindow (WINDOW(w)->dpy, WINDOW(w)->win); return Void; } Object P_Destroy_Window (Object w) { Check_Type (w, T_Window); if (!WINDOW(w)->free) XDestroyWindow (WINDOW(w)->dpy, WINDOW(w)->win); Deregister_Object (w); WINDOW(w)->free = 1; return Void; } static Object P_Destroy_Subwindows (Object w) { Check_Type (w, T_Window); XDestroySubwindows (WINDOW(w)->dpy, WINDOW(w)->win); return Void; } static Object P_Map_Subwindows (Object w) { Check_Type (w, T_Window); XMapSubwindows (WINDOW(w)->dpy, WINDOW(w)->win); return Void; } static Object P_Unmap_Subwindows (Object w) { Check_Type (w, T_Window); XUnmapSubwindows (WINDOW(w)->dpy, WINDOW(w)->win); return Void; } static Object P_Circulate_Subwindows (Object w, Object dir) { Check_Type (w, T_Window); XCirculateSubwindows (WINDOW(w)->dpy, WINDOW(w)->win, Symbols_To_Bits (dir, 0, Circulate_Syms)); return Void; } static Object P_Query_Tree (Object w) { Window root, parent, *children; Display *dpy; unsigned int i, n; Object v, ret; GC_Node2; Check_Type (w, T_Window); dpy = WINDOW(w)->dpy; Disable_Interrupts; XQueryTree (dpy, WINDOW(w)->win, &root, &parent, &children, &n); Enable_Interrupts; v = ret = Null; GC_Link2 (v, ret); v = Make_Window (0, dpy, root); ret = Cons (v, Null); v = Make_Window (0, dpy, parent); ret = Cons (v, ret); v = Make_Vector (n, Null); for (i = 0; i < n; i++) { Object x; x = Make_Window (0, dpy, children[i]); VECTOR(v)->data[i] = x; } ret = Cons (v, ret); GC_Unlink; return ret; } static Object P_Translate_Coordinates (Object src, Object x, Object y, Object dst) { int rx, ry; Window child; Object l, t, z; GC_Node3; Check_Type (src, T_Window); Check_Type (dst, T_Window); if (!XTranslateCoordinates (WINDOW(src)->dpy, WINDOW(src)->win, WINDOW(dst)->win, Get_Integer (x), Get_Integer (y), &rx, &ry, &child)) return False; l = t = P_Make_List (Make_Integer (3), Null); GC_Link3 (l, t, dst); Car (t) = Make_Integer (rx); t = Cdr (t); Car (t) = Make_Integer (ry), t = Cdr (t); z = Make_Window (0, WINDOW(dst)->dpy, child); Car (t) = z; GC_Unlink; return l; } static Object P_Query_Pointer (Object win) { Object l, t, z; Bool ret; Window root, child; int r_x, r_y, x, y; unsigned int mask; GC_Node3; Check_Type (win, T_Window); ret = XQueryPointer (WINDOW(win)->dpy, WINDOW(win)->win, &root, &child, &r_x, &r_y, &x, &y, &mask); t = l = P_Make_List (Make_Integer (8), Null); GC_Link3 (l, t, win); Car (t) = Make_Integer (x); t = Cdr (t); Car (t) = Make_Integer (y); t = Cdr (t); Car (t) = ret ? True : False; t = Cdr (t); z = Make_Window (0, WINDOW(win)->dpy, root); Car (t) = z; t = Cdr (t); Car (t) = Make_Integer (r_x); t = Cdr (t); Car (t) = Make_Integer (r_y); t = Cdr (t); z = Make_Window (0, WINDOW(win)->dpy, child); Car (t) = z; t = Cdr (t); z = Bits_To_Symbols ((unsigned long)mask, 1, State_Syms); Car (t) = z; GC_Unlink; return l; } void elk_init_xlib_window () { Define_Symbol (&Sym_Set_Attr, "set-window-attributes"); Define_Symbol (&Sym_Get_Attr, "get-window-attributes"); Define_Symbol (&Sym_Conf, "window-configuration"); Define_Symbol (&Sym_Geo, "geometry"); Generic_Define (Window, "window", "window?"); Define_Primitive (P_Window_Display, "window-display", 1, 1, EVAL); Define_Primitive (P_Create_Window, "xlib-create-window", 7, 7, EVAL); Define_Primitive (P_Configure_Window, "xlib-configure-window", 2, 2, EVAL); Define_Primitive (P_Change_Window_Attributes, "xlib-change-window-attributes", 2, 2, EVAL); Define_Primitive (P_Get_Window_Attributes, "xlib-get-window-attributes", 1, 1, EVAL); Define_Primitive (P_Get_Geometry, "xlib-get-geometry",1, 1, EVAL); Define_Primitive (P_Map_Window, "map-window", 1, 1, EVAL); Define_Primitive (P_Unmap_Window, "unmap-window", 1, 1, EVAL); Define_Primitive (P_Circulate_Subwindows, "circulate-subwindows", 2, 2, EVAL); Define_Primitive (P_Destroy_Window, "destroy-window", 1, 1, EVAL); Define_Primitive (P_Destroy_Subwindows, "destroy-subwindows", 1, 1, EVAL); Define_Primitive (P_Map_Subwindows, "map-subwindows", 1, 1, EVAL); Define_Primitive (P_Unmap_Subwindows, "unmap-subwindows", 1, 1, EVAL); Define_Primitive (P_Query_Tree, "query-tree", 1, 1, EVAL); Define_Primitive (P_Translate_Coordinates, "translate-coordinates", 4, 4, EVAL); Define_Primitive (P_Query_Pointer, "query-pointer", 1, 1, EVAL); } elk-3.99.8/lib/xlib/client.c0000644000175000017500000003144511577076306012471 00000000000000/* client.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "xlib.h" #include static Object Sym_Wm_Hints, Sym_Size_Hints; static Object P_Iconify_Window (Object w, Object scr) { Check_Type (w, T_Window); if (!XIconifyWindow (WINDOW(w)->dpy, WINDOW(w)->win, Get_Screen_Number (WINDOW(w)->dpy, scr))) Primitive_Error ("cannot iconify window"); return Void; } static Object P_Withdraw_Window (Object w, Object scr) { Check_Type (w, T_Window); if (!XWithdrawWindow (WINDOW(w)->dpy, WINDOW(w)->win, Get_Screen_Number (WINDOW(w)->dpy, scr))) Primitive_Error ("cannot withdraw window"); return Void; } static Object P_Reconfigure_Wm_Window (Object w, Object scr, Object conf) { unsigned long mask; Check_Type (w, T_Window); mask = Vector_To_Record (conf, Conf_Size, Sym_Conf, Conf_Rec); if (!XReconfigureWMWindow (WINDOW(w)->dpy, WINDOW(w)->win, Get_Screen_Number (WINDOW(w)->dpy, scr), mask, &WC)) Primitive_Error ("cannot reconfigure window"); return Void; } static Object P_Wm_Command (Object w) { int i, ac; char **av; Object s, ret, t; GC_Node2; Check_Type (w, T_Window); Disable_Interrupts; if (!XGetCommand (WINDOW(w)->dpy, WINDOW(w)->win, &av, &ac)) ac = 0; Enable_Interrupts; ret = t = P_Make_List (Make_Integer (ac), Null); GC_Link2 (ret, t); for (i = 0; i < ac; i++, t = Cdr (t)) { s = Make_String (av[i], strlen (av[i])); Car (t) = s; } GC_Unlink; if (ac) XFreeStringList (av); return ret; } static void String_List_To_Text_Property (Object x, XTextProperty *ret) { register int i, n; register char **s; Object t; Alloca_Begin; Check_List (x); n = Fast_Length (x); Alloca (s, char**, n * sizeof (char *)); for (i = 0; i < n; i++, x = Cdr (x)) { t = Car (x); Get_Strsym_Stack (t, s[i]); } if (!XStringListToTextProperty (s, n, ret)) Primitive_Error ("cannot create text property"); Alloca_End; } static Object Text_Property_To_String_List (XTextProperty *p) { int n; register int i; char **s; Object x, ret, t; GC_Node2; if (!XTextPropertyToStringList (p, &s, &n)) Primitive_Error ("cannot convert from text property"); ret = t = P_Make_List (Make_Integer (n), Null); GC_Link2 (ret, t); for (i = 0; i < n; i++, t = Cdr (t)) { x = Make_String (s[i], strlen (s[i])); Car (t) = x; } GC_Unlink; XFreeStringList (s); return ret; } static Object P_Get_Text_Property (Object w, Object a) { XTextProperty ret; Check_Type (w, T_Window); Check_Type (a, T_Atom); Disable_Interrupts; if (!XGetTextProperty (WINDOW(w)->dpy, WINDOW(w)->win, &ret, ATOM(a)->atom)) { Enable_Interrupts; return False; } Enable_Interrupts; return Text_Property_To_String_List (&ret); } static Object P_Set_Text_Property (Object w, Object prop, Object a) { XTextProperty p; Check_Type (w, T_Window); Check_Type (a, T_Atom); String_List_To_Text_Property (prop, &p); XSetTextProperty (WINDOW(w)->dpy, WINDOW(w)->win, &p, ATOM(a)->atom); XFree ((char *)p.value); return Void; } static Object P_Wm_Protocols (Object w) { Atom *p; int i, n; Object ret; GC_Node; Check_Type (w, T_Window); Disable_Interrupts; if (!XGetWMProtocols (WINDOW(w)->dpy, WINDOW(w)->win, &p, &n)) Primitive_Error ("cannot get WM protocols"); Enable_Interrupts; ret = Make_Vector (n, Null); GC_Link (ret); for (i = 0; i < n; i++) { Object a; a = Make_Atom (p[i]); VECTOR(ret)->data[i] = a; } XFree ((char *)p); GC_Unlink; return ret; } static Object P_Set_Wm_Protocols (Object w, Object v) { Atom *p; int i, n; Alloca_Begin; Check_Type (w, T_Window); Check_Type (v, T_Vector); n = VECTOR(v)->size; Alloca (p, Atom*, n * sizeof (Atom)); for (i = 0; i < n; i++) { Object a; a = VECTOR(v)->data[i]; Check_Type (a, T_Atom); p[i] = ATOM(a)->atom; } if (!XSetWMProtocols (WINDOW(w)->dpy, WINDOW(w)->win, p, n)) Primitive_Error ("cannot set WM protocols"); Alloca_End; return Void; } static Object P_Wm_Class (Object w) { Object ret, x; XClassHint c; GC_Node; Check_Type (w, T_Window); /* * In X11.2 XGetClassHint() returns either 0 or Success, which happens * to be defined as 0. So until this bug is fixed, we must * explicitly check whether the XClassHint structure has been filled. */ c.res_name = c.res_class = 0; Disable_Interrupts; (void)XGetClassHint (WINDOW(w)->dpy, WINDOW(w)->win, &c); Enable_Interrupts; ret = Cons (False, False); GC_Link (ret); if (c.res_name) { x = Make_String (c.res_name, strlen (c.res_name)); Car (ret) = x; XFree (c.res_name); } if (c.res_class) { x = Make_String (c.res_class, strlen (c.res_class)); Cdr (ret) = x; XFree (c.res_class); } GC_Unlink; return ret; } static Object P_Set_Wm_Class (Object w, Object name, Object class) { XClassHint c; Check_Type (w, T_Window); c.res_name = Get_Strsym (name); c.res_class = Get_Strsym (class); XSetClassHint (WINDOW(w)->dpy, WINDOW(w)->win, &c); return Void; } static Object P_Set_Wm_Command (Object w, Object cmd) { register int i, n; register char **argv; Object c; Alloca_Begin; Check_Type (w, T_Window); Check_List (cmd); n = Fast_Length (cmd); Alloca (argv, char**, n * sizeof (char *)); for (i = 0; i < n; i++, cmd = Cdr (cmd)) { c = Car (cmd); Get_Strsym_Stack (c, argv[i]); } XSetCommand (WINDOW(w)->dpy, WINDOW(w)->win, argv, n); Alloca_End; return Void; } static Object P_Wm_Hints (Object w) { XWMHints *p; Check_Type (w, T_Window); Disable_Interrupts; p = XGetWMHints (WINDOW(w)->dpy, WINDOW(w)->win); Enable_Interrupts; if (p) { WMH = *p; XFree ((char *)p); } else { WMH.flags = 0; } return Record_To_Vector (Wm_Hints_Rec, Wm_Hints_Size, Sym_Wm_Hints, WINDOW(w)->dpy, (unsigned long)WMH.flags); } static Object P_Set_Wm_Hints (Object w, Object h) { unsigned long mask; Check_Type (w, T_Window); mask = Vector_To_Record (h, Wm_Hints_Size, Sym_Wm_Hints, Wm_Hints_Rec); WMH.flags = mask; XSetWMHints (WINDOW(w)->dpy, WINDOW(w)->win, &WMH); return Void; } static Object P_Size_Hints (Object w, Object a) { long supplied; Check_Type (w, T_Window); Check_Type (a, T_Atom); Disable_Interrupts; if (!XGetWMSizeHints (WINDOW(w)->dpy, WINDOW(w)->win, &SZH, &supplied, ATOM(a)->atom)) SZH.flags = 0; if (!(supplied & PBaseSize)) SZH.flags &= ~PBaseSize; if (!(supplied & PWinGravity)) SZH.flags &= ~PWinGravity; Enable_Interrupts; if ((SZH.flags & (PPosition|USPosition)) == (PPosition|USPosition)) SZH.flags &= ~PPosition; if ((SZH.flags & (PSize|USSize)) == (PSize|USSize)) SZH.flags &= ~PSize; return Record_To_Vector (Size_Hints_Rec, Size_Hints_Size, Sym_Size_Hints, WINDOW(w)->dpy, (unsigned long)SZH.flags); } static Object P_Set_Size_Hints (Object w, Object a, Object h) { unsigned long mask; Check_Type (w, T_Window); Check_Type (a, T_Atom); memset ((char *)&SZH, 0, sizeof (SZH)); /* Not portable? */ mask = Vector_To_Record (h, Size_Hints_Size, Sym_Size_Hints, Size_Hints_Rec); if ((mask & (PPosition|USPosition)) == (PPosition|USPosition)) mask &= ~PPosition; if ((mask & (PSize|USSize)) == (PSize|USSize)) mask &= ~PSize; SZH.flags = mask; XSetWMSizeHints (WINDOW(w)->dpy, WINDOW(w)->win, &SZH, ATOM(a)->atom); return Void; } static Object P_Icon_Sizes (Object w) { XIconSize *p; int i, n; Object v; GC_Node; Check_Type (w, T_Window); Disable_Interrupts; if (!XGetIconSizes (WINDOW(w)->dpy, WINDOW(w)->win, &p, &n)) n = 0; Enable_Interrupts; v = Make_Vector (n, Null); GC_Link (v); for (i = 0; i < n; i++) { register XIconSize *q = &p[i]; Object t; t = P_Make_List (Make_Integer (6), Null); VECTOR(v)->data[i] = t; Car (t) = Make_Integer (q->min_width); t = Cdr (t); Car (t) = Make_Integer (q->min_height); t = Cdr (t); Car (t) = Make_Integer (q->max_width); t = Cdr (t); Car (t) = Make_Integer (q->max_height); t = Cdr (t); Car (t) = Make_Integer (q->width_inc); t = Cdr (t); Car (t) = Make_Integer (q->height_inc); } GC_Unlink; if (n > 0) XFree ((char *)p); return v; } static Object P_Set_Icon_Sizes (Object w, Object v) { register int i, n; XIconSize *p; Alloca_Begin; Check_Type (w, T_Window); Check_Type (v, T_Vector); n = VECTOR(v)->size; Alloca (p, XIconSize*, n * sizeof (XIconSize)); for (i = 0; i < n; i++) { register XIconSize *q = &p[i]; Object t; t = VECTOR(v)->data[i]; Check_List (t); if (Fast_Length (t) != 6) Primitive_Error ("invalid argument: ~s", t); q->min_width = Get_Integer (Car (t)); t = Cdr (t); q->min_height = Get_Integer (Car (t)); t = Cdr (t); q->max_width = Get_Integer (Car (t)); t = Cdr (t); q->max_height = Get_Integer (Car (t)); t = Cdr (t); q->width_inc = Get_Integer (Car (t)); t = Cdr (t); q->height_inc = Get_Integer (Car (t)); } XSetIconSizes (WINDOW(w)->dpy, WINDOW(w)->win, p, n); Alloca_End; return Void; } static Object P_Transient_For (Object w) { Window win; Disable_Interrupts; if (!XGetTransientForHint (WINDOW(w)->dpy, WINDOW(w)->win, &win)) win = None; Enable_Interrupts; return Make_Window (0, WINDOW(w)->dpy, win); } static Object P_Set_Transient_For (Object w, Object pw) { Check_Type (w, T_Window); XSetTransientForHint (WINDOW(w)->dpy, WINDOW(w)->win, Get_Window (pw)); return Void; } void elk_init_xlib_client () { Define_Symbol (&Sym_Wm_Hints, "wm-hints"); Define_Symbol (&Sym_Size_Hints, "size-hints"); Define_Primitive (P_Iconify_Window, "iconify-window", 2, 2, EVAL); Define_Primitive (P_Withdraw_Window, "withdraw-window", 2, 2, EVAL); Define_Primitive (P_Reconfigure_Wm_Window, "xlib-reconfigure-wm-window", 3, 3, EVAL); Define_Primitive (P_Wm_Command, "wm-command", 1, 1, EVAL); Define_Primitive (P_Get_Text_Property,"get-text-property", 2, 2, EVAL); Define_Primitive (P_Set_Text_Property,"set-text-property!",3, 3, EVAL); Define_Primitive (P_Wm_Protocols, "wm-protocols", 1, 1, EVAL); Define_Primitive (P_Set_Wm_Protocols, "set-wm-protocols!", 2, 2, EVAL); Define_Primitive (P_Wm_Class, "wm-class", 1, 1, EVAL); Define_Primitive (P_Set_Wm_Class, "set-wm-class!", 3, 3, EVAL); Define_Primitive (P_Set_Wm_Command, "set-wm-command!", 2, 2, EVAL); Define_Primitive (P_Wm_Hints, "xlib-wm-hints", 1, 1, EVAL); Define_Primitive (P_Set_Wm_Hints, "xlib-set-wm-hints!",2, 2, EVAL); Define_Primitive (P_Size_Hints, "xlib-wm-size-hints",2, 2, EVAL); Define_Primitive (P_Set_Size_Hints, "xlib-set-wm-size-hints!", 3, 3, EVAL); Define_Primitive (P_Icon_Sizes, "icon-sizes", 1, 1, EVAL); Define_Primitive (P_Set_Icon_Sizes, "set-icon-sizes!", 2, 2, EVAL); Define_Primitive (P_Transient_For, "transient-for", 1, 1, EVAL); Define_Primitive (P_Set_Transient_For,"set-transient-for!",2, 2, EVAL); } elk-3.99.8/lib/xlib/event.c0000644000175000017500000004566511577076306012345 00000000000000/* event.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "xlib.h" #include #define MAX_ARGS 14 static Object Argl, Argv; static struct event_desc { char *name; int argc; } Event_Table[] = { { "event-0", 1 }, { "event-1", 1 }, { "key-press", 12 }, { "key-release", 12 }, { "button-press", 12 }, { "button-release", 12 }, { "motion-notify", 12 }, { "enter-notify", 14 }, { "leave-notify", 14 }, { "focus-in", 4 }, { "focus-out", 4 }, { "keymap-notify", 3 }, { "expose", 7 }, { "graphics-expose", 9 }, { "no-expose", 4 }, { "visibility-notify", 3 }, { "create-notify", 9 }, { "destroy-notify", 3 }, { "unmap-notify", 4 }, { "map-notify", 4 }, { "map-request", 3 }, { "reparent-notify", 7 }, { "configure-notify", 10 }, { "configure-request", 11 }, { "gravity-notify", 5 }, { "resize-request", 4 }, { "circulate-notify", 4 }, { "circulate-request", 4 }, { "property-notify", 5 }, { "selection-clear", 4 }, { "selection-request", 7 }, { "selection-notify", 6 }, { "colormap-notify", 5 }, { "client-message", 4 }, { "mapping-notify", 4 }, { 0, 0 } }; struct predicate_arg { Object *funcs; Object *ret; }; /*ARGSUSED*/ static int Event_Predicate (Display *dpy, XEvent *ep, #ifdef XLIB_RELEASE_5_OR_LATER XPointer ptr) { #else char *ptr) { #endif struct predicate_arg *ap = (struct predicate_arg *)ptr; register int i; Object args; GC_Node; if ((i = ep->type) < LASTEvent && !Nullp (ap->funcs[i])) { args = Get_Event_Args (ep); GC_Link (args); *ap->ret = Funcall (ap->funcs[i], args, 0); Destroy_Event_Args (args); GC_Unlink; } return Truep (*ap->ret); } /* (handle-events display discard? peek? clause...) * clause = (event function) or ((event...) function) or (else function) * loops/blocks until a function returns x != #f, then returns x. * discard?: discard unprocessed events. * peek?: don't discard processed events. */ static Object P_Handle_Events (Object argl) { Object next, clause, func, ret, funcs[LASTEvent], args; register int i, discard, peek; Display *dpy; char *errmsg = "event occurs more than once"; GC_Node3; struct gcnode gcv; TC_Prolog; TC_Disable; clause = args = Null; GC_Link3 (argl, clause, args); next = Eval (Car (argl)); Check_Type (next, T_Display); dpy = DISPLAY(next)->dpy; argl = Cdr (argl); next = Eval (Car (argl)); Check_Type (next, T_Boolean); discard = Truep (next); argl = Cdr (argl); next = Eval (Car (argl)); Check_Type (next, T_Boolean); peek = Truep (next); for (i = 0; i < LASTEvent; i++) funcs[i] = Null; gcv.gclen = 1+LASTEvent; gcv.gcobj = funcs; gcv.next = &gc3; GC_List = &gcv; for (argl = Cdr (argl); !Nullp (argl); argl = Cdr (argl)) { clause = Car (argl); Check_List (clause); if (Fast_Length (clause) != 2) Primitive_Error ("badly formed event clause"); func = Eval (Car (Cdr (clause))); Check_Procedure (func); clause = Car (clause); if (EQ(clause, Sym_Else)) { for (i = 0; i < LASTEvent; i++) if (Nullp (funcs[i])) funcs[i] = func; } else { if (TYPE(clause) == T_Pair) { for (; !Nullp (clause); clause = Cdr (clause)) { i = Encode_Event (Car (clause)); if (!Nullp (funcs[i])) Primitive_Error (errmsg); funcs[i] = func; } } else { i = Encode_Event (clause); if (!Nullp (funcs[i])) Primitive_Error (errmsg); funcs[i] = func; } } } ret = False; while (!Truep (ret)) { XEvent e; if (discard) { (peek ? XPeekEvent : XNextEvent) (dpy, &e); if ((i = e.type) < LASTEvent && !Nullp (funcs[i])) { args = Get_Event_Args (&e); ret = Funcall (funcs[i], args, 0); Destroy_Event_Args (args); } else { if (peek) XNextEvent (dpy, &e); /* discard it */ } } else { struct predicate_arg a; a.funcs = funcs; a.ret = &ret; (peek ? XPeekIfEvent : XIfEvent) (dpy, &e, Event_Predicate, #ifdef XLIB_RELEASE_5_OR_LATER (XPointer)&a); #else (char *)&a); #endif } } GC_Unlink; TC_Enable; return ret; } static Object Get_Time_Arg (Time t) { return t == CurrentTime ? Sym_Now : Make_Unsigned_Long ((unsigned long)t); } Object Get_Event_Args (XEvent *ep) { Object tmpargs[MAX_ARGS]; register int e, i; register Object *a, *vp; struct gcnode gcv; Object dummy; GC_Node; e = ep->type; dummy = Null; a = tmpargs; for (i = 0; i < MAX_ARGS; i++) a[i] = Null; GC_Link (dummy); gcv.gclen = 1 + MAX_ARGS; gcv.gcobj = a; gcv.next = &gc1; GC_List = &gcv; switch (e) { case KeyPress: case KeyRelease: case ButtonPress: case ButtonRelease: case MotionNotify: case EnterNotify: case LeaveNotify: { register XKeyEvent *p = (XKeyEvent *)ep; a[1] = Make_Window (0, p->display, p->window); a[2] = Make_Window (0, p->display, p->root); a[3] = Make_Window (0, p->display, p->subwindow); a[4] = Get_Time_Arg (p->time); a[5] = Make_Integer (p->x); a[6] = Make_Integer (p->y); a[7] = Make_Integer (p->x_root); a[8] = Make_Integer (p->y_root); if (e == KeyPress || e == KeyRelease) { a[9] = Bits_To_Symbols ((unsigned long)p->state, 1, State_Syms); a[10] = Make_Integer (p->keycode); a[11] = p->same_screen ? True : False; } else if (e == ButtonPress || e == ButtonRelease) { register XButtonEvent *q = (XButtonEvent *)ep; a[9] = Bits_To_Symbols ((unsigned long)q->state, 1, State_Syms); a[10] = Bits_To_Symbols ((unsigned long)q->button, 0, Button_Syms); a[11] = q->same_screen ? True : False; } else if (e == MotionNotify) { register XMotionEvent *q = (XMotionEvent *)ep; a[9] = Bits_To_Symbols ((unsigned long)q->state, 1, State_Syms); a[10] = q->is_hint ? True : False; a[11] = q->same_screen ? True : False; } else { register XCrossingEvent *q = (XCrossingEvent *)ep; a[9] = Bits_To_Symbols ((unsigned long)q->mode, 0, Cross_Mode_Syms); a[10] = Bits_To_Symbols ((unsigned long)q->detail, 0, Cross_Detail_Syms); a[11] = q->same_screen ? True : False; a[12] = q->focus ? True : False; a[13] = Bits_To_Symbols ((unsigned long)q->state, 1, Button_Syms); } } break; case FocusIn: case FocusOut: { register XFocusChangeEvent *p = (XFocusChangeEvent *)ep; a[1] = Make_Window (0, p->display, p->window); a[2] = Bits_To_Symbols ((unsigned long)p->mode, 0, Cross_Mode_Syms); a[3] = Bits_To_Symbols ((unsigned long)p->detail, 0, Focus_Detail_Syms); } break; case KeymapNotify: { register XKeymapEvent *p = (XKeymapEvent *)ep; a[1] = Make_Window (0, p->display, p->window); a[2] = Make_String (p->key_vector, 32); } break; case Expose: { register XExposeEvent *p = (XExposeEvent *)ep; a[1] = Make_Window (0, p->display, p->window); a[2] = Make_Integer (p->x); a[3] = Make_Integer (p->y); a[4] = Make_Integer (p->width); a[5] = Make_Integer (p->height); a[6] = Make_Integer (p->count); } break; case GraphicsExpose: { register XGraphicsExposeEvent *p = (XGraphicsExposeEvent *)ep; a[1] = Make_Window (0, p->display, p->drawable); a[2] = Make_Integer (p->x); a[3] = Make_Integer (p->y); a[4] = Make_Integer (p->width); a[5] = Make_Integer (p->height); a[6] = Make_Integer (p->count); a[7] = Make_Integer (p->major_code); a[8] = Make_Integer (p->minor_code); } break; case NoExpose: { register XNoExposeEvent *p = (XNoExposeEvent *)ep; a[1] = Make_Window (0, p->display, p->drawable); a[2] = Make_Integer (p->major_code); a[3] = Make_Integer (p->minor_code); } break; case VisibilityNotify: { register XVisibilityEvent *p = (XVisibilityEvent *)ep; a[1] = Make_Window (0, p->display, p->window); a[2] = Bits_To_Symbols ((unsigned long)p->state, 0, Visibility_Syms); } break; case CreateNotify: { register XCreateWindowEvent *p = (XCreateWindowEvent *)ep; a[1] = Make_Window (0, p->display, p->parent); a[2] = Make_Window (0, p->display, p->window); a[3] = Make_Integer (p->x); a[4] = Make_Integer (p->y); a[5] = Make_Integer (p->width); a[6] = Make_Integer (p->height); a[7] = Make_Integer (p->border_width); a[8] = p->override_redirect ? True : False; } break; case DestroyNotify: { register XDestroyWindowEvent *p = (XDestroyWindowEvent *)ep; a[1] = Make_Window (0, p->display, p->event); a[2] = Make_Window (0, p->display, p->window); } break; case UnmapNotify: { register XUnmapEvent *p = (XUnmapEvent *)ep; a[1] = Make_Window (0, p->display, p->event); a[2] = Make_Window (0, p->display, p->window); a[3] = p->from_configure ? True : False; } break; case MapNotify: { register XMapEvent *p = (XMapEvent *)ep; a[1] = Make_Window (0, p->display, p->event); a[2] = Make_Window (0, p->display, p->window); a[3] = p->override_redirect ? True : False; } break; case MapRequest: { register XMapRequestEvent *p = (XMapRequestEvent *)ep; a[1] = Make_Window (0, p->display, p->parent); a[2] = Make_Window (0, p->display, p->window); } break; case ReparentNotify: { register XReparentEvent *p = (XReparentEvent *)ep; a[1] = Make_Window (0, p->display, p->event); a[2] = Make_Window (0, p->display, p->window); a[3] = Make_Window (0, p->display, p->parent); a[4] = Make_Integer (p->x); a[5] = Make_Integer (p->y); a[6] = p->override_redirect ? True : False; } break; case ConfigureNotify: { register XConfigureEvent *p = (XConfigureEvent *)ep; a[1] = Make_Window (0, p->display, p->event); a[2] = Make_Window (0, p->display, p->window); a[3] = Make_Integer (p->x); a[4] = Make_Integer (p->y); a[5] = Make_Integer (p->width); a[6] = Make_Integer (p->height); a[7] = Make_Integer (p->border_width); a[8] = Make_Window (0, p->display, p->above); a[9] = p->override_redirect ? True : False; } break; case ConfigureRequest: { register XConfigureRequestEvent *p = (XConfigureRequestEvent *)ep; a[1] = Make_Window (0, p->display, p->parent); a[2] = Make_Window (0, p->display, p->window); a[3] = Make_Integer (p->x); a[4] = Make_Integer (p->y); a[5] = Make_Integer (p->width); a[6] = Make_Integer (p->height); a[7] = Make_Integer (p->border_width); a[8] = Make_Window (0, p->display, p->above); a[9] = Bits_To_Symbols ((unsigned long)p->detail, 0, Stack_Mode_Syms); a[10] = Make_Unsigned_Long (p->value_mask); } break; case GravityNotify: { register XGravityEvent *p = (XGravityEvent *)ep; a[1] = Make_Window (0, p->display, p->event); a[2] = Make_Window (0, p->display, p->window); a[3] = Make_Integer (p->x); a[4] = Make_Integer (p->y); } break; case ResizeRequest: { register XResizeRequestEvent *p = (XResizeRequestEvent *)ep; a[1] = Make_Window (0, p->display, p->window); a[2] = Make_Integer (p->width); a[3] = Make_Integer (p->height); } break; case CirculateNotify: { register XCirculateEvent *p = (XCirculateEvent *)ep; a[1] = Make_Window (0, p->display, p->event); a[2] = Make_Window (0, p->display, p->window); a[3] = Bits_To_Symbols ((unsigned long)p->place, 0, Place_Syms); } break; case CirculateRequest: { register XCirculateRequestEvent *p = (XCirculateRequestEvent *)ep; a[1] = Make_Window (0, p->display, p->parent); a[2] = Make_Window (0, p->display, p->window); a[3] = Bits_To_Symbols ((unsigned long)p->place, 0, Place_Syms); } break; case PropertyNotify: { register XPropertyEvent *p = (XPropertyEvent *)ep; a[1] = Make_Window (0, p->display, p->window); a[2] = Make_Atom (p->atom); a[3] = Get_Time_Arg (p->time); a[4] = Bits_To_Symbols ((unsigned long)p->state, 0, Prop_Syms); } break; case SelectionClear: { register XSelectionClearEvent *p = (XSelectionClearEvent *)ep; a[1] = Make_Window (0, p->display, p->window); a[2] = Make_Atom (p->selection); a[3] = Get_Time_Arg (p->time); } break; case SelectionRequest: { register XSelectionRequestEvent *p = (XSelectionRequestEvent *)ep; a[1] = Make_Window (0, p->display, p->owner); a[2] = Make_Window (0, p->display, p->requestor); a[3] = Make_Atom (p->selection); a[4] = Make_Atom (p->target); a[5] = Make_Atom (p->property); a[6] = Get_Time_Arg (p->time); } break; case SelectionNotify: { register XSelectionEvent *p = (XSelectionEvent *)ep; a[1] = Make_Window (0, p->display, p->requestor); a[2] = Make_Atom (p->selection); a[3] = Make_Atom (p->target); a[4] = Make_Atom (p->property); a[5] = Get_Time_Arg (p->time); } break; case ColormapNotify: { register XColormapEvent *p = (XColormapEvent *)ep; a[1] = Make_Window (0, p->display, p->window); a[2] = Make_Colormap (0, p->display, p->colormap); a[3] = p->new ? True : False; a[4] = p->state == ColormapInstalled ? True : False; } break; case ClientMessage: { register XClientMessageEvent *p = (XClientMessageEvent *)ep; register int i; a[1] = Make_Window (0, p->display, p->window); a[2] = Make_Atom (p->message_type); switch (p->format) { case 8: a[3] = Make_String (p->data.b, 20); break; case 16: a[3] = Make_Vector (10, Null); for (i = 0; i < 10; i++) VECTOR(a[3])->data[i] = Make_Integer (p->data.s[i]); break; case 32: a[3] = Make_Vector (5, Null); for (i = 0; i < 5; i++) VECTOR(a[3])->data[i] = Make_Long (p->data.l[i]); break; default: a[3] = Make_Integer (p->format); /* ??? */ } } break; case MappingNotify: { register XMappingEvent *p = (XMappingEvent *)ep; a[1] = Make_Window (0, p->display, p->window); a[2] = Bits_To_Symbols ((unsigned long)p->request, 0, Mapping_Syms); a[3] = Make_Integer (p->first_keycode); a[4] = Make_Integer (p->count); } break; } a[0] = Intern (Event_Table[e].name); for (vp = VECTOR(Argv)->data, i = 0; i < Event_Table[e].argc; i++) { if (i) vp++; Car (*vp) = a[i]; Cdr (*vp) = vp[1]; } Cdr (*vp) = Null; GC_Unlink; return Argl; } void Destroy_Event_Args (Object args) { Object t; for (t = args; !Nullp (t); t = Cdr (t)) Car (t) = Null; } int Encode_Event (Object e) { Object s; register char *p; register struct event_desc *ep; register int n; Check_Type (e, T_Symbol); s = SYMBOL(e)->name; p = STRING(s)->data; n = STRING(s)->size; for (ep = Event_Table; ep->name; ep++) if (n && strncmp (ep->name, p, n) == 0) break; if (ep->name == 0) Primitive_Error ("no such event: ~s", e); return ep-Event_Table; } static Object P_Get_Motion_Events (Object w, Object from, Object to) { XTimeCoord *p; int n; register int i; Object e, ret; GC_Node2; Check_Type (w, T_Window); p = XGetMotionEvents (WINDOW(w)->dpy, WINDOW(w)->win, Get_Time (from), Get_Time (to), &n); e = ret = Make_Vector (n, Null); GC_Link2 (ret, e); for (i = 0; i < n; i++) { e = P_Make_List (Make_Integer (3), Null); VECTOR(ret)->data[i] = e; Car (e) = Get_Time_Arg (p[i].time); e = Cdr (e); Car (e) = Make_Integer (p[i].x); e = Cdr (e); Car (e) = Make_Integer (p[i].y); } GC_Unlink; XFree ((char *)p); return ret; } static Object P_Event_Listen (Object d, Object wait_flag) { Display *dpy; register int n; XEvent e; Check_Type (d, T_Display); Check_Type (wait_flag, T_Boolean); dpy = DISPLAY(d)->dpy; n = XPending (dpy); if (n == 0 && EQ(wait_flag, True)) { XPeekEvent (dpy, &e); n = XPending (dpy); } return Make_Integer (n); } void elk_init_xlib_event () { Object t; register int i; Argl = P_Make_List (Make_Integer (MAX_ARGS), Null); Global_GC_Link (Argl); Argv = Make_Vector (MAX_ARGS, Null); Global_GC_Link (Argv); for (i = 0, t = Argl; i < MAX_ARGS; i++, t = Cdr (t)) VECTOR(Argv)->data[i] = t; Define_Primitive (P_Handle_Events, "handle-events", 3, MANY, NOEVAL); Define_Primitive (P_Get_Motion_Events, "get-motion-events", 3, 3, EVAL); Define_Primitive (P_Event_Listen, "event-listen", 2, 2, EVAL); } elk-3.99.8/lib/xlib/grab.c0000644000175000017500000001435411577076306012126 00000000000000/* grab.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "xlib.h" static Object Sym_Any; Time Get_Time (Object time) { if (EQ(time, Sym_Now)) return CurrentTime; return (Time)Get_Long (time); } static int Get_Mode (Object m) { Check_Type (m, T_Boolean); return EQ(m, True) ? GrabModeSync : GrabModeAsync; } static Object P_Grab_Pointer (Object win, Object ownerp, Object events, Object psyncp, Object ksyncp, Object confine_to, Object cursor, Object time) { Check_Type (win, T_Window); Check_Type (ownerp, T_Boolean); return Bits_To_Symbols ((unsigned long)XGrabPointer (WINDOW(win)->dpy, WINDOW(win)->win, EQ(ownerp, True), Symbols_To_Bits (events, 1, Event_Syms), Get_Mode (psyncp), Get_Mode (ksyncp), Get_Window (confine_to), Get_Cursor (cursor), Get_Time (time)), 0, Grabstatus_Syms); } static Object P_Ungrab_Pointer (Object d, Object time) { Check_Type (d, T_Display); XUngrabPointer (DISPLAY(d)->dpy, Get_Time (time)); return Void; } static Object P_Grab_Button (Object win, Object button, Object mods, Object ownerp, Object events, Object psyncp, Object ksyncp, Object confine_to, Object cursor) { Check_Type (win, T_Window); Check_Type (ownerp, T_Boolean); XGrabButton (WINDOW(win)->dpy, Symbols_To_Bits (button, 0, Button_Syms), Symbols_To_Bits (mods, 1, State_Syms), WINDOW(win)->win, EQ(ownerp, True), Symbols_To_Bits (events, 1, Event_Syms), Get_Mode (psyncp), Get_Mode (ksyncp), Get_Window (confine_to), Get_Cursor (cursor)); return Void; } static Object P_Ungrab_Button (Object win, Object button, Object mods) { Check_Type (win, T_Window); XUngrabButton (WINDOW(win)->dpy, Symbols_To_Bits (button, 0, Button_Syms), Symbols_To_Bits (mods, 1, State_Syms), WINDOW(win)->win); return Void; } static Object P_Change_Active_Pointer_Grab (Object d, Object events, Object cursor, Object time) { Check_Type (d, T_Display); XChangeActivePointerGrab (DISPLAY(d)->dpy, Symbols_To_Bits (events, 1, Event_Syms), Get_Cursor (cursor), Get_Time (time)); return Void; } static Object P_Grab_Keyboard (Object win, Object ownerp, Object psyncp, Object ksyncp, Object time) { Check_Type (win, T_Window); Check_Type (ownerp, T_Boolean); return Bits_To_Symbols ((unsigned long)XGrabKeyboard (WINDOW(win)->dpy, WINDOW(win)->win, EQ(ownerp, True), Get_Mode (psyncp), Get_Mode (ksyncp), Get_Time (time)), 0, Grabstatus_Syms); } static Object P_Ungrab_Keyboard (Object d, Object time) { Check_Type (d, T_Display); XUngrabKeyboard (DISPLAY(d)->dpy, Get_Time (time)); return Void; } static Object P_Grab_Key (Object win, Object key, Object mods, Object ownerp, Object psyncp, Object ksyncp) { int keycode = AnyKey; Check_Type (win, T_Window); if (!EQ(key, Sym_Any)) keycode = Get_Integer (key); Check_Type (ownerp, T_Boolean); XGrabKey (WINDOW(win)->dpy, keycode, Symbols_To_Bits (mods, 1, State_Syms), WINDOW(win)->win, EQ(ownerp, True), Get_Mode (psyncp), Get_Mode (ksyncp)); return Void; } static Object P_Ungrab_Key (Object win, Object key, Object mods) { int keycode = AnyKey; Check_Type (win, T_Window); if (!EQ(key, Sym_Any)) keycode = Get_Integer (key); XUngrabKey (WINDOW(win)->dpy, keycode, Symbols_To_Bits (mods, 1, State_Syms), WINDOW(win)->win); return Void; } static Object P_Allow_Events (Object d, Object mode, Object time) { Check_Type (d, T_Display); XAllowEvents (DISPLAY(d)->dpy, Symbols_To_Bits (mode, 0, Allow_Events_Syms), Get_Time (time)); return Void; } static Object P_Grab_Server (Object d) { Check_Type (d, T_Display); XGrabServer (DISPLAY(d)->dpy); return Void; } static Object P_Ungrab_Server (Object d) { Check_Type (d, T_Display); XUngrabServer (DISPLAY(d)->dpy); return Void; } void elk_init_xlib_grab () { Define_Primitive (P_Grab_Pointer, "grab-pointer", 8, 8, EVAL); Define_Primitive (P_Ungrab_Pointer, "ungrab-pointer", 2, 2, EVAL); Define_Primitive (P_Grab_Button, "grab-button", 9, 9, EVAL); Define_Primitive (P_Ungrab_Button, "ungrab-button", 3, 3, EVAL); Define_Primitive (P_Change_Active_Pointer_Grab, "change-active-pointer-grab", 4, 4, EVAL); Define_Primitive (P_Grab_Keyboard, "grab-keyboard", 5, 5, EVAL); Define_Primitive (P_Ungrab_Keyboard, "ungrab-keyboard", 2, 2, EVAL); Define_Primitive (P_Grab_Key, "grab-key", 6, 6, EVAL); Define_Primitive (P_Ungrab_Key, "ungrab-key", 3, 3, EVAL); Define_Primitive (P_Allow_Events, "allow-events", 3, 3, EVAL); Define_Primitive (P_Grab_Server, "grab-server", 1, 1, EVAL); Define_Primitive (P_Ungrab_Server, "ungrab-server", 1, 1, EVAL); Define_Symbol (&Sym_Any, "any"); } elk-3.99.8/lib/xlib/display.c0000644000175000017500000002634111577076306012657 00000000000000/* display.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "xlib.h" #include static int Display_Visit (Object *dp, int (*f)()) { (*f)(&DISPLAY(*dp)->after); return 0; } Generic_Predicate (Display) Generic_Equal (Display, DISPLAY, dpy) static int Display_Print (Object d, Object port, int raw, int depth, int length) { Printf (port, "#[display %lu %s]", (unsigned long)(uintptr_t)DISPLAY(d)->dpy, DisplayString (DISPLAY(d)->dpy)); return 0; } Object Make_Display (int finalize, Display *dpy) { Object d; d = Find_Object (T_Display, (GENERIC)dpy, Match_X_Obj); if (Nullp (d)) { d = Alloc_Object (sizeof (struct S_Display), T_Display, 0); DISPLAY(d)->dpy = dpy; DISPLAY(d)->free = 0; DISPLAY(d)->after = False; Register_Object (d, (GENERIC)dpy, finalize ? P_Close_Display : (PFO)0, 1); } return d; } static Object P_Open_Display (int argc, Object *argv) { register char *s; Display *dpy; if (argc == 1) { if ((dpy = XOpenDisplay (Get_Strsym (argv[0]))) == 0) Primitive_Error ("cannot open display ~s", argv[0]); } else if ((dpy = XOpenDisplay ((char *)0)) == 0) { s = XDisplayName ((char *)0); Primitive_Error ("cannot open display ~s", Make_String (s, strlen (s))); } return Make_Display (1, dpy); } Object P_Close_Display (Object d) { register struct S_Display *p; Check_Type (d, T_Display); p = DISPLAY(d); if (!p->free) { Terminate_Group ((GENERIC)p->dpy); XCloseDisplay (p->dpy); } Deregister_Object (d); p->free = 1; return Void; } static Object P_Display_Default_Root_Window (Object d) { Check_Type (d, T_Display); return Make_Window (0, DISPLAY(d)->dpy, DefaultRootWindow (DISPLAY(d)->dpy)); } static Object P_Display_Default_Colormap (Object d) { register Display *dpy; Check_Type (d, T_Display); dpy = DISPLAY(d)->dpy; return Make_Colormap (0, dpy, DefaultColormap (dpy, DefaultScreen (dpy))); } static Object P_Display_Default_Gcontext (Object d) { register Display *dpy; Check_Type (d, T_Display); dpy = DISPLAY(d)->dpy; return Make_Gc (0, dpy, DefaultGC (dpy, DefaultScreen (dpy))); } static Object P_Display_Default_Depth (Object d) { register Display *dpy; Check_Type (d, T_Display); dpy = DISPLAY(d)->dpy; return Make_Integer (DefaultDepth (dpy, DefaultScreen (dpy))); } static Object P_Display_Default_Screen_Number (Object d) { Check_Type (d, T_Display); return Make_Integer (DefaultScreen (DISPLAY(d)->dpy)); } int Get_Screen_Number (Display *dpy, Object scr) { register int s; if ((s = Get_Integer (scr)) < 0 || s > ScreenCount (dpy)-1) Primitive_Error ("invalid screen number"); return s; } static Object P_Display_Cells (Object d, Object scr) { Check_Type (d, T_Display); return Make_Integer (DisplayCells (DISPLAY(d)->dpy, Get_Screen_Number (DISPLAY(d)->dpy, scr))); } static Object P_Display_Planes (Object d, Object scr) { Check_Type (d, T_Display); return Make_Integer (DisplayPlanes (DISPLAY(d)->dpy, Get_Screen_Number (DISPLAY(d)->dpy, scr))); } static Object P_Display_String (Object d) { register char *s; Check_Type (d, T_Display); s = DisplayString (DISPLAY(d)->dpy); return Make_String (s, strlen (s)); } static Object P_Display_Vendor (Object d) { register char *s; Object ret, name; GC_Node; Check_Type (d, T_Display); s = ServerVendor (DISPLAY(d)->dpy); name = Make_String (s, strlen (s)); GC_Link (name); ret = Cons (Null, Make_Integer (VendorRelease (DISPLAY(d)->dpy))); Car (ret) = name; GC_Unlink; return ret; } static Object P_Display_Protocol_Version (Object d) { Check_Type (d, T_Display); return Cons (Make_Integer (ProtocolVersion (DISPLAY(d)->dpy)), Make_Integer (ProtocolRevision (DISPLAY(d)->dpy))); } static Object P_Display_Screen_Count (Object d) { Check_Type (d, T_Display); return Make_Integer (ScreenCount (DISPLAY(d)->dpy)); } static Object P_Display_Image_Byte_Order (Object d) { Check_Type (d, T_Display); return Bits_To_Symbols ((unsigned long)ImageByteOrder (DISPLAY(d)->dpy), 0, Byte_Order_Syms); } static Object P_Display_Bitmap_Unit (Object d) { Check_Type (d, T_Display); return Make_Integer (BitmapUnit (DISPLAY(d)->dpy)); } static Object P_Display_Bitmap_Bit_Order (Object d) { Check_Type (d, T_Display); return Bits_To_Symbols ((unsigned long)BitmapBitOrder (DISPLAY(d)->dpy), 0, Byte_Order_Syms); } static Object P_Display_Bitmap_Pad (Object d) { Check_Type (d, T_Display); return Make_Integer (BitmapPad (DISPLAY(d)->dpy)); } static Object P_Display_Width (Object d) { Check_Type (d, T_Display); return Make_Integer (DisplayWidth (DISPLAY(d)->dpy, DefaultScreen (DISPLAY(d)->dpy))); } static Object P_Display_Height (Object d) { Check_Type (d, T_Display); return Make_Integer (DisplayHeight (DISPLAY(d)->dpy, DefaultScreen (DISPLAY(d)->dpy))); } static Object P_Display_Width_Mm (Object d) { Check_Type (d, T_Display); return Make_Integer (DisplayWidthMM (DISPLAY(d)->dpy, DefaultScreen (DISPLAY(d)->dpy))); } static Object P_Display_Height_Mm (Object d) { Check_Type (d, T_Display); return Make_Integer (DisplayHeightMM (DISPLAY(d)->dpy, DefaultScreen (DISPLAY(d)->dpy))); } static Object P_Display_Motion_Buffer_Size (Object d) { Check_Type (d, T_Display); return Make_Unsigned_Long (XDisplayMotionBufferSize (DISPLAY(d)->dpy)); } static Object P_Display_Flush_Output (Object d) { Check_Type (d, T_Display); XFlush (DISPLAY(d)->dpy); return Void; } static Object P_Display_Wait_Output (Object d, Object discard) { Check_Type (d, T_Display); Check_Type (discard, T_Boolean); XSync (DISPLAY(d)->dpy, EQ(discard, True)); return Void; } static Object P_No_Op (Object d) { Check_Type (d, T_Display); XNoOp (DISPLAY(d)->dpy); return Void; } static Object P_List_Depths (Object d, Object scr) { int num; register int *p, i; Object ret; Check_Type (d, T_Display); if (!(p = XListDepths (DISPLAY(d)->dpy, Get_Screen_Number (DISPLAY(d)->dpy, scr), &num))) return False; ret = Make_Vector (num, Null); for (i = 0; i < num; i++) VECTOR(ret)->data[i] = Make_Integer (p[i]); XFree ((char *)p); return ret; } static Object P_List_Pixmap_Formats (Object d) { register XPixmapFormatValues *p; int num; register int i; Object ret; GC_Node; Check_Type (d, T_Display); if (!(p = XListPixmapFormats (DISPLAY(d)->dpy, &num))) return False; ret = Make_Vector (num, Null); GC_Link (ret); for (i = 0; i < num; i++) { Object t; t = P_Make_List (Make_Integer (3), Null); VECTOR(ret)->data[i] = t; Car (t) = Make_Integer (p[i].depth); t = Cdr (t); Car (t) = Make_Integer (p[i].bits_per_pixel); t = Cdr (t); Car (t) = Make_Integer (p[i].scanline_pad); } GC_Unlink; XFree ((char *)p); return ret; } void elk_init_xlib_display () { T_Display = Define_Type (0, "display", NOFUNC, sizeof (struct S_Display), Display_Equal, Display_Equal, Display_Print, Display_Visit); Define_Primitive (P_Displayp, "display?", 1, 1, EVAL); Define_Primitive (P_Open_Display, "open-display", 0, 1, VARARGS); Define_Primitive (P_Close_Display, "close-display", 1, 1, EVAL); Define_Primitive (P_Display_Default_Root_Window, "display-default-root-window", 1, 1, EVAL); Define_Primitive (P_Display_Default_Colormap, "display-default-colormap", 1, 1, EVAL); Define_Primitive (P_Display_Default_Gcontext, "display-default-gcontext", 1, 1, EVAL); Define_Primitive (P_Display_Default_Depth, "display-default-depth", 1, 1, EVAL); Define_Primitive (P_Display_Default_Screen_Number, "display-default-screen-number", 1, 1, EVAL); Define_Primitive (P_Display_Cells, "display-cells", 2, 2, EVAL); Define_Primitive (P_Display_Planes, "display-planes", 2, 2, EVAL); Define_Primitive (P_Display_String, "display-string", 1, 1, EVAL); Define_Primitive (P_Display_Vendor, "display-vendor", 1, 1, EVAL); Define_Primitive (P_Display_Protocol_Version, "display-protocol-version", 1, 1, EVAL); Define_Primitive (P_Display_Screen_Count, "display-screen-count", 1, 1, EVAL); Define_Primitive (P_Display_Image_Byte_Order, "display-image-byte-order", 1, 1, EVAL); Define_Primitive (P_Display_Bitmap_Unit, "display-bitmap-unit", 1, 1, EVAL); Define_Primitive (P_Display_Bitmap_Bit_Order, "display-bitmap-bit-order", 1, 1, EVAL); Define_Primitive (P_Display_Bitmap_Pad, "display-bitmap-pad", 1, 1, EVAL); Define_Primitive (P_Display_Width, "display-width", 1, 1, EVAL); Define_Primitive (P_Display_Height, "display-height", 1, 1, EVAL); Define_Primitive (P_Display_Width_Mm,"display-width-mm", 1, 1, EVAL); Define_Primitive (P_Display_Height_Mm, "display-height-mm", 1, 1, EVAL); Define_Primitive (P_Display_Motion_Buffer_Size, "display-motion-buffer-size", 1, 1, EVAL); Define_Primitive (P_Display_Flush_Output, "display-flush-output", 1, 1, EVAL); Define_Primitive (P_Display_Wait_Output, "display-wait-output", 2, 2, EVAL); Define_Primitive (P_No_Op, "no-op", 1, 1, EVAL); Define_Primitive (P_List_Depths, "list-depths", 2, 2, EVAL); Define_Primitive (P_List_Pixmap_Formats, "list-pixmap-formats", 1, 1, EVAL); } elk-3.99.8/lib/xlib/extension.c0000644000175000017500000000475011577076306013226 00000000000000/* extension.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "xlib.h" #include static Object P_List_Extensions (Object d) { Object ret; int n; register int i; register char **p; GC_Node; Check_Type (d, T_Display); Disable_Interrupts; p = XListExtensions (DISPLAY(d)->dpy, &n); Enable_Interrupts; ret = Make_Vector (n, Null); GC_Link (ret); for (i = 0; i < n; i++) { Object e; e = Make_String (p[i], strlen (p[i])); VECTOR(ret)->data[i] = e; } GC_Unlink; XFreeExtensionList (p); return ret; } static Object P_Query_Extension (Object d, Object name) { int opcode, event, error; Object ret, t; GC_Node2; Check_Type (d, T_Display); if (!XQueryExtension (DISPLAY(d)->dpy, Get_Strsym (name), &opcode, &event, &error)) return False; t = ret = P_Make_List (Make_Integer (3), Null); GC_Link2 (ret, t); Car (t) = (opcode ? Make_Integer (opcode) : False); t = Cdr (t); Car (t) = (event ? Make_Integer (event) : False); t = Cdr (t); Car (t) = (error ? Make_Integer (error) : False); GC_Unlink; return ret; } void elk_init_xlib_extension () { Define_Primitive (P_List_Extensions, "list-extensions", 1, 1, EVAL); Define_Primitive (P_Query_Extension, "query-extension", 2, 2, EVAL); } elk-3.99.8/lib/xlib/pixel.c0000644000175000017500000000474411577076306012336 00000000000000/* pixel.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "xlib.h" Generic_Predicate (Pixel) Generic_Simple_Equal (Pixel, PIXEL, pix) Generic_Print (Pixel, "#[pixel 0x%lx]", PIXEL(x)->pix) Object Make_Pixel (unsigned long val) { Object pix; pix = Find_Object (T_Pixel, (GENERIC)0, Match_X_Obj, val); if (Nullp (pix)) { pix = Alloc_Object (sizeof (struct S_Pixel), T_Pixel, 0); PIXEL(pix)->tag = Null; PIXEL(pix)->pix = val; Register_Object (pix, (GENERIC)0, (PFO)0, 0); } return pix; } unsigned long Get_Pixel (Object p) { Check_Type (p, T_Pixel); return PIXEL(p)->pix; } static Object P_Pixel_Value (Object p) { return Make_Unsigned_Long (Get_Pixel (p)); } static Object P_Black_Pixel (Object d) { Check_Type (d, T_Display); return Make_Pixel (BlackPixel (DISPLAY(d)->dpy, DefaultScreen (DISPLAY(d)->dpy))); } static Object P_White_Pixel (Object d) { Check_Type (d, T_Display); return Make_Pixel (WhitePixel (DISPLAY(d)->dpy, DefaultScreen (DISPLAY(d)->dpy))); } void elk_init_xlib_pixel () { Generic_Define (Pixel, "pixel", "pixel?"); Define_Primitive (P_Pixel_Value, "pixel-value", 1, 1, EVAL); Define_Primitive (P_Black_Pixel, "black-pixel", 1, 1, EVAL); Define_Primitive (P_White_Pixel, "white-pixel", 1, 1, EVAL); } elk-3.99.8/lib/xlib/Makefile.am0000644000175000017500000000156511577076306013103 00000000000000NULL = EXTRA_DIST = MISSING lib_LTLIBRARIES = $(libelk_xlib_la) pkglib_LTLIBRARIES = $(xlib_la) if HAVE_X11 libelk_xlib_la = libelk-xlib.la xlib_la = xlib.la endif libelk_xlib_la_SOURCES = \ client.c \ color.c \ colormap.c \ cursor.c \ display.c \ error.c \ event.c \ extension.c \ font.c \ gcontext.c \ grab.c \ graphics.c \ key.c \ objects.c \ pixel.c \ pixmap.c \ property.c \ text.c \ type.c \ util.c \ window.c \ wm.c \ $(NULL) libelk_xlib_la_CFLAGS = @X_CFLAGS@ libelk_xlib_la_LDFLAGS = -no-undefined libelk_xlib_la_LIBADD = $(top_builddir)/src/libelk.la @X_LIBS@ xlib_la_SOURCES = init.c xlib_la_CFLAGS = @X_CFLAGS@ xlib_la_LDFLAGS = -module -avoid-version -no-undefined xlib_la_LIBADD = $(top_builddir)/src/libelk.la libelk-xlib.la @X_LIBS@ extensions_HEADERS = xlib.h extensionsdir = $(pkgincludedir)/extensions echo-sources: ; echo $(SOURCES) elk-3.99.8/lib/xlib/property.c0000644000175000017500000002135211577076306013073 00000000000000/* property.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "xlib.h" #include Object Sym_Now; Generic_Predicate (Atom) Generic_Simple_Equal (Atom, ATOM, atom) Generic_Print (Atom, "#[atom %lu]", ATOM(x)->atom) Object Make_Atom (Atom a) { Object atom; if (a == None) return Sym_None; atom = Find_Object (T_Atom, (GENERIC)0, Match_X_Obj, a); if (Nullp (atom)) { atom = Alloc_Object (sizeof (struct S_Atom), T_Atom, 0); ATOM(atom)->tag = Null; ATOM(atom)->atom = a; Register_Object (atom, (GENERIC)0, (PFO)0, 0); } return atom; } /* Should be used with care */ static Object P_Make_Atom (Object n) { return Make_Atom ((Atom)Get_Long (n)); } static Object P_Intern_Atom (Object d, Object name) { Check_Type (d, T_Display); return Make_Atom (XInternAtom (DISPLAY(d)->dpy, Get_Strsym (name), 0)); } static Object P_Find_Atom (Object d, Object name) { Check_Type (d, T_Display); return Make_Atom (XInternAtom (DISPLAY(d)->dpy, Get_Strsym (name), 1)); } static Object P_Atom_Name (Object d, Object a) { register char *s; Check_Type (d, T_Display); Check_Type (a, T_Atom); Disable_Interrupts; s = XGetAtomName (DISPLAY(d)->dpy, ATOM(a)->atom); Enable_Interrupts; return Make_String (s, strlen (s)); } static Object P_List_Properties (Object w) { register int i; int n; register Atom *ap; Object v; GC_Node; Check_Type (w, T_Window); Disable_Interrupts; ap = XListProperties (WINDOW(w)->dpy, WINDOW(w)->win, &n); Enable_Interrupts; v = Make_Vector (n, Null); GC_Link (v); for (i = 0; i < n; i++) { Object x; x = Make_Atom (ap[i]); VECTOR(v)->data[i] = x; } GC_Unlink; XFree ((char *)ap); return v; } static Object P_Get_Property (Object w, Object prop, Object type, Object start, Object len, Object deletep) { Atom req_type = AnyPropertyType, actual_type; int format; unsigned long nitems, bytes_left; unsigned char *data; Object ret, t, x; register unsigned int i; GC_Node2; Check_Type (w, T_Window); Check_Type (prop, T_Atom); if (!EQ(type, False)) { Check_Type (type, T_Atom); req_type = ATOM(type)->atom; } Check_Type (deletep, T_Boolean); Disable_Interrupts; if (XGetWindowProperty (WINDOW(w)->dpy, WINDOW(w)->win, ATOM(prop)->atom, Get_Long (start), Get_Long (len), EQ(deletep, True), req_type, &actual_type, &format, &nitems, &bytes_left, &data) != Success) Primitive_Error ("cannot get property"); Enable_Interrupts; ret = t = P_Make_List (Make_Integer (4), Null); GC_Link2 (ret, t); x = Make_Atom (actual_type); Car (t) = x; t = Cdr (t); x = Make_Integer (format); Car (t) = x; t = Cdr (t); if (nitems) { if (format == 8) { Object s; x = Make_String ((char *)0, (int)nitems); s = Car (t) = x; memcpy (STRING(s)->data, (char *)data, (int)nitems); } else { Object v; GC_Node; v = Make_Vector ((int)nitems, Null); GC_Link (v); for (i = 0; i < nitems; i++) { x = Make_Unsigned (format == 16 ? *((int16_t *)data + i) : *((int32_t *)data + i)); VECTOR(v)->data[i] = x; } Car (t) = v; GC_Unlink; } } t = Cdr (t); x = Make_Unsigned_Long (bytes_left); Car (t) = x; GC_Unlink; return ret; } static Object P_Change_Property (Object w, Object prop, Object type, Object format, Object mode, Object data) { register int i, m, x, nitems, f; char *buf; Alloca_Begin; Check_Type (w, T_Window); Check_Type (prop, T_Atom); Check_Type (type, T_Atom); m = Symbols_To_Bits (mode, 0, Propmode_Syms); switch (f = Get_Integer (format)) { case 8: Check_Type (data, T_String); buf = STRING(data)->data; nitems = STRING(data)->size; break; case 16: case 32: Check_Type (data, T_Vector); nitems = VECTOR(data)->size; Alloca (buf, char*, nitems * (f / sizeof (char))); for (i = 0; i < nitems; i++) { x = Get_Integer (VECTOR(data)->data[i]); if (f == 16) { if (x > 65535) Primitive_Error ("format mismatch"); *((int16_t *)buf + i) = x; } else *((int32_t *)buf + i) = x; } break; default: Primitive_Error ("invalid format: ~s", format); } XChangeProperty (WINDOW(w)->dpy, WINDOW(w)->win, ATOM(prop)->atom, ATOM(type)->atom, f, m, (unsigned char *)buf, nitems); Alloca_End; return Void; } static Object P_Delete_Property (Object w, Object prop) { Check_Type (w, T_Window); Check_Type (prop, T_Atom); XDeleteProperty (WINDOW(w)->dpy, WINDOW(w)->win, ATOM(prop)->atom); return Void; } static Object P_Rotate_Properties (Object w, Object v, Object delta) { Atom *p; register int i, n; Alloca_Begin; Check_Type (w, T_Window); Check_Type (v, T_Vector); n = VECTOR(v)->size; Alloca (p, Atom*, n * sizeof (Atom)); for (i = 0; i < n; i++) { Object a; a = VECTOR(v)->data[i]; Check_Type (a, T_Atom); p[i] = ATOM(a)->atom; } XRotateWindowProperties (WINDOW(w)->dpy, WINDOW(w)->win, p, n, Get_Integer (delta)); Alloca_End; return Void; } static Object P_Set_Selection_Owner (Object d, Object s, Object owner, Object time) { Check_Type (d, T_Display); Check_Type (s, T_Atom); XSetSelectionOwner (DISPLAY(d)->dpy, ATOM(s)->atom, Get_Window (owner), Get_Time (time)); return Void; } static Object P_Selection_Owner (Object d, Object s) { Check_Type (d, T_Display); Check_Type (s, T_Atom); return Make_Window (0, DISPLAY(d)->dpy, XGetSelectionOwner (DISPLAY(d)->dpy, ATOM(s)->atom)); } static Object P_Convert_Selection (Object s, Object target, Object prop, Object w, Object time) { Atom p = None; Check_Type (s, T_Atom); Check_Type (target, T_Atom); if (!EQ(prop, Sym_None)) { Check_Type (prop, T_Atom); p = ATOM(prop)->atom; } Check_Type (w, T_Window); XConvertSelection (WINDOW(w)->dpy, ATOM(s)->atom, ATOM(target)->atom, p, WINDOW(w)->win, Get_Time (time)); return Void; } void elk_init_xlib_property () { Define_Symbol (&Sym_Now, "now"); Generic_Define (Atom, "atom", "atom?"); Define_Primitive (P_Make_Atom, "make-atom", 1, 1, EVAL); Define_Primitive (P_Intern_Atom, "intern-atom", 2, 2, EVAL); Define_Primitive (P_Find_Atom, "find-atom", 2, 2, EVAL); Define_Primitive (P_Atom_Name, "atom-name", 2, 2, EVAL); Define_Primitive (P_List_Properties, "list-properties", 1, 1, EVAL); Define_Primitive (P_Get_Property, "get-property", 6, 6, EVAL); Define_Primitive (P_Change_Property, "change-property", 6, 6, EVAL); Define_Primitive (P_Delete_Property, "delete-property", 2, 2, EVAL); Define_Primitive (P_Rotate_Properties, "rotate-properties", 3, 3, EVAL); Define_Primitive (P_Set_Selection_Owner, "set-selection-owner!", 4, 4, EVAL); Define_Primitive (P_Selection_Owner, "selection-owner", 2, 2, EVAL); Define_Primitive (P_Convert_Selection, "convert-selection", 5, 5, EVAL); } elk-3.99.8/lib/xlib/init.c0000644000175000017500000000522011577076306012146 00000000000000/* init.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "xlib.h" static Object P_Xlib_Release_4_Or_Laterp () { return True; } static Object P_Xlib_Release_5_Or_Laterp () { #ifdef XLIB_RELEASE_5_OR_LATER return True; #else return False; #endif } static Object P_Xlib_Release_6_Or_Laterp () { #ifdef XLIB_RELEASE_6_OR_LATER return True; #else return False; #endif } void elk_init_xlib_init () { /* From libelk-xlib.so */ elk_init_xlib_client (); elk_init_xlib_color (); elk_init_xlib_colormap (); elk_init_xlib_cursor (); elk_init_xlib_display (); elk_init_xlib_error (); elk_init_xlib_event (); elk_init_xlib_extension (); elk_init_xlib_font (); elk_init_xlib_gcontext (); elk_init_xlib_grab (); elk_init_xlib_graphics (); elk_init_xlib_key (); elk_init_xlib_objects (); elk_init_xlib_pixel (); elk_init_xlib_pixmap (); elk_init_xlib_property (); elk_init_xlib_text (); elk_init_xlib_type (); elk_init_xlib_util (); elk_init_xlib_window (); elk_init_xlib_wm (); /* From this plugin */ Define_Primitive (P_Xlib_Release_4_Or_Laterp, "xlib-release-4-or-later?", 0, 0, EVAL); Define_Primitive (P_Xlib_Release_5_Or_Laterp, "xlib-release-5-or-later?", 0, 0, EVAL); Define_Primitive (P_Xlib_Release_6_Or_Laterp, "xlib-release-6-or-later?", 0, 0, EVAL); P_Provide (Intern ("xlib.la")); } elk-3.99.8/lib/Makefile.in0000644000175000017500000004144111577103434012144 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = lib DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ELK_CFLAGS = @ELK_CFLAGS@ ELK_LDFLAGS = @ELK_LDFLAGS@ ELK_LIBS = @ELK_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INCLUDES = @INCLUDES@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOTIF_CFLAGS = @MOTIF_CFLAGS@ MOTIF_LIBS = @MOTIF_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STDINT_HEADER = @STDINT_HEADER@ STRIP = @STRIP@ VERSION = @VERSION@ XAW_CFLAGS = @XAW_CFLAGS@ XAW_LIBS = @XAW_LIBS@ XMKMF = @XMKMF@ XT_CFLAGS = @XT_CFLAGS@ XT_LIBS = @XT_LIBS@ X_CFLAGS = @X_CFLAGS@ X_LIBS = @X_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = misc unix xlib xwidgets all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign lib/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign lib/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: elk-3.99.8/lib/unix/0000755000175000017500000000000011577110017011131 500000000000000elk-3.99.8/lib/unix/fdescr.c0000644000175000017500000002154311577076306012504 00000000000000/* fdescr.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "unix.h" #include static SYMDESCR Open_Syms[] = { { "read", 1 }, { "write", 2 }, { "append", O_APPEND }, { "create", O_CREAT }, { "truncate", O_TRUNC }, { "exclusive", O_EXCL }, #ifdef O_SYNC { "sync", O_SYNC }, #endif #ifdef O_NOCTTY { "noctty", O_NOCTTY }, #endif #ifdef O_NDELAY { "ndelay", O_NDELAY }, #endif #ifdef O_NONBLOCK { "nonblock", O_NONBLOCK }, #endif { 0, 0 } }; static SYMDESCR Fcntl_Flags[] = { { "append", O_APPEND }, #ifdef O_SYNC { "sync", O_SYNC }, #endif #ifdef O_SYNCIO { "syncio", O_SYNCIO }, #endif #ifdef O_NDELAY { "ndelay", O_NDELAY }, #endif #ifdef O_NONBLOCK { "nonblock", O_NONBLOCK }, #endif #ifdef O_LARGEFILE { "largefile", O_LARGEFILE }, #endif #ifdef FASYNC { "async", FASYNC }, #endif { 0, 0 } }; SYMDESCR Lseek_Syms[] = { { "set", 0 }, /* Should use symbolic constants, but */ { "current", 1 }, /* how do we know whether it's SEEK_ */ { "end", 2 }, /* or L_ (BSD), and what include files */ { 0, 0 } /* are to be used? */ }; /* Dangerous: may be used to close the filedescriptor of a port. */ static Object P_Close(Object fd) { if (close(Get_Integer(fd)) == -1) Raise_System_Error("~E"); return Void; } static Object P_Close_On_Exec(int argc, Object *argv) { int flags = 0, fd; fd = Get_Integer(argv[0]); #ifndef WIN32 if ((flags = fcntl(fd, F_GETFD, 0)) == -1) Raise_System_Error("fcntl(F_GETFD): ~E"); #endif if (argc == 2) { Check_Type(argv[1], T_Boolean); #ifndef WIN32 if (fcntl(fd, F_SETFD, Truep(argv[1])) == -1) Raise_System_Error("fcntl(F_SETFD): ~E"); #endif } return flags & 1 ? True : False; } static Object P_Dup(int argc, Object *argv) { int fd = Get_Integer(argv[0]), ret; if ((ret = (argc == 1 ? dup(fd) : dup2(fd, Get_Integer(argv[1])))) == -1) Raise_System_Error("~E"); return Make_Integer(ret); } static Object P_Filedescriptor_Flags(int argc, Object *argv) { int flags = 0, fd; fd = Get_Integer(argv[0]); #ifndef WIN32 if ((flags = fcntl(fd, F_GETFL, 0)) == -1) Raise_System_Error("fcntl(F_GETFL): ~E"); #endif if (argc == 2) { #ifndef WIN32 if (fcntl(fd, F_SETFL, Symbols_To_Bits(argv[1], 1, Fcntl_Flags)) == -1) Raise_System_Error("fcntl(F_SETFL): ~E"); #endif } return Bits_To_Symbols((unsigned long)flags, 1, Fcntl_Flags); } static Object P_Fildescriptor_Port(Object fd, Object mode) { int n, flags; FILE *fp; Object ret; char *m, buf[32]; m = Get_String(mode); switch (m[0]) { case 'r': flags = P_INPUT; break; case 'w': case 'a': flags = 0; break; default: Primitive_Error("invalid mode: ~s", mode); } if (m[1] == '+') flags = P_BIDIR; Disable_Interrupts; if ((fp = fdopen(n = Get_Integer(fd), m)) == 0) { Saved_Errno = errno; Enable_Interrupts; Raise_System_Error("~E"); } sprintf(buf, "unix-fildescriptor[%d]", n); ret = Make_Port(flags, fp, Make_String(buf, strlen(buf))); Register_Object(ret, (GENERIC)0, Terminate_File, 0); Enable_Interrupts; return ret; } static Object P_Isatty(Object fd) { return isatty(Get_Integer(fd)) ? True : False; } static Object P_List_Filedescriptor_Flags() { return Syms_To_List(Fcntl_Flags); } static Object P_List_Open_Modes() { return Syms_To_List(Open_Syms); } /* Bad assumption: off_t fits into an unsigned int. */ static Object P_Lseek(Object fd, Object off, Object whence) { off_t ret; if ((ret = lseek(Get_Integer(fd), (off_t)Get_Long(off), (int)Symbols_To_Bits(whence, 0, Lseek_Syms))) == (off_t)-1) Raise_System_Error("~E"); return Make_Unsigned_Long((unsigned long)ret); } int Num_Filedescriptors() { int ret; #if defined(OPEN_MAX) ret = OPEN_MAX; #elif defined(HAVE_GETDTABLESIZE) ret = getdtablesize(); #elif defined(_SC_OPEN_MAX) static r; if (r == 0) { if ((r = sysconf(_SC_OPEN_MAX)) == -1) r = 256; } ret = r; #elif defined(NOFILE) ret = NOFILE; #else ret = 256; #endif return ret; } static Object P_Num_Filedescriptors() { return Make_Integer(Num_Filedescriptors()); } static Object P_Open(int argc, Object *argv) { Object fn; int mode, n; fn = argv[0]; mode = (int)Symbols_To_Bits(argv[1], 1, Open_Syms); if (!(n = mode & 3)) Primitive_Error("mode must include 'read or 'write"); mode &= ~3; mode |= n-1; if (mode & O_CREAT && argc == 2) Primitive_Error("third argument required for 'create"); if ((n = open(Get_Strsym(fn), mode, argc == 3 ? Get_Integer(argv[2]) : 0)) == -1) Raise_System_Error1("~s: ~E", fn); return Make_Integer(n); } static Object P_Pipe() { int fd[2]; #ifdef WIN32 if (_pipe(fd, 256, O_BINARY) == -1) #else if (pipe(fd) == -1) #endif Raise_System_Error("~E"); return Integer_Pair(fd[0], fd[1]); } static Object P_Port_Filedescriptor(Object port) { Check_Type(port, T_Port); if ((PORT(port)->flags & (P_STRING|P_OPEN)) != P_OPEN) Primitive_Error("~s: invalid port", port); return Make_Integer(fileno(PORT(port)->file)); } static Object Read_Write(int argc, Object *argv, int readflg) { struct S_String *sp; int len, fd; fd = Get_Integer(argv[0]); Check_Type(argv[1], T_String); sp = STRING(argv[1]); if (argc == 3) { len = Get_Integer(argv[2]); if (len < 0 || (unsigned int)len > sp->size) Range_Error(argv[2]); } else len = sp->size; if (readflg) len = read(fd, sp->data, len); else len = write(fd, sp->data, len); if (len == -1) Raise_System_Error("~E"); return Make_Integer(len); } /* Avoid name clash with P_Read/P_Write of interpreter kernel */ static Object P_Readx(int argc, Object *argv) { return Read_Write(argc, argv, 1); } static Object P_Writex(int argc, Object *argv) { return Read_Write(argc, argv, 0); } static Object P_Ttyname(Object fd) { char *ret = NULL; #ifndef WIN32 extern char *ttyname(); Disable_Interrupts; ret = ttyname(Get_Integer(fd)); Enable_Interrupts; #endif return ret ? Make_String(ret, strlen(ret)) : False; } void elk_init_unix_fdescr() { Def_Prim(P_Close, "unix-close", 1, 1, EVAL); Def_Prim(P_Close_On_Exec, "unix-close-on-exec", 1, 2, VARARGS); Def_Prim(P_Dup, "unix-dup", 1, 2, VARARGS); Def_Prim(P_Filedescriptor_Flags,"unix-filedescriptor-flags",1, 2, VARARGS); Def_Prim(P_Fildescriptor_Port, "unix-filedescriptor->port",2, 2, EVAL); Def_Prim(P_Isatty, "unix-isatty?", 1, 1, EVAL); Def_Prim(P_List_Filedescriptor_Flags, "unix-list-filedescriptor-flags", 0, 0, EVAL); Def_Prim(P_List_Open_Modes, "unix-list-open-modes", 0, 0, EVAL); Def_Prim(P_Lseek, "unix-lseek", 3, 3, EVAL); Def_Prim(P_Num_Filedescriptors, "unix-num-filedescriptors", 0, 0, EVAL); Def_Prim(P_Open, "unix-open", 2, 3, VARARGS); Def_Prim(P_Pipe, "unix-pipe", 0, 0, EVAL); Def_Prim(P_Port_Filedescriptor, "unix-port-filedescriptor", 1, 1, EVAL); Def_Prim(P_Readx, "unix-read-string-fill!", 2, 3, VARARGS); Def_Prim(P_Ttyname, "unix-ttyname", 1, 1, EVAL); Def_Prim(P_Writex, "unix-write", 2, 3, VARARGS); } elk-3.99.8/lib/unix/file.c0000644000175000017500000002117311577076306012154 00000000000000/* file.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "unix.h" #include #ifdef HAVE_UTIME_H # include #elif HAVE_SYS_UTIME_H # include #else struct utimbuf { time_t actime, modtime; }; #endif #ifdef HAVE_DIRENT_H # include #else # include #endif #if defined(ELOOP) # define SYMLINKS #endif static SYMDESCR Access_Syms[] = { { "read", R_OK }, /* Nothing == F_OK */ { "write", W_OK }, { "execute", X_OK }, { 0, 0 } }; static Object P_Accessp(Object fn, Object mode) { if (access(Get_Strsym(fn), (int)Symbols_To_Bits(mode, 1, Access_Syms)) == 0) return True; Saved_Errno = errno; return False; } static Object P_Chdir(Object fn) { if (chdir(Get_Strsym(fn)) == -1) Raise_System_Error1("~s: ~E", fn); return Void; } static Object P_Chmod(Object fn, Object mode) { if (chmod(Get_Strsym(fn), Get_Integer(mode)) == -1) Raise_System_Error1("~s: ~E", fn); return Void; } static Object P_Chown(Object fn, Object uid, Object gid) { #ifndef WIN32 if (chown(Get_Strsym(fn), Get_Integer(uid), Get_Integer(gid)) == -1) Raise_System_Error1("~s: ~E", fn); #endif return Void; } static Object P_Link(Object fn1, Object fn2) { #ifndef WIN32 if (link(Get_Strsym(fn1), Get_Strsym(fn2)) == -1) Raise_System_Error2("(~s ~s): ~E", fn1, fn2); #endif return Void; } static Object P_Mkdir(Object fn, Object mode) { #ifndef WIN32 if (mkdir(Get_Strsym(fn), Get_Integer(mode)) == -1) Raise_System_Error1("~s: ~E", fn); #endif return Void; } static Object P_Read_Directory(Object fn) { DIR *d; #ifdef HAVE_DIRENT_H struct dirent *dp; #else struct direct *dp; #endif Object ret; GC_Node; ret = Null; GC_Link(ret); Disable_Interrupts; if ((d = opendir(Get_Strsym(fn))) == NULL) { Saved_Errno = errno; Enable_Interrupts; Raise_System_Error1("~s: cannot open", fn); } while ((dp = readdir(d)) != NULL) { Object x; x = Make_String(dp->d_name, strlen(dp->d_name)); ret = Cons(x, ret); } /* closedir() is void under 4.3BSD, should check result elsewhere. */ (void)closedir(d); Enable_Interrupts; GC_Unlink; return ret; } static Object P_Rename(Object fromfn, Object tofn) { #ifdef HAVE_RENAME if (rename(Get_Strsym(fromfn), Get_Strsym(tofn)) == -1) Raise_System_Error2("(~s ~s): ~E", fromfn, tofn); #else char *from = Get_Strsym(fromfn), *to = Get_Strsym(tofn); Disable_Interrupts; if (link(from, to) == -1) { Saved_Errno = errno; Enable_Interrupts; Raise_System_Error2("(~s ~s): ~E", fromfn, tofn); } if (unlink(from) == -1) { Saved_Errno = errno; (void)unlink(to); Enable_Interrupts; Raise_Error1("~s: ~E", fromfn); } Enable_Interrupts; #endif return Void; } static Object General_Stat(Object obj, Object ret, int l) { Object x; struct stat st; char *s, *fn = NULL; int fd = -1, result = 0; GC_Node; Check_Result_Vector(ret, 11); if (l) { #ifdef SYMLINKS result = lstat(Get_Strsym(obj), &st); #endif } else { Get_Filename_Or_Filedescr(obj, fd, fn); result = fn ? stat(fn, &st) : fstat(fd, &st); } if (result == -1) Raise_System_Error1("~s: ~E", obj); switch (st.st_mode & S_IFMT) { case S_IFDIR: s = "directory"; break; case S_IFCHR: s = "character-special"; break; case S_IFBLK: s = "block-special"; break; case S_IFREG: s = "regular"; break; #ifdef S_IFLNK case S_IFLNK: s = "symlink"; break; #endif #ifdef S_IFSOCK case S_IFSOCK: s = "socket"; break; #endif #ifdef S_IFFIFO case S_IFFIFO: s = "fifo"; break; #endif default: s = "unknown"; break; } /* Bad assumption: any of the st_ fields fits into an unsigned int. */ GC_Link(ret); x = Intern(s); VECTOR(ret)->data[0] = x; x = Make_Unsigned((unsigned)st.st_mode & ~S_IFMT); VECTOR(ret)->data[1] = x; x = Make_Unsigned_Long((unsigned long)st.st_ino); VECTOR(ret)->data[2] = x; x = Make_Unsigned((unsigned)st.st_dev); VECTOR(ret)->data[3] = x; x = Make_Unsigned((unsigned)st.st_nlink); VECTOR(ret)->data[4] = x; x = Make_Unsigned((unsigned)st.st_uid); VECTOR(ret)->data[5] = x; x = Make_Unsigned((unsigned)st.st_gid); VECTOR(ret)->data[6] = x; x = Make_Long((long)st.st_size); VECTOR(ret)->data[7] = x; x = Make_Unsigned_Long((unsigned long)st.st_atime); VECTOR(ret)->data[8] = x; x = Make_Unsigned_Long((unsigned long)st.st_mtime); VECTOR(ret)->data[9] = x; x = Make_Unsigned_Long((unsigned long)st.st_ctime); VECTOR(ret)->data[10] = x; GC_Unlink; return Void; } static Object P_Stat(Object obj, Object ret) { return General_Stat(obj, ret, 0); } #ifdef SYMLINKS static Object P_Lstat(Object obj, Object ret) { return General_Stat(obj, ret, 1); } static Object P_Readlink(Object fn) { char *buf; int len; Object ret; Alloca_Begin; len = Path_Max(); Alloca(buf, char*, len); if ((len = readlink(Get_Strsym(fn), buf, len)) == -1) { Alloca_End; Raise_System_Error1("~s: ~E", fn); } ret = Make_String(buf, len); Alloca_End; return ret; } static Object P_Rmdir(Object fn) { if (rmdir(Get_Strsym(fn)) == -1) Raise_System_Error1("~s: ~E", fn); return Void; } static Object P_Symlink(Object fn1, Object fn2) { if (symlink(Get_Strsym(fn1), Get_Strsym(fn2)) == -1) Raise_System_Error2("(~s ~s): ~E", fn1, fn2); return Void; } #endif static Object P_Unlink(Object fn) { if (unlink(Get_Strsym(fn)) == -1) Raise_System_Error1("~s: ~E", fn); return Void; } static Object P_Utime(int argc, Object *argv) { struct utimbuf ut; if (argc == 2) Primitive_Error("wrong number of arguments"); if (argc == 3) { ut.actime = (time_t)Get_Unsigned_Long(argv[1]); ut.modtime = (time_t)Get_Unsigned_Long(argv[2]); } #ifndef WIN32 if (utime(Get_Strsym(argv[0]), argc == 1 ? (struct utimbuf *)0 : &ut) == -1) Raise_System_Error1("~s: ~E", argv[0]); #endif return Void; } void elk_init_unix_file() { Def_Prim(P_Accessp, "unix-access?", 2, 2, EVAL); Def_Prim(P_Chdir, "unix-chdir", 1, 1, EVAL); Def_Prim(P_Chmod, "unix-chmod", 2, 2, EVAL); Def_Prim(P_Chown, "unix-chown", 3, 3, EVAL); Def_Prim(P_Link, "unix-link", 2, 2, EVAL); Def_Prim(P_Mkdir, "unix-mkdir", 2, 2, EVAL); Def_Prim(P_Read_Directory, "unix-read-directory", 1, 1, EVAL); Def_Prim(P_Rename, "unix-rename", 2, 2, EVAL); Def_Prim(P_Stat, "unix-stat-vector-fill!", 2, 2, EVAL); #ifdef SYMLINKS Def_Prim(P_Lstat, "unix-lstat-vector-fill!", 2, 2, EVAL); Def_Prim(P_Readlink, "unix-readlink", 1, 1, EVAL); Def_Prim(P_Rmdir, "unix-rmdir", 1, 1, EVAL); Def_Prim(P_Symlink, "unix-symlink", 2, 2, EVAL); P_Provide(Intern("unix:symlinks")); #endif Def_Prim(P_Unlink, "unix-unlink", 1, 1, EVAL); Def_Prim(P_Utime, "unix-utime", 1, 3, VARARGS); } elk-3.99.8/lib/unix/signal.c0000644000175000017500000002032711577076306012512 00000000000000/* signal.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "unix.h" static Object Sym_Exit, Sym_Default, Sym_Ignore; static SYMDESCR Signal_Syms[] = { #ifdef SIGALRM { "sigalrm", SIGALRM }, #endif #ifdef SIGBUS { "sigbus", SIGBUS }, #endif { "sigfpe", SIGFPE }, #ifdef SIGHUP { "sighup", SIGHUP }, #endif { "sigill", SIGILL }, { "sigint", SIGINT }, #ifdef SIGKILL { "sigkill", SIGKILL }, #endif #ifdef SIGPIPE { "sigpipe", SIGPIPE }, #endif #ifdef SIGQUIT { "sigquit", SIGQUIT }, #endif { "sigsegv", SIGSEGV }, { "sigterm", SIGTERM }, #ifdef SIGABRT { "sigabrt", SIGABRT }, #endif #ifdef SIGAIO { "sigaio", SIGAIO }, #endif #ifdef SIGARRAYSIZE { "sigarraysize", SIGARRAYSIZE }, #endif #ifdef SIGCHLD { "sigchld", SIGCHLD }, #endif #ifdef SIGCLD { "sigcld", SIGCLD }, #endif #ifdef SIGCONT { "sigcont", SIGCONT }, #endif #ifdef SIGDANGER { "sigdanger", SIGDANGER }, #endif #ifdef SIGDIL { "sigdil", SIGDIL }, #endif #ifdef SIGEMT { "sigemt", SIGEMT }, #endif #ifdef SIGGRANT { "siggrant", SIGGRANT }, #endif #ifdef SIGINFO { "siginfo", SIGINFO }, #endif #ifdef SIGIO { "sigio", SIGIO }, #endif #ifdef SIGIOINT { "sigioint", SIGIOINT }, #endif #ifdef SIGIOT { "sigiot", SIGIOT }, #endif #ifdef SIGLOST { "siglost", SIGLOST }, #endif #ifdef SIGLWP { "siglwp", SIGLWP }, #endif #ifdef SIGMIGRATE { "sigmigrate", SIGMIGRATE }, #endif #ifdef SIGMSG { "sigmsg", SIGMSG }, #endif #ifdef SIGPOLL { "sigpoll", SIGPOLL }, #endif #ifdef SIGPRE { "sigpre", SIGPRE }, #endif #ifdef SIGPROF { "sigprof", SIGPROF }, #endif #ifdef SIGPTY { "sigpty", SIGPTY }, #endif #ifdef SIGPWR { "sigpwr", SIGPWR }, #endif #ifdef SIGRESERVE { "sigreserve", SIGRESERVE }, #endif #ifdef SIGRETRACT { "sigretract", SIGRETRACT }, #endif #ifdef SIGSAK { "sigsak", SIGSAK }, #endif #ifdef SIGSOUND { "sigsound", SIGSOUND }, #endif #ifdef SIGSTOP { "sigstop", SIGSTOP }, #endif #ifdef SIGSYS { "sigsys", SIGSYS }, #endif #ifdef SIGTRAP { "sigtrap", SIGTRAP }, #endif #ifdef SIGTSTP { "sigtstp", SIGTSTP }, #endif #ifdef SIGTTIN { "sigttin", SIGTTIN }, #endif #ifdef SIGTTOU { "sigttou", SIGTTOU }, #endif #ifdef SIGURG { "sigurg", SIGURG }, #endif #ifdef SIGUSR1 { "sigusr1", SIGUSR1 }, #endif #ifdef SIGUSR2 { "sigusr2", SIGUSR2 }, #endif #ifdef SIGVIRT { "sigvirt", SIGVIRT }, #endif #ifdef SIGVTALRM { "sigvtalrm", SIGVTALRM }, #endif #ifdef SIGWAITING { "sigwaiting", SIGWAITING }, #endif #ifdef SIGWINCH { "sigwinch", SIGWINCH }, #endif #ifdef SIGWINDOW { "sigwindow", SIGWINDOW }, #endif #ifdef SIGXCPU { "sigxcpu", SIGXCPU }, #endif #ifdef SIGXFSZ { "sigxfsz", SIGXFSZ }, #endif { 0, 0 } }; static Object P_Kill(Object pid, Object sig) { #ifndef WIN32 int t, s; if ((t = TYPE(sig)) == T_Fixnum || t == T_Bignum) s = Get_Integer(sig); else if (t == T_Symbol) s = Symbols_To_Bits(sig, 0, Signal_Syms); else Wrong_Type_Combination(sig, "symbol or integer"); if (kill(Get_Integer(pid), s) == -1) Raise_System_Error("~E"); #endif return Void; } static Object P_List_Signals() { return Syms_To_List(Signal_Syms); } static Object P_Pause() { #ifndef WIN32 pause(); Fatal_Error("pause() returned unexpectedly"); #endif return Void; } #if defined(HAVE_SIGPROCMASK) || defined(HAVE_SIGBLOCK) static Object Handlers; static Object P_Alarm(Object s) { return Make_Unsigned(alarm(Get_Unsigned(s))); } /*ARGSUSED*/ void General_Handler(int sig) { Object fun, args; #if defined(HAVE_SIGPROCMASK) (void)signal(sig, General_Handler); #endif Set_Error_Tag("signal-handler"); Reset_IO(1); args = Bits_To_Symbols((unsigned long)sig, 0, Signal_Syms); args = Cons(args, Null); fun = VECTOR(Handlers)->data[sig]; if (TYPE(fun) != T_Compound) Fatal_Error("no handler for signal %d", sig); (void)Funcall(fun, args, 0); Format(Curr_Output_Port, "~%\7Signal!~%", 15, 0, (Object *)0); (void)P_Reset(); /*NOTREACHED*/ } static Object Action_To_Sym(void (*act)()) { char *sym; if (act == Signal_Exit) sym = "exit"; else if (act == SIG_IGN) sym = "ignore"; else if (act == SIG_DFL || act == (void (*)())-1) sym = "default"; else sym = "handler"; return Intern(sym); } void Add_To_Mask(int sig) { #ifdef HAVE_SIGPROCMASK sigaddset(&Sigset_Block, sig); #else Sigmask_Block |= sigmask(sig); #endif if (Intr_Level > 0) /* make sure new signal gets blocked */ Force_Disable_Interrupts; } void Remove_From_Mask(int sig) { #ifdef HAVE_SIGPROCMASK sigdelset(&Sigset_Block, sig); #else Sigmask_Block &= ~sigmask(sig); #endif } static Object P_Signal(int argc, Object *argv) { int sig; Object handler, old; void (*disp)(); sig = Symbols_To_Bits(argv[0], 0, Signal_Syms); if (sig >= NSIG) Fatal_Error("signal %d >= NSIG", sig); if (argc == 1) { handler = VECTOR(Handlers)->data[sig]; if (Truep(handler)) return handler; if ((disp = signal(sig, SIG_DFL)) != SIG_DFL) (void)signal(sig, disp); return Action_To_Sym(disp); } switch (sig) { #ifdef SIGBUS case SIGBUS: #endif case SIGFPE: case SIGILL: case SIGINT: case SIGKILL: case SIGSEGV: #ifdef SIGABRT case SIGABRT: #endif Primitive_Error("changing signal ~s not permitted", argv[0]); } handler = argv[1]; if (EQ(handler, Sym_Exit)) { disp = Signal_Exit; } else if (EQ(handler, Sym_Default)) { disp = SIG_DFL; } else if (EQ(handler, Sym_Ignore)) { disp = SIG_IGN; } else if (TYPE(handler) == T_Compound) { if (COMPOUND(handler)->min_args > 1 || COMPOUND(handler)->max_args == 0) Primitive_Error("handler expects wrong number of args"); disp = General_Handler; } else Primitive_Error("invalid handler: ~s", handler); old = VECTOR(Handlers)->data[sig]; VECTOR(Handlers)->data[sig] = (disp == General_Handler) ? handler : False; if (disp == General_Handler) Add_To_Mask(sig); else Remove_From_Mask(sig); if ((disp = signal(sig, disp)) == (void (*)())-1) Raise_System_Error("~E"); return Truep(old) ? old : Action_To_Sym(disp); } #endif /* defined(HAVE_SIGPROCMASK) || defined(HAVE_SIGBLOCK) */ void elk_init_unix_signal() { Define_Symbol(&Sym_Exit, "exit"); Define_Symbol(&Sym_Default, "default"); Define_Symbol(&Sym_Ignore, "ignore"); Def_Prim(P_Kill, "unix-kill", 2, 2, EVAL); Def_Prim(P_List_Signals, "unix-list-signals", 0, 0, EVAL); Def_Prim(P_Pause, "unix-pause", 0, 0, EVAL); #if defined(HAVE_SIGPROCMASK) || defined(HAVE_SIGBLOCK) Def_Prim(P_Alarm, "unix-alarm", 1, 1, EVAL); Handlers = Make_Vector(NSIG, False); Global_GC_Link(Handlers); Def_Prim(P_Signal, "unix-signal", 1, 2, VARARGS); P_Provide(Intern("unix:reliable-signals")); #endif } elk-3.99.8/lib/unix/Makefile.in0000644000175000017500000004561411577103434013135 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = lib/unix DIST_COMMON = $(extensions_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in TODO ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(pkglibdir)" \ "$(DESTDIR)$(extensionsdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) unix_la_DEPENDENCIES = $(top_builddir)/src/libelk.la am__objects_1 = am_unix_la_OBJECTS = error.lo fdescr.lo file.lo lock.lo misc.lo \ passwd.lo process.lo signal.lo system.lo temp.lo time.lo \ unix.lo wait.lo $(am__objects_1) unix_la_OBJECTS = $(am_unix_la_OBJECTS) unix_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(unix_la_LDFLAGS) \ $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/.auto/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(unix_la_SOURCES) DIST_SOURCES = $(unix_la_SOURCES) HEADERS = $(extensions_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ELK_CFLAGS = @ELK_CFLAGS@ ELK_LDFLAGS = @ELK_LDFLAGS@ ELK_LIBS = @ELK_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INCLUDES = @INCLUDES@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOTIF_CFLAGS = @MOTIF_CFLAGS@ MOTIF_LIBS = @MOTIF_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STDINT_HEADER = @STDINT_HEADER@ STRIP = @STRIP@ VERSION = @VERSION@ XAW_CFLAGS = @XAW_CFLAGS@ XAW_LIBS = @XAW_LIBS@ XMKMF = @XMKMF@ XT_CFLAGS = @XT_CFLAGS@ XT_LIBS = @XT_LIBS@ X_CFLAGS = @X_CFLAGS@ X_LIBS = @X_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ NULL = EXTRA_DIST = TODO pkglib_LTLIBRARIES = unix.la unix_la_SOURCES = \ error.c \ fdescr.c \ file.c \ lock.c \ misc.c \ passwd.c \ process.c \ signal.c \ system.c \ temp.c \ time.c \ unix.c \ wait.c \ $(NULL) unix_la_LDFLAGS = -module -avoid-version -no-undefined unix_la_LIBADD = $(top_builddir)/src/libelk.la extensions_HEADERS = unix.h extensionsdir = $(pkgincludedir)/extensions all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign lib/unix/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign lib/unix/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done unix.la: $(unix_la_OBJECTS) $(unix_la_DEPENDENCIES) $(unix_la_LINK) -rpath $(pkglibdir) $(unix_la_OBJECTS) $(unix_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdescr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lock.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/passwd.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/process.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signal.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/system.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/temp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unix.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wait.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-extensionsHEADERS: $(extensions_HEADERS) @$(NORMAL_INSTALL) test -z "$(extensionsdir)" || $(MKDIR_P) "$(DESTDIR)$(extensionsdir)" @list='$(extensions_HEADERS)'; test -n "$(extensionsdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(extensionsdir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(extensionsdir)" || exit $$?; \ done uninstall-extensionsHEADERS: @$(NORMAL_UNINSTALL) @list='$(extensions_HEADERS)'; test -n "$(extensionsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(extensionsdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(extensionsdir)" && rm -f $$files ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(extensionsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-extensionsHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-extensionsHEADERS uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am \ install-extensionsHEADERS install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-pkglibLTLIBRARIES install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-extensionsHEADERS \ uninstall-pkglibLTLIBRARIES echo-sources: ; echo $(SOURCES) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: elk-3.99.8/lib/unix/wait.c0000644000175000017500000001161511577076306012201 00000000000000/* wait.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #ifdef __MACH__ # define _POSIX_SOURCE #endif #include "unix.h" #include #if defined(HAVE_WAITPID) || defined(HAVE_WAIT4) # define WAIT_PROCESS #endif #if defined(HAVE_WAITPID) || defined(HAVE_WAIT3) || defined(HAVE_WAIT4) # define WAIT_OPTIONS #endif #if defined(HAVE_WAIT3) || defined(HAVE_WAIT4) # define WAIT_RUSAGE # include # include #endif #ifdef WAIT_OPTIONS static SYMDESCR Wait_Flags[] = { { "nohang", WNOHANG }, { "untraced", WUNTRACED }, { 0, 0 } }; #endif #ifndef WEXITSTATUS # define WEXITSTATUS(stat) ((int)((stat >> 8) & 0xFF)) #endif #ifndef WTERMSIG # define WTERMSIG(stat) ((int)(stat & 0x7F)) #endif #ifndef WSTOPSIG # define WSTOPSIG(stat) ((int)((stat >> 8) & 0xFF)) #endif #ifndef WIFSIGNALED # define WIFSIGNALED(stat) ((int)(stat & 0x7F)) #endif #ifndef WIFSTOPPED # define WIFSTOPPED(stat) ((int)(stat & 0x7F) == 0x7F) #endif static Object General_Wait(Object ret, Object ruret, int haspid, int pid, int options) { #ifndef WIN32 int retpid, st, code; char *status; #ifdef WAIT_RUSAGE struct rusage ru; Object sec; #endif Object x; GC_Node3; x = Null; Check_Result_Vector(ret, 5); Check_Result_Vector(ruret, 2); if (haspid) { #ifdef HAVE_WAIT4 retpid = wait4(pid, &st, options, &ru); #else #ifdef HAVE_WAITPID retpid = waitpid(pid, &st, options); #endif #endif } else { #ifdef HAVE_WAIT3 retpid = wait3(&st, options, &ru); #else retpid = wait(&st); #endif } if (retpid == -1 && errno != ECHILD) Raise_System_Error("~E"); GC_Link3(ret, ruret, x); x = Make_Integer(retpid); VECTOR(ret)->data[0] = x; if (retpid == 0 || retpid == -1) { status = "none"; st = code = 0; #ifdef WAIT_RUSAGE memset((char *)&ru, 0, sizeof(ru)); #endif } else if (WIFSTOPPED(st)) { status = "stopped"; code = WSTOPSIG(st); } else if (WIFSIGNALED(st)) { status = "signaled"; code = WTERMSIG(st); } else { status = "exited"; code = WEXITSTATUS(st); } x = Intern(status); VECTOR(ret)->data[1] = x; x = Make_Integer(code); VECTOR(ret)->data[2] = x; VECTOR(ret)->data[3] = st & 0200 ? True : False; #ifdef WAIT_RUSAGE x = Cons(Null, Make_Unsigned_Long((unsigned long)ru.ru_utime.tv_usec * 1000)); sec = Make_Unsigned_Long((unsigned long)ru.ru_utime.tv_sec); Car(x) = sec; VECTOR(ruret)->data[0] = x; x = Cons(Null, Make_Unsigned_Long((unsigned long)ru.ru_stime.tv_usec * 1000)); sec = Make_Unsigned_Long((unsigned long)ru.ru_stime.tv_sec); Car(x) = sec; VECTOR(ruret)->data[1] = x; #endif GC_Unlink; #endif return Void; } static Object P_Wait(int argc, Object *argv) { int flags = 0; if (argc == 3) #ifdef WAIT_OPTIONS flags = (int)Symbols_To_Bits(argv[2], 1, Wait_Flags); #else Primitive_Error("wait options not supported"); #endif return General_Wait(argv[0], argv[1], 0, 0, flags); } #ifdef WAIT_PROCESS /* If WAIT_PROCESS is supported, then WAIT_OPTIONS is supported as well, * because both waitpid() and wait4() accept options. */ static Object P_Wait_Process(int argc, Object *argv) { return General_Wait(argv[0], argv[1], 1, Get_Integer(argv[2]), argc == 4 ? (int)Symbols_To_Bits(argv[3], 1, Wait_Flags) : 0); } #endif void elk_init_unix_wait() { Def_Prim(P_Wait, "unix-wait-vector-fill!", 2, 3, VARARGS); #ifdef WAIT_PROCESS Def_Prim(P_Wait_Process, "unix-wait-process-vector-fill!", 3, 4, VARARGS); P_Provide(Intern("unix:wait-process")); #endif #ifdef WAIT_OPTIONS P_Provide(Intern("unix:wait-options")); #endif } elk-3.99.8/lib/unix/unix.h0000644000175000017500000000536311577076306012230 00000000000000/* unix.h * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "config.h" #include #include #include #include #ifdef HAVE_SYS_WAIT_H # include #endif #include #include #ifdef HAVE_UNISTD_H # include #endif #include "scheme.h" extern int errno; extern char *index(); extern Object Unix_Errobj, V_Call_Errhandler; extern SYMDESCR Lseek_Syms[]; Object Integer_Pair (int, int); Object Syms_To_List (SYMDESCR*); extern void Check_Result_Vector (Object, unsigned int); extern int Num_Filedescriptors (); #define Get_Filename_Or_Filedescr(obj,fd,fn) \ switch (TYPE(obj)) {\ case T_String: case T_Symbol:\ (fn) = Get_Strsym(obj); break;\ case T_Fixnum: case T_Bignum:\ (fd) = Get_Integer(obj); break;\ default:\ Wrong_Type_Combination(obj, "symbol, string, or integer");\ } #define Raise_System_Error(msg) {\ Saved_Errno = errno;\ Raise_Error(msg);\ } #define Raise_Error(msg) {\ if (Var_Is_True(V_Call_Errhandler))\ Primitive_Error(msg);\ return Unix_Errobj;\ } #define Raise_System_Error1(msg,a1) {\ Saved_Errno = errno;\ Raise_Error1(msg,a1);\ } #define Raise_Error1(msg,a1) {\ if (Var_Is_True(V_Call_Errhandler))\ Primitive_Error(msg,a1);\ return Unix_Errobj;\ } #define Raise_System_Error2(msg,a1,a2) {\ Saved_Errno = errno;\ Raise_Error2(msg,a1,a2);\ } #define Raise_Error2(msg,a1,a2) {\ if (Var_Is_True(V_Call_Errhandler))\ Primitive_Error(msg,a1,a2);\ return Unix_Errobj;\ } #define Def_Prim Define_Primitive elk-3.99.8/lib/unix/process.c0000644000175000017500000002531011577076306012710 00000000000000/* process.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "unix.h" #include #include #ifdef HAVE_SYS_TIMES_H # include #endif #ifndef WIN32 #if defined(__APPLE__) # include # define environ (* _NSGetEnviron()) #elif defined(__ENVIRON_IN_UNISTD_H) # define environ __environ #elif defined(ENVIRON_IN_UNISTD_H) /* Nothing to do */ #else /* "extern" in front of the next declaration causes the Ultrix 4.2 linker * to fail, but omitting it no longer works with modern C compilers: */ extern char **environ; #endif #if defined(HAVE_ENVIRON) static Object P_Environ() { Object ret, cell, str; char *p, **ep; static char c[2]; GC_Node2; cell = ret = Null; GC_Link2(ret, cell); for (ep = environ; *ep; ep++) { cell = Cons(Null, Null); p = strchr(*ep, '='); if (p) *p++ = 0; else p = c+1; str = Make_String(p, strlen(p)); Cdr(cell) = str; str = Make_String(*ep, strlen(*ep)); Car(cell) = str; ret = Cons(cell, ret); *--p = '='; } GC_Unlink; return P_Reverse(ret); } #endif static Object General_Exec(int argc, Object *argv, int path) { Object fn, args, p, e; char *fnp, **argp, **envp; int i, len; Alloca_Begin; fn = argv[0], args = argv[1]; fnp = Get_Strsym(fn); Check_List(args); len = Fast_Length(args); Alloca(argp, char**, (len+1) * sizeof(char*)); for (i = 0, p = args; i < len; i++, p = Cdr(p)) { e = Car(p); Get_String_Stack(e, argp[i]); } argp[i] = 0; if (argc == 3) { args = argv[2]; Check_List(args); len = Fast_Length(args); Alloca(envp, char**, (len+1) * sizeof(char*)); for (i = 0, p = args; i < len; i++, p = Cdr(p)) { struct S_String *s1, *s2; e = Car(p); Check_Type(e, T_Pair); Check_Type(Car(e), T_String); Check_Type(Cdr(e), T_String); s1 = STRING(Car(e)); s2 = STRING(Cdr(e)); Alloca(envp[i], char*, s1->size + 1 + s2->size + 1); sprintf(envp[i], "%.*s=%.*s", s1->size, s1->data, s2->size, s2->data); } envp[i] = 0; Exit_Handler(); #if 0 if (path) (void)execvpe(fnp, argp, envp); /* ... doesn't exist */ else #endif (void)execve(fnp, argp, envp); } else { Exit_Handler(); if (path) (void)execvp(fnp, argp); else (void)execv(fnp, argp); } Alloca_End; Raise_System_Error1("~s: ~E", fn); } static Object P_Exec(int argc, Object *argv) { return General_Exec(argc, argv, 0); } static Object P_Exec_Path(int argc, Object *argv) { if (argc == 3) /* There is no execvpe (yet?). */ Primitive_Error("environment argument not supported"); return General_Exec(argc, argv, 1); } static Object P_Fork() { int pid; switch (pid = fork()) { case -1: Raise_System_Error("~E"); case 0: Call_Onfork(); } return Make_Integer(pid); } static Object P_Getenv(Object e) { extern char *getenv(); char *s; return (s = getenv(Get_String(e))) ? Make_String(s, strlen(s)) : False; } static Object P_Getlogin() { extern char *getlogin(); char *s; Disable_Interrupts; s = getlogin(); Enable_Interrupts; if (s == 0) Raise_Error("cannot get login name"); return Make_String(s, strlen(s)); } static Object P_Getgids() { return Integer_Pair(getgid(), getegid()); } static Object P_Getpids() { return Integer_Pair(getpid(), getppid()); } static Object P_Getuids() { return Integer_Pair(getuid(), geteuid()); } static Object P_Getgroups() { int i, n; GETGROUPS_TYPE *p; Object ret, next; Alloca_Begin; GC_Node2; /* gcc may complain under SunOS 4.x, because the prototype says * that the type of the 2nd argument is unsigned short*, not int. * But int is right. */ if ((n = getgroups(0, (GETGROUPS_TYPE *)0)) == -1) #ifdef NGROUPS n = NGROUPS; /* 4.3BSD */ #else Raise_System_Error("~E"); #endif Alloca(p, GETGROUPS_TYPE*, n*sizeof(GETGROUPS_TYPE)); (void)getgroups(n, p); next = ret = P_Make_List(Make_Integer(n), Null); GC_Link2(ret, next); for (i = 0; i < n; i++, next = Cdr(next)) { Object x; x = Make_Unsigned((unsigned)p[i]); Car(next) = x; } GC_Unlink; Alloca_End; return ret; } static Object P_Nice(Object incr) { int ret; errno = 0; if ((ret = nice(Get_Integer(incr))) == -1 && errno != 0) Raise_System_Error("~E"); return Make_Integer(ret); } static Object Open_Pipe(Object cmd, int flags) { FILE *fp; Object ret; Disable_Interrupts; if ((fp = popen(Get_String(cmd), flags == P_INPUT ? "r" : "w")) == 0) { Enable_Interrupts; Raise_Error("cannot open pipe to process"); } ret = Make_Port(flags, fp, Make_String("pipe-port", 9)); PORT(ret)->closefun = pclose; Register_Object(ret, (GENERIC)0, Terminate_File, 0); Enable_Interrupts; return ret; } static Object P_Open_Input_Pipe(Object cmd) { return Open_Pipe(cmd, P_INPUT); } static Object P_Open_Output_Pipe(Object cmd) { return Open_Pipe(cmd, 0); } static Object P_Process_Resources(Object ret1, Object ret2) { static int hzval; struct tms tms; Object x; GC_Node2; if (hzval == 0) { #ifdef HZ hzval = HZ; #else #ifdef CLK_TCK hzval = CLK_TCK; #else #ifdef _SC_CLK_TCK hzval = (int)sysconf(_SC_CLK_TCK); #else hzval = 60; /* Fallback for 4.3BSD. I don't have a better idea. */ #endif #endif #endif } Check_Result_Vector(ret1, 2); Check_Result_Vector(ret2, 2); (void)times(&tms); GC_Link2(ret1, ret2); x = Make_Unsigned_Long((unsigned long)tms.tms_utime); VECTOR(ret1)->data[0] = x; x = Make_Unsigned_Long((unsigned long)tms.tms_stime); VECTOR(ret1)->data[1] = x; x = Make_Unsigned_Long((unsigned long)tms.tms_cutime); VECTOR(ret2)->data[0] = x; x = Make_Unsigned_Long((unsigned long)tms.tms_cstime); VECTOR(ret2)->data[1] = x; GC_Unlink; return Make_Integer(hzval); } static Object P_Sleep(Object s) { (void)sleep(Get_Unsigned(s)); return Void; } static Object P_System(Object cmd) { int n, pid, status; char *s = Get_String(cmd); #ifdef HAVE_VFORK switch (pid = vfork()) { #else switch (pid = fork()) { #endif case -1: Raise_System_Error("fork: ~E"); case 0: for (n = Num_Filedescriptors(); n >= 3; n--) (void)close(n); execl("/bin/sh", "sh", "-c", s, (char *)0); _exit(127); default: Disable_Interrupts; while ((n = wait(&status)) != pid && n != -1) ; Enable_Interrupts; } /* Can this happen? if (n == -1) return False; */ n = status & 0377; if (n) return Cons(Make_Integer(n), Null); return Make_Integer((status >> 8) & 0377); } static Object P_Umask(Object mask) { return Make_Integer(umask(Get_Integer(mask))); } static Object P_Working_Directory() { char *buf; int max = Path_Max()+2; /* getcwd() needs two extra bytes */ Object ret; #if !defined(HAVE_GETCWD) && !defined(HAVE_GETWD) FILE *fp; char *p; #endif Alloca_Begin; Alloca(buf, char*, max); Disable_Interrupts; #ifdef HAVE_GETCWD if (getcwd(buf, max) == 0) { Saved_Errno = errno; Alloca_End; Enable_Interrupts; Raise_System_Error("~E"); } #else #ifdef HAVE_GETWD if (getwd(buf) == 0) { Alloca_End; Enable_Interrupts; Raise_Error(buf); } #else if ((fp = popen("pwd", "r")) == 0) { err: Alloca_End; Enable_Interrupts; Raise_Error("cannot get output from pwd"); } if (fgets(buf, max, fp) == 0) goto err; if (p = strchr(buf, '\n')) *p = '\0'; (void)pclose(fp); #endif #endif Enable_Interrupts; ret = Make_String(buf, strlen(buf)); Alloca_End; return ret; } void elk_init_unix_process() { #if defined(HAVE_ENVIRON) Def_Prim(P_Environ, "unix-environ", 0, 0, EVAL); #endif Def_Prim(P_Exec, "unix-exec", 2, 3, VARARGS); Def_Prim(P_Exec_Path, "unix-exec-path", 2, 3, VARARGS); Def_Prim(P_Fork, "unix-fork", 0, 0, EVAL); Def_Prim(P_Getenv, "unix-getenv", 1, 1, EVAL); Def_Prim(P_Getlogin, "unix-getlogin", 0, 0, EVAL); Def_Prim(P_Getgids, "unix-getgids", 0, 0, EVAL); Def_Prim(P_Getpids, "unix-getpids", 0, 0, EVAL); Def_Prim(P_Getuids, "unix-getuids", 0, 0, EVAL); Def_Prim(P_Getgroups, "unix-getgroups", 0, 0, EVAL); Def_Prim(P_Nice, "unix-nice", 1, 1, EVAL); Def_Prim(P_Open_Input_Pipe, "unix-open-input-pipe", 1, 1, EVAL); Def_Prim(P_Open_Output_Pipe, "unix-open-output-pipe", 1, 1, EVAL); Def_Prim(P_Process_Resources, "unix-process-resources-vector-fill!", 2, 2, EVAL); Def_Prim(P_Sleep, "unix-sleep", 1, 1, EVAL); Def_Prim(P_System, "unix-system", 1, 1, EVAL); Def_Prim(P_Umask, "unix-umask", 1, 1, EVAL); Def_Prim(P_Working_Directory, "unix-working-directory", 0, 0, EVAL); } #endif elk-3.99.8/lib/unix/error.c0000644000175000017500000000665311577076306012374 00000000000000/* error.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "unix.h" /* We can't know which error codes exist on a given platform. The * following are the POSIX codes plus a few more that are available * almost everywhere. * Unfortunately, "(unix-errno)" has to return other error codes as * plain integers; they have to be dealt with in Scheme. */ static SYMDESCR Errno_Syms[] = { { "e2big", E2BIG}, { "eacces", EACCES}, { "eagain", EAGAIN}, { "ebadf", EBADF}, { "ebusy", EBUSY}, { "echild", ECHILD}, #ifdef EDEADLK { "edeadlk", EDEADLK}, #endif { "edom", EDOM}, { "eexist", EEXIST}, { "efault", EFAULT}, { "efbig", EFBIG}, { "eintr", EINTR}, { "einval", EINVAL}, { "eio", EIO}, { "eisdir", EISDIR}, { "emfile", EMFILE}, { "emlink", EMLINK}, { "enametoolong", ENAMETOOLONG}, { "enfile", ENFILE}, { "enodev", ENODEV}, { "enoent", ENOENT}, { "enoexec", ENOEXEC}, #ifdef ENOLCK { "enolck", ENOLCK}, #endif { "enomem", ENOMEM}, { "enospc", ENOSPC}, #ifdef ENOSYS { "enosys", ENOSYS}, #endif { "enotdir", ENOTDIR}, { "enotempty", ENOTEMPTY}, { "enotty", ENOTTY}, { "enxio", ENXIO}, { "eperm", EPERM}, { "epipe", EPIPE}, { "erange", ERANGE}, { "erofs", EROFS}, { "espipe", ESPIPE}, { "esrch", ESRCH}, { "exdev", EXDEV}, #ifdef EWOULDBLOCK { "ewouldblock", EWOULDBLOCK }, #endif #ifdef ELOOP { "eloop", ELOOP }, #endif #ifdef EDQUOT { "edquot", EDQUOT }, #endif { 0, 0 } }; Object Unix_Errobj, V_Call_Errhandler; static Object P_Errorp(Object x) { return EQ(x, Unix_Errobj) ? True : False; } static Object P_Errno() { Object sym; sym = Bits_To_Symbols(Saved_Errno, 0, Errno_Syms); return Nullp(sym) ? Make_Integer(Saved_Errno) : sym; } void elk_init_unix_error() { Unix_Errobj = Intern("*unix-error-object*"); Unix_Errobj = Const_Cons(Unix_Errobj, Null); Global_GC_Link(Unix_Errobj); Define_Variable(&V_Call_Errhandler, "unix-call-standard-error-handler?", True); Def_Prim(P_Errorp, "unix-error?", 1, 1, EVAL); Def_Prim(P_Errno, "unix-errno", 0, 0, EVAL); } elk-3.99.8/lib/unix/system.c0000644000175000017500000001210311577076306012552 00000000000000/* system.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "unix.h" #include #if defined(HAVE_UNAME) && !defined(HAVE_GETHOSTNAME) # include #endif #ifdef HAVE_NETDB_H # include #endif #define L_LINK_MAX 0 #define L_NAME_MAX 1 #define L_PATH_MAX 2 #define L_PIPE_BUF 3 #define L_NO_TRUNC 4 static SYMDESCR Limit_Syms[] = { { "max-links", L_LINK_MAX }, { "max-name", L_NAME_MAX }, { "max-path", L_PATH_MAX }, { "pipe-buf", L_PIPE_BUF }, { "no-trunc", L_NO_TRUNC }, { 0, 0 } }; static Object P_File_Limit(Object lim, Object f) { int op = 0, fd = -1; long ret; char *fn = 0; switch (Symbols_To_Bits(lim, 0, Limit_Syms)) { case L_LINK_MAX: #ifdef LINK_MAX return Make_Integer(LINK_MAX); #else #ifdef _PC_LINK_MAX op = _PC_LINK_MAX; # define HAVEOP #else return Make_Integer(sizeof(short) * 8); /* guess */ #endif #endif break; case L_NAME_MAX: #ifdef NAME_MAX return Make_Integer(NAME_MAX); #else #ifdef _PC_NAME_MAX op = _PC_NAME_MAX; # define HAVEOP #else return Make_Integer(255); /* guess */ #endif #endif break; case L_PATH_MAX: #ifdef MAX_PATH return Make_Integer(MAX_PATH); #else #ifdef _PC_PATH_MAX op = _PC_PATH_MAX; # define HAVEOP #else #ifdef MAXPATHLEN return Make_Integer(MAXPATHLEN); #else return Make_Integer(1024); /* guess */ #endif #endif #endif break; case L_PIPE_BUF: #ifdef PIPE_BUF return Make_Integer(PIPE_BUF); #else #ifdef _PC_PIPE_BUF op = _PC_PIPE_BUF; # define HAVEOP #else return Make_Integer(512); /* guess */ #endif #endif break; case L_NO_TRUNC: #ifdef _PC_NO_TRUNC op = _PC_NO_TRUNC; # define HAVEOP #else return False; /* guess */ #endif break; } #ifdef HAVEOP /* If we get here, we have a _PC_XXX symbol in `op' and can invoke * either pathconf() or fpathconf(). */ Get_Filename_Or_Filedescr(f, fd, fn); errno = 0; ret = fn ? pathconf(fn, op) : fpathconf(fd, op); if (ret == -1) { #ifdef _PC_NO_TRUNC if (op == _PC_NO_TRUNC && errno == 0) return False; #endif Raise_System_Error1("~s: ~E", f); } #ifdef _PC_NO_TRUNC if (op == _PC_NO_TRUNC) return ret ? True : False; else #endif return Make_Long(ret); #endif } static Object P_List_File_Limits() { return Syms_To_List(Limit_Syms); } static Object P_Job_Controlp() { #ifdef _POSIX_JOB_CONTROL return True; #else #ifdef _SC_JOB_CONTROL return sysconf(_SC_JOB_CONTROL) == 1 ? True : False; #else #ifdef SIGTSTP return True; #else return False; #endif #endif #endif } static Object P_System_Info(Object ret) { #ifdef HAVE_GETHOSTNAME char hostname[MAXHOSTNAMELEN]; char *p = hostname; #else #ifdef HAVE_UNAME struct utsname uts; char *p = uts.nodename; #else char *p = "unknown-hostname"; #endif #endif char systype[64], *q; Object x; GC_Node; Check_Result_Vector(ret, 3); #ifdef HAVE_GETHOSTNAME (void)gethostname(hostname, sizeof(hostname)); #else #ifdef HAVE_UNAME (void)uname(&uts); #endif #endif GC_Link(ret); x = Make_String(p, strlen(p)); VECTOR(ret)->data[0] = x; strcpy(systype, SYSTEMTYPE); if ((p = strchr(systype, '-')) && (q = strchr(p+1, '-'))) { *p++ = 0; *q = 0; } else p = "?"; x = Make_String(systype, strlen(systype)); VECTOR(ret)->data[1] = x; x = Make_String(p, strlen(p)); VECTOR(ret)->data[2] = x; return Void; } void elk_init_unix_system() { Def_Prim(P_File_Limit, "unix-file-limit", 2, 2, EVAL); Def_Prim(P_List_File_Limits, "unix-list-file-limits", 0, 0, EVAL); Def_Prim(P_Job_Controlp, "unix-job-control?", 0, 0, EVAL); Def_Prim(P_System_Info, "unix-system-info-vector-fill!", 1, 1, EVAL); } elk-3.99.8/lib/unix/temp.c0000644000175000017500000000650611577076306012205 00000000000000/* temp.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "unix.h" #include #ifdef HAVE_TEMPNAM /* Make sure only one of these is defined (if any) */ # undef HAVE_TMPNAM /* Order of preference: tempnam, mktemp, tmpnam */ # undef HAVE_MKTEMP #endif #ifdef HAVE_MKTEMP # undef HAVE_TMPNAM # undef HAVE_TEMPNAM #endif #ifdef HAVE_TMPNAM # undef HAVE_TEMPNAM # undef HAVE_MKTEMP #endif static Object P_Tempname(int argc, Object *argv) { char *name, *dir = 0, *pref = 0; Object ret; #ifdef HAVE_TMPNAM extern char *tmpnam(); #else #ifdef HAVE_TEMPNAM extern char *tempnam(); #else char buf[1024]; #ifdef HAVE_MKTEMP extern char *mktemp(); #else char *p, *q; struct stat st; #endif #endif #endif if (argc > 0) dir = Get_Strsym(argv[0]); if (argc > 1) pref = Get_Strsym(argv[1]); #ifdef HAVE_TMPNAM name = tmpnam((char *)0); #else #ifdef HAVE_TEMPNAM Disable_Interrupts; /* Make sure result gets freed */ name = tempnam(dir, pref); #else if (!dir) dir = "/tmp"; if (!pref) pref = "elk"; if (strlen(dir) + strlen(pref) > 1000) Primitive_Error("directory/prefix argument too long"); #ifdef HAVE_MKTEMP sprintf(buf, "%s/%sXXXXXX", dir, pref); name = mktemp(buf); #else name = 0; sprintf(buf, "%s/%sa%d", dir, pref, getpid()); p = buf+strlen(dir)+strlen(pref)+1; while (stat(buf, &st) == 0) { /* Simple ersatz mktemp */ q = p; while (1) { if (*q == '\0') goto fail; if (*q == 'z') { *q++ = 'a'; } else { if (*q >= '0' && *q <= '9') *q = 'a'; else *++q; break; } } } if (errno == ENOENT) name = buf; fail: ; #endif #endif #endif if (name == 0 || name[0] == '\0') { Enable_Interrupts; Raise_Error("cannot create temp file name"); } ret = Make_String(name, strlen(name)); #ifdef HAVE_TEMPNAM free(name); Enable_Interrupts; #endif return ret; } void elk_init_unix_temp() { Def_Prim(P_Tempname, "unix-tempname", 0, 2, VARARGS); } elk-3.99.8/lib/unix/misc.c0000644000175000017500000000322211577076306012163 00000000000000/* misc.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "unix.h" #include #ifndef WIN32 static Object P_Getpass(Object prompt) { char *ret; extern char *getpass(); Disable_Interrupts; ret = getpass(Get_String(prompt)); Enable_Interrupts; if (ret == 0) Raise_Error("cannot read password from /dev/tty"); return Make_String(ret, strlen(ret)); } void elk_init_unix_misc() { Def_Prim(P_Getpass, "unix-getpass", 1, 1, EVAL); } #endif elk-3.99.8/lib/unix/TODO0000644000175000017500000000027111577076306011555 00000000000000termio stdio (setbuf, fseek, ...) signals: handlers that may return (to be invoked in Funcall?) support for systems with "union wait" (vanilla BSD, Mach, ...) sysconf: NGROUP_MAX, etc. elk-3.99.8/lib/unix/passwd.c0000644000175000017500000001206511577076306012536 00000000000000/* passwd.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "unix.h" #include #ifdef HAVE_PWD_H # include #endif #ifdef HAVE_GRP_H # include #endif static Object P_Get_Passwd(int argc, Object *argv) { #ifndef WIN32 struct passwd *p; Object arg, x; Check_Result_Vector(argv[0], 7); Disable_Interrupts; if (argc == 1) { if ((p = getpwent()) == 0) { Enable_Interrupts; Raise_Error("no more passwd entries"); } } else { arg = argv[1]; switch (TYPE(arg)) { case T_Fixnum: case T_Bignum: p = getpwuid(Get_Integer(arg)); break; case T_String: case T_Symbol: p = getpwnam(Get_String(arg)); break; default: Wrong_Type_Combination(arg, "integer, string, or symbol"); } if (p == 0) { Enable_Interrupts; Raise_Error1("no passwd entry for ~s", arg); } } Enable_Interrupts; x = Make_String(p->pw_name, strlen(p->pw_name)); VECTOR(argv[0])->data[0] = x; x = Make_String(p->pw_passwd, strlen(p->pw_passwd)); VECTOR(argv[0])->data[1] = x; x = Make_Integer(p->pw_uid); VECTOR(argv[0])->data[2] = x; x = Make_Integer(p->pw_gid); VECTOR(argv[0])->data[3] = x; x = Make_String(p->pw_gecos, strlen(p->pw_gecos)); VECTOR(argv[0])->data[4] = x; x = Make_String(p->pw_dir, strlen(p->pw_dir)); VECTOR(argv[0])->data[5] = x; x = Make_String(p->pw_shell, strlen(p->pw_shell)); VECTOR(argv[0])->data[6] = x; #endif return Void; } static Object P_Rewind_Passwd() { #ifndef WIN32 Disable_Interrupts; setpwent(); Enable_Interrupts; #endif return Void; } static Object P_End_Passwd() { #ifndef WIN32 Disable_Interrupts; endpwent(); Enable_Interrupts; #endif return Void; } static Object P_Get_Group(int argc, Object *argv) { #ifndef WIN32 char **pp; struct group *p; Object arg, member, x; GC_Node; Check_Result_Vector(argv[0], 4); Disable_Interrupts; if (argc == 1) { if ((p = getgrent()) == 0) { Enable_Interrupts; Raise_Error("no more group entries"); } } else { arg = argv[1]; switch (TYPE(arg)) { case T_Fixnum: case T_Bignum: p = getgrgid(Get_Integer(arg)); break; case T_String: case T_Symbol: p = getgrnam(Get_String(arg)); break; default: Wrong_Type_Combination(arg, "integer, string, or symbol"); } if (p == 0) { Enable_Interrupts; Raise_Error1("no group entry for ~s", arg); } } Enable_Interrupts; x = Make_String(p->gr_name, strlen(p->gr_name)); VECTOR(argv[0])->data[0] = x; x = Make_String(p->gr_passwd, strlen(p->gr_passwd)); VECTOR(argv[0])->data[1] = x; x = Make_Integer(p->gr_gid); VECTOR(argv[0])->data[2] = x; x = Null; GC_Link(x); for (pp = p->gr_mem; *pp; pp++) { member = Intern(*pp); x = Cons(member, x); } x = P_Reverse(x); GC_Unlink; VECTOR(argv[0])->data[3] = x; #endif return Void; } static Object P_Rewind_Group() { #ifndef WIN32 Disable_Interrupts; setgrent(); Enable_Interrupts; #endif return Void; } static Object P_End_Group() { #ifndef WIN32 Disable_Interrupts; endgrent(); Enable_Interrupts; #endif return Void; } void elk_init_unix_passwd() { Def_Prim(P_Get_Passwd, "unix-get-passwd-vector-fill!", 1, 2, VARARGS); Def_Prim(P_Rewind_Passwd, "unix-rewind-passwd", 0, 0, EVAL); Def_Prim(P_End_Passwd, "unix-end-passwd", 0, 0, EVAL); Def_Prim(P_Get_Group, "unix-get-group-vector-fill!", 1, 2, VARARGS); Def_Prim(P_Rewind_Group, "unix-rewind-group", 0, 0, EVAL); Def_Prim(P_End_Group, "unix-end-group", 0, 0, EVAL); } elk-3.99.8/lib/unix/lock.c0000644000175000017500000000704211577076306012164 00000000000000/* lock.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "unix.h" #include #ifdef F_SETLK # define LOCKS # define RECORD_LOCKS #else #ifdef LOCK_SH # define LOCKS #endif #endif #ifdef LOCKS static Object P_Internal_Lock_Operation(Object fd, Object lck, Object block, Object what, Object ret) { #ifdef RECORD_LOCKS struct flock fl; #else int mode; #endif int op; Object *vp; Check_Result_Vector(lck, 4); Check_Type(what, T_Character); op = CHAR(what); if (op == 'q') Check_Result_Vector(ret, 4); #ifdef RECORD_LOCKS Check_Type(block, T_Boolean); vp = VECTOR(lck)->data; Check_Type(*vp, T_Boolean); fl.l_type = op == 'r' ? F_UNLCK : (Truep(*vp) ? F_WRLCK : F_RDLCK); fl.l_whence = (short)Symbols_To_Bits(*++vp, 0, Lseek_Syms); fl.l_start = Get_Long(*++vp); fl.l_len = Get_Long(*++vp); if (fcntl(Get_Integer(fd), op == 'q' ? F_GETLK : (Truep(block) ? F_SETLKW : F_SETLK), &fl) == -1) { if (op == 's' && !Truep(block) && (errno == EAGAIN || errno == EACCES)) return False; Raise_System_Error("fcntl: ~E"); } if (op == 'q') { Object x; GC_Node; if (fl.l_type == F_UNLCK) return False; GC_Link(ret); VECTOR(ret)->data[0] = fl.l_type == F_WRLCK ? True : False; x = Bits_To_Symbols((unsigned long)fl.l_whence, 0, Lseek_Syms); VECTOR(ret)->data[1] = x; x = Make_Long(fl.l_start); VECTOR(ret)->data[2] = x; x = Make_Long(fl.l_len); VECTOR(ret)->data[3] = x; GC_Unlink; return Make_Integer(fl.l_pid); } #else Check_Type(block, T_Boolean); if (op == 'q') return False; vp = VECTOR(lck)->data; Check_Type(*vp, T_Boolean); mode = op == 'r' ? LOCK_UN : (Truep(*vp) ? LOCK_EX : LOCK_SH); if (op != 'r' && !Truep(block)) mode |= LOCK_NB; if (flock(Get_Integer(fd), mode) == -1) { if (op == 's' && !Truep(block) && errno == EWOULDBLOCK) return False; Raise_System_Error("flock: ~E"); } #endif return op == 's' ? True : Void; } #endif void elk_init_unix_lock() { #ifdef LOCKS Def_Prim(P_Internal_Lock_Operation, "unix-internal-lock-operation", 5, 5, EVAL); P_Provide(Intern("unix:file-locking")); #ifdef RECORD_LOCKS P_Provide(Intern("unix:record-locks")); #endif #endif } elk-3.99.8/lib/unix/time.c0000644000175000017500000001215611577076306012174 00000000000000/* time.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "unix.h" #include #if !defined(HAVE_GETTIMEOFDAY) && defined(HAVE_FTIME) # include #endif #ifdef HAVE_GETTIMEOFDAY # include #endif extern time_t time(); static Object P_Decode_Time(Object t, Object ret, Object utc) { time_t tt; struct tm *tp; Object *op; Check_Result_Vector(ret, 9); Check_Type(utc, T_Boolean); tt = (time_t)Get_Unsigned_Long(t); tp = Truep(utc) ? gmtime(&tt) : localtime(&tt); op = VECTOR(ret)->data; *op++ = Make_Integer(tp->tm_sec); *op++ = Make_Integer(tp->tm_min); *op++ = Make_Integer(tp->tm_hour); *op++ = Make_Integer(tp->tm_mday); *op++ = Make_Integer(tp->tm_mon); *op++ = Make_Integer(tp->tm_year); *op++ = Make_Integer(tp->tm_wday); *op++ = Make_Integer(tp->tm_yday); *op++ = Make_Integer(tp->tm_isdst); return Void; } static Object P_Nanotime(Object ret) { Object x, y; #ifdef HAVE_GETTIMEOFDAY struct timeval tv; struct timezone tz; #else #ifdef HAVE_FTIME struct timeb tb; #else time_t now; int i; #endif #endif GC_Node2; x = Null; Check_Result_Vector(ret, 3); GC_Link2(ret, x); #ifdef HAVE_GETTIMEOFDAY (void)gettimeofday(&tv, &tz); x = Cons(Null, Make_Unsigned_Long((unsigned long)tv.tv_usec * 1000)); y = Make_Unsigned_Long((unsigned long)tv.tv_sec); Car(x) = y; VECTOR(ret)->data[0] = x; VECTOR(ret)->data[1] = Make_Integer(tz.tz_minuteswest); VECTOR(ret)->data[2] = Make_Integer(tz.tz_dsttime); #else #ifdef HAVE_FTIME (void)ftime(&tb); x = Cons(Null, Make_Unsigned_Long((unsigned long)tb.millitm * 1000000)); y = Make_Unsigned_Long((unsigned long)tb.time); Car(x) = y; VECTOR(ret)->data[0] = x; VECTOR(ret)->data[1] = Make_Integer(tb.timezone); VECTOR(ret)->data[2] = Make_Integer(tb.dstflag); #else (void)time(&now); x = Cons(Make_Unsigned_Long((unsigned long)now), Make_Integer(0)); VECTOR(ret)->data[0] = x; VECTOR(ret)->data[1] = Make_Integer(0); VECTOR(ret)->data[2] = Make_Integer(0); #endif #endif GC_Unlink; return Void; } static Object P_Time() { time_t t = time((time_t *)0); return Make_Unsigned_Long((unsigned long)t); } static struct tm *Get_Tm(Object v) { static struct tm tm; int i, n; Object *op; static struct { int min, max; } bounds[] = { { 0, 61 }, /* sec */ { 0, 59 }, /* min */ { 0, 23 }, /* hour */ { 1, 31 }, /* mday */ { 0, 11 }, /* mon */ { 0, 65535 }, /* year */ { 0, 7 }, /* wday */ { 0, 365 } /* yday */ }; Check_Result_Vector(v, 9); for (op = VECTOR(v)->data, i = 0; i < 7; i++, op++) if ((n = Get_Integer(*op)) < bounds[i].min || n > bounds[i].max) Range_Error(*op); op = VECTOR(v)->data; tm.tm_sec = Get_Integer(*op++); tm.tm_min = Get_Integer(*op++); tm.tm_hour = Get_Integer(*op++); tm.tm_mday = Get_Integer(*op++); tm.tm_mon = Get_Integer(*op++); tm.tm_year = Get_Integer(*op++); tm.tm_wday = Get_Integer(*op++); tm.tm_yday = Get_Integer(*op++); tm.tm_isdst = Get_Integer(*op); return &tm; } static Object P_Time_To_String(Object t) { time_t tt; char *ret; switch (TYPE(t)) { case T_Fixnum: case T_Bignum: tt = (time_t)Get_Unsigned_Long(t); ret = ctime(&tt); break; case T_Vector: ret = asctime(Get_Tm(t)); break; default: Wrong_Type_Combination(t, "integer or vector"); /*NOTREACHED*/ } return Make_String(ret, strlen(ret)); } void elk_init_unix_time() { Def_Prim(P_Time, "unix-time", 0, 0, EVAL); Def_Prim(P_Decode_Time, "unix-decode-time-vector-fill!", 3, 3, EVAL); Def_Prim(P_Time_To_String, "unix-time->string-internal", 1, 1, EVAL); Def_Prim(P_Nanotime, "unix-nanotime-vector-fill!", 1, 1, EVAL); } elk-3.99.8/lib/unix/Makefile.am0000644000175000017500000000066611577076306013131 00000000000000NULL = EXTRA_DIST = TODO pkglib_LTLIBRARIES = unix.la unix_la_SOURCES = \ error.c \ fdescr.c \ file.c \ lock.c \ misc.c \ passwd.c \ process.c \ signal.c \ system.c \ temp.c \ time.c \ unix.c \ wait.c \ $(NULL) unix_la_LDFLAGS = -module -avoid-version -no-undefined unix_la_LIBADD = $(top_builddir)/src/libelk.la extensions_HEADERS = unix.h extensionsdir = $(pkgincludedir)/extensions echo-sources: ; echo $(SOURCES) elk-3.99.8/lib/unix/unix.c0000644000175000017500000000362711577076306012224 00000000000000/* unix.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "unix.h" Object Integer_Pair(int a, int b) { Object x, y; GC_Node2; x = y = Null; GC_Link2(x, y); x = Make_Integer(a); y = Make_Integer(b); x = Cons(x, y); GC_Unlink; return x; } Object Syms_To_List(SYMDESCR *p) { Object ret, mode; GC_Node; ret = Null; GC_Link(ret); for ( ; p->name; p++) { mode = Intern(p->name); ret = Cons(mode, ret); } GC_Unlink; return P_Reverse(ret); } void Check_Result_Vector(Object x, unsigned int len) { Check_Type(x, T_Vector); if (VECTOR(x)->size != len) Primitive_Error("argument vector has the wrong length"); } void elk_init_unix_unix() { P_Provide(Intern("unix.la")); } elk-3.99.8/lib/xwidgets/0000755000175000017500000000000011577110017012004 500000000000000elk-3.99.8/lib/xwidgets/MISSING0000644000175000017500000000221211577076306012771 00000000000000Subresources cannot be read by means of get-values. Callbacks *must* return; e.g. a (reset) from within a callback is not allowed. This is a bug in Xt. Xt doesn't notice when ports that have been registered as input source with context-add-input are closed. In this case, the select() fails. error.c: Warning msg handler is now part of application context Missing: keycode translators case converters shared graphics contexts selections 2. XtScreen XtDisplayOfObject XtScreenOfObject XtWindowOfObject 7. XtAddGrab XtRemoveGrab XtGrabKey XtUngrabKey XtGrabKeyboard XtUngrabKeyboard XtGrabButton XtUngrabButton XtGrabPointer XtUngrabPointer XtSetKeyboardFocus XtCallAcceptFocus XtAppPending XtAppPeekEvent, XtAppNextEvent, XtAppProcessEvent, XtDispatchEvent (?) Xt{Add,Remove,Insert}EventHandler (?) Xt{Add,Remove,Insert}RawEventHandler (?) XtBuildEventMask (?) 9. XtGetSubresources (?) XtGetApplicationResources XtGetSubvalues, XtSetSubvalues (?) 10. XtAppAddActionHook (?) XtRemoveActionHook (?) 11. XtAppSetSelectionTimeout XtAppGetSelectionTimeout XtSetWMColormapWindows elk-3.99.8/lib/xwidgets/action.c0000644000175000017500000000633511577076306013370 00000000000000/* action.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "xt.h" typedef struct action { char *name; int num; XtAppContext con; struct action *next; } ACTION; ACTION *actions; /*ARGSUSED*/ static void Dummy_Action (Widget w, XEvent *ep, String *argv, int *argc) { } void Action_Hook (Widget w, XtPointer client_data, char *name, XEvent *ep, char **argv, int *argc) { ACTION *ap; Object args, params, tail; register int i; GC_Node3; for (ap = actions; ap; ap = ap->next) { if (strcmp (ap->name, name)) continue; args = params = tail = Null; GC_Link3 (args, params, tail); params = P_Make_List (Make_Integer (*argc), Null); for (i = 0, tail = params; i < *argc; tail = Cdr (tail), i++) { Object tmp; tmp = Make_String (argv[i], strlen (argv[i])); Car (tail) = tmp; } args = Cons (params, Null); params = Get_Event_Args (ep); args = Cons (Copy_List (params), args); Destroy_Event_Args (params); args = Cons (Make_Widget_Foreign (w), args); (void)Funcall (Get_Function (ap->num), args, 0); GC_Unlink; } } static Object P_Context_Add_Action (Object c, Object s, Object p) { ACTION *ap; XtActionsRec a; Check_Context (c); Check_Procedure (p); ap = (ACTION *)XtMalloc (sizeof (ACTION)); ap->num = Register_Function (p); ap->name = XtNewString (Get_Strsym (s)); ap->con = CONTEXT(c)->context; ap->next = actions; actions = ap; a.string = ap->name; a.proc = (XtActionProc)Dummy_Action; XtAppAddActions (ap->con, &a, 1); return Void; } void Free_Actions (XtAppContext con) { register ACTION *p, **pp; for (pp = &actions; (p = *pp); ) { if (p->con == con) { Deregister_Function (p->num); XtFree (p->name); *pp = p->next; XtFree ((char *)p); } else pp = &p->next; } } void elk_init_xt_action () { Define_Primitive (P_Context_Add_Action, "context-add-action", 3, 3, EVAL); } elk-3.99.8/lib/xwidgets/Makefile.in0000644000175000017500000012136311577103434014004 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = lib/xwidgets DIST_COMMON = $(extensions_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(extensionsdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libelk_xt_la_DEPENDENCIES = $(top_builddir)/src/libelk.la \ ../xlib/libelk-xlib.la am__objects_1 = am__objects_2 = libelk_xt_la-accelerator.lo libelk_xt_la-action.lo \ libelk_xt_la-callback.lo libelk_xt_la-class.lo \ libelk_xt_la-classname.lo libelk_xt_la-context.lo \ libelk_xt_la-converter.lo libelk_xt_la-error.lo \ libelk_xt_la-function.lo libelk_xt_la-identifier.lo \ libelk_xt_la-init.lo libelk_xt_la-objects.lo \ libelk_xt_la-popup.lo libelk_xt_la-resource.lo \ libelk_xt_la-translation.lo libelk_xt_la-widget.lo \ $(am__objects_1) am_libelk_xt_la_OBJECTS = $(am__objects_2) libelk_xt_la_OBJECTS = $(am_libelk_xt_la_OBJECTS) libelk_xt_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libelk_xt_la_CFLAGS) \ $(CFLAGS) $(libelk_xt_la_LDFLAGS) $(LDFLAGS) -o $@ @HAVE_XT_TRUE@am_libelk_xt_la_rpath = -rpath $(libdir) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/.auto/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libelk_xt_la_SOURCES) DIST_SOURCES = $(libelk_xt_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive HEADERS = $(extensions_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ELK_CFLAGS = @ELK_CFLAGS@ ELK_LDFLAGS = @ELK_LDFLAGS@ ELK_LIBS = @ELK_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INCLUDES = @INCLUDES@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOTIF_CFLAGS = @MOTIF_CFLAGS@ MOTIF_LIBS = @MOTIF_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STDINT_HEADER = @STDINT_HEADER@ STRIP = @STRIP@ VERSION = @VERSION@ XAW_CFLAGS = @XAW_CFLAGS@ XAW_LIBS = @XAW_LIBS@ XMKMF = @XMKMF@ XT_CFLAGS = @XT_CFLAGS@ XT_LIBS = @XT_LIBS@ X_CFLAGS = @X_CFLAGS@ X_LIBS = @X_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ NULL = SUBDIRS = . xaw motif EXTRA_DIST = MISSING mkwidget.scm lib_LTLIBRARIES = $(libelk_xt_la) @HAVE_XT_TRUE@libelk_xt_la = libelk-xt.la libelk_xt_la_SOURCES = $(SOURCES_XT) libelk_xt_la_CFLAGS = -I$(srcdir)/../xlib @XT_CFLAGS@ libelk_xt_la_LDFLAGS = -no-undefined libelk_xt_la_LIBADD = $(top_builddir)/src/libelk.la ../xlib/libelk-xlib.la @XT_LIBS@ extensions_HEADERS = xt.h extensionsdir = $(pkgincludedir)/extensions SOURCES_XT = \ accelerator.c \ action.c \ callback.c \ class.c \ classname.c \ context.c \ converter.c \ error.c \ function.c \ identifier.c \ init.c \ objects.c \ popup.c \ resource.c \ translation.c \ widget.c \ $(NULL) all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign lib/xwidgets/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign lib/xwidgets/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libelk-xt.la: $(libelk_xt_la_OBJECTS) $(libelk_xt_la_DEPENDENCIES) $(libelk_xt_la_LINK) $(am_libelk_xt_la_rpath) $(libelk_xt_la_OBJECTS) $(libelk_xt_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_xt_la-accelerator.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_xt_la-action.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_xt_la-callback.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_xt_la-class.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_xt_la-classname.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_xt_la-context.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_xt_la-converter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_xt_la-error.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_xt_la-function.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_xt_la-identifier.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_xt_la-init.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_xt_la-objects.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_xt_la-popup.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_xt_la-resource.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_xt_la-translation.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libelk_xt_la-widget.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< libelk_xt_la-accelerator.lo: accelerator.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xt_la_CFLAGS) $(CFLAGS) -MT libelk_xt_la-accelerator.lo -MD -MP -MF $(DEPDIR)/libelk_xt_la-accelerator.Tpo -c -o libelk_xt_la-accelerator.lo `test -f 'accelerator.c' || echo '$(srcdir)/'`accelerator.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_xt_la-accelerator.Tpo $(DEPDIR)/libelk_xt_la-accelerator.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='accelerator.c' object='libelk_xt_la-accelerator.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xt_la_CFLAGS) $(CFLAGS) -c -o libelk_xt_la-accelerator.lo `test -f 'accelerator.c' || echo '$(srcdir)/'`accelerator.c libelk_xt_la-action.lo: action.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xt_la_CFLAGS) $(CFLAGS) -MT libelk_xt_la-action.lo -MD -MP -MF $(DEPDIR)/libelk_xt_la-action.Tpo -c -o libelk_xt_la-action.lo `test -f 'action.c' || echo '$(srcdir)/'`action.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_xt_la-action.Tpo $(DEPDIR)/libelk_xt_la-action.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='action.c' object='libelk_xt_la-action.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xt_la_CFLAGS) $(CFLAGS) -c -o libelk_xt_la-action.lo `test -f 'action.c' || echo '$(srcdir)/'`action.c libelk_xt_la-callback.lo: callback.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xt_la_CFLAGS) $(CFLAGS) -MT libelk_xt_la-callback.lo -MD -MP -MF $(DEPDIR)/libelk_xt_la-callback.Tpo -c -o libelk_xt_la-callback.lo `test -f 'callback.c' || echo '$(srcdir)/'`callback.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_xt_la-callback.Tpo $(DEPDIR)/libelk_xt_la-callback.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='callback.c' object='libelk_xt_la-callback.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xt_la_CFLAGS) $(CFLAGS) -c -o libelk_xt_la-callback.lo `test -f 'callback.c' || echo '$(srcdir)/'`callback.c libelk_xt_la-class.lo: class.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xt_la_CFLAGS) $(CFLAGS) -MT libelk_xt_la-class.lo -MD -MP -MF $(DEPDIR)/libelk_xt_la-class.Tpo -c -o libelk_xt_la-class.lo `test -f 'class.c' || echo '$(srcdir)/'`class.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_xt_la-class.Tpo $(DEPDIR)/libelk_xt_la-class.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='class.c' object='libelk_xt_la-class.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xt_la_CFLAGS) $(CFLAGS) -c -o libelk_xt_la-class.lo `test -f 'class.c' || echo '$(srcdir)/'`class.c libelk_xt_la-classname.lo: classname.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xt_la_CFLAGS) $(CFLAGS) -MT libelk_xt_la-classname.lo -MD -MP -MF $(DEPDIR)/libelk_xt_la-classname.Tpo -c -o libelk_xt_la-classname.lo `test -f 'classname.c' || echo '$(srcdir)/'`classname.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_xt_la-classname.Tpo $(DEPDIR)/libelk_xt_la-classname.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='classname.c' object='libelk_xt_la-classname.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xt_la_CFLAGS) $(CFLAGS) -c -o libelk_xt_la-classname.lo `test -f 'classname.c' || echo '$(srcdir)/'`classname.c libelk_xt_la-context.lo: context.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xt_la_CFLAGS) $(CFLAGS) -MT libelk_xt_la-context.lo -MD -MP -MF $(DEPDIR)/libelk_xt_la-context.Tpo -c -o libelk_xt_la-context.lo `test -f 'context.c' || echo '$(srcdir)/'`context.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_xt_la-context.Tpo $(DEPDIR)/libelk_xt_la-context.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='context.c' object='libelk_xt_la-context.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xt_la_CFLAGS) $(CFLAGS) -c -o libelk_xt_la-context.lo `test -f 'context.c' || echo '$(srcdir)/'`context.c libelk_xt_la-converter.lo: converter.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xt_la_CFLAGS) $(CFLAGS) -MT libelk_xt_la-converter.lo -MD -MP -MF $(DEPDIR)/libelk_xt_la-converter.Tpo -c -o libelk_xt_la-converter.lo `test -f 'converter.c' || echo '$(srcdir)/'`converter.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_xt_la-converter.Tpo $(DEPDIR)/libelk_xt_la-converter.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='converter.c' object='libelk_xt_la-converter.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xt_la_CFLAGS) $(CFLAGS) -c -o libelk_xt_la-converter.lo `test -f 'converter.c' || echo '$(srcdir)/'`converter.c libelk_xt_la-error.lo: error.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xt_la_CFLAGS) $(CFLAGS) -MT libelk_xt_la-error.lo -MD -MP -MF $(DEPDIR)/libelk_xt_la-error.Tpo -c -o libelk_xt_la-error.lo `test -f 'error.c' || echo '$(srcdir)/'`error.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_xt_la-error.Tpo $(DEPDIR)/libelk_xt_la-error.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='error.c' object='libelk_xt_la-error.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xt_la_CFLAGS) $(CFLAGS) -c -o libelk_xt_la-error.lo `test -f 'error.c' || echo '$(srcdir)/'`error.c libelk_xt_la-function.lo: function.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xt_la_CFLAGS) $(CFLAGS) -MT libelk_xt_la-function.lo -MD -MP -MF $(DEPDIR)/libelk_xt_la-function.Tpo -c -o libelk_xt_la-function.lo `test -f 'function.c' || echo '$(srcdir)/'`function.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_xt_la-function.Tpo $(DEPDIR)/libelk_xt_la-function.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='function.c' object='libelk_xt_la-function.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xt_la_CFLAGS) $(CFLAGS) -c -o libelk_xt_la-function.lo `test -f 'function.c' || echo '$(srcdir)/'`function.c libelk_xt_la-identifier.lo: identifier.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xt_la_CFLAGS) $(CFLAGS) -MT libelk_xt_la-identifier.lo -MD -MP -MF $(DEPDIR)/libelk_xt_la-identifier.Tpo -c -o libelk_xt_la-identifier.lo `test -f 'identifier.c' || echo '$(srcdir)/'`identifier.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_xt_la-identifier.Tpo $(DEPDIR)/libelk_xt_la-identifier.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='identifier.c' object='libelk_xt_la-identifier.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xt_la_CFLAGS) $(CFLAGS) -c -o libelk_xt_la-identifier.lo `test -f 'identifier.c' || echo '$(srcdir)/'`identifier.c libelk_xt_la-init.lo: init.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xt_la_CFLAGS) $(CFLAGS) -MT libelk_xt_la-init.lo -MD -MP -MF $(DEPDIR)/libelk_xt_la-init.Tpo -c -o libelk_xt_la-init.lo `test -f 'init.c' || echo '$(srcdir)/'`init.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_xt_la-init.Tpo $(DEPDIR)/libelk_xt_la-init.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='init.c' object='libelk_xt_la-init.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xt_la_CFLAGS) $(CFLAGS) -c -o libelk_xt_la-init.lo `test -f 'init.c' || echo '$(srcdir)/'`init.c libelk_xt_la-objects.lo: objects.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xt_la_CFLAGS) $(CFLAGS) -MT libelk_xt_la-objects.lo -MD -MP -MF $(DEPDIR)/libelk_xt_la-objects.Tpo -c -o libelk_xt_la-objects.lo `test -f 'objects.c' || echo '$(srcdir)/'`objects.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_xt_la-objects.Tpo $(DEPDIR)/libelk_xt_la-objects.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='objects.c' object='libelk_xt_la-objects.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xt_la_CFLAGS) $(CFLAGS) -c -o libelk_xt_la-objects.lo `test -f 'objects.c' || echo '$(srcdir)/'`objects.c libelk_xt_la-popup.lo: popup.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xt_la_CFLAGS) $(CFLAGS) -MT libelk_xt_la-popup.lo -MD -MP -MF $(DEPDIR)/libelk_xt_la-popup.Tpo -c -o libelk_xt_la-popup.lo `test -f 'popup.c' || echo '$(srcdir)/'`popup.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_xt_la-popup.Tpo $(DEPDIR)/libelk_xt_la-popup.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='popup.c' object='libelk_xt_la-popup.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xt_la_CFLAGS) $(CFLAGS) -c -o libelk_xt_la-popup.lo `test -f 'popup.c' || echo '$(srcdir)/'`popup.c libelk_xt_la-resource.lo: resource.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xt_la_CFLAGS) $(CFLAGS) -MT libelk_xt_la-resource.lo -MD -MP -MF $(DEPDIR)/libelk_xt_la-resource.Tpo -c -o libelk_xt_la-resource.lo `test -f 'resource.c' || echo '$(srcdir)/'`resource.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_xt_la-resource.Tpo $(DEPDIR)/libelk_xt_la-resource.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='resource.c' object='libelk_xt_la-resource.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xt_la_CFLAGS) $(CFLAGS) -c -o libelk_xt_la-resource.lo `test -f 'resource.c' || echo '$(srcdir)/'`resource.c libelk_xt_la-translation.lo: translation.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xt_la_CFLAGS) $(CFLAGS) -MT libelk_xt_la-translation.lo -MD -MP -MF $(DEPDIR)/libelk_xt_la-translation.Tpo -c -o libelk_xt_la-translation.lo `test -f 'translation.c' || echo '$(srcdir)/'`translation.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_xt_la-translation.Tpo $(DEPDIR)/libelk_xt_la-translation.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='translation.c' object='libelk_xt_la-translation.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xt_la_CFLAGS) $(CFLAGS) -c -o libelk_xt_la-translation.lo `test -f 'translation.c' || echo '$(srcdir)/'`translation.c libelk_xt_la-widget.lo: widget.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xt_la_CFLAGS) $(CFLAGS) -MT libelk_xt_la-widget.lo -MD -MP -MF $(DEPDIR)/libelk_xt_la-widget.Tpo -c -o libelk_xt_la-widget.lo `test -f 'widget.c' || echo '$(srcdir)/'`widget.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libelk_xt_la-widget.Tpo $(DEPDIR)/libelk_xt_la-widget.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='widget.c' object='libelk_xt_la-widget.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libelk_xt_la_CFLAGS) $(CFLAGS) -c -o libelk_xt_la-widget.lo `test -f 'widget.c' || echo '$(srcdir)/'`widget.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-extensionsHEADERS: $(extensions_HEADERS) @$(NORMAL_INSTALL) test -z "$(extensionsdir)" || $(MKDIR_P) "$(DESTDIR)$(extensionsdir)" @list='$(extensions_HEADERS)'; test -n "$(extensionsdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(extensionsdir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(extensionsdir)" || exit $$?; \ done uninstall-extensionsHEADERS: @$(NORMAL_UNINSTALL) @list='$(extensions_HEADERS)'; test -n "$(extensionsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(extensionsdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(extensionsdir)" && rm -f $$files # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(extensionsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-extensionsHEADERS install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-extensionsHEADERS uninstall-libLTLIBRARIES .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool ctags ctags-recursive \ distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-extensionsHEADERS install-html \ install-html-am install-info install-info-am \ install-libLTLIBRARIES install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am \ uninstall-extensionsHEADERS uninstall-libLTLIBRARIES echo-sources: ; echo $(SOURCES) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: elk-3.99.8/lib/xwidgets/context.c0000644000175000017500000002365111577076306013577 00000000000000/* context.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "xt.h" static SYMDESCR XtIM_Syms[] = { { "x-event", XtIMXEvent }, { "timer", XtIMTimer }, { "alternate-input", XtIMAlternateInput }, { 0, 0 } }; static SYMDESCR XtInputMask_Syms[] = { { "read", XtInputReadMask }, { "write", XtInputWriteMask }, { "exception", XtInputExceptMask }, { 0, 0 } }; static Object P_Destroy_Context(); Generic_Predicate (Context) Generic_Equal (Context, CONTEXT, context) Generic_Print (Context, "#[context %lu]", (unsigned int)(uintptr_t)POINTER(x)) static Object Internal_Make_Context (int finalize, XtAppContext context) { Object c; c = Find_Object (T_Context, (GENERIC)0, Match_Xt_Obj, context); if (Nullp (c)) { c = Alloc_Object (sizeof (struct S_Context), T_Context, 0); CONTEXT(c)->tag = Null; CONTEXT(c)->context = context; CONTEXT(c)->free = 0; Register_Object (c, (GENERIC)0, finalize ? P_Destroy_Context : (PFO)0, 1); XtAppSetWarningHandler (context, Xt_Warning); XtAppAddActionHook (context, (XtActionHookProc)Action_Hook, (XtPointer)0); } return c; } /* Backwards compatibility: */ Object Make_Context (XtAppContext context) { return Internal_Make_Context (1, context); } Object Make_Context_Foreign (XtAppContext context) { return Internal_Make_Context (0, context); } void Check_Context (Object c) { Check_Type (c, T_Context); if (CONTEXT(c)->free) Primitive_Error ("invalid context: ~s", c); } static Object P_Create_Context () { return Make_Context (XtCreateApplicationContext ()); } static Object P_Destroy_Context (Object c) { Check_Context (c); Free_Actions (CONTEXT(c)->context); XtDestroyApplicationContext (CONTEXT(c)->context); CONTEXT(c)->free = 1; Deregister_Object (c); return Void; } static Object P_Initialize_Display (Object c, Object d, Object name, Object class) { register char *sn = 0, *sc = "", *sd = 0; Display *dpy; extern char **Argv; extern int First_Arg, Argc; int argc = Argc - First_Arg + 1; Argv[First_Arg-1] = "elk"; Check_Context (c); if (!EQ(name, False)) sn = Get_Strsym (name); if (!EQ(class, False)) sc = Get_Strsym (class); if (TYPE(d) == T_Display) { XtDisplayInitialize (CONTEXT(c)->context, DISPLAY(d)->dpy, sn, sc, (XrmOptionDescRec *)0, 0, &argc, &Argv[First_Arg-1]); Argc = First_Arg + argc; return Void; } if (!EQ(d, False)) sd = Get_Strsym (d); dpy = XtOpenDisplay (CONTEXT(c)->context, sd, sn, sc, (XrmOptionDescRec *)0, 0, &argc, &Argv[First_Arg-1]); Argc = First_Arg + argc - 1; if (dpy == 0) { if (sd) Primitive_Error ("cannot open display ~s", d); else Primitive_Error ("cannot open display"); } return Make_Display (0, dpy); } /* Due to a bug in Xt this function drops core when invoked with a * display not owned by Xt. */ static Object P_Display_To_Context (Object d) { Check_Type (d, T_Display); return Make_Context_Foreign (XtDisplayToApplicationContext (DISPLAY(d)->dpy)); } static Object P_Set_Context_Fallback_Resources (int argc, Object *argv) { register char **p = 0; register int i; struct S_String *sp; Object con; con = argv[0]; Check_Context (con); if (argc > 1) { argv++; argc--; p = (char **)XtMalloc ((argc+1) * sizeof (char *)); for (i = 0; i < argc; i++) { Check_Type (argv[i], T_String); sp = STRING(argv[i]); p[i] = XtMalloc (sp->size + 1); memcpy (p[i], sp->data, sp->size); p[i][sp->size] = 0; } p[i] = 0; } XtAppSetFallbackResources (CONTEXT(con)->context, p); return Void; } static Object P_Context_Main_Loop (Object c) { Check_Context (c); XtAppMainLoop (CONTEXT(c)->context); /*NOTREACHED*/ return Void; } static Object P_Context_Pending (Object c) { Check_Context (c); return Bits_To_Symbols ((unsigned long)XtAppPending (CONTEXT(c)->context), 1, XtIM_Syms); } static Object P_Context_Process_Event (int argc, Object *argv) { XtInputMask mask = XtIMAll; Check_Context (argv[0]); if (argc == 2) mask = (XtInputMask)Symbols_To_Bits (argv[1], 1, XtIM_Syms); XtAppProcessEvent (CONTEXT(argv[0])->context, mask); return Void; } static Boolean Work_Proc (XtPointer client_data) { Object ret; ret = Funcall (Get_Function ((int)client_data), Null, 0); if (Truep (ret)) Deregister_Function ((int)client_data); return Truep (ret); } static Object P_Context_Add_Work_Proc (Object c, Object p) { XtWorkProcId id; register int i; Check_Context (c); Check_Procedure (p); i = Register_Function (p); id = XtAppAddWorkProc (CONTEXT(c)->context, Work_Proc, (XtPointer)i); return Make_Id ('w', (XtPointer)id, i); } static Object P_Remove_Work_Proc (Object id) { XtRemoveWorkProc ((XtWorkProcId)Use_Id (id, 'w')); Deregister_Function (IDENTIFIER(id)->num); return Void; } static void Timeout_Proc (XtPointer client_data, XtIntervalId *id) { Object proc, args; register int i = (int)client_data; args = Cons (Make_Id ('t', (XtPointer)*id, i), Null); proc = Get_Function (i); Deregister_Function (i); (void)Funcall (proc, args, 0); } static Object P_Context_Add_Timeout (Object c, Object n, Object p) { XtIntervalId id; register int i; Check_Context (c); Check_Procedure (p); i = Register_Function (p); id = XtAppAddTimeOut (CONTEXT(c)->context, (unsigned long)Get_Long (n), Timeout_Proc, (XtPointer)i); return Make_Id ('t', (XtPointer)id, i); } static Object P_Remove_Timeout (Object id) { XtRemoveTimeOut ((XtIntervalId)Use_Id (id, 't')); Deregister_Function (IDENTIFIER(id)->num); return Void; } /*ARGSUSED*/ static void Input_Proc (XtPointer client_data, int *src, XtInputId *id) { Object p, args; GC_Node2; p = Get_Function ((int)client_data); args = Null; GC_Link2 (p, args); args = Cons (Make_Id ('i', (XtPointer)*id, (int)client_data), Null); args = Cons (Car (p), args); GC_Unlink; (void)Funcall (Cdr (p), args, 0); } static Object P_Context_Add_Input (int argc, Object *argv) { Object c, src, p; XtInputId id; XtInputMask m; register int i; c = argv[0], src = argv[1], p = argv[2]; Check_Context (c); Check_Procedure (p); Check_Type (src, T_Port); if (!(PORT(src)->flags & P_OPEN)) Primitive_Error ("port has been closed: ~s", src); if (PORT(src)->flags & P_STRING) Primitive_Error ("invalid port: ~s", src); if (argc == 4) { m = Symbols_To_Bits (argv[3], 1, XtInputMask_Syms); } else { switch (PORT(src)->flags & (P_INPUT|P_BIDIR)) { case 0: m = XtInputWriteMask; break; case P_INPUT: m = XtInputReadMask; break; default: m = XtInputReadMask|XtInputWriteMask; break; } } i = Register_Function (Cons (src, p)); id = XtAppAddInput (CONTEXT(c)->context, fileno (PORT(src)->file), (XtPointer)m, Input_Proc, (XtPointer)i); return Make_Id ('i', (XtPointer)id, i); } static Object P_Remove_Input (Object id) { XtRemoveInput ((XtInputId)Use_Id (id, 'i')); Deregister_Function (IDENTIFIER(id)->num); return Void; } void elk_init_xt_context () { Generic_Define (Context, "context", "context?"); Define_Primitive (P_Create_Context, "create-context", 0, 0, EVAL); Define_Primitive (P_Destroy_Context, "destroy-context", 1, 1, EVAL); Define_Primitive (P_Initialize_Display, "initialize-display", 4, 4, EVAL); Define_Primitive (P_Display_To_Context, "display->context", 1, 1, EVAL); Define_Primitive (P_Set_Context_Fallback_Resources, "set-context-fallback-resources!", 1, MANY, VARARGS); Define_Primitive (P_Context_Main_Loop, "context-main-loop", 1, 1, EVAL); Define_Primitive (P_Context_Pending, "context-pending", 1, 1, EVAL); Define_Primitive (P_Context_Process_Event, "context-process-event", 1, 2, VARARGS); Define_Primitive (P_Context_Add_Work_Proc, "context-add-work-proc", 2, 2, EVAL); Define_Primitive (P_Remove_Work_Proc, "remove-work-proc", 1, 1, EVAL); Define_Primitive (P_Context_Add_Timeout,"context-add-timeout",3, 3, EVAL); Define_Primitive (P_Remove_Timeout, "remove-timeout", 1, 1, EVAL); Define_Primitive (P_Context_Add_Input, "context-add-input",3, 4, VARARGS); Define_Primitive (P_Remove_Input, "remove-input", 1, 1, EVAL); } elk-3.99.8/lib/xwidgets/function.c0000644000175000017500000000404211577076306013731 00000000000000/* function.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "xt.h" static int max_functions = 512; static Object Functions; int Register_Function (Object x) { register int i; Object v; GC_Node; for (i = 0; i < max_functions; i++) if (Nullp (VECTOR(Functions)->data[i])) break; if (i == max_functions) { max_functions *= 2; GC_Link (x); v = Make_Vector (max_functions, Null); GC_Unlink; memcpy ((char *)VECTOR(v)->data, (char *)VECTOR(Functions)->data, i * sizeof (Object)); Functions = v; } VECTOR(Functions)->data[i] = x; return i; } Object Get_Function (int i) { return VECTOR(Functions)->data[i]; } void Deregister_Function (int i) { VECTOR(Functions)->data[i] = Null; } void elk_init_xt_function () { Functions = Make_Vector (max_functions, Null); Global_GC_Link (Functions); } elk-3.99.8/lib/xwidgets/xt.h0000644000175000017500000001233211577076306012545 00000000000000/* xt.h * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "xlib.h" #define XTSTRINGDEFINES #define Object FOO # include # include # include # include #undef Object #include #if XtSpecificationRelease < 4 #error "Xt Release 3 or earlier no longer supported" #endif #if XtSpecificationRelease >= 5 # define XT_RELEASE_5_OR_LATER #endif #if XtSpecificationRelease >= 6 # define XT_RELEASE_6_OR_LATER #endif typedef XtArgVal (*PFS2X) (Object); typedef Object (*PFX2S) (XtArgVal); extern int T_Context; extern int T_Class; extern int T_Widget; extern int T_Identifier; #define CONTEXT(x) ((struct S_Context *)POINTER(x)) #define CLASS(x) ((struct S_Class *)POINTER(x)) #define WIDGET(x) ((struct S_Widget *)POINTER(x)) #define IDENTIFIER(x) ((struct S_Identifier *)POINTER(x)) struct S_Context { Object tag; XtAppContext context; char free; }; struct S_Class { Object tag; WidgetClass wclass; char *name; }; struct S_Widget { Object tag; Widget widget; char free; }; struct S_Identifier { Object tag; char type; XtPointer val; int num; char free; }; extern WidgetClass widgetClass; /* The `core' class */ extern WidgetClass constraintWidgetClass; extern WidgetClass compositeWidgetClass; C_LINKAGE_BEGIN extern void Check_Callback_List (Object); extern void Check_Context (Object); extern void Check_Widget (Object); extern void Check_Widget_Class (Object, WidgetClass); extern void Convert_Args (int, Object*, ArgList, Widget, WidgetClass); extern void Define_Callback (char*, char*, int); extern void Define_Class (char *, WidgetClass, XtResourceList, int); extern void Define_Converter_To_C (char*, PFS2X); extern void Define_Converter_To_Scheme (char*, PFX2S); extern void Fiddle_Destroy_Callback (Widget); extern void Fill_Callbacks (Object, XtCallbackList, int, PFX2S); extern void Free_Actions (XtAppContext); extern void Get_All_Resources (int, Widget, WidgetClass, XtResource**, int*, int*); extern void Make_Resource_Name (char*); extern int Match_Xt_Obj (Object, va_list); extern Object Get_Callbackfun (XtPointer); extern Object Get_Function (int); extern Object Get_Resources (WidgetClass, void (*)(WidgetClass, XtResourceList*, Cardinal*), int); extern Object Get_Values (Widget, int, Object*); extern Object Make_Class (WidgetClass, char*); extern Object Make_Context (XtAppContext); extern Object Make_Context_Foreign (XtAppContext); extern Object Make_Id (int, XtPointer, int); extern Object Make_Widget (Widget); extern Object Make_Widget_Foreign (Widget); extern Object Make_Widget_Class (WidgetClass); extern PFX2S Find_Callback_Converter (WidgetClass, char*, Object); extern PFX2S Find_Converter_To_Scheme (char*); extern PFS2X Find_Converter_To_C (char*); extern int Register_Function (Object); extern void Deregister_Function (int); extern XtAccelerators Get_Accelerators (Object); extern XtTranslations Get_Translations (Object); extern XtPointer Use_Id (Object, int); extern void Xt_Warning (char*); extern char *Class_Name (WidgetClass); extern void Action_Hook (Widget, XtPointer, char*, XEvent*, char**, int*); extern void Destroy_Callback_Proc (Widget, XtPointer, XtPointer); extern void Get_Sub_Resource_List (WidgetClass, XtResourceList*, Cardinal*); extern Object Xt_Class_Name (WidgetClass); extern Object Get_Selection_CB (void *); /* xm/support.d */ extern Object Get_Any_CB (void *); /* xm/support.d */ extern void elk_init_xt_accelerator (); extern void elk_init_xt_action (); extern void elk_init_xt_callback (); extern void elk_init_xt_class (); extern void elk_init_xt_context (); extern void elk_init_xt_function (); extern void elk_init_xt_identifier (); extern void elk_init_xt_popup (); extern void elk_init_xt_translation (); extern void elk_init_xt_widget (); extern void elk_init_xt_error (); extern void elk_init_xt_init (); C_LINKAGE_END #define Encode_Arglist(ac,av,to,widget,class) {\ Alloca (to, Arg*, ((ac)+1)/2 * sizeof (Arg));\ Convert_Args (ac, av, to, widget, class);\ } #define streq(a,b) (strcmp ((a), (b)) == 0) elk-3.99.8/lib/xwidgets/class.c0000644000175000017500000001752311577076306013221 00000000000000/* class.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "xt.h" #define MAX_CLASS 128 #define MAX_CALLBACK_PER_CLASS 10 typedef struct { char *name; int has_arg; } CALLBACK_INFO; typedef struct { WidgetClass class; char *name; CALLBACK_INFO cb[MAX_CALLBACK_PER_CLASS], *cblast; XtResourceList sub_resources; int num_resources; } CLASS_INFO; static CLASS_INFO ctab[MAX_CLASS], *clast = ctab; Generic_Predicate (Class) Generic_Simple_Equal (Class, CLASS, wclass) Generic_Print (Class, "#[class %s]", CLASS(x)->name) Object Make_Class (WidgetClass class, char *name) { Object c; c = Find_Object (T_Class, (GENERIC)0, Match_Xt_Obj, class); if (Nullp (c)) { c = Alloc_Object (sizeof (struct S_Class), T_Class, 0); CLASS(c)->tag = Null; CLASS(c)->wclass = class; CLASS(c)->name = name; Register_Object (c, (GENERIC)0, (PFO)0, 0); /* See comment in Define_Class below */ XtInitializeWidgetClass (class); } return c; } Object Make_Widget_Class (WidgetClass class) { register CLASS_INFO *p; for (p = ctab; p < clast; p++) if (p->class == class) return Make_Class (class, p->name); Primitive_Error ("undefined widget class ~s", Xt_Class_Name (class)); /*NOTREACHED*/ } static Object P_Find_Class (Object name) { register CLASS_INFO *p; register char *s = Get_Strsym (name); for (p = ctab; p < clast; p++) { if (streq (p->name, s)) return Make_Class (p->class, p->name); } Primitive_Error ("no such widget class: ~s", name); /*NOTREACHED*/ } static Object P_Class_Existsp (Object name) { register CLASS_INFO *p; register char *s = Get_Strsym (name); for (p = ctab; p < clast; p++) { if (streq (p->name, s)) return True; } return False; } char *Class_Name (WidgetClass class) { register CLASS_INFO *p; for (p = ctab; p < clast && p->class != class; p++) ; if (p == clast) return "unknown"; return p->name; } void Get_Sub_Resource_List (WidgetClass class, XtResourceList *rp, Cardinal *np) { register CLASS_INFO *p; for (p = ctab; p < clast && p->class != class; p++) ; if (p == clast) Primitive_Error ("undefined widget class ~s", Xt_Class_Name (class)); *np = p->num_resources; *rp = p->sub_resources; } static Object P_Class_Resources (Object c) { Check_Type (c, T_Class); return Get_Resources (CLASS(c)->wclass, XtGetResourceList, 1); } static Object P_Class_Constraint_Resources (Object c) { Check_Type (c, T_Class); return Get_Resources (CLASS(c)->wclass, XtGetConstraintResourceList, 1); } static Object P_Class_Sub_Resources (Object c) { Check_Type (c, T_Class); return Get_Resources (CLASS(c)->wclass, Get_Sub_Resource_List, 0); } void Define_Class (char *name, WidgetClass class, XtResourceList r, int nr) { Set_Error_Tag ("define-class"); if (clast == ctab+MAX_CLASS) Primitive_Error ("too many widget classes"); /* * The next line should read: * XtInitializeWidgetClass (class); * However, there is a bug in Motif 1.1.4 that causes an application * to drop core if the row-column widget class is initialized before * the first vendor-shell widget has been created. * Thus, we can't initialize any classes at this point; we will do * it in Make_Class above instead. * This essentially causes a class to be initialized the first time * it is used. */ clast->name = name; clast->class = class; clast->cb[0].name = XtNdestroyCallback; clast->cb[0].has_arg = 0; clast->cblast = clast->cb+1; clast->sub_resources = r; clast->num_resources = nr; clast++; } void Define_Callback (char *cl, char *s, int has_arg) { register CLASS_INFO *p; Set_Error_Tag ("define-callback"); for (p = ctab; p < clast; p++) if (streq (p->name, cl)) { if (p->cblast == p->cb+MAX_CALLBACK_PER_CLASS) Primitive_Error ("too many callbacks for this class"); p->cblast->name = s; p->cblast->has_arg = has_arg; p->cblast++; return; } Primitive_Error ("undefined class"); } PFX2S Find_Callback_Converter (WidgetClass c, char *name, Object sname) { register CLASS_INFO *p; register CALLBACK_INFO *q; PFX2S conv; for (p = ctab; p < clast; p++) if (p->class == c) { for (q = p->cb; q < p->cblast; q++) if (streq (q->name, name)) { if (q->has_arg) { char s1[128], s2[128], msg[256]; /* First look for a class specific converter * then for a general one. Callback converters * have a prefix "callback:" to avoid name conflicts * with converters for normal resources. */ sprintf (s1, "callback:%s-%s", p->name, name); conv = Find_Converter_To_Scheme (s1); if (conv == 0) { sprintf(s2, "callback:%s", name); conv = Find_Converter_To_Scheme (s2); if (conv == 0) { sprintf (msg, "no callback converter for %s or %s", s1, s2); Primitive_Error (msg); } } return conv; } else return (PFX2S)0; } Primitive_Error ("no such callback: ~s", sname); } Primitive_Error ("undefined widget class ~s", Xt_Class_Name (c)); /*NOTREACHED*/ } void elk_init_xt_class () { Generic_Define (Class, "class", "class?"); Define_Primitive (P_Find_Class, "find-class", 1, 1, EVAL); Define_Primitive (P_Class_Resources, "class-resources", 1, 1, EVAL); Define_Primitive (P_Class_Constraint_Resources, "class-constraint-resources", 1, 1, EVAL); Define_Primitive (P_Class_Sub_Resources, "class-sub-resources", 1, 1, EVAL); Define_Primitive (P_Class_Existsp, "class-exists?", 1, 1, EVAL); /* * Doesn't work with Motif-1.1.0: * Define_Class ("simple", simpleWidgetClass, (XtResourceList)0, 0); */ Define_Class ("core", widgetClass, (XtResourceList)0, 0); Define_Class ("constraint", constraintWidgetClass, (XtResourceList)0, 0); Define_Class ("composite", compositeWidgetClass, (XtResourceList)0, 0); } elk-3.99.8/lib/xwidgets/motif/0000755000175000017500000000000011577110017013122 500000000000000elk-3.99.8/lib/xwidgets/motif/text.d0000644000175000017500000000356511577076306014220 00000000000000;; text.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'text "Text.h") (define-widget-class 'text 'xmTextWidgetClass '(pendingDelete PendingDelete Boolean) '(selectThreshold SelectThreshold Int) '(blinkRate BlinkRate Int) '(columns Columns Short) '(cursorPositionVisible CursorPositionVisible Boolean) '(fontList FontList FontList) '(resizeHeight ResizeHeight Boolean) '(resizeWidth ResizeWidth Boolean) '(rows Rows Short) '(wordWrap WordWrap Boolean)) (define-callback 'text 'activateCallback #t) (define-callback 'text 'valueChangedCallback #t) (define text-callback->scheme " return Get_Any_CB ((XmAnyCallbackStruct *)x);") (c->scheme 'callback:text-valueChangedCallback text-callback->scheme) elk-3.99.8/lib/xwidgets/motif/arrow-button.c0000644000175000017500000000130611577076426015670 00000000000000#include "../xt.h" #include #include #include void elk_init_motif_arrowbutton () { XtResourceList r = 0; Define_Class ("arrow-button-gadget", xmArrowButtonGadgetClass, r, 0); Define_Class ("arrow-button", xmArrowButtonWidgetClass, r, 0); Define_Callback ("arrow-button-gadget", "disarmCallback", 1); Define_Callback ("arrow-button-gadget", "armCallback", 1); Define_Callback ("arrow-button-gadget", "activateCallback", 1); Define_Callback ("arrow-button", "disarmCallback", 1); Define_Callback ("arrow-button", "armCallback", 1); Define_Callback ("arrow-button", "activateCallback", 1); P_Provide(Intern("motif:arrow-button")); } elk-3.99.8/lib/xwidgets/motif/main-window.c0000644000175000017500000000035211577076426015456 00000000000000#include "../xt.h" #include #include void elk_init_motif_mainwindow () { XtResourceList r = 0; Define_Class ("main-window", xmMainWindowWidgetClass, r, 0); P_Provide(Intern("motif:main-window")); } elk-3.99.8/lib/xwidgets/motif/drawn-button.d0000644000175000017500000000307711577076306015656 00000000000000;; drawn-button.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'drawnbutton "DrawnB.h") (define-widget-class 'drawn-button 'xmDrawnButtonWidgetClass) (define-callback 'drawn-button 'activateCallback #t) (define-callback 'drawn-button 'armCallback #t) (define-callback 'drawn-button 'disarmCallback #t) (define-callback 'drawn-button 'exposeCallback #t) (define-callback 'drawn-button 'resizeCallback #t) elk-3.99.8/lib/xwidgets/motif/drawing-area.c0000644000175000017500000000064111577076426015567 00000000000000#include "../xt.h" #include #include void elk_init_motif_drawingarea () { XtResourceList r = 0; Define_Class ("drawing-area", xmDrawingAreaWidgetClass, r, 0); Define_Callback ("drawing-area", "resizeCallback", 1); Define_Callback ("drawing-area", "inputCallback", 1); Define_Callback ("drawing-area", "exposeCallback", 1); P_Provide(Intern("motif:drawing-area")); } elk-3.99.8/lib/xwidgets/motif/Makefile.in0000644000175000017500000013221711577103434015122 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = lib/xwidgets/motif DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) motif_la_DEPENDENCIES = $(top_builddir)/src/libelk.la \ ../../xlib/libelk-xlib.la ../libelk-xt.la am__objects_1 = am__objects_2 = motif_la-arrow-button.lo motif_la-bulletin-brd.lo \ motif_la-cascade-btn.lo motif_la-command.lo \ motif_la-drawing-area.lo motif_la-drawn-button.lo \ motif_la-file-selectn.lo motif_la-form.lo motif_la-frame.lo \ motif_la-label.lo motif_la-list.lo motif_la-main-window.lo \ motif_la-message-box.lo motif_la-paned-window.lo \ motif_la-push-button.lo motif_la-row-column.lo \ motif_la-scale.lo motif_la-scroll-bar.lo \ motif_la-scrolled-win.lo motif_la-selectn-box.lo \ motif_la-separator.lo motif_la-shell.lo motif_la-support.lo \ motif_la-text.lo motif_la-toggle-btn.lo $(am__objects_1) am_motif_la_OBJECTS = motif_la-init.lo $(am__objects_2) motif_la_OBJECTS = $(am_motif_la_OBJECTS) motif_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(motif_la_CFLAGS) $(CFLAGS) \ $(motif_la_LDFLAGS) $(LDFLAGS) -o $@ @HAVE_MOTIF_TRUE@am_motif_la_rpath = -rpath $(pkglibdir) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/.auto/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(motif_la_SOURCES) DIST_SOURCES = $(motif_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ELK_CFLAGS = @ELK_CFLAGS@ ELK_LDFLAGS = @ELK_LDFLAGS@ ELK_LIBS = @ELK_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INCLUDES = @INCLUDES@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOTIF_CFLAGS = @MOTIF_CFLAGS@ MOTIF_LIBS = @MOTIF_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STDINT_HEADER = @STDINT_HEADER@ STRIP = @STRIP@ VERSION = @VERSION@ XAW_CFLAGS = @XAW_CFLAGS@ XAW_LIBS = @XAW_LIBS@ XMKMF = @XMKMF@ XT_CFLAGS = @XT_CFLAGS@ XT_LIBS = @XT_LIBS@ X_CFLAGS = @X_CFLAGS@ X_LIBS = @X_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ NULL = EXTRA_DIST = $(SOURCES_MOTIF_D) CLEANFILES = $(SOURCES_MOTIF_C) pkglib_LTLIBRARIES = $(motif_la) @HAVE_MOTIF_TRUE@motif_la = motif.la motif_la_SOURCES = init.c $(SOURCES_MOTIF_C) motif_la_CFLAGS = -I$(srcdir)/../../xlib @MOTIF_CFLAGS@ -DUSING_MOTIF motif_la_LDFLAGS = -module -avoid-version -no-undefined -u XmIsMotifWMRunning motif_la_LIBADD = $(top_builddir)/src/libelk.la ../../xlib/libelk-xlib.la ../libelk-xt.la @MOTIF_LIBS@ SOURCES_MOTIF_C = \ arrow-button.c \ bulletin-brd.c \ cascade-btn.c \ command.c \ drawing-area.c \ drawn-button.c \ file-selectn.c \ form.c \ frame.c \ label.c \ list.c \ main-window.c \ message-box.c \ paned-window.c \ push-button.c \ row-column.c \ scale.c \ scroll-bar.c \ scrolled-win.c \ selectn-box.c \ separator.c \ shell.c \ support.c \ text.c \ toggle-btn.c \ $(NULL) SOURCES_MOTIF_D = \ arrow-button.d \ bulletin-brd.d \ cascade-btn.d \ command.d \ drawing-area.d \ drawn-button.d \ file-selectn.d \ form.d \ frame.d \ label.d \ list.d \ main-window.d \ message-box.d \ paned-window.d \ push-button.d \ row-column.d \ scale.d \ scroll-bar.d \ scrolled-win.d \ selectn-box.d \ separator.d \ shell.d \ support.d \ text.d \ toggle-btn.d \ $(NULL) all: all-am .SUFFIXES: .SUFFIXES: .c .d .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign lib/xwidgets/motif/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign lib/xwidgets/motif/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done motif.la: $(motif_la_OBJECTS) $(motif_la_DEPENDENCIES) $(motif_la_LINK) $(am_motif_la_rpath) $(motif_la_OBJECTS) $(motif_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/motif_la-arrow-button.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/motif_la-bulletin-brd.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/motif_la-cascade-btn.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/motif_la-command.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/motif_la-drawing-area.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/motif_la-drawn-button.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/motif_la-file-selectn.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/motif_la-form.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/motif_la-frame.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/motif_la-init.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/motif_la-label.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/motif_la-list.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/motif_la-main-window.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/motif_la-message-box.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/motif_la-paned-window.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/motif_la-push-button.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/motif_la-row-column.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/motif_la-scale.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/motif_la-scroll-bar.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/motif_la-scrolled-win.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/motif_la-selectn-box.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/motif_la-separator.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/motif_la-shell.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/motif_la-support.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/motif_la-text.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/motif_la-toggle-btn.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< motif_la-init.lo: init.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -MT motif_la-init.lo -MD -MP -MF $(DEPDIR)/motif_la-init.Tpo -c -o motif_la-init.lo `test -f 'init.c' || echo '$(srcdir)/'`init.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/motif_la-init.Tpo $(DEPDIR)/motif_la-init.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='init.c' object='motif_la-init.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -c -o motif_la-init.lo `test -f 'init.c' || echo '$(srcdir)/'`init.c motif_la-arrow-button.lo: arrow-button.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -MT motif_la-arrow-button.lo -MD -MP -MF $(DEPDIR)/motif_la-arrow-button.Tpo -c -o motif_la-arrow-button.lo `test -f 'arrow-button.c' || echo '$(srcdir)/'`arrow-button.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/motif_la-arrow-button.Tpo $(DEPDIR)/motif_la-arrow-button.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='arrow-button.c' object='motif_la-arrow-button.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -c -o motif_la-arrow-button.lo `test -f 'arrow-button.c' || echo '$(srcdir)/'`arrow-button.c motif_la-bulletin-brd.lo: bulletin-brd.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -MT motif_la-bulletin-brd.lo -MD -MP -MF $(DEPDIR)/motif_la-bulletin-brd.Tpo -c -o motif_la-bulletin-brd.lo `test -f 'bulletin-brd.c' || echo '$(srcdir)/'`bulletin-brd.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/motif_la-bulletin-brd.Tpo $(DEPDIR)/motif_la-bulletin-brd.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='bulletin-brd.c' object='motif_la-bulletin-brd.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -c -o motif_la-bulletin-brd.lo `test -f 'bulletin-brd.c' || echo '$(srcdir)/'`bulletin-brd.c motif_la-cascade-btn.lo: cascade-btn.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -MT motif_la-cascade-btn.lo -MD -MP -MF $(DEPDIR)/motif_la-cascade-btn.Tpo -c -o motif_la-cascade-btn.lo `test -f 'cascade-btn.c' || echo '$(srcdir)/'`cascade-btn.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/motif_la-cascade-btn.Tpo $(DEPDIR)/motif_la-cascade-btn.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cascade-btn.c' object='motif_la-cascade-btn.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -c -o motif_la-cascade-btn.lo `test -f 'cascade-btn.c' || echo '$(srcdir)/'`cascade-btn.c motif_la-command.lo: command.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -MT motif_la-command.lo -MD -MP -MF $(DEPDIR)/motif_la-command.Tpo -c -o motif_la-command.lo `test -f 'command.c' || echo '$(srcdir)/'`command.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/motif_la-command.Tpo $(DEPDIR)/motif_la-command.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='command.c' object='motif_la-command.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -c -o motif_la-command.lo `test -f 'command.c' || echo '$(srcdir)/'`command.c motif_la-drawing-area.lo: drawing-area.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -MT motif_la-drawing-area.lo -MD -MP -MF $(DEPDIR)/motif_la-drawing-area.Tpo -c -o motif_la-drawing-area.lo `test -f 'drawing-area.c' || echo '$(srcdir)/'`drawing-area.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/motif_la-drawing-area.Tpo $(DEPDIR)/motif_la-drawing-area.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drawing-area.c' object='motif_la-drawing-area.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -c -o motif_la-drawing-area.lo `test -f 'drawing-area.c' || echo '$(srcdir)/'`drawing-area.c motif_la-drawn-button.lo: drawn-button.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -MT motif_la-drawn-button.lo -MD -MP -MF $(DEPDIR)/motif_la-drawn-button.Tpo -c -o motif_la-drawn-button.lo `test -f 'drawn-button.c' || echo '$(srcdir)/'`drawn-button.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/motif_la-drawn-button.Tpo $(DEPDIR)/motif_la-drawn-button.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drawn-button.c' object='motif_la-drawn-button.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -c -o motif_la-drawn-button.lo `test -f 'drawn-button.c' || echo '$(srcdir)/'`drawn-button.c motif_la-file-selectn.lo: file-selectn.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -MT motif_la-file-selectn.lo -MD -MP -MF $(DEPDIR)/motif_la-file-selectn.Tpo -c -o motif_la-file-selectn.lo `test -f 'file-selectn.c' || echo '$(srcdir)/'`file-selectn.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/motif_la-file-selectn.Tpo $(DEPDIR)/motif_la-file-selectn.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='file-selectn.c' object='motif_la-file-selectn.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -c -o motif_la-file-selectn.lo `test -f 'file-selectn.c' || echo '$(srcdir)/'`file-selectn.c motif_la-form.lo: form.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -MT motif_la-form.lo -MD -MP -MF $(DEPDIR)/motif_la-form.Tpo -c -o motif_la-form.lo `test -f 'form.c' || echo '$(srcdir)/'`form.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/motif_la-form.Tpo $(DEPDIR)/motif_la-form.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='form.c' object='motif_la-form.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -c -o motif_la-form.lo `test -f 'form.c' || echo '$(srcdir)/'`form.c motif_la-frame.lo: frame.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -MT motif_la-frame.lo -MD -MP -MF $(DEPDIR)/motif_la-frame.Tpo -c -o motif_la-frame.lo `test -f 'frame.c' || echo '$(srcdir)/'`frame.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/motif_la-frame.Tpo $(DEPDIR)/motif_la-frame.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='frame.c' object='motif_la-frame.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -c -o motif_la-frame.lo `test -f 'frame.c' || echo '$(srcdir)/'`frame.c motif_la-label.lo: label.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -MT motif_la-label.lo -MD -MP -MF $(DEPDIR)/motif_la-label.Tpo -c -o motif_la-label.lo `test -f 'label.c' || echo '$(srcdir)/'`label.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/motif_la-label.Tpo $(DEPDIR)/motif_la-label.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='label.c' object='motif_la-label.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -c -o motif_la-label.lo `test -f 'label.c' || echo '$(srcdir)/'`label.c motif_la-list.lo: list.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -MT motif_la-list.lo -MD -MP -MF $(DEPDIR)/motif_la-list.Tpo -c -o motif_la-list.lo `test -f 'list.c' || echo '$(srcdir)/'`list.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/motif_la-list.Tpo $(DEPDIR)/motif_la-list.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='list.c' object='motif_la-list.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -c -o motif_la-list.lo `test -f 'list.c' || echo '$(srcdir)/'`list.c motif_la-main-window.lo: main-window.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -MT motif_la-main-window.lo -MD -MP -MF $(DEPDIR)/motif_la-main-window.Tpo -c -o motif_la-main-window.lo `test -f 'main-window.c' || echo '$(srcdir)/'`main-window.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/motif_la-main-window.Tpo $(DEPDIR)/motif_la-main-window.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='main-window.c' object='motif_la-main-window.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -c -o motif_la-main-window.lo `test -f 'main-window.c' || echo '$(srcdir)/'`main-window.c motif_la-message-box.lo: message-box.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -MT motif_la-message-box.lo -MD -MP -MF $(DEPDIR)/motif_la-message-box.Tpo -c -o motif_la-message-box.lo `test -f 'message-box.c' || echo '$(srcdir)/'`message-box.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/motif_la-message-box.Tpo $(DEPDIR)/motif_la-message-box.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='message-box.c' object='motif_la-message-box.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -c -o motif_la-message-box.lo `test -f 'message-box.c' || echo '$(srcdir)/'`message-box.c motif_la-paned-window.lo: paned-window.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -MT motif_la-paned-window.lo -MD -MP -MF $(DEPDIR)/motif_la-paned-window.Tpo -c -o motif_la-paned-window.lo `test -f 'paned-window.c' || echo '$(srcdir)/'`paned-window.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/motif_la-paned-window.Tpo $(DEPDIR)/motif_la-paned-window.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='paned-window.c' object='motif_la-paned-window.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -c -o motif_la-paned-window.lo `test -f 'paned-window.c' || echo '$(srcdir)/'`paned-window.c motif_la-push-button.lo: push-button.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -MT motif_la-push-button.lo -MD -MP -MF $(DEPDIR)/motif_la-push-button.Tpo -c -o motif_la-push-button.lo `test -f 'push-button.c' || echo '$(srcdir)/'`push-button.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/motif_la-push-button.Tpo $(DEPDIR)/motif_la-push-button.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='push-button.c' object='motif_la-push-button.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -c -o motif_la-push-button.lo `test -f 'push-button.c' || echo '$(srcdir)/'`push-button.c motif_la-row-column.lo: row-column.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -MT motif_la-row-column.lo -MD -MP -MF $(DEPDIR)/motif_la-row-column.Tpo -c -o motif_la-row-column.lo `test -f 'row-column.c' || echo '$(srcdir)/'`row-column.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/motif_la-row-column.Tpo $(DEPDIR)/motif_la-row-column.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='row-column.c' object='motif_la-row-column.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -c -o motif_la-row-column.lo `test -f 'row-column.c' || echo '$(srcdir)/'`row-column.c motif_la-scale.lo: scale.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -MT motif_la-scale.lo -MD -MP -MF $(DEPDIR)/motif_la-scale.Tpo -c -o motif_la-scale.lo `test -f 'scale.c' || echo '$(srcdir)/'`scale.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/motif_la-scale.Tpo $(DEPDIR)/motif_la-scale.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='scale.c' object='motif_la-scale.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -c -o motif_la-scale.lo `test -f 'scale.c' || echo '$(srcdir)/'`scale.c motif_la-scroll-bar.lo: scroll-bar.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -MT motif_la-scroll-bar.lo -MD -MP -MF $(DEPDIR)/motif_la-scroll-bar.Tpo -c -o motif_la-scroll-bar.lo `test -f 'scroll-bar.c' || echo '$(srcdir)/'`scroll-bar.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/motif_la-scroll-bar.Tpo $(DEPDIR)/motif_la-scroll-bar.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='scroll-bar.c' object='motif_la-scroll-bar.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -c -o motif_la-scroll-bar.lo `test -f 'scroll-bar.c' || echo '$(srcdir)/'`scroll-bar.c motif_la-scrolled-win.lo: scrolled-win.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -MT motif_la-scrolled-win.lo -MD -MP -MF $(DEPDIR)/motif_la-scrolled-win.Tpo -c -o motif_la-scrolled-win.lo `test -f 'scrolled-win.c' || echo '$(srcdir)/'`scrolled-win.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/motif_la-scrolled-win.Tpo $(DEPDIR)/motif_la-scrolled-win.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='scrolled-win.c' object='motif_la-scrolled-win.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -c -o motif_la-scrolled-win.lo `test -f 'scrolled-win.c' || echo '$(srcdir)/'`scrolled-win.c motif_la-selectn-box.lo: selectn-box.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -MT motif_la-selectn-box.lo -MD -MP -MF $(DEPDIR)/motif_la-selectn-box.Tpo -c -o motif_la-selectn-box.lo `test -f 'selectn-box.c' || echo '$(srcdir)/'`selectn-box.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/motif_la-selectn-box.Tpo $(DEPDIR)/motif_la-selectn-box.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='selectn-box.c' object='motif_la-selectn-box.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -c -o motif_la-selectn-box.lo `test -f 'selectn-box.c' || echo '$(srcdir)/'`selectn-box.c motif_la-separator.lo: separator.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -MT motif_la-separator.lo -MD -MP -MF $(DEPDIR)/motif_la-separator.Tpo -c -o motif_la-separator.lo `test -f 'separator.c' || echo '$(srcdir)/'`separator.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/motif_la-separator.Tpo $(DEPDIR)/motif_la-separator.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='separator.c' object='motif_la-separator.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -c -o motif_la-separator.lo `test -f 'separator.c' || echo '$(srcdir)/'`separator.c motif_la-shell.lo: shell.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -MT motif_la-shell.lo -MD -MP -MF $(DEPDIR)/motif_la-shell.Tpo -c -o motif_la-shell.lo `test -f 'shell.c' || echo '$(srcdir)/'`shell.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/motif_la-shell.Tpo $(DEPDIR)/motif_la-shell.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='shell.c' object='motif_la-shell.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -c -o motif_la-shell.lo `test -f 'shell.c' || echo '$(srcdir)/'`shell.c motif_la-support.lo: support.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -MT motif_la-support.lo -MD -MP -MF $(DEPDIR)/motif_la-support.Tpo -c -o motif_la-support.lo `test -f 'support.c' || echo '$(srcdir)/'`support.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/motif_la-support.Tpo $(DEPDIR)/motif_la-support.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='support.c' object='motif_la-support.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -c -o motif_la-support.lo `test -f 'support.c' || echo '$(srcdir)/'`support.c motif_la-text.lo: text.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -MT motif_la-text.lo -MD -MP -MF $(DEPDIR)/motif_la-text.Tpo -c -o motif_la-text.lo `test -f 'text.c' || echo '$(srcdir)/'`text.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/motif_la-text.Tpo $(DEPDIR)/motif_la-text.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='text.c' object='motif_la-text.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -c -o motif_la-text.lo `test -f 'text.c' || echo '$(srcdir)/'`text.c motif_la-toggle-btn.lo: toggle-btn.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -MT motif_la-toggle-btn.lo -MD -MP -MF $(DEPDIR)/motif_la-toggle-btn.Tpo -c -o motif_la-toggle-btn.lo `test -f 'toggle-btn.c' || echo '$(srcdir)/'`toggle-btn.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/motif_la-toggle-btn.Tpo $(DEPDIR)/motif_la-toggle-btn.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='toggle-btn.c' object='motif_la-toggle-btn.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(motif_la_CFLAGS) $(CFLAGS) -c -o motif_la-toggle-btn.lo `test -f 'toggle-btn.c' || echo '$(srcdir)/'`toggle-btn.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES .d.c: $(top_builddir)/src/elk -g -p .:$(top_srcdir)/scm:$(srcdir)/.. -l mkwidget.scm $< $@ motif echo-sources: ; echo $(SOURCES) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: elk-3.99.8/lib/xwidgets/motif/scroll-bar.c0000644000175000017500000000577111577076426015277 00000000000000#include "../xt.h" #include #include static Object Get_Scrollbar_CB (XmScrollBarCallbackStruct *p) { Object ret, s; GC_Node2; ret = s = Cons (Make_Integer (p->pixel), Null); GC_Link2 (ret, s); ret = Cons (Make_Integer (p->value), ret); s = Get_Any_CB ((XmAnyCallbackStruct *)p); ret = Cons (Cdr (s), ret); ret = Cons (Car (s), ret); GC_Unlink; return ret; } static Object S_Callback_Scroll_Bar_DecrementCallback (XtArgVal x) { return Get_Scrollbar_CB ((XmScrollBarCallbackStruct *)x); } static Object S_Callback_Scroll_Bar_IncrementCallback (XtArgVal x) { return Get_Scrollbar_CB ((XmScrollBarCallbackStruct *)x); } static Object S_Callback_Scroll_Bar_PageDecrementCallback (XtArgVal x) { return Get_Scrollbar_CB ((XmScrollBarCallbackStruct *)x); } static Object S_Callback_Scroll_Bar_PageIncrementCallback (XtArgVal x) { return Get_Scrollbar_CB ((XmScrollBarCallbackStruct *)x); } static Object S_Callback_Scroll_Bar_DragCallback (XtArgVal x) { return Get_Scrollbar_CB ((XmScrollBarCallbackStruct *)x); } static Object S_Callback_Scroll_Bar_ToTopCallback (XtArgVal x) { return Get_Scrollbar_CB ((XmScrollBarCallbackStruct *)x); } static Object S_Callback_Scroll_Bar_ToBottomCallback (XtArgVal x) { return Get_Scrollbar_CB ((XmScrollBarCallbackStruct *)x); } static Object S_Callback_Scroll_Bar_ValueChangedCallback (XtArgVal x) { return Get_Scrollbar_CB ((XmScrollBarCallbackStruct *)x); } void elk_init_motif_scrollbar () { XtResourceList r = 0; Define_Class ("scroll-bar", xmScrollBarWidgetClass, r, 0); Define_Callback ("scroll-bar", "valueChangedCallback", 1); Define_Callback ("scroll-bar", "toBottomCallback", 1); Define_Callback ("scroll-bar", "toTopCallback", 1); Define_Callback ("scroll-bar", "dragCallback", 1); Define_Callback ("scroll-bar", "pageIncrementCallback", 1); Define_Callback ("scroll-bar", "pageDecrementCallback", 1); Define_Callback ("scroll-bar", "incrementCallback", 1); Define_Callback ("scroll-bar", "decrementCallback", 1); Define_Converter_To_Scheme ("callback:scroll-bar-valueChangedCallback", S_Callback_Scroll_Bar_ValueChangedCallback); Define_Converter_To_Scheme ("callback:scroll-bar-toBottomCallback", S_Callback_Scroll_Bar_ToBottomCallback); Define_Converter_To_Scheme ("callback:scroll-bar-toTopCallback", S_Callback_Scroll_Bar_ToTopCallback); Define_Converter_To_Scheme ("callback:scroll-bar-dragCallback", S_Callback_Scroll_Bar_DragCallback); Define_Converter_To_Scheme ("callback:scroll-bar-pageIncrementCallback", S_Callback_Scroll_Bar_PageIncrementCallback); Define_Converter_To_Scheme ("callback:scroll-bar-pageDecrementCallback", S_Callback_Scroll_Bar_PageDecrementCallback); Define_Converter_To_Scheme ("callback:scroll-bar-incrementCallback", S_Callback_Scroll_Bar_IncrementCallback); Define_Converter_To_Scheme ("callback:scroll-bar-decrementCallback", S_Callback_Scroll_Bar_DecrementCallback); P_Provide(Intern("motif:scroll-bar")); } elk-3.99.8/lib/xwidgets/motif/separator.d0000644000175000017500000000260611577076306015227 00000000000000;; separator.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'separator '("Separator.h" "SeparatoG.h")) (define-widget-class 'separator 'xmSeparatorWidgetClass) (define-widget-class 'separator-gadget 'xmSeparatorGadgetClass) elk-3.99.8/lib/xwidgets/motif/paned-window.d0000644000175000017500000000262711577076306015626 00000000000000;; paned-window.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'panedwindow "PanedW.h") (prolog "extern WidgetClass xmSashWidgetClass;") (define-widget-class 'paned-window 'xmPanedWindowWidgetClass) (define-widget-class 'sash 'xmSashWidgetClass) elk-3.99.8/lib/xwidgets/motif/scale.c0000644000175000017500000000247011577076426014317 00000000000000#include "../xt.h" #include #include static Object Get_Scale_CB (XmScaleCallbackStruct *p) { Object ret, s; extern SYMDESCR Reason_Syms[]; GC_Node2; ret = s = Make_Integer (p->value); GC_Link2 (ret, s); ret = Cons (ret, Null); #ifdef SCALE_WIDGET_WORKS /* It doesn't. */ s = Get_Any_CB ((XmAnyCallbackStruct *)p); #else s = Intern ("event-goes-here-when-Xm-is-fixed"); s = Cons (s, Null); s = Cons (Bits_To_Symbols ((unsigned long)p->reason, 0, Reason_Syms), s); #endif ret = Cons (Cdr (s), ret); ret = Cons (Car (s), ret); GC_Unlink; return ret; } static Object S_Callback_Scale_DragCallback (XtArgVal x) { return Get_Scale_CB ((XmScaleCallbackStruct *)x); } static Object S_Callback_Scale_ValueChangedCallback (XtArgVal x) { return Get_Scale_CB ((XmScaleCallbackStruct *)x); } void elk_init_motif_scale () { XtResourceList r = 0; Define_Class ("scale", xmScaleWidgetClass, r, 0); Define_Callback ("scale", "valueChangedCallback", 1); Define_Callback ("scale", "dragCallback", 1); Define_Converter_To_Scheme ("callback:scale-valueChangedCallback", S_Callback_Scale_ValueChangedCallback); Define_Converter_To_Scheme ("callback:scale-dragCallback", S_Callback_Scale_DragCallback); P_Provide(Intern("motif:scale")); } elk-3.99.8/lib/xwidgets/motif/arrow-button.d0000644000175000017500000000334511577076306015673 00000000000000;; arrow-button.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'arrowbutton '("ArrowB.h" "ArrowBG.h")) (define-widget-class 'arrow-button 'xmArrowButtonWidgetClass) (define-widget-class 'arrow-button-gadget 'xmArrowButtonGadgetClass) (define-callback 'arrow-button 'activateCallback #t) (define-callback 'arrow-button 'armCallback #t) (define-callback 'arrow-button 'disarmCallback #t) (define-callback 'arrow-button-gadget 'activateCallback #t) (define-callback 'arrow-button-gadget 'armCallback #t) (define-callback 'arrow-button-gadget 'disarmCallback #t) elk-3.99.8/lib/xwidgets/motif/label.c0000644000175000017500000000045011577076426014303 00000000000000#include "../xt.h" #include #include #include void elk_init_motif_label () { XtResourceList r = 0; Define_Class ("label-gadget", xmLabelGadgetClass, r, 0); Define_Class ("label", xmLabelWidgetClass, r, 0); P_Provide(Intern("motif:label")); } elk-3.99.8/lib/xwidgets/motif/row-column.d0000644000175000017500000001003511577076306015324 00000000000000;; row-column.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'rowcolumn "RowColumn.h") (prolog "static SYMDESCR Type_Syms[] = { { \"work-area\", XmWORK_AREA }, { \"menu-bar\", XmMENU_BAR }, { \"menu-pulldown\", XmMENU_PULLDOWN }, { \"menu-popup\", XmMENU_POPUP }, { \"menu-option\", XmMENU_OPTION }, { 0, 0} };") (define-widget-class 'row-column 'xmRowColumnWidgetClass) (prolog "static void Post_Handler (Widget w, XtPointer client_data, XEvent *event, Boolean *unused) { unsigned int b; Arg a; XButtonPressedEvent *ep = (XButtonPressedEvent *)event; Widget popup = (Widget)client_data; XtSetArg (a, XmNwhichButton, &b); XtGetValues (popup, &a, 1); if (ep->button != b) return; XmMenuPosition (popup, ep); XtManageChild (popup); }") (prolog "static Object Get_Row_Column_CB (XmRowColumnCallbackStruct *p) { Object ret, s; GC_Node2; ret = s = Make_Widget_Foreign (p->widget); GC_Link2 (ret, s); ret = Cons (ret, Null); s = Get_Any_CB ((XmAnyCallbackStruct *)p); ret = Cons (Cdr (s), ret); ret = Cons (Car (s), ret); GC_Unlink; return ret; }") (define-primitive 'popup-menu-attach-to! '(m w) " XtPointer client_data; Arg a; Check_Widget_Class (m, xmRowColumnWidgetClass); Check_Widget (w); XtSetArg (a, XmNuserData, &client_data); XtGetValues (WIDGET(w)->widget, &a, 1); if (client_data) XtRemoveEventHandler (WIDGET(w)->widget, ButtonPressMask, 0, Post_Handler, client_data); client_data = (XtPointer)WIDGET(m)->widget; XtAddEventHandler (WIDGET(w)->widget, ButtonPressMask, 0, Post_Handler, client_data); client_data = (XtPointer)WIDGET(m)->widget; XtSetValues (WIDGET(w)->widget, &a, 1); return Void;") (define-callback 'row-column 'entryCallback #t) (define row-column-callback->scheme " return Get_Row_Column_CB ((XmRowColumnCallbackStruct *)x);") (c->scheme 'callback:row-column-entryCallback row-column-callback->scheme) (define scheme->row-column-type " return (XtArgVal)Symbols_To_Bits (x, 0, Type_Syms);") ;;; whichButton resource is declared with a type of XtRWhichButton ;;; instead of XtRUnsignedInt. Argh! (define scheme->which-button " return (XtArgVal)Get_Integer (x);") (define which-button->scheme " return Make_Integer (x);") ;;; entryClass is declared as int! Bletch! (define scheme->entry-class " Check_Type (x, T_Class); return (XtArgVal)CLASS(x)->wclass;") (define entry-class->scheme " return Make_Widget_Class ((WidgetClass)x);") (scheme->c 'row-column-rowColumnType scheme->row-column-type) (scheme->c 'row-column-whichButton scheme->which-button) (c->scheme 'row-column-whichButton which-button->scheme) (scheme->c 'row-column-entryClass scheme->entry-class) (c->scheme 'row-column-entryClass entry-class->scheme) elk-3.99.8/lib/xwidgets/motif/label.d0000644000175000017500000000254711577076306014312 00000000000000;; label.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'label '("Label.h" "LabelG.h")) (define-widget-class 'label 'xmLabelWidgetClass) (define-widget-class 'label-gadget 'xmLabelGadgetClass) elk-3.99.8/lib/xwidgets/motif/drawn-button.c0000644000175000017500000000102511577076426015647 00000000000000#include "../xt.h" #include #include void elk_init_motif_drawnbutton () { XtResourceList r = 0; Define_Class ("drawn-button", xmDrawnButtonWidgetClass, r, 0); Define_Callback ("drawn-button", "resizeCallback", 1); Define_Callback ("drawn-button", "exposeCallback", 1); Define_Callback ("drawn-button", "disarmCallback", 1); Define_Callback ("drawn-button", "armCallback", 1); Define_Callback ("drawn-button", "activateCallback", 1); P_Provide(Intern("motif:drawn-button")); } elk-3.99.8/lib/xwidgets/motif/push-button.c0000644000175000017500000000127011577076426015515 00000000000000#include "../xt.h" #include #include #include void elk_init_motif_pushbutton () { XtResourceList r = 0; Define_Class ("push-button-gadget", xmPushButtonGadgetClass, r, 0); Define_Class ("push-button", xmPushButtonWidgetClass, r, 0); Define_Callback ("push-button-gadget", "disarmCallback", 1); Define_Callback ("push-button-gadget", "armCallback", 1); Define_Callback ("push-button-gadget", "activateCallback", 1); Define_Callback ("push-button", "disarmCallback", 1); Define_Callback ("push-button", "armCallback", 1); Define_Callback ("push-button", "activateCallback", 1); P_Provide(Intern("motif:push-button")); } elk-3.99.8/lib/xwidgets/motif/cascade-btn.c0000644000175000017500000000115211577076426015370 00000000000000#include "../xt.h" #include #include #include void elk_init_motif_cascadebutton () { XtResourceList r = 0; Define_Class ("cascade-button-gadget", xmCascadeButtonGadgetClass, r, 0); Define_Class ("cascade-button", xmCascadeButtonWidgetClass, r, 0); Define_Callback ("cascade-button-gadget", "cascadingCallback", 1); Define_Callback ("cascade-button-gadget", "activateCallback", 1); Define_Callback ("cascade-button", "cascadingCallback", 1); Define_Callback ("cascade-button", "activateCallback", 1); P_Provide(Intern("motif:cascade-btn")); } elk-3.99.8/lib/xwidgets/motif/scroll-bar.d0000644000175000017500000000574611577076306015277 00000000000000;; scroll-bar.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'scrollbar "ScrollBar.h") (define-widget-class 'scroll-bar 'xmScrollBarWidgetClass) (prolog "static Object Get_Scrollbar_CB (XmScrollBarCallbackStruct *p) { Object ret, s; GC_Node2; ret = s = Cons (Make_Integer (p->pixel), Null); GC_Link2 (ret, s); ret = Cons (Make_Integer (p->value), ret); s = Get_Any_CB ((XmAnyCallbackStruct *)p); ret = Cons (Cdr (s), ret); ret = Cons (Car (s), ret); GC_Unlink; return ret; }") (define-callback 'scroll-bar 'decrementCallback #t) (define-callback 'scroll-bar 'incrementCallback #t) (define-callback 'scroll-bar 'pageDecrementCallback #t) (define-callback 'scroll-bar 'pageIncrementCallback #t) (define-callback 'scroll-bar 'dragCallback #t) (define-callback 'scroll-bar 'toTopCallback #t) (define-callback 'scroll-bar 'toBottomCallback #t) (define-callback 'scroll-bar 'valueChangedCallback #t) (define scrollbar-callback->scheme " return Get_Scrollbar_CB ((XmScrollBarCallbackStruct *)x);") (c->scheme 'callback:scroll-bar-decrementCallback scrollbar-callback->scheme) (c->scheme 'callback:scroll-bar-incrementCallback scrollbar-callback->scheme) (c->scheme 'callback:scroll-bar-pageDecrementCallback scrollbar-callback->scheme) (c->scheme 'callback:scroll-bar-pageIncrementCallback scrollbar-callback->scheme) (c->scheme 'callback:scroll-bar-dragCallback scrollbar-callback->scheme) (c->scheme 'callback:scroll-bar-toTopCallback scrollbar-callback->scheme) (c->scheme 'callback:scroll-bar-toBottomCallback scrollbar-callback->scheme) (c->scheme 'callback:scroll-bar-valueChangedCallback scrollbar-callback->scheme) elk-3.99.8/lib/xwidgets/motif/separator.c0000644000175000017500000000050711577076426015227 00000000000000#include "../xt.h" #include #include #include void elk_init_motif_separator () { XtResourceList r = 0; Define_Class ("separator-gadget", xmSeparatorGadgetClass, r, 0); Define_Class ("separator", xmSeparatorWidgetClass, r, 0); P_Provide(Intern("motif:separator")); } elk-3.99.8/lib/xwidgets/motif/scrolled-win.c0000644000175000017500000000144711577076426015635 00000000000000#include "../xt.h" #include #include static SYMDESCR Scrolling_Syms[] = { { "automatic", XmAUTOMATIC }, { "application-defined", XmAPPLICATION_DEFINED }, { "AUTOMATIC", XmAUTOMATIC }, /* see above */ { "APPLICATION_DEFINED", XmAPPLICATION_DEFINED }, { "application_defined", XmAPPLICATION_DEFINED }, { 0, 0} }; static XtArgVal C_ScrollingPolicy (Object x) { if (TYPE(x) == T_String) x = P_String_To_Symbol(x); return (XtArgVal)Symbols_To_Bits (x, 0, Scrolling_Syms); } void elk_init_motif_scrolledwindow () { XtResourceList r = 0; Define_Class ("scrolled-window", xmScrolledWindowWidgetClass, r, 0); Define_Converter_To_C ("scrollingPolicy", C_ScrollingPolicy); P_Provide(Intern("motif:scrolled-win")); } elk-3.99.8/lib/xwidgets/motif/form.d0000644000175000017500000000242511577076306014171 00000000000000;; form.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'form "Form.h") (define-widget-class 'form 'xmFormWidgetClass) elk-3.99.8/lib/xwidgets/motif/push-button.d0000644000175000017500000000332711577076306015520 00000000000000;; push-button.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'pushbutton '("PushB.h" "PushBG.h")) (define-widget-class 'push-button 'xmPushButtonWidgetClass) (define-widget-class 'push-button-gadget 'xmPushButtonGadgetClass) (define-callback 'push-button 'activateCallback #t) (define-callback 'push-button 'armCallback #t) (define-callback 'push-button 'disarmCallback #t) (define-callback 'push-button-gadget 'activateCallback #t) (define-callback 'push-button-gadget 'armCallback #t) (define-callback 'push-button-gadget 'disarmCallback #t) elk-3.99.8/lib/xwidgets/motif/scale.d0000644000175000017500000000426411577076306014320 00000000000000;; scale.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'scale "Scale.h") (define-widget-class 'scale 'xmScaleWidgetClass) (prolog "static Object Get_Scale_CB (XmScaleCallbackStruct *p) { Object ret, s; extern SYMDESCR Reason_Syms[]; GC_Node2; ret = s = Make_Integer (p->value); GC_Link2 (ret, s); ret = Cons (ret, Null); #ifdef SCALE_WIDGET_WORKS /* It doesn't. */ s = Get_Any_CB ((XmAnyCallbackStruct *)p); #else s = Intern (\"event-goes-here-when-Xm-is-fixed\"); s = Cons (s, Null); s = Cons (Bits_To_Symbols ((unsigned long)p->reason, 0, Reason_Syms), s); #endif ret = Cons (Cdr (s), ret); ret = Cons (Car (s), ret); GC_Unlink; return ret; }") (define-callback 'scale 'dragCallback #t) (define-callback 'scale 'valueChangedCallback #t) (define scale-callback->scheme " return Get_Scale_CB ((XmScaleCallbackStruct *)x);") (c->scheme 'callback:scale-dragCallback scale-callback->scheme) (c->scheme 'callback:scale-valueChangedCallback scale-callback->scheme) elk-3.99.8/lib/xwidgets/motif/paned-window.c0000644000175000017500000000051211577076426015617 00000000000000#include "../xt.h" #include #include extern WidgetClass xmSashWidgetClass; void elk_init_motif_panedwindow () { XtResourceList r = 0; Define_Class ("sash", xmSashWidgetClass, r, 0); Define_Class ("paned-window", xmPanedWindowWidgetClass, r, 0); P_Provide(Intern("motif:paned-window")); } elk-3.99.8/lib/xwidgets/motif/frame.c0000644000175000017500000000032411577076426014316 00000000000000#include "../xt.h" #include #include void elk_init_motif_frame () { XtResourceList r = 0; Define_Class ("frame", xmFrameWidgetClass, r, 0); P_Provide(Intern("motif:frame")); } elk-3.99.8/lib/xwidgets/motif/selectn-box.d0000644000175000017500000000365211577076306015454 00000000000000;; selectn-box.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'selectionbox "SelectioB.h") (prolog "static SYMDESCR Type_Syms[] = { { \"dialog-prompt\", XmDIALOG_PROMPT }, { \"dialog-selection\", XmDIALOG_SELECTION }, { \"dialog-work-area\", XmDIALOG_WORK_AREA }, { 0, 0} };") (define-widget-class 'selection-box 'xmSelectionBoxWidgetClass) (define scheme->dialog-type " return (XtArgVal)Symbols_To_Bits (x, 0, Type_Syms);") (scheme->c 'selection-box-dialogType scheme->dialog-type) (define-callback 'selection-box 'applyCallback #t) (define-callback 'selection-box 'cancelCallback #t) (define-callback 'selection-box 'noMatchCallback #t) (define-callback 'selection-box 'okCallback #t) (define-callback 'selection-box 'helpCallback #t) elk-3.99.8/lib/xwidgets/motif/text.c0000644000175000017500000000334111577076426014212 00000000000000#include "../xt.h" #include #include static Object S_Callback_Text_ValueChangedCallback (XtArgVal x) { return Get_Any_CB ((XmAnyCallbackStruct *)x); } void elk_init_motif_text () { XtResourceList r = 0; r = (XtResourceList)XtMalloc (10 * sizeof (XtResource)); r[0].resource_name = "pendingDelete"; r[0].resource_class = "PendingDelete"; r[0].resource_type = "Boolean"; r[1].resource_name = "selectThreshold"; r[1].resource_class = "SelectThreshold"; r[1].resource_type = "Int"; r[2].resource_name = "blinkRate"; r[2].resource_class = "BlinkRate"; r[2].resource_type = "Int"; r[3].resource_name = "columns"; r[3].resource_class = "Columns"; r[3].resource_type = "Short"; r[4].resource_name = "cursorPositionVisible"; r[4].resource_class = "CursorPositionVisible"; r[4].resource_type = "Boolean"; r[5].resource_name = "fontList"; r[5].resource_class = "FontList"; r[5].resource_type = "FontList"; r[6].resource_name = "resizeHeight"; r[6].resource_class = "ResizeHeight"; r[6].resource_type = "Boolean"; r[7].resource_name = "resizeWidth"; r[7].resource_class = "ResizeWidth"; r[7].resource_type = "Boolean"; r[8].resource_name = "rows"; r[8].resource_class = "Rows"; r[8].resource_type = "Short"; r[9].resource_name = "wordWrap"; r[9].resource_class = "WordWrap"; r[9].resource_type = "Boolean"; Define_Class ("text", xmTextWidgetClass, r, 10); Define_Callback ("text", "valueChangedCallback", 1); Define_Callback ("text", "activateCallback", 1); Define_Converter_To_Scheme ("callback:text-valueChangedCallback", S_Callback_Text_ValueChangedCallback); P_Provide(Intern("motif:text")); } elk-3.99.8/lib/xwidgets/motif/list.d0000644000175000017500000000665111577076306014206 00000000000000;; list.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'list "List.h") (define-widget-class 'list 'xmListWidgetClass) (prolog "static Object String_Table_To_Scheme (XmString *tab, int len) { Object ret, tail; char *text; GC_Node2; tail = ret = P_Make_List (Make_Integer (len), Null); GC_Link2 (ret, tail); for ( ; len > 0; len--, tail = Cdr (tail)) { if (!XmStringGetLtoR (*tab++, XmSTRING_DEFAULT_CHARSET, &text)) text = \"\"; Car (tail) = Make_String (text, strlen (text)); } GC_Unlink; return ret; }") (prolog "static SYMDESCR Type_Syms[] = { { \"initial\", XmINITIAL }, { \"modification\", XmMODIFICATION }, { \"addition\", XmADDITION }, { 0, 0} };") (prolog "static Object Get_List_CB (XmListCallbackStruct *p) { Object ret, s; char *text; GC_Node2; if (!XmStringGetLtoR (p->item, XmSTRING_DEFAULT_CHARSET, &text)) text = \"\"; ret = s = Make_String (text, strlen (text)); GC_Link2 (ret, s); ret = Cons (ret, Null); if (p->reason == XmCR_MULTIPLE_SELECT || p->reason == XmCR_EXTENDED_SELECT) { s = String_Table_To_Scheme (p->selected_items, p->selected_item_count); ret = Cons (s, ret); s = Bits_To_Symbols ((unsigned long)p->selection_type, 0, Type_Syms); ret = Cons (s, ret); } else { ret = Cons (Make_Integer (p->item_position), ret); } s = Get_Any_CB ((XmAnyCallbackStruct *)p); ret = Cons (Cdr (s), ret); ret = Cons (Car (s), ret); GC_Unlink; return ret; }") (define-callback 'list 'browseSelectionCallback #t) (define-callback 'list 'defaultActionCallback #t) (define-callback 'list 'extendedSelectionCallback #t) (define-callback 'list 'multipleSelectionCallback #t) (define-callback 'list 'singleSelectionCallback #t) (define list-callback->scheme " return Get_List_CB ((XmListCallbackStruct *)x);") (c->scheme 'callback:list-browseSelectionCallback list-callback->scheme) (c->scheme 'callback:list-defaultActionCallback list-callback->scheme) (c->scheme 'callback:list-extendedSelectionCallback list-callback->scheme) (c->scheme 'callback:list-multipleSelectionCallback list-callback->scheme) (c->scheme 'callback:list-singleSelectionCallback list-callback->scheme) elk-3.99.8/lib/xwidgets/motif/file-selectn.d0000644000175000017500000000311511577076306015575 00000000000000;; file-selectn.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'fileselection "FileSB.h") (define-widget-class 'file-selection 'xmFileSelectionBoxWidgetClass) (define-callback 'file-selection 'applyCallback #t) (define-callback 'file-selection 'cancelCallback #t) (define-callback 'file-selection 'noMatchCallback #t) (define-callback 'file-selection 'okCallback #t) (define-callback 'file-selection 'helpCallback #t) elk-3.99.8/lib/xwidgets/motif/message-box.c0000644000175000017500000000245711577076426015447 00000000000000#include "../xt.h" #include #include static SYMDESCR Type_Syms[] = { { "dialog-error", XmDIALOG_ERROR }, { "dialog-information", XmDIALOG_INFORMATION }, { "dialog-message", XmDIALOG_MESSAGE }, { "dialog-question", XmDIALOG_QUESTION }, { "dialog-warning", XmDIALOG_WARNING }, { "dialog-working", XmDIALOG_WORKING }, { 0, 0} }; static XtArgVal C_Message_Box_DialogType (Object x) { return (XtArgVal)Symbols_To_Bits (x, 0, Type_Syms); } static Object S_Callback_Message_Box_CancelCallback (XtArgVal x) { return Get_Any_CB ((XmAnyCallbackStruct *)x); } static Object S_Callback_Message_Box_OkCallback (XtArgVal x) { return Get_Any_CB ((XmAnyCallbackStruct *)x); } void elk_init_motif_messagebox () { XtResourceList r = 0; Define_Class ("message-box", xmMessageBoxWidgetClass, r, 0); Define_Callback ("message-box", "okCallback", 1); Define_Callback ("message-box", "cancelCallback", 1); Define_Converter_To_Scheme ("callback:message-box-okCallback", S_Callback_Message_Box_OkCallback); Define_Converter_To_Scheme ("callback:message-box-cancelCallback", S_Callback_Message_Box_CancelCallback); Define_Converter_To_C ("message-box-dialogType", C_Message_Box_DialogType); P_Provide(Intern("motif:message-box")); } elk-3.99.8/lib/xwidgets/motif/shell.c0000644000175000017500000000203211577076426014331 00000000000000#include "../xt.h" #include #include #include void elk_init_motif_shell () { XtResourceList r = 0; r = (XtResourceList)XtMalloc (2 * sizeof (XtResource)); r[0].resource_name = "width"; r[0].resource_class = "Width"; r[0].resource_type = "Dimension"; r[1].resource_name = "height"; r[1].resource_class = "Height"; r[1].resource_type = "Dimension"; Define_Class ("menu-shell", xmMenuShellWidgetClass, r, 2); Define_Class ("dialog-shell", xmDialogShellWidgetClass, r, 0); Define_Class ("application-shell", applicationShellWidgetClass, r, 0); Define_Class ("toplevel-shell", topLevelShellWidgetClass, r, 0); Define_Class ("transient-shell", transientShellWidgetClass, r, 0); Define_Class ("vendor-shell", vendorShellWidgetClass, r, 0); Define_Class ("wm-shell", wmShellWidgetClass, r, 0); Define_Class ("override-shell", overrideShellWidgetClass, r, 0); Define_Class ("shell", shellWidgetClass, r, 0); P_Provide(Intern("motif:shell")); } elk-3.99.8/lib/xwidgets/motif/cascade-btn.d0000644000175000017500000000321511577076306015370 00000000000000;; cascade-btn.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'cascadebutton '("CascadeB.h" "CascadeBG.h")) (define-widget-class 'cascade-button 'xmCascadeButtonWidgetClass) (define-widget-class 'cascade-button-gadget 'xmCascadeButtonGadgetClass) (define-callback 'cascade-button 'activateCallback #t) (define-callback 'cascade-button 'cascadingCallback #t) (define-callback 'cascade-button-gadget 'activateCallback #t) (define-callback 'cascade-button-gadget 'cascadingCallback #t) elk-3.99.8/lib/xwidgets/motif/list.c0000644000175000017500000000606311577076426014205 00000000000000#include "../xt.h" #include #include static Object String_Table_To_Scheme (XmString *tab, int len) { Object ret, tail; char *text; GC_Node2; tail = ret = P_Make_List (Make_Integer (len), Null); GC_Link2 (ret, tail); for ( ; len > 0; len--, tail = Cdr (tail)) { if (!XmStringGetLtoR (*tab++, XmSTRING_DEFAULT_CHARSET, &text)) text = ""; Car (tail) = Make_String (text, strlen (text)); } GC_Unlink; return ret; } static SYMDESCR Type_Syms[] = { { "initial", XmINITIAL }, { "modification", XmMODIFICATION }, { "addition", XmADDITION }, { 0, 0} }; static Object Get_List_CB (XmListCallbackStruct *p) { Object ret, s; char *text; GC_Node2; if (!XmStringGetLtoR (p->item, XmSTRING_DEFAULT_CHARSET, &text)) text = ""; ret = s = Make_String (text, strlen (text)); GC_Link2 (ret, s); ret = Cons (ret, Null); if (p->reason == XmCR_MULTIPLE_SELECT || p->reason == XmCR_EXTENDED_SELECT) { s = String_Table_To_Scheme (p->selected_items, p->selected_item_count); ret = Cons (s, ret); s = Bits_To_Symbols ((unsigned long)p->selection_type, 0, Type_Syms); ret = Cons (s, ret); } else { ret = Cons (Make_Integer (p->item_position), ret); } s = Get_Any_CB ((XmAnyCallbackStruct *)p); ret = Cons (Cdr (s), ret); ret = Cons (Car (s), ret); GC_Unlink; return ret; } static Object S_Callback_List_BrowseSelectionCallback (XtArgVal x) { return Get_List_CB ((XmListCallbackStruct *)x); } static Object S_Callback_List_DefaultActionCallback (XtArgVal x) { return Get_List_CB ((XmListCallbackStruct *)x); } static Object S_Callback_List_ExtendedSelectionCallback (XtArgVal x) { return Get_List_CB ((XmListCallbackStruct *)x); } static Object S_Callback_List_MultipleSelectionCallback (XtArgVal x) { return Get_List_CB ((XmListCallbackStruct *)x); } static Object S_Callback_List_SingleSelectionCallback (XtArgVal x) { return Get_List_CB ((XmListCallbackStruct *)x); } void elk_init_motif_list () { XtResourceList r = 0; Define_Class ("list", xmListWidgetClass, r, 0); Define_Callback ("list", "singleSelectionCallback", 1); Define_Callback ("list", "multipleSelectionCallback", 1); Define_Callback ("list", "extendedSelectionCallback", 1); Define_Callback ("list", "defaultActionCallback", 1); Define_Callback ("list", "browseSelectionCallback", 1); Define_Converter_To_Scheme ("callback:list-singleSelectionCallback", S_Callback_List_SingleSelectionCallback); Define_Converter_To_Scheme ("callback:list-multipleSelectionCallback", S_Callback_List_MultipleSelectionCallback); Define_Converter_To_Scheme ("callback:list-extendedSelectionCallback", S_Callback_List_ExtendedSelectionCallback); Define_Converter_To_Scheme ("callback:list-defaultActionCallback", S_Callback_List_DefaultActionCallback); Define_Converter_To_Scheme ("callback:list-browseSelectionCallback", S_Callback_List_BrowseSelectionCallback); P_Provide(Intern("motif:list")); } elk-3.99.8/lib/xwidgets/motif/shell.d0000644000175000017500000000352011577076306014332 00000000000000;; shell.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'shell '(DialogS.h MenuShell.h)) (define-widget-class 'shell 'shellWidgetClass) (define-widget-class 'override-shell 'overrideShellWidgetClass) (define-widget-class 'wm-shell 'wmShellWidgetClass) (define-widget-class 'vendor-shell 'vendorShellWidgetClass) (define-widget-class 'transient-shell 'transientShellWidgetClass) (define-widget-class 'toplevel-shell 'topLevelShellWidgetClass) (define-widget-class 'application-shell 'applicationShellWidgetClass) (define-widget-class 'dialog-shell 'xmDialogShellWidgetClass) (define-widget-class 'menu-shell 'xmMenuShellWidgetClass '(width Width Dimension) '(height Height Dimension)) elk-3.99.8/lib/xwidgets/motif/bulletin-brd.c0000644000175000017500000000037011577076426015610 00000000000000#include "../xt.h" #include #include void elk_init_motif_bulletinboard () { XtResourceList r = 0; Define_Class ("bulletin-board", xmBulletinBoardWidgetClass, r, 0); P_Provide(Intern("motif:bulletin-brd")); } elk-3.99.8/lib/xwidgets/motif/toggle-btn.d0000644000175000017500000000426111577076306015270 00000000000000;; toggle-btn.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'togglebutton '("ToggleB.h" "ToggleBG.h")) (define-widget-class 'toggle-button 'xmToggleButtonWidgetClass) (define-widget-class 'toggle-button-gadget 'xmToggleButtonGadgetClass) (define-callback 'toggle-button 'armCallback #t) (define-callback 'toggle-button 'disarmCallback #t) (define-callback 'toggle-button 'valueChangedCallback #t) (define-callback 'toggle-button-gadget 'armCallback #t) (define-callback 'toggle-button-gadget 'disarmCallback #t) (define-callback 'toggle-button-gadget 'valueChangedCallback #t) ;;; Ignore the `set' field in all callback structs (can do a get-values ;;; on the widget passed to the callback function). (define toggle-button-callback->scheme " return Get_Any_CB ((XmAnyCallbackStruct *)x);") (c->scheme 'callback:toggle-button-valueChangedCallback toggle-button-callback->scheme) (c->scheme 'callback:toggle-button-gadget-valueChangedCallback toggle-button-callback->scheme) elk-3.99.8/lib/xwidgets/motif/row-column.c0000644000175000017500000000620011577076426015325 00000000000000#include "../xt.h" #include #include static SYMDESCR Type_Syms[] = { { "work-area", XmWORK_AREA }, { "menu-bar", XmMENU_BAR }, { "menu-pulldown", XmMENU_PULLDOWN }, { "menu-popup", XmMENU_POPUP }, { "menu-option", XmMENU_OPTION }, { 0, 0} }; static void Post_Handler (Widget w, XtPointer client_data, XEvent *event, Boolean *unused) { unsigned int b; Arg a; XButtonPressedEvent *ep = (XButtonPressedEvent *)event; Widget popup = (Widget)client_data; XtSetArg (a, XmNwhichButton, &b); XtGetValues (popup, &a, 1); if (ep->button != b) return; XmMenuPosition (popup, ep); XtManageChild (popup); } static Object Get_Row_Column_CB (XmRowColumnCallbackStruct *p) { Object ret, s; GC_Node2; ret = s = Make_Widget_Foreign (p->widget); GC_Link2 (ret, s); ret = Cons (ret, Null); s = Get_Any_CB ((XmAnyCallbackStruct *)p); ret = Cons (Cdr (s), ret); ret = Cons (Car (s), ret); GC_Unlink; return ret; } static Object P_Popup_Menu_Attach_To (Object m, Object w) { XtPointer client_data; Arg a; Check_Widget_Class (m, xmRowColumnWidgetClass); Check_Widget (w); XtSetArg (a, XmNuserData, &client_data); XtGetValues (WIDGET(w)->widget, &a, 1); if (client_data) XtRemoveEventHandler (WIDGET(w)->widget, ButtonPressMask, 0, Post_Handler, client_data); client_data = (XtPointer)WIDGET(m)->widget; XtAddEventHandler (WIDGET(w)->widget, ButtonPressMask, 0, Post_Handler, client_data); client_data = (XtPointer)WIDGET(m)->widget; XtSetValues (WIDGET(w)->widget, &a, 1); return Void; } static Object S_Callback_Row_Column_EntryCallback (XtArgVal x) { return Get_Row_Column_CB ((XmRowColumnCallbackStruct *)x); } static XtArgVal C_Row_Column_RowColumnType (Object x) { return (XtArgVal)Symbols_To_Bits (x, 0, Type_Syms); } static XtArgVal C_Row_Column_WhichButton (Object x) { return (XtArgVal)Get_Integer (x); } static Object S_Row_Column_WhichButton (XtArgVal x) { return Make_Integer (x); } static XtArgVal C_Row_Column_EntryClass (Object x) { Check_Type (x, T_Class); return (XtArgVal)CLASS(x)->wclass; } static Object S_Row_Column_EntryClass (XtArgVal x) { return Make_Widget_Class ((WidgetClass)x); } void elk_init_motif_rowcolumn () { XtResourceList r = 0; Define_Class ("row-column", xmRowColumnWidgetClass, r, 0); Define_Callback ("row-column", "entryCallback", 1); Define_Primitive (P_Popup_Menu_Attach_To, "popup-menu-attach-to!", 2, 2, EVAL); Define_Converter_To_Scheme ("row-column-entryClass", S_Row_Column_EntryClass); Define_Converter_To_C ("row-column-entryClass", C_Row_Column_EntryClass); Define_Converter_To_Scheme ("row-column-whichButton", S_Row_Column_WhichButton); Define_Converter_To_C ("row-column-whichButton", C_Row_Column_WhichButton); Define_Converter_To_C ("row-column-rowColumnType", C_Row_Column_RowColumnType); Define_Converter_To_Scheme ("callback:row-column-entryCallback", S_Callback_Row_Column_EntryCallback); P_Provide(Intern("motif:row-column")); } elk-3.99.8/lib/xwidgets/motif/toggle-btn.c0000644000175000017500000000235211577076426015271 00000000000000#include "../xt.h" #include #include #include static Object S_Callback_Toggle_Button_ValueChangedCallback (XtArgVal x) { return Get_Any_CB ((XmAnyCallbackStruct *)x); } static Object S_Callback_Toggle_Button_Gadget_ValueChangedCallback (XtArgVal x) { return Get_Any_CB ((XmAnyCallbackStruct *)x); } void elk_init_motif_togglebutton () { XtResourceList r = 0; Define_Class ("toggle-button-gadget", xmToggleButtonGadgetClass, r, 0); Define_Class ("toggle-button", xmToggleButtonWidgetClass, r, 0); Define_Callback ("toggle-button-gadget", "valueChangedCallback", 1); Define_Callback ("toggle-button-gadget", "disarmCallback", 1); Define_Callback ("toggle-button-gadget", "armCallback", 1); Define_Callback ("toggle-button", "valueChangedCallback", 1); Define_Callback ("toggle-button", "disarmCallback", 1); Define_Callback ("toggle-button", "armCallback", 1); Define_Converter_To_Scheme ("callback:toggle-button-gadget-valueChangedCallback", S_Callback_Toggle_Button_Gadget_ValueChangedCallback); Define_Converter_To_Scheme ("callback:toggle-button-valueChangedCallback", S_Callback_Toggle_Button_ValueChangedCallback); P_Provide(Intern("motif:toggle-btn")); } elk-3.99.8/lib/xwidgets/motif/support.d0000644000175000017500000002364211577076306014746 00000000000000;; arrow-button.d: Used as container for random stuff ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'support "") ; No include file (prolog "SYMDESCR Reason_Syms[] = { { \"none\", XmCR_NONE }, { \"help\", XmCR_HELP }, { \"value-changed\", XmCR_VALUE_CHANGED }, { \"increment\", XmCR_INCREMENT }, { \"decrement\", XmCR_DECREMENT }, { \"page-increment\", XmCR_PAGE_INCREMENT }, { \"page-decrement\", XmCR_PAGE_DECREMENT }, { \"to-top\", XmCR_TO_TOP }, { \"to-bottom\", XmCR_TO_BOTTOM }, { \"drag\", XmCR_DRAG }, { \"activate\", XmCR_ACTIVATE }, { \"arm\", XmCR_ARM }, { \"disarm\", XmCR_DISARM }, { \"map\", XmCR_MAP }, { \"unmap\", XmCR_UNMAP }, { \"focus\", XmCR_FOCUS }, { \"losing-focus\", XmCR_LOSING_FOCUS }, { \"modifying-text-value\", XmCR_MODIFYING_TEXT_VALUE },") (prolog " { \"moving-insert-cursor\", XmCR_MOVING_INSERT_CURSOR }, { \"execute\", XmCR_EXECUTE }, { \"single-select\", XmCR_SINGLE_SELECT }, { \"multiple-select\", XmCR_MULTIPLE_SELECT }, { \"extended-select\", XmCR_EXTENDED_SELECT }, { \"browse-select\", XmCR_BROWSE_SELECT }, { \"default-action\", XmCR_DEFAULT_ACTION }, { \"clipboard-data-request\", XmCR_CLIPBOARD_DATA_REQUEST }, { \"clipboard-data-delete\", XmCR_CLIPBOARD_DATA_DELETE }, { \"cascading\", XmCR_CASCADING }, { \"ok\", XmCR_OK }, { \"cancel\", XmCR_CANCEL }, { \"apply\", XmCR_APPLY }, { \"no-match\", XmCR_NO_MATCH }, { \"command-entered\", XmCR_COMMAND_ENTERED }, { \"command-changed\", XmCR_COMMAND_CHANGED }, { \"expose\", XmCR_EXPOSE }, { \"resize\", XmCR_RESIZE }, { \"input\", XmCR_INPUT }, { 0, 0 } };") (prolog "Object Get_Any_CB (void *_p) { XmAnyCallbackStruct *p = _p; Object args, ret; GC_Node2; args = ret = Null; GC_Link2 (ret, args); if (p->event) { args = Get_Event_Args (p->event); ret = Copy_List (args); Destroy_Event_Args (args); } ret = Cons (Bits_To_Symbols ((unsigned long)p->reason, 0, Reason_Syms), ret); GC_Unlink; return ret; }") (prolog "Object Get_Selection_CB (void *_p) { XmSelectionBoxCallbackStruct *p = _p; Object ret, s; char *text; GC_Node2; if (!XmStringGetLtoR (p->value, XmSTRING_DEFAULT_CHARSET, &text)) text = \"\"; ret = s = Make_String (text, strlen (text)); GC_Link2 (ret, s); ret = Cons (ret, Null); s = Get_Any_CB ((XmAnyCallbackStruct *)p); ret = Cons (Cdr (s), ret); ret = Cons (Car (s), ret); GC_Unlink; return ret; }") (prolog "static XtArgVal Scheme_To_String_Table (Object x) { Object t; char *s; XmString *tab; int i = 0; Alloca_Begin; tab = (XmString *)XtMalloc (Get_Integer (P_Length (x)) * sizeof (XmString)); /* tab is never freed since the converter must return a new address * each time it is called. */ for (t = x; TYPE(t) == T_Pair; t = Cdr (t)) { Get_Strsym_Stack (Car (t), s); tab[i++] = XmStringCreate (s, XmSTRING_DEFAULT_CHARSET); } Alloca_End; return (XtArgVal)tab; }") (define-primitive 'update-display '(w) " Check_Widget (w); XmUpdateDisplay (WIDGET(w)->widget); return Void;") ;;; Converters (define keysym->scheme " return Make_Char ((int)x);") (define scheme->keysym " Check_Type (x, T_Character); return (XtArgVal)CHAR(x);") (define position->scheme " return Make_Integer (*(Position *)(void *)&x);") (define scheme->position " return (XtArgVal)Get_Integer (x);") (define dimension->scheme " return Make_Integer (*(Dimension *)(void *)&x);") (define scheme->dimension " return (XtArgVal)Get_Unsigned (x);") (define int->scheme " return Make_Integer (*(int *)(void *)&x);") (define scheme->int " return (XtArgVal)Get_Integer (x);") (define window->scheme " return Make_Widget_Foreign ((Widget)x);") (define scheme->window " Check_Widget (x); return (XtArgVal)WIDGET(x)->widget;") (define scheme->scrollbar " extern WidgetClass xmScrollBarWidgetClass; Check_Widget_Class (x, xmScrollBarWidgetClass); return (XtArgVal)WIDGET(x)->widget;") (define selection-callback->scheme " return Get_Selection_CB ((XmSelectionBoxCallbackStruct *)x);") (define help-callback->scheme " return Get_Any_CB ((XmAnyCallbackStruct *)x);") (define button-callback->scheme " return Get_Any_CB ((XmAnyCallbackStruct *)x);") (define event-callback->scheme " return Get_Any_CB ((XmAnyCallbackStruct *)x);") (define xm-string->scheme " char *text; if (!XmStringGetLtoR ((XmString)x, XmSTRING_DEFAULT_CHARSET, &text)) text = \"\"; return Make_String (text, strlen (text));") (define scheme->xm-string " char *s; XtArgVal ret; Alloca_Begin; Get_Strsym_Stack (x, s); ret = (XtArgVal)XmStringCreateLtoR (s, XmSTRING_DEFAULT_CHARSET); Alloca_End; return ret;") (define scheme->xm-string-table " return Scheme_To_String_Table (x);") (c->scheme 'KeySym keysym->scheme) (scheme->c 'KeySym scheme->keysym) (c->scheme 'HorizontalPosition position->scheme) (c->scheme 'VerticalPosition position->scheme) (c->scheme 'HorizontalDimension dimension->scheme) (c->scheme 'VerticalDimension dimension->scheme) (c->scheme 'HorizontalInt int->scheme) ; Sigh. Why don't they just (c->scheme 'VerticalInt int->scheme) ; use plain old Int?? (scheme->c 'HorizontalPosition scheme->position) (scheme->c 'VerticalPosition scheme->position) (scheme->c 'HorizontalDimension scheme->dimension) (scheme->c 'VerticalDimension scheme->dimension) (scheme->c 'HorizontalInt scheme->int) (scheme->c 'VerticalInt scheme->int) (c->scheme 'ShellHorizPos position->scheme) (c->scheme 'ShellVertPos position->scheme) (c->scheme 'ShellHorizDim dimension->scheme) (c->scheme 'ShellVertDim dimension->scheme) (scheme->c 'ShellHorizPos scheme->position) (scheme->c 'ShellVertPos scheme->position) (scheme->c 'ShellHorizDim scheme->dimension) (scheme->c 'ShellVertDim scheme->dimension) (c->scheme 'horizontalScrollBar window->scheme) ; Some classes have resources (c->scheme 'verticalScrollBar window->scheme) ; of type window instead of (c->scheme 'workWindow window->scheme) ; widget. What a crock! (c->scheme 'commandWindow window->scheme) (c->scheme 'menuBar window->scheme) (c->scheme 'subMenuId window->scheme) (c->scheme 'menuHistory window->scheme) (c->scheme 'menuHelpWidget window->scheme) (c->scheme 'bottomWidget window->scheme) (c->scheme 'leftWidget window->scheme) (c->scheme 'rightWidget window->scheme) (c->scheme 'topWidget window->scheme) (scheme->c 'horizontalScrollBar scheme->scrollbar) (scheme->c 'verticalScrollBar scheme->scrollbar) (scheme->c 'workWindow scheme->window) (scheme->c 'commandWindow scheme->window) (scheme->c 'menuBar scheme->window) (scheme->c 'subMenuId scheme->window) (scheme->c 'menuHistory scheme->window) (scheme->c 'menuHelpWidget scheme->window) (scheme->c 'bottomWidget scheme->window) (scheme->c 'leftWidget scheme->window) (scheme->c 'rightWidget scheme->window) (scheme->c 'topWidget scheme->window) (c->scheme 'callback:applyCallback selection-callback->scheme) (c->scheme 'callback:cancelCallback selection-callback->scheme) (c->scheme 'callback:noMatchCallback selection-callback->scheme) (c->scheme 'callback:okCallback selection-callback->scheme) (c->scheme 'callback:helpCallback help-callback->scheme) (c->scheme 'callback:activateCallback button-callback->scheme) (c->scheme 'callback:armCallback button-callback->scheme) (c->scheme 'callback:disarmCallback button-callback->scheme) (c->scheme 'callback:cascadingCallback button-callback->scheme) (c->scheme 'callback:exposeCallback event-callback->scheme) (c->scheme 'callback:inputCallback event-callback->scheme) (c->scheme 'callback:resizeCallback event-callback->scheme) (c->scheme 'XmString xm-string->scheme) (scheme->c 'XmString scheme->xm-string) (scheme->c 'XmStringTable scheme->xm-string-table) ;;; Classes for which no .d-file exists: (define-widget-class 'primitive 'xmPrimitiveWidgetClass) (define-widget-class 'manager 'xmManagerWidgetClass) elk-3.99.8/lib/xwidgets/motif/main-window.d0000644000175000017500000000246011577076306015456 00000000000000;; main-window.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'mainwindow "MainW.h") (define-widget-class 'main-window 'xmMainWindowWidgetClass) elk-3.99.8/lib/xwidgets/motif/bulletin-brd.d0000644000175000017500000000247611577076306015617 00000000000000;; bulletin-brd.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'bulletinboard "BulletinB.h") (define-widget-class 'bulletin-board 'xmBulletinBoardWidgetClass) elk-3.99.8/lib/xwidgets/motif/frame.d0000644000175000017500000000243211577076306014316 00000000000000;; frame.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'frame "Frame.h") (define-widget-class 'frame 'xmFrameWidgetClass) elk-3.99.8/lib/xwidgets/motif/message-box.d0000644000175000017500000000422411577076306015437 00000000000000;; message-box.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'messagebox "MessageB.h") (prolog "static SYMDESCR Type_Syms[] = { { \"dialog-error\", XmDIALOG_ERROR }, { \"dialog-information\", XmDIALOG_INFORMATION }, { \"dialog-message\", XmDIALOG_MESSAGE }, { \"dialog-question\", XmDIALOG_QUESTION }, { \"dialog-warning\", XmDIALOG_WARNING }, { \"dialog-working\", XmDIALOG_WORKING }, { 0, 0} };") (define-widget-class 'message-box 'xmMessageBoxWidgetClass) (define-callback 'message-box 'cancelCallback #t) (define-callback 'message-box 'okCallback #t) (define scheme->dialog-type " return (XtArgVal)Symbols_To_Bits (x, 0, Type_Syms);") (define message-box-callback->scheme " return Get_Any_CB ((XmAnyCallbackStruct *)x);") (scheme->c 'message-box-dialogType scheme->dialog-type) (c->scheme 'callback:message-box-cancelCallback message-box-callback->scheme) (c->scheme 'callback:message-box-okCallback message-box-callback->scheme) elk-3.99.8/lib/xwidgets/motif/scrolled-win.d0000644000175000017500000000446711577076306015640 00000000000000;; scrolled-win.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'scrolledwindow "ScrolledW.h") (prolog ;;; Before the converter for scrollingPolicy was introduced (which wasn't ;;; even necessary), the one provided by Xm was called and people were using ;;; "AUTOMATIC" and "APPLICATION_DEFINED". Everything was fine. ;;; ;;; After the converter was introduced, code was required to use 'automatic ;;; and 'application-defined instead. Thus the change broke existing code. ;;; ;;; As a temporary solution, I'm now adding AUTOMATIC etc. to the list of ;;; legal values, but clearly some kind of concept is needed here... "static SYMDESCR Scrolling_Syms[] = { { \"automatic\", XmAUTOMATIC }, { \"application-defined\", XmAPPLICATION_DEFINED }, { \"AUTOMATIC\", XmAUTOMATIC }, /* see above */ { \"APPLICATION_DEFINED\", XmAPPLICATION_DEFINED }, { \"application_defined\", XmAPPLICATION_DEFINED }, { 0, 0} };") (define-widget-class 'scrolled-window 'xmScrolledWindowWidgetClass) (scheme->c 'scrollingPolicy " if (TYPE(x) == T_String) x = P_String_To_Symbol(x); return (XtArgVal)Symbols_To_Bits (x, 0, Scrolling_Syms);") elk-3.99.8/lib/xwidgets/motif/form.c0000644000175000017500000000031711577076426014171 00000000000000#include "../xt.h" #include #include void elk_init_motif_form () { XtResourceList r = 0; Define_Class ("form", xmFormWidgetClass, r, 0); P_Provide(Intern("motif:form")); } elk-3.99.8/lib/xwidgets/motif/file-selectn.c0000644000175000017500000000104311577076426015575 00000000000000#include "../xt.h" #include #include void elk_init_motif_fileselection () { XtResourceList r = 0; Define_Class ("file-selection", xmFileSelectionBoxWidgetClass, r, 0); Define_Callback ("file-selection", "helpCallback", 1); Define_Callback ("file-selection", "okCallback", 1); Define_Callback ("file-selection", "noMatchCallback", 1); Define_Callback ("file-selection", "cancelCallback", 1); Define_Callback ("file-selection", "applyCallback", 1); P_Provide(Intern("motif:file-selectn")); } elk-3.99.8/lib/xwidgets/motif/drawing-area.d0000644000175000017500000000272111577076306015566 00000000000000;; drawing-area.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'drawingarea "DrawingA.h") (define-widget-class 'drawing-area 'xmDrawingAreaWidgetClass) (define-callback 'drawing-area 'exposeCallback #t) (define-callback 'drawing-area 'inputCallback #t) (define-callback 'drawing-area 'resizeCallback #t) elk-3.99.8/lib/xwidgets/motif/selectn-box.c0000644000175000017500000000164211577076426015453 00000000000000#include "../xt.h" #include #include static SYMDESCR Type_Syms[] = { { "dialog-prompt", XmDIALOG_PROMPT }, { "dialog-selection", XmDIALOG_SELECTION }, { "dialog-work-area", XmDIALOG_WORK_AREA }, { 0, 0} }; static XtArgVal C_Selection_Box_DialogType (Object x) { return (XtArgVal)Symbols_To_Bits (x, 0, Type_Syms); } void elk_init_motif_selectionbox () { XtResourceList r = 0; Define_Class ("selection-box", xmSelectionBoxWidgetClass, r, 0); Define_Callback ("selection-box", "helpCallback", 1); Define_Callback ("selection-box", "okCallback", 1); Define_Callback ("selection-box", "noMatchCallback", 1); Define_Callback ("selection-box", "cancelCallback", 1); Define_Callback ("selection-box", "applyCallback", 1); Define_Converter_To_C ("selection-box-dialogType", C_Selection_Box_DialogType); P_Provide(Intern("motif:selectn-box")); } elk-3.99.8/lib/xwidgets/motif/command.c0000644000175000017500000000152211577076426014643 00000000000000#include "../xt.h" #include #include static Object S_Callback_Command_CommandChangedCallback (XtArgVal x) { return Get_Selection_CB ((XmCommandCallbackStruct *)x); } static Object S_Callback_Command_CommandEnteredCallback (XtArgVal x) { return Get_Selection_CB ((XmCommandCallbackStruct *)x); } void elk_init_motif_command () { XtResourceList r = 0; Define_Class ("command", xmCommandWidgetClass, r, 0); Define_Callback ("command", "commandEnteredCallback", 1); Define_Callback ("command", "commandChangedCallback", 1); Define_Converter_To_Scheme ("callback:command-commandEnteredCallback", S_Callback_Command_CommandEnteredCallback); Define_Converter_To_Scheme ("callback:command-commandChangedCallback", S_Callback_Command_CommandChangedCallback); P_Provide(Intern("motif:command")); } elk-3.99.8/lib/xwidgets/motif/support.c0000644000175000017500000003372711577076426014755 00000000000000#include "../xt.h" #include SYMDESCR Reason_Syms[] = { { "none", XmCR_NONE }, { "help", XmCR_HELP }, { "value-changed", XmCR_VALUE_CHANGED }, { "increment", XmCR_INCREMENT }, { "decrement", XmCR_DECREMENT }, { "page-increment", XmCR_PAGE_INCREMENT }, { "page-decrement", XmCR_PAGE_DECREMENT }, { "to-top", XmCR_TO_TOP }, { "to-bottom", XmCR_TO_BOTTOM }, { "drag", XmCR_DRAG }, { "activate", XmCR_ACTIVATE }, { "arm", XmCR_ARM }, { "disarm", XmCR_DISARM }, { "map", XmCR_MAP }, { "unmap", XmCR_UNMAP }, { "focus", XmCR_FOCUS }, { "losing-focus", XmCR_LOSING_FOCUS }, { "modifying-text-value", XmCR_MODIFYING_TEXT_VALUE }, { "moving-insert-cursor", XmCR_MOVING_INSERT_CURSOR }, { "execute", XmCR_EXECUTE }, { "single-select", XmCR_SINGLE_SELECT }, { "multiple-select", XmCR_MULTIPLE_SELECT }, { "extended-select", XmCR_EXTENDED_SELECT }, { "browse-select", XmCR_BROWSE_SELECT }, { "default-action", XmCR_DEFAULT_ACTION }, { "clipboard-data-request", XmCR_CLIPBOARD_DATA_REQUEST }, { "clipboard-data-delete", XmCR_CLIPBOARD_DATA_DELETE }, { "cascading", XmCR_CASCADING }, { "ok", XmCR_OK }, { "cancel", XmCR_CANCEL }, { "apply", XmCR_APPLY }, { "no-match", XmCR_NO_MATCH }, { "command-entered", XmCR_COMMAND_ENTERED }, { "command-changed", XmCR_COMMAND_CHANGED }, { "expose", XmCR_EXPOSE }, { "resize", XmCR_RESIZE }, { "input", XmCR_INPUT }, { 0, 0 } }; Object Get_Any_CB (void *_p) { XmAnyCallbackStruct *p = _p; Object args, ret; GC_Node2; args = ret = Null; GC_Link2 (ret, args); if (p->event) { args = Get_Event_Args (p->event); ret = Copy_List (args); Destroy_Event_Args (args); } ret = Cons (Bits_To_Symbols ((unsigned long)p->reason, 0, Reason_Syms), ret); GC_Unlink; return ret; } Object Get_Selection_CB (void *_p) { XmSelectionBoxCallbackStruct *p = _p; Object ret, s; char *text; GC_Node2; if (!XmStringGetLtoR (p->value, XmSTRING_DEFAULT_CHARSET, &text)) text = ""; ret = s = Make_String (text, strlen (text)); GC_Link2 (ret, s); ret = Cons (ret, Null); s = Get_Any_CB ((XmAnyCallbackStruct *)p); ret = Cons (Cdr (s), ret); ret = Cons (Car (s), ret); GC_Unlink; return ret; } static XtArgVal Scheme_To_String_Table (Object x) { Object t; char *s; XmString *tab; int i = 0; Alloca_Begin; tab = (XmString *)XtMalloc (Get_Integer (P_Length (x)) * sizeof (XmString)); /* tab is never freed since the converter must return a new address * each time it is called. */ for (t = x; TYPE(t) == T_Pair; t = Cdr (t)) { Get_Strsym_Stack (Car (t), s); tab[i++] = XmStringCreate (s, XmSTRING_DEFAULT_CHARSET); } Alloca_End; return (XtArgVal)tab; } static Object P_Update_Display (Object w) { Check_Widget (w); XmUpdateDisplay (WIDGET(w)->widget); return Void; } static Object S_KeySym (XtArgVal x) { return Make_Char ((int)x); } static XtArgVal C_KeySym (Object x) { Check_Type (x, T_Character); return (XtArgVal)CHAR(x); } static Object S_HorizontalPosition (XtArgVal x) { return Make_Integer (*(Position *)(void *)&x); } static Object S_VerticalPosition (XtArgVal x) { return Make_Integer (*(Position *)(void *)&x); } static Object S_HorizontalDimension (XtArgVal x) { return Make_Integer (*(Dimension *)(void *)&x); } static Object S_VerticalDimension (XtArgVal x) { return Make_Integer (*(Dimension *)(void *)&x); } static Object S_HorizontalInt (XtArgVal x) { return Make_Integer (*(int *)(void *)&x); } static Object S_VerticalInt (XtArgVal x) { return Make_Integer (*(int *)(void *)&x); } static XtArgVal C_HorizontalPosition (Object x) { return (XtArgVal)Get_Integer (x); } static XtArgVal C_VerticalPosition (Object x) { return (XtArgVal)Get_Integer (x); } static XtArgVal C_HorizontalDimension (Object x) { return (XtArgVal)Get_Unsigned (x); } static XtArgVal C_VerticalDimension (Object x) { return (XtArgVal)Get_Unsigned (x); } static XtArgVal C_HorizontalInt (Object x) { return (XtArgVal)Get_Integer (x); } static XtArgVal C_VerticalInt (Object x) { return (XtArgVal)Get_Integer (x); } static Object S_ShellHorizPos (XtArgVal x) { return Make_Integer (*(Position *)(void *)&x); } static Object S_ShellVertPos (XtArgVal x) { return Make_Integer (*(Position *)(void *)&x); } static Object S_ShellHorizDim (XtArgVal x) { return Make_Integer (*(Dimension *)(void *)&x); } static Object S_ShellVertDim (XtArgVal x) { return Make_Integer (*(Dimension *)(void *)&x); } static XtArgVal C_ShellHorizPos (Object x) { return (XtArgVal)Get_Integer (x); } static XtArgVal C_ShellVertPos (Object x) { return (XtArgVal)Get_Integer (x); } static XtArgVal C_ShellHorizDim (Object x) { return (XtArgVal)Get_Unsigned (x); } static XtArgVal C_ShellVertDim (Object x) { return (XtArgVal)Get_Unsigned (x); } static Object S_HorizontalScrollBar (XtArgVal x) { return Make_Widget_Foreign ((Widget)x); } static Object S_VerticalScrollBar (XtArgVal x) { return Make_Widget_Foreign ((Widget)x); } static Object S_WorkWindow (XtArgVal x) { return Make_Widget_Foreign ((Widget)x); } static Object S_CommandWindow (XtArgVal x) { return Make_Widget_Foreign ((Widget)x); } static Object S_MenuBar (XtArgVal x) { return Make_Widget_Foreign ((Widget)x); } static Object S_SubMenuId (XtArgVal x) { return Make_Widget_Foreign ((Widget)x); } static Object S_MenuHistory (XtArgVal x) { return Make_Widget_Foreign ((Widget)x); } static Object S_MenuHelpWidget (XtArgVal x) { return Make_Widget_Foreign ((Widget)x); } static Object S_BottomWidget (XtArgVal x) { return Make_Widget_Foreign ((Widget)x); } static Object S_LeftWidget (XtArgVal x) { return Make_Widget_Foreign ((Widget)x); } static Object S_RightWidget (XtArgVal x) { return Make_Widget_Foreign ((Widget)x); } static Object S_TopWidget (XtArgVal x) { return Make_Widget_Foreign ((Widget)x); } static XtArgVal C_HorizontalScrollBar (Object x) { extern WidgetClass xmScrollBarWidgetClass; Check_Widget_Class (x, xmScrollBarWidgetClass); return (XtArgVal)WIDGET(x)->widget; } static XtArgVal C_VerticalScrollBar (Object x) { extern WidgetClass xmScrollBarWidgetClass; Check_Widget_Class (x, xmScrollBarWidgetClass); return (XtArgVal)WIDGET(x)->widget; } static XtArgVal C_WorkWindow (Object x) { Check_Widget (x); return (XtArgVal)WIDGET(x)->widget; } static XtArgVal C_CommandWindow (Object x) { Check_Widget (x); return (XtArgVal)WIDGET(x)->widget; } static XtArgVal C_MenuBar (Object x) { Check_Widget (x); return (XtArgVal)WIDGET(x)->widget; } static XtArgVal C_SubMenuId (Object x) { Check_Widget (x); return (XtArgVal)WIDGET(x)->widget; } static XtArgVal C_MenuHistory (Object x) { Check_Widget (x); return (XtArgVal)WIDGET(x)->widget; } static XtArgVal C_MenuHelpWidget (Object x) { Check_Widget (x); return (XtArgVal)WIDGET(x)->widget; } static XtArgVal C_BottomWidget (Object x) { Check_Widget (x); return (XtArgVal)WIDGET(x)->widget; } static XtArgVal C_LeftWidget (Object x) { Check_Widget (x); return (XtArgVal)WIDGET(x)->widget; } static XtArgVal C_RightWidget (Object x) { Check_Widget (x); return (XtArgVal)WIDGET(x)->widget; } static XtArgVal C_TopWidget (Object x) { Check_Widget (x); return (XtArgVal)WIDGET(x)->widget; } static Object S_Callback_ApplyCallback (XtArgVal x) { return Get_Selection_CB ((XmSelectionBoxCallbackStruct *)x); } static Object S_Callback_CancelCallback (XtArgVal x) { return Get_Selection_CB ((XmSelectionBoxCallbackStruct *)x); } static Object S_Callback_NoMatchCallback (XtArgVal x) { return Get_Selection_CB ((XmSelectionBoxCallbackStruct *)x); } static Object S_Callback_OkCallback (XtArgVal x) { return Get_Selection_CB ((XmSelectionBoxCallbackStruct *)x); } static Object S_Callback_HelpCallback (XtArgVal x) { return Get_Any_CB ((XmAnyCallbackStruct *)x); } static Object S_Callback_ActivateCallback (XtArgVal x) { return Get_Any_CB ((XmAnyCallbackStruct *)x); } static Object S_Callback_ArmCallback (XtArgVal x) { return Get_Any_CB ((XmAnyCallbackStruct *)x); } static Object S_Callback_DisarmCallback (XtArgVal x) { return Get_Any_CB ((XmAnyCallbackStruct *)x); } static Object S_Callback_CascadingCallback (XtArgVal x) { return Get_Any_CB ((XmAnyCallbackStruct *)x); } static Object S_Callback_ExposeCallback (XtArgVal x) { return Get_Any_CB ((XmAnyCallbackStruct *)x); } static Object S_Callback_InputCallback (XtArgVal x) { return Get_Any_CB ((XmAnyCallbackStruct *)x); } static Object S_Callback_ResizeCallback (XtArgVal x) { return Get_Any_CB ((XmAnyCallbackStruct *)x); } static Object S_XmString (XtArgVal x) { char *text; if (!XmStringGetLtoR ((XmString)x, XmSTRING_DEFAULT_CHARSET, &text)) text = ""; return Make_String (text, strlen (text)); } static XtArgVal C_XmString (Object x) { char *s; XtArgVal ret; Alloca_Begin; Get_Strsym_Stack (x, s); ret = (XtArgVal)XmStringCreateLtoR (s, XmSTRING_DEFAULT_CHARSET); Alloca_End; return ret; } static XtArgVal C_XmStringTable (Object x) { return Scheme_To_String_Table (x); } void elk_init_motif_support () { XtResourceList r = 0; Define_Class ("manager", xmManagerWidgetClass, r, 0); Define_Class ("primitive", xmPrimitiveWidgetClass, r, 0); Define_Primitive (P_Update_Display, "update-display", 1, 1, EVAL); Define_Converter_To_C ("XmStringTable", C_XmStringTable); Define_Converter_To_C ("XmString", C_XmString); Define_Converter_To_Scheme ("XmString", S_XmString); Define_Converter_To_Scheme ("callback:resizeCallback", S_Callback_ResizeCallback); Define_Converter_To_Scheme ("callback:inputCallback", S_Callback_InputCallback); Define_Converter_To_Scheme ("callback:exposeCallback", S_Callback_ExposeCallback); Define_Converter_To_Scheme ("callback:cascadingCallback", S_Callback_CascadingCallback); Define_Converter_To_Scheme ("callback:disarmCallback", S_Callback_DisarmCallback); Define_Converter_To_Scheme ("callback:armCallback", S_Callback_ArmCallback); Define_Converter_To_Scheme ("callback:activateCallback", S_Callback_ActivateCallback); Define_Converter_To_Scheme ("callback:helpCallback", S_Callback_HelpCallback); Define_Converter_To_Scheme ("callback:okCallback", S_Callback_OkCallback); Define_Converter_To_Scheme ("callback:noMatchCallback", S_Callback_NoMatchCallback); Define_Converter_To_Scheme ("callback:cancelCallback", S_Callback_CancelCallback); Define_Converter_To_Scheme ("callback:applyCallback", S_Callback_ApplyCallback); Define_Converter_To_C ("topWidget", C_TopWidget); Define_Converter_To_C ("rightWidget", C_RightWidget); Define_Converter_To_C ("leftWidget", C_LeftWidget); Define_Converter_To_C ("bottomWidget", C_BottomWidget); Define_Converter_To_C ("menuHelpWidget", C_MenuHelpWidget); Define_Converter_To_C ("menuHistory", C_MenuHistory); Define_Converter_To_C ("subMenuId", C_SubMenuId); Define_Converter_To_C ("menuBar", C_MenuBar); Define_Converter_To_C ("commandWindow", C_CommandWindow); Define_Converter_To_C ("workWindow", C_WorkWindow); Define_Converter_To_C ("verticalScrollBar", C_VerticalScrollBar); Define_Converter_To_C ("horizontalScrollBar", C_HorizontalScrollBar); Define_Converter_To_Scheme ("topWidget", S_TopWidget); Define_Converter_To_Scheme ("rightWidget", S_RightWidget); Define_Converter_To_Scheme ("leftWidget", S_LeftWidget); Define_Converter_To_Scheme ("bottomWidget", S_BottomWidget); Define_Converter_To_Scheme ("menuHelpWidget", S_MenuHelpWidget); Define_Converter_To_Scheme ("menuHistory", S_MenuHistory); Define_Converter_To_Scheme ("subMenuId", S_SubMenuId); Define_Converter_To_Scheme ("menuBar", S_MenuBar); Define_Converter_To_Scheme ("commandWindow", S_CommandWindow); Define_Converter_To_Scheme ("workWindow", S_WorkWindow); Define_Converter_To_Scheme ("verticalScrollBar", S_VerticalScrollBar); Define_Converter_To_Scheme ("horizontalScrollBar", S_HorizontalScrollBar); Define_Converter_To_C ("ShellVertDim", C_ShellVertDim); Define_Converter_To_C ("ShellHorizDim", C_ShellHorizDim); Define_Converter_To_C ("ShellVertPos", C_ShellVertPos); Define_Converter_To_C ("ShellHorizPos", C_ShellHorizPos); Define_Converter_To_Scheme ("ShellVertDim", S_ShellVertDim); Define_Converter_To_Scheme ("ShellHorizDim", S_ShellHorizDim); Define_Converter_To_Scheme ("ShellVertPos", S_ShellVertPos); Define_Converter_To_Scheme ("ShellHorizPos", S_ShellHorizPos); Define_Converter_To_C ("VerticalInt", C_VerticalInt); Define_Converter_To_C ("HorizontalInt", C_HorizontalInt); Define_Converter_To_C ("VerticalDimension", C_VerticalDimension); Define_Converter_To_C ("HorizontalDimension", C_HorizontalDimension); Define_Converter_To_C ("VerticalPosition", C_VerticalPosition); Define_Converter_To_C ("HorizontalPosition", C_HorizontalPosition); Define_Converter_To_Scheme ("VerticalInt", S_VerticalInt); Define_Converter_To_Scheme ("HorizontalInt", S_HorizontalInt); Define_Converter_To_Scheme ("VerticalDimension", S_VerticalDimension); Define_Converter_To_Scheme ("HorizontalDimension", S_HorizontalDimension); Define_Converter_To_Scheme ("VerticalPosition", S_VerticalPosition); Define_Converter_To_Scheme ("HorizontalPosition", S_HorizontalPosition); Define_Converter_To_C ("KeySym", C_KeySym); Define_Converter_To_Scheme ("KeySym", S_KeySym); P_Provide(Intern("motif:support")); } elk-3.99.8/lib/xwidgets/motif/Makefile.am0000644000175000017500000000255211577076306015116 00000000000000NULL = EXTRA_DIST = $(SOURCES_MOTIF_D) CLEANFILES = $(SOURCES_MOTIF_C) pkglib_LTLIBRARIES = $(motif_la) if HAVE_MOTIF motif_la = motif.la endif motif_la_SOURCES = init.c $(SOURCES_MOTIF_C) motif_la_CFLAGS = -I$(srcdir)/../../xlib @MOTIF_CFLAGS@ -DUSING_MOTIF motif_la_LDFLAGS = -module -avoid-version -no-undefined -u XmIsMotifWMRunning motif_la_LIBADD = $(top_builddir)/src/libelk.la ../../xlib/libelk-xlib.la ../libelk-xt.la @MOTIF_LIBS@ .d.c: $(top_builddir)/src/elk -g -p .:$(top_srcdir)/scm:$(srcdir)/.. -l mkwidget.scm $< $@ motif SOURCES_MOTIF_C = \ arrow-button.c \ bulletin-brd.c \ cascade-btn.c \ command.c \ drawing-area.c \ drawn-button.c \ file-selectn.c \ form.c \ frame.c \ label.c \ list.c \ main-window.c \ message-box.c \ paned-window.c \ push-button.c \ row-column.c \ scale.c \ scroll-bar.c \ scrolled-win.c \ selectn-box.c \ separator.c \ shell.c \ support.c \ text.c \ toggle-btn.c \ $(NULL) SOURCES_MOTIF_D = \ arrow-button.d \ bulletin-brd.d \ cascade-btn.d \ command.d \ drawing-area.d \ drawn-button.d \ file-selectn.d \ form.d \ frame.d \ label.d \ list.d \ main-window.d \ message-box.d \ paned-window.d \ push-button.d \ row-column.d \ scale.d \ scroll-bar.d \ scrolled-win.d \ selectn-box.d \ separator.d \ shell.d \ support.d \ text.d \ toggle-btn.d \ $(NULL) echo-sources: ; echo $(SOURCES) elk-3.99.8/lib/xwidgets/motif/command.d0000644000175000017500000000322211577076306014640 00000000000000;; command.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'command "Command.h") (define-widget-class 'command 'xmCommandWidgetClass) (define-callback 'command 'commandChangedCallback #t) (define-callback 'command 'commandEnteredCallback #t) (define command-callback->scheme " return Get_Selection_CB ((XmCommandCallbackStruct *)x);") (c->scheme 'callback:command-commandChangedCallback command-callback->scheme) (c->scheme 'callback:command-commandEnteredCallback command-callback->scheme) elk-3.99.8/lib/xwidgets/motif/init.c0000644000175000017500000000315711577076306014173 00000000000000/* init.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "../xt.h" void elk_init_xaw_init () { elk_init_xt_accelerator (); elk_init_xt_action (); elk_init_xt_callback (); elk_init_xt_class (); elk_init_xt_context (); elk_init_xt_function (); elk_init_xt_identifier (); elk_init_xt_popup (); elk_init_xt_translation (); elk_init_xt_widget (); elk_init_xt_error (); elk_init_xt_init (); P_Provide (Intern ("motif.la")); } elk-3.99.8/lib/xwidgets/widget.c0000644000175000017500000002765511577076306013406 00000000000000/* widget.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "xt.h" static Object P_Destroy_Widget(Object); Generic_Predicate (Widget) Generic_Equal (Widget, WIDGET, widget) Generic_Print (Widget, "#[widget %lu]", (unsigned int)(uintptr_t)POINTER(x)) static Object Internal_Make_Widget (int finalize, Widget widget) { Object w; if (widget == 0) return Sym_None; w = Find_Object (T_Widget, (GENERIC)0, Match_Xt_Obj, widget); if (Nullp (w)) { w = Alloc_Object (sizeof (struct S_Widget), T_Widget, 0); WIDGET(w)->tag = Null; WIDGET(w)->widget = widget; WIDGET(w)->free = 0; XtAddCallback (widget, XtNdestroyCallback, Destroy_Callback_Proc, (XtPointer)0); Register_Object (w, (GENERIC)0, finalize ? P_Destroy_Widget : (PFO)0, 0); } return w; } /* Backwards compatibility: */ Object Make_Widget (Widget widget) { return Internal_Make_Widget (1, widget); } Object Make_Widget_Foreign (Widget widget) { return Internal_Make_Widget (0, widget); } void Check_Widget (Object w) { Check_Type (w, T_Widget); if (WIDGET(w)->free) Primitive_Error ("invalid widget: ~s", w); } void Check_Widget_Class (Object w, WidgetClass class) { Check_Widget (w); if (XtClass (WIDGET(w)->widget) != class) Primitive_Error ("widget not of expected class: ~s", w); } static Object P_Destroy_Widget (Object w) { Check_Widget (w); XtDestroyWidget (WIDGET(w)->widget); return Void; } static Object P_Create_Shell (int argc, Object *argv) { register char *sn = 0, *sc = 0; ArgList a; Object name, class, w, d, ret; Alloca_Begin; name = argv[0], class = argv[1], w = argv[2], d = argv[3]; if (!EQ(name, False)) sn = Get_Strsym (name); if (!EQ(class, False)) sc = Get_Strsym (class); Check_Type (w, T_Class); Check_Type (d, T_Display); Encode_Arglist (argc-4, argv+4, a, (Widget)0, CLASS(w)->wclass); ret = Make_Widget (XtAppCreateShell (sn, sc, CLASS(w)->wclass, DISPLAY(d)->dpy, a, (Cardinal)(argc-4)/2)); Alloca_End; return ret; } static Object P_Create_Widget (int argc, Object *argv) { ArgList a; char *name = 0; Object x, class, parent, ret; Alloca_Begin; x = argv[0]; if (TYPE(x) != T_Class) { name = Get_Strsym (x); argv++; argc--; } class = argv[0]; parent = argv[1]; Check_Type (class, T_Class); Check_Widget (parent); if (name == 0) name = CLASS(class)->name; Encode_Arglist (argc-2, argv+2, a, WIDGET(parent)->widget, CLASS(class)->wclass); ret = Make_Widget (XtCreateWidget ((String)name, CLASS(class)->wclass, WIDGET(parent)->widget, a, (Cardinal)(argc-2)/2)); Alloca_End; return ret; } static Object P_Realize_Widget (Object w) { Check_Widget (w); XtRealizeWidget (WIDGET(w)->widget); return Void; } static Object P_Unrealize_Widget (Object w) { Check_Widget (w); XtUnrealizeWidget (WIDGET(w)->widget); return Void; } static Object P_Widget_Realizedp (Object w) { Check_Widget (w); return XtIsRealized (WIDGET(w)->widget) ? True : False; } static Object P_Widget_Display (Object w) { Check_Widget (w); return Make_Display (0, XtDisplayOfObject (WIDGET(w)->widget)); } static Object P_Widget_Parent (Object w) { Check_Widget (w); return Make_Widget_Foreign (XtParent (WIDGET(w)->widget)); } static Object P_Widget_Name (Object w) { char *s; Check_Widget (w); s = XtName (WIDGET(w)->widget); return Make_String (s, strlen (s)); } static Object P_Widget_To_Window (Object w) { Check_Widget (w); return Make_Window (0, XtDisplayOfObject (WIDGET(w)->widget), XtWindow (WIDGET(w)->widget)); } static Object P_Widget_Compositep (Object w) { Check_Widget (w); return XtIsComposite (WIDGET(w)->widget) ? True : False; } static Object Manage_Unmanage (Object children, void (*f)()) { register int i, n; Widget *buf; Object tail; Alloca_Begin; Check_List (children); n = Fast_Length (children); Alloca (buf, Widget*, n * sizeof (Widget)); for (i = 0, tail = children; i < n; i++, tail = Cdr (tail)) { Object w; w = Car (tail); Check_Widget (w); buf[i] = WIDGET(w)->widget; } f (buf, n); Alloca_End; return Void; } static Object P_Manage_Children (Object children) { return Manage_Unmanage (children, XtManageChildren); } static Object P_Unmanage_Children (Object children) { return Manage_Unmanage (children, XtUnmanageChildren); } static Object P_Widget_Managedp (Object w) { Check_Widget (w); return XtIsManaged (WIDGET(w)->widget) ? True : False; } static Object P_Widget_Class (Object w) { Check_Widget (w); return Make_Widget_Class (XtClass (WIDGET(w)->widget)); } static Object P_Widget_Superclass (Object w) { Check_Widget (w); if (XtClass (WIDGET(w)->widget) == widgetClass) return Sym_None; return Make_Widget_Class (XtSuperclass (WIDGET(w)->widget)); } static Object P_Widget_Subclassp (Object w, Object c) { Check_Widget (w); Check_Type (c, T_Class); return XtIsSubclass (WIDGET(w)->widget, CLASS(c)->wclass) ? True : False; } static Object P_Set_Mapped_When_Managed (Object w, Object m) { Check_Widget (w); Check_Type (m, T_Boolean); XtSetMappedWhenManaged (WIDGET(w)->widget, EQ(m, True)); return Void; } static Object P_Map_Widget (Object w) { Check_Widget (w); XtMapWidget (WIDGET(w)->widget); return Void; } static Object P_Unmap_Widget (Object w) { Check_Widget (w); XtUnmapWidget (WIDGET(w)->widget); return Void; } static Object P_Set_Values (int argc, Object *argv) { ArgList a; Widget w; register int i, n = (argc-1)/2; Alloca_Begin; Check_Widget (argv[0]); w = WIDGET(argv[0])->widget; Encode_Arglist (argc-1, argv+1, a, w, XtClass (w)); XtSetValues (w, a, (Cardinal)n); for (i = 0; i < n; i++) if (streq (a[i].name, XtNdestroyCallback)) Fiddle_Destroy_Callback (w); Alloca_End; return Void; } static Object P_Get_Values (int argc, Object *argv) { Widget w; Check_Widget (argv[0]); w = WIDGET(argv[0])->widget; return Get_Values (w, argc-1, argv+1); } static Object P_Widget_Context (Object w) { Check_Widget (w); return Make_Context_Foreign (XtWidgetToApplicationContext (WIDGET(w)->widget)); } static Object P_Set_Sensitive (Object w, Object s) { Check_Widget (w); Check_Type (s, T_Boolean); XtSetSensitive (WIDGET(w)->widget, EQ(s, True)); return Void; } static Object P_Sensitivep (Object w) { Check_Widget (w); return XtIsSensitive (WIDGET(w)->widget) ? True : False; } static Object P_Window_To_Widget (Object w) { Check_Type (w, T_Window); return Make_Widget_Foreign (XtWindowToWidget (WINDOW(w)->dpy, WINDOW(w)->win)); } static Object P_Name_To_Widget (Object root, Object name) { Check_Widget (root); return Make_Widget_Foreign (XtNameToWidget (WIDGET(root)->widget, Get_Strsym (name))); } static Object P_Widget_Translate_Coordinates (Object w, Object x, Object y) { Position root_x, root_y; Check_Widget (w); XtTranslateCoords (WIDGET(w)->widget, Get_Integer (x), Get_Integer (y), &root_x, &root_y); return Cons (Make_Integer (root_x), Make_Integer (root_y)); } /* The GC-visit function for widgets. Visit the children of composite * widgets and all the parents of a widget. * Based on code contributed by Ken Fox . */ #include #include #include #undef XtIsComposite Boolean XtIsComposite (Widget object); static int Widget_Visit (Object *root, int (*func)()) { Object obj; Widget w = WIDGET(*root)->widget; if (WIDGET(*root)->free == 0 && XtIsComposite (w)) { unsigned int i; CompositeRec *comp = (CompositeRec *)w; for (i = 0; i < comp->composite.num_children; i++) { obj = Find_Object (T_Widget, (GENERIC)0, Match_Xt_Obj, comp->composite.children[i]); if (TYPE(obj) == T_Widget) func (&obj); } while ((w = XtParent (w))) { obj = Find_Object (T_Widget, (GENERIC)0, Match_Xt_Obj, w); if (TYPE(obj) == T_Widget) func (&obj); } } return 0; } void elk_init_xt_widget () { T_Widget = Define_Type (0, "widget", NOFUNC, sizeof (struct S_Widget), Widget_Equal, Widget_Equal, Widget_Print, Widget_Visit); Define_Primitive (P_Widgetp, "widget?", 1, 1, EVAL); Define_Primitive (P_Destroy_Widget, "destroy-widget", 1, 1, EVAL); Define_Primitive (P_Create_Shell, "create-shell", 4, MANY, VARARGS); Define_Primitive (P_Create_Widget, "create-widget", 2, MANY, VARARGS); Define_Primitive (P_Realize_Widget, "realize-widget", 1, 1, EVAL); Define_Primitive (P_Unrealize_Widget, "unrealize-widget", 1, 1, EVAL); Define_Primitive (P_Widget_Realizedp, "widget-realized?", 1, 1, EVAL); Define_Primitive (P_Widget_Display, "widget-display", 1, 1, EVAL); Define_Primitive (P_Widget_Parent, "widget-parent", 1, 1, EVAL); Define_Primitive (P_Widget_Name, "widget-name", 1, 1, EVAL); Define_Primitive (P_Widget_To_Window, "widget->window", 1, 1, EVAL); Define_Primitive (P_Widget_Compositep, "widget-composite?", 1, 1, EVAL); Define_Primitive (P_Manage_Children, "manage-children", 1, 1, EVAL); Define_Primitive (P_Unmanage_Children, "unmanage-children", 1, 1, EVAL); Define_Primitive (P_Widget_Managedp, "widget-managed?", 1, 1, EVAL); Define_Primitive (P_Widget_Class, "widget-class", 1, 1, EVAL); Define_Primitive (P_Widget_Superclass, "widget-superclass", 1, 1, EVAL); Define_Primitive (P_Widget_Subclassp, "widget-subclass?", 2, 2, EVAL); Define_Primitive (P_Set_Mapped_When_Managed, "set-mapped-when-managed!", 2, 2, EVAL); Define_Primitive (P_Map_Widget, "map-widget", 1, 1, EVAL); Define_Primitive (P_Unmap_Widget, "unmap-widget", 1, 1, EVAL); Define_Primitive (P_Set_Values, "set-values!", 1, MANY, VARARGS); Define_Primitive (P_Get_Values, "get-values", 1, MANY, VARARGS); Define_Primitive (P_Widget_Context, "widget-context", 1, 1, EVAL); Define_Primitive (P_Set_Sensitive, "set-sensitive!", 2, 2, EVAL); Define_Primitive (P_Sensitivep, "widget-sensitive?", 1, 1, EVAL); Define_Primitive (P_Window_To_Widget, "window->widget", 1, 1, EVAL); Define_Primitive (P_Name_To_Widget, "name->widget", 2, 2, EVAL); Define_Primitive (P_Widget_Translate_Coordinates, "widget-translate-coordinates", 3, 3, EVAL); } elk-3.99.8/lib/xwidgets/identifier.c0000644000175000017500000000457611577076306014242 00000000000000/* identifier.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "xt.h" Generic_Predicate (Identifier) static int Identifier_Equal (Object x, Object y) { register struct S_Identifier *p = IDENTIFIER(x), *q = IDENTIFIER(y); return p->type == q->type && p->val == q->val && !p->free && !q->free; } Generic_Print (Identifier, "#[identifier %lu]", (unsigned int)(uintptr_t)POINTER(x)) Object Make_Id (int type, XtPointer val, int num) { Object i; i = Find_Object (T_Identifier, (GENERIC)0, Match_Xt_Obj, type, val); if (Nullp (i)) { i = Alloc_Object (sizeof (struct S_Identifier), T_Identifier, 0); IDENTIFIER(i)->tag = Null; IDENTIFIER(i)->type = type; IDENTIFIER(i)->val = val; IDENTIFIER(i)->num = num; IDENTIFIER(i)->free = 0; Register_Object (i, (GENERIC)0, (PFO)0, 0); } return i; } XtPointer Use_Id (Object x, int type) { Check_Type (x, T_Identifier); if (IDENTIFIER(x)->type != type || IDENTIFIER(x)->free) Primitive_Error ("invalid identifier"); IDENTIFIER(x)->free = 1; Deregister_Object (x); return IDENTIFIER(x)->val; } void elk_init_xt_identifier () { Generic_Define (Identifier, "identifier", "identifier?"); } elk-3.99.8/lib/xwidgets/accelerator.c0000644000175000017500000000423511577076306014374 00000000000000/* accelerator.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "xt.h" XtAccelerators Get_Accelerators (Object a) { register char *s; XtAccelerators ret; Alloca_Begin; Get_Strsym_Stack (a, s); if ((ret = XtParseAcceleratorTable (s)) == 0) Primitive_Error ("bad accelerator table: ~s", a); Alloca_End; return ret; } static Object P_Install_Accelerators (Object dst, Object src) { Check_Widget (dst); Check_Widget (src); XtInstallAccelerators (WIDGET(dst)->widget, WIDGET(src)->widget); return Void; } static Object P_Install_All_Accelerators (Object dst, Object src) { Check_Widget (dst); Check_Widget (src); XtInstallAllAccelerators (WIDGET(dst)->widget, WIDGET(src)->widget); return Void; } void elk_init_xt_accelerator () { Define_Primitive (P_Install_Accelerators, "install-accelerators", 2, 2, EVAL); Define_Primitive (P_Install_All_Accelerators, "install-all-accelerators", 2, 2, EVAL); } elk-3.99.8/lib/xwidgets/error.c0000644000175000017500000000332311577076306013236 00000000000000/* error.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "xt.h" static Object V_Xt_Warning_Handler; void Xt_Warning (char *msg) { Object args, fun; args = Cons (Make_String (msg, strlen (msg)), Null); fun = Var_Get (V_Xt_Warning_Handler); if (TYPE(fun) == T_Compound) (void)Funcall (fun, args, 0); Format (Curr_Output_Port, msg, strlen (msg), 0, (Object *)0); (void)P_Newline (0, (Object *)0); } void elk_init_xt_error () { Define_Variable (&V_Xt_Warning_Handler, "xt-warning-handler", Null); XtSetWarningHandler (Xt_Warning); } elk-3.99.8/lib/xwidgets/objects.c0000644000175000017500000000343311577076306013540 00000000000000/* objects.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include #include "xt.h" int Match_Xt_Obj (Object x, va_list v) { register int type = TYPE(x); if (type == T_Context) { return va_arg (v, XtAppContext) == CONTEXT(x)->context; } else if (type == T_Class) { return va_arg (v, WidgetClass) == CLASS(x)->wclass; } else if (type == T_Widget) { return va_arg (v, Widget) == WIDGET(x)->widget; } else if (type == T_Identifier) { return va_arg (v, int) == IDENTIFIER(x)->type && va_arg (v, XtPointer) == IDENTIFIER(x)->val; } else Panic ("Match_Xt_Obj"); return 0; } elk-3.99.8/lib/xwidgets/resource.c0000644000175000017500000004100411577076306013732 00000000000000/* resource.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "xt.h" #include #define XtRChar "Char" #define XtRGC "GC" #define XtRBackingStore "BackingStore" #define T_Unknown -1 #define T_String_Or_Symbol -2 #define T_Callbacklist -3 #define T_Float -4 #define T_Backing_Store -5 #define T_Dimension -6 #define T_Translations -7 #define T_Position -8 #define T_Bitmap -9 #define T_Cardinal -10 #define T_Accelerators -11 static int Resource_To_Scheme_Type (register char *t) { if (streq (XtRAcceleratorTable, t)) return T_Accelerators; else if (streq (XtRBackingStore, t)) return T_Backing_Store; else if (streq (XtRBitmap, t)) return T_Bitmap; else if (streq (XtRBoolean, t)) return T_Boolean; else if (streq (XtRCallback, t)) return T_Callbacklist; else if (streq (XtRCardinal, t)) return T_Cardinal; else if (streq (XtRColormap, t)) return T_Colormap; else if (streq (XtRCursor, t)) return T_Cursor; else if (streq (XtRDimension, t)) return T_Dimension; else if (streq (XtRDisplay, t)) return T_Display; else if (streq (XtRFloat, t)) return T_Float; else if (streq (XtRFont, t)) return T_Font; else if (streq (XtRFontStruct, t)) return T_Font; else if (streq (XtRGC, t)) return T_Gc; else if (streq (XtRInt, t)) return T_Fixnum; else if (streq (XtRPixel, t)) return T_Pixel; else if (streq (XtRPixmap, t)) return T_Pixmap; else if (streq (XtRPosition, t)) return T_Position; else if (streq (XtRShort, t)) return T_Fixnum; else if (streq (XtRString, t)) return T_String_Or_Symbol; else if (streq (XtRTranslationTable, t)) return T_Translations; else if (streq (XtRUnsignedChar, t)) return T_Character; else if (streq (XtRChar, t)) return T_Character; else if (streq (XtRWidget, t)) return T_Widget; else if (streq (XtRWindow, t)) return T_Window; return T_Unknown; } void Get_All_Resources (int sub, Widget w, WidgetClass c, XtResource **rp, int *np, int *cp) { XtResource *r, *sr, *cr; int nr, snr = 0, cnr = 0; XtGetResourceList (c, &r, (Cardinal *)&nr); if (sub) Get_Sub_Resource_List (c, &sr, (Cardinal *)&snr); if (w && XtParent (w)) XtGetConstraintResourceList (XtClass (XtParent (w)), &cr, (Cardinal *)&cnr); *np = nr + snr + cnr; *cp = cnr; *rp = (XtResource *)XtMalloc (*np * sizeof (XtResource)); memcpy ((char *)*rp, (char *)r, nr * sizeof (XtResource)); XtFree ((char *)r); if (snr) memcpy ((char *)(*rp + nr), (char *)sr, snr * sizeof (XtResource)); if (cnr) { memcpy ((char *)(*rp + nr+snr), (char *)cr, cnr * sizeof (XtResource)); XtFree ((char *)cr); } } void Convert_Args (int ac, Object *av, ArgList to, Widget widget, WidgetClass class) { register char *name, *res; register int i, j, k; Object arg, val; XtResource *r; int nr, nc; int st, dt; char key[128]; PFS2X converter; char *stmp; XrmValue src, dst; Alloca_Begin; if (ac & 1) Primitive_Error ("missing argument value"); Get_All_Resources (1, widget, class, &r, &nr, &nc); /* Note: * `r' is not freed in case of error. */ for (i = k = 0; k < ac; i++, k++) { arg = av[k]; Get_Strsym_Stack (arg, name); Make_Resource_Name (name); for (j = 0; j < nr && !streq (name, r[j].resource_name); j++) ; if (j == nr) Primitive_Error ("no such resource: ~s", arg); if (streq (r[j].resource_class, XtCReadOnly)) Primitive_Error ("resource is read-only: ~s", arg); res = r[j].resource_name; val = av[++k]; st = TYPE(val); dt = Resource_To_Scheme_Type (r[j].resource_type); /* First look for widget class specific converter for * this resource, then look for a general converter * (first try the name of the resource, then the type): */ if (widget && j >= nr-nc) class = XtClass (XtParent (widget)); sprintf (key, "%s-%s", Class_Name (class), name); converter = Find_Converter_To_C (key); if (converter || (converter = Find_Converter_To_C (res)) || (converter = Find_Converter_To_C (r[j].resource_type))) { XtArgVal ret = converter (val); XtSetArg (to[i], res, ret); } else if (dt == T_String_Or_Symbol) { Get_Strsym_Stack (val, stmp); XtSetArg (to[i], res, XtNewString (stmp)); /* Never freed! */ } else if (dt == T_Callbacklist) { int n; XtCallbackList callbacks; Check_Callback_List (val); n = Fast_Length (val); callbacks = (XtCallbackRec *) /* Never freed! */ XtMalloc ((n+1) * sizeof (XtCallbackRec)); callbacks[n].callback = 0; callbacks[n].closure = 0; Fill_Callbacks (val, callbacks, n, Find_Callback_Converter (class, name, arg)); XtSetArg (to[i], res, callbacks); } else if (dt == T_Float) { float f = (float)Get_Double (val); to[i].name = res; memcpy ((char *)&to[i].value, (char *)&f, sizeof f); } else if (dt == T_Dimension || dt == T_Position || dt == T_Cardinal || dt == T_Fixnum) { XtSetArg (to[i], res, Get_Integer (val)); } else if (dt == T_Backing_Store) { XtSetArg (to[i], res, Symbols_To_Bits (val, 0, Backing_Store_Syms)); } else if (dt == T_Translations) { XtSetArg (to[i], res, Get_Translations (val)); } else if (dt == T_Accelerators) { XtSetArg (to[i], res, Get_Accelerators (val)); } else if ((dt == T_Bitmap || dt == T_Pixmap) && EQ(val, Sym_None)) { XtSetArg (to[i], res, None); } else if (dt == T_Bitmap) { /* Should check depth here (must be 1), but how? */ XtSetArg (to[i], res, Get_Pixmap (val)); } else { if (st != dt) { char msg[128]; /* Try to let XtConvert() do the conversion. */ if (widget && (st == T_String || st == T_Symbol)) { Get_Strsym_Stack (val, stmp); src.size = strlen (stmp); src.addr = (caddr_t)stmp; XtConvert (widget, (String)XtRString, &src, r[j].resource_type, &dst); if (dst.addr) { if (dst.size == (sizeof (unsigned char))) { XtSetArg (to[i], res, *(unsigned char *)dst.addr); } else if (dst.size == sizeof (int)) { XtSetArg (to[i], res, *(int *)dst.addr); } else if (dst.size == sizeof (XtArgVal)) { XtSetArg (to[i], res, *(XtArgVal *)dst.addr); } else { sprintf (msg, "%s: converter for %s returned weird size %d", name, r[j].resource_type, dst.size); Primitive_Error (msg); } goto done; } } sprintf (msg, "%s: can't convert %s ~s to %s", name, Types[st].name, r[j].resource_type); Primitive_Error (msg, val); } if (dt == T_Boolean) { XtSetArg (to[i], res, EQ(val, True)); } else if (dt == T_Colormap) { XtSetArg (to[i], res, COLORMAP(val)->cm); } else if (dt == T_Cursor) { XtSetArg (to[i], res, CURSOR(val)->cursor); } else if (dt == T_Display) { XtSetArg (to[i], res, DISPLAY(val)->dpy); } else if (dt == T_Font) { Open_Font_Maybe (val); if (streq (r[j].resource_type, XtRFontStruct)) XtSetArg (to[i], res, FONT(val)->info); else XtSetArg (to[i], res, FONT(val)->id); } else if (dt == T_Pixel) { XtSetArg (to[i], res, PIXEL(val)->pix); } else if (dt == T_Pixmap) { XtSetArg (to[i], res, PIXMAP(val)->pm); } else if (dt == T_Gc) { XtSetArg (to[i], res, GCONTEXT(val)->gc); } else if (dt == T_Character) { XtSetArg (to[i], res, CHAR(val)); } else if (dt == T_Widget) { XtSetArg (to[i], res, WIDGET(val)->widget); } else if (dt == T_Window) { XtSetArg (to[i], res, WINDOW(val)->win); } else Panic ("bad conversion type"); } done: ; } Alloca_End; XtFree ((char *)r); } Object Get_Values (Widget w, int ac, Object *av) { register char *name; register int i, j; Object arg; XtResource *r; int nr, nc; int t; ArgList argl; Object ret, tail; Display *dpy; char key[128]; PFX2S converter; Widget w2; GC_Node2; Alloca_Begin; Alloca (argl, Arg*, ac * sizeof (Arg)); Get_All_Resources (0, w, XtClass (w), &r, &nr, &nc); /* Note: * `r' is not freed in case of error. */ for (i = 0; i < ac; i++) { XtArgVal argval; arg = av[i]; Check_Type (arg, T_Symbol); Get_Strsym_Stack (arg, name); Make_Resource_Name (name); for (j = 0; j < nr && !streq (name, r[j].resource_name); j++) ; if (j == nr) Primitive_Error ("no such resource: ~s", arg); argl[i].name = name; Alloca (argval, XtArgVal, r[j].resource_size); argl[i].value = argval; } XtGetValues (w, argl, (Cardinal)ac); ret = tail = P_Make_List (Make_Integer (ac), Null); GC_Link2 (ret, tail); /* * Display is needed for resources like cursor and pixmap. * XtDisplayOfObject(w) is not necessarily the right one! */ dpy = XtDisplayOfObject (w); for (i = 0; i < ac; i++, tail = Cdr (tail)) { Object o; XtArgVal val = argl[i].value; for (j = 0; j < nr && !streq (argl[i].name, r[j].resource_name); j++) ; t = Resource_To_Scheme_Type (r[j].resource_type); /* Look for a widget class specific converter, then for a * general converter (first try the resource name, then the type): */ w2 = (j >= nr-nc) ? XtParent (w) : w; sprintf (key, "%s-%s", Class_Name (XtClass (w2)), argl[i].name); converter = Find_Converter_To_Scheme (key); if (converter) { o = converter (*(XtArgVal *)val); } else if ((converter = Find_Converter_To_Scheme (argl[i].name))) { o = converter (*(XtArgVal *)val); } else if ((converter = Find_Converter_To_Scheme (r[j].resource_type))) { o = converter (*(XtArgVal *)val); } else if (t == T_String_Or_Symbol) { char *s = *(char **)val; if (s == 0) s = ""; o = Make_String (s, strlen (s)); } else if (t == T_Callbacklist) { register int i, n; Object ret, tail; XtCallbackList callbacks = *(XtCallbackList *)val; GC_Node; for (n = 0; callbacks[n].callback; n++) ; ret = tail = P_Make_List (Make_Integer (n), Null); GC_Link2 (ret, tail); for (i = 0; i < n; i++, tail = Cdr (tail)) Car (tail) = Get_Callbackfun (callbacks[i].closure); GC_Unlink; o = ret; } else if (t == T_Float) { o = Make_Reduced_Flonum ((double)*(float *)val); } else if (t == T_Backing_Store) { o = Bits_To_Symbols ((unsigned long)*(int *)val, 0, Backing_Store_Syms); if (Nullp (o)) Primitive_Error ("invalid backing-store (Xt bug)"); } else if (t == T_Boolean) { o = (Boolean)*(Boolean *)val ? True : False; } else if (t == T_Colormap) { o = Make_Colormap (0, dpy, *(Colormap *)val); } else if (t == T_Cursor) { o = Make_Cursor_Foreign (dpy, *(Cursor *)val); } else if (t == T_Gc) { o = Make_Gc (0, dpy, *(GC *)val); } else if (t == T_Dimension) { o = Make_Integer (*(Dimension *)val); } else if (t == T_Position) { o = Make_Integer (*(Position *)val); } else if (t == T_Cardinal) { o = Make_Unsigned (*(Cardinal *)val); } else if (t == T_Fixnum) { if (streq (r[j].resource_type, XtRInt)) o = Make_Integer (*(int *)val); else o = Make_Integer (*(short *)val); } else if (t == T_Display) { o = Make_Display (0, dpy); } else if (t == T_Font) { if (streq (r[j].resource_type, XtRFontStruct)) { o = Make_Font_Foreign (dpy, False, (Font)0, *(XFontStruct **)val); } else { XFontStruct *info; Disable_Interrupts; info = XQueryFont (dpy, *(Font *)val); Enable_Interrupts; o = Make_Font_Foreign (dpy, False, *(Font *)val, info); } } else if (t == T_Pixel) { o = Make_Pixel (*(unsigned long *)val); } else if (t == T_Pixmap || t == T_Bitmap) { o = Make_Pixmap_Foreign (dpy, *(Pixmap *)val); } else if (t == T_Character) { o = Make_Char (*(unsigned char *)val); } else if (t == T_Widget) { o = Make_Widget_Foreign (*(Widget *)val); } else if (t == T_Window) { o = Make_Window (0, dpy, *(Window *)val); } else { char s[128]; sprintf (s, "%s: no converter for %s", argl[i].name, r[j].resource_type); Primitive_Error (s); } Car (tail) = o; } XtFree ((char *)r); GC_Unlink; return ret; } /* Convert `mapped-when-managed' to `mappedWhenManaged'. */ void Make_Resource_Name (register char *s) { register char *p; for (p = s; *s; ) { if (*s == '-') { if (*++s) { if (islower (*s)) *s = toupper (*s); *p++ = *s++; } } else *p++ = *s++; } *p = '\0'; } Object Get_Resources (WidgetClass c, void (*fun)(), int freeit) { XtResource *r; register XtResource *p; int nr; Object ret, tail, tail2, x; GC_Node3; fun (c, &r, &nr); /* Note: * `r' is not freed in case of error. */ ret = tail = tail2 = P_Make_List (Make_Integer (nr), Null); GC_Link3 (ret, tail, tail2); for (p = r; p < r+nr; p++, tail = Cdr (tail)) { x = tail2 = P_Make_List (Make_Integer (3), Null); Car (tail) = tail2 = x; x = Intern (p->resource_name); Car (tail2) = x; tail2 = Cdr (tail2); x = Intern (p->resource_class); Car (tail2) = x; tail2 = Cdr (tail2); x = Intern (p->resource_type); Car (tail2) = x; } GC_Unlink; if (freeit) XtFree ((char *)r); return ret; } elk-3.99.8/lib/xwidgets/converter.c0000644000175000017500000000450511577076306014117 00000000000000/* converter.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "xt.h" #define MAX_CONVERTER 512 typedef struct { char *name; int scheme_to_c; PFX2S to_scheme; PFS2X to_c; } CONVERTER; static CONVERTER ctab[MAX_CONVERTER], *clast = ctab; void Define_Converter_To_Scheme (char *name, PFX2S c) { Set_Error_Tag ("c->scheme"); if (clast == ctab+MAX_CONVERTER) Primitive_Error ("too many converters"); clast->name = name; clast->scheme_to_c = 0; clast->to_scheme = c; clast++; } void Define_Converter_To_C (char *name, PFS2X c) { Set_Error_Tag ("scheme->c"); if (clast == ctab+MAX_CONVERTER) Primitive_Error ("too many converters"); clast->name = name; clast->scheme_to_c = 1; clast->to_c = c; clast++; } PFX2S Find_Converter_To_Scheme (char *name) { register CONVERTER *p; for (p = ctab; p < clast; p++) if (!p->scheme_to_c && streq (p->name, name)) return p->to_scheme; return 0; } PFS2X Find_Converter_To_C (char *name) { register CONVERTER *p; for (p = ctab; p < clast; p++) if (p->scheme_to_c && streq (p->name, name)) return p->to_c; return 0; } elk-3.99.8/lib/xwidgets/mkwidget.scm0000644000175000017500000001333611577076306014265 00000000000000;;; -*-Scheme-*- (define type-name #f) (define classes '()) (define callbacks '()) (define primitives '()) (define converters '()) (define f) (define (check-string proc x name) (if (not (memq (type x) '(symbol string))) (error proc (format #f "~s must be string or symbol" name)))) (define (define-widget-type name include) (if type-name (error 'define-widget-type "must be called once")) (check-string 'define-widget-type name 'name) (if (pair? include) (for-each (lambda (i) (check-string 'define-widget-type i 'include)) include) (check-string 'define-widget-type include 'include)) (set! type-name name) (format f "#include \"../xt.h\"~%") (case widget-set (motif (format f "#include ~%"))) (if (and (not (eqv? include "")) (not (null? include))) (begin (define dir) (case widget-set (motif (set! dir "Xm")) (xaw (set! dir "X11/Xaw"))) (if (pair? include) (for-each (lambda (i) (if (char=? (string-ref (format #f "~a" i) 0) #\<) (format f "#include ~a~%" i) (format f "#include <~a/~a>~%" dir i))) include) (if (char=? (string-ref (format #f "~a" include) 0) #\<) (format f "#include ~a~%" include) (format f "#include <~a/~a>~%" dir include))))) (newline f)) (define (prolog code) (if (not type-name) (error 'prolog "must define a widget-type first")) (check-string 'prolog code 'code) (display code f) (format f "~%~%")) (define (define-callback class name has-arg?) (check-string 'define-callback class 'class) (check-string 'define-callback name 'name) (if (not (boolean? has-arg?)) (error 'define-callback "has-arg? must be boolean")) (set! callbacks (cons (list class name has-arg?) callbacks))) (define (c->scheme name body) (check-string 'c->scheme name 'name) (define c-name (scheme-to-c-name name)) (string-set! c-name 0 #\S) (format f "static Object ~a (XtArgVal x) {~%" c-name) (display body f) (format f "~%}~%~%") (define s (format #f " Define_Converter_To_Scheme (\"~a\", ~a);~%" name c-name)) (set! converters (cons s converters))) (define (scheme->c name body) (check-string 'scheme->c name 'name) (define c-name (scheme-to-c-name name)) (string-set! c-name 0 #\C) (format f "static XtArgVal ~a (Object x) {~%" c-name) (display body f) (format f "~%}~%~%") (define s (format #f " Define_Converter_To_C (\"~a\", ~a);~%" name c-name)) (set! converters (cons s converters))) (define (define-primitive scheme-name args body) (check-string 'define-primitive scheme-name 'scheme-name) (if (not (pair? args)) (error 'define-primitive "args must be a list")) (define c-name (scheme-to-c-name scheme-name)) (format f "static Object ~a (" c-name) (do ((a args a)) ((null? a)) (display "Object " f) (display (car a) f) (set! a (cdr a)) (if (not (null? a)) (display ", " f))) (display ") {" f) (newline f) (display body f) (format f "~%}~%~%") (define s (format #f " Define_Primitive (~a, \"~a\", ~a, ~a, EVAL);~%" c-name scheme-name (length args) (length args))) (set! primitives (cons s primitives))) ;;; [missing conversion from -> to "to"] (define (scheme-to-c-name s) (if (symbol? s) (set! s (symbol->string s))) (define len (string-length s)) (if (char=? (string-ref s (1- len)) #\?) (string-set! s (1- len) #\p)) (if (char=? (string-ref s (1- len)) #\!) (set! len (1- len))) (let loop ((ret "P") (i 0)) (if (>= i len) ret (define next (do ((j i (1+ j))) ((or (= j len) (memq (string-ref s j) '(#\- #\:))) j))) (loop (format #f "~a_~a~a" ret (char-upcase (string-ref s i)) (substring s (1+ i) next)) (1+ next))))) (define (define-widget-class name class . sub-resources) (check-string 'define-widget-class name 'name) (check-string 'define-widget-class class 'class) (set! classes (cons (list name class sub-resources) classes))) (define (feature-name fn) (let ((i (substring? ".d" fn))) (display "filename: ") (display fn) (newline) (if (not i) (error 'mkwidget "bad filename suffix in ~a (expected .d)" fn)) (string->symbol (substring fn 0 i)))) (define args (command-line-args)) (if (not (= (length args) 3)) (error 'mkwidget "expected three arguments")) (define widget-set (string->symbol (caddr args))) (set! f (open-output-file (cadr args))) (load (car args)) (if (not type-name) (error 'mkwidget "no widget type defined")) (format f "void elk_init_~a_~a () {~%" widget-set type-name) (if (not (null? classes)) (format f " XtResourceList r = 0;~%")) (do ((c classes (cdr c))) ((null? c)) (define cl (car c)) (define res (caddr cl)) (if (not (null? res)) (begin (format f " r = (XtResourceList)XtMalloc (~a * sizeof (XtResource));~%" (length res)) (do ((r res (cdr r)) (num 0 (1+ num))) ((null? r)) (define x (car r)) (if (not (= (length x) 3)) (error 'mkwidget "bad sub-resource declaration")) (for-each (lambda (r) (if (not (memq (type r) '(symbol string))) (error 'mkwidget "bad type in sub-resource declaration"))) x) (format f " r[~a].resource_name = \"~a\";~%" num (car x)) (format f " r[~a].resource_class = \"~a\";~%" num (cadr x)) (format f " r[~a].resource_type = \"~a\";~%" num (caddr x))))) (format f " Define_Class (\"~a\", ~a, r, ~a);~%" (car cl) (cadr cl) (length res))) (do ((c callbacks (cdr c))) ((null? c)) (define cb (car c)) (format f " Define_Callback (\"~a\", \"~a\", ~a);~%" (car cb) (cadr cb) (if (caddr cb) 1 0))) (for-each (lambda (x) (display x f)) primitives) (for-each (lambda (x) (display x f)) converters) (format f " P_Provide(Intern(\"~a:~a\"));~%" widget-set (feature-name (car args))) (format f "}~%") elk-3.99.8/lib/xwidgets/classname.c0000644000175000017500000000264211577076306014056 00000000000000/* classname.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "xt.h" #include #include Object Xt_Class_Name (WidgetClass class) { return Make_String (class->core_class.class_name, strlen (class->core_class.class_name)); } elk-3.99.8/lib/xwidgets/popup.c0000644000175000017500000000516511577076306013256 00000000000000/* popup.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "xt.h" static SYMDESCR Grab_Kind_Syms[] = { { "grab-none", XtGrabNone }, { "grab-nonexclusive", XtGrabNonexclusive }, { "grab-exclusive", XtGrabExclusive }, { 0, 0 } }; static Object P_Create_Popup_Shell (int argc, Object *argv) { ArgList a; char *name = 0; Object x, class, parent, ret; Alloca_Begin; x = argv[0]; if (TYPE(x) != T_Class) { name = Get_Strsym (x); argv++; argc--; } class = argv[0]; parent = argv[1]; Check_Type (class, T_Class); Check_Widget (parent); if (name == 0) name = CLASS(class)->name; Encode_Arglist (argc-2, argv+2, a, (Widget)0, CLASS(class)->wclass); ret = Make_Widget (XtCreatePopupShell (name, CLASS(class)->wclass, WIDGET(parent)->widget, a, (Cardinal)(argc-2)/2)); Alloca_End; return ret; } static Object P_Popup (Object shell, Object grab_kind) { Check_Widget (shell); XtPopup (WIDGET(shell)->widget, Symbols_To_Bits (grab_kind, 0, Grab_Kind_Syms)); return Void; } static Object P_Popdown (Object shell) { Check_Widget (shell); XtPopdown (WIDGET(shell)->widget); return Void; } void elk_init_xt_popup () { Define_Primitive (P_Create_Popup_Shell, "create-popup-shell", 2, MANY, VARARGS); Define_Primitive (P_Popup, "popup", 2, 2, EVAL); Define_Primitive (P_Popdown, "popdown", 1, 1, EVAL); } elk-3.99.8/lib/xwidgets/translation.c0000644000175000017500000000574311577076306014453 00000000000000/* translation.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "xt.h" XtTranslations Get_Translations (Object t) { register char *s; XtTranslations ret; Alloca_Begin; Get_Strsym_Stack (t, s); if ((ret = XtParseTranslationTable (s)) == 0) Primitive_Error ("bad translation table: ~s", t); Alloca_End; return ret; } static Object P_Augment_Translations (Object w, Object t) { Check_Widget (w); XtAugmentTranslations (WIDGET(w)->widget, Get_Translations (t)); return Void; } static Object P_Override_Translations (Object w, Object t) { Check_Widget (w); XtOverrideTranslations (WIDGET(w)->widget, Get_Translations (t)); return Void; } static Object P_Uninstall_Translations (Object w) { Check_Widget (w); XtUninstallTranslations (WIDGET(w)->widget); return Void; } /* Due to a bug in Xt these functions drop core when invoked with a * display not owned by Xt. */ static Object P_Multi_Click_Time (Object d) { Check_Type (d, T_Display); return Make_Integer (XtGetMultiClickTime (DISPLAY(d)->dpy)); } static Object P_Set_Multi_Click_Time (Object d, Object t) { Check_Type (d, T_Display); XtSetMultiClickTime (DISPLAY(d)->dpy, Get_Integer (t)); return Void; } void elk_init_xt_translation () { Define_Primitive (P_Augment_Translations, "augment-translations", 2, 2, EVAL); Define_Primitive (P_Override_Translations, "override-translations", 2, 2, EVAL); Define_Primitive (P_Uninstall_Translations, "uninstall-translations", 1, 1, EVAL); Define_Primitive (P_Multi_Click_Time, "multi-click-time", 1, 1, EVAL); Define_Primitive (P_Set_Multi_Click_Time, "set-multi-click-time!", 2, 2, EVAL); } elk-3.99.8/lib/xwidgets/Makefile.am0000644000175000017500000000130211577076306013770 00000000000000NULL = SUBDIRS = . xaw motif EXTRA_DIST = MISSING mkwidget.scm lib_LTLIBRARIES = $(libelk_xt_la) if HAVE_XT libelk_xt_la = libelk-xt.la endif libelk_xt_la_SOURCES = $(SOURCES_XT) libelk_xt_la_CFLAGS = -I$(srcdir)/../xlib @XT_CFLAGS@ libelk_xt_la_LDFLAGS = -no-undefined libelk_xt_la_LIBADD = $(top_builddir)/src/libelk.la ../xlib/libelk-xlib.la @XT_LIBS@ extensions_HEADERS = xt.h extensionsdir = $(pkgincludedir)/extensions SOURCES_XT = \ accelerator.c \ action.c \ callback.c \ class.c \ classname.c \ context.c \ converter.c \ error.c \ function.c \ identifier.c \ init.c \ objects.c \ popup.c \ resource.c \ translation.c \ widget.c \ $(NULL) echo-sources: ; echo $(SOURCES) elk-3.99.8/lib/xwidgets/callback.c0000644000175000017500000001203411577076306013640 00000000000000/* callback.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "xt.h" void Remove_All_Callbacks (Widget w); typedef struct { PFX2S converter; int num; } CLIENT_DATA; Object Get_Callbackfun (XtPointer c) { register CLIENT_DATA *cd = (CLIENT_DATA *)c; return cd ? Get_Function (cd->num) : False; } static void Callback_Proc (Widget w, XtPointer client_data, XtPointer call_data) { register CLIENT_DATA *cd = (CLIENT_DATA *)client_data; Object args; GC_Node; args = Null; GC_Link (args); if (cd->converter) args = Cons ((cd->converter)((XtArgVal)call_data), args); args = Cons (Make_Widget_Foreign (w), args); GC_Unlink; (void)Funcall (Get_Callbackfun (client_data), args, 0); } /*ARGSUSED*/ void Destroy_Callback_Proc (Widget w, XtPointer client_data, XtPointer call_data) { Object x; x = Find_Object (T_Widget, (GENERIC)0, Match_Xt_Obj, w); if (Nullp (x) || WIDGET(x)->free) return; WIDGET(x)->free = 1; Remove_All_Callbacks (w); Deregister_Object (x); } /* The code assumes that callbacks are called in the order they * have been added. The Destroy_Callback_Proc() must always be * the last callback in the destroy callback list of each widget. * * When the destroy callback list of a widget is modified * (via P_Add_Callbacks or P_Set_Values), Fiddle_Destroy_Callback() * must be called to remove the Destroy_Callback_Proc() and put * it back to the end of the callback list. */ void Fiddle_Destroy_Callback (Widget w) { XtRemoveCallback (w, XtNdestroyCallback, Destroy_Callback_Proc, (XtPointer)0); XtAddCallback (w, XtNdestroyCallback, Destroy_Callback_Proc, (XtPointer)0); } void Check_Callback_List (Object x) { Object tail; Check_List (x); for (tail = x; !Nullp (tail); tail = Cdr (tail)) Check_Procedure (Car (tail)); } static Object P_Add_Callbacks (Object w, Object name, Object cbl) { register char *s; register int n; XtCallbackList callbacks; Alloca_Begin; Check_Widget (w); Check_Callback_List (cbl); s = Get_Strsym (name); Make_Resource_Name (s); n = Fast_Length (cbl); Alloca (callbacks, XtCallbackRec*, (n+1) * sizeof (XtCallbackRec)); callbacks[n].callback = 0; callbacks[n].closure = 0; Fill_Callbacks (cbl, callbacks, n, Find_Callback_Converter (XtClass (WIDGET(w)->widget), s, name)); XtAddCallbacks (WIDGET(w)->widget, s, callbacks); if (streq (s, XtNdestroyCallback)) Fiddle_Destroy_Callback (WIDGET(w)->widget); Alloca_End; return Void; } void Fill_Callbacks (Object src, XtCallbackList dst, register int n, PFX2S conv) { register CLIENT_DATA *cd; register int i, j; Object tail; for (i = 0, tail = src; i < n; i++, tail = Cdr (tail)) { j = Register_Function (Car (tail)); cd = (CLIENT_DATA *)XtMalloc (sizeof (CLIENT_DATA)); cd->converter = conv; cd->num = j; dst[i].callback = (XtCallbackProc)Callback_Proc; dst[i].closure = (XtPointer)cd; } } void Remove_All_Callbacks (Widget w) { Arg a[1]; XtCallbackList c; XtResource *r; int nr, nc; register int i, j; Get_All_Resources (0, w, XtClass (w), &r, &nr, &nc); for (j = 0; j < nr; j++) { if (streq (r[j].resource_type, XtRCallback)) { XtSetArg (a[0], r[j].resource_name, &c); XtGetValues (w, a, 1); for (i = 0; c[i].callback; i++) { register CLIENT_DATA *cd = (CLIENT_DATA *)c[i].closure; if (c[i].callback == (XtCallbackProc)Callback_Proc && cd) { Deregister_Function (cd->num); XtFree ((char *)cd); } } } } XtFree ((char *)r); } void elk_init_xt_callback () { Define_Primitive (P_Add_Callbacks, "add-callbacks", 3, 3, EVAL); } elk-3.99.8/lib/xwidgets/init.c0000644000175000017500000000440211577076306013047 00000000000000/* init.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "xt.h" static Object P_Xt_Release_4_Or_Laterp () { return True; } static Object P_Xt_Release_5_Or_Laterp () { #ifdef XT_RELEASE_5_OR_LATER return True; #else return False; #endif } static Object P_Xt_Release_6_Or_Laterp () { #ifdef XT_RELEASE_6_OR_LATER return True; #else return False; #endif } extern WidgetClass vendorShellWidgetClass; /* The reference to vendorShellWidgetClass is required to make sure * that the linker pulls the vendor shell definition from libXaw, * not from libXt. It's passed to a dummy function to make sure that * it isn't removed by the optimizer. */ static void dummy (WidgetClass w) { } void elk_init_xt_init () { extern WidgetClass vendorShellWidgetClass; dummy(vendorShellWidgetClass); Define_Primitive (P_Xt_Release_4_Or_Laterp, "xt-release-4-or-later?", 0, 0, EVAL); Define_Primitive (P_Xt_Release_5_Or_Laterp, "xt-release-5-or-later?", 0, 0, EVAL); Define_Primitive (P_Xt_Release_6_Or_Laterp, "xt-release-6-or-later?", 0, 0, EVAL); XtToolkitInitialize (); } elk-3.99.8/lib/xwidgets/xaw/0000755000175000017500000000000011577110017012603 500000000000000elk-3.99.8/lib/xwidgets/xaw/smebsb.d0000644000175000017500000000250511577076306014161 00000000000000;; smebsb.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'smebsb "SmeBSB.h") (define-widget-class 'smebsb 'smeBSBObjectClass) (define-callback 'smebsb 'callback #f) elk-3.99.8/lib/xwidgets/xaw/panner.d0000644000175000017500000000276311577076306014177 00000000000000;; panner.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'panner "Panner.h") (define-widget-class 'panner 'pannerWidgetClass) (define-callback 'panner 'reportCallback #t) (c->scheme 'callback:panner-reportCallback " XawPannerReport *p = (XawPannerReport *)x; return Cons (Make_Integer (p->slider_x), Make_Integer (p->slider_y));") elk-3.99.8/lib/xwidgets/xaw/stripchart.d0000644000175000017500000000500511577076306015067 00000000000000;; stripchart.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'stripchart "StripChart.h") (prolog "static void Get_Value (Widget w, XtPointer client_data, XtPointer value) { Object ret; ret = Funcall (Get_Function ((int)client_data), Null, 0); switch (TYPE(ret)) { case T_Fixnum: *(double *)value = (double)FIXNUM(ret); break; case T_Flonum: *(double *)value = FLONUM(ret)->val; break; case T_Bignum: *(double *)value = Bignum_To_Double (ret); break; default: Primitive_Error (\"stripchart sampler must return number\"); } }") (define-widget-class 'stripchart 'stripChartWidgetClass) (define-primitive 'stripchart-set-sampler '(w p) " int i; Arg a[1]; XtCallbackList c; Check_Widget_Class (w, stripChartWidgetClass); Check_Procedure (p); XtSetArg (a[0], XtNgetValue, &c); XtGetValues (WIDGET(w)->widget, a, 1); if (c[0].callback) Primitive_Error (\"stripchart already has a sampler\"); i = Register_Function (p); XtAddCallback (WIDGET(w)->widget, XtNgetValue, Get_Value, (XtPointer)i); return Make_Id ('s', (XtPointer)WIDGET(w)->widget, i);") (define-primitive 'stripchart-remove-sampler '(i) " Widget w; w = (Widget)Use_Id (i, 's'); XtRemoveCallback (w, XtNgetValue, Get_Value, (XtPointer)IDENTIFIER(i)->num); Deregister_Function (IDENTIFIER(i)->num); return Void;") elk-3.99.8/lib/xwidgets/xaw/dialog.c0000644000175000017500000000030511577100311014120 00000000000000#include "../xt.h" #include void elk_init_xaw_dialog () { XtResourceList r = 0; Define_Class ("dialog", dialogWidgetClass, r, 0); P_Provide(Intern("xaw:dialog")); } elk-3.99.8/lib/xwidgets/xaw/porthole.d0000644000175000017500000000437411577076306014550 00000000000000;; porthole.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'porthole "Porthole.h") (prolog "static SYMDESCR Panner_Syms[] = { { \"slider-x\", XawPRSliderX }, { \"slider-y\", XawPRSliderY }, { \"slider-width\", XawPRSliderWidth }, { \"slider-height\", XawPRSliderHeight }, { \"canvas-width\", XawPRCanvasWidth }, { \"canvas-height\", XawPRCanvasHeight }, { 0, 0 } };") (define-widget-class 'porthole 'portholeWidgetClass) (define-callback 'porthole 'reportCallback #t) (c->scheme 'callback:porthole-reportCallback " Object ret; XawPannerReport *p = (XawPannerReport *)x; GC_Node; ret = Null; GC_Link (ret); ret = Cons (Make_Integer (p->canvas_height), ret); ret = Cons (Make_Integer (p->canvas_width), ret); ret = Cons (Make_Integer (p->slider_height), ret); ret = Cons (Make_Integer (p->slider_width), ret); ret = Cons (Make_Integer (p->slider_y), ret); ret = Cons (Make_Integer (p->slider_x), ret); ret = Cons (Bits_To_Symbols ((unsigned long)p->changed, 1, Panner_Syms), ret); GC_Unlink; return ret;") elk-3.99.8/lib/xwidgets/xaw/repeater.c0000644000175000017500000000055311577100311014475 00000000000000#include "../xt.h" #include void elk_init_xaw_repeater () { XtResourceList r = 0; Define_Class ("repeater", repeaterWidgetClass, r, 0); Define_Callback ("repeater", "callback", 0); Define_Callback ("repeater", "stopCallback", 0); Define_Callback ("repeater", "startCallback", 0); P_Provide(Intern("xaw:repeater")); } elk-3.99.8/lib/xwidgets/xaw/paned.c0000644000175000017500000000307511577100311013757 00000000000000#include "../xt.h" #include static Object P_Paned_Allow_Resize (Object w, Object enable) { Check_Widget (w); Check_Type (enable, T_Boolean); XawPanedAllowResize (WIDGET(w)->widget, EQ (enable, True)); return Void; } static Object P_Paned_Set_Min_Max (Object w, Object min, Object max) { Check_Widget (w); XawPanedSetMinMax (WIDGET(w)->widget, Get_Integer (min), Get_Integer (max)); return Void; } static Object P_Paned_Get_Min_Max (Object w) { int min, max; Check_Widget (w); XawPanedGetMinMax (WIDGET(w)->widget, &min, &max); return Cons (Make_Integer (min), Make_Integer (max)); } static Object P_Paned_Set_Refigure_Mode (Object w, Object enable) { Check_Widget_Class (w, panedWidgetClass); Check_Type (enable, T_Boolean); XawPanedSetRefigureMode (WIDGET(w)->widget, EQ (enable, True)); return Void; } static Object P_Paned_Get_Num_Sub (Object w) { Check_Widget_Class (w, panedWidgetClass); return Make_Integer (XawPanedGetNumSub (WIDGET(w)->widget)); } void elk_init_xaw_paned () { XtResourceList r = 0; Define_Class ("paned", panedWidgetClass, r, 0); Define_Primitive (P_Paned_Get_Num_Sub, "paned-get-num-sub", 1, 1, EVAL); Define_Primitive (P_Paned_Set_Refigure_Mode, "paned-set-refigure-mode!", 2, 2, EVAL); Define_Primitive (P_Paned_Get_Min_Max, "paned-get-min-max", 1, 1, EVAL); Define_Primitive (P_Paned_Set_Min_Max, "paned-set-min-max!", 3, 3, EVAL); Define_Primitive (P_Paned_Allow_Resize, "paned-allow-resize", 2, 2, EVAL); P_Provide(Intern("xaw:paned")); } elk-3.99.8/lib/xwidgets/xaw/Makefile.in0000644000175000017500000012233011577103434014576 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = lib/xwidgets/xaw DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) xaw_la_DEPENDENCIES = $(top_builddir)/src/libelk.la \ ../../xlib/libelk-xlib.la ../libelk-xt.la am__objects_1 = am__objects_2 = xaw_la-ascii.lo xaw_la-box.lo xaw_la-command.lo \ xaw_la-dialog.lo xaw_la-form.lo xaw_la-grip.lo xaw_la-label.lo \ xaw_la-list.lo xaw_la-menubutton.lo xaw_la-paned.lo \ xaw_la-panner.lo xaw_la-porthole.lo xaw_la-repeater.lo \ xaw_la-scrollbar.lo xaw_la-shell.lo xaw_la-simplemenu.lo \ xaw_la-sme.lo xaw_la-smebsb.lo xaw_la-smeline.lo \ xaw_la-stripchart.lo xaw_la-toggle.lo xaw_la-tree.lo \ xaw_la-viewport.lo $(am__objects_1) am_xaw_la_OBJECTS = xaw_la-init.lo $(am__objects_2) xaw_la_OBJECTS = $(am_xaw_la_OBJECTS) xaw_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(xaw_la_CFLAGS) $(CFLAGS) \ $(xaw_la_LDFLAGS) $(LDFLAGS) -o $@ @HAVE_XAW_TRUE@am_xaw_la_rpath = -rpath $(pkglibdir) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/.auto/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(xaw_la_SOURCES) DIST_SOURCES = $(xaw_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ELK_CFLAGS = @ELK_CFLAGS@ ELK_LDFLAGS = @ELK_LDFLAGS@ ELK_LIBS = @ELK_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INCLUDES = @INCLUDES@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOTIF_CFLAGS = @MOTIF_CFLAGS@ MOTIF_LIBS = @MOTIF_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STDINT_HEADER = @STDINT_HEADER@ STRIP = @STRIP@ VERSION = @VERSION@ XAW_CFLAGS = @XAW_CFLAGS@ XAW_LIBS = @XAW_LIBS@ XMKMF = @XMKMF@ XT_CFLAGS = @XT_CFLAGS@ XT_LIBS = @XT_LIBS@ X_CFLAGS = @X_CFLAGS@ X_LIBS = @X_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ NULL = EXTRA_DIST = $(SOURCES_XAW_D) CLEANFILES = $(SOURCES_XAW_C) pkglib_LTLIBRARIES = $(xaw_la) @HAVE_XAW_TRUE@xaw_la = xaw.la xaw_la_SOURCES = init.c $(SOURCES_XAW_C) xaw_la_CFLAGS = -I$(srcdir)/../../xlib @XAW_CFLAGS@ -DUSING_XAW xaw_la_LDFLAGS = -module -avoid-version -no-undefined xaw_la_LIBADD = $(top_builddir)/src/libelk.la ../../xlib/libelk-xlib.la ../libelk-xt.la @XAW_LIBS@ SOURCES_XAW_C = \ ascii.c \ box.c \ command.c \ dialog.c \ form.c \ grip.c \ label.c \ list.c \ menubutton.c \ paned.c \ panner.c \ porthole.c \ repeater.c \ scrollbar.c \ shell.c \ simplemenu.c \ sme.c \ smebsb.c \ smeline.c \ stripchart.c \ toggle.c \ tree.c \ viewport.c \ $(NULL) SOURCES_XAW_D = \ ascii.d \ box.d \ command.d \ dialog.d \ form.d \ grip.d \ label.d \ list.d \ menubutton.d \ paned.d \ panner.d \ porthole.d \ repeater.d \ scrollbar.d \ shell.d \ simplemenu.d \ sme.d \ smebsb.d \ smeline.d \ stripchart.d \ toggle.d \ tree.d \ viewport.d \ $(NULL) all: all-am .SUFFIXES: .SUFFIXES: .c .d .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign lib/xwidgets/xaw/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign lib/xwidgets/xaw/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done xaw.la: $(xaw_la_OBJECTS) $(xaw_la_DEPENDENCIES) $(xaw_la_LINK) $(am_xaw_la_rpath) $(xaw_la_OBJECTS) $(xaw_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaw_la-ascii.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaw_la-box.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaw_la-command.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaw_la-dialog.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaw_la-form.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaw_la-grip.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaw_la-init.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaw_la-label.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaw_la-list.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaw_la-menubutton.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaw_la-paned.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaw_la-panner.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaw_la-porthole.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaw_la-repeater.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaw_la-scrollbar.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaw_la-shell.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaw_la-simplemenu.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaw_la-sme.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaw_la-smebsb.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaw_la-smeline.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaw_la-stripchart.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaw_la-toggle.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaw_la-tree.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaw_la-viewport.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< xaw_la-init.lo: init.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -MT xaw_la-init.lo -MD -MP -MF $(DEPDIR)/xaw_la-init.Tpo -c -o xaw_la-init.lo `test -f 'init.c' || echo '$(srcdir)/'`init.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/xaw_la-init.Tpo $(DEPDIR)/xaw_la-init.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='init.c' object='xaw_la-init.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -c -o xaw_la-init.lo `test -f 'init.c' || echo '$(srcdir)/'`init.c xaw_la-ascii.lo: ascii.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -MT xaw_la-ascii.lo -MD -MP -MF $(DEPDIR)/xaw_la-ascii.Tpo -c -o xaw_la-ascii.lo `test -f 'ascii.c' || echo '$(srcdir)/'`ascii.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/xaw_la-ascii.Tpo $(DEPDIR)/xaw_la-ascii.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ascii.c' object='xaw_la-ascii.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -c -o xaw_la-ascii.lo `test -f 'ascii.c' || echo '$(srcdir)/'`ascii.c xaw_la-box.lo: box.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -MT xaw_la-box.lo -MD -MP -MF $(DEPDIR)/xaw_la-box.Tpo -c -o xaw_la-box.lo `test -f 'box.c' || echo '$(srcdir)/'`box.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/xaw_la-box.Tpo $(DEPDIR)/xaw_la-box.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='box.c' object='xaw_la-box.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -c -o xaw_la-box.lo `test -f 'box.c' || echo '$(srcdir)/'`box.c xaw_la-command.lo: command.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -MT xaw_la-command.lo -MD -MP -MF $(DEPDIR)/xaw_la-command.Tpo -c -o xaw_la-command.lo `test -f 'command.c' || echo '$(srcdir)/'`command.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/xaw_la-command.Tpo $(DEPDIR)/xaw_la-command.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='command.c' object='xaw_la-command.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -c -o xaw_la-command.lo `test -f 'command.c' || echo '$(srcdir)/'`command.c xaw_la-dialog.lo: dialog.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -MT xaw_la-dialog.lo -MD -MP -MF $(DEPDIR)/xaw_la-dialog.Tpo -c -o xaw_la-dialog.lo `test -f 'dialog.c' || echo '$(srcdir)/'`dialog.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/xaw_la-dialog.Tpo $(DEPDIR)/xaw_la-dialog.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dialog.c' object='xaw_la-dialog.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -c -o xaw_la-dialog.lo `test -f 'dialog.c' || echo '$(srcdir)/'`dialog.c xaw_la-form.lo: form.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -MT xaw_la-form.lo -MD -MP -MF $(DEPDIR)/xaw_la-form.Tpo -c -o xaw_la-form.lo `test -f 'form.c' || echo '$(srcdir)/'`form.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/xaw_la-form.Tpo $(DEPDIR)/xaw_la-form.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='form.c' object='xaw_la-form.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -c -o xaw_la-form.lo `test -f 'form.c' || echo '$(srcdir)/'`form.c xaw_la-grip.lo: grip.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -MT xaw_la-grip.lo -MD -MP -MF $(DEPDIR)/xaw_la-grip.Tpo -c -o xaw_la-grip.lo `test -f 'grip.c' || echo '$(srcdir)/'`grip.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/xaw_la-grip.Tpo $(DEPDIR)/xaw_la-grip.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='grip.c' object='xaw_la-grip.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -c -o xaw_la-grip.lo `test -f 'grip.c' || echo '$(srcdir)/'`grip.c xaw_la-label.lo: label.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -MT xaw_la-label.lo -MD -MP -MF $(DEPDIR)/xaw_la-label.Tpo -c -o xaw_la-label.lo `test -f 'label.c' || echo '$(srcdir)/'`label.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/xaw_la-label.Tpo $(DEPDIR)/xaw_la-label.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='label.c' object='xaw_la-label.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -c -o xaw_la-label.lo `test -f 'label.c' || echo '$(srcdir)/'`label.c xaw_la-list.lo: list.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -MT xaw_la-list.lo -MD -MP -MF $(DEPDIR)/xaw_la-list.Tpo -c -o xaw_la-list.lo `test -f 'list.c' || echo '$(srcdir)/'`list.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/xaw_la-list.Tpo $(DEPDIR)/xaw_la-list.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='list.c' object='xaw_la-list.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -c -o xaw_la-list.lo `test -f 'list.c' || echo '$(srcdir)/'`list.c xaw_la-menubutton.lo: menubutton.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -MT xaw_la-menubutton.lo -MD -MP -MF $(DEPDIR)/xaw_la-menubutton.Tpo -c -o xaw_la-menubutton.lo `test -f 'menubutton.c' || echo '$(srcdir)/'`menubutton.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/xaw_la-menubutton.Tpo $(DEPDIR)/xaw_la-menubutton.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='menubutton.c' object='xaw_la-menubutton.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -c -o xaw_la-menubutton.lo `test -f 'menubutton.c' || echo '$(srcdir)/'`menubutton.c xaw_la-paned.lo: paned.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -MT xaw_la-paned.lo -MD -MP -MF $(DEPDIR)/xaw_la-paned.Tpo -c -o xaw_la-paned.lo `test -f 'paned.c' || echo '$(srcdir)/'`paned.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/xaw_la-paned.Tpo $(DEPDIR)/xaw_la-paned.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='paned.c' object='xaw_la-paned.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -c -o xaw_la-paned.lo `test -f 'paned.c' || echo '$(srcdir)/'`paned.c xaw_la-panner.lo: panner.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -MT xaw_la-panner.lo -MD -MP -MF $(DEPDIR)/xaw_la-panner.Tpo -c -o xaw_la-panner.lo `test -f 'panner.c' || echo '$(srcdir)/'`panner.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/xaw_la-panner.Tpo $(DEPDIR)/xaw_la-panner.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='panner.c' object='xaw_la-panner.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -c -o xaw_la-panner.lo `test -f 'panner.c' || echo '$(srcdir)/'`panner.c xaw_la-porthole.lo: porthole.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -MT xaw_la-porthole.lo -MD -MP -MF $(DEPDIR)/xaw_la-porthole.Tpo -c -o xaw_la-porthole.lo `test -f 'porthole.c' || echo '$(srcdir)/'`porthole.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/xaw_la-porthole.Tpo $(DEPDIR)/xaw_la-porthole.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='porthole.c' object='xaw_la-porthole.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -c -o xaw_la-porthole.lo `test -f 'porthole.c' || echo '$(srcdir)/'`porthole.c xaw_la-repeater.lo: repeater.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -MT xaw_la-repeater.lo -MD -MP -MF $(DEPDIR)/xaw_la-repeater.Tpo -c -o xaw_la-repeater.lo `test -f 'repeater.c' || echo '$(srcdir)/'`repeater.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/xaw_la-repeater.Tpo $(DEPDIR)/xaw_la-repeater.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='repeater.c' object='xaw_la-repeater.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -c -o xaw_la-repeater.lo `test -f 'repeater.c' || echo '$(srcdir)/'`repeater.c xaw_la-scrollbar.lo: scrollbar.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -MT xaw_la-scrollbar.lo -MD -MP -MF $(DEPDIR)/xaw_la-scrollbar.Tpo -c -o xaw_la-scrollbar.lo `test -f 'scrollbar.c' || echo '$(srcdir)/'`scrollbar.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/xaw_la-scrollbar.Tpo $(DEPDIR)/xaw_la-scrollbar.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='scrollbar.c' object='xaw_la-scrollbar.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -c -o xaw_la-scrollbar.lo `test -f 'scrollbar.c' || echo '$(srcdir)/'`scrollbar.c xaw_la-shell.lo: shell.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -MT xaw_la-shell.lo -MD -MP -MF $(DEPDIR)/xaw_la-shell.Tpo -c -o xaw_la-shell.lo `test -f 'shell.c' || echo '$(srcdir)/'`shell.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/xaw_la-shell.Tpo $(DEPDIR)/xaw_la-shell.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='shell.c' object='xaw_la-shell.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -c -o xaw_la-shell.lo `test -f 'shell.c' || echo '$(srcdir)/'`shell.c xaw_la-simplemenu.lo: simplemenu.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -MT xaw_la-simplemenu.lo -MD -MP -MF $(DEPDIR)/xaw_la-simplemenu.Tpo -c -o xaw_la-simplemenu.lo `test -f 'simplemenu.c' || echo '$(srcdir)/'`simplemenu.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/xaw_la-simplemenu.Tpo $(DEPDIR)/xaw_la-simplemenu.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='simplemenu.c' object='xaw_la-simplemenu.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -c -o xaw_la-simplemenu.lo `test -f 'simplemenu.c' || echo '$(srcdir)/'`simplemenu.c xaw_la-sme.lo: sme.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -MT xaw_la-sme.lo -MD -MP -MF $(DEPDIR)/xaw_la-sme.Tpo -c -o xaw_la-sme.lo `test -f 'sme.c' || echo '$(srcdir)/'`sme.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/xaw_la-sme.Tpo $(DEPDIR)/xaw_la-sme.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sme.c' object='xaw_la-sme.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -c -o xaw_la-sme.lo `test -f 'sme.c' || echo '$(srcdir)/'`sme.c xaw_la-smebsb.lo: smebsb.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -MT xaw_la-smebsb.lo -MD -MP -MF $(DEPDIR)/xaw_la-smebsb.Tpo -c -o xaw_la-smebsb.lo `test -f 'smebsb.c' || echo '$(srcdir)/'`smebsb.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/xaw_la-smebsb.Tpo $(DEPDIR)/xaw_la-smebsb.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='smebsb.c' object='xaw_la-smebsb.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -c -o xaw_la-smebsb.lo `test -f 'smebsb.c' || echo '$(srcdir)/'`smebsb.c xaw_la-smeline.lo: smeline.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -MT xaw_la-smeline.lo -MD -MP -MF $(DEPDIR)/xaw_la-smeline.Tpo -c -o xaw_la-smeline.lo `test -f 'smeline.c' || echo '$(srcdir)/'`smeline.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/xaw_la-smeline.Tpo $(DEPDIR)/xaw_la-smeline.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='smeline.c' object='xaw_la-smeline.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -c -o xaw_la-smeline.lo `test -f 'smeline.c' || echo '$(srcdir)/'`smeline.c xaw_la-stripchart.lo: stripchart.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -MT xaw_la-stripchart.lo -MD -MP -MF $(DEPDIR)/xaw_la-stripchart.Tpo -c -o xaw_la-stripchart.lo `test -f 'stripchart.c' || echo '$(srcdir)/'`stripchart.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/xaw_la-stripchart.Tpo $(DEPDIR)/xaw_la-stripchart.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='stripchart.c' object='xaw_la-stripchart.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -c -o xaw_la-stripchart.lo `test -f 'stripchart.c' || echo '$(srcdir)/'`stripchart.c xaw_la-toggle.lo: toggle.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -MT xaw_la-toggle.lo -MD -MP -MF $(DEPDIR)/xaw_la-toggle.Tpo -c -o xaw_la-toggle.lo `test -f 'toggle.c' || echo '$(srcdir)/'`toggle.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/xaw_la-toggle.Tpo $(DEPDIR)/xaw_la-toggle.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='toggle.c' object='xaw_la-toggle.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -c -o xaw_la-toggle.lo `test -f 'toggle.c' || echo '$(srcdir)/'`toggle.c xaw_la-tree.lo: tree.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -MT xaw_la-tree.lo -MD -MP -MF $(DEPDIR)/xaw_la-tree.Tpo -c -o xaw_la-tree.lo `test -f 'tree.c' || echo '$(srcdir)/'`tree.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/xaw_la-tree.Tpo $(DEPDIR)/xaw_la-tree.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tree.c' object='xaw_la-tree.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -c -o xaw_la-tree.lo `test -f 'tree.c' || echo '$(srcdir)/'`tree.c xaw_la-viewport.lo: viewport.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -MT xaw_la-viewport.lo -MD -MP -MF $(DEPDIR)/xaw_la-viewport.Tpo -c -o xaw_la-viewport.lo `test -f 'viewport.c' || echo '$(srcdir)/'`viewport.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/xaw_la-viewport.Tpo $(DEPDIR)/xaw_la-viewport.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='viewport.c' object='xaw_la-viewport.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xaw_la_CFLAGS) $(CFLAGS) -c -o xaw_la-viewport.lo `test -f 'viewport.c' || echo '$(srcdir)/'`viewport.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES .d.c: $(top_builddir)/src/elk -g -p .:$(top_srcdir)/scm:$(srcdir)/.. -l mkwidget.scm $< $@ xaw echo-sources: ; echo $(SOURCES) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: elk-3.99.8/lib/xwidgets/xaw/sme.c0000644000175000017500000000026611577100311013453 00000000000000#include "../xt.h" #include void elk_init_xaw_sme () { XtResourceList r = 0; Define_Class ("sme", smeObjectClass, r, 0); P_Provide(Intern("xaw:sme")); } elk-3.99.8/lib/xwidgets/xaw/simplemenu.d0000644000175000017500000000350311577076306015063 00000000000000;; simplemenu.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'simplemenu "SimpleMenu.h") (define-widget-class 'simplemenu 'simpleMenuWidgetClass) (define-primitive 'simplemenu-add-global-actions '(c) " Check_Context (c); XawSimpleMenuAddGlobalActions (CONTEXT(c)->context); return Void;") (define-primitive 'simplemenu-get-active-entry '(w) " Check_Widget_Class (w, simpleMenuWidgetClass); return Make_Widget_Foreign (XawSimpleMenuGetActiveEntry (WIDGET(w)->widget));") (define-primitive 'simplemenu-clear-active-entry '(w) " Check_Widget_Class (w, simpleMenuWidgetClass); XawSimpleMenuClearActiveEntry (WIDGET(w)->widget); return Void;") elk-3.99.8/lib/xwidgets/xaw/box.d0000644000175000017500000000241611577076306013477 00000000000000;; box.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'box "Box.h") (define-widget-class 'box 'boxWidgetClass) elk-3.99.8/lib/xwidgets/xaw/menubutton.d0000644000175000017500000000246111577076306015107 00000000000000;; menubutton.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'menubutton "MenuButton.h") (define-widget-class 'menubutton 'menuButtonWidgetClass) elk-3.99.8/lib/xwidgets/xaw/toggle.d0000644000175000017500000000427511577076306014175 00000000000000;; toggle.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'toggle "Toggle.h") (define-widget-class 'toggle 'toggleWidgetClass) (define-callback 'toggle 'callback #f) (scheme->c 'toggle-radioData " return (XtArgVal)Get_Integer (x);") (c->scheme 'toggle-radioData " return Make_Integer ((int)x);") (define-primitive 'toggle-change-radio-group! '(w1 w2) " Check_Widget_Class (w1, toggleWidgetClass); Check_Widget_Class (w2, toggleWidgetClass); XawToggleChangeRadioGroup (WIDGET(w1)->widget, WIDGET(w2)->widget); return Void;") (define-primitive 'toggle-get-current '(w) " Check_Widget_Class (w, toggleWidgetClass); return Make_Integer ((int)XawToggleGetCurrent (WIDGET(w)->widget));") (define-primitive 'toggle-set-current! '(w x) " Check_Widget_Class (w, toggleWidgetClass); XawToggleSetCurrent (WIDGET(w)->widget, (caddr_t)Get_Integer (x)); return Void;") (define-primitive 'toggle-unset-current! '(w) " Check_Widget_Class (w, toggleWidgetClass); XawToggleUnsetCurrent (WIDGET(w)->widget); return Void;") elk-3.99.8/lib/xwidgets/xaw/paned.d0000644000175000017500000000432211577076306013774 00000000000000;; paned.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'paned "Paned.h") (define-widget-class 'paned 'panedWidgetClass) (define-primitive 'paned-allow-resize '(w enable) " Check_Widget (w); Check_Type (enable, T_Boolean); XawPanedAllowResize (WIDGET(w)->widget, EQ (enable, True)); return Void;") (define-primitive 'paned-set-min-max! '(w min max) " Check_Widget (w); XawPanedSetMinMax (WIDGET(w)->widget, Get_Integer (min), Get_Integer (max)); return Void;") (define-primitive 'paned-get-min-max '(w) " int min, max; Check_Widget (w); XawPanedGetMinMax (WIDGET(w)->widget, &min, &max); return Cons (Make_Integer (min), Make_Integer (max));") (define-primitive 'paned-set-refigure-mode! '(w enable) " Check_Widget_Class (w, panedWidgetClass); Check_Type (enable, T_Boolean); XawPanedSetRefigureMode (WIDGET(w)->widget, EQ (enable, True)); return Void;") (define-primitive 'paned-get-num-sub '(w) " Check_Widget_Class (w, panedWidgetClass); return Make_Integer (XawPanedGetNumSub (WIDGET(w)->widget));") elk-3.99.8/lib/xwidgets/xaw/label.c0000644000175000017500000000030011577100311013733 00000000000000#include "../xt.h" #include void elk_init_xaw_label () { XtResourceList r = 0; Define_Class ("label", labelWidgetClass, r, 0); P_Provide(Intern("xaw:label")); } elk-3.99.8/lib/xwidgets/xaw/scrollbar.d0000644000175000017500000000414311577076306014671 00000000000000;; scrollbar.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'scrollbar "Scrollbar.h") (prolog "static SYMDESCR Orientation_Syms[] = { { \"horizontal\", XtorientHorizontal }, { \"vertical\", XtorientVertical }, { 0, 0 } };") (define-widget-class 'scrollbar 'scrollbarWidgetClass) (scheme->c 'scrollbar-orientation " return (XtArgVal)Symbols_To_Bits (x, 0, Orientation_Syms);") (c->scheme 'scrollbar-orientation " return Bits_To_Symbols ((unsigned long)x, 0, Orientation_Syms);") (define-callback 'scrollbar 'scrollProc #t) (define-callback 'scrollbar 'jumpProc #t) (c->scheme 'callback:scrollbar-scrollProc " return Make_Integer ((int)x);") (c->scheme 'callback:scrollbar-jumpProc " return Make_Reduced_Flonum ((double)*(float *)x);") (define-primitive 'scrollbar-set-thumb! '(w t s) " Check_Widget_Class (w, scrollbarWidgetClass); XawScrollbarSetThumb (WIDGET(w)->widget, Get_Double (t), Get_Double (s)); return Void;") elk-3.99.8/lib/xwidgets/xaw/stripchart.c0000644000175000017500000000314111577100311015045 00000000000000#include "../xt.h" #include static void Get_Value (Widget w, XtPointer client_data, XtPointer value) { Object ret; ret = Funcall (Get_Function ((int)client_data), Null, 0); switch (TYPE(ret)) { case T_Fixnum: *(double *)value = (double)FIXNUM(ret); break; case T_Flonum: *(double *)value = FLONUM(ret)->val; break; case T_Bignum: *(double *)value = Bignum_To_Double (ret); break; default: Primitive_Error ("stripchart sampler must return number"); } } static Object P_Stripchart_Set_Sampler (Object w, Object p) { int i; Arg a[1]; XtCallbackList c; Check_Widget_Class (w, stripChartWidgetClass); Check_Procedure (p); XtSetArg (a[0], XtNgetValue, &c); XtGetValues (WIDGET(w)->widget, a, 1); if (c[0].callback) Primitive_Error ("stripchart already has a sampler"); i = Register_Function (p); XtAddCallback (WIDGET(w)->widget, XtNgetValue, Get_Value, (XtPointer)i); return Make_Id ('s', (XtPointer)WIDGET(w)->widget, i); } static Object P_Stripchart_Remove_Sampler (Object i) { Widget w; w = (Widget)Use_Id (i, 's'); XtRemoveCallback (w, XtNgetValue, Get_Value, (XtPointer)IDENTIFIER(i)->num); Deregister_Function (IDENTIFIER(i)->num); return Void; } void elk_init_xaw_stripchart () { XtResourceList r = 0; Define_Class ("stripchart", stripChartWidgetClass, r, 0); Define_Primitive (P_Stripchart_Remove_Sampler, "stripchart-remove-sampler", 1, 1, EVAL); Define_Primitive (P_Stripchart_Set_Sampler, "stripchart-set-sampler", 2, 2, EVAL); P_Provide(Intern("xaw:stripchart")); } elk-3.99.8/lib/xwidgets/xaw/label.d0000644000175000017500000000243011577076306013762 00000000000000;; label.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'label "Label.h") (define-widget-class 'label 'labelWidgetClass) elk-3.99.8/lib/xwidgets/xaw/sme.d0000644000175000017500000000241611577076306013473 00000000000000;; sme.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'sme "Sme.h") (define-widget-class 'sme 'smeObjectClass) elk-3.99.8/lib/xwidgets/xaw/tree.c0000644000175000017500000000064311577100311013625 00000000000000#include "../xt.h" #include static Object P_Tree_Force_Layout (Object w) { Check_Widget_Class (w, treeWidgetClass); XawTreeForceLayout (WIDGET(w)->widget); return Void; } void elk_init_xaw_tree () { XtResourceList r = 0; Define_Class ("tree", treeWidgetClass, r, 0); Define_Primitive (P_Tree_Force_Layout, "tree-force-layout", 1, 1, EVAL); P_Provide(Intern("xaw:tree")); } elk-3.99.8/lib/xwidgets/xaw/form.d0000644000175000017500000000274211577076306013654 00000000000000;; form.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'form "Form.h") (define-widget-class 'form 'formWidgetClass) (define-primitive 'form-do-layout '(w enable) " Check_Widget_Class (w, formWidgetClass); Check_Type (enable, T_Boolean); XawFormDoLayout (WIDGET(w)->widget, EQ (enable, True)); return Void;") elk-3.99.8/lib/xwidgets/xaw/smeline.d0000644000175000017500000000244211577076306014342 00000000000000;; smeline.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'smeline "SmeLine.h") (define-widget-class 'smeline 'smeLineObjectClass) elk-3.99.8/lib/xwidgets/xaw/scrollbar.c0000644000175000017500000000303211577100311014644 00000000000000#include "../xt.h" #include static SYMDESCR Orientation_Syms[] = { { "horizontal", XtorientHorizontal }, { "vertical", XtorientVertical }, { 0, 0 } }; static XtArgVal C_Scrollbar_Orientation (Object x) { return (XtArgVal)Symbols_To_Bits (x, 0, Orientation_Syms); } static Object S_Scrollbar_Orientation (XtArgVal x) { return Bits_To_Symbols ((unsigned long)x, 0, Orientation_Syms); } static Object S_Callback_Scrollbar_ScrollProc (XtArgVal x) { return Make_Integer ((int)x); } static Object S_Callback_Scrollbar_JumpProc (XtArgVal x) { return Make_Reduced_Flonum ((double)*(float *)x); } static Object P_Scrollbar_Set_Thumb (Object w, Object t, Object s) { Check_Widget_Class (w, scrollbarWidgetClass); XawScrollbarSetThumb (WIDGET(w)->widget, Get_Double (t), Get_Double (s)); return Void; } void elk_init_xaw_scrollbar () { XtResourceList r = 0; Define_Class ("scrollbar", scrollbarWidgetClass, r, 0); Define_Callback ("scrollbar", "jumpProc", 1); Define_Callback ("scrollbar", "scrollProc", 1); Define_Primitive (P_Scrollbar_Set_Thumb, "scrollbar-set-thumb!", 3, 3, EVAL); Define_Converter_To_Scheme ("callback:scrollbar-jumpProc", S_Callback_Scrollbar_JumpProc); Define_Converter_To_Scheme ("callback:scrollbar-scrollProc", S_Callback_Scrollbar_ScrollProc); Define_Converter_To_Scheme ("scrollbar-orientation", S_Scrollbar_Orientation); Define_Converter_To_C ("scrollbar-orientation", C_Scrollbar_Orientation); P_Provide(Intern("xaw:scrollbar")); } elk-3.99.8/lib/xwidgets/xaw/list.d0000644000175000017500000000542611577076306013666 00000000000000;; list.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'list "List.h") (prolog " static char **Get_List (Object x) { register int i, n; register char *s, **l; Alloca_Begin; Check_List (x); n = Fast_Length (x); l = (char **)XtMalloc ((n+1) * sizeof (char *)); for (i = 0; i < n; i++, x = Cdr (x)) { Get_Strsym_Stack (Car (x), s); l[i] = XtNewString (s); } l[i] = 0; Alloca_End; return l; }") (define-widget-class 'list 'listWidgetClass) (define-callback 'list 'callback #t) (c->scheme 'callback:list-callback " XawListReturnStruct *p = (XawListReturnStruct *)x; return Cons (Make_String (p->string, strlen (p->string)), Make_Integer (p->list_index));") (scheme->c 'list-list " return (XtArgVal)Get_List (x);") (define-primitive 'list-change! '(w x resize) " Check_Widget_Class (w, listWidgetClass); Check_Type (resize, T_Boolean); XawListChange (WIDGET(w)->widget, Get_List (x), 0, 0, EQ (resize, True)); return Void;") (define-primitive 'list-highlight '(w i) " Check_Widget_Class (w, listWidgetClass); XawListHighlight (WIDGET(w)->widget, Get_Integer (i)); return Void;") (define-primitive 'list-unhighlight '(w) " Check_Widget_Class (w, listWidgetClass); XawListUnhighlight (WIDGET(w)->widget); return Void;") (define-primitive 'list-current '(w) " XawListReturnStruct *p; Check_Widget_Class (w, listWidgetClass); p = XawListShowCurrent (WIDGET(w)->widget); if (p->list_index == XAW_LIST_NONE) return False; return Cons (Make_String (p->string, strlen (p->string)), Make_Integer (p->list_index));") elk-3.99.8/lib/xwidgets/xaw/grip.d0000644000175000017500000000357411577076306013656 00000000000000;; grip.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'grip "Grip.h") (define-widget-class 'grip 'gripWidgetClass) (define-callback 'grip 'callback #t) (c->scheme 'callback:grip-callback " Object args, ret, t; register unsigned int i; GripCallData p = (GripCallData)x; GC_Node3; args = ret = t = Null; GC_Link3 (args, ret, t); args = Get_Event_Args (p->event); ret = Cons (Copy_List (args), Null); Destroy_Event_Args (args); t = P_Make_List (Make_Integer (p->num_params), Null); for (i = 0, Cdr (ret) = t; i < p->num_params; i++, t = Cdr (t)) { Object s; s = Make_String (p->params[i], strlen (p->params[i])); Car (t) = s; } GC_Unlink; return ret;") elk-3.99.8/lib/xwidgets/xaw/toggle.c0000644000175000017500000000321311577100311014143 00000000000000#include "../xt.h" #include static XtArgVal C_Toggle_RadioData (Object x) { return (XtArgVal)Get_Integer (x); } static Object S_Toggle_RadioData (XtArgVal x) { return Make_Integer ((int)x); } static Object P_Toggle_Change_Radio_Group (Object w1, Object w2) { Check_Widget_Class (w1, toggleWidgetClass); Check_Widget_Class (w2, toggleWidgetClass); XawToggleChangeRadioGroup (WIDGET(w1)->widget, WIDGET(w2)->widget); return Void; } static Object P_Toggle_Get_Current (Object w) { Check_Widget_Class (w, toggleWidgetClass); return Make_Integer ((int)XawToggleGetCurrent (WIDGET(w)->widget)); } static Object P_Toggle_Set_Current (Object w, Object x) { Check_Widget_Class (w, toggleWidgetClass); XawToggleSetCurrent (WIDGET(w)->widget, (caddr_t)Get_Integer (x)); return Void; } static Object P_Toggle_Unset_Current (Object w) { Check_Widget_Class (w, toggleWidgetClass); XawToggleUnsetCurrent (WIDGET(w)->widget); return Void; } void elk_init_xaw_toggle () { XtResourceList r = 0; Define_Class ("toggle", toggleWidgetClass, r, 0); Define_Callback ("toggle", "callback", 0); Define_Primitive (P_Toggle_Unset_Current, "toggle-unset-current!", 1, 1, EVAL); Define_Primitive (P_Toggle_Set_Current, "toggle-set-current!", 2, 2, EVAL); Define_Primitive (P_Toggle_Get_Current, "toggle-get-current", 1, 1, EVAL); Define_Primitive (P_Toggle_Change_Radio_Group, "toggle-change-radio-group!", 2, 2, EVAL); Define_Converter_To_Scheme ("toggle-radioData", S_Toggle_RadioData); Define_Converter_To_C ("toggle-radioData", C_Toggle_RadioData); P_Provide(Intern("xaw:toggle")); } elk-3.99.8/lib/xwidgets/xaw/shell.c0000644000175000017500000000102211577100311013765 00000000000000#include "../xt.h" #include void elk_init_xaw_shell () { XtResourceList r = 0; Define_Class ("application-shell", applicationShellWidgetClass, r, 0); Define_Class ("toplevel-shell", topLevelShellWidgetClass, r, 0); Define_Class ("transient-shell", transientShellWidgetClass, r, 0); Define_Class ("wm-shell", wmShellWidgetClass, r, 0); Define_Class ("override-shell", overrideShellWidgetClass, r, 0); Define_Class ("shell", shellWidgetClass, r, 0); P_Provide(Intern("xaw:shell")); } elk-3.99.8/lib/xwidgets/xaw/menubutton.c0000644000175000017500000000033111577100311015060 00000000000000#include "../xt.h" #include void elk_init_xaw_menubutton () { XtResourceList r = 0; Define_Class ("menubutton", menuButtonWidgetClass, r, 0); P_Provide(Intern("xaw:menubutton")); } elk-3.99.8/lib/xwidgets/xaw/simplemenu.c0000644000175000017500000000204211577100311015037 00000000000000#include "../xt.h" #include static Object P_Simplemenu_Add_Global_Actions (Object c) { Check_Context (c); XawSimpleMenuAddGlobalActions (CONTEXT(c)->context); return Void; } static Object P_Simplemenu_Get_Active_Entry (Object w) { Check_Widget_Class (w, simpleMenuWidgetClass); return Make_Widget_Foreign (XawSimpleMenuGetActiveEntry (WIDGET(w)->widget)); } static Object P_Simplemenu_Clear_Active_Entry (Object w) { Check_Widget_Class (w, simpleMenuWidgetClass); XawSimpleMenuClearActiveEntry (WIDGET(w)->widget); return Void; } void elk_init_xaw_simplemenu () { XtResourceList r = 0; Define_Class ("simplemenu", simpleMenuWidgetClass, r, 0); Define_Primitive (P_Simplemenu_Clear_Active_Entry, "simplemenu-clear-active-entry", 1, 1, EVAL); Define_Primitive (P_Simplemenu_Get_Active_Entry, "simplemenu-get-active-entry", 1, 1, EVAL); Define_Primitive (P_Simplemenu_Add_Global_Actions, "simplemenu-add-global-actions", 1, 1, EVAL); P_Provide(Intern("xaw:simplemenu")); } elk-3.99.8/lib/xwidgets/xaw/list.c0000644000175000017500000000424711577100311013645 00000000000000#include "../xt.h" #include static char **Get_List (Object x) { register int i, n; register char *s, **l; Alloca_Begin; Check_List (x); n = Fast_Length (x); l = (char **)XtMalloc ((n+1) * sizeof (char *)); for (i = 0; i < n; i++, x = Cdr (x)) { Get_Strsym_Stack (Car (x), s); l[i] = XtNewString (s); } l[i] = 0; Alloca_End; return l; } static Object S_Callback_List_Callback (XtArgVal x) { XawListReturnStruct *p = (XawListReturnStruct *)x; return Cons (Make_String (p->string, strlen (p->string)), Make_Integer (p->list_index)); } static XtArgVal C_List_List (Object x) { return (XtArgVal)Get_List (x); } static Object P_List_Change (Object w, Object x, Object resize) { Check_Widget_Class (w, listWidgetClass); Check_Type (resize, T_Boolean); XawListChange (WIDGET(w)->widget, Get_List (x), 0, 0, EQ (resize, True)); return Void; } static Object P_List_Highlight (Object w, Object i) { Check_Widget_Class (w, listWidgetClass); XawListHighlight (WIDGET(w)->widget, Get_Integer (i)); return Void; } static Object P_List_Unhighlight (Object w) { Check_Widget_Class (w, listWidgetClass); XawListUnhighlight (WIDGET(w)->widget); return Void; } static Object P_List_Current (Object w) { XawListReturnStruct *p; Check_Widget_Class (w, listWidgetClass); p = XawListShowCurrent (WIDGET(w)->widget); if (p->list_index == XAW_LIST_NONE) return False; return Cons (Make_String (p->string, strlen (p->string)), Make_Integer (p->list_index)); } void elk_init_xaw_list () { XtResourceList r = 0; Define_Class ("list", listWidgetClass, r, 0); Define_Callback ("list", "callback", 1); Define_Primitive (P_List_Current, "list-current", 1, 1, EVAL); Define_Primitive (P_List_Unhighlight, "list-unhighlight", 1, 1, EVAL); Define_Primitive (P_List_Highlight, "list-highlight", 2, 2, EVAL); Define_Primitive (P_List_Change, "list-change!", 3, 3, EVAL); Define_Converter_To_C ("list-list", C_List_List); Define_Converter_To_Scheme ("callback:list-callback", S_Callback_List_Callback); P_Provide(Intern("xaw:list")); } elk-3.99.8/lib/xwidgets/xaw/ascii.d0000644000175000017500000000413611577076306014000 00000000000000;; ascii.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'asciitext "AsciiText.h") (define-widget-class 'ascii-text 'asciiTextWidgetClass '(font Font FontStruct) '(foreground Foreground Pixel) '(dataCompression DataCompression Boolean) '(displayNonprinting Output Boolean) '(echo Output Boolean) '(editType EditType EditMode) '(length Length Int) '(pieceSize PieceSize Int) '(string String String) '(type Type AsciiType)) (define bad-resource " Primitive_Error (\"cannot get or set sink/source\");") (scheme->c 'ascii-text-textSink bad-resource) (scheme->c 'ascii-text-textSource bad-resource) (c->scheme 'ascii-text-textSink bad-resource) (c->scheme 'ascii-text-textSource bad-resource) (define-primitive 'ascii-text-string '(w) " Arg a[1]; char *s; Check_Widget_Class (w, asciiTextWidgetClass); XtSetArg (a[0], XtNstring, &s); XtGetValues (WIDGET(w)->widget, a, 1); return Make_String (s, strlen (s));") elk-3.99.8/lib/xwidgets/xaw/shell.d0000644000175000017500000000334311577076306014016 00000000000000;; shell.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'shell "") (prolog ; Shell.h is always under X11, since it's "#include ") ; actually part of Xt, not of Xaw. (define-widget-class 'shell 'shellWidgetClass) (define-widget-class 'override-shell 'overrideShellWidgetClass) (define-widget-class 'wm-shell 'wmShellWidgetClass) (define-widget-class 'transient-shell 'transientShellWidgetClass) (define-widget-class 'toplevel-shell 'topLevelShellWidgetClass) (define-widget-class 'application-shell 'applicationShellWidgetClass) elk-3.99.8/lib/xwidgets/xaw/smebsb.c0000644000175000017500000000036411577100311014141 00000000000000#include "../xt.h" #include void elk_init_xaw_smebsb () { XtResourceList r = 0; Define_Class ("smebsb", smeBSBObjectClass, r, 0); Define_Callback ("smebsb", "callback", 0); P_Provide(Intern("xaw:smebsb")); } elk-3.99.8/lib/xwidgets/xaw/box.c0000644000175000017500000000026611577100310013456 00000000000000#include "../xt.h" #include void elk_init_xaw_box () { XtResourceList r = 0; Define_Class ("box", boxWidgetClass, r, 0); P_Provide(Intern("xaw:box")); } elk-3.99.8/lib/xwidgets/xaw/smeline.c0000644000175000017500000000031211577100311014313 00000000000000#include "../xt.h" #include void elk_init_xaw_smeline () { XtResourceList r = 0; Define_Class ("smeline", smeLineObjectClass, r, 0); P_Provide(Intern("xaw:smeline")); } elk-3.99.8/lib/xwidgets/xaw/panner.c0000644000175000017500000000103111577100311014141 00000000000000#include "../xt.h" #include static Object S_Callback_Panner_ReportCallback (XtArgVal x) { XawPannerReport *p = (XawPannerReport *)x; return Cons (Make_Integer (p->slider_x), Make_Integer (p->slider_y)); } void elk_init_xaw_panner () { XtResourceList r = 0; Define_Class ("panner", pannerWidgetClass, r, 0); Define_Callback ("panner", "reportCallback", 1); Define_Converter_To_Scheme ("callback:panner-reportCallback", S_Callback_Panner_ReportCallback); P_Provide(Intern("xaw:panner")); } elk-3.99.8/lib/xwidgets/xaw/ascii.c0000644000175000017500000000462311577100311013760 00000000000000#include "../xt.h" #include static XtArgVal C_Ascii_Text_TextSink (Object x) { Primitive_Error ("cannot get or set sink/source"); } static XtArgVal C_Ascii_Text_TextSource (Object x) { Primitive_Error ("cannot get or set sink/source"); } static Object S_Ascii_Text_TextSink (XtArgVal x) { Primitive_Error ("cannot get or set sink/source"); } static Object S_Ascii_Text_TextSource (XtArgVal x) { Primitive_Error ("cannot get or set sink/source"); } static Object P_Ascii_Text_String (Object w) { Arg a[1]; char *s; Check_Widget_Class (w, asciiTextWidgetClass); XtSetArg (a[0], XtNstring, &s); XtGetValues (WIDGET(w)->widget, a, 1); return Make_String (s, strlen (s)); } void elk_init_xaw_asciitext () { XtResourceList r = 0; r = (XtResourceList)XtMalloc (10 * sizeof (XtResource)); r[0].resource_name = "font"; r[0].resource_class = "Font"; r[0].resource_type = "FontStruct"; r[1].resource_name = "foreground"; r[1].resource_class = "Foreground"; r[1].resource_type = "Pixel"; r[2].resource_name = "dataCompression"; r[2].resource_class = "DataCompression"; r[2].resource_type = "Boolean"; r[3].resource_name = "displayNonprinting"; r[3].resource_class = "Output"; r[3].resource_type = "Boolean"; r[4].resource_name = "echo"; r[4].resource_class = "Output"; r[4].resource_type = "Boolean"; r[5].resource_name = "editType"; r[5].resource_class = "EditType"; r[5].resource_type = "EditMode"; r[6].resource_name = "length"; r[6].resource_class = "Length"; r[6].resource_type = "Int"; r[7].resource_name = "pieceSize"; r[7].resource_class = "PieceSize"; r[7].resource_type = "Int"; r[8].resource_name = "string"; r[8].resource_class = "String"; r[8].resource_type = "String"; r[9].resource_name = "type"; r[9].resource_class = "Type"; r[9].resource_type = "AsciiType"; Define_Class ("ascii-text", asciiTextWidgetClass, r, 10); Define_Primitive (P_Ascii_Text_String, "ascii-text-string", 1, 1, EVAL); Define_Converter_To_Scheme ("ascii-text-textSource", S_Ascii_Text_TextSource); Define_Converter_To_Scheme ("ascii-text-textSink", S_Ascii_Text_TextSink); Define_Converter_To_C ("ascii-text-textSource", C_Ascii_Text_TextSource); Define_Converter_To_C ("ascii-text-textSink", C_Ascii_Text_TextSink); P_Provide(Intern("xaw:ascii")); } elk-3.99.8/lib/xwidgets/xaw/form.c0000644000175000017500000000073511577100311013633 00000000000000#include "../xt.h" #include static Object P_Form_Do_Layout (Object w, Object enable) { Check_Widget_Class (w, formWidgetClass); Check_Type (enable, T_Boolean); XawFormDoLayout (WIDGET(w)->widget, EQ (enable, True)); return Void; } void elk_init_xaw_form () { XtResourceList r = 0; Define_Class ("form", formWidgetClass, r, 0); Define_Primitive (P_Form_Do_Layout, "form-do-layout", 2, 2, EVAL); P_Provide(Intern("xaw:form")); } elk-3.99.8/lib/xwidgets/xaw/viewport.d0000644000175000017500000000244711577076306014572 00000000000000;; viewport.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'viewport "Viewport.h") (define-widget-class 'viewport 'viewportWidgetClass) elk-3.99.8/lib/xwidgets/xaw/repeater.d0000644000175000017500000000266211577076306014521 00000000000000;; repeater.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'repeater "Repeater.h") (define-widget-class 'repeater 'repeaterWidgetClass) (define-callback 'repeater 'startCallback #f) (define-callback 'repeater 'stopCallback #f) (define-callback 'repeater 'callback #f) elk-3.99.8/lib/xwidgets/xaw/command.c0000644000175000017500000000037211577100310014302 00000000000000#include "../xt.h" #include void elk_init_xaw_command () { XtResourceList r = 0; Define_Class ("command", commandWidgetClass, r, 0); Define_Callback ("command", "callback", 0); P_Provide(Intern("xaw:command")); } elk-3.99.8/lib/xwidgets/xaw/grip.c0000644000175000017500000000162211577100311013625 00000000000000#include "../xt.h" #include static Object S_Callback_Grip_Callback (XtArgVal x) { Object args, ret, t; register unsigned int i; GripCallData p = (GripCallData)x; GC_Node3; args = ret = t = Null; GC_Link3 (args, ret, t); args = Get_Event_Args (p->event); ret = Cons (Copy_List (args), Null); Destroy_Event_Args (args); t = P_Make_List (Make_Integer (p->num_params), Null); for (i = 0, Cdr (ret) = t; i < p->num_params; i++, t = Cdr (t)) { Object s; s = Make_String (p->params[i], strlen (p->params[i])); Car (t) = s; } GC_Unlink; return ret; } void elk_init_xaw_grip () { XtResourceList r = 0; Define_Class ("grip", gripWidgetClass, r, 0); Define_Callback ("grip", "callback", 1); Define_Converter_To_Scheme ("callback:grip-callback", S_Callback_Grip_Callback); P_Provide(Intern("xaw:grip")); } elk-3.99.8/lib/xwidgets/xaw/Makefile.am0000644000175000017500000000217011577076306014573 00000000000000NULL = EXTRA_DIST = $(SOURCES_XAW_D) CLEANFILES = $(SOURCES_XAW_C) pkglib_LTLIBRARIES = $(xaw_la) if HAVE_XAW xaw_la = xaw.la endif xaw_la_SOURCES = init.c $(SOURCES_XAW_C) xaw_la_CFLAGS = -I$(srcdir)/../../xlib @XAW_CFLAGS@ -DUSING_XAW xaw_la_LDFLAGS = -module -avoid-version -no-undefined xaw_la_LIBADD = $(top_builddir)/src/libelk.la ../../xlib/libelk-xlib.la ../libelk-xt.la @XAW_LIBS@ .d.c: $(top_builddir)/src/elk -g -p .:$(top_srcdir)/scm:$(srcdir)/.. -l mkwidget.scm $< $@ xaw SOURCES_XAW_C = \ ascii.c \ box.c \ command.c \ dialog.c \ form.c \ grip.c \ label.c \ list.c \ menubutton.c \ paned.c \ panner.c \ porthole.c \ repeater.c \ scrollbar.c \ shell.c \ simplemenu.c \ sme.c \ smebsb.c \ smeline.c \ stripchart.c \ toggle.c \ tree.c \ viewport.c \ $(NULL) SOURCES_XAW_D = \ ascii.d \ box.d \ command.d \ dialog.d \ form.d \ grip.d \ label.d \ list.d \ menubutton.d \ paned.d \ panner.d \ porthole.d \ repeater.d \ scrollbar.d \ shell.d \ simplemenu.d \ sme.d \ smebsb.d \ smeline.d \ stripchart.d \ toggle.d \ tree.d \ viewport.d \ $(NULL) echo-sources: ; echo $(SOURCES) elk-3.99.8/lib/xwidgets/xaw/porthole.c0000644000175000017500000000241611577100311014522 00000000000000#include "../xt.h" #include static SYMDESCR Panner_Syms[] = { { "slider-x", XawPRSliderX }, { "slider-y", XawPRSliderY }, { "slider-width", XawPRSliderWidth }, { "slider-height", XawPRSliderHeight }, { "canvas-width", XawPRCanvasWidth }, { "canvas-height", XawPRCanvasHeight }, { 0, 0 } }; static Object S_Callback_Porthole_ReportCallback (XtArgVal x) { Object ret; XawPannerReport *p = (XawPannerReport *)x; GC_Node; ret = Null; GC_Link (ret); ret = Cons (Make_Integer (p->canvas_height), ret); ret = Cons (Make_Integer (p->canvas_width), ret); ret = Cons (Make_Integer (p->slider_height), ret); ret = Cons (Make_Integer (p->slider_width), ret); ret = Cons (Make_Integer (p->slider_y), ret); ret = Cons (Make_Integer (p->slider_x), ret); ret = Cons (Bits_To_Symbols ((unsigned long)p->changed, 1, Panner_Syms), ret); GC_Unlink; return ret; } void elk_init_xaw_porthole () { XtResourceList r = 0; Define_Class ("porthole", portholeWidgetClass, r, 0); Define_Callback ("porthole", "reportCallback", 1); Define_Converter_To_Scheme ("callback:porthole-reportCallback", S_Callback_Porthole_ReportCallback); P_Provide(Intern("xaw:porthole")); } elk-3.99.8/lib/xwidgets/xaw/tree.d0000644000175000017500000000265211577076306013650 00000000000000;; tree.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'tree "Tree.h") (define-widget-class 'tree 'treeWidgetClass) (define-primitive 'tree-force-layout '(w) " Check_Widget_Class (w, treeWidgetClass); XawTreeForceLayout (WIDGET(w)->widget); return Void;") elk-3.99.8/lib/xwidgets/xaw/dialog.d0000644000175000017500000000243511577076306014147 00000000000000;; dialog.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'dialog "Dialog.h") (define-widget-class 'dialog 'dialogWidgetClass) elk-3.99.8/lib/xwidgets/xaw/command.d0000644000175000017500000000251311577076306014323 00000000000000;; command.d ;; ;; $Id$ ;; ;; Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin ;; Copyright 2002, 2003 Sam Hocevar , Paris ;; ;; This software was derived from Elk 1.2, which was Copyright 1987, 1988, ;; 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written ;; by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project ;; between TELES and Nixdorf Microprocessor Engineering, Berlin). ;; ;; Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- ;; owners or individual owners of copyright in this software, grant to any ;; person or company a worldwide, royalty free, license to ;; ;; i) copy this software, ;; ii) prepare derivative works based on this software, ;; iii) distribute copies of this software or derivative works, ;; iv) perform this software, or ;; v) display this software, ;; ;; provided that this notice is not removed and that neither Oliver Laumann ;; nor Teles nor Nixdorf are deemed to have made any representations as to ;; the suitability of this software for any purpose nor are held responsible ;; for any defects of this software. ;; ;; THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. (define-widget-type 'command "Command.h") (define-widget-class 'command 'commandWidgetClass) (define-callback 'command 'callback #f) elk-3.99.8/lib/xwidgets/xaw/viewport.c0000644000175000017500000000031711577100311014543 00000000000000#include "../xt.h" #include void elk_init_xaw_viewport () { XtResourceList r = 0; Define_Class ("viewport", viewportWidgetClass, r, 0); P_Provide(Intern("xaw:viewport")); } elk-3.99.8/lib/xwidgets/xaw/init.c0000644000175000017500000000315511577076306013652 00000000000000/* init.c * * $Id$ * * Copyright 1990, 1991, 1992, 1993, 1994, 1995, Oliver Laumann, Berlin * Copyright 2002, 2003 Sam Hocevar , Paris * * This software was derived from Elk 1.2, which was Copyright 1987, 1988, * 1989, Nixdorf Computer AG and TELES GmbH, Berlin (Elk 1.2 has been written * by Oliver Laumann for TELES Telematic Services, Berlin, in a joint project * between TELES and Nixdorf Microprocessor Engineering, Berlin). * * Oliver Laumann, TELES GmbH, Nixdorf Computer AG and Sam Hocevar, as co- * owners or individual owners of copyright in this software, grant to any * person or company a worldwide, royalty free, license to * * i) copy this software, * ii) prepare derivative works based on this software, * iii) distribute copies of this software or derivative works, * iv) perform this software, or * v) display this software, * * provided that this notice is not removed and that neither Oliver Laumann * nor Teles nor Nixdorf are deemed to have made any representations as to * the suitability of this software for any purpose nor are held responsible * for any defects of this software. * * THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. */ #include "../xt.h" void elk_init_xaw_init () { elk_init_xt_accelerator (); elk_init_xt_action (); elk_init_xt_callback (); elk_init_xt_class (); elk_init_xt_context (); elk_init_xt_function (); elk_init_xt_identifier (); elk_init_xt_popup (); elk_init_xt_translation (); elk_init_xt_widget (); elk_init_xt_error (); elk_init_xt_init (); P_Provide (Intern ("xaw.la")); } elk-3.99.8/lib/Makefile.am0000644000175000017500000000004211577076306012132 00000000000000SUBDIRS = misc unix xlib xwidgets elk-3.99.8/Makefile.am0000644000175000017500000000032411577076306011367 00000000000000NULL = SUBDIRS = include src lib scm doc examples test DIST_SUBDIRS = $(SUBDIRS) EXTRA_DIST = \ bootstrap \ build-win32 \ BUGS \ ChangeLog \ MACHINES \ MIGRATE \ $(NULL) AUTOMAKE_OPTIONS = dist-bzip2 elk-3.99.8/MIGRATE0000644000175000017500000002030011577076306010342 00000000000000$Id$ This file lists changes in the interpreter kernel that affect the C/C++ interface to applications using Elk and to Elk extensions, and (in rare cases) the Scheme level interface. Changes in release 3.0: o To avoid name conflicts, the names of extension initialization (finalization) functions now begin with elk_init_ (elk_finit_). You will have to edit your source and change the function names accordingly. o The Scheme object representation ("Object") has been changed from an unsigned long to a struct. Although the changes are backwards compatible with the Elk 2.2 interface and should, in general, not affect your C/C++ code, you should be aware of a few potential trouble spots: o Code can no longer assume sizeof(Object) == sizeof(int). Thus, all arguments and return values of type Object must be declared properly. o You can no longer cast an `int' into an Object or vice versa. o You cannot compare Objects directly; use the EQ macro. o POINTER_CONSTANT_HIGH_BITS is gone (but you weren't supposed to use this anyway...) o Initializing a local (auto) Object variable in the declaration doesn't work any longer if you are using a K&R C compiler. o You can no longer enforce allocation of a specific type slot by Define_Type(). The first argument to Define_Type() now _must_ be zero. o The constant MAX_TYPE has become meaningless and will be removed in the future. Also, SETFIXNUM and SETTYPE do not exist any longer (SET can be used instead); SETPOINTER is obsolete. o There are a few new interface functions that your code may benefit from (such as Set_App_Name); see CHANGES and the new C/C++ Programmer's Manual (doc/cprog). o A few `P_*' functions have been renamed in the interpreter for consistency. See include/compat.h. o In Elk 2.2, the primitives c[ad]*r and cxr just returned () if the list was too short. Proper error checking has been added. If your Scheme code suddenly produces errors in calls to c[ad]*r, check the arguments. o All the names of converters for callbacks in lib/xaw/*.d and lib/xm/*.d now have a prefix `callback:'. This was required to resolve name conflicts with the converters for ordinary resources. If you are using custom widgets or have added your own converters to existing widgets, you will have to add the prefix. Changes in release 2.2: o All Scheme files in the distribution now end with the suffix .scm; `require' now appends .scm to the feature name if no file name has been specified. You should rename your Scheme files accordingly (if you haven't done yet anyway). o Declarations that are private to the interpreter (and are not supposed to be used by extensions) have been moved from include/extern.h into include/intern.h. You should make sure that extensions only use functions and variables defined in the new include/extern.h. o If you have an extension that invokes fork() and that may execute Scheme primitives in the child process, make sure that the new function `Call_Onfork()' is invoked in the child process to call the `fork handlers' which may have been registered by the interpreter or by other extensions. o The interpreter kernel now exports functions to convert C longs into Scheme numbers and vice versa. See CHANGES for the list of new functions. o The new function Define_Reader() may be used by extensions to define their own `#' read syntaxes. See lib/bitstring.c for an example. o The macros Make_C_String, Declare_C_String, and Dispose_C_String are now obsolete (but are retained for compatibility for a limited time). You should use the new, improved functions/macros mentioned in CHANGES and in src/cstring.c. o Get_Integer() and the new Get_Long() can be called with inexact integers (such as the result of truncate). If you are writing a Scheme primitive that requires its argument(s) to be *exact* integers, use Get_Exact_Integer() or Get_Exact_Long(). o Elk 2.2 now correctly supports inexact integers. This may cause Scheme code such as (vector-ref '#(a b c) (truncate 1.5)) which used to work in earlier versions of Elk to fail, as truncate returns an inexact integer in this example. One simple way to fix this is to use inexact->exact to convert the inexact integer into an exact one. o As extensions (such as the new UNIX extension) are now allowed to use signals, it is important that you protect critical code sections by calls to Disable_Interrupts/Enable_Interrupts (in C) or disable-interrupts/enable-interrupts (in Scheme). o The representation of Void has changed-- it is no longer a separate, pointer-less type (like Null), but a symbol with an empty name. As a result you now have to GC_Link variables holding Void. o The old (undocumented) `struct' extension is obsolete; you should use the new record extension (see doc/record). o The primitives `file-status' and `getenv' have been removed. file-status can be approximated by functions from the new UNIX extension like this: (require 'unix) (define (file-status file) (let ((stat (unix-errval (unix-stat file)))) (if (unix-error? stat) 'non-existent (stat-type stat)))) Use unix-getenv from the UNIX extension in place of the old getenv primitive (note, though, that unix-getenv must be called with a string; it doesn't accept a symbol). o The `linkscheme' shell script gets installed into a different directory (lib) now and works in a slightly different way. The `linkext' script is now called lib/makedl. `init_objects' is gone; see INSTALL for a new mechanism to link extensions with the interpreter statically. Changes in release 2.1: o The library libutil.a (which was part of the default libraries in earlier versions) has been removed; the code has been integrated into the interpreter kernel. If you have pre-linked dynamically loadable extensions against this library or against object files in lib/misc, just remove the relevant commands from your Makefiles. o The semantics of the Truep() macro have changed; the empty list no longer counts as false (see comment in CHANGES). Changes in release 2.0: o The Elk include file "scheme.h" now is in a different directory (include), so you have to change the -I option in your Makefiles. o is no longer included by "scheme.h", so you have to include it in your extensions if it is required. o lib/string.h is included automatically if you include scheme.h. o It is no longer necessary to pre-link extensions against lib/util/objects.o or lib/util/symbol.o. The files now are in a library (libutil.a); extensions are linked against this library automatically when they are loaded into Elk. o The way new Scheme objects are allocated has changed as a side-effect of adding the necessary hooks for the generational garbage collector (which is not yet present in Elk 2.0). The function Get_Bytes has been replaced by the new function Alloc_Object. Alloc_Object already returns a Scheme `Object'; there is no need to use SET any longer. The arguments are the object's size in bytes, the type, and a flag indicating whether the object is constant (constant objects may be placed into a read-only portion of the memory in later versions of Elk). So you have to replace old code to allocate an object of type T_Foo that looked like this: Object o; char *p; p = Get_Bytes (sizeof (struct S_Foo)); SET(o, T_Foo, (struct S_Foo *)p); by this: Object o = Alloc_Object (sizeof (struct S_Foo), T_Foo, 0); (use 1 instead of 0 if the new object is considered immutable). o If you store weak pointers to objects and forward the pointers explicitly in an after-GC function, you are now required to use a set of new macros. See src/terminate.c and lib/util/objects.c for examples. o The empty list is no longer regarded as false. To simplify testing, you can evaluate (empty-list-is-false-for-backward-compatibility #t) to enable the old (no longer standard-conforming) semantics. A call to this function with an argument of #f reverts to the default behavior.