doste-0.3.1/0000777000175000001440000000000011265574152007642 500000000000000doste-0.3.1/install-sh0000755000175000001440000002176610750154243011567 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2004-09-10.20 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" chmodcmd="$chmodprog 0755" chowncmd= chgrpcmd= stripcmd= rmcmd="$rmprog -f" mvcmd="$mvprog" src= dst= dir_arg= dstarg= no_target_directory= usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: -c (ignored) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. --help display this help and exit. --version display version info and exit. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test -n "$1"; do case $1 in -c) shift continue;; -d) dir_arg=true shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; --help) echo "$usage"; exit 0;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -s) stripcmd=$stripprog shift continue;; -t) dstarg=$2 shift shift continue;; -T) no_target_directory=true shift continue;; --version) echo "$0 $scriptversion"; exit 0;; *) # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. test -n "$dir_arg$dstarg" && break # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dstarg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dstarg" shift # fnord fi shift # arg dstarg=$arg done break;; esac done if test -z "$1"; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi for src do # Protect names starting with `-'. case $src in -*) src=./$src ;; esac if test -n "$dir_arg"; then dst=$src src= if test -d "$dst"; then mkdircmd=: chmodcmd= else mkdircmd=$mkdirprog fi else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dstarg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dstarg # Protect names starting with `-'. case $dst in -*) dst=./$dst ;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dstarg: Is a directory" >&2 exit 1 fi dst=$dst/`basename "$src"` fi fi # This sed command emulates the dirname command. dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # Skip lots of stat calls in the usual case. if test ! -d "$dstdir"; then defaultIFS=' ' IFS="${IFS-$defaultIFS}" oIFS=$IFS # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` IFS=$oIFS pathcomp= while test $# -ne 0 ; do pathcomp=$pathcomp$1 shift if test ! -d "$pathcomp"; then $mkdirprog "$pathcomp" # mkdir can fail with a `File exist' error in case several # install-sh are creating the directory concurrently. This # is OK. test -d "$pathcomp" || exit fi pathcomp=$pathcomp/ done fi if test -n "$dir_arg"; then $doit $mkdircmd "$dst" \ && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } else dstfile=`basename "$dst"` # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 trap '(exit $?); exit' 1 2 13 15 # Copy the file name to the temp name. $doit $cpprog "$src" "$dsttmp" && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && # Now rename the file to the real destination. { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ || { # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { if test -f "$dstdir/$dstfile"; then $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ || { echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 (exit 1); exit } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" } } fi || { (exit 1); exit; } done # The final little trick to "correctly" pass the exit status to the exit trap. { (exit 0); exit } # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: doste-0.3.1/configure.ac0000755000175000001440000000246011265574050012046 00000000000000# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. #AC_PREREQ(2.59) AC_INIT(DOSTE, 0.3.1) AC_CONFIG_SRCDIR(src/dvm/oid.cpp) AC_CANONICAL_TARGET AM_INIT_AUTOMAKE([no-dependencies]) AM_CONFIG_HEADER([config.h]) # Checks for programs. AC_PROG_RANLIB AC_PROG_CXX AC_PROG_CC AC_LANG(C++) # Checks for header files. AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS([fcntl.h stddef.h stdlib.h string.h sys/time.h unistd.h]) AC_CHECK_HEADERS([string vector list]) # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STDBOOL AC_C_CONST AC_C_INLINE AC_HEADER_TIME # Checks for library functions. AC_FUNC_ERROR_AT_LINE AC_PROG_GCC_TRADITIONAL AC_FUNC_MALLOC AC_FUNC_MEMCMP AC_CHECK_FUNCS([memset sqrt strstr strdup]) CXXFLAGS="-g -Wall -DLINUX " CFLAGS="-DLINUX -O3" LDFLAGS="$LDFLAGS" if test "$target_cpu" == "x86_64"; then CXXFLAGS="$CXXFLAGS -DX86_64" LDFLAGS="$LDFLAGS -L/usr/X11R6/lib64" else CXXFLAGS="$CXXFLAGS -march=pentium3 -mfpmath=sse" LDFLAGS="$LDFLAGS -L/usr/X11R6/lib" fi # Checks for libraries. AC_OUTPUT(Makefile src/Makefile src/dvm/Makefile src/library/Makefile loader/Makefile include/Makefile include/doste/Makefile include/doste/dvm/Makefile scripts/Makefile scripts/linux.dasm loader/linux.cpp) doste-0.3.1/loader/0000777000175000001440000000000011265574152011110 500000000000000doste-0.3.1/loader/Makefile.am0000644000175000001440000000020711026665155013056 00000000000000bin_PROGRAMS=doste doste_SOURCES=linux.cpp INCLUDES=-I@top_srcdir@/include -I@top_builddir@/include AM_LDFLAGS=-L../src -ldl -ldoste doste-0.3.1/loader/Makefile.in0000644000175000001440000003001111265574062013064 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 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@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@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 = doste$(EXEEXT) subdir = loader DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/linux.cpp.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 = linux.cpp am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_doste_OBJECTS = linux.$(OBJEXT) doste_OBJECTS = $(am_doste_OBJECTS) doste_LDADD = $(LDADD) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = am__depfiles_maybe = CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ SOURCES = $(doste_SOURCES) DIST_SOURCES = $(doste_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__leading_dot = @am__leading_dot@ 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_builddir = @top_builddir@ top_srcdir = @top_srcdir@ doste_SOURCES = linux.cpp INCLUDES = -I@top_srcdir@/include -I@top_builddir@/include AM_LDFLAGS = -L../src -ldl -ldoste all: all-am .SUFFIXES: .SUFFIXES: .cpp .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 \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps loader/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu --ignore-deps loader/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 linux.cpp: $(top_builddir)/config.status $(srcdir)/linux.cpp.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) doste$(EXEEXT): $(doste_OBJECTS) $(doste_DEPENDENCIES) @rm -f doste$(EXEEXT) $(CXXLINK) $(doste_OBJECTS) $(doste_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c .cpp.o: $(CXXCOMPILE) -c -o $@ $< .cpp.obj: $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` 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; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ 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; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ 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)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @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 $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(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) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-binPROGRAMS install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: 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-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic ctags distclean distclean-compile \ distclean-generic 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-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-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-binPROGRAMS # 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: doste-0.3.1/loader/linux.cpp0000644000175000001440000000067511265574137012702 00000000000000#include #include #include using namespace doste; int main(int argc, char *argv[]) { doste::initialise(argc, argv); dvm::root["notations"]["dasm"]["run"] = new LocalFile("/usr/local/share/doste/scripts/linux.dasm"); //Check current directory for a configuration script. dvm::root["notations"]["dasm"]["run"] = new LocalFile("config.dasm"); doste::run(); doste::finalise(); } doste-0.3.1/loader/linux.cpp.in0000644000175000001440000000067311026664307013277 00000000000000#include #include #include using namespace doste; int main(int argc, char *argv[]) { doste::initialise(argc, argv); dvm::root["notations"]["dasm"]["run"] = new LocalFile("@prefix@/share/doste/scripts/linux.dasm"); //Check current directory for a configuration script. dvm::root["notations"]["dasm"]["run"] = new LocalFile("config.dasm"); doste::run(); doste::finalise(); } doste-0.3.1/NEWS0000644000175000001440000000000010750154243010234 00000000000000doste-0.3.1/Makefile.am0000755000175000001440000000004211026421113011570 00000000000000SUBDIRS=src loader include scriptsdoste-0.3.1/configure0000755000175000001440000057306611265574063011507 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for DOSTE 0.3.1. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 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=: # 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 # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. 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 echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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 : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file 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 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=: 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 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='DOSTE' PACKAGE_TARNAME='doste' PACKAGE_VERSION='0.3.1' PACKAGE_STRING='DOSTE 0.3.1' PACKAGE_BUGREPORT='' ac_unique_file="src/dvm/oid.cpp" # 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='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA am__isrc CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar RANLIB CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT CC CFLAGS ac_ct_CC CXXCPP GREP EGREP LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CXX CXXFLAGS LDFLAGS LIBS CPPFLAGS CCC CC CFLAGS CXXCPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (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_TARNAME}' 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=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=no ;; -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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. 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 case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } 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 DOSTE 0.3.1 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/doste] --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 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 case $ac_init_help in short | recursive ) echo "Configuration of DOSTE 0.3.1:";; esac cat <<\_ACEOF Some influential environment variables: CXX C++ compiler command CXXFLAGS 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 C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CC C compiler command CFLAGS C compiler flags CXXCPP C++ preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _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" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 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 DOSTE configure 0.3.1 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 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 DOSTE $as_me 0.3.1, which was generated by GNU Autoconf 2.61. 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=. 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: 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 cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_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 cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" 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'; { (exit 1); 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 # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $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,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi # 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 || { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } { echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6; } if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_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 && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 echo "$as_me: error: invalid value of canonical build" >&2;} { (exit 1); exit 1; }; };; 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 { echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6; } if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi { echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 echo "$as_me: error: invalid value of canonical host" >&2;} { (exit 1); exit 1; }; };; 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 { echo "$as_me:$LINENO: checking target system type" >&5 echo $ECHO_N "checking target system type... $ECHO_C" >&6; } if test "${ac_cv_target+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi { echo "$as_me:$LINENO: result: $ac_cv_target" >&5 echo "${ECHO_T}$ac_cv_target" >&6; } case $ac_cv_target in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 echo "$as_me: error: invalid value of canonical target" >&2;} { (exit 1); exit 1; }; };; 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.10' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. { echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { 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 ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. 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 { echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { echo "$as_me:$LINENO: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm -f conftest.sed # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi { echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } if test -z "$MKDIR_P"; then if test "${ac_cv_path_mkdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 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. test -d ./--version && rmdir ./--version MKDIR_P="$ac_install_sh -d" fi fi { echo "$as_me:$LINENO: result: $MKDIR_P" >&5 echo "${ECHO_T}$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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { 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" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$AWK" && break done { echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&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 { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } SET_MAKE= else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null 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 { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi 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='doste' VERSION='0.3.1' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { 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" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { 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" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&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" # 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" # Checks for programs. 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 echo "${ECHO_T}$ac_ct_CXX" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C++ compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { echo "$as_me:$LINENO: checking for C++ compiler default output file name" >&5 echo $ECHO_N "checking for C++ compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.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 { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C++ compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C++ compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C++ compiler works" >&5 echo $ECHO_N "checking whether the C++ compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C++ compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C++ compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; } if test "${ac_cv_cxx_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; } GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cxx_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CXXFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 echo "${ECHO_T}$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 ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { 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" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { 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" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { 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" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { 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" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { 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" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { 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" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #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" 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; 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 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 # Checks for header files. 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 { echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6; } if test -z "$CXXCPP"; then if test "${ac_cv_prog_CXXCPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f 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 { echo "$as_me:$LINENO: result: $CXXCPP" >&5 echo "${ECHO_T}$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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } 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 { echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Extract the first word of "grep ggrep" to use in msg output if test -z "$GREP"; then set dummy grep ggrep; ac_prog_name=$2 if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" 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 ac_count=`expr $ac_count + 1` 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 fi GREP="$ac_cv_path_GREP" if test -z "$GREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else # Extract the first word of "egrep" to use in msg output if test -z "$EGREP"; then set dummy egrep; ac_prog_name=$2 if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" 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 ac_count=`expr $ac_count + 1` 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 fi EGREP="$ac_cv_path_EGREP" if test -z "$EGREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi { echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5 echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6; } if test "${ac_cv_header_sys_wait_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #ifndef WEXITSTATUS # define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8) #endif #ifndef WIFEXITED # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif int main () { int s; wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_sys_wait_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_sys_wait_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6; } if test $ac_cv_header_sys_wait_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SYS_WAIT_H 1 _ACEOF 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=`echo "ac_cv_header_$ac_header" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in fcntl.h stddef.h stdlib.h string.h sys/time.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in string vector list do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Checks for typedefs, structures, and compiler characteristics. { echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5 echo $ECHO_N "checking for stdbool.h that conforms to C99... $ECHO_C" >&6; } if test "${ac_cv_header_stdbool_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef bool "error: bool is not defined" #endif #ifndef false "error: false is not defined" #endif #if false "error: false is not 0" #endif #ifndef true "error: true is not defined" #endif #if true != 1 "error: true is not 1" #endif #ifndef __bool_true_false_are_defined "error: __bool_true_false_are_defined is not defined" #endif struct s { _Bool s: 1; _Bool t; } s; char a[true == 1 ? 1 : -1]; char b[false == 0 ? 1 : -1]; char c[__bool_true_false_are_defined == 1 ? 1 : -1]; char d[(bool) 0.5 == true ? 1 : -1]; bool e = &s; char f[(_Bool) 0.0 == false ? 1 : -1]; char g[true]; char h[sizeof (_Bool)]; char i[sizeof s.t]; enum { j = false, k = true, l = false * true, m = true * 256 }; _Bool n[m]; char o[sizeof n == m * sizeof n[0] ? 1 : -1]; char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; # if defined __xlc__ || defined __GNUC__ /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0 reported by James Lemley on 2005-10-05; see http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html This test is not quite right, since xlc is allowed to reject this program, as the initializer for xlcbug is not one of the forms that C requires support for. However, doing the test right would require a runtime test, and that would make cross-compilation harder. Let us hope that IBM fixes the xlc bug, and also adds support for this kind of constant expression. In the meantime, this test will reject xlc, which is OK, since our stdbool.h substitute should suffice. We also test this with GCC, where it should work, to detect more quickly whether someone messes up the test in the future. */ char digs[] = "0123456789"; int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1); # endif /* Catch a bug in an HP-UX C compiler. See http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html */ _Bool q = true; _Bool *pq = &q; int main () { *pq |= q; *pq |= ! q; /* Refer to every declared value, to avoid compiler optimizations. */ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + !m + !n + !o + !p + !q + !pq); ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdbool_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdbool_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5 echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6; } { echo "$as_me:$LINENO: checking for _Bool" >&5 echo $ECHO_N "checking for _Bool... $ECHO_C" >&6; } if test "${ac_cv_type__Bool+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef _Bool ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type__Bool=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type__Bool=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5 echo "${ECHO_T}$ac_cv_type__Bool" >&6; } if test $ac_cv_type__Bool = yes; then cat >>confdefs.h <<_ACEOF #define HAVE__BOOL 1 _ACEOF fi if test $ac_cv_header_stdbool_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STDBOOL_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; } if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* 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 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF #define const _ACEOF fi { echo "$as_me:$LINENO: checking for inline" >&5 echo $ECHO_N "checking for inline... $ECHO_C" >&6; } if test "${ac_cv_c_inline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_inline=$ac_kw else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 echo "${ECHO_T}$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 { echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; } if test "${ac_cv_header_time+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_time=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 echo "${ECHO_T}$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then cat >>confdefs.h <<\_ACEOF #define TIME_WITH_SYS_TIME 1 _ACEOF fi # Checks for library functions. { echo "$as_me:$LINENO: checking for error_at_line" >&5 echo $ECHO_N "checking for error_at_line... $ECHO_C" >&6; } if test "${ac_cv_lib_error_at_line+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { error_at_line (0, 0, "", 0, "an error occurred"); ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_error_at_line=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_error_at_line=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_lib_error_at_line" >&5 echo "${ECHO_T}$ac_cv_lib_error_at_line" >&6; } if test $ac_cv_lib_error_at_line = no; then case " $LIBOBJS " in *" error.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS error.$ac_objext" ;; esac fi if test $ac_cv_c_compiler_gnu = yes; then { echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6; } if test "${ac_cv_prog_gcc_traditional+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_pattern="Autoconf.*'x'" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include Autoconf TIOCGETP _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then ac_cv_prog_gcc_traditional=yes else ac_cv_prog_gcc_traditional=no fi rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include Autoconf TCGETA _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then ac_cv_prog_gcc_traditional=yes fi rm -f conftest* fi fi { echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6; } if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi for ac_header in stdlib.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5 echo $ECHO_N "checking for GNU libc compatible malloc... $ECHO_C" >&6; } if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_malloc_0_nonnull=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if defined STDC_HEADERS || defined HAVE_STDLIB_H # include #else char *malloc (); #endif int main () { return ! malloc (0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_malloc_0_nonnull=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_malloc_0_nonnull=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5 echo "${ECHO_T}$ac_cv_func_malloc_0_nonnull" >&6; } if test $ac_cv_func_malloc_0_nonnull = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MALLOC 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define HAVE_MALLOC 0 _ACEOF case " $LIBOBJS " in *" malloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS malloc.$ac_objext" ;; esac cat >>confdefs.h <<\_ACEOF #define malloc rpl_malloc _ACEOF fi { echo "$as_me:$LINENO: checking for working memcmp" >&5 echo $ECHO_N "checking for working memcmp... $ECHO_C" >&6; } if test "${ac_cv_func_memcmp_working+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_memcmp_working=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { /* Some versions of memcmp are not 8-bit clean. */ char c0 = '\100', c1 = '\200', c2 = '\201'; if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0) return 1; /* The Next x86 OpenStep bug shows up only when comparing 16 bytes or more and with at least one buffer not starting on a 4-byte boundary. William Lewis provided this test program. */ { char foo[21]; char bar[21]; int i; for (i = 0; i < 4; i++) { char *a = foo + i; char *b = bar + i; strcpy (a, "--------01111111"); strcpy (b, "--------10000000"); if (memcmp (a, b, 16) >= 0) return 1; } return 0; } ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_memcmp_working=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_memcmp_working=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { echo "$as_me:$LINENO: result: $ac_cv_func_memcmp_working" >&5 echo "${ECHO_T}$ac_cv_func_memcmp_working" >&6; } test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in *" memcmp.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS memcmp.$ac_objext" ;; esac for ac_func in memset sqrt strstr strdup do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* 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 $ac_func (); /* 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_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done CXXFLAGS="-g -Wall -DLINUX " CFLAGS="-DLINUX -O3" LDFLAGS="$LDFLAGS" if test "$target_cpu" == "x86_64"; then CXXFLAGS="$CXXFLAGS -DX86_64" LDFLAGS="$LDFLAGS -L/usr/X11R6/lib64" else CXXFLAGS="$CXXFLAGS -march=pentium3 -mfpmath=sse" LDFLAGS="$LDFLAGS -L/usr/X11R6/lib" fi # Checks for libraries. ac_config_files="$ac_config_files Makefile src/Makefile src/dvm/Makefile src/library/Makefile loader/Makefile include/Makefile include/doste/Makefile include/doste/dvm/Makefile scripts/Makefile scripts/linux.dasm loader/linux.cpp" 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_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 test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 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= 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=`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. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be 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=: # 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 # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. 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 echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file 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 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=: 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 # 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 DOSTE $as_me 0.3.1, which was generated by GNU Autoconf 2.61. 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 cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ DOSTE config.status 0.3.1 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 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' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; 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 ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" 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 if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/dvm/Makefile") CONFIG_FILES="$CONFIG_FILES src/dvm/Makefile" ;; "src/library/Makefile") CONFIG_FILES="$CONFIG_FILES src/library/Makefile" ;; "loader/Makefile") CONFIG_FILES="$CONFIG_FILES loader/Makefile" ;; "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; "include/doste/Makefile") CONFIG_FILES="$CONFIG_FILES include/doste/Makefile" ;; "include/doste/dvm/Makefile") CONFIG_FILES="$CONFIG_FILES include/doste/dvm/Makefile" ;; "scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;; "scripts/linux.dasm") CONFIG_FILES="$CONFIG_FILES scripts/linux.dasm" ;; "loader/linux.cpp") CONFIG_FILES="$CONFIG_FILES loader/linux.cpp" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers 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= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim build!$build$ac_delim build_cpu!$build_cpu$ac_delim build_vendor!$build_vendor$ac_delim build_os!$build_os$ac_delim host!$host$ac_delim host_cpu!$host_cpu$ac_delim host_vendor!$host_vendor$ac_delim host_os!$host_os$ac_delim target!$target$ac_delim target_cpu!$target_cpu$ac_delim target_vendor!$target_vendor$ac_delim target_os!$target_os$ac_delim INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim INSTALL_DATA!$INSTALL_DATA$ac_delim am__isrc!$am__isrc$ac_delim CYGPATH_W!$CYGPATH_W$ac_delim PACKAGE!$PACKAGE$ac_delim VERSION!$VERSION$ac_delim ACLOCAL!$ACLOCAL$ac_delim AUTOCONF!$AUTOCONF$ac_delim AUTOMAKE!$AUTOMAKE$ac_delim AUTOHEADER!$AUTOHEADER$ac_delim MAKEINFO!$MAKEINFO$ac_delim install_sh!$install_sh$ac_delim STRIP!$STRIP$ac_delim INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim mkdir_p!$mkdir_p$ac_delim AWK!$AWK$ac_delim SET_MAKE!$SET_MAKE$ac_delim am__leading_dot!$am__leading_dot$ac_delim AMTAR!$AMTAR$ac_delim am__tar!$am__tar$ac_delim am__untar!$am__untar$ac_delim RANLIB!$RANLIB$ac_delim CXX!$CXX$ac_delim CXXFLAGS!$CXXFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CXX!$ac_ct_CXX$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim CXXCPP!$CXXCPP$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 87; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[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="$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 || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$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 "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; 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 || 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" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`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 || 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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 # 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= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF 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 sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;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 " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 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 "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; :H) # # CONFIG_HEADER # _ACEOF # Transform confdefs.h into a sed script `conftest.defines', that # substitutes the proper values into config.h.in to produce config.h. rm -f conftest.defines conftest.tail # First, append a space to every undef/define line, to ease matching. echo 's/$/ /' >conftest.defines # Then, protect against being on the right side of a sed subst, or in # an unquoted here document, in config.status. If some macros were # called several times there might be several #defines for the same # symbol, which is useless. But do not sort them, since the last # AC_DEFINE must be honored. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* # These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where # NAME is the cpp macro being defined, VALUE is the value it is being given. # PARAMS is the parameter list in the macro definition--in most cases, it's # just an empty string. ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' ac_dB='\\)[ (].*,\\1define\\2' ac_dC=' ' ac_dD=' ,' uniq confdefs.h | sed -n ' t rset :rset s/^[ ]*#[ ]*define[ ][ ]*// t ok d :ok s/[\\&,]/\\&/g s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p ' >>conftest.defines # Remove the space that was appended to ease matching. # Then 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. # (The regexp can be short, since the line contains either #define or #undef.) echo 's/ $// s,^[ #]*u.*,/* & */,' >>conftest.defines # Break up conftest.defines: ac_max_sed_lines=50 # First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" # Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" # Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" # et cetera. ac_in='$ac_file_inputs' ac_out='"$tmp/out1"' ac_nxt='"$tmp/out2"' while : do # Write a here document: cat >>$CONFIG_STATUS <<_ACEOF # First, check the format of the line: cat >"\$tmp/defines.sed" <<\\CEOF /^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def /^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def b :def _ACEOF sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines conftest.tail echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then echo "/* $configure_input */" >"$tmp/config.h" cat "$ac_result" >>"$tmp/config.h" if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else rm -f $ac_file mv "$tmp/config.h" $ac_file fi else echo "/* $configure_input */" cat "$ac_result" fi rm -f "$tmp/out12" # 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 || 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 ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi doste-0.3.1/aclocal.m40000644000175000001440000005077511265574061011433 00000000000000# generated automatically by aclocal 1.10.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 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. # 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(AC_AUTOCONF_VERSION, [2.61],, [m4_warning([this file was generated for autoconf 2.61. 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'.])]) # Copyright (C) 2002, 2003, 2005, 2006, 2007 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.10' 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.10.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 AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.10.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(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` ]) # 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 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 13 # 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.60])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) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) ]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_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 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # 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 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 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 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 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_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_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 doste-0.3.1/AUTHORS0000644000175000001440000000004411026665732010624 00000000000000Nicolas Pope, n.w.pope@warwick.ac.ukdoste-0.3.1/config.sub0000755000175000001440000007511310750154243011541 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. timestamp='2004-08-29' # 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., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit 0;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32r | m32rle | m68000 | m68k | m88k | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | msp430 \ | ns16k | ns32k \ | openrisc | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \ | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*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-* \ | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | msp430-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ | xtensa-* \ | ymp-* \ | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16c) basic_machine=cr16c-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; or32 | or32-*) basic_machine=or32-unknown os=-coff ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sh64) basic_machine=sh64-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*) # 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* \ | -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 ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: doste-0.3.1/Makefile.in0000644000175000001440000004554111265574063011635 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 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@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@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 AUTHORS COPYING ChangeLog INSTALL NEWS \ config.guess config.sub install-sh missing 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 = depcomp = am__depfiles_maybe = 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 ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__leading_dot = @am__leading_dot@ 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_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = src loader include scripts 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) --gnu --ignore-deps'; \ cd $(srcdir) && $(AUTOMAKE) --gnu --ignore-deps \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu --ignore-deps 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) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) 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) cd $(top_srcdir) && $(AUTOHEADER) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 # 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): @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; \ (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): @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; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (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; nonemtpy = 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) tags=; \ 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 || \ tags="$$tags $$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; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ 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)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) 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 $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(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-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 $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && cd $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-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) 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 mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-exec-am: install-html: install-html-recursive install-info: install-info-recursive install-man: install-pdf: install-pdf-recursive install-ps: install-ps-recursive 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 pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ dist-lzma dist-shar dist-tarZ dist-zip distcheck distclean \ distclean-generic distclean-hdr 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 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: doste-0.3.1/config.guess0000755000175000001440000012450410750154243012075 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 Free Software Foundation, Inc. timestamp='2004-09-07' # 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit 0 ;; amd64:OpenBSD:*:*) echo x86_64-unknown-openbsd${UNAME_RELEASE} exit 0 ;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; cats:OpenBSD:*:*) echo arm-unknown-openbsd${UNAME_RELEASE} exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; luna88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; macppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvmeppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sgi:OpenBSD:*:*) echo mips64-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sun3:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit 0 ;; macppc:MirBSD:*:*) echo powerppc-unknown-mirbsd${UNAME_RELEASE} exit 0 ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit 0 ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit 0 ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit 0 ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit 0;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit 0 ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit 0 ;; *:OS/390:*:*) echo i370-ibm-openedition exit 0 ;; *:OS400:*:*) echo powerpc-ibm-os400 exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit 0;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit 0 ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit 0 ;; DRS?6000:UNIX_SV:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7 && exit 0 ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; 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 0 ;; 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 0 ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit 0 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit 0 ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit 0 ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit 0 ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit 0 ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit 0 ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) 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 \ && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ && exit 0 echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit 0 ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit 0 ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit 0 ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit 0 ;; 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 0 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit 0 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit 0 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit 0 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit 0 ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit 0 ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit 0 ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then 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 $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo rs6000-ibm-aix3.2.5 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 0 ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:*:*) echo rs6000-ibm-aix exit 0 ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit 0 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit 0 ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit 0 ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit 0 ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit 0 ;; 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 # avoid double evaluation of $set_cc_for_build test -n "$CC_FOR_BUILD" || eval $set_cc_for_build if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit 0 ;; 3050*:HI-UX:*:*) 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 && $dummy && exit 0 echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit 0 ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit 0 ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit 0 ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit 0 ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit 0 ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit 0 ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit 0 ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; 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 0 ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit 0 ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; x86:Interix*:[34]*) echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' exit 0 ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit 0 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit 0 ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit 0 ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit 0 ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; *: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 0 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit 0 ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit 0 ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit 0 ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit 0 ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit 0 ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit 0 ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit 0 ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit 0 ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit 0 ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit 0 ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit 0 ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit 0 ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #ifdef __INTEL_COMPILER LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit 0 ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit 0 ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit 0 ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit 0 ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit 0 ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit 0 ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit 0 ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit 0 ;; i*86:*:5:[78]*) case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit 0 ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit 0 ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit 0 ;; paragon:*:*:*) echo i860-intel-osf1 exit 0 ;; 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 0 ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit 0 ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit 0 ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit 0 ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 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 0 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; *: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 0 ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit 0 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit 0 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit 0 ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit 0 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit 0 ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit 0 ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit 0 ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit 0 ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit 0 ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit 0 ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit 0 ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in *86) UNAME_PROCESSOR=i686 ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit 0 ;; *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit 0 ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit 0 ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit 0 ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit 0 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit 0 ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit 0 ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit 0 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit 0 ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit 0 ;; *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit 0 ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms && exit 0 ;; I*) echo ia64-dec-vms && exit 0 ;; V*) echo vax-dec-vms && exit 0 ;; esac 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"); 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 && $dummy && exit 0 # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } # 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 0 ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; c34*) echo c34-convex-bsd exit 0 ;; c38*) echo c38-convex-bsd exit 0 ;; c4*) echo c4-convex-bsd exit 0 ;; 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: doste-0.3.1/COPYING0000644000175000001440000004312210750154243010604 00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. doste-0.3.1/README0000644000175000001440000000007411026666106010433 00000000000000See http://www.doste.co.uk for documentation and tutorials. doste-0.3.1/config.h.in0000644000175000001440000000556711265574145011620 00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_LIST /* Define to 1 if your system has a GNU libc compatible `malloc' function, and to 0 otherwise. */ #undef HAVE_MALLOC /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET /* Define to 1 if you have the `sqrt' function. */ #undef HAVE_SQRT /* Define to 1 if stdbool.h conforms to C99. */ #undef HAVE_STDBOOL_H /* Define to 1 if you have the header file. */ #undef HAVE_STDDEF_H /* 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 `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the header file. */ #undef HAVE_STRING /* 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 to 1 if you have the `strstr' function. */ #undef HAVE_STRSTR /* 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_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have that is POSIX.1 compatible. */ #undef HAVE_SYS_WAIT_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the header file. */ #undef HAVE_VECTOR /* Define to 1 if the system has the type `_Bool'. */ #undef HAVE__BOOL /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Version number of package */ #undef VERSION /* 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 rpl_malloc if the replacement function should be used. */ #undef malloc doste-0.3.1/include/0000777000175000001440000000000011265574152011265 500000000000000doste-0.3.1/include/doste/0000777000175000001440000000000011265574152012403 500000000000000doste-0.3.1/include/doste/file.h0000644000175000001440000000577011056270221013404 00000000000000/* * includes/doste/file.h * * File wrapper class to provide file system independence. * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _doste_FILE_H_ #define _doste_FILE_H_ #include #include #include #include #include #ifdef _MSC_VER #pragma warning ( disable : 4251 ) #endif namespace doste { class XARAIMPORT File : public doste::Object, public doste::Stream { public: VOBJECT(Object, File); enum Mode {READ, WRITE, READWRITE}; File() {}; File(const OID &obj) : Object(obj) {}; virtual ~File() {}; /** Get the filename. */ PROPERTY_R(dstring, filename); /** Change the filename */ PROPERTY_W(dstring, filename); /** Base is prepended to the filename */ PROPERTY_R(dstring, base); /** Base is prepended to the filename */ PROPERTY_W(dstring, base); /** * Get a full path to a local cached copy of the file. This is * needed for DLL modules which cannot load using this file * class but instead directly from the local file system. * @param buf A char array to fill with the filename. * @param max The size of the char array. */ virtual void getLocalFilename(char *buf, int max)=0; void mode(Mode m) { m_mode = m; } Mode mode() const { return m_mode; } /** * Open this file in the specified mode. * @param m Mode is READ, WRITE or READWRITE. * @return True if the file has been opened. */ virtual bool open(Mode m)=0; /** Close this file if open. */ virtual void close()=0; private: Mode m_mode; }; /** * Use this implementation of File to read files stored on the local * file system. */ class XARAIMPORT LocalFile : public File { public: OBJECT(File, LocalFile); LocalFile(); /** Constructor. Specify the filename */ LocalFile(const char *filename); LocalFile(const OID &obj); ~LocalFile(); void getLocalFilename(char *buf, int max); bool open(Mode m); void close(); int read(char *buf, int count); //int write(const char *buf, int count); void seek(int pos, Seek d); char peek(int n=0); bool eof(); int size(); int tell(); private: std::fstream m_stream; int m_size; char *m_cache; int m_pos; }; }; #endif doste-0.3.1/include/doste/messages.h0000644000175000001440000001026211026670020014262 00000000000000/* * includes/doste/messages.h * * Wrappers to generate error,warning,debug and information message objects. * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _doste_MESSAGES_H_ #define _doste_MESSAGES_H_ #include #include namespace doste { /** * Represents any error that occurs within DOSTE or in any loaded module. It will * create a database object filled with the error information and assign that to * root["error"]. By default DOSTE will trigger on this and print, in red, a message * to standard error. An error should be generated if the system has failed in some way * that would cause it to badly break if the error had not been detected. A fatal error * is one that causes the system to halt, typically these have to use standard error * directly. */ class XARAIMPORT Error { public: /** * Create a new error object. Currently only a number and string message * can be specified with the werror. * @param id A unique error number or 0 if unknown. * @param msg A dstring containing the error message. */ Error(int id, doste::dstring msg); ~Error() {} static const int UNKNOWN = 0; /**< An unknown error, yet to be given a number. */ static const int SYNTAX = 1; /**< A syntax error occured in a notation parser. */ static const int MODULE_NOT_FOUND = 2; /**< Unable to load a dynamic module, does not exist. */ static const int INVALID_MODULE = 3; /**< The specified module is not a valid DOSTE module. */ static const int POOL = 4; /**< Cannot use error objects for this!!!!! */ static const int CUSTOM = 1000; /**< Custom modules events should be >= this number. */ }; /** * Represents any warning that occurs within DOSTE or in any loaded module. It will * create a database object filled with the warning information and assign that to * root["warning"]. By default DOSTE will trigger on this and print, in orange or yellow, a message * to standard error. A warning should be generated if the system will not break but might not * do as the user expects. */ class XARAIMPORT Warning { public: Warning(int id, doste::dstring msg); ~Warning() {} static const int UNKNOWN = 0; /**< An unknown warning, yet to be given a number. */ static const int SCRIPT_NOT_FOUND = 1; /**< A script file could not be found. */ static const int INVALID_DESTINATION = 2; /**< Trying to send event to unknown OID. */ static const int GLOBAL_HANDLERS = 3; /**< Attempting to set multiple global handlers. */ static const int HANDLER_EXCEED = 4; /**< Maximum number of event handlers exceeded. */ static const int CURRENT_QUEUE = 5; /**< Sending event to current queue, a bad idea. */ static const int EVENT_OVERFLOW = 6; /**< Trying to delete more events than were allocated. */ static const int UNPROCESSED_EVENT = 7; /**< An event matched a handler but was not processed. */ static const int CUSTOM = 1000; /**< Custom module warnings should be >= this number. */ }; class XARAIMPORT Debug { public: Debug(int id, doste::dstring msg); ~Debug() {} static const int UNKNOWN = 0; static const int CUSTOM = 1000; //All custom user message number are above this. }; class XARAIMPORT Info { public: Info(int id, doste::dstring msg); ~Info() {} static const int UNKNOWN = 0; static const int LOADING = 1; static const int CUSTOM = 1000; //All custom user message number are above this. }; }; #endif doste-0.3.1/include/doste/dvm/0000777000175000001440000000000011265574152013171 500000000000000doste-0.3.1/include/doste/dvm/type_traits.h0000644000175000001440000001141311026667016015622 00000000000000/* * includes/doste/dvm/type_traits.h * * DOSTE related type traits for metaprogramming. * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _doste_DVM_TYPE_TRAITS_H_ #define _doste_DVM_TYPE_TRAITS_H_ namespace doste { namespace dvm { class true_type { public: static const bool value = true; }; class false_type { public: static const bool value = false; }; //--- is_void --- template class is_void : public false_type {}; template <> class is_void : public true_type {}; //--- is_integer --- template class is_integer : public false_type {}; template <> class is_integer : public true_type {}; template <> class is_integer : public true_type {}; template <> class is_integer : public true_type {}; template <> class is_integer : public true_type {}; template <> class is_integer : public true_type {}; template <> class is_integer : public true_type {}; template <> class is_integer : public true_type {}; template <> class is_integer : public true_type {}; template <> class is_integer : public true_type {}; template <> class is_integer : public true_type {}; //--- is_real --- template class is_real : public false_type {}; template <> class is_real : public true_type {}; template <> class is_real : public true_type {}; template <> class is_real : public true_type {}; //--- is_bool --- template class is_bool : public false_type {}; template <> class is_bool : public true_type {}; //--- is_pointer --- template class is_pointer : public false_type {}; template class is_pointer : public true_type {}; //--- is_reference --- template class is_reference : public false_type {}; template class is_reference : public true_type {}; //--- is_const --- template class is_const : public false_type {}; template class is_const : public true_type {}; //--- is_unsigned --- //template class is_unsigned : public false_type {}; //template class is_unsigned : public true_type {}; //--- is_pod --- template class is_pod : public false_type {}; template <> class is_pod : public true_type {}; template <> class is_pod : public true_type {}; template <> class is_pod : public true_type {}; template <> class is_pod : public true_type {}; template <> class is_pod : public true_type {}; template <> class is_pod : public true_type {}; template <> class is_pod : public true_type {}; template <> class is_pod : public true_type {}; template <> class is_pod : public true_type {}; template <> class is_pod : public true_type {}; template <> class is_pod : public true_type {}; template <> class is_pod : public true_type {}; template <> class is_pod : public true_type {}; template <> class is_pod : public true_type {}; template <> class is_pod : public true_type {}; template class is_pod : public true_type {}; //--- is_reuseable --- template class is_reuseable : public false_type {}; //--- add_reference --- //template struct ref_adder { typedef T& type; }; //template struct ref_adder { typedef T type; }; //template struct add_reference { typedef ref_adder< T, is_reference::value >::type type; }; //--- add_const --- //--- add_pointer --- //--- bool_constant --- template class bool_constant : public false_type {}; template <> class bool_constant : public true_type {}; //--- integer_constant --- template struct integer_constant { static const int value = C; }; }; }; #endif doste-0.3.1/include/doste/dvm/dvm.h0000644000175000001440000000370211026666463014050 00000000000000/* * includes/doste/dvm/dvm.h * * Dependency Virtual Machine * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _doste_DVM_H_ #define _doste_DVM_H_ #include #include #include #include namespace doste { /** * The Dependency Virtual Machine namespace. All core database functionality is kept in here. * @author Nicolas Pope * @see OID * @see Event */ namespace dvm { void DVMIMPORT initialise(const OID &base, int n); void DVMIMPORT finalise(); /** Your computers root database object */ extern DVMIMPORT OID root; /** Change value to DEBUG_ constants to output database * debug information. Caution, this outputs a massive amount * of data. */ extern DVMIMPORT unsigned int debug; static const unsigned int DEBUG_SET_EVENTS = 0x00000001; static const unsigned int DEBUG_NOTIFY_EVENTS = 0x00000002; static const unsigned int DEBUG_DEFINE_EVENTS = 0x00000004; static const unsigned int DEBUG_ADDDEP_EVENTS = 0x00000008; static const unsigned int DEBUG_INSTANTS = 0x00000010; static const unsigned int DEBUG_GET_EVENTS = 0x00000020; }; }; #endif doste-0.3.1/include/doste/dvm/event.h0000644000175000001440000001354011056251306014371 00000000000000/* * includes/doste/dvm/event.h * * Event class for object communication. * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 9/11/2007 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _doste_DVM_EVENT_H_ #define _doste_DVM_EVENT_H_ #include #include #include #include #include #ifdef X86_64 typedef long unsigned int size_t; #else //typedef unsigned long size_t; #endif namespace doste { namespace dvm { typedef int EventType; /** * Represents an object event. All communication between objects is done via these events. * Each event is given a destination, type and an optional number of parameters and is then * sent to be routed and processed. Event sends may be synchronous or asynchronous. * @author Nicolas Pope */ class DVMIMPORT Event { public: Event() {}; /** * Constructor. You can specify event details here but they can be overridden later. * @param type Event type, e.g. SET * @param dest The destination object. */ Event(EventType type, const OID &dest) : m_type(type), m_dest(dest) {} /** Destructor */ ~Event() {}; /** * Send this event for processing. This is non-blocking for all events * except for GET events (GET, GET_KEYS,GETDEF,CREATE and GETFLAGS). * All events are guaranteed to be processed after one instant. * @param flags Flags to control how it is processed. See Event:FLAG_. * @return True if it was sent correctly. */ bool send(int flags=0) { return Processor::send(this,flags); }; //void callback(ECallback *cb) { m_cb = cb; }; //ECallback *callback() const { return m_cb; }; /** Get a parameter. The template argument is the parameter number. */ template inline const OID ¶m(); /** Set a parameter. The template argument is the parameter number */ template inline void param(const OID &p); /** @return The type of event. Type becomes 0 once the event has been processed. */ EventType type() const { return m_type; }; /** * Change the event type. * @param t New event type. */ void type(EventType t) { m_type = t; }; /** @return The result returned by this event if applicable. */ const OID &result() const { return m_res; }; /** Change the result value */ void result(const OID &res) { m_res = res; }; /** @return The destination object OID */ const OID &dest() const { return m_dest; }; /** * Change the destination object. * @param d The new destination. */ void dest(const OID &d) { m_dest = d; }; void* operator new(size_t s); void operator delete(void *p); //The GET operations are evaluated immediately static const EventType GET = 0x01; /**< Get an object attribute value */ static const EventType GET_KEYS = 0x02; /**< Get all object keys */ static const EventType GETDEF = 0x03; /**< Get the definition of an attribute */ static const EventType CREATE = 0x04; /**< Create a new object based on another objects OID */ static const EventType GETFLAGS = 0x05; static const EventType GET_RANGE = 0x06; static const EventType COPY = 0x07; //GET_FLAGS //GET_DEPENDENTS //Various custom GETs for statistics, security etc... //The SET operations always go into Q1 static const EventType SET = 0x10; /**< Set an object attribute */ static const EventType DEFINE = 0x11; /**< Define a single object attribute */ static const EventType DEFINE_FUNC = 0x12; /**< Define an attribute as a function */ //static const EventType DEFINE_AGENT = 0x13; /**< Define an attribute as an agent */ //Maybe some custom SETs for security... static const EventType SETFLAGS = 0x14; //The NOTIFY operations always go into Q2 static const EventType NOTIFY = 0x20; /**< Notify that a definition is out-of-date */ static const EventType ADDDEP = 0x30; /**< Add a single dependency */ static const EventType ADD_REF = 0x31; /**< Add a reference to prevent garbage collection */ static const EventType REMOVE_REF = 0x32; /**< Remove a reference and garbage collect if needed. */ //See also the Processor flags. static const int FLAG_BLOCK = 0x01; static const int FLAG_FREE = 0x02; /**< Automatically delete the event when processed. */ static const int FLAG_AGENT = 0x04; /**< Deprecated. */ static void initialise(); static void finalise(); private: static const unsigned int MAX_PARAMETERS = 4; static const unsigned int EVENT_POOL_SIZE = 100000; static doste::SpinLock event_lock; EventType m_type; //ECallback *m_cb; OID m_dest; //union { OID m_p[MAX_PARAMETERS]; OID m_res; //}; static unsigned int s_ppos; static Event *s_pool[EVENT_POOL_SIZE]; static Event *s_block; //Block of preallocated events }; }; }; template inline const doste::dvm::OID &doste::dvm::Event::param() { if (I > MAX_PARAMETERS) return doste::dvm::Null; return m_p[I]; } template inline void doste::dvm::Event::param(const doste::dvm::OID &p) { if (I > MAX_PARAMETERS) return; m_p[I] = p; } #endif doste-0.3.1/include/doste/dvm/Makefile.am0000644000175000001440000000023411026706611015130 00000000000000pkgincludedir = $(includedir)/doste/dvm pkginclude_HEADERS=buffer.h coid.h definition.h dvm.h event.h handler.h modifiers.h oid.h processor.h type_traits.h doste-0.3.1/include/doste/dvm/processor.h0000644000175000001440000001271511056222603015270 00000000000000/* * includes/doste/dvm/processor.h * * The main processing class for the Doste transaction system. * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 21/7/2007 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _doste_DVM_PROCESSOR_H_ #define _doste_DVM_PROCESSOR_H_ #include #include #include namespace doste { namespace dvm { class Context; class Event; /** * There should be one instance of the processor class for * each processor. All event processing is initiated here and * it stores all the event queues. If you wish to block until * an event has completed then use processRemaining(). Generally * there should be little need to use this class directly. * @author Nicolas Pope * @see Event */ class DVMIMPORT Processor { public: Processor(); virtual ~Processor(); /** * Causes the run method to return. Do not use directly. */ void shutdown() { m_running = false; }; //bool isIdle() const { return m_idle; }; //void notIdle() { m_idle = false; }; /** @return The number of events still in all queues. TODO: UPDATE TO CHECK ALL QUEUES */ static int queueSize(); /** @return This processors unique ID number. */ int getID() const { return m_id; }; /** * Process all events in the specified queue. This should not be called * directly because on multi-processor systems this will cause deadlock.
* Queue 0 = SET events.
* Queue 1 = NOTIFY events.
* Queue 2 = ADDDEP events.
* @param queue The queue number, 0-2. */ static void processQueue(int queue); /** * Causes all queues to be processed in order and synchronised with other * processors. You may call this but not from inside an event handler. Use * processRemaining() in an event handler. * @return True if there are still more events to be processed. */ static bool processInstant(); /** * Finish processing queues. This is a version of processInstant() which works * inside event handlers without causing deadlocks. */ static void processRemaining(); /** @return Number of instants since start. */ static long long getInstant() { return s_instant; }; /** @return Number of events processed since start. */ static long long getEventCount() { long long temp = s_evtcount; s_evtcount = 0; return temp; }; Context *context() const { return m_context; } void context(Context *con) { m_context = con; } /** Simple wrapper that calls processInstant() until no more events exist in the queues. */ static void processAll() { while (processInstant()); }; virtual void dbInit(const OID &proc) {}; /** * Get a processor from is unique id number. * @param id Processor ID * @return Processor corresponding to ID or NULL. */ static Processor *getProcessor(int id); /** * Get the processor object for the processor which is calling this function. * @return This processors processor object. */ static Processor *getThisProcessor(); /** * @return The number of active processors on this machine */ static int numProcessors() { return s_nextproc; }; /** * Add an event to the correct queue for processing. This returns immediately. * @param evt A reference to an event. * @param flags The only valid flag is Event::FLAG_FREE which deletes the object when processed. * @return True if the event was sent correctly. */ static bool send(Event &evt, int flags=0) { return send(&evt,flags); }; /** * Add an event to the correct queue for processing. This returns immediately. * @param evt A pointer to an event. * @param flags The only valid flag is Event::FLAG_FREE which deletes the object when processed. * @return True if the event was sent correctly. */ static bool send(Event *evt, int flags=0); static void init(int n); static void final(); static void dump(); static const int FLAGS_BLOCK = 0x01; static const int FLAGS_FREE = 0x02; /**< Delete the event object when it has been processed */ static const unsigned int MAX_PROCESSORS = 8; static const unsigned int QUEUE_SIZE = 100000; static const unsigned int NUM_QUEUES = 3; protected: int m_id; #ifdef LINUX pthread_t m_pthread; static pthread_key_t s_pkey; #endif bool m_running; bool m_idle; Context *m_context; struct EvtQueue { Event *evt; int flags; }; struct Queues { unsigned int get; unsigned int put; EvtQueue q[QUEUE_SIZE]; }; static Queues s_queue[NUM_QUEUES]; static long long s_instant; static long long s_evtcount; static Processor *s_processors[MAX_PROCESSORS]; static int s_nextproc; }; }; }; #endif doste-0.3.1/include/doste/dvm/Makefile.in0000644000175000001440000002625011265574062015157 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 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@ pkglibdir = $(libdir)/@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/doste/dvm DIST_COMMON = $(pkginclude_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 = depcomp = am__depfiles_maybe = 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 = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(pkgincludedir)" pkgincludeHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(pkginclude_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkgincludedir = $(includedir)/doste/dvm ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__leading_dot = @am__leading_dot@ 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_builddir = @top_builddir@ top_srcdir = @top_srcdir@ pkginclude_HEADERS = buffer.h coid.h definition.h dvm.h event.h handler.h modifiers.h oid.h processor.h type_traits.h 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 \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps include/doste/dvm/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu --ignore-deps include/doste/dvm/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 install-pkgincludeHEADERS: $(pkginclude_HEADERS) @$(NORMAL_INSTALL) test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" @list='$(pkginclude_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(pkgincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgincludedir)/$$f'"; \ $(pkgincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgincludedir)/$$f"; \ done uninstall-pkgincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(pkginclude_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(pkgincludedir)/$$f'"; \ rm -f "$(DESTDIR)$(pkgincludedir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ 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; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ 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)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @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 $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(HEADERS) installdirs: for dir in "$(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) 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 mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-pkgincludeHEADERS install-dvi: install-dvi-am 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 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 pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkgincludeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ ctags distclean distclean-generic 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-pkgincludeHEADERS install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \ uninstall uninstall-am 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: doste-0.3.1/include/doste/dvm/handler.h0000644000175000001440000000707311026666573014706 00000000000000/* * includes/doste/dvm/handler.h * * An event router. * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _doste_DVM_HANDLER_H_ #define _doste_DVM_HANDLER_H_ #include #include namespace doste { namespace dvm { class Event; /** * Handlers deal with all event processing. There may be several different implementations of a * handler depending on where the object is stored. For example: local storage using main memory, * disk storage or network storage. A handler registers which OIDs it is reponsible for and all * subsequent events sent to those objects go to the corresponding handler. * @author Nicolas Pope */ class DVMIMPORT Handler { public: /** * Use this to mean all events that match no other handler. * There can only be one such handler, you will receive warnings if * there are multiple global handlers and the most recently created * will be used. */ Handler(); /** * Constructor for single object handler. Typically this is used for hardware * that only needs to receive the events of one object. * @param o OID to receive events for. */ Handler(const OID &o); /** * Constructor for multi-object handler. Receives events for a range of objects. * Used for storage handlers and math handlers. * @param l First OID in range, inclusive. * @param h Last OID in range, inclusive. */ Handler(const OID &l, const OID &h); virtual ~Handler(); /** * Implement to handle object events. Note that if you return false for a bulk * operation event then that event will be converted into many smaller non-bulk * events and handle will be called again. * @param evt The event to be handled. * @return True if the event was handled, false if it could not be handled. */ virtual bool handle(Event &evt)=0; /** * Maps an OID range to this handler. Similar to constructor but allows additional * ranges to be mapped as well. * @param l First OID in range, inclusive * @param h Last OID in range, inclusive */ void map(const OID &l, const OID &h); /** * Will route the event to the correct handler or agent. * This will be called by each Processor. * @param evt The event to send to correct handler. * @return True if a handler was found. */ static bool route(Event &evt); private: static const unsigned int MAX_HANDLERS = 20; //Can be implemented more efficiently. Sort etc... struct SHandlerEntry { Handler *ha; OID l; OID h; }; static SHandlerEntry s_handlers[MAX_HANDLERS]; static Handler *s_otherwise; static unsigned int s_numhandlers; static void convertSetList(doste::dvm::Event &evt, Handler *ha); //static void convertGetRange(Event &evt, Handler *ha); }; }; }; #endif doste-0.3.1/include/doste/dvm/oid.h0000644000175000001440000005660111137277464014045 00000000000000/* * includes/doste/dvm/oid.h * * Object IDentifier class with C++ wrappers for object access. * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 9/11/2007 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _doste_DVM_OID_H_ #define _doste_DVM_OID_H_ #include #include //Because this file is included everywhere... //#define NEW new(__FILE__, __LINE__) #include /*inline void *operator new(size_t size, const char *filename, int line) { std::cout << "Allocate: " << size << " "<< filename << ":" << line << "\n"; return malloc(size); }*/ namespace doste { class Object; namespace dvm { class Buffer; class Definition; class OIDAccessor; /** * Object Identifier. A 128bit number that uniquely identifies an * object within the DVM. This class provides wrapper methods for * accessing and changing attributes within the object referred to * by this OID. These wrappers generate the required events. * @author Nicolas Pope */ #ifdef _MSC_VER #pragma pack(1) #endif class DVMIMPORT OID { public: /** Null constructor. */ OID() : m_hl(0), m_ll(0) {}; /** Manually specify the OID components when constructing */ OID(unsigned int a, unsigned int b, unsigned int c, unsigned int d) : m_b(b), m_a(a), m_d(d), m_c(c) {}; /** Create an OID from an integer */ OID(int v) : m_b(1), m_a(0), m_ll(v) {}; /** Create an OID from an unsigned integer */ OID(unsigned int v) : m_b(1), m_a(0), m_ll(v) {}; /** Create an OID from a float */ OID(float v) : m_b(2), m_a(0) { m_dbl = (double)v; }; /** Create an OID from a boolean */ OID(bool v) : m_b(0), m_a(0), m_d((v)?1:2), m_c(0) {}; /** Create an OID from a name. This name should not contain white space or special characters. */ OID(const char *v); /** Create an OID from a 64bit long long integer. */ OID(long long v) : m_b(1), m_a(0) { m_ll = v; }; /** Create an OID from a 64bit double */ OID(double v) : m_b(2), m_a(0) { m_dbl = v; }; /** Create an OID from an ascii character. */ OID(char v) : m_b(3), m_a(0), m_d(v), m_c(0) {}; /** Create an OID from a 32 or 64bit pointer. */ OID(void *v) : m_b(4), m_a(0) { #ifdef X86_64 m_ll = (long long)v; #else m_ll = (long long)(int)v; #endif }; OID(const OIDAccessor &a); ~OID() {}; /** * Will map a specific OID to a label. * @param o OID to map to. * @param l The label. */ static void mapLabel(const OID &o, const char*l); /** * Enables you to cast an OID to an object pointer. The object you are * casting to must be a DOSTE-enabled object, inherits from Object. */ template operator T*() const { return get_pointer(doste::dvm::is_pod()); }; template inline T *get_pointer(true_type t) const { if (isPointer()) { #ifndef X86_64 return (T*)(int)m_ll; #else return (T*)m_ll; #endif } else { return 0; } } template inline T *get_pointer(false_type) const; /** * Cast an OID to an integer. This will automatically convert from * other types where possible. Floats, characters and booleans will * be converted. * @return Integer if possible, otherwise 0. */ operator int() const { if (isLongLong()) { return (int)m_ll; } else if (isDouble()) { return (int)m_dbl; } else if (isChar()) { return m_d; } else if (isBuffer()) { return m_d; } else if (isBool()) { return (m_d == 1) ? 1 : 0; } else { return 0; } }; /** * Cast an OID to a float. This will automatically convert integers * and booleans. * @return A floating point number or 0.0 */ operator float() const { if (isDouble()) { return (float)m_dbl; } else if (isLongLong()) { return (float)m_ll; } else if (isBool()) { return (m_d == 1) ? 1.0f : 0.0f; } else { return 0.0f; } }; /** * Cast an OID to a double. This automatically converts integers and booleans. * @return A double or 0.0. */ operator double() const { if (isDouble()) { return m_dbl; } else if (isLongLong()) { return (double)m_ll; } else if (isBool()) { return (m_d == 1) ? 1.0 : 0.0; } else { return 0.0; } }; /** * Cast an OID to a long long integer. This automatically converts floats, * characters and booleans. * @return An integer if possible, otherwise 0. */ operator long long() const { if (isLongLong()) { return m_ll; } else if (isDouble()) { return (long long)m_dbl; } else if (isChar()) { return m_d; } else if (isBool()) { return (m_d == 1) ? 1 : 0; } else { return 0; } }; /** * Cast an OID to an ascii character. It automatically converts * integers. * @return A character or 0. */ operator char() const { if (isChar()) { return m_d; } else if (isLongLong()) { return m_d; } else if (isDouble()) { return 0; } else { return 0; } }; /** * Cast an OID to a boolean. Everything is true except false, 0, 0.0, Null and a null character. * @return A boolean value. */ operator bool() const { if (isBool()) { return (m_d == 1) ? true : false; } else { return (m_d > 0) ? true : false; } }; /** * This operator will return a new definition object when used on an OID. * An example might be doste::root("time"). * @see Definition * @return A new definition. */ Definition operator()(const OID &o) const; /** * Array style access to the contents of the object this OID represents. * You can also use assignment on this to change values in the database. * @see OIDAccessor * @param o The OID to use as the attribute name. * @return An OIDAccessor but this can be cast to an OID to get the value. */ template inline OIDAccessor operator[](const T &o) const; /** * Get an Object pointer from a specified attribute. * @param o The attribute name. * @return Object pointer or NULL. */ template inline T *get(const OID &o) const; //This is implemented in object. template inline void set(const OID &key, T *value, bool async=false) const; /** * Get the value of an attribute within this object. * @param o Attribute name. * @return Value of this attribute */ OID get(const OID &o) const; /** * Change the value of an attribute within this object. * @param key The attribute name * @param value New value to change it to. * @param async Synchronous or asynchronous. False (default) means block until done. */ void set(const OID &key, const OID &value, bool async=false) const; /** * Set the definition for a specified attribute. * @param key The attribute name * @param def The definition object * @param async Synchronous or asynchronous. False (default) means block until done. * @see Definition */ void define(const OID &key, const OID &def, bool async=false) const; /** * Set the definition for a specified attribute. This version does not evaluate * the definition to determine the initial value but instead uses the value you specify. * @param key The attribute name * @param def The definition object * @param init Initialise the value to this * @param async Synchronous or asynchronous. False (default) means block until done. * @see Definition */ void define(const OID &key, const OID &def, const OID &init, bool async=false) const; /** * Set a function definition for a specified attribute. Note that this overrides any * normal definition (and vice versa). A function definition evaluates on read instead * of using dependency maintenance. * @param key The attribute name * @param func The function definition object * @param async Synchronous or asynchronous. False (default) means block until done. * @see Definition */ void function(const OID &key, const OID &func, bool async=false) const; /** * Get the current definition for an attribute in this object. * @param key Attribute name. * @return Definition object. * @see Definition */ OID definition(const OID &key) const; /** * Return the flags for an attribute. This tells you what kind of definition it is * and various other meta information. Look at OID::FLAG_ constants. * @param key The attribute name. * @return 32bit flags. */ int flags(const OID &key) const; void flags(const OID &key, int flags, bool async=false) const; /** * Make an attribute within this object dependent upon something. * @param dest The object to depend upon * @param attrib The attribute to depend upon * @param key The attribute in this object that has the dependency. */ void dependency(const OID &dest, const OID &attrib, const OID &key); /** * Copy all attributes in this object into the specified object. * @param n Destination. */ OID copy(const OID &n); void destroy(); //void merge(const OID &obj); static const unsigned char FLAG_FUNCTION = 0x01; /**< The definition is a function definition */ static const unsigned char FLAG_OUT_OF_DATE = 0x40; /**< Evaluate on next use */ static const unsigned char FLAG_DEFINITION = 0x04; /**< Not used */ static const unsigned char FLAG_PRIVATE = 0x08; /**< Must have private read/write permission */ static const unsigned char FLAG_HIDDEN = 0x10; /**< By default hide this attribute */ static const unsigned char FLAG_DEEP = 0x20; class iterator; /** * Start iterating over elements within this object. * @return A new iterator. */ iterator begin() const; /** * An iterator that corresponds to the end of elements. * @return A null of finished iterator. Compare with this to stop iterating. */ iterator end() const; /** Compare two OIDs. Does a 128bit comparison */ friend inline bool operator==(const OID&, const OID&); /** Compare two OIDs. Does a 128bit comparison */ friend inline bool operator!=(const OID&, const OID&); /** Compares all 128bits */ friend inline bool operator<(const OID&, const OID&); /** Compares all 128bits */ friend inline bool operator>(const OID&, const OID&); friend inline bool operator<=(const OID&, const OID&); friend inline bool operator>=(const OID&, const OID&); friend inline OID operator&(const OID&, const OID&); /** * Add one to this OID. 128bit number increment. * @return The new OID with 1 added. */ const OID &operator++() { if (m_d == 0xFFFFFFFF) { m_d = 0; if (m_c == 0xFFFFFFFF) { m_c = 0; if (m_b == 0xFFFFFFFF) { m_b = 0; m_a+=1; } else { m_b += 1; } } else { m_c += 1; } } else { m_d += 1; } return *this; }; /** * Add one to this OID. 128bit number increment. * @return The OID before incrementing. */ OID operator++(int) { OID temp = *this; if (m_d == 0xFFFFFFFF) { m_d = 0; if (m_c == 0xFFFFFFFF) { m_c = 0; if (m_b == 0xFFFFFFFF) { m_b = 0; m_a+=1; } else { m_b += 1; } } else { m_c += 1; } } else { m_d += 1; } return temp; }; //OID operator--(); //OID operator--(int); /** * Numerically add two OIDs together. Useful for adding OID::local() to * some standard base. */ friend inline OID operator+(const OID &, const OID &); //friend OID operator-(const OID &, int); //const OID &operator+=(int); //const OID &operator-=(int); //Stream operators. /** * Convert this OID into a human readable ascii string. All number OIDs are * converted to number strings. Label OIDs are looked up for the actually label. * Other OIDs are printed out as 4 32bit numbers. * @param buf The char buffer to fill with the result. * @param max The size of the buffer. */ void toString(char *buf, int max) const; /** @return True is this OID represents an integer (32bit or 64bit). */ bool isInt() const { return (m_a == 0 && m_b == 1) ? true : false; }; /** @return True is this OID represents a float (32bit or 64bit). */ bool isFloat() const { return (m_a == 0 && m_b == 2) ? true : false; }; /** @return True is this OID represents a float (32bit or 64bit). */ bool isDouble() const { return (m_a == 0 && m_b == 2) ? true : false; }; /** @return True is this OID represents an integer (32bit or 64bit). */ bool isLongLong() const { return (m_a == 0 && m_b == 1) ? true : false; }; /** @return True is this OID represents a character (ascii or unicode). */ bool isChar() const { return (m_a == 0 && m_b == 3) ? true : false; }; /** @return True is this OID represents a label. */ bool isName() const { return (m_a == 0 && m_b == 5) ? true : false; }; /** @return True is this OID represents a boolean. */ bool isBool() const { return (isSpecial() && m_c == 0 && (m_d == 1 || m_d == 2)) ? true : false; }; /** @return True is this OID represents a pointer (32bit or 64bit). */ bool isPointer() const { return (m_a == 0 && m_b == 4) ? true : false; }; bool isCharPtr() const { return (m_a == 0 && m_b == 10) ? true : false; }; /** @return True is this OID represents a special Buffer object. */ bool isBuffer() const { return (m_a == 0 && m_b == 14) ? true : false; }; bool isIntPtr() const { return (m_a == 0 && m_b == 11) ? true : false; }; bool isFloatPtr() const { return (m_a == 0 && m_b == 12) ? true : false; }; bool isOIDPtr() const { return (m_a == 0 && m_b == 13) ? true : false; }; /** @return True is this OID corresponds to an agent. */ bool isAgent() const { return (m_a > 0 && m_c == 15) ? true : false; }; /** @return True is this OID represents a virtual machine instruction. */ bool isVirtual() const { return (m_a == 0 && m_b == 100) ? true : false; }; /** @return True is this OID is any type of reserved OID (numbers, specials, pointers, buffers...). */ bool isReserved() const { return (m_a == 0) ? true : false; }; /** @return True is this OID represents a definition modifier. */ bool isModifier() const { return (m_hl == 0 && m_c == 1) ? true : false; }; /** @return True is this OID represents a special OID (true,false,this,null,all,key,...). */ bool isSpecial() const { return (m_a == 0 && m_b == 0) ? true : false; }; /** @return First 32bit component */ unsigned int a() const { return m_a; }; /** @return Second 32bit component */ unsigned int b() const { return m_b; }; /** @return Third 32bit component */ unsigned int c() const { return m_c; }; /** @return Fourth 32bit component */ unsigned int d() const { return m_d; }; /** * Each machine has a base local OID of the form '<*:0:0:0>'. This sets this * machines local OID and should only be called during initialisation. * @param o The base OID for this machine. */ static void local(const OID &o) { s_local = o; }; /** @return This machines local base OID */ static OID local() { return s_local; }; /** @return A new OID for this machine */ static OID create(); //private: #ifdef X86_64 union { struct { #endif union { struct { unsigned int m_b; unsigned int m_a; }; long long m_hl; }; union { struct { unsigned int m_d; unsigned int m_c; }; double m_dbl; long long m_ll; }; #ifdef X86_64 }; __int128_t m_128; }; #endif static OID s_local; #ifdef _MSC_VER }; #pragma pack() //pop pack value #else } __attribute__((packed)); #endif /** * A standard C++ iterator for iterating over all elements within an object. * Use the OID begin() method to create a new iterator. An example of how to use * it:

* for (OID::iterator i=myobj.begin(); i!=myobj.end(); i++) { value = (*i); ... } */ class DVMIMPORT OID::iterator { friend class OID; public: ~iterator(); OID operator*(); iterator &operator++(); iterator &operator++(int); iterator &operator--(); iterator &operator--(int); friend inline bool operator==(const iterator &i1, const iterator &i2); friend inline bool operator!=(const iterator &i1, const iterator &i2); OID object() const { return m_object; } private: doste::dvm::OID m_object; doste::dvm::OID m_buf; Buffer *m_buffer; int m_cur; iterator(const OID &o, int c); }; class DVMIMPORT OIDAccessor { friend class OID; public: OIDAccessor(OID obj, OID key) : m_obj(obj), m_key(key) {}; ~OIDAccessor() {}; template operator T() const { return (T)m_obj.get(m_key); } //operator OID() const { return m_obj.get(m_key); }; template OIDAccessor &operator=(T *p) { m_obj.set(m_key, (OID)*p); return *this; } OIDAccessor &operator=(const OID &o) { m_obj.set(m_key, o); return *this; }; OIDAccessor &operator=(const Definition &d); friend bool DVMIMPORT operator==(const OIDAccessor &acc, const OID &o); template OIDAccessor operator[](const T &o) const { return OIDAccessor(m_obj.get(m_key), o); }; void set(const OID &val, bool async=false) { m_obj.set(m_key, val, async); }; OID get() const { return m_obj.get(m_key); }; private: OID m_obj; OID m_key; }; #undef True #undef False static const OID Null = OID(0,0,0,0); /**< A null OID typically means undefined */ static const OID True = OID(0,0,0,1); /**< The boolean true OID */ static const OID False = OID(0,0,0,2); /**< The boolean false OID */ static const OID Local = OID(0,0,0,3); /**< Unused */ static const OID Global = OID(0,0,0,4); /**< Unused */ static const OID This = OID(0,0,0,5); /**< Refers to the current 'this' object. It will often be substituted for a real OID.*/ static const OID Infinity = OID(0,0,0,6); /**< Used for floating pointer operations */ static const OID All = OID(0,0,0,9); /**< Refers to all attributes in an object */ static const OID Size = OID(0,0,0,8); /**< Used as an attribute label to specify a string or definition list size */ static const OID Key = OID(0,0,0,9); /**< In a definition this is substituted for the attribute name of this definition*/ static const OID Void = OID(0,0,0,10); /**< Means 'don't care'. Setting this to an attribute always causes notification. */ static const OID Self = OID(0,0,0,11); /**< Inside a function definition this access the functions containing object.*/ static const OID Type = OID(0,0,0,12); /**< Type of object used for rtti */ static const OID Parent = OID(0,0,0,13); static const OID Add = OID(0,0,0,14); static const OID Subtract = OID(0,0,0,15); static const OID Divide = OID(0,0,0,16); static const OID Multiply = OID(0,0,0,17); static const OID Less = OID(0,0,0,18); static const OID Greater = OID(0,0,0,19); static const OID And = OID(0,0,0,20); static const OID Or = OID(0,0,0,21); static const OID Not = OID(0,0,0,22); static const OID Question = OID(0,0,0,23); static const OID Percent = OID(0,0,0,24); static const OID At = OID(0,0,0,25); static const OID Exclamation = OID(0,0,0,26); static const OID _delete = OID (0,0,0,100); static const OID _size = OID(0,0,0,101); static const OID _save = OID(0,0,0,102); static const OID _clone = OID(0,0,0,103); static const OID _keys = OID(0,0,0,104); static const OID _allkeys = OID(0,0,0,105); static const OID _deep = OID(0,0,0,106); template <> class is_pod : public true_type {}; }; }; template doste::dvm::OIDAccessor doste::dvm::OID::operator[](const T &o) const { return doste::dvm::OIDAccessor(*this, o); }; bool doste::dvm::operator==(const doste::dvm::OID &o1, const doste::dvm::OID &o2) { //#ifdef X86_64 //return (o1.m_128 == o2.m_128); //#else return (o1.m_hl == o2.m_hl && o1.m_ll == o2.m_ll); //#endif } bool doste::dvm::operator!=(const doste::dvm::OID &o1, const doste::dvm::OID &o2) { //#ifdef X86_64 //return (o1.m_128 != o2.m_128); //#else return (o1.m_hl != o2.m_hl || o1.m_ll != o2.m_ll); //#endif } namespace doste { namespace dvm{ bool operator<(const doste::dvm::OID &o1, const doste::dvm::OID &o2) { //#ifdef X86_64 //return (o1.m_128 < o2.m_128); //#else return ((unsigned long long)o1.m_hl < (unsigned long long)o2.m_hl || (o1.m_hl == o2.m_hl && (unsigned long long)o1.m_ll < (unsigned long long)o2.m_ll )); //#endif } bool operator>(const doste::dvm::OID &o1, const doste::dvm::OID &o2) { //#ifdef X86_64 //return (o1.m_128 > o2.m_128); //#else return ((unsigned long long)o1.m_hl > (unsigned long long)o2.m_hl || (o1.m_hl == o2.m_hl && (unsigned long long)o1.m_ll > (unsigned long long)o2.m_ll )); //#endif } bool operator<=(const doste::dvm::OID &o1, const doste::dvm::OID &o2) { //#ifdef X86_64 //return (o1.m_128 <= o2.m_128); //#else return ((o1 < o2) || (o1 == o2)); //#endif } bool operator>=(const doste::dvm::OID &o1, const doste::dvm::OID &o2) { //#ifdef X86_64 //return (o1.m_128 >= o2.m_128); //#else return ((o1 > o2) || (o1 == o2)); //#endif } doste::dvm::OID operator&(const doste::dvm::OID &o1, const doste::dvm::OID &o2) { return doste::dvm::OID(o1.m_a & o2.m_a, o1.m_b & o2.m_b, o1.m_c & o2.m_c, o1.m_d & o2.m_d); } doste::dvm::OID operator+(const doste::dvm::OID &o1, const doste::dvm::OID &o2) { return doste::dvm::OID(o1.m_a+o2.m_a,o1.m_b+o2.m_b,o1.m_c+o2.m_c,o1.m_d+o2.m_d); } bool operator==(const doste::dvm::OID::iterator &i1, const doste::dvm::OID::iterator &i2) { return (i1.m_object == i2.m_object && i1.m_cur == i2.m_cur); } bool operator!=(const doste::dvm::OID::iterator &i1, const doste::dvm::OID::iterator &i2) { return (i1.m_object != i2.m_object || i1.m_cur != i2.m_cur); } } } #endif doste-0.3.1/include/doste/dvm/modifiers.h0000644000175000001440000001017411056311304015224 00000000000000/* * includes/doste/dvm/modifiers.h * * Available definition modifiers. * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _doste_DVM_MODIFIERS_H_ #define _doste_DVM_MODIFIERS_H_ namespace doste { namespace dvm { /** * Modifiers are used to control definition evaluation. For example the SET modifier will * cause a SET event to be used with the following two elements as arguments. */ namespace modifiers { static const int SET = 1; /**< Use a SET event with next elements as key and value. */ static const int DEFINE = 2; /**< Use a DEFINE event with next elements as key and definition */ //static const int DEFINEAGENT = 3; /**< Use a DEFINE_AGENT event with next elements as key and definition */ static const int DEFINEFUNC = 4; /**< Use a DEFINE_FUNC event with next elements as key and definition */ static const int CREATE = 5; /**< Create a new OID using the CREATE event */ //static const int ADDDEP = 6; /**< Add a dependency using the ADDDEP event */ static const int SEQ = 7; /**< Set next element as the current object */ //static const int RETURN = 8; /**< Not useful currently. */ static const int NODEP = 9; /**< Do not add dependencies on subsequent GETS */ static const int SYNC = 10; /**< Not used */ static const int COMPARE = 11; /**< Compare two OIDS and put boolean result in current object. */ //static const int GETRANGE = 12; /**< Return a buffer object containing a range */ //static const int GETMULTI = 13; /**< Return a buffer object after a mult-get EVENT */ //static const int FORALL = 14; /**< */ //static const int FORRANGE = 15; /**< */ static const int NOCONTEXT = 16; static const int UNION = 17; //static const int LIST = 18; //static const int ISET = 19; /**< Init SET for new objects. */ //static const int IDEFINE = 20; //static const int IFUNC = 21; //Bulk operations. //static const int CLONE = 22; static const int GETDEF = 23; static const int GETFLAGS = 24; static const int BEGINSUB = 25; static const int ENDSUB = 26; static const OID Set = OID(0,0,1,SET); static const OID Define = OID(0,0,1,DEFINE); //static const OID DefineAgent = OID(0,0,1,DEFINEAGENT); static const OID DefineFunc = OID(0,0,1,DEFINEFUNC); static const OID Create = OID(0,0,1,CREATE); //static const OID AddDep = OID(0,0,1,ADDDEP); static const OID Seq = OID(0,0,1,SEQ); //static const OID Return = OID(0,0,1,RETURN); static const OID NoDep = OID(0,0,1,NODEP); static const OID Sync = OID(0,0,1,SYNC); static const OID Compare = OID(0,0,1,COMPARE); //static const OID GetRange = OID(0,0,1,GETRANGE); //static const OID GetMulti = OID(0,0,1,GETMULTI); //static const OID ForAll = OID(0,0,1,FORALL); //static const OID ForRange = OID(0,0,1,FORRANGE); static const OID NoContext = OID(0,0,1,NOCONTEXT); static const OID Union = OID(0,0,1,UNION); //static const OID List = OID(0,0,1,LIST); //static const OID ISet = OID(0,0,1,ISET); //static const OID IDefine = OID(0,0,1,IDEFINE); //static const OID IFunc = OID(0,0,1,IFUNC); //Bulk operations. //static const OID Clone = OID(0,0,1,CLONE); static const OID GetDef = OID(0,0,1,GETDEF); static const OID GetFlags = OID(0,0,1,GETFLAGS); static const OID BeginSub = OID(0,0,1,BEGINSUB); static const OID EndSub = OID(0,0,1,ENDSUB); }; }; }; #endif doste-0.3.1/include/doste/dvm/definition.h0000644000175000001440000000643011056312004015371 00000000000000/* * includes/doste/dvm/definition.h * * C++ Wrapper for DOSTE definitions. * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _doste_DVM_DEFINITION_H_ #define _doste_DVM_DEFINITION_H_ #include #include #include namespace doste { namespace dvm { class Context; /** * Manage and evaluate definitions. This is the heart of the virtual machine as it * is responsible to definition evaluation. It also works closely with OID to create * a simple way of describing definitions in C++. An example of a C++ definition is * shown below:

* * root["test"] = root("devices")("ps2keyboard")("key");
*
* * @author Nicolas Pope * @see doste::OID * @see doste::Modifiers */ class DVMIMPORT Definition { public: /** Constructor to make a new definition. */ Definition() { m_def = doste::dvm::OID::create(); m_size = 0; }; /** * Constructor to use an existing definition. * @param o The object representing the definition. */ Definition(const doste::dvm::OID &o) : m_def(o) { m_size = (OID)m_def[Size]; }; /** Destructor. */ ~Definition() {}; /** * Used to help construct definitions in C++. Allows you to apply together * OIDs to build up a definition. See example in main class description. * @param o The key or first object to add to the definition. * @return This. */ Definition operator()(const doste::dvm::OID &o); /** * Cast to OID to get definition object. This does not evaluate the * definition. */ operator doste::dvm::OID() const { return m_def; }; /** * Evaluate the definition and return the result. It takes several parameters * to control how the definition should be evaluated or what it should do with * side-effects and dependencies. * @param obj Object to use as 'this' in the definition. * @param key Object to use as '$' in the definition. * @param fdef Is this a function definition. If it is then add dependencies to host definition. * @param agent Is this an agent. If yes then use the agent run queue for all side-effects. * @return The result object for this definition. */ doste::dvm::OID evaluate(const doste::dvm::OID &obj, const doste::dvm::OID &key, bool fdef=false); struct DContext { OID object; OID key; }; private: doste::dvm::OID m_def; int m_size; doste::dvm::OID parseExpression(doste::dvm::Context *ctx, doste::dvm::Buffer *def, int &index); }; }; }; #endif doste-0.3.1/include/doste/dvm/buffer.h0000644000175000001440000001111311056207042014511 00000000000000/* * includes/doste/dvm/buffer.h * * Efficient temporary storage for events that accept or return bulk data. * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _DOSTE_DVM_BUFFER_H_ #define _DOSTE_DVM_BUFFER_H_ #include #include namespace doste { namespace dvm { enum BufferType {B_INT=1, B_CHAR=2, B_OID=3, B_FLOAT=4, B_LONGLONG=5, B_DOUBLE=6}; /** * A temporary object designed for storing integer indexed data. This is generated * by various bulk events and is the most efficient way of communicating bulk * data to the database and vice versa. Typically the sender will create and fill * a buffer object and the receiver will use and then delete it. */ class DVMIMPORT Buffer { Buffer() : m_count(0), m_data(0), m_dofree(false) { //std::cout << "MAKE BUFFER\n"; }; ~Buffer() { //std::cout << "DESTROY BUF\n"; if (m_dofree && m_data != 0) { delete [] m_data; m_data = 0; m_dofree = false; } }; public: /** * Construct a buffer using an array as the data source. It will use the * given pointer without copying the data and so the pointer must remain * valid until the buffer has been used (the event has been processed). * @param buf The array to use as the source. * @param count Number of elements in the char array. * @return Buffer OID. */ static OID create(char *buf, int count); static OID create(int *buf, int count); static OID create(long long *buf, int count); static OID create(float *buf, int count); static OID create(double *buf, int count); static OID create(OID *buf, int count); /** * Create a buffer of the specified type. This allocates the required * memory which will be freed when the buffer is destroyed. * @param t The buffer data type. * @param count Number of elements in the array. * @return Buffer OID. */ static OID create(BufferType t, int count); /** * Allocate a buffer but do not set its data source or allocated any * memory for it yet. * @return Buffer OID. */ static OID create() { return allocate(); }; /** * Get the raw data pointer. */ void *raw() const { return m_data; }; /** * Get the size in bytes of the data array. This is not the number of * elements in the array as they may be more than one byte each. * @see count() * @return Size of data array in bytes. */ int size() const { switch(m_type) { case B_INT: return m_count*sizeof(int); case B_CHAR: return m_count*sizeof(char); case B_OID: return m_count*sizeof(OID); case B_FLOAT: return m_count*sizeof(float); case B_LONGLONG: return m_count*sizeof(long long); case B_DOUBLE: return m_count*sizeof(double); default: return 0; } }; /** * Number of elements in the data array. * @return Number of elements. */ int count() const { return m_count; }; /** * Query the type of the data stored in this buffer object. */ BufferType type() const { return m_type; }; //Conversion methods. void get(int *buf, int count); void get(char *buf, int count); void get(OID *buf, int count); void get(float *buf, int count); OID get(int index) const { return ((OID*)m_data)[index]; }; void set(int *buf, int count); void set(char *buf, int count); void set(OID *buf, int count); void set(float *buf, int count); void seti(int index, const OID &value) { ((OID*)m_data)[index] = value; }; static OID allocate(); static void destroy(const OID &id) { free(id); }; static void free(const OID &id); static Buffer *lookup(const OID &id); private: int m_count; BufferType m_type; char *m_data; bool m_dofree; static const unsigned int MAX_BUFFERS = 50; static Buffer *s_buffers[MAX_BUFFERS]; }; }; }; #endif doste-0.3.1/include/doste/dvm/coid.h0000644000175000001440000000555611026666371014207 00000000000000/* * includes/doste/dvm/coid.h * * OID Compression * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _doste_DVM_COID_H_ #define _doste_DVM_COID_H_ #include namespace doste { namespace dvm { class OID; /** * Compressed OID. OIDs are 128 bit (16 byte) numbers in their fully expanded * state, so the methods in this class can be used to compress and decompress * these OIDs. It does this by replacing common OIDs with some reduced form. * @author Nicolas Pope */ class DVMIMPORT COID { public: /** * Compress an OID into a buffer. The buffer must be at least * 17 bytes big to fit the worst case compression. * @param buf Buffer to write the compressed OID into. * @param o The OID to compress. * @return Number of bytes for compressed OID. */ static int compress(unsigned char *buf, const OID &o); /** * Decompress and OID from a buffer. The buffer must contain * a COID generated from the compress function. * @param buf Compress OID buffer. * @param o The resulting OID is put in here. * @return Number of bytes read from buffer. */ static int decompress(const unsigned char *buf, OID &o); private: static const unsigned char COID_NULL = 0; static const unsigned char COID_THIS = 1; static const unsigned char COID_SPECIAL = 2; static const unsigned char COID_INT = 3; static const unsigned char COID_LONG = 4; static const unsigned char COID_FULL = 5; static const unsigned char COID_INDEX = 6; static const unsigned char COID_CHAR = 7; static const unsigned char COID_CINT = 8; static const unsigned char COID_SINT = 9; static const unsigned char COID_MODIF = 10; static const unsigned char COID_MOD_SET = 11; static const unsigned char COID_MOD_NODEP = 12; static const unsigned char COID_MOD_DEF = 13; static const unsigned char COID_BEGINDEF = 14; static const unsigned char COID_ENDDEF = 15; static const unsigned char COID_BEGINLIST = 16; static const unsigned char COID_ENDLIST = 17; static const unsigned char COID_MOD_SEQ = 18; }; }; }; #endif doste-0.3.1/include/doste/agenthandler.h0000644000175000001440000000402411026667370015124 00000000000000/* * includes/doste/agenthandler.h * * Manages and schedules all agents. * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _doste_AGENTHANDLER_H_ #define _doste_AGENTHANDLER_H_ #include #include #include namespace doste { namespace dvm { class Event; }; class Agent; class XARAIMPORT AgentHandler : public dvm::Handler { public: AgentHandler(); ~AgentHandler(); bool handle(dvm::Event &evt); static int add(Agent *agent, int id, dvm::Definition cond, unsigned int flags); static void update(int aid, Agent *agent, int id, dvm::Definition cond, unsigned int flags); static void remove(int id); static void remove(Agent *agent, int id); static void processAll(); static const unsigned int AE_CONDITIONAL = 0x0001; static const unsigned int AE_IMMEDIATE = 0x0002; private: struct AgentEntry { Agent *agent; int localid; dvm::Definition cond; unsigned int flags; }; static const unsigned int MAX_QUEUE_SIZE = 1000; static Vector s_agents; //Queue of agent notify requests. struct AgentQueue { int put; int get; int q[MAX_QUEUE_SIZE]; }; static AgentQueue s_queues[2]; static int s_curq; }; }; #endif doste-0.3.1/include/doste/dstring.h0000755000175000001440000000402511053077352014141 00000000000000/* * includes/doste/dstring.h * * C++ wrapper for DOSTE strings * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _doste_DSTRING_H_ #define _doste_DSTRING_H_ #include #include #include namespace doste { /** * A class to convert c-strings to doste strings and vice-versa. */ class XARAIMPORT DString { public: DString(); DString(const char *str, bool async=false); DString(dvm::OID o); ~DString(); void toString(char *str, int max); int size() const { return m_obj[dvm::Size]; }; operator dvm::OID() const { return m_obj; }; operator const char*(); template friend DString operator+(DString m, T v) { return m + doste::dvm::OID(v); } XARAIMPORT friend DString operator+(DString m, const char *str); XARAIMPORT friend DString operator+(DString m, const doste::dvm::OID &o); XARAIMPORT friend DString operator+(DString m, const DString &str); //friend bool operator==(const char *str); //friend bool operator==(const DString &str); private: dvm::OID m_obj; char *m_buffer; //static char s_unsafe[1024]; }; typedef DString dstring; namespace dvm { template <> class is_pod : public true_type {}; }; }; #endif doste-0.3.1/include/doste/spinlock.h0000644000175000001440000000650711056505266014320 00000000000000/* * includes/doste/spinlock.h * * A wrapper for pthread_spinlock and own implementation * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* doste * spinlock.h * * Author: Nicolas Pope * Date: 25/7/2007 * * A spin lock which does not yield the CPU, it simply spins. It is MP safe. */ #ifndef _doste_SPINLOCK_H_ #define _doste_SPINLOCK_H_ #ifdef LINUX #include #endif #ifdef _MSC_VER #pragma warning ( disable : 4251 ) #endif namespace doste { /** * A very simple spin lock implementation that does literally * spin. It might be a good idea to send an interrupt when * unlocking to awaken the other processor in a multi-processor * system. To use, simple create it and call wait() and then * free() when finished with a critical section. * @author Nicolas Pope */ class SpinLock { public: SpinLock() #ifdef XARAOS : m_lock(0) #endif { #ifdef LINUX pthread_spin_init(&m_lock, PTHREAD_PROCESS_PRIVATE); #endif } ~SpinLock() { #ifdef LINUX pthread_spin_destroy(&m_lock); #endif } /** * This will stop the processor until the lock has been * released by the other processor. */ void wait() { #ifdef XARAOS asm("push %rbx"); asm("push %rax"); asm("pushf"); asm("cli"); //Cannot have an interrupt stuck on a locked section. while(test() > 0); asm("pop %rbx"); asm("" : "=b" (m_flags)); asm("pop %rax"); asm("pop %rbx"); #endif #ifdef LINUX pthread_spin_lock(&m_lock); #endif } /** * Release the lock, if someone is waiting for it then * they will then be able to proceed. If multiple are * waiting then one will be non-deterministically choosen * to continue. */ void free() { #ifdef XARAOS asm("push %rax"); asm("" : : "a" (m_flags)); asm("push %rax"); asm("popf"); asm("push %rbx"); asm("" : : "a" ((unsigned long long)&m_lock)); asm("mov $0, %ebx"); asm("xchgl %ebx,(%rax)"); asm("pop %rbx"); asm("pop %rax"); #endif #ifdef LINUX pthread_spin_unlock(&m_lock); #endif } private: #ifdef XARAOS int m_lock; unsigned long m_flags; #endif #ifdef LINUX pthread_spinlock_t m_lock; #endif #ifdef XARAOS int test() { int result; //asm("pop %ebx"); //asm("mov %%ebx, %0" : "=b" (m_flags)); //asm("pop %ebx"); //asm("cli"); asm("" : : "a" ((unsigned long)&m_lock)); asm("mov $1, %ebx"); asm("lock\nxchgl %ebx,(%rax)"); //Only one processor can do this at a time. asm("" : "=b" (result)); return result; } #endif }; }; #endif doste-0.3.1/include/doste/object.h0000644000175000001440000002327511137277464013753 00000000000000/* * includes/doste/object.h * * An base class wrapper to map C++ objects to DOSTE objects. * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _doste_OBJECT_H_ #define _doste_OBJECT_H_ #include #include //#include #include #include #include #define OBJECT_BASE(j) static doste::dvm::OID type() { return #j; }; \ static doste::Object* construct(const doste::dvm::OID &o){ return new j( o ); }; \ virtual bool isa(const doste::dvm::OID &t) { if (type() == t) return true; else return false; }; #define OBJECT(k,j) static doste::dvm::OID type() { return #j; }; \ static doste::Object* construct(const doste::dvm::OID &o){ return new j( o ); }; \ virtual bool isa(const doste::dvm::OID &t) { if (type() == t) return true; else return k::isa(t); }; /*void operator delete(void *p) { free(p); } void *operator new(size_t s, bool nop, bool nop2) { return malloc(s); } \ void *operator new(size_t s) { OID b = doste::OID::create(); b.set("type", #j); return Object::convert(b); } \ void *operator new(size_t s, const doste::OID &b) { return Object::convert(b); }*/ #define VOBJECT(k,i) static doste::dvm::OID type() { return #i; }; \ virtual bool isa(const doste::dvm::OID &t) { if (type() == t) return true; else return k::isa(t); } \ //#undef THIS //#define THIS static_cast(*this) #ifdef WIN32 #define PROPERTY_R(T, A) doste::make_pointer< T, doste::dvm::is_pod::value >::type __stdcall A() const { return get_value(#A, doste::dvm::is_pod()); }; #define PROPERTY_RF(T, A, B) doste::make_pointer< T, doste::dvm::is_pod::value >::type __stdcall A() const { return get_value(B, doste::dvm::is_pod()); }; #else #define PROPERTY_R(T, A) doste::make_pointer< T, doste::dvm::is_pod::value >::type A() const { return get_value(#A, doste::dvm::is_pod()); }; #define PROPERTY_RF(T, A, B) doste::make_pointer< T, doste::dvm::is_pod::value >::type A() const { return get_value(B, doste::dvm::is_pod()); }; #endif #define PROPERTY_W(T, A) void A(const doste::make_pointer< T, doste::dvm::is_pod::value >::type &v) { set_value(#A, v, doste::dvm::is_pod()); }; #define PROPERTY_WF(T, A, B) void A(const doste::make_pointer< T, doste::dvm::is_pod::value >::type &v) { set_value(B, v, doste::dvm::is_pod()); }; #define PROPERTY_RW(T, A) PROPERTY_R(T,A); PROPERTY_W(T,A) #define PROPERTY_RWF(T,A,B) PROPERTY_RF(T,A,B); PROPERTY_WF(T,A,B) #define PROPERTY(T,A) PROPERTY_RW(T,A) #define PROPERTY_F(T,A,B) PROPERTY_RWF(T,A,B) namespace doste { /* * Templates to optionally make a type into a pointer at compile time. * Used by PROP_GET and PROP_SET. */ template struct make_pointer { typedef T type; }; template struct make_pointer { typedef T* type; }; /** * A base class that can be inherited by any class that wishes to represent * a type of object stored within the database. It provides a means of * constructing an object automatically from a database object and a means * of easily accessing data in the database.

* Anything that does inherit from the class requires a public OBJECT macro * to be added to the class definition. This takes two arguments, first the * name of the class it inherits from and second its own class name. In * addition to this the constructor must take an OID parameter which is * passed down to Object.

* Before the system can construct objects of your type you must register it * with Object::registerType<T>();

* Generally you would want to inherit Agent instead which provides extra * functionality in the form of event handling. */ class XARAIMPORT Object : public doste::dvm::OID { public: OBJECT_BASE(Object); /** * Make a new object with a new OID. This may be called directly because type * does not matter in this case. Make sure that you set the type attribute in * you top most constructor. */ Object() : OID(OID::create()) { s_map.add(*this, (void*)this); s_list.addFront(this); noremove = false; //std::cout << "MAKING C++ OBJECT: " << d() << "\n"; }; /** * Make an object from an object in the database. This object should be * of the correct type and so it is best if you use the convert() function * instead of directly using this constructor. * @param obj The object id for the database object. */ Object(const doste::dvm::OID &obj) : OID(obj) { s_map.add(*this, (void*)this); s_list.addFront(this); noremove = false; //std::cout << "MAKING C++ OBJECT: " << d() << "\n"; }; virtual ~Object() { if (!noremove) { s_list.removeAll(this); s_map.remove(*this); } }; void setID(const OID &o) { m_a = o.a(); m_b = o.b(); m_c = o.c(); m_d = o.d(); }; /** @return The OID for this C++ object */ operator OID() { return static_cast(*this); }; /** * Get an object pointer for an object contained within this one. * @param k The attribute name where the object is. * @return Pointer to C++ object or null. */ template T *getObject(const OID &k) const { return Object::convert(get(k)); }; /** * Register a C++ class as a valid object type. This allows objects of * this type to be constructed automatically by the convert() function. * The template parameter is your type. */ template inline static void registerType(); /** * Convert a DOSTE OID into a C++ object pointer of the correct type. * If the conversion cannot be performed then NULL is returned and an * error is generated telling you why. * @param o The database object. * @return C++ pointer for object or NULL. */ template inline static T *convert(const OID &o); /** * Delete all C++ objects that have ever been converted. */ static void destroyAll() { //Iterate over map and delete objects. for (doste::List::iterator i=s_list.begin(); i!=s_list.end(); i++) { (*i)->noremove = true; delete *i; } s_list.clear(); s_map.clear(); }; protected: /* * Template selector to choose how a value or object should be * retrieved from the database. Is it a primitive type or an Object? */ template inline T get_value(const OID &k, dvm::true_type) const { return (T)((OID)(*this)[k]); }; template inline T *get_value(const OID &k, dvm::false_type) const { return getObject(k); }; template inline void set_reuse(const OID &k, const T &v, dvm::true_type) { dvm::OID o = get(k); if (o == dvm::Null) { o = dvm::OID::create(); set(k, o); } v.fillObject(o); } template inline void set_reuse(const OID &k, const T &v, dvm::false_type) { set(k,v,false); } template inline void set_value(const OID &k, const T &v, dvm::true_type) { set_reuse(k,v, dvm::is_reuseable()); }; template inline void set_value(const OID &k, const T *v, dvm::false_type) { set(k,*v, false); }; private: bool noremove; static doste::Map s_map; static doste::Map s_reg; static doste::List s_list; }; }; template T *doste::Object::convert(const OID &o) { //not an object if(o==dvm::Null) return 0; //Lookup C++ pointer in map Object *obj = (Object*)(void*)s_map[o]; if (obj != 0) { //Check RTTI for valid type. if (obj->isa(T::type())) return (T*)obj; else { DMsg msg(DMsg::WARNING); msg << o << " is not a " << T::type() << "\n"; return 0; } } else { //Haxy solution to automatically set type on first use. dvm::OID ttype = o.get(dvm::Type); if (ttype == dvm::Null) { o.set(dvm::Type, T::type(), true); ttype = T::type(); } //If not exist then construct as correct object type if (s_reg[ttype] != dvm::Null) { obj = ((Object *(*)(const OID &))(void*)(s_reg[ttype]))(o); //Check RTTI again if (o.get(dvm::Type)==dvm::Null || obj->isa(T::type())) return (T*)obj; else { DMsg msg(DMsg::WARNING); msg << o << " is not a " << T::type() << "\n"; return 0; } } else { //Give a warning about unregistered type if (o.get(dvm::Type) != dvm::Null) { DMsg msg(DMsg::WARNING); msg << "What is a " << ttype << "\n"; } return 0; } } } template void doste::Object::registerType() { s_reg.add(T::type(), (void*)T::construct); } template T *doste::dvm::OID::get(const OID &o) const { return doste::Object::convert(*this); } template void doste::dvm::OID::set(const OID &key, T *value, bool async) const { set(key, *value, async); } namespace doste { namespace dvm { template <> inline void OID::set(const OID &key, void *value, bool async) const { set(key, OID(value), async); } }; }; template T *doste::dvm::OID::get_pointer(false_type) const { return doste::Object::convert(*this); } #endif doste-0.3.1/include/doste/agent.h0000644000175000001440000001316511026667066013576 00000000000000/* * includes/doste/agent.h * * Provides a base class for custom event handling * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 23/11/2007 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _doste_AGENT_H_ #define _doste_AGENT_H_ #include #include #include #include #include #define IMPLEMENT_EVENTS(A,B) template inline void meta_reg_##A(A *o) { \ o->regEvt(); \ meta_reg_##A(o); \ } \ template <> inline void meta_reg_##A(A *o) { \ o->regEvt(); \ } \ template inline void meta_eval_##A(A *o, int aid, int id) { \ if (id == I) { \ o->evalEvt(aid, id); return; \ } \ meta_eval_##A(o,aid, id); \ } \ template <> inline void meta_eval_##A(A *o, int aid, int id) { \ if (id == A::num_evt_last-1) { \ o->evalEvt(aid, id); return; \ } \ } \ bool A::notify(int aid, int id) { \ B::notify(aid, id); \ if (id == -1) meta_reg_##A(this); \ else if (id >= 10000) return A::handler(id-10000); \ else meta_eval_##A(this, aid, id); \ return true; \ } #define BEGIN_EVENTS(A) static const int num_evt_parent = A::num_evt_last; \ template void regEvt() {}; \ template void evalEvt(int aid, int eid) {}; \ virtual bool notify(int aid, int id); \ static const int num_evt_first = __LINE__; #define END_EVENTS static const int num_evt_last = __LINE__ - num_evt_first + num_evt_parent; //evaluate(num_##A); #define EVENT(A,K) void A(); static const int num_##A = __LINE__ - num_evt_first + num_evt_parent; void reg_##A() { doste::AgentHandler::add(this, num_##A, K, 0); } //#define SHARE_EVENT(j,k) { j::evalEvt(obj,key,value); } #define OnEvent(j,i) template <> void j::regEvt() { reg_##i(); } \ template <> void j::evalEvt(int aid, int eid) #define E(A) (A)(doste::dvm::modifiers::Seq) #define DEPENDENCY(A,B) (OID::local() + OID(0,0,15,0)).dependency(A,B,aid); namespace doste { /** * The interface for an agent. An agent is something which observes attributes * in the database and performs various tasks when certain observables change. * You can implement this class to be notifed when particular object attributes * are changed. Also implement it if you wish to simply make changes to the * database as an external source, such as an interrupt handler.

* * To help with the trigger mechanism several macros have been provided. These * allow you to register and respond to events. Here is an example which watches * the cout attribute of the root object:

* * * class ConsoleAgent : public doste::Agent { * public: * ConsoleAgent() { registerEvents(); } * * BEGIN_EVENTS(Agent); * EVENT(evt_cout, doste::root("cout")); * END_EVENTS; * }; * * OnEvent(ConsoleAgent, evt_cout) { * std::cout << (const char*)doste::dstring(value) << "\n"; * } * * IMPLEMENT_EVENTS(ConsoleAgent,Agent); * * * The OnEvent macro must be placed inside the same namespace that the ConsoleAgent * class was declared in. It expands to a function which has three parameters: obj, * key and value, all of which are OIDs. In the above example obj is doste::root, key * is cout and value is whatever was assigned to cout. * @author Nicolas Pope * @see doste::Object * @see doste::OID * @see doste::Definition */ class XARAIMPORT Agent : public Object { public: OBJECT(Object, Agent); /** * Constructor. You should call registerEvents() in your constructor * when inheriting an Agent. */ Agent() {}; Agent(const OID &obj) : Object(obj) {} virtual ~Agent() {}; /** * Implement to be notified of events. You can request to be notified * whenever an attribute within an object is changed. * @param id A number associated with the listen event. * @return Was this event handled by this agent. */ virtual bool notify(int aid, int id) { return false; } virtual bool handler(int id) { return false; } void addEvent(int id, dvm::Definition def) { AgentHandler::add(this, id+10000, def, 0); } /** * Yield your agent thread. This can only be called from within an event. */ static void yield(); //protected: /** * Register all events with database. This must be called to inform the database * that this agent wants to be triggered on certain events. Usually it would be * called in the constructor of your sub class. */ void registerEvents() { notify(0, -1); }; static const int num_evt_last = 0; //OID evaluate(int id); //void reg(int id, Definition def); private: //Agent *next; //OID m_id; //doste::Vector m_defs; //static int s_agentcount; }; }; #endif doste-0.3.1/include/doste/Makefile.am0000644000175000001440000000036711236551172014354 00000000000000pkgincludedir = $(includedir)/doste pkginclude_HEADERS=agent.h agenthandler.h barrier.h dll.h dmsg.h dstring.h file.h list.h map.h mutex.h notation.h object.h spinlock.h stream.h token.h vector.h doste.h messages.h directory.h dasm.h SUBDIRS=dvm doste-0.3.1/include/doste/list.h0000644000175000001440000001517011026670124013436 00000000000000/* * includes/doste/list.h * * A list template that corresponds to but is not the same as the C++ stl list. * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 18/7/2007 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _doste_LIST_H_ #define _doste_LIST_H_ #ifdef _MSC_VER #pragma warning ( disable : 4251 ) #endif namespace doste { /** * A general purpose doubly-linked list template for use in DOSTE. It has some * similarities to the STL list but is not the same. */ template class List { class ListEntry { public: T value; ListEntry *prev; ListEntry *next; }; public: class iterator { public: iterator(ListEntry *position) : m_pos(position) {}; ~iterator() {}; iterator operator++() { ListEntry *temp = m_pos; if (m_pos != 0) m_pos = m_pos->next; return iterator(temp); }; iterator operator++(int) { if (m_pos != 0) m_pos = m_pos->next; return iterator(m_pos); }; T operator*() { return (m_pos != 0) ? m_pos->value : T(); }; bool operator==(const iterator &i) { return i.m_pos == m_pos; }; bool operator!=(const iterator &i) { return i.m_pos != m_pos; }; private: ListEntry *m_pos; }; List() : m_first(0), m_last(0), m_size(0) { }; ~List() { clear(); }; /** * Put an item at the front of the list. * @param value The value to put here. */ void addFront(T value) { ListEntry *entry = new ListEntry(); entry->value = value; entry->next = m_first; entry->prev = 0; if (m_first != 0) { m_first->prev = entry; m_first = entry; } else { m_last = entry; m_first = entry; } ++m_size; }; /** * Put an item at the back of the list. * @param value The value to put there. */ void addBack(T value) { ListEntry *entry = new ListEntry(); entry->value = value; entry->next = 0; entry->prev = m_last; if (m_last != 0) { m_last->next = entry; m_last = entry; } else { m_last = entry; m_first = entry; } ++m_size; }; /** * @return The first item in the list. */ T getFront() const { return m_first; }; /** * @return The last item in the list. */ T getBack() const { return m_last; }; /** * This will remove the first item and return it. The following item * will then become the first item. * @return Original first item. */ T removeFront() { if (m_first != 0) { T temp = m_first->value; m_first = m_first->next; if (m_first != 0) { m_first->prev = 0; } else { m_last = 0; } --m_size; return temp; } //This will not always work. return (T)0; }; /** * This will remove the last item and return it. The previous item will then * become the last item. * @return Original last item. */ T removeBack() { if (m_last != 0) { T temp = m_last->value; m_last = m_last->prev; if (m_last != 0) { m_last->next = 0; } else { m_first = 0; } --m_size; return temp; } //This will not always work. return (T)0; }; /** * Retrieve the item at a specific index. Note that for lists this is slow * as it counts from the front. * @param index The index from 0 to size()-1. * @return The value at that index or corresponding null. */ T get(int index) const { int i=0; ListEntry *current = m_first; while (i < index && current != 0) { current = current->next; ++i; } if (current != 0) return current->value; else return (T)0; }; /** * Makes sure that there is only one of this value in the list. * @param value The value to make unique in this list. */ void unique(T value) { int count = 0; ListEntry *current = m_first; ListEntry *temp; while (current != 0) { if (current->value == value) { ++count; if (count > 1) { if (current->next != 0) { current->next->prev = current->prev; } else { m_last = current->prev; } if (current->prev != 0) { current->prev->next = current->next; } else { m_first = current->next; } temp = current; current = current->next; delete temp; continue; } } current = current->next; } }; /** * Removes all items in the list so that size becomes 0. */ void clear() { ListEntry *current = m_first; ListEntry *temp; while (current != 0) { temp = current; current = current->next; delete temp; } m_size = 0; m_first = 0; m_last = 0; }; /** * @return Number of items in the list. */ int size() const { return m_size; }; /** * Put an item at a specific location, this causes all items above to be * shifted by one index. * @param index Position to index, starts at 0 for front. * @param value Item to put at that position. */ void insert(int index, T value) { int i=0; ListEntry *current = m_first; while (i < index && current != 0) { current = current->next; ++i; } if (current == 0) return; //TODO }; //void remove(T index); iterator erase(iterator pos); void removeAll(T value) { ListEntry *current = m_first; ListEntry *temp; while (current != 0) { if (current->value == value) { if (current->next != 0) { current->next->prev = current->prev; } else { m_last = current->prev; } if (current->prev != 0) { current->prev->next = current->next; } else { m_first = current->next; } temp = current; current = current->next; delete temp; } else { current = current->next; } } }; int find(T) const; bool contains(T) const; void replace(int index, T); iterator begin() const { return iterator(m_first); }; iterator end() const { return iterator(0); }; private: ListEntry *m_first; ListEntry *m_last; int m_size; }; }; #endif doste-0.3.1/include/doste/dasm.h0000644000175000001440000000323711056505266013417 00000000000000/* * src/dasm.h * * The DOSTE notation parser. * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _doste_DASM_H_ #define _doste_DASM_H_ #include #ifdef _MSC_VER #pragma warning ( disable : 4996 ) #endif namespace doste { class DASM : public Notation { public: OBJECT(Notation, DASM); DASM(); DASM(const OID &obj); ~DASM(); bool statement(const dvm::OID &); PROPERTY_RF(dvm::OID, variables, "variables"); PROPERTY_WF(dvm::OID, variables, "variables"); void error(const char *message); private: bool parseObject(OID &cur); bool parseSubExpr(OID &cur); bool parseDefinition(OID &cur, int &i, bool real, bool ncontext=false); bool parseString(OID &cur); bool parseIf(int &i, OID &cur, bool imed=false); bool parseSelect(int &i, OID &cur, bool imed=false); //current base object dvm::OID m_base; }; }; #endif doste-0.3.1/include/doste/barrier.h0000644000175000001440000000000211006562756014106 00000000000000 doste-0.3.1/include/doste/Makefile.in0000644000175000001440000003620711265574062014374 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 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@ pkglibdir = $(libdir)/@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/doste DIST_COMMON = $(pkginclude_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 = depcomp = am__depfiles_maybe = 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 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(pkgincludedir)" pkgincludeHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(pkginclude_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkgincludedir = $(includedir)/doste ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__leading_dot = @am__leading_dot@ 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_builddir = @top_builddir@ top_srcdir = @top_srcdir@ pkginclude_HEADERS = agent.h agenthandler.h barrier.h dll.h dmsg.h dstring.h file.h list.h map.h mutex.h notation.h object.h spinlock.h stream.h token.h vector.h doste.h messages.h directory.h dasm.h SUBDIRS = dvm 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 \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps include/doste/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu --ignore-deps include/doste/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 install-pkgincludeHEADERS: $(pkginclude_HEADERS) @$(NORMAL_INSTALL) test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" @list='$(pkginclude_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(pkgincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgincludedir)/$$f'"; \ $(pkgincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgincludedir)/$$f"; \ done uninstall-pkgincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(pkginclude_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(pkgincludedir)/$$f'"; \ rm -f "$(DESTDIR)$(pkgincludedir)/$$f"; \ done # 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): @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; \ (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): @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; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (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; nonemtpy = 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) tags=; \ 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 || \ tags="$$tags $$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; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ 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)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @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 $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(HEADERS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(pkgincludedir)"; 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) 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 mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-pkgincludeHEADERS install-dvi: install-dvi-recursive install-exec-am: install-html: install-html-recursive install-info: install-info-recursive install-man: install-pdf: install-pdf-recursive install-ps: install-ps-recursive 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 pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-pkgincludeHEADERS .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic ctags \ ctags-recursive distclean distclean-generic 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-pkgincludeHEADERS \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ 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: doste-0.3.1/include/doste/directory.h0000644000175000001440000000137311053100431014454 00000000000000//Get the files contained in a directory #ifndef _DOSTE_DIRECTORY_H_ #define _DOSTE_DIRECTORY_H_ #include #include #include #undef MAX_PATH //damn windows #define MAX_PATH 400 #define MAX_ENTRIES 100 namespace doste { struct DirEntry { bool available; dstring name; char path[MAX_PATH]; dvm::OID entries[MAX_ENTRIES]; int size; }; class Directory : public dvm::Handler { public: Directory(); ~Directory(); bool handle(dvm::Event &evt); private: Vector m_dirs; void search(DirEntry *ent); dvm::OID addDirectory(const char *, const char *); dvm::OID addFile(const char *, const char *); dvm::OID lookupEntry(int id, const dvm::OID &entry); }; }; #endif doste-0.3.1/include/doste/mutex.h0000644000175000001440000000316411026670433013630 00000000000000/* * includes/doste/mutex.h * * An wrapper for pthread_mutex * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _doste_MUTEX_H_ #define _doste_MUTEX_H_ #ifdef LINUX #include #endif #include namespace doste { /** * A locking mutex class. Used to create non-trivial critical sections. * Use a spinlock instead for trivial one or two line locks. * @author Nicolas Pope */ class XARAIMPORT Mutex { public: Mutex() { #ifdef LINUX pthread_mutex_init(&m_mutex, 0); #endif } ~Mutex() { #ifdef LINUX pthread_mutex_destroy(&m_mutex); #endif } void lock() { #ifdef LINUX pthread_mutex_lock(&m_mutex); #endif } void unlock() { #ifdef LINUX pthread_mutex_unlock(&m_mutex); #endif } private: #ifdef LINUX pthread_mutex_t m_mutex; #endif }; }; #endif doste-0.3.1/include/doste/dmsg.h0000644000175000001440000000360411026667450013424 00000000000000/* * includes/doste/dmsg.h * * Deprecated. * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _doste_DMSG_H_ #define _doste_DMSG_H_ #include #include #undef ERROR namespace doste { /** * DOSTE Message Class. Used throughout DOSTE as a simple way to output * information, errors and warnings to the console using colours. This * will be changed or replaced with a better system soon. * @author Nicolas Pope */ class XARAIMPORT DMsg { public: DMsg() : m_type(INFO) {}; DMsg(unsigned int type) : m_type(type) { }; ~DMsg() {}; typedef unsigned int MsgFormatter; friend XARAIMPORT DMsg &operator<<(DMsg &m, const char *str); friend XARAIMPORT DMsg &operator<<(DMsg &m, const dvm::OID &o); friend XARAIMPORT DMsg &operator<<(DMsg &m, int v); friend XARAIMPORT DMsg &operator<<(DMsg &m, DMsg::MsgFormatter f); static const MsgFormatter WARNING=1; static const MsgFormatter ERROR=2; static const MsgFormatter INFO=0; static const MsgFormatter DEBUG=3; static const MsgFormatter FATAL=4; private: unsigned int m_type; }; }; #endif doste-0.3.1/include/doste/doste.h0000644000175000001440000000375511053264037013611 00000000000000/* * includes/doste/doste.h * * Global common doste header. * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _doste_H_ #define _doste_H_ #include #include #include /** * All doste components are within the doste namespace. Before using * doste you must call doste::initialise() and when finished call * doste::finalise(). * @author Nicolas Pope */ namespace doste { extern XARAIMPORT void initialise(int argc, char *argv[]); extern XARAIMPORT void finalise(); extern XARAIMPORT void update(); extern XARAIMPORT void run(); class XAgent : public Agent { public: XAgent(const OID &obj) : Agent(obj) { registerEvents(); }; ~XAgent() {}; BEGIN_EVENTS(Agent); EVENT(evt_softagent, (*this)("agents")(doste::dvm::All)); EVENT(evt_notation, (*this)("notations")(doste::dvm::All)); EVENT(evt_modules, (*this)("modules")(doste::dvm::All)); EVENT(evt_cout, (*this)("cout")); EVENT(evt_error, (*this)("error")); EVENT(evt_warning, (*this)("warning")); EVENT(evt_debug, (*this)("debug")); EVENT(evt_info, (*this)("info")); //Notation event END_EVENTS; }; }; #endif doste-0.3.1/include/doste/vector.h0000644000175000001440000001247411026672735014003 00000000000000/* * includes/doste/vector.h * * A generic dynamic array. * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _doste_VECTOR_H_ #define _doste_VECTOR_H_ #include #include namespace doste { /** * Implements a classic vector data structure. It is a dynamically resizeable array. * @author Nicolas Pope */ template class XARAIMPORT Vector { public: /** * Constructor. * @param cap Initial capacity, defaults to 120 * @param inc Increment amount when space runs out. */ Vector(int cap=120, int inc=30) : m_cap(cap), m_size(0), m_inc(inc) { m_array = new T[m_cap]; }; /** Destructor */ ~Vector() { delete [] m_array; }; /** * Clear and delete the array. Remember that it does not delete the elements if * they are points, you must do this first. */ void clear() { delete [] m_array; //Might want to reset cap. m_size = 0; m_array = new T[m_cap]; } /** * Add a single element to the end of the array. It will automatically resize * the array if needed. * @param element The element to add. */ void add(T element) { if (m_size < m_cap) { m_array[m_size++] = element; } else { resize(increment()); m_array[m_size++] = element; } }; /** * Remove a specific element and return it. This will move all other elements * above it down by one but will not shrink the array. * @param index Index, starting from 0, of the element to remove. * @return The element at this index before removing. */ T remove(int index) { if (index < 0 || index >= m_size) return T(); //Move everything above this point down one for (int i=index; i= 0 && index < m_size) ? m_array[index] : T(); }; /** Same as get() */ T operator[](int index) { return (index >= 0 && index < m_size) ? m_array[index] : T(); }; /** * Change the value at a particular index. If the index is beyond the end of * the current capacity then the capacity will be increased. * @param index The index. * @param value The element to add to this index. */ void set(int index, T value) { if (index < 0) return; if (index >= m_size) { m_size = index+1; if (m_cap < m_size) resize((m_size-m_cap) + m_inc); } m_array[index] = value; }; /** @return Pointer to internal array. */ T *data() { return m_array; }; /** * C++ style iterator. */ class iterator { public: iterator(int position, T *array) : m_pos(position), m_array(array) {}; ~iterator() {}; iterator operator++() { m_pos++; return *this; }; iterator operator++(int) { ++m_pos; return *this; }; T operator*() { return m_array[m_pos]; }; bool operator==(const iterator &i) { return i.m_pos == m_pos; }; bool operator!=(const iterator &i) { return i.m_pos != m_pos; }; private: int m_pos; T *m_array; }; /** @return A new iterator starting at the beginning of the vector. */ iterator begin() const { return iterator(0, m_array); }; /** @return An iterator corresponding to the end of the vector. */ iterator end() const { return iterator(m_size, m_array); }; private: T *m_array; int m_cap; int m_size; int m_inc; }; }; #endif doste-0.3.1/include/doste/dll.h0000644000175000001440000000245111026667424013245 00000000000000/* * includes/doste/dll.h.h * * Windows dllimport and dllexport definitions * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef WIN32 #if BUILD_XARA_DLL # define XARAIMPORT __declspec (dllexport) #else /* Not BUILDING_DLL */ # define XARAIMPORT __declspec (dllimport) #endif /* Not BUILDING_DLL */ #if BUILD_DVM_DLL # define DVMIMPORT __declspec (dllexport) #else /* Not BUILDING_DLL */ # define DVMIMPORT __declspec (dllimport) #endif /* Not BUILDING_DLL */ #else #define XARAIMPORT #define DVMIMPORT #endif doste-0.3.1/include/doste/stream.h0000644000175000001440000001113311026671025013752 00000000000000/* * includes/doste/stream.h * * Base class for any kind of stream. Used for parsing and file loading. * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _doste_STREAM_H_ #define _doste_STREAM_H_ #include namespace doste { /** * Generic stream class. This is similar to iostream in the C++ * library and is used to remove the difference from a string, * a local file and remote files etc. It also allows the token * parsers to work with any data source. * @author Nicolas Pope * @see File * @see LocalFile * @see StringStream * @see token */ class XARAIMPORT Stream { public: virtual ~Stream() {} enum Seek {BEG, CUR, END}; /** * Read a number of bytes from this stream into a buffer. * @param buf An array to read the bytes into. * @param count Number of bytes to read. * @return Number of bytes actually read. */ virtual int read(char *buf, int count) { return 0; }; /** * Write a number of bytes into this stream from a buffer. * @param buf The source array. * @param count Number of bytes to write. * @return Number of bytes actually written. */ virtual int write(const char *buf, int count) { return 0; }; /** * Move to a new position within the stream. * @param pos New position. * @param d If BEG then position if from beginning of stream. If CUR then position is added to current location. If END then position is from the end of the stream. */ virtual void seek(int pos, Seek d=CUR)=0; /** * Look at the next character but do not change position in the stream. * @param n Look at the nth character from the current position. * @return The character or 0. */ virtual char peek(int n=0)=0; /** @return The current stream position. */ virtual int tell()=0; /** @return True if the end of the stream has been reached. */ virtual bool eof()=0; /** @return The total size of the stream if known, otherwise -1. */ virtual int size()=0; //Put stream operators here. /** * Read a single element of type T.
* e.g. char a = file->read(); * @return The value read. */ template T read() { T buf; read((char*)&buf, sizeof(T)); return buf; } /** * Read a single element of type T into the specified buffer.
* e.g. char a;
file->read(a);
* @param buf An object to read into. */ template void read(T &buf) { read((char*)&buf, sizeof(T)); } /** * Parse a specified token from the stream. See the token namespace for * available token types. This can be used for parsing text files and is * used for the DASM notation.
* If you need to key a resulting value (e.g. when parsing an integer) then * use parse value instead. If the token fails to parse it does not modify the * position of the stream. * @param t The token object, passed by value. * @return True if this token was parsed. */ template bool parse(T t) { return t.parse(*this); } /** * Similar to parse() except that the token is passed by reference. This * enables you to get values back from the token if it was parsed. * @param t The token to parse * @return True if the token was parsed. */ template bool parseValue(T &t) { return t.parse(*this); } }; /** * Implements the Stream class so that character arrays can be used * as a data source instead of a file. * @author Nicolas Pope */ class XARAIMPORT StringStream : public Stream { public: StringStream() : m_s(0), m_pos(0) {} StringStream(const char *s); ~StringStream() {}; int read(char *buf, int count); void seek(int pos, Seek d); char peek(int n); int tell(); bool eof(); int size(); const char *data() const { return m_s; } private: const char *m_s; int m_pos; int m_size; }; }; #endif doste-0.3.1/include/doste/notation.h0000644000175000001440000000443511155243111014313 00000000000000/* * includes/doste/notation.h * * Base class for custom notations * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _doste_NOTATION_H_ #define _doste_NOTATION_H_ #include #include #include #include namespace doste { class XARAIMPORT Notation : public Agent { public: OBJECT(Agent, Notation); Notation() { registerEvents(); }; Notation(const OID &obj) : Agent(obj) { registerEvents(); }; virtual ~Notation() {}; Stream *stream; virtual bool statement(const dvm::OID &) { return false; }; //Implement this are the first parse point. OID run(const char *filename, const OID &base); OID execute(const char *str, const OID &base); OID execute(Stream *s, const OID &base); const OID &result() const { return m_result; }; //Events to trigger on execute and run BEGIN_EVENTS(Agent); EVENT(evt_run, (*this)("run")); EVENT(evt_execute, (*this)("execute")); END_EVENTS; protected: template bool parse(T tok) { return tok.parse(*stream); }; template bool parseValue(T &tok) { return tok.parse(*stream); }; protected: OID m_result; int m_lines; }; }; /** Macro to write dasm code in c++ */ #include #define _DASM(A) ((doste::Notation*)(doste::dvm::root.get("notations").get("dasm")))->execute(#A, *this) #define _DASM2(A) ((doste::Notation*)(doste::dvm::root.get("notations").get("dasm")))->execute(#A, doste::dvm::root) #endif doste-0.3.1/include/doste/map.h0000644000175000001440000000630311052555216013241 00000000000000/* * includes/doste/map.h * * Map an OID to an OID * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _doste_MAP_H_ #define _doste_MAP_H_ #include #include namespace doste { class MapPair { public: MapPair() {}; MapPair(const dvm::OID &k, const dvm::OID &v) : key(k), value(v) {}; dvm::OID key; dvm::OID value; }; /** * Maps and OID to another OID. Not a general template class. * @author Nicolas Pope */ class XARAIMPORT Map { public: Map() {}; ~Map() {}; static const unsigned int MAP_SIZE = 1000; dvm::OID operator[](const dvm::OID &o) { int hash = hashOID(o); for (int i=0; i *table, doste::Vector::iterator it) : m_pos(position), m_it(it), m_table(table) { }; ~iterator() {}; iterator operator++() { if (m_it != m_table[m_pos].end()) { m_it++; } else { m_pos++; m_it = m_table[m_pos].begin(); } return *this; }; iterator operator++(int) { if (m_it != m_table[m_pos].end()) { m_it++; } else { m_pos++; m_it = m_table[m_pos].begin(); } return *this; }; MapPair operator*() { return *m_it; }; bool operator==(const iterator &i) { return (i.m_pos == m_pos) && (m_it == i.m_it); }; bool operator!=(const iterator &i) { return (i.m_pos != m_pos) || (m_it != i.m_it); }; private: int m_pos; doste::Vector::iterator m_it; const doste::Vector *m_table; }; iterator begin() const { return iterator(0, m_table, m_table[0].begin()); }; iterator end() const { return iterator(MAP_SIZE-1, m_table, m_table[MAP_SIZE-1].end()); }; private: int hashOID(const dvm::OID &o) { return o.d() % MAP_SIZE; }; doste::Vector< MapPair > m_table[MAP_SIZE]; }; }; #endif doste-0.3.1/include/doste/token.h0000644000175000001440000002271611056467656013630 00000000000000/* * includes/doste/token.h * * Generic tokens for token parsing scripts. * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _doste_TOKEN_H_ #define _doste_TOKEN_H_ #include #include namespace doste { /** * A collection of tokens for parsing text files. These are used in conjunction * with the Stream class which can be a file. If a token fails to parse then it * returns false and does not modify the stream position. */ namespace token { /** * Removes any white space from the stream. This includes spaces, tabs and new line characters. */ struct WhiteSpace { bool parse(Stream &s) const { count = 0; while (!s.eof() && (s.peek() == ' ' || s.peek() == '\t' || s.peek() == '\n' || s.peek() == '\r')) { if (s.peek() == '\n') count++; s.seek(1); } return true; }; mutable int count; }; /** * Parses a specific sequence of characters */ template struct Char { Char(const char *c) : m_c(c) {}; bool parse(Stream &s) const { for (int i=0; i struct Char<1> { Char(char c) : m_c(c) {}; bool parse(Stream &s) const { if (s.peek() == m_c) { s.seek(1); return true; } else { return false; } }; private: char m_c; }; /** * Reads any single character from the stream. Use the value property to access the character read. */ struct AnyChar { bool parse(Stream &s) const { if (s.eof()) return false; value = s.read(); return true; }; mutable char value; }; /** * Parse a specified keyword from the input. */ struct Keyword { Keyword(const char *c) : m_c(c) {}; bool parse(Stream &s) const { int i=0; int p = s.tell(); while (m_c[i] != 0) { if (s.read() != m_c[i]) { s.seek(p, Stream::BEG); return false; } i++; } char next = s.peek(); if ((next >= 'a' && next <= 'z') || (next >= 'A' && next <='Z') || (next >= '0' && next <= '9') || next == '_') { s.seek(p, Stream::BEG); return false; } //s.seek(i); return true; }; private: const char *m_c; }; /** * Read any alpha-numeric string. It will parse a-z, A-Z, 0-9 and _ but will * stop on anything else. Returns false only if no string exists. The value read * can be accessed in the value property. */ struct AlphaNumeric { AlphaNumeric() : value(0) {}; ~AlphaNumeric() { if (value != 0) delete [] value; }; bool parse(Stream &s) const { int i=0; while (true) { //if (s.eof()) break; char c = s.peek(i); if ( !( (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || (c == '_')) ) break; i++; } //s.seek(p, Stream::BEG); if (i == 0) return false; if (value != 0) delete [] value; value = new char[i+1]; for (int j=0; j(); value[i] = 0; return true; }; mutable char *value; }; /** * Same as AlphaNumeric except it includes the characters % . ? @. */ struct AlphaNumericX { AlphaNumericX() : value(0) {}; ~AlphaNumericX() { if (value != 0) delete [] value; }; bool parse(Stream &s) const { int i=0; while (true) { //if (s.eof()) break; char c = s.peek(i); if ( !( (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || (c == '_') || (c == '%') || (c == '.') || (c == '?') || (c == '@')) ) break; i++; } //s.seek(p, Stream::BEG); if (i == 0) return false; if (value != 0) delete [] value; value = new char[i+1]; for (int j=0; j(); value[i] = 0; return true; }; mutable char *value; }; /** * Parse a floating point number from a string. Use the value property to get the number parsed. */ struct Float { bool parse(Stream &s) const { char temp[20]; int i=0; //Allow for negative. if (!s.eof() && s.peek(i) == '-') { temp[i] = s.peek(i); i++; } if (s.eof() || s.peek(i) < '0' || s.peek(i) > '9') return false; //Read integer part while (!s.eof() && (s.peek(i) >= '0' && s.peek(i) <= '9')) { temp[i] = s.peek(i); i++; } //Read decimal if (!s.eof() && s.peek(i) != '.') return false; temp[i] = s.peek(i); i++; if (s.eof() || s.peek(i) < '0' || s.peek(i) > '9') return false; while (!s.eof() && (s.peek(i) >= '0' && s.peek(i) <= '9')) { temp[i] = s.peek(i); i++; } s.seek(i); temp[i] = 0; value = (float)atof(temp); return true; }; mutable float value; }; /** * Read an integer from the stream. You can specify the base as a template parameter. Valid bases include 2,10 and 16. * The value can be accessed in the value property. */ template struct Integer { bool parse(Stream &s) const { //An invalid integer base. return false; } }; template <> struct Integer<10> { bool parse(Stream &s) const { //Need to allow for negative bool negative = false; if ((s.peek() == '-')) { negative = true; s.seek(1); } if (s.peek() < '0' || s.peek() > '9') { if (negative) s.seek(-1); return false; } value = s.read() - '0'; int factor = 10; while (s.peek() >= '0' && s.peek() <= '9') { value = value * factor; value += s.read() - (int)'0'; } if (negative) value = -value; return true; } mutable long long value; }; template <> struct Integer<2> { bool parse(Stream &s) const { if (s.peek() != '1') return false; s.seek(1); value = 1; while (s.peek() == '0' || s.peek() == '1') { value = value << 1; value += s.read() - (int)'0'; } return true; } mutable long long value; }; template <> struct Integer<16> { bool parse(Stream &s) const { value = 0; int i = 0; while ((s.peek() >= '0' && s.peek() <= '9') || (s.peek() >= 'A' && s.peek() <= 'F') || (s.peek() >= 'a' && s.peek() <= 'f')) { i++; value = value << 4; switch(s.read()) { case '0': break; case '1': value += 1; break; case '2': value += 2; break; case '3': value += 3; break; case '4': value += 4; break; case '5': value += 5; break; case '6': value += 6; break; case '7': value += 7; break; case '8': value += 8; break; case '9': value += 9; break; case 'a': case 'A': value += 10; break; case 'b': case 'B': value += 11; break; case 'c': case 'C': value += 12; break; case 'd': case 'D': value += 13; break; case 'e': case 'E': value += 14; break; case 'f': case 'F': value += 15; break; default: break; } } if (i == 0) return false; return true; } mutable long long value; }; /** * Read a block of text until a specified character is reached. If two characters are * given then the first character must be matched first. An example usage would be to parse * a string in quotes. */ template struct Block { Block(char b) : m_a(0), m_b(b) {}; Block(char a, char b) : m_a(a), m_b(b) {}; bool parse(Stream &s) const { if (((s.peek() == m_a) || (m_a == 0)) && !s.eof()) { if (m_a != 0) s.seek(1); int i=0; while (!s.eof() && s.peek() != m_b) { value[i++] = s.read(); } s.seek(1); value[i] = 0; return true; } else { return false; } }; mutable char value[500]; private: char m_a; char m_b; }; template <> struct Block<1> { Block(char a, char b) : m_a(a), m_b(b) {}; bool parse(Stream &s) const { if (s.peek() == m_a) { value = s.peek(1); if (s.peek(2) == m_b) { s.seek(3); return true; } else { return false; } } else { return false; } }; mutable char value; private: char m_a; char m_b; }; template <> struct Block<2> { Block(char a, char b) : m_a(a), m_b(b) {}; bool parse(Stream &s) const { if (s.peek() == m_a) { value[0] = s.peek(1); value[1] = s.peek(2); if (s.peek(3) == m_b) { s.seek(4); return true; } else { return false; } } else { return false; } }; mutable char value[2]; private: char m_a; char m_b; }; }; }; #endif doste-0.3.1/include/Makefile.am0000644000175000001440000000001611026665105013224 00000000000000SUBDIRS=doste doste-0.3.1/include/Makefile.in0000644000175000001440000003325711265574062013260 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 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@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@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 = $(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 = depcomp = am__depfiles_maybe = 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 ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__leading_dot = @am__leading_dot@ 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_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = doste 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 \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps include/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu --ignore-deps 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 # 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): @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; \ (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): @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; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (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; nonemtpy = 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) tags=; \ 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 || \ tags="$$tags $$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; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ 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)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @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 $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ 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) 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 mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-exec-am: install-html: install-html-recursive install-info: install-info-recursive install-man: install-pdf: install-pdf-recursive install-ps: install-ps-recursive 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 pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic ctags \ ctags-recursive distclean distclean-generic 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 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: doste-0.3.1/INSTALL0000644000175000001440000002243210750154243010603 00000000000000Installation Instructions Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free Software Foundation, Inc. This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Basic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. (Caching is disabled by default to prevent problems with accidental use of stale cache files.) If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You only need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not support the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Here is a another example: /bin/bash ./configure CONFIG_SHELL=/bin/bash Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent configuration-related scripts to be executed by `/bin/bash'. `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of the options to `configure', and exit. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. doste-0.3.1/missing0000755000175000001440000002453310750154243011155 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2004-09-07.08 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004 # 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, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Send bug reports to ." exit 0 ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit 0 ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). case "$1" in lex|yacc) # Not GNU programs, they don't have --version. ;; tar) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case "$1" in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` fi if [ -f "$file" ]; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi touch $file ;; tar) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case "$firstarg" in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case "$firstarg" in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: doste-0.3.1/src/0000777000175000001440000000000011265574152010431 500000000000000doste-0.3.1/src/dvm/0000777000175000001440000000000011265574152011217 500000000000000doste-0.3.1/src/dvm/definition.cpp0000644000175000001440000001524711056461160013770 00000000000000/* * src/dvm/definition.cpp * * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include //#include #include #include "context.h" using namespace doste; using namespace doste::dvm; Definition Definition::operator()(const OID &o) { //Get the current size and append this object //This is an unsafe GET. m_def.set(m_size++, o, true); //Save the new size m_def.set(Size, m_size, true); //Otherwise the GET size on the next call is wrong. //Processor::processAll(); return *this; } #include OID Definition::parseExpression(Context *ctx, Buffer *def, int &index) { OID res = def->get(index++); OID temp, temp2; int modi; bool nodep = false; Event *evt2; Event *evt = new Event(Event::GET, Null); if (res == modifiers::Create) res = OID::create(); else if (res == modifiers::BeginSub) res = parseExpression(ctx,def,index); while (index < m_size) { temp = def->get(index); if (res == This) res = ctx->object(); else if (res == Key) res = ctx->key(); if (temp == modifiers::BeginSub) temp = parseExpression(ctx,def,++index); if (temp.isModifier()) { modi = temp.d(); switch (modi) { case modifiers::ENDSUB: //index++; if (res == This) res = ctx->object(); else if (res == Key) res = ctx->key(); delete evt; return res; case modifiers::SET: temp = def->get(++index); if (temp == modifiers::BeginSub) temp = parseExpression(ctx,def,index); temp2 = def->get(++index); if (temp2 == modifiers::BeginSub) temp2 = parseExpression(ctx,def,index); evt2 = new Event(Event::SET, res); evt2->param<0>(temp); //Get key from definition evt2->param<1>(temp2); //Get value from definition evt2->send(Event::FLAG_FREE); break; case modifiers::DEFINE: temp = def->get(++index); if (temp == modifiers::BeginSub) temp = parseExpression(ctx,def,index); temp2 = def->get(++index); if (temp2 == modifiers::BeginSub) temp2 = parseExpression(ctx,def,index); evt2 = new Event(Event::DEFINE, res); evt2->param<0>(temp); //Get key from definition evt2->param<1>(temp2); //Get definition object from definition evt2->param<2>(Null); evt2->send(Event::FLAG_FREE); break; case modifiers::DEFINEFUNC: temp = def->get(++index); if (temp == modifiers::BeginSub) temp = parseExpression(ctx,def,index); temp2 = def->get(++index); if (temp2 == modifiers::BeginSub) temp2 = parseExpression(ctx,def,index); evt2 = new Event(Event::DEFINE_FUNC, res); evt2->param<0>(temp); //Get key from definition evt2->param<1>(temp2); //Get function definition from definition evt2->send(Event::FLAG_FREE); break; //case modifiers::CREATE: // res = OID::create(); // break; case modifiers::UNION: temp = def->get(++index); if (temp == modifiers::BeginSub) temp = parseExpression(ctx,def,index); temp.copy(res); break; case modifiers::GETDEF: evt->type(Event::GETDEF); evt->dest(res); evt->param<0>(temp); evt->send(); res = evt->result(); break; case modifiers::GETFLAGS: evt->type(Event::GETFLAGS); evt->dest(res); evt->param<0>(temp); evt->send(); res = evt->result(); break; case modifiers::SEQ: //Replace current object with next object in definition res = def->get(++index); if (res == modifiers::BeginSub) res = parseExpression(ctx,def,index); break; case modifiers::NODEP: //Toggle the nodep to add or not add dependencies automatically nodep = !nodep; break; case modifiers::COMPARE: //Compare the current object with the next and put boolean //result as the current object. temp = def->get(++index); if (temp == modifiers::BeginSub) temp = parseExpression(ctx,def,index); res = (res == temp); break; default: break; } } else { evt->type(Event::GET); evt->dest(res); evt->param<0>(temp); evt->send(); res = evt->result(); //Should a dependency be added. if (!nodep) { evt2 = new Event(Event::ADDDEP, evt->dest()); evt2->param<0>(temp); evt2->param<1>(ctx->object()); evt2->param<2>(ctx->key()); evt2->send(Event::FLAG_FREE); } } //Move to next element in the definition. index++; } delete evt; if (res == This) res = ctx->object(); else if (res == Key) res = ctx->key(); return res; } OID Definition::evaluate(const OID &obj, const OID &key, bool fdef) { //Need to know the current processor. Processor *cproc; cproc = Processor::getThisProcessor(); Context *context, *oldctx; if (fdef && cproc->context() != 0) { context = cproc->context(); if (context == 0) { Warning(0, "An invalid context was found inside a definition"); return Null; } } else { oldctx = cproc->context(); context = new Context(*this, obj, key); cproc->context(context); //context->newVO(); } //OID skey; //OID sobject; //bool restore_context = false; Event *evt2 = new Event(Event::GET_RANGE, m_def); evt2->param<0>(0); evt2->param<1>(m_size); evt2->send(); OID boid = evt2->result(); Buffer *def = Buffer::lookup(boid); delete evt2; if (def == 0) { //Error(0, "An invalid definition was found, could not evaluate"); return Null; } //Get the first object and use as initial base. int i=0; OID res; // = def->get(0); //Do we need to save the context //if (res != modifiers::NoContext) { //skey = context->selfKey(); //sobject = context->selfObject(); //context->selfKey(key); //context->selfObject(obj); //restore_context = true; //} else { // res = def->get(++i); //} res = parseExpression(context, def, i); //if (restore_context) { // context->selfObject(sobject); // context->selfKey(skey); //} if (!fdef) { cproc->context(oldctx); delete context; } Buffer::free(boid); return res; } doste-0.3.1/src/dvm/names.cpp0000644000175000001440000000755211137277464012757 00000000000000/* * src/dvm/names.cpp * * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "names.h" #include #include #include #include "../softagent.h" using namespace doste; using namespace doste::dvm; #ifdef _MSC_VER #pragma warning(disable:4996) #endif Mutex name_lock; #undef This Names::Names() { //m_hash = new NameEntry*[NAME_HASH_SIZE]; for (unsigned int i=0; i", Greater); add("&", And); add("|", Or); add("add", Add); add("sub", Subtract); add("div", Divide); add("less", Less); add("greater", Greater); add("mul", Multiply); add("_clone", _clone); //add("clone", _clone); add("_keys", _keys); //Also add the modifiers. add("SET", modifiers::Set); add("DEFINE", modifiers::Define); add("FUNC", modifiers::DefineFunc); add("CREATE", modifiers::Create); add("new", modifiers::Create); //add("ADDDEP", Modifiers::AddDep); add("SEQ", modifiers::Seq); //add("RETURN", Modifiers::Return); add("union", modifiers::Union); add("GETDEF", modifiers::GetDef); add("GETFLAGS", modifiers::GetFlags); add("compare", modifiers::Compare); //SoftAgent labels add("SSET", SoftAgent::SSET); add("ASET", SoftAgent::ASET); add("SDEF", SoftAgent::SDEF); add("ADEF", SoftAgent::ADEF); add("SGET", SoftAgent::SGET); add("CREA", SoftAgent::CREA); add("ISET", SoftAgent::ISET); add("SFUN", SoftAgent::SFUN); add("AFUN", SoftAgent::AFUN); //... } Names::~Names() { //Delete all name entries. for (unsigned int i=0; inext; delete cur; cur = next; } } } OID Names::lookup(const char *n) { int hash = hashString(n); name_lock.lock(); NameEntry *cur = m_hash[hash]; while (cur != 0) { if (strcmp(cur->name, n) == 0) { name_lock.unlock(); return cur->id; } cur = cur->next; } NameEntry *newname = new NameEntry; strcpy(newname->name, n); newname->next = m_hash[hash]; newname->id = OID(0,5,0,m_lastname++); m_hash[hash] = newname; name_lock.unlock(); return newname->id; } //#include void Names::add(const char *n, const OID &o) { int hash = hashString(n); NameEntry *newname = new NameEntry; strcpy(newname->name, n); name_lock.lock(); newname->next = m_hash[hash]; newname->id = o; m_hash[hash] = newname; name_lock.unlock(); } const char *Names::lookup(const OID &o) { if (o == Null) return "null"; NameEntry *cur; name_lock.lock(); for (unsigned int i=0; iid == o) { name_lock.unlock(); return cur->name; } cur = cur->next; } } name_lock.unlock(); return 0; } doste-0.3.1/src/dvm/dvm.cpp0000644000175000001440000000714411052546675012436 00000000000000/* * src/dvm/doste.cpp * * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include //#include //#include #include #include #include #include //#include //#include //#include #include "local.h" #include "number.h" doste::dvm::OID DVMIMPORT doste::dvm::root; unsigned int DVMIMPORT doste::dvm::debug = 0; doste::dvm::Processor *proc; bool running = true; #include "names.h" extern doste::dvm::Names *names; #ifdef LINUX #include #define MAX_THREADS 4 pthread_t thread[MAX_THREADS]; pthread_attr_t pattr; #endif #undef True void *thread_func(void *p) { //doste::Processor *proc = (doste::Processor*)p; doste::dvm::Processor *proc = new doste::dvm::Processor(); while (running) { //std::cout << "PROC2\n"; doste::dvm::Processor::processAll(); //usleep(1); } delete proc; #ifdef LINUX pthread_exit(NULL); #endif return NULL; } void doste::dvm::initialise(const OID &base, int n) { names = new Names; doste::dvm::OID rbase(base.a(),base.b(),0,0); doste::dvm::OID::local(rbase); Event::initialise(); Processor::init(n); new doste::dvm::Processor(); new VStore(); new Number(); root = OID::create(); //Make the root object. Event *evt = new Event(Event::ADD_REF, root); evt->send(Event::FLAG_FREE); //Now register the file objects //Object::registerType(); //Object::registerType(); #ifdef LINUX pthread_attr_init(&pattr); pthread_attr_setscope(&pattr, PTHREAD_SCOPE_SYSTEM); pthread_attr_setdetachstate(&pattr, PTHREAD_CREATE_DETACHED); //One for each secondary processor that the system has. for (int i=1; i(); //OID notations = OID::create(); //root["notations"] = notations; //OID dasm = OID::create(); //notations["dasm"] = dasm; //DASMAgent *dagent = new DASMAgent(dasm); } void doste::dvm::finalise() { running = false; #ifdef LINUX pthread_attr_destroy(&pattr); //pthread_join(thread, NULL); #endif Processor::final(); Event::finalise(); //Delete the handler. //Delete the processor. delete names; } doste-0.3.1/src/dvm/virtualobject.cpp0000644000175000001440000000501511026664310014504 00000000000000#include "virtualobject.h" #include #include using namespace doste; using namespace doste::dvm; VirtualObject::VirtualObject() : m_convert(false) { for (unsigned int i=0; inext; delete cur; cur = temp; } } } void VirtualObject::set(const OID &key, const OID &value) { int hash = key.d() % VO_HASHSIZE; Attribute *cur = m_hash[hash]; while (cur != 0) { if (cur->key == key) { cur->value = value; return; } cur = cur->next; } cur = new Attribute; cur->key = key; cur->def = Null; cur->flags = 0; cur->value = value; cur->next = m_hash[hash]; m_hash[hash] = cur; } void VirtualObject::define(const OID &key, const OID &def) { int hash = key.d() % VO_HASHSIZE; Attribute *cur = m_hash[hash]; while (cur != 0) { if (cur->key == key) { cur->def = def; cur->flags = 0; return; } cur = cur->next; } cur = new Attribute; cur->key = key; cur->def = def; cur->flags = 0; cur->value = Null; cur->next = m_hash[hash]; m_hash[hash] = cur; } void VirtualObject::function(const OID &key, const OID &def) { int hash = key.d() % VO_HASHSIZE; Attribute *cur = m_hash[hash]; while (cur != 0) { if (cur->key == key) { cur->def = def; cur->flags = 1; return; } cur = cur->next; } cur = new Attribute; cur->key = key; cur->def = def; cur->flags = 1; cur->value = Null; cur->next = m_hash[hash]; m_hash[hash] = cur; } const OID &VirtualObject::get(const OID &key) { int hash = key.d() % VO_HASHSIZE; Attribute *cur = m_hash[hash]; while (cur != 0) { if (cur->key == key) { return cur->value; } cur = cur->next; } return Null; } OID VirtualObject::convert() { Attribute *cur; OID real = getRealOID(); Event *evt; for (unsigned int i=0; iparam<0>(cur->key); evt->param<1>(cur->value); evt->send(Event::FLAG_FREE); if (cur->def != Null) { if (cur->flags == 0) evt = new Event(Event::DEFINE, real); else evt = new Event(Event::DEFINE_FUNC, real); evt->param<0>(cur->key); evt->param<1>(cur->def); evt->send(Event::FLAG_FREE); } cur = cur->next; } } return real; } OID VirtualObject::getRealOID() { if (m_real == Null) { m_real = OID::create(); } return m_real; } doste-0.3.1/src/dvm/Makefile.am0000644000175000001440000000050711027176640013165 00000000000000lib_LIBRARIES=libdvm.a libdvm_a_SOURCES=buffer.cpp coid.cpp context.cpp definition.cpp dvm.cpp event.cpp handler.cpp names.cpp number.cpp oid.cpp processor.cpp virtualobject.cpp local.cpp context.h virtualobject.h local.h number.h names.h dll.h libdvm_a_CPPFLAGS=-fPIC INCLUDES=-I@top_srcdir@/include -I@top_builddir@/include doste-0.3.1/src/dvm/local.h0000755000175000001440000001121111062774117012373 00000000000000/* * src/dvm/local.h * * Internal RAM storage for DOSTE database objects. * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _doste_DVM_VSTORE_H_ #define _doste_DVM_VSTORE_H_ #include #include #include #include #include #include #include class OIDPair { public: friend inline bool operator==(const OIDPair &p1, const OIDPair &p2); doste::dvm::OID obj; doste::dvm::OID key; }; namespace doste { namespace dvm { class VStore : public Handler { public: VStore(); ~VStore(); bool handle(Event &evt); private: static OID s_alloc; class Attribute; class Object { public: Object(); Object(const OID &o); ~Object(); const OID &getOID() const { return m_oid; }; OID getKeysBuffer(); OID getRangeBuffer(int a, int b); void add(const OID &key) { m_keys.add(key); }; bool contains(const OID &key) const { return m_keys.contains(key); }; void all(Attribute *a) { m_all = a; }; Attribute *all() const { return m_all; }; OID specialGet(const OID &k); void copy(const OID &nobj); OID keys(); OID size(); void addReference() { m_refcount++; }; void removeReference() { m_refcount--; if (m_refcount <= 0) { //std::cout << "Deleting Object: <" << m_oid.a() << ":" << m_oid.b() << ":" << m_oid.c() << ":" << m_oid.d() << ">\n"; //delete this; } } static Object *get(const OID &o); static void initialise(); static void finalise(); private: //doste::ReadWriteLock m_rwlock; //Lock for key modifications. OID m_oid; Object *next; Attribute *m_all; int m_refcount; static const unsigned int OBJECT_HASH_SIZE = 10000; Vector m_keys; static Object *s_hash[OBJECT_HASH_SIZE]; //static doste::ReadWriteLock s_hlock; static int hashOID(const OID &o) { return o.d() % OBJECT_HASH_SIZE; }; }; class Attribute { public: Attribute(const OID &obj, const OID &key); ~Attribute(); const OID &getKey() const { return m_key; }; const OID &getValue() { if ((m_flags & OID::FLAG_FUNCTION) != 0) { m_value = Definition(m_def).evaluate(m_obj, m_key, true); } return m_value; } const OID &getValue(const OID &key) { if ((m_flags & OID::FLAG_FUNCTION) != 0) { m_value = Definition(m_def).evaluate(m_obj, key, true); } return m_value; } const OID &getObject() const { return m_obj; }; bool setValue(const OID &value); void setDefinition(const OID &def, int flags, const OID &init); const OID &getDefinition() const { return m_def; }; int getFlags() const { return m_flags; }; void setFlags(int flag); //bool isAgent() const { return (m_flags & OID::FLAG_AGENT) != 0; }; bool isFunction() const { return (m_flags & OID::FLAG_FUNCTION) != 0; }; bool isDefinition() const { return m_def != Null; }; void notify(); void addDependent(const OID &obj, const OID &key); void notifyAll(); void notifyAll(const OID &key, const OID &value); static Attribute *get(const OID &obj, const OID &key); static void initialise(); static void finalise(); private: OID m_obj; OID m_key; OID m_value; unsigned char m_instant; List m_deps; OID m_def; unsigned char m_flags; Attribute *next; SpinLock m_lock; static const unsigned int ATTRIB_HASH_SIZE = 200000; void evaluate(const OID &me); static Attribute *s_hash[ATTRIB_HASH_SIZE]; static int hashOIDS(const OID &o, const OID &k) { return ((k.d() << 16)+o.d()) % ATTRIB_HASH_SIZE; }; }; }; }; }; bool operator==(const OIDPair &p1, const OIDPair &p2) { return (p1.obj == p2.obj && p1.key == p2.key); } #endif doste-0.3.1/src/dvm/context.cpp0000644000175000001440000000217711026675546013336 00000000000000/* * src/dvm/context.cpp * * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "context.h" using namespace doste::dvm; Context::~Context() { convertVOs(); for (int i=0; im_convert) m_vos[i]->convert(); } } doste-0.3.1/src/dvm/context.h0000644000175000001440000000365711026675546013007 00000000000000/* * src/dvm/context.h * * Used within definitions to store contextual information. * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _doste_CONTEXT_H_ #define _doste_CONTEXT_H_ #include #include "virtualobject.h" namespace doste { namespace dvm { class Context { public: Context(Definition &def, const OID &obj, const OID &pkey) : m_key(pkey), m_object(obj), m_def(def), m_skey(pkey), m_sobject(obj) {}; ~Context(); const OID &key() const { return m_key; } const OID &object() const { return m_object; } const Definition &definition() const { return m_def; } const OID &selfObject() const { return m_sobject; } const OID &selfKey() const { return m_skey; } void selfObject(const OID &sobj) { m_sobject = sobj; } void selfKey(const OID &skey) { m_skey = skey; } OID newVO() { m_vos.add(new VirtualObject()); return OID(0,100,0,m_vos.size()-1); } VirtualObject *getVO(const OID &vo) { return m_vos[vo.d()]; } private: void convertVOs(); doste::Vector m_vos; OID m_key; OID m_object; Definition &m_def; OID m_skey; OID m_sobject; }; }; }; #endif doste-0.3.1/src/dvm/virtualobject.h0000644000175000001440000000144611026664310014155 00000000000000#ifndef _doste_VIRTUALOBJECT_H_ #define _doste_VIRTUALOBJECT_H_ #include namespace doste { namespace dvm { class Context; class VirtualObject { friend class Context; public: VirtualObject(); ~VirtualObject(); void set(const OID &key, const OID &value); const OID &get(const OID &key); void define(const OID &key, const OID &def); void function(const OID &key, const OID &def); OID convert(); OID getRealOID(); OID doconvert() { m_convert = true; return getRealOID(); } private: struct Attribute { OID key; OID value; OID def; unsigned char flags; Attribute *next; }; static const unsigned int VO_HASHSIZE = 20; Attribute *m_hash[VO_HASHSIZE]; OID m_real; bool m_convert; }; }; }; #endif doste-0.3.1/src/dvm/Makefile.in0000644000175000001440000004626111265574063013212 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 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@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@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 = src/dvm 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 = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(libdir)" libLIBRARIES_INSTALL = $(INSTALL_DATA) LIBRARIES = $(lib_LIBRARIES) AR = ar ARFLAGS = cru libdvm_a_AR = $(AR) $(ARFLAGS) libdvm_a_LIBADD = am_libdvm_a_OBJECTS = libdvm_a-buffer.$(OBJEXT) \ libdvm_a-coid.$(OBJEXT) libdvm_a-context.$(OBJEXT) \ libdvm_a-definition.$(OBJEXT) libdvm_a-dvm.$(OBJEXT) \ libdvm_a-event.$(OBJEXT) libdvm_a-handler.$(OBJEXT) \ libdvm_a-names.$(OBJEXT) libdvm_a-number.$(OBJEXT) \ libdvm_a-oid.$(OBJEXT) libdvm_a-processor.$(OBJEXT) \ libdvm_a-virtualobject.$(OBJEXT) libdvm_a-local.$(OBJEXT) libdvm_a_OBJECTS = $(am_libdvm_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = am__depfiles_maybe = CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libdvm_a_SOURCES) DIST_SOURCES = $(libdvm_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__leading_dot = @am__leading_dot@ 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_builddir = @top_builddir@ top_srcdir = @top_srcdir@ lib_LIBRARIES = libdvm.a libdvm_a_SOURCES = buffer.cpp coid.cpp context.cpp definition.cpp dvm.cpp event.cpp handler.cpp names.cpp number.cpp oid.cpp processor.cpp virtualobject.cpp local.cpp context.h virtualobject.h local.h number.h names.h dll.h libdvm_a_CPPFLAGS = -fPIC INCLUDES = -I@top_srcdir@/include -I@top_builddir@/include all: all-am .SUFFIXES: .SUFFIXES: .cpp .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 \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps src/dvm/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu --ignore-deps src/dvm/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 install-libLIBRARIES: $(lib_LIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(libLIBRARIES_INSTALL) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ $(libLIBRARIES_INSTALL) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ else :; fi; \ done @$(POST_INSTALL) @list='$(lib_LIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ p=$(am__strip_dir) \ echo " $(RANLIB) '$(DESTDIR)$(libdir)/$$p'"; \ $(RANLIB) "$(DESTDIR)$(libdir)/$$p"; \ else :; fi; \ done uninstall-libLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(libdir)/$$p'"; \ rm -f "$(DESTDIR)$(libdir)/$$p"; \ done clean-libLIBRARIES: -test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES) libdvm.a: $(libdvm_a_OBJECTS) $(libdvm_a_DEPENDENCIES) -rm -f libdvm.a $(libdvm_a_AR) libdvm.a $(libdvm_a_OBJECTS) $(libdvm_a_LIBADD) $(RANLIB) libdvm.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c .cpp.o: $(CXXCOMPILE) -c -o $@ $< .cpp.obj: $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` libdvm_a-buffer.o: buffer.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdvm_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdvm_a-buffer.o `test -f 'buffer.cpp' || echo '$(srcdir)/'`buffer.cpp libdvm_a-buffer.obj: buffer.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdvm_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdvm_a-buffer.obj `if test -f 'buffer.cpp'; then $(CYGPATH_W) 'buffer.cpp'; else $(CYGPATH_W) '$(srcdir)/buffer.cpp'; fi` libdvm_a-coid.o: coid.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdvm_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdvm_a-coid.o `test -f 'coid.cpp' || echo '$(srcdir)/'`coid.cpp libdvm_a-coid.obj: coid.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdvm_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdvm_a-coid.obj `if test -f 'coid.cpp'; then $(CYGPATH_W) 'coid.cpp'; else $(CYGPATH_W) '$(srcdir)/coid.cpp'; fi` libdvm_a-context.o: context.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdvm_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdvm_a-context.o `test -f 'context.cpp' || echo '$(srcdir)/'`context.cpp libdvm_a-context.obj: context.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdvm_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdvm_a-context.obj `if test -f 'context.cpp'; then $(CYGPATH_W) 'context.cpp'; else $(CYGPATH_W) '$(srcdir)/context.cpp'; fi` libdvm_a-definition.o: definition.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdvm_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdvm_a-definition.o `test -f 'definition.cpp' || echo '$(srcdir)/'`definition.cpp libdvm_a-definition.obj: definition.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdvm_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdvm_a-definition.obj `if test -f 'definition.cpp'; then $(CYGPATH_W) 'definition.cpp'; else $(CYGPATH_W) '$(srcdir)/definition.cpp'; fi` libdvm_a-dvm.o: dvm.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdvm_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdvm_a-dvm.o `test -f 'dvm.cpp' || echo '$(srcdir)/'`dvm.cpp libdvm_a-dvm.obj: dvm.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdvm_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdvm_a-dvm.obj `if test -f 'dvm.cpp'; then $(CYGPATH_W) 'dvm.cpp'; else $(CYGPATH_W) '$(srcdir)/dvm.cpp'; fi` libdvm_a-event.o: event.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdvm_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdvm_a-event.o `test -f 'event.cpp' || echo '$(srcdir)/'`event.cpp libdvm_a-event.obj: event.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdvm_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdvm_a-event.obj `if test -f 'event.cpp'; then $(CYGPATH_W) 'event.cpp'; else $(CYGPATH_W) '$(srcdir)/event.cpp'; fi` libdvm_a-handler.o: handler.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdvm_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdvm_a-handler.o `test -f 'handler.cpp' || echo '$(srcdir)/'`handler.cpp libdvm_a-handler.obj: handler.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdvm_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdvm_a-handler.obj `if test -f 'handler.cpp'; then $(CYGPATH_W) 'handler.cpp'; else $(CYGPATH_W) '$(srcdir)/handler.cpp'; fi` libdvm_a-names.o: names.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdvm_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdvm_a-names.o `test -f 'names.cpp' || echo '$(srcdir)/'`names.cpp libdvm_a-names.obj: names.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdvm_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdvm_a-names.obj `if test -f 'names.cpp'; then $(CYGPATH_W) 'names.cpp'; else $(CYGPATH_W) '$(srcdir)/names.cpp'; fi` libdvm_a-number.o: number.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdvm_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdvm_a-number.o `test -f 'number.cpp' || echo '$(srcdir)/'`number.cpp libdvm_a-number.obj: number.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdvm_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdvm_a-number.obj `if test -f 'number.cpp'; then $(CYGPATH_W) 'number.cpp'; else $(CYGPATH_W) '$(srcdir)/number.cpp'; fi` libdvm_a-oid.o: oid.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdvm_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdvm_a-oid.o `test -f 'oid.cpp' || echo '$(srcdir)/'`oid.cpp libdvm_a-oid.obj: oid.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdvm_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdvm_a-oid.obj `if test -f 'oid.cpp'; then $(CYGPATH_W) 'oid.cpp'; else $(CYGPATH_W) '$(srcdir)/oid.cpp'; fi` libdvm_a-processor.o: processor.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdvm_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdvm_a-processor.o `test -f 'processor.cpp' || echo '$(srcdir)/'`processor.cpp libdvm_a-processor.obj: processor.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdvm_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdvm_a-processor.obj `if test -f 'processor.cpp'; then $(CYGPATH_W) 'processor.cpp'; else $(CYGPATH_W) '$(srcdir)/processor.cpp'; fi` libdvm_a-virtualobject.o: virtualobject.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdvm_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdvm_a-virtualobject.o `test -f 'virtualobject.cpp' || echo '$(srcdir)/'`virtualobject.cpp libdvm_a-virtualobject.obj: virtualobject.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdvm_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdvm_a-virtualobject.obj `if test -f 'virtualobject.cpp'; then $(CYGPATH_W) 'virtualobject.cpp'; else $(CYGPATH_W) '$(srcdir)/virtualobject.cpp'; fi` libdvm_a-local.o: local.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdvm_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdvm_a-local.o `test -f 'local.cpp' || echo '$(srcdir)/'`local.cpp libdvm_a-local.obj: local.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdvm_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdvm_a-local.obj `if test -f 'local.cpp'; then $(CYGPATH_W) 'local.cpp'; else $(CYGPATH_W) '$(srcdir)/local.cpp'; fi` 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; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ 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; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ 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)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @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 $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: for dir in "$(DESTDIR)$(libdir)"; 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) 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-libLIBRARIES mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-libLIBRARIES install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: 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-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLIBRARIES ctags distclean distclean-compile \ distclean-generic 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-libLIBRARIES 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 pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-libLIBRARIES # 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: doste-0.3.1/src/dvm/names.h0000755000175000001440000000323311265574030012406 00000000000000/* * src/dvm/names.h * * Maps strings to OIDs and vice versa. * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _doste_DVM_NAMES_H_ #define _doste_DVM_NAMES_H_ #include namespace doste { namespace dvm { class Names { public: Names(); ~Names(); OID lookup(const char *n); const char *lookup(const OID &o); void add(const char *n, const OID &o); private: static const unsigned int MAX_NAME_SIZE = 80; static const unsigned int NAME_HASH_SIZE = 1000; struct NameEntry { char name[MAX_NAME_SIZE]; OID id; NameEntry *next; }; NameEntry *m_hash[NAME_HASH_SIZE]; int m_lastname; int hashString(const char *value) { unsigned long hash = 0; int c; while ((c = *value++)) hash = c + (hash << 6) + (hash << 16) - hash; return hash % NAME_HASH_SIZE; } }; }; }; #endif doste-0.3.1/src/dvm/number.cpp0000644000175000001440000001344111072476113013124 00000000000000/* * src/dvm/number.cpp * * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "number.h" #include #include #include #include #include using namespace doste::dvm; NumOp::NumOp() : Handler(OID(0,16,0,0), OID(0,70,0xFFFFFFFF,0xFFFFFFFF)) { } NumOp::~NumOp() { } bool NumOp::handle(Event &evt) { if (evt.type() == Event::GET) { //std::cout << "Numop\n"; //if (!evt.param<0>().isLongLong()) { // evt.result(Null); // return true; //} switch(evt.dest().b()) { case 16: evt.result(evt.dest().m_ll + (long long)evt.param<0>()); break; case 17: evt.result(evt.dest().m_ll - (long long)evt.param<0>()); break; case 18: evt.result((float)evt.dest().m_ll / (float)evt.param<0>()); break; case 19: evt.result(evt.dest().m_ll * (long long)evt.param<0>()); break; case 20: evt.result(evt.dest().m_ll & (long long)evt.param<0>()); break; case 21: evt.result(evt.dest().m_ll | (long long)evt.param<0>()); break; case 22: evt.result(evt.dest().m_ll < (long long)evt.param<0>()); break; case 23: evt.result(evt.dest().m_ll > (long long)evt.param<0>()); break; case 24: evt.result(evt.dest().m_ll << (long long)evt.param<0>()); break; case 25: evt.result(evt.dest().m_ll >> (long long)evt.param<0>()); break; case 26: evt.result(evt.dest().m_ll % (long long)evt.param<0>()); break; case 30: evt.result(evt.dest().m_dbl + (double)evt.param<0>()); break; case 31: evt.result(evt.dest().m_dbl - (double)evt.param<0>()); break; case 32: evt.result(evt.dest().m_dbl / (double)evt.param<0>()); break; case 33: evt.result(evt.dest().m_dbl * (double)evt.param<0>()); break; case 34: evt.result(evt.dest().m_dbl < (double)evt.param<0>()); break; case 35: evt.result(evt.dest().m_dbl > (double)evt.param<0>()); break; case 50: if (evt.dest() == OID(0,50,0,1)) evt.result(tan(evt.param<0>().m_dbl)); //TAN else if (evt.dest() == OID(0,50,0,2)) evt.result(atan(evt.param<0>().m_dbl)); //ATAN else if (evt.dest() == OID(0,50,0,3)) evt.result(OID(0,51, evt.param<0>().c(), evt.param<0>().d())); else if (evt.dest() == OID(0,50,0,4)) evt.result(sqrt(evt.param<0>().m_dbl)); //SQRT else if (evt.dest() == OID(0,50,0,5)) evt.result(sin(evt.param<0>().m_dbl)); //SIN else if (evt.dest() == OID(0,50,0,6)) evt.result(cos(evt.param<0>().m_dbl)); //COS else if (evt.dest() == OID(0,50,0,7)) evt.result((float)rand() / (float)RAND_MAX); //random break; case 51: evt.result(atan2(evt.dest().m_dbl, evt.param<0>().m_dbl)); break; } } return true; } OID Xor; OID Shiftleft; OID Shiftright; OID Trunc; OID Lower; OID Upper; OID Round; Number::Number() : Handler(OID(0,1,0,0), OID(0,2,0xFFFFFFFF,0xFFFFFFFF)) { Xor = OID("xor"); Shiftleft = OID("shiftleft"); Shiftright = OID("shiftright"); Lower = OID("lower"); Upper = OID("upper"); Round = OID("round"); new NumOp(); srand ( (unsigned int)time(NULL) ); } Number::~Number() { } bool Number::handle(Event &evt) { if (evt.type() == Event::GET) { if (evt.dest().isLongLong()) { if (evt.param<0>() == Type) evt.result("Integer"); else if (evt.param<0>() == Add) evt.result(OID(0,15,0,0)+evt.dest()); else if (evt.param<0>() == Subtract) evt.result(OID(0,16,0,0)+evt.dest()); else if (evt.param<0>() == Divide) evt.result(OID(0,17,0,0)+evt.dest()); else if (evt.param<0>() == Multiply) evt.result(OID(0,18,0,0)+evt.dest()); else if (evt.param<0>() == And) evt.result(OID(0,19,0,0)+evt.dest()); else if (evt.param<0>() == Or) evt.result(OID(0,20,0,0)+evt.dest()); else if (evt.param<0>() == Less) evt.result(OID(0,21,0,0)+evt.dest()); else if (evt.param<0>() == Greater) evt.result(OID(0,22,0,0)+evt.dest()); else if (evt.param<0>() == Shiftleft) evt.result(OID(0,23,0,0)+evt.dest()); else if (evt.param<0>() == Shiftright) evt.result(OID(0,24,0,0)+evt.dest()); else if (evt.param<0>() == Percent) evt.result(OID(0,25,0,0)+evt.dest()); } else if (evt.dest().isDouble()) { //std::cout << "wtf\n"; //evt.result(Null); if (evt.param<0>() == Add) evt.result(OID(0,28,0,0)+evt.dest()); else if (evt.param<0>() == Subtract) evt.result(OID(0,29,0,0)+evt.dest()); else if (evt.param<0>() == Divide) evt.result(OID(0,30,0,0)+evt.dest()); else if (evt.param<0>() == Multiply) evt.result(OID(0,31,0,0)+evt.dest()); else if (evt.param<0>() == Less) evt.result(OID(0,32,0,0)+evt.dest()); else if (evt.param<0>() == Greater) evt.result(OID(0,33,0,0)+evt.dest()); else if (evt.param<0>() == Lower) evt.result((int)evt.dest()); }/* else { if (evt.param<0>() == Tan) evt.result(OID(0,50,0,1)); else if (evt.param<0>() == ATan) evt.result(OID(0,50,0,2)); else if (evt.param<0>() == ATan2) evt.result(OID(0,50,0,3)); else if (evt.param<0>() == Sin) evt.result(OID(0,50,0,4)); else if (evt.param<0>() == ASin) evt.result(OID(0,50,0,5)); else if (evt.param<0>() == Cos) evt.result(OID(0,50,0,6)); else if (evt.param<0>() == ACos) evt.result(OID(0,50,0,7)); else if (evt.param<0>() == Sqrt) evt.result(OID(0,50,0,8)); }*/ } return true; } doste-0.3.1/src/dvm/event.cpp0000644000175000001440000000440111056243652012753 00000000000000/* * src/dvm/event.cpp * * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include using namespace doste; using namespace doste::dvm; Event *Event::s_pool[EVENT_POOL_SIZE] = {0}; unsigned int Event::s_ppos = 0; Event *Event::s_block; SpinLock Event::event_lock; void *doste::dvm::Event::operator new (size_t s) { //event_lock.wait(); /*if (s_ppos >= EVENT_POOL_SIZE-1) { std::cerr << "================================================================================\n" << "FATAL ERROR: Event pool underflow. Pool size is: " << EVENT_POOL_SIZE << ". This generally means either you have a single very massive definition (a massive script?) or an infinite loop has occured. Possible also that you have more than " << EVENT_POOL_SIZE << " definitions evaluating in parallel.\n" << "================================================================================\n"; exit(-1); }*/ void *v = s_pool[s_ppos++]; //event_lock.free(); return v; } void doste::dvm::Event::operator delete(void *p) { //event_lock.wait(); /*if (s_ppos == 0) { //event_lock.free(); Warning(Warning::EVENT_OVERFLOW, "Too many events are being deleted!"); return; }*/ s_pool[--s_ppos] = (Event*)p; //event_lock.free(); } void Event::initialise() { s_block = new Event[EVENT_POOL_SIZE]; for (unsigned int i=0; i namespace doste { namespace dvm { /** * Internal DOSTE class for number processing. It receives events * relating to integer or floating point operations and calculates * the result. * @author Nicolas Pope */ class Number : public Handler { public: Number(); ~Number(); bool handle(Event &evt); }; /** * Internal DOSTE class for number processing. This receives events * directly from numbers and returns an OID corresponding to the requested * operation. This returned OID will later be handled by the Number class. * @see doste::Handlers::Number * @author Nicolas Pope */ class NumOp : public Handler { public: NumOp(); ~NumOp(); bool handle(Event &evt); }; }; }; #endif doste-0.3.1/src/dvm/processor.cpp0000644000175000001440000001313311056222603013644 00000000000000/* * src/dvm/processor.cpp * * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 22/7/2007 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include using namespace doste; using namespace doste::dvm; Processor *Processor::s_processors[Processor::MAX_PROCESSORS]; int Processor::s_nextproc = 0; Processor::Queues Processor::s_queue[Processor::NUM_QUEUES]; long long Processor::s_instant = 0; long long Processor::s_evtcount = 0; int curq = -1; Mutex proc_mutex; #ifdef LINUX pthread_barrier_t proc_barrier; pthread_key_t Processor::s_pkey; #endif void Processor::init( int n) { //Arch::Processor::init(); //Initialise the whole queue to null for (unsigned int i=0; itype() << " " << s_queue[i].q[j].evt->dest() << "\n"; msg << " " << s_queue[i].q[j].evt->param<0>() << "," << s_queue[i].q[j].evt->param<1>() << "\n"; } } msg << "End Queue Dump\n";*/ } Processor *Processor::getProcessor(int id) { if (id < 0 || id >= s_nextproc) { return 0; } return s_processors[id]; } Processor *Processor::getThisProcessor() { #ifdef LINUX long long id = (long long)pthread_getspecific(s_pkey); #else int id = 0; #endif return s_processors[id]; } Processor::Processor() { s_processors[s_nextproc] = this; s_nextproc++; m_idle = false; m_id = s_nextproc-1; m_context = 0; #ifdef LINUX m_pthread = pthread_self(); pthread_setspecific(s_pkey, (void*)m_id); //std::cout << "ThreadID: " << m_id << "\n"; #endif } Processor::~Processor() { } int Processor::queueSize() { return (s_queue[0].put - s_queue[0].get) + (s_queue[1].put - s_queue[1].get) + (s_queue[2].put - s_queue[2].get); } bool Processor::send(Event *evt, int flags) { bool res; //ECallback *cb = evt->callback(); //This means that it should be processed by this //processor now and block until done. if ((evt->type() & 0xF0) == 0) { //Process Now. res = Handler::route(*evt); //Delete if needed if ((flags & FLAGS_FREE) != 0) { delete evt; } return res; } //Otherwise select a processor and add to correct queue. int queue = ((evt->type() & 0xF0) >> 4) -1; //if (queue == curq) Warning(Warning::CURRENT_QUEUE, "You are sending events to the current queue, this is not good."); proc_mutex.lock(); int i = s_queue[queue].put; s_queue[queue].put = ((i+1) % QUEUE_SIZE); //proc->m_queue[queue].put; //info(String("Sent ") + String(proc->getID())); s_queue[queue].q[i].evt = evt; s_queue[queue].q[i].flags = flags; proc_mutex.unlock(); //#ifdef DOSTE //Arch::x86::APIC::sendIPI(0x82); //#endif return true; } bool Processor::processInstant() { #ifdef LINUX pthread_barrier_wait(&proc_barrier); #endif curq = 0; processQueue(0); #ifdef LINUX pthread_barrier_wait(&proc_barrier); #endif curq = 1; processQueue(1); #ifdef LINUX pthread_barrier_wait(&proc_barrier); #endif curq = 2; processQueue(2); //#ifdef LINUX //pthread_barrier_wait(&proc_barrier); //#endif curq = -1; //Add to complete instants. if ((getThisProcessor()->getID() == 0)) { s_instant++; if (doste::dvm::debug & doste::dvm::DEBUG_INSTANTS) std::cout << "Instant: " << s_instant << "\n"; } return (queueSize() != 0); } void Processor::processRemaining() { if (curq == 1) { processQueue(1); #ifdef LINUX pthread_barrier_wait(&proc_barrier); #endif curq = 2; processQueue(2); curq = -1; if (queueSize() != 0) { #ifdef LINUX pthread_barrier_wait(&proc_barrier); #endif curq = 0; processQueue(0); #ifdef LINUX pthread_barrier_wait(&proc_barrier); #endif curq = 1; } } else { processInstant(); } } void Processor::processQueue(int queue) { Event *evt; int flags; while (true) { proc_mutex.lock(); if (s_queue[queue].get == s_queue[queue].put) { proc_mutex.unlock(); return; } evt = s_queue[queue].q[s_queue[queue].get].evt; //s_queue[s_curq].q[s_queue[s_curq].get].evt = 0; flags = s_queue[queue].q[s_queue[queue].get++].flags; if (s_queue[queue].get == QUEUE_SIZE) s_queue[queue].get = 0; //} //Add to the count of processed events. //s_evtcount++; proc_mutex.unlock(); Handler::route(*evt); //Actually process the event. if (flags & FLAGS_FREE) { delete evt; } } } doste-0.3.1/src/dvm/dll.h0000644000175000001440000000031711007311421012036 00000000000000#ifdef WIN32 #if BUILD_DVM_DLL # define DVMIMPORT __declspec (dllexport) #else /* Not BUILDING_DLL */ # define DVMIMPORT __declspec (dllimport) #endif /* Not BUILDING_DLL */ #else #define DVMIMPORT #endif doste-0.3.1/src/dvm/handler.cpp0000644000175000001440000001300011056242607013241 00000000000000/* * src/dvm/handler.cpp * * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include using namespace doste; using namespace doste::dvm; //Agent *Handler::s_agents[AGENT_HASH_SIZE] = {0}; Handler::SHandlerEntry Handler::s_handlers[Handler::MAX_HANDLERS]; Handler *Handler::s_otherwise = 0; unsigned int Handler::s_numhandlers = 0; Mutex handle_lock; Handler::Handler() { if (s_otherwise != 0) { Warning(Warning::GLOBAL_HANDLERS, "You are attempting to create multiple global handlers"); } s_otherwise = this; } Handler::Handler(const OID &o) { if (s_numhandlers >= MAX_HANDLERS) { Warning(Warning::HANDLER_EXCEED, "There are too many handlers"); return; } handle_lock.lock(); s_handlers[s_numhandlers].ha = this; s_handlers[s_numhandlers].l = o; s_handlers[s_numhandlers].h = o; s_numhandlers++; handle_lock.unlock(); } Handler::Handler(const OID &l, const OID &h) { if (s_numhandlers >= MAX_HANDLERS) { Warning(Warning::HANDLER_EXCEED, "There are too many handlers"); return; } handle_lock.lock(); s_handlers[s_numhandlers].ha = this; s_handlers[s_numhandlers].l = l; s_handlers[s_numhandlers].h = h; s_numhandlers++; handle_lock.unlock(); } Handler::~Handler() { //Remove handler, but not possible yet. } void Handler::map(const OID &l, const OID &h) { if (s_numhandlers >= MAX_HANDLERS) { Warning(Warning::HANDLER_EXCEED, "There are too many handlers"); return; } handle_lock.lock(); s_handlers[s_numhandlers].ha = this; s_handlers[s_numhandlers].l = l; s_handlers[s_numhandlers].h = h; s_numhandlers++; handle_lock.unlock(); } bool Handler::route(Event &evt) { //if (evt.dest() == Null) { // evt.result(Null); // return false; //} /*if (doste::dvm::debug != 0) { char buf[100]; if ((doste::dvm::debug & doste::dvm::DEBUG_SET_EVENTS) && (evt.type() == Event::SET)) { evt.dest().toString(buf,100); std::cout << "SET [" << Processor::getThisProcessor()->getID() << "] " << buf << "("; evt.param<0>().toString(buf,100); std::cout << buf << ") = "; evt.param<1>().toString(buf,100); std::cout << buf << "\n"; std::cout.flush(); } if ((doste::dvm::debug & doste::dvm::DEBUG_DEFINE_EVENTS) && (evt.type() == Event::DEFINE)) { evt.dest().toString(buf,100); std::cout << "DEFINE [" << Processor::getThisProcessor()->getID() << "] " << buf << "("; evt.param<0>().toString(buf,100); std::cout << buf << ") is "; evt.param<1>().toString(buf,100); std::cout << buf << "\n"; std::cout.flush(); } if ((doste::dvm::debug & doste::dvm::DEBUG_ADDDEP_EVENTS) && (evt.type() == Event::ADDDEP)) { evt.dest().toString(buf,100); std::cout << "ADDDEP [" << Processor::getThisProcessor()->getID() << "] " << buf << "("; evt.param<0>().toString(buf,100); std::cout << buf << ") <- "; evt.param<1>().toString(buf,100); std::cout << buf << "("; evt.param<2>().toString(buf,100); std::cout << buf << ")\n"; std::cout.flush(); } if ((doste::dvm::debug & doste::dvm::DEBUG_NOTIFY_EVENTS) && (evt.type() == Event::NOTIFY)) { evt.dest().toString(buf,100); std::cout << "NOTIFY [" << Processor::getThisProcessor()->getID() << "] " << buf << "("; evt.param<0>().toString(buf,100); std::cout << buf << ")\n"; std::cout.flush(); } if ((doste::dvm::debug & doste::dvm::DEBUG_GET_EVENTS) && (evt.type() == Event::GET)) { evt.dest().toString(buf,100); std::cout << "GET [" << Processor::getThisProcessor()->getID() << "] " << buf << "("; evt.param<0>().toString(buf,100); std::cout << buf << ")\n"; std::cout.flush(); } }*/ //Search for a matching handler. Handler *ha=s_otherwise; //#ifdef LINUX //pthread_mutex_lock(&handle_lock); //#endif if (!evt.dest().isReserved()) ha = s_handlers[0].ha; else { for (unsigned int i=1; i= evt.dest())) { ha = s_handlers[i].ha; break; } } } //#ifdef LINUX //pthread_mutex_unlock(&handle_lock); //#endif if (ha == 0) { if (evt.dest() != Null) { Warning(Warning::INVALID_DESTINATION, dstring("I don't know how to talk to '") + evt.dest() + "'"); } //if (evt.callback() != 0) evt.callback()->complete(true); evt.result(Null); evt.type(0); return false; } //TODO: Need to check that it handled bulk events correctly. //NOTE: Still need to set correct result and complete in callback. if (!ha->handle(evt)) { evt.type(0); Warning(Warning::UNPROCESSED_EVENT, dstring("Event ") + evt.type() + " for " + evt.dest() + " could not be processed. Parameter 0 is " + evt.param<0>()); return false; } evt.type(0); return true; } doste-0.3.1/src/dvm/buffer.cpp0000644000175000001440000000764111056207014013104 00000000000000/* * src/dvm/buffer.cpp * * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include using namespace doste; using namespace doste::dvm; Buffer *Buffer::s_buffers[MAX_BUFFERS] = {0}; OID Buffer::create(char *buf, int count) { OID id = allocate(); Buffer *bobj = lookup(id); if (bobj->m_dofree) delete [] bobj->m_data; bobj->m_data = buf; bobj->m_count = count; bobj->m_dofree = false; bobj->m_type = B_CHAR; return id; } OID Buffer::create(int *buf, int count) { OID id = allocate(); Buffer *bobj = lookup(id); if (bobj->m_dofree) delete [] bobj->m_data; bobj->m_data = (char*)buf; bobj->m_count = count; bobj->m_dofree = false; bobj->m_type = B_INT; return id; } OID Buffer::create(long long *buf, int count) { OID id = allocate(); Buffer *bobj = lookup(id); if (bobj->m_dofree) delete [] bobj->m_data; bobj->m_data = (char*)buf; bobj->m_count = count; bobj->m_dofree = false; bobj->m_type = B_LONGLONG; return id; } OID Buffer::create(float *buf, int count) { OID id = allocate(); Buffer *bobj = lookup(id); if (bobj->m_dofree) delete [] bobj->m_data; bobj->m_data = (char*)buf; bobj->m_count = count; bobj->m_dofree = false; bobj->m_type = B_FLOAT; return id; } OID Buffer::create(double *buf, int count) { OID id = allocate(); Buffer *bobj = lookup(id); if (bobj->m_dofree) delete [] bobj->m_data; bobj->m_data = (char*)buf; bobj->m_count = count; bobj->m_dofree = false; bobj->m_type = B_DOUBLE; return id; } OID Buffer::create(OID *buf, int count) { OID id = allocate(); Buffer *bobj = lookup(id); if (bobj->m_dofree) delete [] bobj->m_data; bobj->m_data = (char*)buf; bobj->m_count = count; bobj->m_dofree = false; bobj->m_type = B_OID; return id; } OID Buffer::create(BufferType t, int count) { OID id = allocate(); Buffer *bobj = lookup(id); if (bobj->m_dofree) delete [] bobj->m_data; bobj->m_count = count; bobj->m_dofree = true; bobj->m_type = t; //std::cout << "Count: " << count << "\n"; switch (t) { case B_CHAR: bobj->m_data = new char[count]; break; case B_INT: bobj->m_data = (char*)new int[count]; break; case B_LONGLONG: bobj->m_data = (char*)new long long[count]; break; case B_FLOAT: bobj->m_data = (char*)new float[count]; break; case B_DOUBLE: bobj->m_data = (char*)new double[count]; break; case B_OID: //bobj->m_data = (char*)(new OID[count]); break; bobj->m_data = new char[count*sizeof(OID)]; break; default: bobj->m_dofree = false; bobj->m_data = 0; bobj->m_count = 0; } //std::cout << "Alloc ptr: " << (void*)bobj->m_data << "\n"; return id; } OID Buffer::allocate() { for (unsigned int i=0; i= 0 && idi < MAX_BUFFERS) { if (s_buffers[idi] != 0) delete s_buffers[idi]; s_buffers[idi] = 0; } } Buffer *Buffer::lookup(const OID &id) { if (!id.isBuffer()) return 0; unsigned int idi = (unsigned int)id.d(); if (idi >= 0 && idi < MAX_BUFFERS) { return s_buffers[idi]; } else { return 0; } } doste-0.3.1/src/dvm/coid.cpp0000644000175000001440000001111511026675077012557 00000000000000/* * src/dvm/coid.cpp * * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include //#include using namespace doste::dvm; int COID::compress(unsigned char *buf, const OID &o) { //char code; //char tempc; //short temps; //int tempi; int i=0; if (o == Null) { buf[i] = COID_NULL; return 1; } else if (o == This) { buf[i] = COID_THIS; return 1; } else if (o == modifiers::Set) { buf[i] = COID_MOD_SET; return 1; } else if (o == modifiers::Define) { buf[i] = COID_MOD_DEF; return 1; } else if (o == modifiers::NoDep) { buf[i] = COID_MOD_NODEP; return 1; } else if (o == modifiers::Seq) { buf[i] = COID_MOD_SEQ; return 1; /*} else if (o == DOF::BeginDef) { buf[i] = COID_BEGINDEF; return 1; } else if (o == DOF::EndDef) { buf[i] = COID_ENDDEF; return 1; } else if (o == DOF::BeginList) { buf[i] = COID_BEGINLIST; return 1; } else if (o == DOF::EndList) { buf[i] = COID_ENDLIST; return 1;*/ } else if (o.isSpecial() && o.c() == 1) { buf[i++] = COID_MODIF; buf[i] = o.d(); return 2; } else if (o.isSpecial()) { buf[i++] = COID_SPECIAL; buf[i++] = o.d() >> 8; buf[i] = o.d(); return 3; } else if (o.isName()) { buf[i++] = COID_INDEX; buf[i++] = o.d() >> 8; buf[i] = o.d(); return 3; } else if (o.isChar()) { buf[i++] = COID_CHAR; buf[i++] = o.d(); return 2; } else if (o.isLongLong()) { if (o.c() == 0) { if ((int)o.d() < 128 && (int)o.d() > -128) { buf[i++] = COID_CINT; buf[i] = o.d(); return 2; } else if ((int)o.d() < 32000 && (int)o.d() > -32000) { buf[i++] = COID_SINT; buf[i++] = o.d() >> 8; buf[i] = o.d(); return 3; } else { buf[i++] = COID_INT; buf[i++] = o.d() >> 24; buf[i++] = o.d() >> 16; buf[i++] = o.d() >> 8; buf[i++] = o.d(); return 5; } } else { buf[i++] = COID_LONG; //TODO return 1; } } else { buf[i++] = COID_FULL; buf[i++] = o.a() >> 24; buf[i++] = o.a() >> 16; buf[i++] = o.a() >> 8; buf[i++] = o.a(); buf[i++] = o.b() >> 24; buf[i++] = o.b() >> 16; buf[i++] = o.b() >> 8; buf[i++] = o.b(); buf[i++] = o.c() >> 24; buf[i++] = o.c() >> 16; buf[i++] = o.c() >> 8; buf[i++] = o.c(); buf[i++] = o.d() >> 24; buf[i++] = o.d() >> 16; buf[i++] = o.d() >> 8; buf[i++] = o.d(); return 17; } } int COID::decompress(const unsigned char *buf, OID &o) { switch (buf[0]) { case COID_NULL: o = Null; return 1; case COID_THIS: o = This; return 1; case COID_SPECIAL: o = OID(0,0,0,((unsigned int)buf[1]<<8)+buf[2]); return 3; case COID_MODIF: o = OID(0,0,1,buf[1]); return 2; case COID_MOD_SET: o = modifiers::Set; return 1; case COID_MOD_DEF: o = modifiers::Define; return 1; case COID_MOD_NODEP: o = modifiers::NoDep; return 1; case COID_MOD_SEQ: o = modifiers::Seq; return 1; /*case COID_BEGINDEF: o = DOF::BeginDef; return 1; case COID_ENDDEF: o = DOF::EndDef; return 1; case COID_BEGINLIST: o = DOF::BeginList; return 1; case COID_ENDLIST: o = DOF::EndList; return 1;*/ case COID_INDEX: o = OID(0,5,0,((unsigned int)buf[1] << 8) + buf[2]); return 3; case COID_CHAR: o = OID(0,3,0,buf[1]); return 2; case COID_CINT: o = OID(0,1,0,buf[1]); return 2; case COID_SINT: o = OID(0,1,0,((unsigned int)buf[1] << 8) + buf[2]); return 3; case COID_INT: o = OID(0,1,0,((unsigned int)buf[1] << 24) + ((unsigned int)buf[2] << 16) + ((unsigned int)buf[3] << 8) + (unsigned int)buf[4]); return 5; case COID_FULL: o = OID( (buf[1]<<24) + (buf[2]<<16) + (buf[3]<<8) + (buf[4]), (buf[5]<<24) + (buf[6]<<16) + (buf[7]<<8) + (buf[8]), (buf[9]<<24) + (buf[10]<<16) + (buf[11]<<8) + (buf[12]), (buf[13]<<24) + (buf[14]<<16) + (buf[15]<<8) + (buf[16])); return 17; } return 1; } doste-0.3.1/src/dvm/local.cpp0000755000175000001440000004000611137277464012740 00000000000000/* * src/dvm/local.cpp * * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "local.h" #include #include //#include #include #include #include #include #ifdef LINUX #include pthread_mutex_t attrib_lock = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t oid_lock = PTHREAD_MUTEX_INITIALIZER; #endif using namespace doste; using namespace doste::dvm; VStore::Object *VStore::Object::s_hash[VStore::Object::OBJECT_HASH_SIZE] = {0}; VStore::Attribute *VStore::Attribute::s_hash[VStore::Attribute::ATTRIB_HASH_SIZE] = {0}; OID VStore::s_alloc; VStore::VStore() : Handler(OID::local()+OID(0,0,1,0), OID::local()+OID(0,0,1,0xFFFFFFFF)) { s_alloc = OID::local()+OID(0,0,1,0); Object::initialise(); Attribute::initialise(); map(True, False); } VStore::~VStore() { Attribute::finalise(); Object::finalise(); } bool VStore::handle(Event &evt) { Object *obj; Attribute *attrib; OID temp; switch(evt.type()) { case Event::CREATE: #ifdef LINUX //SPINLOCK pthread_mutex_lock(&oid_lock); #endif temp = s_alloc; s_alloc++; #ifdef LINUX //SPINLOCK pthread_mutex_unlock(&oid_lock); #endif evt.result(temp); break; case Event::COPY: obj = Object::get(evt.dest()); if (obj != 0) { obj->copy(evt.param<0>()); } break; case Event::GET: if (evt.param<0>().isSpecial() && evt.param<0>().d() >= 100) { obj = Object::get(evt.dest()); if (obj != 0) { evt.result(obj->specialGet(evt.param<0>())); } else { evt.result(Null); } break; }/* else if (evt.param<0>().isLongLong()) { obj = Object::get(evt.dest()); if (obj == 0) evt.result(Null); else evt.result(obj->getArray(evt.param<0>())); if (evt.result() != Null) break; }*/ attrib = Attribute::get(evt.dest(), evt.param<0>()); if (attrib == 0) { attrib = Attribute::get(evt.dest(), Key); if (attrib == 0) evt.result(Null); else { if ((attrib->getDefinition() != Null) && ((attrib->getFlags() & OID::FLAG_FUNCTION) == 0)) { evt.result(Definition(attrib->getDefinition()).evaluate(evt.dest(), evt.param<0>())); //TODO: Prevent evaluation of this the next time? evt.dest().define(evt.param<0>(), attrib->getDefinition(), evt.result(), true); } else { //Debug(0, dstring("Function: ") + evt.param<0>()); evt.result(attrib->getValue(evt.param<0>())); } } } else if (attrib->getFlags() & OID::FLAG_OUT_OF_DATE) { attrib->setFlags(attrib->getFlags() & (0xFF - OID::FLAG_OUT_OF_DATE)); attrib->setValue(Definition(attrib->getDefinition()).evaluate(evt.dest(), evt.param<0>(), false)); evt.result(attrib->getValue()); } else { evt.result(attrib->getValue()); } break; case Event::GETDEF: attrib = Attribute::get(evt.dest(), evt.param<0>()); if (attrib == 0) { evt.result(Null); } else evt.param<0>(attrib->getFlags()); evt.result(attrib->getDefinition()); break; case Event::GETFLAGS: attrib = Attribute::get(evt.dest(), evt.param<0>()); if (attrib == 0) { evt.result(Null); } else evt.result(attrib->getFlags()); break; case Event::SET: #ifdef LINUX pthread_mutex_lock(&attrib_lock); #endif attrib = Attribute::get(evt.dest(), evt.param<0>()); if (attrib == 0) { //also need to add a key. obj = Object::get(evt.dest()); if (obj == 0) obj = new Object(evt.dest()); obj->add(evt.param<0>()); attrib = new Attribute(evt.dest(), evt.param<0>()); } #ifdef LINUX pthread_mutex_unlock(&attrib_lock); #endif if (attrib->setValue(evt.param<1>()) && evt.param<0>() != Key) { temp = attrib->getValue(); #ifdef LINUX pthread_mutex_lock(&attrib_lock); #endif attrib = Attribute::get(evt.dest(), Key); #ifdef LINUX pthread_mutex_unlock(&attrib_lock); #endif if (attrib != 0) attrib->notifyAll(evt.param<0>(), temp); } break; case Event::DEFINE: #ifdef LINUX pthread_mutex_lock(&attrib_lock); #endif attrib = Attribute::get(evt.dest(), evt.param<0>()); if (attrib == 0) { //also need to add a key. obj = Object::get(evt.dest()); if (obj == 0) obj = new Object(evt.dest()); obj->add(evt.param<0>()); attrib = new Attribute(evt.dest(), evt.param<0>()); } #ifdef LINUX pthread_mutex_unlock(&attrib_lock); #endif attrib->setDefinition(evt.param<1>(), 0, evt.param<2>()); break; case Event::SETFLAGS: #ifdef LINUX pthread_mutex_lock(&attrib_lock); #endif attrib = Attribute::get(evt.dest(), evt.param<0>()); if (attrib == 0) { //also need to add a key. obj = Object::get(evt.dest()); if (obj == 0) obj = new Object(evt.dest()); obj->add(evt.param<0>()); attrib = new Attribute(evt.dest(), evt.param<0>()); } #ifdef LINUX pthread_mutex_unlock(&attrib_lock); #endif attrib->setFlags(evt.param<1>()); break; case Event::DEFINE_FUNC: #ifdef LINUX pthread_mutex_lock(&attrib_lock); #endif attrib = Attribute::get(evt.dest(), evt.param<0>()); if (attrib == 0) { //also need to add a key. obj = Object::get(evt.dest()); if (obj == 0) obj = new Object(evt.dest()); obj->add(evt.param<0>()); attrib = new Attribute(evt.dest(), evt.param<0>()); } #ifdef LINUX pthread_mutex_unlock(&attrib_lock); #endif //Size optimisation //if ((evt.param<1>()[Size] == 1) && (((OID)evt.param<1>()[0]).isSpecial() == false)) { //std::cout << "DEFINE_FUNC: Size optimise\n"; // attrib->setValue(evt.param<1>()[0]); //} else { attrib->setDefinition(evt.param<1>(), OID::FLAG_FUNCTION, Null); //} break; case Event::ADDDEP: #ifdef LINUX pthread_mutex_lock(&attrib_lock); #endif attrib = Attribute::get(evt.dest(), evt.param<0>()); if (attrib == 0) { obj = Object::get(evt.dest()); if (obj == 0) obj = new Object(evt.dest()); obj->add(evt.param<0>()); attrib = new Attribute(evt.dest(), evt.param<0>()); } #ifdef LINUX pthread_mutex_unlock(&attrib_lock); #endif if (attrib != 0) attrib->addDependent(evt.param<1>(), evt.param<2>()); break; case Event::ADD_REF: //#ifdef LINUX //pthread_mutex_lock(&attrib_lock); //#endif obj = Object::get(evt.dest()); if (obj != 0) obj->addReference(); //#ifdef LINUX //pthread_mutex_unlock(&attrib_lock); //#endif break; case Event::REMOVE_REF: #ifdef LINUX pthread_mutex_lock(&attrib_lock); #endif obj = Object::get(evt.dest()); if (obj != 0) obj->removeReference(); #ifdef LINUX pthread_mutex_unlock(&attrib_lock); #endif break; case Event::NOTIFY: attrib = Attribute::get(evt.dest(), evt.param<0>()); if (attrib != 0) attrib->notify(); break; case Event::GET_KEYS: obj = Object::get(evt.dest()); if (obj == 0) evt.result(Null); else evt.result(obj->getKeysBuffer()); break; case Event::GET_RANGE: obj = Object::get(evt.dest()); if (obj == 0) evt.result(Null); else evt.result(obj->getRangeBuffer(evt.param<0>(), evt.param<1>())); break; default: return false; } //if (evt.callback() != 0) { // evt.callback()->notify(evt); //} return true; } //------------------- //Object //------------------- void VStore::Object::initialise() { } void VStore::Object::finalise() { //Delete all objects. } VStore::Object::Object() : next(0), m_refcount(0) { m_oid = s_alloc; s_alloc++; int hash = hashOID(m_oid); next = s_hash[hash]; s_hash[hash] = this; } VStore::Object::Object(const OID &o) : m_oid(o), next(0), m_refcount(0) { int hash = hashOID(o); next = s_hash[hash]; s_hash[hash] = this; } VStore::Object::~Object() { Attribute *attrib; //Delete all attributes for (int i=0; inext; } else { prev->next = cur->next; } } prev = cur; cur = cur->next; } } OID VStore::Object::specialGet(const OID &k) { switch (k.d()) { case 100: break; //delete case 101: break; //size case 102: break; //save case 103: break; case 104: return keys(); case 105: break; //Allkeys case 106: break; //deep } return Null; } void VStore::Object::copy(const OID &nobj) { //OID nobj = OID::create(); OID res, value; int flags; Attribute *attrib; for (int i=0; igetFlags(); res = attrib->getDefinition(); } /*if (flags & OID::FLAG_OUT_OF_DATE) { attrib->setFlags(flags & (0xFF - OID::FLAG_OUT_OF_DATE)); flags = attrib->getFlags(); attrib->setValue(Definition(res).evaluate(m_oid, m_keys[i], false)); value = attrib->getValue(); }*/ if (res != Null) { if (flags && 0x01) { //if (res.isVirtual()) context->getVO(res)->function(*it, evt2->result()); nobj.function(m_keys[i], res, true); } else { value = attrib->getValue(); nobj.set(m_keys[i], value, true); nobj.define(m_keys[i], res, true); } } else { if (flags && OID::FLAG_DEEP) { #ifdef LINUX //SPINLOCK pthread_mutex_lock(&oid_lock); #endif res = s_alloc; s_alloc++; #ifdef LINUX //SPINLOCK pthread_mutex_unlock(&oid_lock); #endif value = attrib->getValue(); value.copy(res); res.set(Parent, nobj, true); nobj.set(m_keys[i], res, true); } else { value = attrib->getValue(); if (value != Null) nobj.set(m_keys[i], value, true); } nobj.flags(m_keys[i],flags, true); } //delete evt; } } OID VStore::Object::keys() { OID nobj = OID::create(); for (int i=0; igetOID() == o) { return cur; } cur = cur->next; } return 0; } OID VStore::Object::getKeysBuffer() { if (m_keys.size() == 0) return Null; return Buffer::create(m_keys.data(), m_keys.size()); } OID VStore::Object::getRangeBuffer(int a, int b) { OID boid = Buffer::create(B_OID, b-a); Buffer *buf = Buffer::lookup(boid); Attribute *attrib; for (int i=a; igetFlags() & OID::FLAG_OUT_OF_DATE) { attrib->setFlags(attrib->getFlags() & (0xFF - OID::FLAG_OUT_OF_DATE)); attrib->setValue(Definition(attrib->getDefinition()).evaluate(m_oid, i, false)); } buf->seti(i-a, attrib->getValue()); } else buf->seti(i-a, Null); } return boid; } //--------------------- //Attribute //--------------------- void VStore::Attribute::initialise() { } void VStore::Attribute::finalise() { //Delete all attributes. } VStore::Attribute::Attribute(const OID &obj, const OID &key) : m_obj(obj), m_key(key), m_value(Null), m_instant(0xFF), m_def(Null), m_flags(0), next(0) { int hash = hashOIDS(obj,key); next = s_hash[hash]; s_hash[hash] = this; } VStore::Attribute::~Attribute() { int hash = hashOIDS(m_obj,m_key); Attribute *cur = s_hash[hash]; Attribute *prev = 0; while (cur != 0) { if (cur == this) { if (prev == 0) { s_hash[hash] = cur->next; } else { prev->next = cur->next; } } prev = cur; cur = cur->next; } } VStore::Attribute *VStore::Attribute::get(const OID &obj, const OID &key) { int hash = hashOIDS(obj,key); Attribute *cur = s_hash[hash]; while (cur != 0) { if (cur->getObject() == obj && cur->getKey() == key) { return cur; } cur = cur->next; } return 0; } bool VStore::Attribute::setValue(const OID &value) { m_lock.wait(); if ((m_value != value || value == Void)) { //m_instant = Processor::getInstant(); if (!m_value.isReserved()) { Event *evt = new Event(Event::REMOVE_REF, m_value); evt->send(Event::FLAG_FREE); } m_value = value; if (!value.isReserved()) { Event *evt = new Event(Event::ADD_REF, value); evt->send(Event::FLAG_FREE); } m_lock.free(); notifyAll(); return true; } m_lock.free(); return false; } void VStore::Attribute::setFlags(int flag) { m_flags = (flag & 0xFFFFFFF8) | (m_flags & 0x7); } void VStore::Attribute::addDependent(const OID &obj, const OID &key) { OIDPair pair; pair.key = key; pair.obj = obj; //LOCK m_lock.wait(); m_deps.addFront(pair); m_deps.unique(pair); //UNLOCK m_lock.free(); } void VStore::Attribute::notify() { //Make sure that notify is only called once per instant //if ((unsigned char)(Processor::getInstant()&0xFF) == m_instant) { DMsg msg(DMsg::WARNING); msg << "DOUBLE NOTIFY: " << m_key << "\n"; return; } //m_instant = (unsigned char)(Processor::getInstant()&0xFF); //If there is a definition then evaluate it now if (m_def != Null && (m_flags & OID::FLAG_FUNCTION) == 0) { //Generate a SET event with the definitions result. //if (m_deps.size() != 0) { Event *evt = new Event(Event::SET, m_obj); evt->param<0>(m_key); evt->param<1>(Definition(m_def).evaluate(m_obj, m_key, false)); evt->send(Event::FLAG_FREE); //} else { //Set the OUT OF DATE flag // m_flags |= OID::FLAG_OUT_OF_DATE; //} } }; void VStore::Attribute::setDefinition(const OID &def, int flags, const OID &init) { //Make the changes... assuming that no other processors //are also making these changes. May need a lock here. m_lock.wait(); if (!m_def.isReserved()) { Event *evt = new Event(Event::REMOVE_REF, m_def); evt->send(Event::FLAG_FREE); } m_def = def; if (!def.isReserved()) { Event *evt = new Event(Event::ADD_REF, def); evt->send(Event::FLAG_FREE); } m_flags = flags; m_lock.free(); if (init != Null) setValue(init); if (m_def != Null && ((m_flags & OID::FLAG_FUNCTION) == 0) && m_key != Key && init == Null) { Event *evt = new Event(Event::NOTIFY, m_obj); evt->param<0>(m_key); evt->param<1>(m_obj); evt->param<2>(m_key); evt->param<3>(m_value); //NOTE: UNRELIABLE, DO NOT USE evt->send(Event::FLAG_FREE); } } void VStore::Attribute::notifyAll() { Event *evt; //For all attributes dependent upon this one... for (List::iterator i=m_deps.begin(); i!=m_deps.end(); i++) { //The list must be unique to prevent excess notifies? //Now dealt with by notify so this does not matter. //m_lock.wait(); //m_deps.unique(*i); //m_lock.free(); //Generate the notify event for this object. evt = new Event(Event::NOTIFY, (*i).obj); evt->param<0>((*i).key); //Agents rely on the following but they really should not. evt->param<1>(m_obj); evt->param<2>(m_key); evt->param<3>(m_value); //NOTE: TO BE REMOVED evt->send(Event::FLAG_FREE); } //Remove all notifications m_lock.wait(); m_deps.clear(); m_lock.free(); } void VStore::Attribute::notifyAll(const OID &key, const OID &value) { Event *evt; //Notify list must be unique. for (List::iterator i=m_deps.begin(); i!=m_deps.end(); i++) { //No longer needed as notify checks for double calls //m_lock.wait(); //m_deps.unique(*i); //m_lock.free(); evt = new Event(Event::NOTIFY, (*i).obj); evt->param<0>((*i).key); //Only needed by agents, should be removed. evt->param<1>(m_obj); evt->param<2>(key); evt->param<3>(value); //NOTE: TO BE REMOVED evt->send(Event::FLAG_FREE); } m_lock.wait(); m_deps.clear(); m_lock.free(); } doste-0.3.1/src/dvm/oid.cpp0000644000175000001440000002201711137277464012420 00000000000000/* * src/dvm/oid.cpp * * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include "names.h" #include #include //#include //#include #include #include #ifdef _MSC_VER #pragma warning(disable:4996) #endif using namespace doste; using namespace doste::dvm; Names *names; OID doste::dvm::OID::s_local = OID(1,0,0,0); OID::OID(const char *v) { //First check if its a number or explicit OID. //Explicit OID if (v[0] == '<') { int i = 1; //Read Integer int a = 0; while (v[i] != ':') { a *= 10; a += v[i] - '0'; i++; } //Read : i++; //Read Integer int b = 0; while (v[i] != ':') { b *= 10; b += v[i] - '0'; i++; } //Read : i++; //Read Integer int c = 0; while (v[i] != ':') { c *= 10; c += v[i] - '0'; i++; } //Read : i++; //Read Integer int d = 0; while (v[i] != '>') { d *= 10; d += v[i] - '0'; i++; } //Read > *this = OID(a,b,c,d); } else if ((v[0] == '-') || (v[0] >= '0' && v[0] <= '9')) { if (strchr(v, '.')) { *this = atof(v); } else { int i=0; int num=0; bool neg = false; if (v[0] == '-') { i++; neg = true; } while (v[i] != 0) { num *= 10; num += v[i] - '0'; i++; } if (neg) num = -num; *this = OID(num); } } else { *this = names->lookup(v); } } OID::OID(const OIDAccessor &a) { *this = a.m_obj.get(a.m_key); } void mapLabel(const OID &id, const char* name){ names->add(name, id); } bool doste::dvm::operator==(const OIDAccessor &acc, const OID &o) { return (OID)acc == o; } OID doste::dvm::OID::get(const OID &o) const { Event *evt = new Event(Event::GET, *this); evt->param<0>(o); evt->send(); OID res(evt->result()); delete evt; return res; } void OID::set(const OID &key, const OID &value, bool async) const { Event *evt = new Event(Event::SET, *this); evt->param<0>(key); evt->param<1>(value); evt->send(Event::FLAG_FREE); if (!async) { // Processor::processAll(); //while (evt->type() != 0) { // Processor::processInstant(); //} //delete evt; Processor::processRemaining(); } } void OID::define(const OID &key, const OID &def, bool async) const { Event *evt = new Event(Event::DEFINE, *this); evt->param<0>(key); evt->param<1>(def); evt->param<2>(Null); evt->send(Event::FLAG_FREE); if (!async) { // Processor::processAll(); //while (evt->type() != 0) { //Processor::processInstant(); //} //delete evt; Processor::processRemaining(); } } void OID::define(const OID &key, const OID &def, const OID &init, bool async) const { Event *evt = new Event(Event::DEFINE, *this); evt->param<0>(key); evt->param<1>(def); evt->param<2>(init); evt->send(Event::FLAG_FREE); if (!async) { // Processor::processAll(); //while (evt->type() != 0) { //Processor::processInstant(); //} //delete evt; Processor::processRemaining(); } } void OID::function(const OID &key, const OID &def, bool async) const { Event *evt = new Event(Event::DEFINE_FUNC, *this); evt->param<0>(key); evt->param<1>(def); evt->send(Event::FLAG_FREE); if (!async) { // Processor::processAll(); //while (evt->type() != 0) { // Processor::processInstant(); //} //delete evt; Processor::processRemaining(); } } OID OID::definition(const OID &key) const { Event *evt = new Event(Event::GETDEF, *this); evt->param<0>(key); evt->send(); OID res = evt->result(); delete evt; return res; } int OID::flags(const OID &key) const { Event *evt = new Event(Event::GETFLAGS, *this); evt->param<0>(key); evt->send(); OID res = evt->result(); delete evt; return res; } void OID::flags(const OID &key, int f, bool async) const { Event *evt = new Event(Event::SETFLAGS, *this); evt->param<0>(key); evt->param<1>(f); evt->send(Event::FLAG_FREE); if (!async) { Processor::processRemaining(); } } void OID::dependency(const OID &dest, const OID &attrib, const OID &key) { Event *evt = new Event(Event::ADDDEP, dest); evt->param<0>(attrib); evt->param<1>(*this); evt->param<2>(key); evt->send(Event::FLAG_FREE); } Definition doste::dvm::OID::operator()(const OID &o) const { return (Definition()(*this)(o)); } OID OID::copy(const OID &n) { Event evt(Event::COPY, *this); evt.param<0>(n); evt.send(); return n; } OID OID::create() { Event *evt = new Event(Event::CREATE, local()+OID(0,0,1,0)); evt->send(); OID res(evt->result()); delete evt; return res; } OID::iterator OID::begin() const { return iterator(*this, 0); } OID::iterator OID::end() const { return iterator(*this, -1); }; OIDAccessor &OIDAccessor::operator=(const Definition &d) { m_obj.define(m_key, d, false); return *this; } OID::iterator::iterator(const OID &o, int c) : m_object(o), m_cur(c) { if (c >= 0) { Event *evt = new Event(Event::GET_KEYS, o); evt->send(); m_buf = evt->result(); delete evt; m_buffer = Buffer::lookup(m_buf); if (m_buffer == 0) { m_cur = -1; return; } if (m_buffer->count() == 0) { Buffer::free(m_buf); m_buffer = 0; m_cur = -1; } } }; OID::iterator::~iterator() { if (m_buffer != 0) Buffer::free(m_buf); }; OID OID::iterator::operator*() { if (m_buffer == 0) return Null; return m_buffer->get(m_cur); }; OID::iterator &OID::iterator::operator++() { if (m_buffer == 0) return *this; m_cur++; if (m_cur >= m_buffer->count()) m_cur = -1; if (m_buffer->get(m_cur) == Parent) { m_cur++; if (m_cur >= m_buffer->count()) m_cur = -1; } return *this; }; OID::iterator &OID::iterator::operator++(int) { if (m_buffer == 0) return *this; m_cur++; if (m_cur >= m_buffer->count()) m_cur = -1; if (m_buffer->get(m_cur) == Parent) { m_cur++; if (m_cur >= m_buffer->count()) m_cur = -1; } return *this; }; void OID::toString(char *buf, int len) const { int i = 0; const char *temp; if (*this == True) { strcpy(buf, "true"); return; } else if (*this == False) { strcpy(buf, "false"); return; } else if (isLongLong()) { #ifdef X86_64 long long divisor = 1000000000000000000; #else long long divisor = 1000000000; #endif long long rem; char map[] = {'0','1','2','3','4','5','6','7','8','9', 0, 0, 0}; long long v = m_ll; if (v < 0) { buf[i++] = '-'; v = 0-v; } bool beginout = false; while (divisor > 1) { rem = v / divisor; v = v % divisor; divisor /= 10; if (rem != 0) beginout = true; if (beginout) { buf[i] = map[rem]; i++; } } buf[i] = map[v]; i++; buf[i] = 0; return; } else if (isDouble()) { sprintf(buf, "%0.4f", (float)(*this)); return; } else if (isChar()) { buf[i++] = '\''; buf[i++] = (char)m_d; buf[i++] = '\''; buf[i] = 0; return; } else if (isName()) { temp = names->lookup(*this); if (temp != 0) { strcpy(buf, temp); return; } } else if (isSpecial()) { temp = names->lookup(*this); if (temp != 0) { strcpy(buf, temp); return; } } else if (isModifier()) { temp = names->lookup(*this); if (temp != 0) { strcpy(buf, temp); return; } } buf[0] = '<'; buf[1] = '['; i+=2; int divisor = 1000000000; int rem; char map[] = {'0','1','2','3','4','5','6','7','8','9'}; int v = m_a; bool beginout = false; while (divisor > 1) { rem = v / divisor; v = v % divisor; divisor /= 10; if (rem != 0) beginout = true; if (beginout) { buf[i] = map[rem]; i++; } } buf[i] = map[v]; i++; buf[i++] = ':'; v = m_b; divisor = 1000000000; beginout = false; while (divisor > 1) { rem = v / divisor; v = v % divisor; divisor /= 10; if (rem != 0) beginout = true; if (beginout) { buf[i] = map[rem]; i++; } } buf[i] = map[v]; i++; buf[i++] = ':'; v = m_c; divisor = 1000000000; beginout = false; while (divisor > 1) { rem = v / divisor; v = v % divisor; divisor /= 10; if (rem != 0) beginout = true; if (beginout) { buf[i] = map[rem]; i++; } } buf[i] = map[v]; i++; buf[i++] = ':'; v = m_d; divisor = 1000000000; beginout = false; while (divisor > 1) { rem = v / divisor; v = v % divisor; divisor /= 10; if (rem != 0) beginout = true; if (beginout) { buf[i] = map[rem]; i++; } } buf[i] = map[v]; i++; buf[i++] = ']'; buf[i++] = '>'; buf[i] = 0; } doste-0.3.1/src/library/0000777000175000001440000000000011265574152012075 500000000000000doste-0.3.1/src/library/stream.cpp0000644000175000001440000000330511026675546014015 00000000000000/* * src/library/stream.cpp * * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include using namespace doste; //using namespace doste::dvm; StringStream::StringStream(const char *s) : m_s(s), m_pos(0) { m_size = strlen(s); } int StringStream::read(char *buf, int count) { if (eof()) { buf[0] = 0; return 0; } if (m_pos+count >= m_size) count = m_size-m_pos; memcpy(buf, &m_s[m_pos], count); m_pos += count; return count; } void StringStream::seek(int pos, Seek d) { if (d == CUR) m_pos += pos; else if (d == BEG) m_pos = pos; else m_pos = m_size - pos; if (m_pos < 0) m_pos = 0; if (m_pos > m_size) m_pos = m_size; } char StringStream::peek(int n) { if (eof()) return 0; return m_s[m_pos+n]; } int StringStream::tell() { return m_pos; } bool StringStream::eof() { return (m_pos >= m_size); } int StringStream::size() { return m_size; } doste-0.3.1/src/library/Makefile.am0000644000175000001440000000027511021541064014033 00000000000000lib_LIBRARIES=libdostelib.a libdostelib_a_SOURCES=dstring.cpp file.cpp list.cpp stream.cpp dmsg.cpp libdostelib_a_CPPFLAGS=-fPIC INCLUDES=-I@top_srcdir@/include -I@top_builddir@/include doste-0.3.1/src/library/file.cpp0000644000175000001440000000663711072476375013454 00000000000000/* * src/library/file.cpp * * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include using namespace doste; using namespace doste::dvm; LocalFile::LocalFile() : File() {} LocalFile::LocalFile(const char *pfilename) { filename(pfilename); } LocalFile::LocalFile(const OID &obj) : File(obj) { m_size = 0; } LocalFile::~LocalFile() { } void LocalFile::getLocalFilename(char *buf, int max) { dstring b = base(); dstring f = filename(); //Should check for max... b.toString(buf, b.size()+1); f.toString(&buf[b.size()], f.size()+1); } bool LocalFile::open(Mode m) { mode(m); m_cache = 0; m_pos = 0; dstring b = base(); dstring f = filename(); char *buf = new char[b.size()+f.size()+2]; b.toString(buf, b.size()+1); f.toString(&buf[b.size()], f.size()+1); //std::cout << "LocalFile: " << buf << "\n"; m_stream.open(buf, std::fstream::in | std::fstream::binary); delete [] buf; m_stream.seekg(0, std::fstream::end); m_size = m_stream.tellg(); m_stream.seekg(0, std::fstream::beg); return m_stream.is_open(); } void LocalFile::close() { if (m_cache != 0) delete [] m_cache; m_cache = 0; m_stream.close(); } int LocalFile::read(char *buf, int count) { if (m_size == 0 || !m_stream.is_open()) return 0; if (m_cache == 0) { m_cache = new char[m_size+1]; m_stream.read(m_cache,m_size); } if (eof()) { buf[0] = 0; return 0; } if (count > m_size-m_pos) { count = m_size-m_pos; } int start = m_pos; //m_stream.tellg(); memcpy(buf, &m_cache[m_pos], count); //m_stream.read(buf,count); m_pos += count; //if (eof()) { // buf[((int)m_stream.tellg()) - start] = 0; //} return m_pos - start; } void LocalFile::seek(int pos, Seek d=CUR) { if (d == CUR) { m_pos += pos; } else if (d == BEG) { m_pos = pos; } else { m_pos = m_size - pos; } /*if (d == CUR) { m_stream.seekg(pos, std::fstream::cur); } else if (d == BEG) { m_stream.seekg(pos, std::fstream::beg); } else { m_stream.seekg(pos, std::fstream::end); }*/ } char LocalFile::peek(int n) { if (m_size == 0 || !m_stream.is_open()) return 0; if (m_cache == 0) { m_cache = new char[m_size]; m_stream.read(m_cache,m_size); } if (m_pos+n >= m_size) return 0; return m_cache[m_pos+n]; /*if (n == 0) { char p = m_stream.peek(); if (eof()) return 0; return p; } else { int org = tell(); seek(n, CUR); char p = m_stream.peek(); if (eof()) return 0; seek(org, BEG); return p; }*/ } bool LocalFile::eof() { //return m_stream.eof(); //return (tell() >= size()); return (m_pos >= m_size); } int LocalFile::tell() { //return m_stream.tellg(); return m_pos; } int LocalFile::size() { return m_size; } doste-0.3.1/src/library/Makefile.in0000644000175000001440000003573511265574063014074 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 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@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@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 = src/library 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 = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(libdir)" libLIBRARIES_INSTALL = $(INSTALL_DATA) LIBRARIES = $(lib_LIBRARIES) AR = ar ARFLAGS = cru libdostelib_a_AR = $(AR) $(ARFLAGS) libdostelib_a_LIBADD = am_libdostelib_a_OBJECTS = libdostelib_a-dstring.$(OBJEXT) \ libdostelib_a-file.$(OBJEXT) libdostelib_a-list.$(OBJEXT) \ libdostelib_a-stream.$(OBJEXT) libdostelib_a-dmsg.$(OBJEXT) libdostelib_a_OBJECTS = $(am_libdostelib_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = am__depfiles_maybe = CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ SOURCES = $(libdostelib_a_SOURCES) DIST_SOURCES = $(libdostelib_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__leading_dot = @am__leading_dot@ 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_builddir = @top_builddir@ top_srcdir = @top_srcdir@ lib_LIBRARIES = libdostelib.a libdostelib_a_SOURCES = dstring.cpp file.cpp list.cpp stream.cpp dmsg.cpp libdostelib_a_CPPFLAGS = -fPIC INCLUDES = -I@top_srcdir@/include -I@top_builddir@/include all: all-am .SUFFIXES: .SUFFIXES: .cpp .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 \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps src/library/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu --ignore-deps src/library/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 install-libLIBRARIES: $(lib_LIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(libLIBRARIES_INSTALL) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ $(libLIBRARIES_INSTALL) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ else :; fi; \ done @$(POST_INSTALL) @list='$(lib_LIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ p=$(am__strip_dir) \ echo " $(RANLIB) '$(DESTDIR)$(libdir)/$$p'"; \ $(RANLIB) "$(DESTDIR)$(libdir)/$$p"; \ else :; fi; \ done uninstall-libLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(libdir)/$$p'"; \ rm -f "$(DESTDIR)$(libdir)/$$p"; \ done clean-libLIBRARIES: -test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES) libdostelib.a: $(libdostelib_a_OBJECTS) $(libdostelib_a_DEPENDENCIES) -rm -f libdostelib.a $(libdostelib_a_AR) libdostelib.a $(libdostelib_a_OBJECTS) $(libdostelib_a_LIBADD) $(RANLIB) libdostelib.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c .cpp.o: $(CXXCOMPILE) -c -o $@ $< .cpp.obj: $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` libdostelib_a-dstring.o: dstring.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdostelib_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdostelib_a-dstring.o `test -f 'dstring.cpp' || echo '$(srcdir)/'`dstring.cpp libdostelib_a-dstring.obj: dstring.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdostelib_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdostelib_a-dstring.obj `if test -f 'dstring.cpp'; then $(CYGPATH_W) 'dstring.cpp'; else $(CYGPATH_W) '$(srcdir)/dstring.cpp'; fi` libdostelib_a-file.o: file.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdostelib_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdostelib_a-file.o `test -f 'file.cpp' || echo '$(srcdir)/'`file.cpp libdostelib_a-file.obj: file.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdostelib_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdostelib_a-file.obj `if test -f 'file.cpp'; then $(CYGPATH_W) 'file.cpp'; else $(CYGPATH_W) '$(srcdir)/file.cpp'; fi` libdostelib_a-list.o: list.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdostelib_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdostelib_a-list.o `test -f 'list.cpp' || echo '$(srcdir)/'`list.cpp libdostelib_a-list.obj: list.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdostelib_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdostelib_a-list.obj `if test -f 'list.cpp'; then $(CYGPATH_W) 'list.cpp'; else $(CYGPATH_W) '$(srcdir)/list.cpp'; fi` libdostelib_a-stream.o: stream.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdostelib_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdostelib_a-stream.o `test -f 'stream.cpp' || echo '$(srcdir)/'`stream.cpp libdostelib_a-stream.obj: stream.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdostelib_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdostelib_a-stream.obj `if test -f 'stream.cpp'; then $(CYGPATH_W) 'stream.cpp'; else $(CYGPATH_W) '$(srcdir)/stream.cpp'; fi` libdostelib_a-dmsg.o: dmsg.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdostelib_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdostelib_a-dmsg.o `test -f 'dmsg.cpp' || echo '$(srcdir)/'`dmsg.cpp libdostelib_a-dmsg.obj: dmsg.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdostelib_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdostelib_a-dmsg.obj `if test -f 'dmsg.cpp'; then $(CYGPATH_W) 'dmsg.cpp'; else $(CYGPATH_W) '$(srcdir)/dmsg.cpp'; fi` 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; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ 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; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ 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)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @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 $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: for dir in "$(DESTDIR)$(libdir)"; 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) 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-libLIBRARIES mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-libLIBRARIES install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: 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-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLIBRARIES ctags distclean distclean-compile \ distclean-generic 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-libLIBRARIES 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 pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-libLIBRARIES # 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: doste-0.3.1/src/library/dmsg.cpp0000644000175000001440000000621011026675546013452 00000000000000/* * src/library/dmsg.cpp * * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #ifdef WIN32 #include #undef ERROR #endif using namespace doste; using namespace doste::dvm; namespace doste { DMsg &operator<<(DMsg &m, DMsg::MsgFormatter f) { m.m_type = f; return m; } DMsg &operator<<(DMsg &m, int v) { m << OID(v); return m; } DMsg &operator<<(DMsg &m, const char *str) { #ifdef LINUX switch(m.m_type) { case DMsg::WARNING: std::cout << "\e[33m"; break; case DMsg::ERROR: std::cout << "\e[31;1m"; break; case DMsg::DEBUG: std::cout << "\e[34;1m"; break; case DMsg::FATAL: std::cout << "\e[31;1m"; break; default: break; } #else HANDLE hConsole; hConsole = GetStdHandle(STD_OUTPUT_HANDLE); switch(m.m_type) { case DMsg::WARNING: SetConsoleTextAttribute(hConsole, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY); break; case DMsg::ERROR: SetConsoleTextAttribute(hConsole, FOREGROUND_RED); break; case DMsg::DEBUG: SetConsoleTextAttribute(hConsole, FOREGROUND_BLUE); break; default: break; } #endif std::cout << str; if (m.m_type != DMsg::INFO) { #ifdef LINUX std::cout << "\e[0m"; #else SetConsoleTextAttribute(hConsole, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE); #endif std::cout.flush(); } return m; } DMsg &operator<<(DMsg &m, const OID &o) { #ifdef LINUX switch(m.m_type) { case DMsg::WARNING: std::cout << "\e[33m"; break; case DMsg::ERROR: std::cout << "\e[31;1m"; break; case DMsg::DEBUG: std::cout << "\e[34;1m"; break; case DMsg::FATAL: std::cout << "\e[31;1m"; break; default: break; } #else HANDLE hConsole; hConsole = GetStdHandle(STD_OUTPUT_HANDLE); switch(m.m_type) { case DMsg::WARNING: SetConsoleTextAttribute(hConsole, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY); break; case DMsg::ERROR: SetConsoleTextAttribute(hConsole, FOREGROUND_RED); break; case DMsg::DEBUG: SetConsoleTextAttribute(hConsole, FOREGROUND_BLUE); break; default: break; } #endif char buf[40]; o.toString(buf,40); std::cout << buf; if (m.m_type != DMsg::INFO) { #ifdef LINUX std::cout << "\e[0m"; #else SetConsoleTextAttribute(hConsole, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE); #endif std::cout.flush(); } return m; } }; doste-0.3.1/src/library/list.cpp0000755000175000001440000000000011026675546013465 00000000000000doste-0.3.1/src/library/dstring.cpp0000644000175000001440000000577111056222647014176 00000000000000/* * src/library/dstring.cpp * * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include using namespace doste; using namespace doste::dvm; DString::DString() : m_buffer(0) { m_obj = OID::create(); } DString::DString(const char *str, bool async) : m_buffer(0) { m_obj = OID::create(); int size = strlen(str); for (int i=0; i= max) size = max-1; int j = 0; OID v; Event *evt = new Event(Event::GET_RANGE, m_obj); evt->param<0>(0); evt->param<1>(size); evt->send(); OID boid = evt->result(); Buffer *str2 = Buffer::lookup(boid); delete evt; if (str2 == 0) { str[0] = 0; return; } for (int i=0; iget(i); if (v.isChar()) str[j++] = str2->get(i); else { int k = 0; char buf[500]; v.toString(buf,500); while (buf[k] != 0) { str[j++] = buf[k++]; } } } Buffer::free(boid); str[j] = 0; }; DString::operator const char*() { if (m_buffer == 0) m_buffer = new char[size()+100]; toString(m_buffer,size()+1); return m_buffer; } DString doste::operator+(DString m, const char *str) { int s = m.size(); int s2 = strlen(str); for (int i=0; i #ifdef _MSC_VER #pragma warning ( disable : 4996 ) #endif namespace doste { class DASM : public Notation { public: OBJECT(Notation, DASM); DASM(); DASM(const OID &obj); ~DASM(); bool statement(const dvm::OID &); PROPERTY_RF(dvm::OID, variables, "variables"); PROPERTY_WF(dvm::OID, variables, "variables"); void error(const char *message); private: bool parseObject(OID &cur); bool parseSubExpr(OID &cur); bool parseDefinition(OID &cur, int &i, bool real, bool ncontext=false); bool parseString(OID &cur); bool parseIf(int &i, OID &cur, bool imed=false); bool parseSelect(int &i, OID &cur, bool imed=false); //current base object dvm::OID m_base; }; }; #endif doste-0.3.1/src/directory.cpp0000644000175000001440000000702511110622035013040 00000000000000#include #include #ifdef WIN32 #include #pragma warning ( disable : 4996 ) #endif #ifdef LINUX #include #include #include #include #endif using namespace doste; using namespace doste::dvm; Directory::Directory() : Handler(OID(0,101,0,0), OID(0,101,0,100000)) { addDirectory(".", "."); } Directory::~Directory() { } bool Directory::handle(Event &evt) { switch (evt.type()) { case Event::GET: evt.result(lookupEntry(evt.dest().d(), evt.param<0>())); return true; case Event::ADDDEP: return true; case Event::ADD_REF: return true; case Event::REMOVE_REF: return true; default: return false; } } dvm::OID Directory::lookupEntry(int id, const dvm::OID &entry) { if (id < 0 || id >= m_dirs.size()) return dvm::Null; DirEntry *dir = m_dirs[id]; if (entry.isLongLong()) { if (!dir->available) search(dir); if ((int)entry < 0 || (int)entry >= dir->size) return dvm::Null; return dir->entries[(int)entry]; } else { if (entry == OID("name")) { return dir->name; } else if (entry == dvm::Size) { if (!dir->available) search(dir); return dir->size; } else { return Null; } } } void Directory::search(DirEntry *ent) { //if(directory()==dvm::Null) return 0; //dstring dir = directory(); ent->available = true; int n = 0; #ifdef WIN32 WIN32_FIND_DATA findFileData; int tLen = strlen(ent->path); #ifdef UNICODE //convert directory to wchar_t for unicode wchar_t *wDir = new wchar_t[tLen+3]; mbstowcs(wDir, ent->path, tLen+1); #else //not visual studio (MinGW) uses char char *wDir = new char[tLen+3]; strcpy(wDir, ent->path); #endif wDir[tLen+0] = '/'; //this string must be a search pattern, so add /* to path wDir[tLen+1] = '*'; wDir[tLen+2] = 0; HANDLE hFind = FindFirstFile(wDir, &findFileData); if(hFind != INVALID_HANDLE_VALUE) { do { //convert to char* from wchar_t char f[64]; for(int i=0; i<64; i++) { f[i] = (char) findFileData.cFileName[i]; if(f[i]==0) break; } //add directory or file to database if(findFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { ent->entries[n] = addDirectory(ent->path, f); } else { ent->entries[n] = addFile(ent->path, f); } n++; } while(FindNextFile(hFind, &findFileData)); } FindClose(hFind); #endif #ifdef LINUX DIR *dp; struct stat st; struct dirent *dirp; char buf[500]; if((dp = opendir((const char*)ent->path)) != NULL){ while ((dirp = readdir(dp)) != NULL) { strcpy(buf,ent->path); strcat(buf,"/"); strcat(buf,dirp->d_name); stat(buf, &st); if(S_ISDIR(st.st_mode)) { //std::cout << " add dir " << dirp->d_name << "\n"; ent->entries[n] = addDirectory(ent->path, dirp->d_name); } else { ent->entries[n] = addFile(ent->path, dirp->d_name); } n++; } closedir(dp); } #endif ent->size = n; } dvm::OID Directory::addFile(const char *path, const char* name) { dvm::OID nf = OID::create(); nf.set(dvm::Type, OID("LocalFile"), true); nf.set("filename", dstring(name, true), true); nf.set("base", dstring(path, true), true); Event *evt = new Event(Event::ADD_REF, nf); evt->send(Event::FLAG_FREE); return nf; } dvm::OID Directory::addDirectory(const char *path, const char* name) { DirEntry *nd = new DirEntry; nd->available = false; nd->size = 0; //nd->entries = new OID[MAX_ENTRIES]; nd->name = dstring(name, true); strcpy(nd->path, path); strcat(nd->path, "/"); strcat(nd->path, name); int id = m_dirs.size(); m_dirs.add(nd); return OID(0,101,0,id); } doste-0.3.1/src/agenthandler.cpp0000644000175000001440000000664211056216713013507 00000000000000/* * src/agenthandler.cpp * * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include using namespace doste; using namespace doste::dvm; Vector AgentHandler::s_agents; AgentHandler::AgentQueue AgentHandler::s_queues[2]; int AgentHandler::s_curq = 0; AgentHandler::AgentHandler() : Handler(OID(0,0,15,0),OID(0,0,15,0xFF)) { } AgentHandler::~AgentHandler() { for (int i=0; iparam<0>(evt.param<0>()); evt2->send(Event::FLAG_FREE); } else if (evt.type() == Event::NOTIFY) { //Evaluate condition OID res = s_agents[evt.param<0>()]->cond.evaluate(OID(0,0,15,0), evt.param<0>()); if (((s_agents[evt.param<0>()]->flags & AE_CONDITIONAL) == 0) || (res == dvm::True)) { //Check immediate //if (s_agents[evt.param<0>()]->flags & AE_IMMEDIATE) { s_agents[evt.param<0>()]->agent->notify(evt.param<0>(), s_agents[evt.param<0>()]->localid); //} else { //Add to queue. //s_queues[s_curq].q[s_queues[s_curq].put++] = evt.param<0>(); //} } } return true; } int AgentHandler::add(Agent *agent, int id, Definition cond, unsigned int flags) { AgentEntry *newae = new AgentEntry; newae->agent = agent; newae->localid = id; newae->cond = cond; newae->flags = flags; s_agents.add(newae); //Evaluate condition and call notify if needed. Event *evt = new Event(Event::DEFINE, OID(0,0,15,0)); evt->param<0>(s_agents.size()-1); evt->param<1>(cond); evt->send(Event::FLAG_FREE); return s_agents.size()-1; } void AgentHandler::update(int aid, Agent *agent, int id, Definition cond, unsigned int flags) { AgentEntry *newae = s_agents[aid]; newae->agent = agent; newae->localid = id; newae->cond = cond; newae->flags = flags; //Evaluate condition and call notify if needed. Event *evt = new Event(Event::DEFINE, OID(0,0,15,0)); evt->param<0>(aid); evt->param<1>(cond); evt->send(Event::FLAG_FREE); } void AgentHandler::remove(Agent *agent, int id) { } void AgentHandler::remove(int id) { } void AgentHandler::processAll() { int curq = s_curq; s_curq = (s_curq == 0) ? 1 : 0; s_queues[s_curq].put = 0; //Do some crap here. //Queue should be unique... ie each agent is only evaluated once. //Use two queues and switch between them. for (int i=0; iagent->notify(s_agents[s_queues[curq].q[i]]->localid); } } doste-0.3.1/src/doste.cpp0000644000175000001440000002621211265574030012165 00000000000000/* * src/doste.cpp * * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include #include "module.h" #include "softagent.h" #include "dasm.h" #include #include #include #include #ifdef LINUX #include #include #include #include #include pthread_t uthread; pthread_attr_t uattr; #endif #ifdef WIN32 #include #include #include #endif #ifndef WIN32 #include #define INVALID_SOCKET -1 #define SOCKET_ERROR -1 #include #include #include #include #include #include #include #endif #undef ERROR using namespace doste; using namespace doste::dvm; //DObject static data doste::Map Object::s_map; doste::Map Object::s_reg; doste::List Object::s_list; bool interactive = false; bool settime = true; bool service = false; sockaddr_in localAddr; int service_sock = -1; OID dasm; double ttime; double ttime_last = 0.0; double ttime_draw = 0.0; double dtime = 0.0; long long startticks; namespace doste { OnEvent(XAgent, evt_softagent) { //Make all softagents OID ag = (*this)["agents"]; for (OID::iterator i=ag.begin(); i!=ag.end(); i++) { (SoftAgent*)(ag.get(*i)); //std::cout << "Found agent\n"; } } OnEvent(XAgent, evt_notation) { //Make all softagents OID ag = (*this)["notations"]; for (OID::iterator i=ag.begin(); i!=ag.end(); i++) { (Notation*)(ag.get(*i)); //std::cout << "Found notation\n"; } } OnEvent(XAgent, evt_modules) { //Make all softagents OID ag = (*this)["modules"]; for (OID::iterator i=ag.begin(); i!=ag.end(); i++) { (Module*)(ag.get(*i)); //std::cout << "Found module\n"; } } OnEvent(XAgent, evt_cout) { DEPENDENCY(*this, "cout2"); std::cout << (const char*)dstring(get("cout")); } OnEvent(XAgent, evt_error) { if (get("error") == Null) return; #ifdef LINUX std::cout << "\e[31;1m"; #else HANDLE hConsole; hConsole = GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleTextAttribute(hConsole, FOREGROUND_RED); #endif std::cout << (const char*)dstring(get("error").get("message")) << "\n";; #ifdef LINUX std::cout << "\e[0m"; #else SetConsoleTextAttribute(hConsole, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE); #endif std::cout.flush(); } OnEvent(XAgent, evt_warning) { if (get("warning") == Null) return; #ifdef LINUX std::cout << "\e[33m"; #else HANDLE hConsole; hConsole = GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleTextAttribute(hConsole, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY); #endif std::cout << (const char*)dstring(get("warning").get("message")) << "\n";; #ifdef LINUX std::cout << "\e[0m"; #else SetConsoleTextAttribute(hConsole, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE); #endif std::cout.flush(); } OnEvent(XAgent, evt_debug) { if (get("debug") == Null) return; #ifdef LINUX std::cout << "\e[34;1m"; #else HANDLE hConsole; hConsole = GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleTextAttribute(hConsole, FOREGROUND_BLUE); #endif std::cout << (const char*)dstring(get("debug").get("message")) << "\n";; #ifdef LINUX std::cout << "\e[0m"; #else SetConsoleTextAttribute(hConsole, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE); #endif std::cout.flush(); } OnEvent(XAgent, evt_info) { if (get("info") == Null) return; std::cout << (const char*)dstring(get("info").get("message")) << "\n";; std::cout.flush(); } IMPLEMENT_EVENTS(XAgent, Agent); } long long getTicks() { #ifdef LINUX unsigned long long ticks; struct timeval now; gettimeofday(&now, NULL); ticks = ((unsigned long long)now.tv_sec) * (unsigned long long)1000000 + ((unsigned long long)now.tv_usec); return ticks; #endif #ifdef WIN32 LARGE_INTEGER tks; QueryPerformanceCounter(&tks); return (((unsigned long long)tks.HighPart << 32) + (unsigned long long)tks.LowPart); #endif } void doste::initialise(int argc, char *argv[]) { int n = 1; OID base = OID(1,0,0,0); int ai = 0; int arg_exec[20]; //NOTE: do not hard code. int port = 9001; startticks = getTicks(); for (int i=1; i(); Object::registerType(); Object::registerType(); Object::registerType(); Object::registerType(); Object::registerType(); new XAgent(root); if (ai > 0) { //DASM dasm(doste::dvm::root); for (int i=0; i "; std::cout.flush(); while (root["running"] == true) { #ifdef LINUX ttime = ((double) getTicks() - (double) startticks) / 1000000.0; #endif #ifdef WIN32 LARGE_INTEGER fq; QueryPerformanceFrequency(&fq); ttime = ((double)getTicks() - (double)startticks) / (double)(((unsigned long long)fq.HighPart << 32) + (unsigned long long)fq.LowPart); #endif if (settime) root["time"] = ttime; //root["frametime"] = ttime - ttime_last; //std::cout << "Update FPS: " << 1.0 / (ttime - ttime_last) << "\n"; ttime_draw += (ttime - ttime_last); dtime = (ttime - ttime_last); ttime_last = ttime; if (service) { //UDP check block.tv_sec = 0; block.tv_usec = 0; selres = select(service_sock, 0, 0, 0, &block); //Read the packet. recvfrom(service_sock, ibuf, 1000, 0, (sockaddr*)&fromaddr, &fromlength); ((DASM*)dasm)->execute(ibuf,root); res = ((DASM*)dasm)->result(); if (res.get(Size) != Null && res.get(0).isChar()) { dstring(res).toString(ibuf,1000); } else { res.toString(ibuf, 1000); } sendto(service_sock, ibuf, strlen(ibuf), 0, (sockaddr*)&fromaddr, fromlength); } else if (interactive) { /*if (pos == 0) { std::cout << "> "; } else { std::cout << " "; } std::cout.flush(); std::cin.getline(&ibuf[pos],10000); dasm.execute(ibuf, root); pos = 0;*/ //count = std::cin.readsome(&ibuf[pos], 10000-pos); #ifdef LINUX count = read(0, &ibuf[pos], 10000-pos); #else if(_kbhit()) { ReadConsoleA(GetStdHandle(STD_INPUT_HANDLE), &ibuf[pos], 10000-pos, (unsigned long *)&count, 0); } else { count = 0; } #endif if (count > 0) { pos += count; ibuf[pos] = 0; if (ibuf[pos-1] == '\n') { //We have reached the end of an input statement pos = 0; ((DASM*)dasm)->execute(ibuf,root); DMsg msg(DMsg::INFO); res = dasm.get("result"); //res = ((Notation*)(doste::dvm::root.get("notations").get("dasm")))->execute(ibuf,root); if (!res.isReserved() && res.get(Size) != Null && res.get(0).isChar()) { dstring(res).toString(ibuf,1000); std::cout << " \"" << ibuf << "\"\n"; } else { res.toString(ibuf, 1000); std::cout << " " << ibuf << "\n"; } std::cout << "dasm> "; std::cout.flush(); } } } //Processor::processAll(); if (!Processor::processInstant() && settime) { root["stable"] = Void; } //AgentHandler::processAll(); //if ((ttime_stat - ttime) >= 1.0) { // ttime_stat = ttime; // std::cout << "EPS: " << Processor::getEventCount() << "\n"; //} //Every 60th of a second call Module::updateAll(); //if (ttime_draw >= 0.016) { //if (settime) root["frametime"] = ttime_draw; //ttime_draw = 0.0; //std::cout << "UPDATE ALL\n"; Module::updateAll(dtime); //} } delete [] ibuf; } doste-0.3.1/src/Makefile.in0000644000175000001440000005132411265574063012420 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 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@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@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 = libdoste.so$(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 = am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_libdoste_so_OBJECTS = libdoste_so-doste.$(OBJEXT) \ libdoste_so-agenthandler.$(OBJEXT) \ libdoste_so-notation.$(OBJEXT) libdoste_so-dasm.$(OBJEXT) \ libdoste_so-softagent.$(OBJEXT) libdoste_so-module.$(OBJEXT) \ libdoste_so-messages.$(OBJEXT) libdoste_so-directory.$(OBJEXT) libdoste_so_OBJECTS = $(am_libdoste_so_OBJECTS) libdoste_so_LDADD = $(LDADD) libdoste_so_DEPENDENCIES = dvm/libdvm.a library/libdostelib.a libdoste_so_LINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ $(libdoste_so_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = am__depfiles_maybe = CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libdoste_so_SOURCES) DIST_SOURCES = $(libdoste_so_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 ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = $(libdir) 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_builddir = @top_builddir@ top_srcdir = @top_srcdir@ libdoste_so_SOURCES = doste.cpp agenthandler.cpp notation.cpp dasm.cpp softagent.cpp module.cpp module.h softagent.h dasm.h messages.cpp directory.cpp libdoste_so_CPPFLAGS = -fPIC libdoste_so_LDFLAGS = -shared -lpthread INCLUDES = -I@top_srcdir@/include -I@top_builddir@/include LDADD = dvm/libdvm.a library/libdostelib.a SUBDIRS = dvm library all: all-recursive .SUFFIXES: .SUFFIXES: .cpp .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 \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps src/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu --ignore-deps 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 install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) libdoste.so$(EXEEXT): $(libdoste_so_OBJECTS) $(libdoste_so_DEPENDENCIES) @rm -f libdoste.so$(EXEEXT) $(libdoste_so_LINK) $(libdoste_so_OBJECTS) $(libdoste_so_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c .cpp.o: $(CXXCOMPILE) -c -o $@ $< .cpp.obj: $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` libdoste_so-doste.o: doste.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdoste_so_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdoste_so-doste.o `test -f 'doste.cpp' || echo '$(srcdir)/'`doste.cpp libdoste_so-doste.obj: doste.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdoste_so_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdoste_so-doste.obj `if test -f 'doste.cpp'; then $(CYGPATH_W) 'doste.cpp'; else $(CYGPATH_W) '$(srcdir)/doste.cpp'; fi` libdoste_so-agenthandler.o: agenthandler.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdoste_so_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdoste_so-agenthandler.o `test -f 'agenthandler.cpp' || echo '$(srcdir)/'`agenthandler.cpp libdoste_so-agenthandler.obj: agenthandler.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdoste_so_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdoste_so-agenthandler.obj `if test -f 'agenthandler.cpp'; then $(CYGPATH_W) 'agenthandler.cpp'; else $(CYGPATH_W) '$(srcdir)/agenthandler.cpp'; fi` libdoste_so-notation.o: notation.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdoste_so_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdoste_so-notation.o `test -f 'notation.cpp' || echo '$(srcdir)/'`notation.cpp libdoste_so-notation.obj: notation.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdoste_so_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdoste_so-notation.obj `if test -f 'notation.cpp'; then $(CYGPATH_W) 'notation.cpp'; else $(CYGPATH_W) '$(srcdir)/notation.cpp'; fi` libdoste_so-dasm.o: dasm.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdoste_so_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdoste_so-dasm.o `test -f 'dasm.cpp' || echo '$(srcdir)/'`dasm.cpp libdoste_so-dasm.obj: dasm.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdoste_so_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdoste_so-dasm.obj `if test -f 'dasm.cpp'; then $(CYGPATH_W) 'dasm.cpp'; else $(CYGPATH_W) '$(srcdir)/dasm.cpp'; fi` libdoste_so-softagent.o: softagent.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdoste_so_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdoste_so-softagent.o `test -f 'softagent.cpp' || echo '$(srcdir)/'`softagent.cpp libdoste_so-softagent.obj: softagent.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdoste_so_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdoste_so-softagent.obj `if test -f 'softagent.cpp'; then $(CYGPATH_W) 'softagent.cpp'; else $(CYGPATH_W) '$(srcdir)/softagent.cpp'; fi` libdoste_so-module.o: module.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdoste_so_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdoste_so-module.o `test -f 'module.cpp' || echo '$(srcdir)/'`module.cpp libdoste_so-module.obj: module.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdoste_so_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdoste_so-module.obj `if test -f 'module.cpp'; then $(CYGPATH_W) 'module.cpp'; else $(CYGPATH_W) '$(srcdir)/module.cpp'; fi` libdoste_so-messages.o: messages.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdoste_so_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdoste_so-messages.o `test -f 'messages.cpp' || echo '$(srcdir)/'`messages.cpp libdoste_so-messages.obj: messages.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdoste_so_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdoste_so-messages.obj `if test -f 'messages.cpp'; then $(CYGPATH_W) 'messages.cpp'; else $(CYGPATH_W) '$(srcdir)/messages.cpp'; fi` libdoste_so-directory.o: directory.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdoste_so_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdoste_so-directory.o `test -f 'directory.cpp' || echo '$(srcdir)/'`directory.cpp libdoste_so-directory.obj: directory.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdoste_so_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdoste_so-directory.obj `if test -f 'directory.cpp'; then $(CYGPATH_W) 'directory.cpp'; else $(CYGPATH_W) '$(srcdir)/directory.cpp'; fi` # 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): @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; \ (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): @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; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (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; nonemtpy = 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) tags=; \ 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 || \ tags="$$tags $$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; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ 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)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @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 $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(PROGRAMS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)"; 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) 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-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-exec-am: install-binPROGRAMS install-html: install-html-recursive install-info: install-info-recursive install-man: install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-binPROGRAMS \ clean-generic ctags ctags-recursive distclean \ distclean-compile distclean-generic 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-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-compile mostlyclean-generic pdf pdf-am \ ps ps-am tags tags-recursive uninstall uninstall-am \ uninstall-binPROGRAMS # 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: doste-0.3.1/src/dasm.cpp0000644000175000001440000004707611230625043011777 00000000000000/* * src/dasm.cpp * * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "dasm.h" #include #include #include #include #include using namespace doste; using namespace doste::dvm; using namespace doste::token; char errbuf[100]; DASM::DASM() { if (get("variables") == Null) set("variables", OID::create()); } DASM::DASM(const OID &obj) : Notation(obj) { if (get("variables") == Null) set("variables", OID::create()); } DASM::~DASM() { } bool DASM::statement(const OID &base) { //Parse Number //Parse alphanumeric //Parse = //Parse is //Parse func //Parse new //Parse ( //Parse [ //Parse { //Parse # //Parse ! //Parse " //Parse ' //Parse m_base = base; WhiteSpace ws; parseValue(ws); m_lines += ws.count; if (parse(Keyword("%list"))) { char buf[50]; parseValue(ws); m_lines += ws.count; parseSubExpr(m_result); for (OID::iterator i=m_result.begin(); i!=m_result.end(); i++) { (*i).toString(buf,50); std::cout << "\t" << buf << " = "; m_result.get(*i).toString(buf,50); std::cout << buf << "\n"; } } else { if (!parseSubExpr(m_result)) { error("Failed to complete script."); } } //DMsg msg(DMsg::INFO); //msg << " " << m_result << "\n"; set("result", m_result); return false; } bool DASM::parseString(OID &cur) { int i=0; cur = OID::create(); AnyChar p; while (parseValue(p) && (p.value != '"')) { if (p.value == '\\') { parseValue(p); switch (p.value) { case 'n': cur[i++] = '\n'; break; case 't': cur[i++] = '\t'; break; case '\\': cur[i++] = '\\'; break; default: cur[i++] = p.value; } } else { cur[i++] = p.value; } } cur[Size] = i; return true; } bool DASM::parseObject(OID &cur) { Integer<10> integer; Float real; AlphaNumericX alpha; if (parseValue(real)) cur = real.value; else if (parseValue(integer)) cur = integer.value; else if (parse(Char<1>('\''))) { //Now parse next char char c; stream->read(c); if (c == '\\') { stream->read(c); switch (c) { case 'n': cur = '\n'; break; case 't': cur = '\t'; break; default: cur = c; } } else { cur = c; } parse(Char<1>('\'')); } else if (parse(Char<1>('*'))) cur = Multiply; else if (parse(Char<1>('$'))) cur = Key; else if (parse(Char<1>('-'))) cur = Subtract; else if (parse(Char<1>('/'))) cur = Divide; else if (parse(Char<1>('+'))) cur = Add; else if (parse(Char<1>('>'))) cur = Greater; //else if (parse(Char<1>('>'))) cur = Greater; else if (parse(Char<1>('|'))) cur = Or; else if (parse(Char<1>('&'))) cur = And; else if (parse(Char<1>('?'))) cur = Question; else if (parse(Char<1>('%'))) cur = Percent; else if (parse(Char<1>('!'))) cur = modifiers::NoDep; else if (parse(Char<1>('@'))) { //This is a variable. if (parseValue(alpha)) { cur = variables().get(alpha.value); } else { cur = At; } } else if (parse(Keyword(".."))) cur = Parent; else if (parse(Char<1>('.'))) cur = This; else if (parseValue(alpha)) cur = OID(alpha.value); else if (parse(Char<1>('~'))) cur = modifiers::NoDep; else if (parse(Char<1>(';'))) cur = modifiers::Seq; else if (parse(Keyword("=="))) cur = modifiers::Compare; else if (parse(Char<1>('"'))) parseString(cur); //else if (parse(Char<1>('('))) return parseSubExpr(cur); else if (parse(Char<2>("<["))) { parseValue(integer); cur.m_a = (unsigned int)integer.value; parse(Char<1>(':')); parseValue(integer); cur.m_b = (unsigned int)integer.value; parse(Char<1>(':')); parseValue(integer); cur.m_c = (unsigned int)integer.value; parse(Char<1>(':')); parseValue(integer); cur.m_d = (unsigned int)integer.value; parse(Char<2>("]>")); } else if (parse(Char<1>('<'))) cur = Less; else { return false; } return true; } bool DASM::parseIf(int &i, OID &cur, bool imed) { //Now parse condition OID condition; WhiteSpace ws; int oldi = i; i += 2; int zero = 0; parseValue(ws); m_lines += ws.count; if (parse(Char<1>('('))) { if (imed) parseSubExpr(condition); else { cur.set(i++, modifiers::BeginSub); parseDefinition(cur, i, true); cur.set(i++, modifiers::EndSub); } if (!parse(Char<1>(')'))) { error("Missing ) in if statement"); return false; } } else { error("An if must be followed by some condition."); return false; } //Parse true part OID truepart; bool abstrue = false; parseValue(ws); m_lines += ws.count; if (parse(Char<1>('{'))) { zero = 0; truepart = OID::create(); if (!parseDefinition(truepart, zero, true)) return false; if (!parse(Char<1>('}'))) { error("Missing } in if statement"); return false; } } else { if (!parseObject(truepart)) { error("An object or definition must be given in an if statement."); return false; } abstrue = true; } zero = 0; //We may now have an else parseValue(ws); m_lines += ws.count; OID elsepart = Null; bool abselse = false; if (parse(Keyword("else"))) { parseValue(ws); m_lines += ws.count; if (parse(Char<1>('{'))) { zero = 0; elsepart = OID::create(); if (!parseDefinition(elsepart, zero, true)) return false; if (!parse(Char<1>('}'))) { error("Missing } if statement"); return false; } } else if (parse(Keyword("if"))) { zero = 0; elsepart = OID::create(); if (!parseIf(zero, elsepart, imed)) return false; } else { if (!parseObject(elsepart)) { error("An object or definition must be given in an if statement."); return false; } abselse = true; } } //Now actually construct the if. OID ifobj = OID::create(); if (abstrue) ifobj.set(True, truepart, true); else ifobj.function(True, truepart, true); if (abselse) ifobj.set(Key, elsepart, false); else ifobj.function(Key, elsepart, false); if (imed) { cur = ifobj.get(condition); } else { cur.set(oldi++, ifobj, true); cur.set(oldi++, doste::dvm::modifiers::NoDep, true); //cur.function(i++, condition, false); } return true; } bool DASM::parseSelect(int &i, OID &cur, bool imed) { OID selector; OID selobj = OID::create(); OID caseval; OID rhsval; WhiteSpace ws; int oldi = i; int zero = 0; i += 2; //Parse the selector value parseValue(ws); m_lines += ws.count; if (parse(Char<1>('('))) { if (imed) parseSubExpr(selector); else { cur.set(i++, modifiers::BeginSub); parseDefinition(cur, i, true); cur.set(i++, modifiers::EndSub); } if (!parse(Char<1>(')'))) { error("Missing ) in select"); return false; } } else { error("A select must be followed by some definition."); return false; } //Now parse starting brace parseValue(ws); m_lines += ws.count; if (!parse(Char<1>('{'))) { error("Missing '{' in select."); return false; } //Until a closing brace is found, parse cases while (!stream->eof()) { parseValue(ws); m_lines += ws.count; if (parse(Char<1>('}'))) break; else { //Parse an object (or expression) if (!parseObject(caseval)) { error("Missing case value in select statement."); return false; } //Parse a : if (!parse(Char<1>(':'))) { error("Missing a ':' after a select case value."); return false; } parseValue(ws); m_lines += ws.count; //Parse object, expression or definition if (parse(Char<1>('('))) { //TODO } else if (parse(Char<1>('{'))) { zero = 0; rhsval = OID::create(); if (!parseDefinition(rhsval, zero, true)) return false; if (!parse(Char<1>('}'))) { error("Missing } in select case"); return false; } selobj.function(caseval,rhsval,false); } else if (parseObject(rhsval)) { selobj.set(caseval, rhsval,false); } else { error("The right-hand-side of a select case must be an expression, definition or value."); return false; } } } if (imed) { cur = selobj.get(selector); } else { cur.set(oldi++, selobj, true); cur.set(oldi++, doste::dvm::modifiers::NoDep, true); } return true; } bool DASM::parseDefinition(OID &cur, int &i, bool real, bool ncontext) { AlphaNumeric alpha; WhiteSpace ws; bool deep = false; int zero = 0; //if (i == 0) cur = OID::create(); OID key, value; parseValue(ws); m_lines += ws.count; while (parse(Block<>('#','\n'))) { parseValue(ws); m_lines += ws.count; }; //if (ncontext) { // cur.set(i++, modifiers::NoContext); //} //If statements if (parse(Keyword("if"))) { if (!parseIf(i, cur)) return false; } else if (parse(Keyword("select"))) { if (!parseSelect(i, cur)) return false; } else if (parse(Keyword("%deep"))) { deep = true; } else { //Read the base object if (!parseObject(value)) { error("Unable to parse definition"); return false; } cur.set(i++, value); } //Now read more until something special is encountered. while (!stream->eof()) { parseValue(ws); m_lines += ws.count; while (parse(Block<>('#','\n'))) { parseValue(ws); m_lines += ws.count; }; if (parse(Keyword("if"))) { if (!parseIf(i, cur)) return false; } else if (parse(Keyword("select"))) { if (!parseSelect(i, cur)) return false; } else if (parse(Keyword("is"))) { cur.set(i, cur.get(i-1)); cur.set(i-1, modifiers::Define); i++; } else if (parse(Keyword("func"))) { cur.set(i, cur.get(i-1)); cur.set(i-1, modifiers::DefineFunc); i++; } else if (parse(Keyword("new"))) { cur.set(i++, modifiers::Create); //} else if (parse(Keyword("clone"))) { // cur.set(i++, modifiers::Clone); } else if (parse(Keyword("%deep"))) { deep = true; } else if (parse(Keyword("=="))) { cur.set(i++, modifiers::Compare); } else if (parse(Char<1>('='))) { cur.set(i, cur.get(i-1)); cur.set(i-1, modifiers::Set); i++; } else if (parse(Keyword(".."))) { cur.set(i++, Parent); } else if (parse(Char<1>('('))) { if (real) { //if (!parseDefinition(cur, i, true, true)) return false; //cur.function(i++, value); cur.set(i++, modifiers::BeginSub); if (!parseDefinition(cur,i,true)) return false; if (!parse(Char<1>(')'))) { error("Missing )"); return false; } cur.set(i++, modifiers::EndSub); } else { if (!parseSubExpr(value)) return false; cur.set(i++, value); if (!parse(Char<1>(')'))) { error("Missing )"); return false; } } } else if (parse(Char<1>('{'))) { //if (real && !dot) { zero = 0; value = OID::create(); if (!parseDefinition(value, zero, true)) return false; if (!parse(Char<1>('}'))) { error("Missing }"); return false; } cur.set(i++, value); //} else { // dot = false; // if (!parseSubExpr(value)) return false; // cur.set(i++, value); //} //} else if (real && parse(Char<1>(')'))) { // cur.set(i++, modifiers::EndSub); } else if (parse(Char<1>(')')) || parse(Char<1>(']')) || parse(Char<1>('}'))) { //cur = cur.get(key); //cur.set(i++,key); cur.set(Size, i); stream->seek(-1, Stream::CUR); return true; }else if (parseObject(value)) { //DMsg msg(DMsg::DEBUG); //if (!first) { cur.set(i++, value); //} else { // first = false; //} //key = OID(value); } else if (!parse(Char<1>(0))) { error("I could not understand a statement on this line (def)"); return false; } } //cur.set(i++,key); cur.set(Size, i); return true; } #undef This bool DASM::parseSubExpr(OID &cur) { AlphaNumeric alpha; WhiteSpace ws; bool first = true; int lop = 0; int i; bool deep = false; int zero = 0; parseValue(ws); m_lines += ws.count; while (parse(Block<>('#','\n'))) { parseValue(ws); m_lines += ws.count; }; OID key, value; //First need to check for variable assignment. if (parse(Char<1>('@'))) { if (!parseValue(alpha)) { error("Expected a name after the variable identifier '@'"); return false; } //Now must check for equals parseValue(ws); m_lines += ws.count; if (parse(Char<1>('='))) { parseValue(ws); m_lines += ws.count; if (parse(Char<1>('('))) { if (!parseSubExpr(cur)) return false; if (!parse(Char<1>(')'))) { error("Missing )"); return false; } } else { if (!parseObject(cur)) { error("Variable must be followed by expression or object"); return false; } } variables().set(alpha.value, cur); //cur = Null; //parse(Char<1>(';')); } else { cur = variables().get(alpha.value); } } else if (parse(Char<1>('('))) { if (!parseSubExpr(cur)) return false; if (!parse(Char<1>(')'))) { error("Missing )"); return false; } } else if (parse(Keyword("if"))) { if (!parseIf(i, cur, true)) return false; } else if (parse(Keyword("select"))) { if (!parseSelect(i, cur, true)) return false; } else if (parse(Keyword("%deep"))) { deep = true; } else { //Read the base object if (!parseObject(cur)) { //error("An expression must start with an object, if, select, expression, a % tag or @ variable"); return true; } } if (cur == This) cur = m_base; //doste::dvm::root; if (cur == modifiers::Create) cur = OID::create(); //Now read more until something special is encountered. while (!stream->eof()) { parseValue(ws); m_lines += ws.count; while (parse(Block<>('#','\n'))) { parseValue(ws); m_lines += ws.count; }; if (parse(Char<1>('='))) { if (parse(Char<1>('='))) { //Comparison if (!parseSubExpr(value)) return false; if (cur == value) cur = True; else cur = False; continue; } else { lop = 0; parseValue(ws); m_lines += ws.count; if (parse(Char<1>('{'))) { zero = 0; value = OID::create(); if (!parseDefinition(value, zero, true)) return false; if (!parse(Char<1>('}'))) { error("Missing } in assignment"); return false; } cur.set(key, value); continue; } else if (parse(Char<1>('['))) { zero = 0; value = OID::create(); if (!parseDefinition(value, zero, false)) return false; if (!parse(Char<1>(']'))) { error("Missing ] in assignment"); return false; } cur.set(key, value); continue; } else if (parseObject(value)) { cur.set(key, value); continue; } else if (parse(Char<1>('('))) { if (!parseSubExpr(value)) return false; if (!parse(Char<1>(')'))) { error("Missing ) in assignment"); return false; } cur.set(key, value); continue; } else if (parse(Char<1>('='))) { cur.set(key, modifiers::Compare); } else { error("A '(' or '[' is expected after an 'is'."); return false; } } } else if (parse(Char<1>('('))) { if (!parseSubExpr(value)) return false; if (!first && (lop == 1)) { cur = cur.get(key); } else { first = false; } lop = 1; key = value; if (deep) { cur.flags(key, OID::FLAG_DEEP); deep = false; } if (!parse(Char<1>(')'))) { error("Missing )"); return false; } } else if (parse(Keyword("union"))) { if (lop == 1) cur = cur.get(key); lop = 0; parseValue(ws); m_lines += ws.count; if (parse(Char<1>('{'))) { zero = 0; value = OID::create(); if (!parseDefinition(value, zero, true)) return false; if (!parse(Char<1>('}'))) { error("Missing } in union"); return false; } } else if (parse(Char<1>('('))) { if (!parseSubExpr(value)) return false; if (!parse(Char<1>(')'))) { error("Missing ) in union"); return false; } } else { error("A '(' or '[' is expected after an 'is'."); return false; } value.copy(cur); //Now sync it. //Processor::processRemaining(); continue; } else if (parse(Keyword("is"))) { lop = 0; parseValue(ws); m_lines += ws.count; if (parse(Char<1>('{'))) { zero = 0; value = OID::create(); if (!parseDefinition(value, zero, true)) return false; if (!parse(Char<1>('}'))) { error("Missing } in definition"); return false; } cur.define(key, value); continue; } else if (parse(Char<1>('('))) { if (!parseSubExpr(value)) return false; if (!parse(Char<1>(')'))) { error("Missing ) in definition"); return false; } cur.define(key, value); continue; } else { error("A '(' or '[' is expected after an 'is'."); return false; } } else if (parse(Keyword("func"))) { lop = 0; parseValue(ws); m_lines += ws.count; if (parse(Char<1>('{'))) { zero = 0; value = OID::create(); if (!parseDefinition(value, zero, true)) return false; if (!parse(Char<1>('}'))) { error("Missing } in function"); return false; } cur.function(key, value); continue; } else if (parse(Char<1>('('))) { if (!parseSubExpr(value)) return false; if (!parse(Char<1>(')'))) { error("Missing ) in function"); return false; } cur.function(key, value); continue; } else { error("A '(' or '[' is expected after an 'is'."); return false; } } else if (parse(Char<1>(';'))) { if (lop == 1) cur = cur.get(key); lop = 0; parseValue(ws); m_lines += ws.count; while (parse(Block<>('#','\n'))) { parseValue(ws); m_lines += ws.count; }; if (stream->eof()) break; if (parse(Char<1>('@'))) { if (!parseValue(alpha)) { error("Expected a name after the variable identifier '@'"); return false; } //Now must check for equals parseValue(ws); m_lines += ws.count; if (parse(Char<1>('='))) { parseValue(ws); m_lines += ws.count; if (parse(Char<1>('('))) { if (!parseSubExpr(cur)) return false; if (!parse(Char<1>(')'))) { error("Missing )"); return false; } } else { if (!parseObject(cur)) { error("Variable must be followed by expression or object"); return false; } } variables().set(alpha.value, cur); //cur = Null; //parse(Char<1>(';')); } else { cur = variables().get(alpha.value); } } else if (parse(Char<1>('('))) { if (!parseSubExpr(cur)) return false; if (!parse(Char<1>(')'))) { error("Missing )"); return false; } } else if (parse(Keyword("if"))) { if (!parseIf(i, cur, true)) return false; } else if (parse(Keyword("select"))) { if (!parseSelect(i, cur, true)) return false; } else { //Read the base object if (!parseObject(cur)) { error("A ; must be followed by an object, expression, if or select"); return false; } } if (cur == This) cur = doste::dvm::root; if (cur == modifiers::Create) cur = OID::create(); } else if (parse(Char<1>(')'))) { if (lop == 1) cur = cur.get(key); stream->seek(-1,Stream::CUR); return true; } else if (parse(Keyword("%deep"))) { deep = true; } else if (parseObject(value)) { if (!first && (lop == 1)) { cur = cur.get(key); } else { first = false; } lop = 1; key = value; if (deep) { cur.flags(key, OID::FLAG_DEEP); deep = false; } } else if (!parse(Char<1>(0))) { error("I could no understand a statement on this line"); return false; } } if (lop == 1) cur = cur.get(key); return true; } void DASM::error(const char *message) { char msg[2000]; strcpy(msg, "DASM: "); OID(m_lines+1).toString(&msg[strlen(msg)], 500); strcat(msg, ": "); strcat(msg,message); Error(Error::SYNTAX, msg); } doste-0.3.1/src/softagent.cpp0000644000175000001440000000707711043554734013054 00000000000000/* * src/softagent.cpp * * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "softagent.h" #include using namespace doste; using namespace doste::dvm; SoftAgent::SoftAgent() : m_aid(-1) { //std::cout << "Making Soft Agent2\n"; //AgentHandler::add(this, 0, (*this)("observable"), 0); AgentHandler::add(this, 0, (*this)("condition"), AgentHandler::AE_CONDITIONAL); AgentHandler::add(this, 1, (*this)("code"), 0); } SoftAgent::SoftAgent(const OID &obj) : Agent(obj), m_aid(-1) { //std::cout << "Making Soft Agent\n"; //AgentHandler::add(this, 0, (*this)("observable"), 0); AgentHandler::add(this, 0, (*this)("condition"), AgentHandler::AE_CONDITIONAL); AgentHandler::add(this, 1, (*this)("code"), 0); } SoftAgent::~SoftAgent() { } bool SoftAgent::notify(int aid, int id) { if (id == 0) onExecute(); else if (id == 1) onCodeChange(); return true; } void SoftAgent::onTriggerChange() { //Remove previous triggers? //if (m_aid == -1) // m_aid = AgentHandler::add(this, 2, object()(observable()), (immediate()) ? AgentHandler::AE_IMMEDIATE : 0); //else // AgentHandler::update(m_aid, this, 2, object()(observable()), (immediate()) ? AgentHandler::AE_IMMEDIATE : 0); //if ( } void SoftAgent::onExecute() { //Loop through code std::cout << "EXECUTE\n"; OID c = code(); int size = c.get(Size); int t1,t2,t3; OID reg[MAX_REGISTERS]; for (int i=0; i #include using namespace doste; using namespace doste::dvm; #ifdef _MSC_VER #pragma warning(disable:4996) #endif Module *Module::s_modules[Module::MAX_MODULES] = {0}; #undef ERROR Module::Module(const OID &obj) : Agent(obj), m_ltime(0.0) { char buf[300]; File *f = get("file"); if (f == 0) { Error(Error::MODULE_NOT_FOUND, "Invalid module file"); return; } f->getLocalFilename(buf,300); Info(Info::LOADING, "Loading module: " + f->filename()); std::cout.flush(); #ifdef LINUX m_handle = dlopen(buf, RTLD_NOW); #else #ifdef UNICODE int len = strlen(buf) + 1; wchar_t *wbuf = new wchar_t[len]; mbstowcs(wbuf, buf, len); m_handle = LoadLibrary((LPCWSTR)wbuf); #else m_handle = LoadLibrary(buf); #endif #endif if (m_handle == 0) { DMsg msg(DMsg::ERROR); #ifdef LINUX Error(Error::INVALID_MODULE, dlerror()); #else Error(Error::INVALID_MODULE, dstring("Could not load library [") + (int)GetLastError() + "]"); #endif return; } //Initialise the module #ifdef LINUX m_init = dlsym(m_handle, "initialise"); #else m_init = (void*)GetProcAddress(m_handle, "initialise"); #endif if (m_init == 0) { Error(Error::INVALID_MODULE, "The module is missing an 'initialise' function"); return; } m_base = get("base"); m_doupdate = get("update"); m_freq = (double)get("frequency"); #ifdef LINUX m_update = dlsym(m_handle, "update"); #else m_update = (void*)GetProcAddress(m_handle, "update"); #endif //m_docreate = true; ((void (*)(const OID &))m_init)(m_base); for (unsigned int i=0; im_ltime += dtime; if (s_modules[i]->m_ltime >= s_modules[i]->m_freq) { s_modules[i]->m_ltime = 0.0; s_modules[i]->update(); } } else { return; } } } doste-0.3.1/src/notation.cpp0000644000175000001440000000470111056264111012673 00000000000000/* * src/notation.cpp * * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include using namespace doste; using namespace doste::dvm; namespace doste { OnEvent(Notation, evt_run) { if (get("run") == Null) return; File *s = get("run"); if (s == 0 || !s->open(File::READ)) { Warning(Warning::SCRIPT_NOT_FOUND, "Failed to load script " + ((s!=0) ? s->filename() : "")); return; } Info(Info::LOADING, "Loading script " + s->filename()); OID res = execute(s, doste::dvm::root); s->close(); } OnEvent(Notation, evt_execute) { if (get("execute") == Null) return; dstring s(get("execute")); //std::cout << "Executing: " << (const char*)s << "\n"; execute((const char *)s, doste::dvm::root); } IMPLEMENT_EVENTS(Notation, Agent); }; OID Notation::run(const char *filename, const OID &base) { File *s = new LocalFile(filename); if (!s->open(File::READ)) { Warning(Warning::SCRIPT_NOT_FOUND, dstring("Failed to load script ") + filename); return Null; } Info(Info::LOADING, dstring("Loading script ") + filename); OID res = execute(s, base); s->close(); delete s; return res; } OID Notation::execute(const char *str, const OID &base) { StringStream *s = new StringStream(str); OID res = execute(s, base); delete s; return res; } OID Notation::execute(Stream *s, const OID &base) { Stream *oldstream = stream; OID oldres = m_result; int oldlines = m_lines; m_lines = 0; stream = s; while (statement(base)); stream = oldstream; OID newres = m_result; m_result = oldres; m_lines = oldlines; return newres; } doste-0.3.1/src/module.h0000644000175000001440000000303311026675750012003 00000000000000/* * src/module.h * * Loads DLL modules at run-time. * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _doste_MODULE_H_ #define _doste_MODULE_H_ #include #ifdef WIN32 #include #endif #ifdef LINUX #include #endif namespace doste { class Module : public Agent { public: OBJECT(Agent, Module); Module(const OID &obj); ~Module(); void update(); static void updateAll(double dtime); private: #ifdef LINUX void *m_handle; #else HMODULE m_handle; #endif void *m_update; void *m_init; bool m_docreate; bool m_doupdate; dvm::OID m_base; double m_ltime; double m_freq; static const unsigned int MAX_MODULES = 50; static Module *s_modules[MAX_MODULES]; }; }; #endif doste-0.3.1/src/messages.cpp0000644000175000001440000000314411026675750012663 00000000000000/* * src/messages.cpp * * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include using namespace doste; using namespace doste::dvm; Error::Error(int id, dstring msg) { OID err = OID::create(); err.set("message", msg); err.set("number", id); //Timestamp? root.set("error", err, true); } Warning::Warning(int id, dstring msg) { OID warn = OID::create(); warn.set("message", msg); warn.set("number", id); //Timestamp? root.set("warning", warn, true); } Debug::Debug(int id, dstring msg) { OID dbg = OID::create(); dbg.set("message", msg); dbg.set("number", id); //Timestamp? root.set("debug", dbg, true); } Info::Info(int id, dstring msg) { OID info = OID::create(); info.set("message", msg); info.set("number", id); //Timestamp? root.set("info", info, true); } doste-0.3.1/src/softagent.h0000644000175000001440000000377211043554411012507 00000000000000/* * src/softagent.h * * Copyright (C) 2008 Nicolas Pope * * Author(s) : Nicolas Pope * Date : 2008 * Home Page : http://www.doste.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _doste_SOFTAGENT_H_ #define _doste_SOFTAGENT_H_ #include namespace doste { namespace dvm { class OID; }; class SoftAgent : public Agent { public: OBJECT(Agent,SoftAgent); SoftAgent(); SoftAgent(const dvm::OID &obj); ~SoftAgent(); bool notify(int aid, int id); PROPERTY_RF(bool, immediate, "immediate"); PROPERTY_WF(bool, immediate, "immediate"); PROPERTY_RF(bool, conditional, "condition"); PROPERTY_WF(bool, conditional, "condition"); PROPERTY_RF(dvm::OID, code, "code"); PROPERTY_WF(dvm::OID, code, "code"); //Events to detect object, observable or code changes. void onTriggerChange(); void onCodeChange(); void onExecute(); static const unsigned int MAX_REGISTERS = 10; static const int SSET = 0; static const int ASET = 1; static const int SDEF = 2; static const int ADEF = 3; static const int SFUN = 4; static const int AFUN = 5; static const int SGET = 6; static const int GDEF = 7; static const int GFUN = 8; static const int CREA = 9; static const int ISET = 10; private: int m_aid; //Compiled code (JIT) might go here. }; }; #endif doste-0.3.1/scripts/0000777000175000001440000000000011265574152011331 500000000000000doste-0.3.1/scripts/Makefile.am0000644000175000001440000000016711026435611013274 00000000000000resdir = $(datadir)/@PACKAGE@/scripts res_DATA=linux.dasm boolean.dasm common.dasm console.dasm EXTRA_DIST=$(res_DATA) doste-0.3.1/scripts/Makefile.in0000644000175000001440000002273511265574062013323 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 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@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@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 = scripts DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/linux.dasm.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 = linux.dasm depcomp = am__depfiles_maybe = 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 = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(resdir)" resDATA_INSTALL = $(INSTALL_DATA) DATA = $(res_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__leading_dot = @am__leading_dot@ 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_builddir = @top_builddir@ top_srcdir = @top_srcdir@ resdir = $(datadir)/@PACKAGE@/scripts res_DATA = linux.dasm boolean.dasm common.dasm console.dasm EXTRA_DIST = $(res_DATA) 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 \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps scripts/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu --ignore-deps scripts/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 linux.dasm: $(top_builddir)/config.status $(srcdir)/linux.dasm.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-resDATA: $(res_DATA) @$(NORMAL_INSTALL) test -z "$(resdir)" || $(MKDIR_P) "$(DESTDIR)$(resdir)" @list='$(res_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(resDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(resdir)/$$f'"; \ $(resDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(resdir)/$$f"; \ done uninstall-resDATA: @$(NORMAL_UNINSTALL) @list='$(res_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(resdir)/$$f'"; \ rm -f "$(DESTDIR)$(resdir)/$$f"; \ done 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 $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(resdir)"; 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) 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 mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-resDATA install-dvi: install-dvi-am 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 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 pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-resDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic 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-resDATA install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \ uninstall-am uninstall-resDATA # 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: doste-0.3.1/scripts/linux.dasm0000644000175000001440000000053311265574137013256 00000000000000#Create relevant structures to initialise the system #Nicolas Pope this os = linux; #Script path as specified by configure script when building this path = "/usr/local/share/doste/scripts/"; @path = (this path); @dasm = (this notations dasm); #Load OS independent scripts @dasm run = (new type=LocalFile base=( @path ) filename="common.dasm"); doste-0.3.1/scripts/console.dasm0000644000175000001440000000035111061420617013542 00000000000000#Various console definitions #Nicolas Pope .console = (new _pln_agent_caller is { .println; ._pln_agent = 0; } _pln_agent is { select (._pln_agent) { 0: { @root cout = (.~println); 1 } 1: { @root cout = "\n"; 2 } } } );doste-0.3.1/scripts/boolean.dasm0000644000175000001440000000037711026416416013532 00000000000000#Boolean logic operations #Nicolas Pope true not = false; false not = true; true and = (new true = true false = false); false and = (new true = false false = false); true or = (new true = true false = true); false or = (new true = true false = false); doste-0.3.1/scripts/common.dasm0000644000175000001440000000063111061420557013374 00000000000000#Shortcut variables. @math = (.math); @root = (.); #A wrapper to allow math random to be used normally. .math random func { @root ~_random void }; #Boolean operators @dasm run = (new type=LocalFile base=( @path ) filename="boolean.dasm"); #Console stuff @dasm run = (new type=LocalFile base=( @path ) filename="console.dasm"); .lasttime = 0.0; .lasttime is { .time }; .itime is { .time sub (.~lasttime) }; doste-0.3.1/scripts/linux.dasm.in0000644000175000001440000000053111026423717013651 00000000000000#Create relevant structures to initialise the system #Nicolas Pope this os = linux; #Script path as specified by configure script when building this path = "@prefix@/share/doste/scripts/"; @path = (this path); @dasm = (this notations dasm); #Load OS independent scripts @dasm run = (new type=LocalFile base=( @path ) filename="common.dasm"); doste-0.3.1/ChangeLog0000755000175000001440000000004611026666003011323 00000000000000Version 0.3: First standalone release.