OSDN Git Service

Added Unix build environment
authorryan <>
Mon, 12 Jun 2006 22:49:05 +0000 (22:49 +0000)
committerryan <>
Mon, 12 Jun 2006 22:49:05 +0000 (22:49 +0000)
91 files changed:
Jamfile.in [new file with mode: 0644]
Jamrules [new file with mode: 0644]
LICENSE [moved from gpl.txt with 100% similarity, mode: 0644]
README [new file with mode: 0644]
autogen.sh [new file with mode: 0755]
changelog [moved from changelog.txt with 100% similarity, mode: 0644]
config-msvc.h [new file with mode: 0644]
config.h [new file with mode: 0644]
config.h.in [new file with mode: 0644]
configure [new file with mode: 0755]
configure.ac [new file with mode: 0644]
mk/autoconf/cel.m4 [new file with mode: 0644]
mk/autoconf/checkbuild.m4 [new file with mode: 0644]
mk/autoconf/checkcommon.m4 [new file with mode: 0644]
mk/autoconf/checkcppunit.m4 [new file with mode: 0644]
mk/autoconf/checkcswin32libs.m4 [new file with mode: 0644]
mk/autoconf/checklib.m4 [new file with mode: 0644]
mk/autoconf/checklibtool.m4 [new file with mode: 0644]
mk/autoconf/checkopengl.m4 [new file with mode: 0644]
mk/autoconf/checkpic.m4 [new file with mode: 0644]
mk/autoconf/checkprog.m4 [new file with mode: 0644]
mk/autoconf/checkpthread.m4 [new file with mode: 0644]
mk/autoconf/checkpython.m4 [new file with mode: 0644]
mk/autoconf/checktt2.m4 [new file with mode: 0644]
mk/autoconf/compiler.m4 [new file with mode: 0644]
mk/autoconf/config.guess [new file with mode: 0755]
mk/autoconf/config.sub [new file with mode: 0755]
mk/autoconf/crystal.m4 [new file with mode: 0644]
mk/autoconf/cs_check_host.m4 [new file with mode: 0644]
mk/autoconf/diagnose.m4 [new file with mode: 0644]
mk/autoconf/embed.m4 [new file with mode: 0644]
mk/autoconf/emit.m4 [new file with mode: 0644]
mk/autoconf/headercache.m4 [new file with mode: 0644]
mk/autoconf/install-sh [new file with mode: 0755]
mk/autoconf/installdirs.m4 [new file with mode: 0644]
mk/autoconf/jamcache.m4 [new file with mode: 0644]
mk/autoconf/makecache.m4 [new file with mode: 0644]
mk/autoconf/mkdir.m4 [new file with mode: 0644]
mk/autoconf/packageinfo.m4 [new file with mode: 0644]
mk/autoconf/path.m4 [new file with mode: 0644]
mk/autoconf/progver.m4 [new file with mode: 0644]
mk/autoconf/qualify.m4 [new file with mode: 0644]
mk/autoconf/split.m4 [new file with mode: 0644]
mk/autoconf/textcache.m4 [new file with mode: 0644]
mk/autoconf/trim.m4 [new file with mode: 0644]
mk/autoconf/warnings.m4 [new file with mode: 0644]
mk/jam/application.jam [new file with mode: 0644]
mk/jam/assembler.jam [new file with mode: 0644]
mk/jam/bisonflex.jam [new file with mode: 0644]
mk/jam/build.jam [new file with mode: 0644]
mk/jam/clean.jam [new file with mode: 0644]
mk/jam/compiler.jam [new file with mode: 0644]
mk/jam/docs.jam [new file with mode: 0644]
mk/jam/dump.jam [new file with mode: 0644]
mk/jam/flags.jam [new file with mode: 0644]
mk/jam/groups.jam [new file with mode: 0644]
mk/jam/help.jam [new file with mode: 0644]
mk/jam/helper.jam [new file with mode: 0644]
mk/jam/install.jam [new file with mode: 0644]
mk/jam/jamcompatibility.jam [new file with mode: 0644]
mk/jam/library.jam [new file with mode: 0644]
mk/jam/macosx.jam [new file with mode: 0644]
mk/jam/msvcgen.jam [new file with mode: 0644]
mk/jam/objectivec.jam [new file with mode: 0644]
mk/jam/objects.jam [new file with mode: 0644]
mk/jam/options.jam [new file with mode: 0644]
mk/jam/plugin.jam [new file with mode: 0644]
mk/jam/property.jam [new file with mode: 0644]
mk/jam/resource.jam [new file with mode: 0644]
mk/jam/static.jam [new file with mode: 0644]
mk/jam/strip.jam [new file with mode: 0644]
mk/jam/subdir.jam [new file with mode: 0644]
mk/jam/swig.jam [new file with mode: 0644]
mk/jam/unittest.jam [new file with mode: 0644]
mk/jam/unix.jam [new file with mode: 0644]
mk/jam/variant.jam [new file with mode: 0644]
mk/jam/win32.jam [new file with mode: 0644]
mk/msvcgen/control.tlib [new file with mode: 0644]
mk/msvcgen/custom.cslib [new file with mode: 0644]
mk/msvcgen/macros.tlib [new file with mode: 0644]
mk/msvcgen/project6.tlib [new file with mode: 0644]
mk/msvcgen/project7.tlib [new file with mode: 0644]
mk/msvcgen/projectx6.tlib [new file with mode: 0644]
mk/msvcgen/projectx7.tlib [new file with mode: 0644]
mk/msvcgen/workspace6.tlib [new file with mode: 0644]
mk/msvcgen/workspace7.tlib [new file with mode: 0644]
msvc/README [new file with mode: 0644]
msvc/Skyscraper.sln [new file with mode: 0644]
msvc/Skyscraper.vcproj [new file with mode: 0644]
readme.txt [deleted file]
skyscraper.ico [new file with mode: 0644]

diff --git a/Jamfile.in b/Jamfile.in
new file mode 100644 (file)
index 0000000..4f45a79
--- /dev/null
@@ -0,0 +1,107 @@
+TOP ?= "@top_srcdir@" ;
+BUILDTOP ?= "@top_builddir@" ;
+
+SubDir TOP ;
+
+IncludeDir ;
+IncludeDir src ;
+IncludeDir $(BUILDTOP) : : literal transient ;
+
+CleanDir clean :
+    out ;
+Clean distclean :
+    aclocal.m4
+    config.h
+    config.h.in~
+    config.log
+    config.status
+    config.status.lineno
+    config.cache
+    configure.lineno
+    Jamconfig
+    Jamfile ;
+CleanDir distclean :
+    autom4te.cache ;
+Depends distclean : clean ;
+
+Clean maintainerclean :
+  config.h.in
+  configure ;
+Depends maintainerclean : distclean ;
+
+Help distclean : "Remove built targets and configuration" ;
+Help maintainerclean :
+    "Remove built targets, configuration, and generated files." ;
+
+# Set up subdirectories into which the different generated project for 
+# different go.
+MsvcGenSubDir TOP msvc : common ;
+MsvcGenSubDir TOP msvc 7 : 7 ;
+MsvcGenSubDir TOP msvc 71 : 71 ;
+MsvcGenSubDir TOP msvc 8 : 8 ;
+MsvcGenTemplateDir TOP mk msvcgen ;
+# Set up the workspace we want msvcgen to synthesize.
+MsvcGenWorkspace skyscraper ;
+
+# Customize the build configurations to contain some defines required by
+# CrystalSpace.
+MsvcGenVariable customize : mk/msvcgen/custom.cslib ;
+
+local hash = "\$" ;
+MsvcGenConfig CRYSTAL.AVAILABLE : yes ;
+MsvcGenConfig CRYSTAL.DEFINES ;
+MsvcGenConfig CRYSTAL.CFLAGS ;
+MsvcGenConfig CRYSTAL.LFLAGS ;
+MsvcGenConfig CRYSTAL.LIBS : "libcrystalspace.lib" ;
+MsvcGenConfig CRYSTAL.LIBS.DEBUG : "libcrystalspace_d.lib" ;
+MsvcGenConfig CRYSTAL.INCDIRS :
+  [ ConcatDirs .. .. .. CS include ]
+  [ ConcatDirs .. .. .. CS include csutil win32 ]
+  [ ConcatDirs "$(hash)(CRYSTAL)" include ]
+  [ ConcatDirs "$(hash)(CRYSTAL)" include csutil win32 ] ;
+MsvcGenConfig CRYSTAL.LIBDIRS :
+  [ ConcatDirs .. .. .. CS out release$(MSVC_VERSION) libs ]
+  [ ConcatDirs .. .. .. CS libs csutil win32 libs ]
+  [ ConcatDirs "$(hash)(CRYSTAL)" out release$(MSVC_VERSION) libs ]
+  [ ConcatDirs "$(hash)(CRYSTAL)" libs csutil win32 libs ] ;
+MsvcGenConfig CRYSTAL.LIBDIRS.DEBUG :
+  [ ConcatDirs .. .. .. CS out debug$(MSVC_VERSION) libs ]
+  [ ConcatDirs .. .. .. CS libs csutil win32 libs ]
+  [ ConcatDirs "$(hash)(CRYSTAL)" out debug$(MSVC_VERSION) libs ]
+  [ ConcatDirs "$(hash)(CRYSTAL)" libs csutil win32 libs ] ;
+
+if $(CEL.DESIRED) = yes
+{
+  MsvcGenConfig CEL.AVAILABLE : yes ;
+  MsvcGenConfig CEL.DEFINES : USE_CEL ;
+  MsvcGenConfig CEL.CFLAGS ;
+  MsvcGenConfig CEL.LFLAGS ;
+  MsvcGenConfig CEL.LIBS : "libceltool.lib" ;
+  MsvcGenConfig CEL.LIBS.DEBUG : "libceltool_d.lib" ;
+  MsvcGenConfig CEL.INCDIRS :
+    [ ConcatDirs .. .. .. cel include ]
+    [ ConcatDirs "$(hash)(CEL)" include ]
+    [ ConcatDirs "$(hash)(CEL)" include cel ] ;
+  MsvcGenConfig CEL.LIBDIRS :
+    [ ConcatDirs .. .. .. cel out release libs ]
+    [ ConcatDirs "$(hash)(CEL)" out release libs ]
+    [ ConcatDirs "$(hash)(CEL)" libs ] ;
+  MsvcGenConfig CEL.LIBDIRS.DEBUG :
+    [ ConcatDirs .. .. .. cel out debug libs ]
+    [ ConcatDirs "$(hash)(CEL)" out debug libs ]
+    [ ConcatDirs "$(hash)(CEL)" libs ] ;
+}
+
+# Set project-specific compiler and linker options for msvcgen.
+#MsvcDefine MY_DEFINE : "my value" ;
+#MsvcDefine MY_RELEASE_DEFINE : "my release value" : release ;
+#MsvcDefine MY_DEBUG_DEFINE : "my debug value" : debug ;
+#MsvcCFlags : "/I \"my\\inc\\path\"" : release ;
+#MsvcCFlags : "/I \"my\\debuginc\\path\"" : debug ;
+#MsvcLFlags : "/libpath:\"my\\lib\\path\"" : release ;
+#MsvcLFlags : "/libpath:\"my\\debuglib\\path\"" : debug ;
+#MsvcGenConfig SUPERCOOL.AVAILABLE : yes ;
+#MsvcGenConfig SUPERCOOL.LIBS : supercool.lib ;
+#MsvcGenConfig SUPERCOOL.LIBS.DEBUG : supercooldebug.lib ;
+
+SubInclude TOP src ;
diff --git a/Jamrules b/Jamrules
new file mode 100644 (file)
index 0000000..c83736d
--- /dev/null
+++ b/Jamrules
@@ -0,0 +1,21 @@
+if ! $(BUILDTOP)
+{
+BUILDTOP = . ;
+}
+
+# Include configuration.
+JAMCONFIG ?= $(BUILDTOP)/Jamconfig ;
+include $(JAMCONFIG) ;
+
+# Set up compiler flags.
+# Unfortunately, we can not use FDefines here since Boost Jam does not have it,
+# and we have not yet included mk/jam/build.jam which provides an emulation
+# layer for Boost.  We can not include build.jam earlier because these flags
+# need to be defined before build.jam is included.  :-(
+COMPILER.CFLAGS = -Wall -Wno-unknown-pragmas ;
+COMPILER.CFLAGS.optimize = -O3 -fomit-frame-pointer -ffast-math ;
+COMPILER.CFLAGS.debug = -g3 -DCS_DEBUG ;
+COMPILER.CFLAGS.profile = -gp -O3 ;
+
+# Include CS build rules
+include $(TOP)/mk/jam/build.jam ;
diff --git a/gpl.txt b/LICENSE
old mode 100755 (executable)
new mode 100644 (file)
similarity index 100%
rename from gpl.txt
rename to LICENSE
diff --git a/README b/README
new file mode 100644 (file)
index 0000000..848c71a
--- /dev/null
+++ b/README
@@ -0,0 +1,116 @@
+Skyscraper version 1.1
+Copyright (C)2003-2006 Ryan Thoryk
+http://www.tliquest.net/skyscraper
+http://sourceforge.net/projects/skyscraper
+
+Contents
+1. Legal Notice
+2. Introduction
+3. Release Notes
+4. Building and Installing
+5. Usage
+6. Contact
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+1. Legal Notice
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+For more information, see the LICENSE file.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+2. Introduction
+
+Skyscraper is a 3D virtual building simulator written in C++ using the CrystalSpace
+graphics engine.  The goal of the Skyscraper project is to create a fully-featured,
+modular, 3D realtime building simulation engine, including gaming support (single
+and network multiplayer). Everything possible is planned to be simulated, including
+elevators, stairs, interfloor areas, ductwork, and more, all in first-person 3D. The
+simulator core is called the Scalable Building Simulator, or SBS. Buildings are stored
+in scripted text files that are loaded and generated in realtime by the simulator. A
+graphical building designer application is planned to assist in creating building data
+files. The current version of Skyscraper (1.1) is written in C++ and uses the open-source
+CrystalSpace graphics engine, and is multiplatform.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+3. Release Notes
+
+This 1.1 release is a milestone release, and is a complete rewrite of the original
+1.0 codebase, in C++.  This is an ongoing effort towards a 2.0 stable release.
+Newer features, a completely redesigned simulation engine, external loadable
+buildings, better graphics, and more are being developed.  This version was
+originally coded in Visual Basic 6 using the TrueVision3D graphics engine.
+
+This software requires the CrystalSpace3D CVS 5/19/2006 (or later) graphics engine
+library which can be found at http://www.crystalspace3d.com.
+
+See the changelog for new features, fixes, and other changes in this release.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+4. Building and installing
+
+Skyscraper can be built on Unix, Msys/Mingw, and Cygwin using the Jam build
+tool. Microsoft Visual C++ users can build the project using the project files
+in the skyscraper/msvc directory.
+
+4.1 Jam
+
+ The build system is based upon Jam rather than 'make'.  If you do not yet have
+ Jam installed, then check your distribution for a Jam package or download the
+ source and compile/install Jam yourself.  You can find the source here:
+
+    ftp://ftp.perforce.com/pub/jam/
+
+ You will need at least version 2.4.
+
+4.1.1 Building
+
+ 1. Go to the top-level directory in the project tree.
+ 2. Run "./configure", possibly with some options, if you wish.  You can see a
+    list of available options by invoking configure with the "--help" option.
+ 3. Run "jam".
+
+4.1.2 Installing
+
+ 1. Build the project.
+ 2. Ensure that you have write permissions to the install directories. On Unix
+    (GNU/Linux, MacOS/X, Darwin, BSD) this usually means that you need to be
+    the 'root' user.
+ 3. Run "jam install".
+
+4.2 Microsoft Visual C++
+
+ 1. Open the solution file skyscraper/msvc/skyscraper.sln.
+ 2. Choose "Release" or "Debug" build mode.
+ 3. Build the project.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+5. Usage
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+6. Contact
+
+Bug-Reports, suggestions, and requests should be send to
+ryan at tliquest dot net
+
+
diff --git a/autogen.sh b/autogen.sh
new file mode 100755 (executable)
index 0000000..7f3c49f
--- /dev/null
@@ -0,0 +1,25 @@
+#! /bin/sh
+
+if test ! -f configure.ac ; then
+  echo "*** Please invoke this script from directory containing configure.ac."
+  exit 1
+fi
+
+MACROFILE=aclocal.m4
+MACRODIR=mk/autoconf
+
+rm -f $MACROFILE
+for i in $MACRODIR/*.m4 ; do
+  cat $i >> $MACROFILE
+done
+
+autoheader
+rc=$?
+
+if test $rc -eq 0; then
+  autoconf
+  rc=$?
+fi
+
+rm -f $MACROFILE
+exit $rc
old mode 100755 (executable)
new mode 100644 (file)
similarity index 100%
rename from changelog.txt
rename to changelog
diff --git a/config-msvc.h b/config-msvc.h
new file mode 100644 (file)
index 0000000..187a598
--- /dev/null
@@ -0,0 +1,10 @@
+/*
+ * MSVC-specific configuration for skyscraper.
+ *
+ * This file is the analogue of the config.h file created by the configure
+ * script for Unix and Unix-like platforms. Since the configure script is not
+ * invoked by MSVC users, the MSVC build instead gleans project configuration
+ * information from this file, which must be maintained manually.
+ */
+
+/* Insert MSVC-specific configuration information here. */
diff --git a/config.h b/config.h
new file mode 100644 (file)
index 0000000..6b9f21e
--- /dev/null
+++ b/config.h
@@ -0,0 +1,62 @@
+/* config.h.  Generated from config.h.in by configure.  */
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define when compiling for MacOS/X */
+/* #undef CS_PLATFORM_MACOSX */
+
+/* Define when compiling for Unix and Unix-like (i.e. MacOS/X) */
+#define CS_PLATFORM_UNIX 
+
+/* Define when compiling for Win32 */
+/* #undef CS_PLATFORM_WIN32 */
+
+/* Define to 1 if you have the <elf.h> header file. */
+#define HAVE_ELF_H 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "ryan@tliquest.net"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "skyscraper"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "skyscraper 1.1"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "skyscraper"
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "1.1"
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Avoid problem caused by missing <Carbon/CarbonSound.h> */
+/* #undef __CARBONSOUND__ */
diff --git a/config.h.in b/config.h.in
new file mode 100644 (file)
index 0000000..1c2b12c
--- /dev/null
@@ -0,0 +1,61 @@
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define when compiling for MacOS/X */
+#undef CS_PLATFORM_MACOSX
+
+/* Define when compiling for Unix and Unix-like (i.e. MacOS/X) */
+#undef CS_PLATFORM_UNIX
+
+/* Define when compiling for Win32 */
+#undef CS_PLATFORM_WIN32
+
+/* Define to 1 if you have the <elf.h> header file. */
+#undef HAVE_ELF_H
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* 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
+
+/* Avoid problem caused by missing <Carbon/CarbonSound.h> */
+#undef __CARBONSOUND__
diff --git a/configure b/configure
new file mode 100755 (executable)
index 0000000..e9b17cf
--- /dev/null
+++ b/configure
@@ -0,0 +1,12112 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.59d for skyscraper 1.1.
+#
+# Report bugs to <ryan@tliquest.net>.
+#
+# 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 Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+
+# 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 /usr/bin/posix$PATH_SEPARATOR/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 which exist, to save several forks.
+        if test -f $as_shell &&
+               { ($as_shell) 2> /dev/null <<\_ASEOF
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+:
+_ASEOF
+}; then
+  CONFIG_SHELL=$as_shell
+              as_have_required=yes
+              if { $as_shell 2> /dev/null <<\_ASEOF
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+:
+(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 (dirname -- /) >/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='mkdir -p'
+elif mkdirs . 2>/dev/null; then
+  as_mkdir_p='mkdirs'
+else
+  as_mkdir_p=''
+fi
+test -d ./-p && rmdir ./-p
+
+# Find out whether ``test -x'' works.  Don't use a zero-byte file, as
+# systems may use methods other than mode bits to determine executability.
+cat >conf$$.file <<_ASEOF
+#! /bin/sh
+exit 0
+_ASEOF
+chmod +x conf$$.file
+if test -x conf$$.file >/dev/null 2>&1; then
+  as_executable_p="test -x"
+else
+  as_executable_p=:
+fi
+rm -f conf$$.file
+
+# 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 </dev/null 6>&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='skyscraper'
+PACKAGE_TARNAME='skyscraper'
+PACKAGE_VERSION='1.1'
+PACKAGE_STRING='skyscraper 1.1'
+PACKAGE_BUGREPORT='ryan@tliquest.net'
+
+ac_unique_file="mk/jam/build.jam"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# if HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#if HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#if HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#if HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#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
+CC
+CFLAGS
+LDFLAGS
+CPPFLAGS
+ac_ct_CC
+EXEEXT
+OBJEXT
+CXX
+CXXFLAGS
+ac_ct_CXX
+RANLIB
+WINDRES
+ac_ct_WINDRES
+DOXYGEN
+DOT
+ac_ct_DOT
+TEXI2DVI
+TEXI2PDF
+DVIPS
+DVIPDF
+MAKEINFO
+INSTALL
+LIBTOOL_TEST
+ac_ct_LIBTOOL_TEST
+LIBTOOL_PATH
+LIBTOOL
+ac_ct_LIBTOOL
+CS_LT_APPLE
+APPLE_LIBTOOL
+MKDIR
+MKDIRS
+PERL
+TTREE
+PKG_CONFIG
+ac_ct_PKG_CONFIG
+CONFIG_CPPUNIT
+ac_ct_CONFIG_CPPUNIT
+CONFIG_
+ac_ct_CONFIG_
+CRYSTAL
+CRYSTAL_CONFIG_TOOL
+CPP
+GREP
+EGREP
+OBJCOPY
+ac_ct_OBJCOPY
+CONFIG_BFD
+ac_ct_CONFIG_BFD
+LIBOBJS
+LTLIBOBJS'
+ac_subst_files=''
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+CPPFLAGS
+CXX
+CXXFLAGS
+CCC
+CRYSTAL
+CPP'
+
+
+# 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 skyscraper 1.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/skyscraper]
+  --htmldir=DIR          html documentation [DOCDIR]
+  --dvidir=DIR           dvi documentation [DOCDIR]
+  --pdfdir=DIR           pdf documentation [DOCDIR]
+  --psdir=DIR            ps documentation [DOCDIR]
+_ACEOF
+
+  cat <<\_ACEOF
+
+System types:
+  --build=BUILD     configure for building on BUILD [guessed]
+  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+  case $ac_init_help in
+     short | recursive ) echo "Configuration of skyscraper 1.1:";;
+   esac
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --enable-cstest         verify that the Crystal Space SDK is actually usable
+                          (default YES)
+  --enable-meta-info-embedding
+                          store plugin meta-information directly inside plugin
+                          modules if supported by platform; if disabled,
+                          meta-information is stored in stand-alone .csplugin
+                          files; this option is enabled by default for
+                          non-Unix platforms and on Unix platforms with
+                          ELF-format object files; it is disabled by default
+                          on Unix platforms if ELF is not available and the
+                          project uses a non-GPL-compatible license (such as
+                          LGPL) since the non-ELF Unix embedding technology
+                          requires the GPL-licensed libbfd library; if ELF is
+                          not available, enable this option on Unix only if
+                          you are certain you want a GPL-licensed library
+                          infecting your project
+  --enable-debug          build with debugging information (default NO)
+
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-cppunit=dir      specify location of libcppunit if not detected
+                          automatically; searches dir/include, dir/lib, and
+                          dir
+  --without-cs            do not look for an installed Crystal Space SDK; this
+                          option is useful only if you need to perform routine
+                          maintenance tasks, such as generating project files
+                          or converting documentation, without having the
+                          Crystal Space SDK installed
+  --with-cs-prefix=CRYSTAL_PREFIX
+                          specify location of Crystal Space installation; this
+                          is the \$prefix value used when installing the SDK
+  --with-bfd=dir          specify location of libbfd if not detected
+                          automatically; searches dir/include, dir/lib, and
+                          dir
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  CXX         C++ compiler command
+  CXXFLAGS    C++ compiler flags
+  CRYSTAL     Prefix where Crystal Space is installed
+  CPP         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.
+
+Report bugs to <ryan@tliquest.net>.
+_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
+skyscraper configure 1.1
+generated by GNU Autoconf 2.59d
+
+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 skyscraper $as_me 1.1, which was
+generated by GNU Autoconf 2.59d.  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_sep=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *\'*)
+      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+    2)
+      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+       ac_must_keep_next=false # Got value, back to normal.
+      else
+       case $ac_arg in
+         *=* | --config-cache | -C | -disable-* | --disable-* \
+         | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+         | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+         | -with-* | --with-* | -without-* | --without-* | --x)
+           case "$ac_configure_args0 " in
+             "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+           esac
+           ;;
+         -* ) ac_must_keep_next=true ;;
+       esac
+      fi
+      ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+      # Get rid of the leading space.
+      ac_sep=" "
+      ;;
+    esac
+  done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: 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
+      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
+       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
+
+
+PACKAGE_LONGNAME="Skyscraper"
+    PACKAGE_COPYRIGHT="Copyright (C)2004-2006 Ryan Thoryk"
+    PACKAGE_HOMEPAGE="http://www.tliquest.net/skyscraper"
+
+
+ac_aux_dir=
+for ac_dir in mk/autoconf $srcdir/mk/autoconf; 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 mk/autoconf $srcdir/mk/autoconf" >&5
+echo "$as_me: error: cannot find install-sh or install.sh in mk/autoconf $srcdir/mk/autoconf" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"
+ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
+
+# Make sure we can run config.sub.
+$ac_config_sub sun4 >/dev/null 2>&1 ||
+  { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
+echo "$as_me: error: cannot run $ac_config_sub" >&2;}
+   { (exit 1); exit 1; }; }
+
+{ echo "$as_me:$LINENO: checking build system type" >&5
+echo $ECHO_N "checking build system type... $ECHO_C" >&6; }
+if test "${ac_cv_build+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$ac_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=`$ac_config_sub $ac_build_alias` ||
+  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_build_alias failed" >&5
+echo "$as_me: error: $ac_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=`$ac_config_sub $host_alias` ||
+    { { echo "$as_me:$LINENO: error: $ac_config_sub $host_alias failed" >&5
+echo "$as_me: error: $ac_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
+
+
+
+#----------------------------------------------------------------------------
+# Setup for the configuration header.
+#----------------------------------------------------------------------------
+ac_config_headers="$ac_config_headers config.h"
+
+
+#----------------------------------------------------------------------------
+# Check for tools.
+#----------------------------------------------------------------------------
+
+
+    CFLAGS="$CFLAGS" # Filter undesired flags
+    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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+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`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version >&5\"") >&5
+  (eval $ac_compiler --version >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v >&5\"") >&5
+  (eval $ac_compiler -v >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V >&5\"") >&5
+  (eval $ac_compiler -V >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+
+# List of possible output files.  We want to start from the most likely,
+# but we have to check foo.exe before foo, because Cygwin `test -f' looks
+# also for foo.exe.  b.out is created by i960 compilers.
+# As a last resort, we also try wildcards: `conftest.*' and `a.*'.
+# But we are not allowed to rm a.*, and we do not want always remove
+# conftest.*, so we will list them literally, when appropriate.
+ac_outfiles="a_out.exe a.out conftest.exe conftest a.exe 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.
+rm -f $ac_outfiles conftest.*
+
+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 $ac_outfiles"
+
+# The following tests should remove their output except files matching conftest.*.
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; }
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
+  (eval $ac_link_default) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  for ac_file in $ac_outfiles a.* conftest.* NO
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+    * ) break;;
+  esac
+done
+if test "$ac_file" = NO; then
+  { { echo "$as_me:$LINENO: error: no output file found
+See \`config.log' for more details." >&5
+echo "$as_me: error: no output file found
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+fi
+
+{ echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6; }
+# 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'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+       cross_compiling=yes
+    else
+       { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  fi
+fi
+{ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+
+# Clean up; list also $ac_file, in case it matched a wildcard entry.
+rm -f $ac_outfiles $ac_file
+
+{ 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 test "${ac_cv_exeext+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # If both `conftest.exe' and `conftest' are `present' (well, observable),
+    # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+    # work properly (i.e., refer to `conftest.exe'), while it won't with `rm'.
+    for ac_file in conftest.exe conftest conftest.* NO; 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
+    if test "$ac_file" = NO; then
+  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: no output file found
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of executables: no output file found
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+    # Clean up; list also $ac_file, in case it matched conftest.*.
+    rm -f $ac_outfiles $ac_file
+
+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
+
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6; }
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+
+
+ac_clean_files=$ac_clean_files_save
+
+{ 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
+  rm -f conftest.o conftest.obj
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  for ac_file in 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
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+
+
+rm -f conftest.*
+{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_compiler_gnu=no
+fi
+
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ 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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f 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 <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -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];
+
+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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cc_c89=$ac_arg
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f 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
+
+    if test -n "$CC"; then
+
+       cs_build_prop_val="$CC"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}CMD.CC ?= \"$cs_build_prop_val\" ;
+"
+fi
+
+       cs_build_prop_val="$CPPFLAGS $CFLAGS"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}COMPILER.CFLAGS += \"$cs_build_prop_val\" ;
+"
+fi
+
+
+       # Check if compiler recognizes -pipe directive.
+       { echo "$as_me:$LINENO: checking if $CC accepts -pipe" >&5
+echo $ECHO_N "checking if $CC accepts -pipe... $ECHO_C" >&6; }
+if test "${cs_cv_prog_cc_pipe_ok+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+    cs_cflags_save="$CFLAGS"
+    cs_lflags_save="$LDFLAGS"
+    cs_libs_save="$LIBS"
+    cs_build_ok=no
+
+
+    for cs_build_item in `echo @-pipe@@ | sed 'y% %#%'`
+    do
+
+    set filler `echo "$cs_build_item" | awk 'BEGIN { FS="@" }
+       { for (i=1; i <= NF; ++i)
+           { if ($i == "") print "filler"; else print $i } }'`
+    shift
+    if test $# -eq 0; then
+  cs_dummy=''
+else
+  if test "$1" = filler; then
+  cs_dummy=''
+else
+  cs_dummy=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_cflags_test=''
+else
+  if test "$1" = filler; then
+  cs_cflags_test=''
+else
+  cs_cflags_test=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_lflags_test=''
+else
+  if test "$1" = filler; then
+  cs_lflags_test=''
+else
+  cs_lflags_test=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_libs_test=''
+else
+  if test "$1" = filler; then
+  cs_libs_test=''
+else
+  cs_libs_test=$1
+fi
+
+       shift
+fi
+
+    cs_cflags_test=`echo $cs_cflags_test | sed 'y%#% %'`
+    cs_lflags_test=`echo $cs_lflags_test | sed 'y%#% %'`
+    cs_libs_test=`echo $cs_libs_test | sed 'y%#% %'`
+
+       CFLAGS="$cs_cflags_test  $cs_cflags_save"
+       LDFLAGS="$cs_lflags_test  $cs_lflags_save"
+       LIBS="$cs_libs_test  $cs_libs_save"
+       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 conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cs_build_ok=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+       if test $cs_build_ok = yes; then
+  break
+fi
+
+    done
+
+
+    CFLAGS=$cs_cflags_save
+    LDFLAGS=$cs_lflags_save
+    LIBS=$cs_libs_save
+    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 $cs_build_ok = yes; then
+  cs_build_cflags=`echo x$cs_cflags_test | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_build_lflags=`echo x$cs_lflags_test | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_build_libs=`echo x$cs_libs_test | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_cv_prog_cc_pipe=`echo x$cs_build_cflags $cs_build_lflags $cs_build_libs | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+           cs_cv_prog_cc_pipe_ok="$cs_cv_prog_cc_pipe"
+else
+  cs_cv_prog_cc_pipe=''
+           cs_cv_prog_cc_pipe_ok=no
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $cs_cv_prog_cc_pipe_ok" >&5
+echo "${ECHO_T}$cs_cv_prog_cc_pipe_ok" >&6; }
+    if test "$cs_cv_prog_cc_pipe_ok" != no; then
+  cs_build_prop_val="$cs_cv_prog_cc_pipe"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}COMPILER.CFLAGS += \"$cs_build_prop_val\" ;
+"
+fi
+
+
+fi
+
+
+fi
+
+
+if test -z "$CC"; then
+  { { echo "$as_me:$LINENO: error: Could not find a usable C compiler." >&5
+echo "$as_me: error: Could not find a usable C compiler." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+
+    CXXFLAGS="$CXXFLAGS" # Filter undesired flags
+    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_executable_p "$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_executable_p "$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`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version >&5\"") >&5
+  (eval $ac_compiler --version >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v >&5\"") >&5
+  (eval $ac_compiler -v >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V >&5\"") >&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_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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_compiler_gnu=no
+fi
+
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cxx_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f 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
+
+    if test -n "$CXX"; then
+
+       cs_build_prop_val="$CXX"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}CMD.C++ ?= \"$cs_build_prop_val\" ;
+"
+fi
+
+
+       cs_build_prop_val="$CPPFLAGS $CXXFLAGS"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}COMPILER.C++FLAGS += \"$cs_build_prop_val\" ;
+"
+fi
+
+
+        # Check if compiler can be instructed to produce position-independent-code
+        # (PIC).  This feature is required by some platforms when building plugin
+        # modules and shared libraries.
+       { echo "$as_me:$LINENO: checking how to treat C++ warnings as errors" >&5
+echo $ECHO_N "checking how to treat C++ warnings as errors... $ECHO_C" >&6; }
+if test "${cs_cv_prog_cxx_pic_werror_ok+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+    cs_cflags_save="$CXXFLAGS"
+    cs_lflags_save="$LDFLAGS"
+    cs_libs_save="$LIBS"
+    cs_build_ok=no
+
+
+    for cs_build_item in `echo @-Werror@@ | sed 'y% %#%'`
+    do
+
+    set filler `echo "$cs_build_item" | awk 'BEGIN { FS="@" }
+       { for (i=1; i <= NF; ++i)
+           { if ($i == "") print "filler"; else print $i } }'`
+    shift
+    if test $# -eq 0; then
+  cs_dummy=''
+else
+  if test "$1" = filler; then
+  cs_dummy=''
+else
+  cs_dummy=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_cflags_test=''
+else
+  if test "$1" = filler; then
+  cs_cflags_test=''
+else
+  cs_cflags_test=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_lflags_test=''
+else
+  if test "$1" = filler; then
+  cs_lflags_test=''
+else
+  cs_lflags_test=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_libs_test=''
+else
+  if test "$1" = filler; then
+  cs_libs_test=''
+else
+  cs_libs_test=$1
+fi
+
+       shift
+fi
+
+    cs_cflags_test=`echo $cs_cflags_test | sed 'y%#% %'`
+    cs_lflags_test=`echo $cs_lflags_test | sed 'y%#% %'`
+    cs_libs_test=`echo $cs_libs_test | sed 'y%#% %'`
+
+       CXXFLAGS="$cs_cflags_test  $cs_cflags_save"
+       LDFLAGS="$cs_lflags_test  $cs_lflags_save"
+       LIBS="$cs_libs_test  $cs_libs_save"
+       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 conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cs_build_ok=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+       if test $cs_build_ok = yes; then
+  break
+fi
+
+    done
+
+
+    CXXFLAGS=$cs_cflags_save
+    LDFLAGS=$cs_lflags_save
+    LIBS=$cs_libs_save
+    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 $cs_build_ok = yes; then
+  cs_build_cflags=`echo x$cs_cflags_test | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_build_lflags=`echo x$cs_lflags_test | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_build_libs=`echo x$cs_libs_test | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_cv_prog_cxx_pic_werror=`echo x$cs_build_cflags $cs_build_lflags $cs_build_libs | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+           cs_cv_prog_cxx_pic_werror_ok="$cs_cv_prog_cxx_pic_werror"
+else
+  cs_cv_prog_cxx_pic_werror=''
+           cs_cv_prog_cxx_pic_werror_ok=no
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $cs_cv_prog_cxx_pic_werror_ok" >&5
+echo "${ECHO_T}$cs_cv_prog_cxx_pic_werror_ok" >&6; }
+
+    { echo "$as_me:$LINENO: checking how to enable C++ PIC generation" >&5
+echo $ECHO_N "checking how to enable C++ PIC generation... $ECHO_C" >&6; }
+if test "${cs_cv_prog_cxx_pic_ok+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+    cs_cflags_save="$CXXFLAGS"
+    cs_lflags_save="$LDFLAGS"
+    cs_libs_save="$LIBS"
+    cs_build_ok=no
+
+
+    for cs_build_item in `echo @-fPIC@@ | sed 'y% %#%'`
+    do
+
+    set filler `echo "$cs_build_item" | awk 'BEGIN { FS="@" }
+       { for (i=1; i <= NF; ++i)
+           { if ($i == "") print "filler"; else print $i } }'`
+    shift
+    if test $# -eq 0; then
+  cs_dummy=''
+else
+  if test "$1" = filler; then
+  cs_dummy=''
+else
+  cs_dummy=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_cflags_test=''
+else
+  if test "$1" = filler; then
+  cs_cflags_test=''
+else
+  cs_cflags_test=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_lflags_test=''
+else
+  if test "$1" = filler; then
+  cs_lflags_test=''
+else
+  cs_lflags_test=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_libs_test=''
+else
+  if test "$1" = filler; then
+  cs_libs_test=''
+else
+  cs_libs_test=$1
+fi
+
+       shift
+fi
+
+    cs_cflags_test=`echo $cs_cflags_test | sed 'y%#% %'`
+    cs_lflags_test=`echo $cs_lflags_test | sed 'y%#% %'`
+    cs_libs_test=`echo $cs_libs_test | sed 'y%#% %'`
+
+       CXXFLAGS="$cs_cflags_test $cs_cv_prog_cxx_pic_werror $cs_cflags_save"
+       LDFLAGS="$cs_lflags_test  $cs_lflags_save"
+       LIBS="$cs_libs_test  $cs_libs_save"
+       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 conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  if { ac_try='grep "fPIC" conftest.err >/dev/null 2>&1'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cs_build_ok=no
+else
+  cs_build_ok=yes
+fi
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+       if test $cs_build_ok = yes; then
+  break
+fi
+
+    done
+
+     rm -f conftest.err
+    CXXFLAGS=$cs_cflags_save
+    LDFLAGS=$cs_lflags_save
+    LIBS=$cs_libs_save
+    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 $cs_build_ok = yes; then
+  cs_build_cflags=`echo x$cs_cflags_test | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_build_lflags=`echo x$cs_lflags_test | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_build_libs=`echo x$cs_libs_test | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_cv_prog_cxx_pic=`echo x$cs_build_cflags $cs_build_lflags $cs_build_libs | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+           cs_cv_prog_cxx_pic_ok="$cs_cv_prog_cxx_pic"
+else
+  cs_cv_prog_cxx_pic=''
+           cs_cv_prog_cxx_pic_ok=no
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $cs_cv_prog_cxx_pic_ok" >&5
+echo "${ECHO_T}$cs_cv_prog_cxx_pic_ok" >&6; }
+    if test "$cs_cv_prog_cxx_pic_ok" != no; then
+  cs_build_prop_val="$cs_cv_prog_cxx_pic"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}COMPILER.C++FLAGS.PIC ?= \"$cs_build_prop_val\" ;
+"
+fi
+
+fi
+
+
+fi
+
+
+if test -z "$CXX"; then
+  { { echo "$as_me:$LINENO: error: Could not find a usable C++ compiler." >&5
+echo "$as_me: error: Could not find a usable C++ compiler." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+    if test -n "$CXX"; then
+  cs_build_prop_val="\$(CMD.C++)"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}CMD.LINK ?= \"$cs_build_prop_val\" ;
+"
+fi
+
+else
+  cs_build_prop_val="\$(CMD.CC)"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}CMD.LINK ?= \"$cs_build_prop_val\" ;
+"
+fi
+
+fi
+
+
+    cs_build_prop_val="$LDFLAGS"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}COMPILER.LFLAGS += \"$cs_build_prop_val\" ;
+"
+fi
+
+
+    # Check if compiler/linker recognizes -shared directive which is needed for
+    # linking plugin modules.  Unfortunately, the Apple compiler (and possibly
+    # others) requires extra effort.  Even though the compiler does not recognize
+    # the -shared option, it nevertheless returns a "success" result after emitting
+    # the warning "unrecognized option `-shared'".  Worse, even -Werror fails to
+    # promote the warning to an error, so we must instead scan the compiler's
+    # output for an appropriate diagnostic.
+    { echo "$as_me:$LINENO: checking if -shared is accepted" >&5
+echo $ECHO_N "checking if -shared is accepted... $ECHO_C" >&6; }
+if test "${cs_cv_prog_link_shared_ok+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+    cs_cflags_save="$CXXFLAGS"
+    cs_lflags_save="$LDFLAGS"
+    cs_libs_save="$LIBS"
+    cs_build_ok=no
+
+
+    for cs_build_item in `echo @-shared@@ | sed 'y% %#%'`
+    do
+
+    set filler `echo "$cs_build_item" | awk 'BEGIN { FS="@" }
+       { for (i=1; i <= NF; ++i)
+           { if ($i == "") print "filler"; else print $i } }'`
+    shift
+    if test $# -eq 0; then
+  cs_dummy=''
+else
+  if test "$1" = filler; then
+  cs_dummy=''
+else
+  cs_dummy=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_cflags_test=''
+else
+  if test "$1" = filler; then
+  cs_cflags_test=''
+else
+  cs_cflags_test=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_lflags_test=''
+else
+  if test "$1" = filler; then
+  cs_lflags_test=''
+else
+  cs_lflags_test=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_libs_test=''
+else
+  if test "$1" = filler; then
+  cs_libs_test=''
+else
+  cs_libs_test=$1
+fi
+
+       shift
+fi
+
+    cs_cflags_test=`echo $cs_cflags_test | sed 'y%#% %'`
+    cs_lflags_test=`echo $cs_lflags_test | sed 'y%#% %'`
+    cs_libs_test=`echo $cs_libs_test | sed 'y%#% %'`
+
+       CXXFLAGS="$cs_cflags_test  $cs_cflags_save"
+       LDFLAGS="$cs_lflags_test  $cs_lflags_save"
+       LIBS="$cs_libs_test  $cs_libs_save"
+       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 conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  if { ac_try='grep "shared" conftest.err >/dev/null 2>&1'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cs_build_ok=no
+else
+  cs_build_ok=yes
+fi
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+       if test $cs_build_ok = yes; then
+  break
+fi
+
+    done
+
+     rm -f conftest.err
+    CXXFLAGS=$cs_cflags_save
+    LDFLAGS=$cs_lflags_save
+    LIBS=$cs_libs_save
+    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 $cs_build_ok = yes; then
+  cs_build_cflags=`echo x$cs_cflags_test | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_build_lflags=`echo x$cs_lflags_test | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_build_libs=`echo x$cs_libs_test | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_cv_prog_link_shared=`echo x$cs_build_cflags $cs_build_lflags $cs_build_libs | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+           cs_cv_prog_link_shared_ok="$cs_cv_prog_link_shared"
+else
+  cs_cv_prog_link_shared=''
+           cs_cv_prog_link_shared_ok=no
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $cs_cv_prog_link_shared_ok" >&5
+echo "${ECHO_T}$cs_cv_prog_link_shared_ok" >&6; }
+    if test "$cs_cv_prog_link_shared_ok" != no; then
+  cs_build_prop_val="-shared"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}PLUGIN.LFLAGS += \"$cs_build_prop_val\" ;
+"
+fi
+
+fi
+
+
+    # Check if linker recognizes -soname which is used to assign a name internally
+    # to plugin modules.
+    if test "" != yes; then
+  { echo "$as_me:$LINENO: checking if -soname is accepted" >&5
+echo $ECHO_N "checking if -soname is accepted... $ECHO_C" >&6; }
+if test "${cs_cv_prog_link_soname+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+    cs_cflags_save="$CXXFLAGS"
+    cs_lflags_save="$LDFLAGS"
+    cs_libs_save="$LIBS"
+    cs_build_ok=no
+
+
+    for cs_build_item in `echo @-Wl,-soname,foobar@@ | sed 'y% %#%'`
+    do
+
+    set filler `echo "$cs_build_item" | awk 'BEGIN { FS="@" }
+       { for (i=1; i <= NF; ++i)
+           { if ($i == "") print "filler"; else print $i } }'`
+    shift
+    if test $# -eq 0; then
+  cs_dummy=''
+else
+  if test "$1" = filler; then
+  cs_dummy=''
+else
+  cs_dummy=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_cflags_test=''
+else
+  if test "$1" = filler; then
+  cs_cflags_test=''
+else
+  cs_cflags_test=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_lflags_test=''
+else
+  if test "$1" = filler; then
+  cs_lflags_test=''
+else
+  cs_lflags_test=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_libs_test=''
+else
+  if test "$1" = filler; then
+  cs_libs_test=''
+else
+  cs_libs_test=$1
+fi
+
+       shift
+fi
+
+    cs_cflags_test=`echo $cs_cflags_test | sed 'y%#% %'`
+    cs_lflags_test=`echo $cs_lflags_test | sed 'y%#% %'`
+    cs_libs_test=`echo $cs_libs_test | sed 'y%#% %'`
+
+       CXXFLAGS="$cs_cflags_test  $cs_cflags_save"
+       LDFLAGS="$cs_lflags_test  $cs_lflags_save"
+       LIBS="$cs_libs_test  $cs_libs_save"
+       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 conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cs_build_ok=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+       if test $cs_build_ok = yes; then
+  break
+fi
+
+    done
+
+
+    CXXFLAGS=$cs_cflags_save
+    LDFLAGS=$cs_lflags_save
+    LIBS=$cs_libs_save
+    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 $cs_build_ok = yes; then
+  cs_build_cflags=`echo x$cs_cflags_test  | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_build_lflags=`echo x$cs_lflags_test  | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_build_libs=`echo x$cs_libs_test  | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_cv_prog_link_soname=yes
+               cs_cv_prog_link_soname_cflags=$cs_build_cflags
+               cs_cv_prog_link_soname_lflags=$cs_build_lflags
+               cs_cv_prog_link_soname_libs=$cs_build_libs
+else
+  cs_cv_prog_link_soname=no
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $cs_cv_prog_link_soname" >&5
+echo "${ECHO_T}$cs_cv_prog_link_soname" >&6; }
+else
+  { echo "$as_me:$LINENO: checking if -soname is accepted" >&5
+echo $ECHO_N "checking if -soname is accepted... $ECHO_C" >&6; }
+           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
+
+    cs_cflags_save="$CXXFLAGS"
+    cs_lflags_save="$LDFLAGS"
+    cs_libs_save="$LIBS"
+    cs_build_ok=no
+
+
+    for cs_build_item in `echo @-Wl,-soname,foobar@@ | sed 'y% %#%'`
+    do
+
+    set filler `echo "$cs_build_item" | awk 'BEGIN { FS="@" }
+       { for (i=1; i <= NF; ++i)
+           { if ($i == "") print "filler"; else print $i } }'`
+    shift
+    if test $# -eq 0; then
+  cs_dummy=''
+else
+  if test "$1" = filler; then
+  cs_dummy=''
+else
+  cs_dummy=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_cflags_test=''
+else
+  if test "$1" = filler; then
+  cs_cflags_test=''
+else
+  cs_cflags_test=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_lflags_test=''
+else
+  if test "$1" = filler; then
+  cs_lflags_test=''
+else
+  cs_lflags_test=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_libs_test=''
+else
+  if test "$1" = filler; then
+  cs_libs_test=''
+else
+  cs_libs_test=$1
+fi
+
+       shift
+fi
+
+    cs_cflags_test=`echo $cs_cflags_test | sed 'y%#% %'`
+    cs_lflags_test=`echo $cs_lflags_test | sed 'y%#% %'`
+    cs_libs_test=`echo $cs_libs_test | sed 'y%#% %'`
+
+       CXXFLAGS="$cs_cflags_test  $cs_cflags_save"
+       LDFLAGS="$cs_lflags_test  $cs_lflags_save"
+       LIBS="$cs_libs_test  $cs_libs_save"
+       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 conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cs_build_ok=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+       if test $cs_build_ok = yes; then
+  break
+fi
+
+    done
+
+
+    CXXFLAGS=$cs_cflags_save
+    LDFLAGS=$cs_lflags_save
+    LIBS=$cs_libs_save
+    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 $cs_build_ok = yes; then
+  cs_build_cflags=`echo x$cs_cflags_test  | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_build_lflags=`echo x$cs_lflags_test  | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_build_libs=`echo x$cs_libs_test  | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_cv_prog_link_soname=yes
+               cs_cv_prog_link_soname_cflags=$cs_build_cflags
+               cs_cv_prog_link_soname_lflags=$cs_build_lflags
+               cs_cv_prog_link_soname_libs=$cs_build_libs
+else
+  cs_cv_prog_link_soname=no
+fi
+
+           { echo "$as_me:$LINENO: result: $cs_cv_prog_link_soname" >&5
+echo "${ECHO_T}$cs_cv_prog_link_soname" >&6; }
+fi
+
+    if test $cs_cv_prog_link_soname = yes; then
+  cs_build_prop_val="yes"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}PLUGIN.LFLAGS.USE_SONAME ?= \"$cs_build_prop_val\" ;
+"
+fi
+
+else
+  cs_cv_prog_link_soname_cflags=''
+       cs_cv_prog_link_soname_lflags=''
+       cs_cv_prog_link_soname_libs=''
+
+fi
+
+
+
+# The default RANLIB in Jambase is wrong on some platforms, and is also
+# unsuitable during cross-compilation, so we set the value unconditionally
+# (sixth argument of CS_EMIT_BUILD_PROPERTY).
+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_executable_p "$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_executable_p "$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
+
+cs_build_prop_val="$RANLIB"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}RANLIB = \"$cs_build_prop_val\" ;
+"
+fi
+
+
+
+    if test "$cs_prog_path_prepared" != yes; then
+  cs_prog_path_prepared=yes
+       PATH="$PATH$PATH_SEPARATOR/usr/local/bin$PATH_SEPARATOR/sw/bin"
+       export PATH
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in windres
+  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_WINDRES+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$WINDRES"; then
+  ac_cv_prog_WINDRES="$WINDRES" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_WINDRES="$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
+WINDRES=$ac_cv_prog_WINDRES
+if test -n "$WINDRES"; then
+  { echo "$as_me:$LINENO: result: $WINDRES" >&5
+echo "${ECHO_T}$WINDRES" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+    test -n "$WINDRES" && break
+  done
+fi
+if test -z "$WINDRES"; then
+  ac_ct_WINDRES=$WINDRES
+  for ac_prog in windres
+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_WINDRES+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_WINDRES"; then
+  ac_cv_prog_ac_ct_WINDRES="$ac_ct_WINDRES" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_WINDRES="$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_WINDRES=$ac_cv_prog_ac_ct_WINDRES
+if test -n "$ac_ct_WINDRES"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_WINDRES" >&5
+echo "${ECHO_T}$ac_ct_WINDRES" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$ac_ct_WINDRES" && break
+done
+
+  if test "x$ac_ct_WINDRES" = x; then
+    WINDRES=""
+  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
+    WINDRES=$ac_ct_WINDRES
+  fi
+fi
+
+cs_build_prop_val="$WINDRES"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}CMD.WINDRES ?= \"$cs_build_prop_val\" ;
+"
+fi
+
+
+
+    if test "$cs_prog_path_prepared" != yes; then
+  cs_prog_path_prepared=yes
+       PATH="$PATH$PATH_SEPARATOR/usr/local/bin$PATH_SEPARATOR/sw/bin"
+       export PATH
+fi
+
+    for ac_prog in doxygen
+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_DOXYGEN+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$DOXYGEN"; then
+  ac_cv_prog_DOXYGEN="$DOXYGEN" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_DOXYGEN="$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
+DOXYGEN=$ac_cv_prog_DOXYGEN
+if test -n "$DOXYGEN"; then
+  { echo "$as_me:$LINENO: result: $DOXYGEN" >&5
+echo "${ECHO_T}$DOXYGEN" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$DOXYGEN" && break
+done
+
+cs_build_prop_val="$DOXYGEN"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}CMD.DOXYGEN ?= \"$cs_build_prop_val\" ;
+"
+fi
+
+
+
+    if test "$cs_prog_path_prepared" != yes; then
+  cs_prog_path_prepared=yes
+       PATH="$PATH$PATH_SEPARATOR/usr/local/bin$PATH_SEPARATOR/sw/bin"
+       export PATH
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in dot
+  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_DOT+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$DOT"; then
+  ac_cv_prog_DOT="$DOT" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_DOT="$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
+DOT=$ac_cv_prog_DOT
+if test -n "$DOT"; then
+  { echo "$as_me:$LINENO: result: $DOT" >&5
+echo "${ECHO_T}$DOT" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+    test -n "$DOT" && break
+  done
+fi
+if test -z "$DOT"; then
+  ac_ct_DOT=$DOT
+  for ac_prog in dot
+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_DOT+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_DOT"; then
+  ac_cv_prog_ac_ct_DOT="$ac_ct_DOT" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_DOT="$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_DOT=$ac_cv_prog_ac_ct_DOT
+if test -n "$ac_ct_DOT"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_DOT" >&5
+echo "${ECHO_T}$ac_ct_DOT" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$ac_ct_DOT" && break
+done
+
+  if test "x$ac_ct_DOT" = x; then
+    DOT=""
+  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
+    DOT=$ac_ct_DOT
+  fi
+fi
+
+cs_build_prop_val="$DOT"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}CMD.DOT ?= \"$cs_build_prop_val\" ;
+"
+fi
+
+
+
+    if test "$cs_prog_path_prepared" != yes; then
+  cs_prog_path_prepared=yes
+       PATH="$PATH$PATH_SEPARATOR/usr/local/bin$PATH_SEPARATOR/sw/bin"
+       export PATH
+fi
+
+    for ac_prog in texi2dvi
+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_TEXI2DVI+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$TEXI2DVI"; then
+  ac_cv_prog_TEXI2DVI="$TEXI2DVI" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_TEXI2DVI="$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
+TEXI2DVI=$ac_cv_prog_TEXI2DVI
+if test -n "$TEXI2DVI"; then
+  { echo "$as_me:$LINENO: result: $TEXI2DVI" >&5
+echo "${ECHO_T}$TEXI2DVI" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$TEXI2DVI" && break
+done
+
+cs_build_prop_val="$TEXI2DVI"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}CMD.TEXI2DVI ?= \"$cs_build_prop_val\" ;
+"
+fi
+
+
+
+    if test "$cs_prog_path_prepared" != yes; then
+  cs_prog_path_prepared=yes
+       PATH="$PATH$PATH_SEPARATOR/usr/local/bin$PATH_SEPARATOR/sw/bin"
+       export PATH
+fi
+
+    for ac_prog in texi2pdf
+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_TEXI2PDF+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$TEXI2PDF"; then
+  ac_cv_prog_TEXI2PDF="$TEXI2PDF" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_TEXI2PDF="$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
+TEXI2PDF=$ac_cv_prog_TEXI2PDF
+if test -n "$TEXI2PDF"; then
+  { echo "$as_me:$LINENO: result: $TEXI2PDF" >&5
+echo "${ECHO_T}$TEXI2PDF" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$TEXI2PDF" && break
+done
+
+cs_build_prop_val="$TEXI2PDF"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}CMD.TEXI2PDF ?= \"$cs_build_prop_val\" ;
+"
+fi
+
+
+
+    if test "$cs_prog_path_prepared" != yes; then
+  cs_prog_path_prepared=yes
+       PATH="$PATH$PATH_SEPARATOR/usr/local/bin$PATH_SEPARATOR/sw/bin"
+       export PATH
+fi
+
+    for ac_prog in dvips
+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_DVIPS+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$DVIPS"; then
+  ac_cv_prog_DVIPS="$DVIPS" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_DVIPS="$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
+DVIPS=$ac_cv_prog_DVIPS
+if test -n "$DVIPS"; then
+  { echo "$as_me:$LINENO: result: $DVIPS" >&5
+echo "${ECHO_T}$DVIPS" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$DVIPS" && break
+done
+
+cs_build_prop_val="$DVIPS"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}CMD.DVIPS ?= \"$cs_build_prop_val\" ;
+"
+fi
+
+
+
+    if test "$cs_prog_path_prepared" != yes; then
+  cs_prog_path_prepared=yes
+       PATH="$PATH$PATH_SEPARATOR/usr/local/bin$PATH_SEPARATOR/sw/bin"
+       export PATH
+fi
+
+    for ac_prog in dvipdf
+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_DVIPDF+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$DVIPDF"; then
+  ac_cv_prog_DVIPDF="$DVIPDF" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_DVIPDF="$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
+DVIPDF=$ac_cv_prog_DVIPDF
+if test -n "$DVIPDF"; then
+  { echo "$as_me:$LINENO: result: $DVIPDF" >&5
+echo "${ECHO_T}$DVIPDF" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$DVIPDF" && break
+done
+
+cs_build_prop_val="$DVIPDF"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}CMD.DVIPDF ?= \"$cs_build_prop_val\" ;
+"
+fi
+
+
+
+    if test "$cs_prog_path_prepared" != yes; then
+  cs_prog_path_prepared=yes
+       PATH="$PATH$PATH_SEPARATOR/usr/local/bin$PATH_SEPARATOR/sw/bin"
+       export PATH
+fi
+
+    for ac_prog in makeinfo
+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_MAKEINFO+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$MAKEINFO"; then
+  ac_cv_prog_MAKEINFO="$MAKEINFO" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_MAKEINFO="$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
+MAKEINFO=$ac_cv_prog_MAKEINFO
+if test -n "$MAKEINFO"; then
+  { echo "$as_me:$LINENO: result: $MAKEINFO" >&5
+echo "${ECHO_T}$MAKEINFO" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$MAKEINFO" && break
+done
+
+cs_build_prop_val="$MAKEINFO"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}CMD.MAKEINFO ?= \"$cs_build_prop_val\" ;
+"
+fi
+
+
+
+    if test "$cs_prog_path_prepared" != yes; then
+  cs_prog_path_prepared=yes
+       PATH="$PATH$PATH_SEPARATOR/usr/local/bin$PATH_SEPARATOR/sw/bin"
+       export PATH
+fi
+
+    for ac_prog in install
+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_INSTALL+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$INSTALL"; then
+  ac_cv_prog_INSTALL="$INSTALL" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_INSTALL="$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
+INSTALL=$ac_cv_prog_INSTALL
+if test -n "$INSTALL"; then
+  { echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$INSTALL" && break
+done
+
+cs_build_prop_val="$INSTALL"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}INSTALL ?= \"$cs_build_prop_val\" ;
+"
+fi
+
+
+# GNU: Search for libtool before glibtool since Fink version is likely newer.
+
+if test -z "$LIBTOOL"; then
+
+    if test "$cs_prog_path_prepared" != yes; then
+  cs_prog_path_prepared=yes
+       PATH="$PATH$PATH_SEPARATOR/usr/local/bin$PATH_SEPARATOR/sw/bin"
+       export PATH
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in libtool glibtool gnulibtool
+  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_LIBTOOL_TEST+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$LIBTOOL_TEST"; then
+  ac_cv_prog_LIBTOOL_TEST="$LIBTOOL_TEST" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in     /sw/bin$PATH_SEPARATOR/usr/local/bin$PATH_SEPARATOR$PATH$PATH_SEPARATOR/usr/local/bin$PATH_SEPARATOR/sw/bin
+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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_LIBTOOL_TEST="$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
+LIBTOOL_TEST=$ac_cv_prog_LIBTOOL_TEST
+if test -n "$LIBTOOL_TEST"; then
+  { echo "$as_me:$LINENO: result: $LIBTOOL_TEST" >&5
+echo "${ECHO_T}$LIBTOOL_TEST" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+    test -n "$LIBTOOL_TEST" && break
+  done
+fi
+if test -z "$LIBTOOL_TEST"; then
+  ac_ct_LIBTOOL_TEST=$LIBTOOL_TEST
+  for ac_prog in libtool glibtool gnulibtool
+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_LIBTOOL_TEST+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_LIBTOOL_TEST"; then
+  ac_cv_prog_ac_ct_LIBTOOL_TEST="$ac_ct_LIBTOOL_TEST" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in     /sw/bin$PATH_SEPARATOR/usr/local/bin$PATH_SEPARATOR$PATH$PATH_SEPARATOR/usr/local/bin$PATH_SEPARATOR/sw/bin
+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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_LIBTOOL_TEST="$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_LIBTOOL_TEST=$ac_cv_prog_ac_ct_LIBTOOL_TEST
+if test -n "$ac_ct_LIBTOOL_TEST"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_LIBTOOL_TEST" >&5
+echo "${ECHO_T}$ac_ct_LIBTOOL_TEST" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$ac_ct_LIBTOOL_TEST" && break
+done
+
+  if test "x$ac_ct_LIBTOOL_TEST" = x; then
+    LIBTOOL_TEST=""
+  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
+    LIBTOOL_TEST=$ac_ct_LIBTOOL_TEST
+  fi
+fi
+
+    if test -n "$LIBTOOL_TEST"; then
+
+    if test "$cs_prog_path_prepared" != yes; then
+  cs_prog_path_prepared=yes
+       PATH="$PATH$PATH_SEPARATOR/usr/local/bin$PATH_SEPARATOR/sw/bin"
+       export PATH
+fi
+
+    # Extract the first word of "$LIBTOOL_TEST", so it can be a program name with args.
+set dummy $LIBTOOL_TEST; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_LIBTOOL_PATH+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $LIBTOOL_PATH in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_LIBTOOL_PATH="$LIBTOOL_PATH" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in     /sw/bin$PATH_SEPARATOR/usr/local/bin$PATH_SEPARATOR$PATH$PATH_SEPARATOR/usr/local/bin$PATH_SEPARATOR/sw/bin
+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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_LIBTOOL_PATH="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+LIBTOOL_PATH=$ac_cv_path_LIBTOOL_PATH
+if test -n "$LIBTOOL_PATH"; then
+  { echo "$as_me:$LINENO: result: $LIBTOOL_PATH" >&5
+echo "${ECHO_T}$LIBTOOL_PATH" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+       if test -n "$LIBTOOL_PATH"; then
+  { echo "$as_me:$LINENO: checking classification of $LIBTOOL_PATH" >&5
+echo $ECHO_N "checking classification of $LIBTOOL_PATH... $ECHO_C" >&6; }
+       if { (echo "$as_me:$LINENO: \$LIBTOOL_PATH --version 1>&2") >&5
+  ($LIBTOOL_PATH --version 1>&2) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  { echo "$as_me:$LINENO: result: gnu" >&5
+echo "${ECHO_T}gnu" >&6; }
+           LIBTOOL="$LIBTOOL_PATH"
+else
+  { echo "$as_me:$LINENO: result: apple" >&5
+echo "${ECHO_T}apple" >&6; }
+           if test -z "$APPLE_LIBTOOL"; then
+  APPLE_LIBTOOL="$LIBTOOL_PATH"
+fi
+
+
+    if test "$cs_prog_path_prepared" != yes; then
+  cs_prog_path_prepared=yes
+       PATH="$PATH$PATH_SEPARATOR/usr/local/bin$PATH_SEPARATOR/sw/bin"
+       export PATH
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in glibtool gnulibtool
+  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_LIBTOOL+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$LIBTOOL"; then
+  ac_cv_prog_LIBTOOL="$LIBTOOL" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_LIBTOOL="$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
+LIBTOOL=$ac_cv_prog_LIBTOOL
+if test -n "$LIBTOOL"; then
+  { echo "$as_me:$LINENO: result: $LIBTOOL" >&5
+echo "${ECHO_T}$LIBTOOL" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+    test -n "$LIBTOOL" && break
+  done
+fi
+if test -z "$LIBTOOL"; then
+  ac_ct_LIBTOOL=$LIBTOOL
+  for ac_prog in glibtool gnulibtool
+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_LIBTOOL+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_LIBTOOL"; then
+  ac_cv_prog_ac_ct_LIBTOOL="$ac_ct_LIBTOOL" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_LIBTOOL="$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_LIBTOOL=$ac_cv_prog_ac_ct_LIBTOOL
+if test -n "$ac_ct_LIBTOOL"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_LIBTOOL" >&5
+echo "${ECHO_T}$ac_ct_LIBTOOL" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$ac_ct_LIBTOOL" && break
+done
+
+  if test "x$ac_ct_LIBTOOL" = x; then
+    LIBTOOL=""
+  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
+    LIBTOOL=$ac_ct_LIBTOOL
+  fi
+fi
+
+fi
+
+fi
+
+fi
+
+fi
+
+
+
+# Apple: Ensure that Apple libtool will be found before GNU libtool from Fink.
+
+if test -z "$APPLE_LIBTOOL"; then
+
+    if test "$cs_prog_path_prepared" != yes; then
+  cs_prog_path_prepared=yes
+       PATH="$PATH$PATH_SEPARATOR/usr/local/bin$PATH_SEPARATOR/sw/bin"
+       export PATH
+fi
+
+    # Extract the first word of "libtool", so it can be a program name with args.
+set dummy libtool; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_CS_LT_APPLE+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $CS_LT_APPLE in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_CS_LT_APPLE="$CS_LT_APPLE" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in     /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH$PATH_SEPARATOR/usr/local/bin$PATH_SEPARATOR/sw/bin
+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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_CS_LT_APPLE="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+CS_LT_APPLE=$ac_cv_path_CS_LT_APPLE
+if test -n "$CS_LT_APPLE"; then
+  { echo "$as_me:$LINENO: result: $CS_LT_APPLE" >&5
+echo "${ECHO_T}$CS_LT_APPLE" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+    if test -n "$CS_LT_APPLE"; then
+  { echo "$as_me:$LINENO: checking classification of $CS_LT_APPLE" >&5
+echo $ECHO_N "checking classification of $CS_LT_APPLE... $ECHO_C" >&6; }
+       if { (echo "$as_me:$LINENO: \$CS_LT_APPLE --version 1>&2") >&5
+  ($CS_LT_APPLE --version 1>&2) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  { echo "$as_me:$LINENO: result: gnu" >&5
+echo "${ECHO_T}gnu" >&6; }
+
+else
+  { echo "$as_me:$LINENO: result: apple" >&5
+echo "${ECHO_T}apple" >&6; }
+           APPLE_LIBTOOL="$CS_LT_APPLE"
+fi
+
+fi
+
+fi
+
+
+cs_build_prop_val="$LIBTOOL"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}LIBTOOL ?= \"$cs_build_prop_val\" ;
+"
+fi
+
+cs_build_prop_val="$APPLE_LIBTOOL"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}APPLE_LIBTOOL ?= \"$cs_build_prop_val\" ;
+"
+fi
+
+
+{ echo "$as_me:$LINENO: checking how to create a directory" >&5
+echo $ECHO_N "checking how to create a directory... $ECHO_C" >&6; }
+if test "${cs_cv_shell_mkdir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cs_cv_shell_mkdir='mkdir'
+fi
+{ echo "$as_me:$LINENO: result: $cs_cv_shell_mkdir" >&5
+echo "${ECHO_T}$cs_cv_shell_mkdir" >&6; }
+    MKDIR=$cs_cv_shell_mkdir
+
+
+    { echo "$as_me:$LINENO: checking how to create a directory tree" >&5
+echo $ECHO_N "checking how to create a directory tree... $ECHO_C" >&6; }
+if test "${cs_cv_shell_mkdir_p+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if $cs_cv_shell_mkdir -p . 2>/dev/null; then
+           cs_cv_shell_mkdir_p='mkdir -p'
+       elif mkdirs . 2>/dev/null; then
+           cs_cv_shell_mkdir_p='mkdirs'
+       fi
+       test -d ./-p && rmdir ./-p
+fi
+{ echo "$as_me:$LINENO: result: $cs_cv_shell_mkdir_p" >&5
+echo "${ECHO_T}$cs_cv_shell_mkdir_p" >&6; }
+    if test "${cs_cv_shell_mkdir_p+set}" = set; then
+  MKDIRS=$cs_cv_shell_mkdir_p
+
+else
+  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
+    { { echo "$as_me:$LINENO: error: do not know how to create a directory tree" >&5
+echo "$as_me: error: do not know how to create a directory tree" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+cs_build_prop_val="$MKDIR"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}CMD.MKDIR ?= \"$cs_build_prop_val\" ;
+"
+fi
+
+cs_build_prop_val="$MKDIRS"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}CMD.MKDIRS ?= \"$cs_build_prop_val\" ;
+"
+fi
+
+
+
+    if test "$cs_prog_path_prepared" != yes; then
+  cs_prog_path_prepared=yes
+       PATH="$PATH$PATH_SEPARATOR/usr/local/bin$PATH_SEPARATOR/sw/bin"
+       export PATH
+fi
+
+    for ac_prog in perl5 perl
+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_PERL+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$PERL"; then
+  ac_cv_prog_PERL="$PERL" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_PERL="$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
+PERL=$ac_cv_prog_PERL
+if test -n "$PERL"; then
+  { echo "$as_me:$LINENO: result: $PERL" >&5
+echo "${ECHO_T}$PERL" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$PERL" && break
+done
+
+cs_build_prop_val="$PERL"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}PERL ?= \"$cs_build_prop_val\" ;
+"
+fi
+
+
+
+    if test "$cs_prog_path_prepared" != yes; then
+  cs_prog_path_prepared=yes
+       PATH="$PATH$PATH_SEPARATOR/usr/local/bin$PATH_SEPARATOR/sw/bin"
+       export PATH
+fi
+
+    for ac_prog in perl5 perl
+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_PERL+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$PERL"; then
+  ac_cv_prog_PERL="$PERL" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_PERL="$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
+PERL=$ac_cv_prog_PERL
+if test -n "$PERL"; then
+  { echo "$as_me:$LINENO: result: $PERL" >&5
+echo "${ECHO_T}$PERL" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$PERL" && break
+done
+
+    if test -n "$PERL"; then
+  { echo "$as_me:$LINENO: checking for TemplateToolkit" >&5
+echo $ECHO_N "checking for TemplateToolkit... $ECHO_C" >&6; }
+if test "${cs_cv_perl_tt2+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if { (echo "$as_me:$LINENO: \$PERL -M'Template 2.11' -MTemplate::Plugin -e 0 1>&2") >&5
+  ($PERL -M'Template 2.11' -MTemplate::Plugin -e 0 1>&2) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  cs_cv_perl_tt2=yes
+else
+  cs_cv_perl_tt2=no
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $cs_cv_perl_tt2" >&5
+echo "${ECHO_T}$cs_cv_perl_tt2" >&6; }
+
+    if test "$cs_prog_path_prepared" != yes; then
+  cs_prog_path_prepared=yes
+       PATH="$PATH$PATH_SEPARATOR/usr/local/bin$PATH_SEPARATOR/sw/bin"
+       export PATH
+fi
+
+    for ac_prog in ttree
+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_path_TTREE+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $TTREE in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_TTREE="$TTREE" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_TTREE="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+TTREE=$ac_cv_path_TTREE
+if test -n "$TTREE"; then
+  { echo "$as_me:$LINENO: result: $TTREE" >&5
+echo "${ECHO_T}$TTREE" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$TTREE" && break
+done
+
+       if test $cs_cv_perl_tt2 = yes && test -n "$TTREE"; then
+  cs_build_prop_val="$TTREE"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}TTREE ?= \"$cs_build_prop_val\" ;
+"
+fi
+
+fi
+
+fi
+
+
+#----------------------------------------------------------------------------
+# Determine system type
+#----------------------------------------------------------------------------
+
+
+    case $host_cpu in
+        [Ii][3-9]86*|[Xx]86*) cs_host_cpu=x86 ;;
+        *) cs_host_cpu=$host_cpu ;;
+    esac
+    cs_host_cpu_normalized="`echo "$cs_host_cpu" | $as_tr_cpp`"
+    cs_jamconfig_text="${cs_jamconfig_text}TARGET.PROCESSOR ?= \"$cs_host_cpu_normalized\" ;
+"
+
+    cs_host_os_normalized=''
+    case $host_os in
+        mingw*|cygwin*)
+            cs_host_target=win32gcc
+            cs_host_family=windows
+            ;;
+        darwin*)
+
+
+
+    # Both MacOS/X and Darwin are identified via $host_os as "darwin".  We need
+    # a way to distinguish between the two.  If Carbon.h is present, then
+    # assume MacOX/S; if not, assume Darwin.  If --with-x=yes was invoked, and
+    # Carbon.h is present, then assume that user wants to cross-build for
+    # Darwin even though build host is MacOS/X.
+    # IMPLEMENTATION NOTE *1*
+    # The QuickTime 7.0 installer removes <CarbonSound/CarbonSound.h>, which
+    # causes #include <Carbon/Carbon.h> to fail unconditionally. Re-installing
+    # the QuickTime SDK should restore the header, however not all developers
+    # know to do this, so we work around the problem of the missing
+    # CarbonSound.h by #defining __CARBONSOUND__ in the test in order to
+    # prevent Carbon.h from attempting to #include the missing header.
+    # IMPLEMENTATION NOTE *2*
+    # At least one MacOS/X user switches between gcc 2.95 and gcc 3.3 with a
+    # script which toggles the values of CC, CXX, and CPP.  Unfortunately, CPP
+    # was being set to run the preprocessor directly ("cpp", for instance)
+    # rather than running it via the compiler ("gcc -E", for instance).  The
+    # problem with running the preprocessor directly is that __APPLE__ and
+    # __GNUC__ are not defined, which causes the Carbon.h check to fail.  We
+    # avoid this problem by supplying a non-empty fourth argument to
+    # AC_CHECK_HEADER(), which causes it to test compile the header only (which
+    # is a more robust test), rather than also testing it via the preprocessor.
+
+
+cat >>confdefs.h <<\_ACEOF
+#define __CARBONSOUND__
+_ACEOF
+
+    { echo "$as_me:$LINENO: checking for Carbon/Carbon.h" >&5
+echo $ECHO_N "checking for Carbon/Carbon.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_Carbon_Carbon_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.  */
+/* force compile */
+
+#include <Carbon/Carbon.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_header_Carbon_Carbon_h=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_header_Carbon_Carbon_h=no
+fi
+
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_Carbon_Carbon_h" >&5
+echo "${ECHO_T}$ac_cv_header_Carbon_Carbon_h" >&6; }
+if test $ac_cv_header_Carbon_Carbon_h = yes; then
+  cs_host_macosx=yes
+else
+  cs_host_macosx=no
+fi
+
+
+
+    if test $cs_host_macosx = yes; then
+  { echo "$as_me:$LINENO: checking for --with-x" >&5
+echo $ECHO_N "checking for --with-x... $ECHO_C" >&6; }
+       if test "${with_x+set}" = set && test "$with_x" = "yes"; then
+  { echo "$as_me:$LINENO: result: yes (assume Darwin)" >&5
+echo "${ECHO_T}yes (assume Darwin)" >&6; }
+           cs_host_macosx=no
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+fi
+
+
+    if test $cs_host_macosx = yes; then
+  cs_host_target=macosx
+       cs_host_family=unix
+       cs_host_os_normalized='MacOS/X'
+
+cat >>confdefs.h <<\_ACEOF
+#define CS_PLATFORM_MACOSX
+_ACEOF
+
+
+       { echo "$as_me:$LINENO: checking for Objective-C compiler" >&5
+echo $ECHO_N "checking for Objective-C compiler... $ECHO_C" >&6; }
+if test "${cs_cv_prog_objc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cs_cv_prog_objc="$CC"
+fi
+{ echo "$as_me:$LINENO: result: $cs_cv_prog_objc" >&5
+echo "${ECHO_T}$cs_cv_prog_objc" >&6; }
+       cs_jamconfig_text="${cs_jamconfig_text}CMD.OBJC ?= \"$cs_cv_prog_objc\" ;
+"
+       { echo "$as_me:$LINENO: checking for Objective-C++ compiler" >&5
+echo $ECHO_N "checking for Objective-C++ compiler... $ECHO_C" >&6; }
+if test "${cs_cv_prog_objcxx+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cs_cv_prog_objcxx="$CXX"
+fi
+{ echo "$as_me:$LINENO: result: $cs_cv_prog_objcxx" >&5
+echo "${ECHO_T}$cs_cv_prog_objcxx" >&6; }
+       cs_jamconfig_text="${cs_jamconfig_text}CMD.OBJC++ ?= \"$cs_cv_prog_objcxx\" ;
+"
+else
+  cs_host_target=unix
+       cs_host_family=unix
+fi
+
+            ;;
+        *)
+            # Everything else is assumed to be Unix or Unix-like.
+            cs_host_target=unix
+            cs_host_family=unix
+           ;;
+    esac
+
+    case $cs_host_family in
+       windows)
+
+cat >>confdefs.h <<\_ACEOF
+#define CS_PLATFORM_WIN32
+_ACEOF
+
+           if test -z "$cs_host_os_normalized"; then
+  cs_host_os_normalized='Win32'
+fi
+
+           ;;
+       unix)
+
+cat >>confdefs.h <<\_ACEOF
+#define CS_PLATFORM_UNIX
+_ACEOF
+
+           if test -z "$cs_host_os_normalized"; then
+  cs_host_os_normalized='Unix'
+fi
+
+           ;;
+    esac
+
+    cs_host_os_normalized_uc="`echo "$cs_host_os_normalized" | $as_tr_cpp`"
+    cs_jamconfig_text="${cs_jamconfig_text}TARGET.OS ?= \"$cs_host_os_normalized_uc\" ;
+"
+    cs_jamconfig_text="${cs_jamconfig_text}TARGET.OS.NORMALIZED ?= \"$cs_host_os_normalized\" ;
+"
+
+
+#----------------------------------------------------------------------------
+# Check for syntax problems / header files
+#----------------------------------------------------------------------------
+# Nothing yet.
+
+#----------------------------------------------------------------------------
+# Check for external libraries
+#----------------------------------------------------------------------------
+
+# Check whether --with-cppunit was given.
+if test "${with_cppunit+set}" = set; then
+  withval=$with_cppunit;
+fi
+
+
+    # Backward compatibility: Recognize --with-libcppunit as alias for --with-cppunit.
+    if test -n "$with_libcppunit" && test -z "$with_cppunit"; then
+  with_cppunit="$with_libcppunit"
+fi
+
+
+    if test -z "$with_cppunit"; then
+  with_cppunit=yes
+fi
+
+    if test "$with_cppunit" != no; then
+  # If --with-cppunit value is same as cached value, then assume other
+        # cached values are also valid; otherwise, ignore all cached values.
+       if test "$with_cppunit" != "$cs_cv_with_cppunit"; then
+  cs_ignore_cache=yes
+else
+  cs_ignore_cache=no
+fi
+
+
+       cs_check_lib_flags=''
+       if test $with_cppunit = yes; then
+  if test "$cs_prog_pkg_config_checked" != yes; then
+
+    if test "$cs_prog_path_prepared" != yes; then
+  cs_prog_path_prepared=yes
+       PATH="$PATH$PATH_SEPARATOR/usr/local/bin$PATH_SEPARATOR/sw/bin"
+       export PATH
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in pkg-config
+  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_PKG_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$PKG_CONFIG"; then
+  ac_cv_prog_PKG_CONFIG="$PKG_CONFIG" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_PKG_CONFIG="$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
+PKG_CONFIG=$ac_cv_prog_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+echo "${ECHO_T}$PKG_CONFIG" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+    test -n "$PKG_CONFIG" && break
+  done
+fi
+if test -z "$PKG_CONFIG"; then
+  ac_ct_PKG_CONFIG=$PKG_CONFIG
+  for ac_prog in pkg-config
+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_PKG_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_PKG_CONFIG"; then
+  ac_cv_prog_ac_ct_PKG_CONFIG="$ac_ct_PKG_CONFIG" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_PKG_CONFIG="$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_PKG_CONFIG=$ac_cv_prog_ac_ct_PKG_CONFIG
+if test -n "$ac_ct_PKG_CONFIG"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_PKG_CONFIG" >&5
+echo "${ECHO_T}$ac_ct_PKG_CONFIG" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$ac_ct_PKG_CONFIG" && break
+done
+
+  if test "x$ac_ct_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  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
+    PKG_CONFIG=$ac_ct_PKG_CONFIG
+  fi
+fi
+
+       PKG_CONFIG_PATH="/usr/local/lib/pkgconfig$PATH_SEPARATOR/sw/lib/pkgconfig$PATH_SEPARATOR/opt/local/lib/pkgconfig$PATH_SEPARATOR/opt/lib/pkgconfig$PATH_SEPARATOR$PKG_CONFIG_PATH"
+    export PKG_CONFIG_PATH
+       cs_prog_pkg_config_checked=yes
+fi
+
+    if test -z "$cs_cv_prog_pkg_config_ok"; then
+  if test -n "$PKG_CONFIG"; then
+  if $PKG_CONFIG --atleast-pkgconfig-version=0.9.0; then
+  cs_cv_prog_pkg_config_ok=yes
+else
+  cs_cv_prog_pkg_config_ok=no
+fi
+
+else
+  cs_cv_prog_pkg_config_ok=no
+fi
+
+fi
+
+    if test $cs_cv_prog_pkg_config_ok = yes; then
+  { echo "$as_me:$LINENO: checking if $PKG_CONFIG recognizes cppunit" >&5
+echo $ECHO_N "checking if $PKG_CONFIG recognizes cppunit... $ECHO_C" >&6; }
+if test "${cs_cv_prog_pkg_config_cppunit+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if $PKG_CONFIG --exists cppunit; then
+  cs_cv_prog_pkg_config_cppunit=yes
+else
+  cs_cv_prog_pkg_config_cppunit=no
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $cs_cv_prog_pkg_config_cppunit" >&5
+echo "${ECHO_T}$cs_cv_prog_pkg_config_cppunit" >&6; }
+       if test $cs_cv_prog_pkg_config_cppunit = yes; then
+  if test -z "$cs_cv_prog_pkg_config_cppunit_flags"; then
+  cs_check_lib_cflag=`{ (echo "$as_me:$LINENO: \$PKG_CONFIG --cflags cppunit") >&5
+  ($PKG_CONFIG --cflags cppunit) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } | tr '\\\\' '/' | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_check_lib_lflag=''
+       cs_check_lib_libs=`{ (echo "$as_me:$LINENO: \$PKG_CONFIG --libs cppunit") >&5
+  ($PKG_CONFIG --libs cppunit) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } | tr '\\\\' '/' | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_cv_prog_pkg_config_cppunit_flags=`echo @$cs_check_lib_cflag@$cs_check_lib_lflag@$cs_check_lib_libs | sed 'y% %#%'`
+fi
+
+    cs_check_lib_flags="$cs_check_lib_flags $cs_cv_prog_pkg_config_cppunit_flags"
+fi
+
+fi
+
+
+    if test "$cs_prog_path_prepared" != yes; then
+  cs_prog_path_prepared=yes
+       PATH="$PATH$PATH_SEPARATOR/usr/local/bin$PATH_SEPARATOR/sw/bin"
+       export PATH
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in cppunit-config
+  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_CONFIG_CPPUNIT+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CONFIG_CPPUNIT"; then
+  ac_cv_prog_CONFIG_CPPUNIT="$CONFIG_CPPUNIT" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CONFIG_CPPUNIT="$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
+CONFIG_CPPUNIT=$ac_cv_prog_CONFIG_CPPUNIT
+if test -n "$CONFIG_CPPUNIT"; then
+  { echo "$as_me:$LINENO: result: $CONFIG_CPPUNIT" >&5
+echo "${ECHO_T}$CONFIG_CPPUNIT" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+    test -n "$CONFIG_CPPUNIT" && break
+  done
+fi
+if test -z "$CONFIG_CPPUNIT"; then
+  ac_ct_CONFIG_CPPUNIT=$CONFIG_CPPUNIT
+  for ac_prog in cppunit-config
+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_CONFIG_CPPUNIT+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CONFIG_CPPUNIT"; then
+  ac_cv_prog_ac_ct_CONFIG_CPPUNIT="$ac_ct_CONFIG_CPPUNIT" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CONFIG_CPPUNIT="$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_CONFIG_CPPUNIT=$ac_cv_prog_ac_ct_CONFIG_CPPUNIT
+if test -n "$ac_ct_CONFIG_CPPUNIT"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_CONFIG_CPPUNIT" >&5
+echo "${ECHO_T}$ac_ct_CONFIG_CPPUNIT" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CONFIG_CPPUNIT" && break
+done
+
+  if test "x$ac_ct_CONFIG_CPPUNIT" = x; then
+    CONFIG_CPPUNIT=""
+  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
+    CONFIG_CPPUNIT=$ac_ct_CONFIG_CPPUNIT
+  fi
+fi
+
+    if test -n "$CONFIG_CPPUNIT"; then
+  if test -z "$cs_cv_prog_config_cppunit_ok"; then
+  if $CONFIG_CPPUNIT --cflags --libs >/dev/null 2>&1; then
+  cs_cv_prog_config_cppunit_ok=yes
+else
+  cs_cv_prog_config_cppunit_ok=no
+fi
+
+fi
+
+       if test $cs_cv_prog_config_cppunit_ok = yes; then
+  if test -z "$cs_cv_prog_config_cppunit_flags"; then
+  cs_check_lib_cflag=`{ (echo "$as_me:$LINENO: \$CONFIG_CPPUNIT --cflags ") >&5
+  ($CONFIG_CPPUNIT --cflags ) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } | tr '\\\\' '/' | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_check_lib_lflag=''
+       cs_check_lib_libs=`{ (echo "$as_me:$LINENO: \$CONFIG_CPPUNIT --libs ") >&5
+  ($CONFIG_CPPUNIT --libs ) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } | tr '\\\\' '/' | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_cv_prog_config_cppunit_flags=`echo @$cs_check_lib_cflag@$cs_check_lib_lflag@$cs_check_lib_libs | sed 'y% %#%'`
+fi
+
+    cs_check_lib_flags="$cs_check_lib_flags $cs_cv_prog_config_cppunit_flags"
+fi
+
+fi
+
+               if test "$cs_prog_pkg_config_checked" != yes; then
+
+    if test "$cs_prog_path_prepared" != yes; then
+  cs_prog_path_prepared=yes
+       PATH="$PATH$PATH_SEPARATOR/usr/local/bin$PATH_SEPARATOR/sw/bin"
+       export PATH
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in pkg-config
+  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_PKG_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$PKG_CONFIG"; then
+  ac_cv_prog_PKG_CONFIG="$PKG_CONFIG" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_PKG_CONFIG="$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
+PKG_CONFIG=$ac_cv_prog_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+echo "${ECHO_T}$PKG_CONFIG" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+    test -n "$PKG_CONFIG" && break
+  done
+fi
+if test -z "$PKG_CONFIG"; then
+  ac_ct_PKG_CONFIG=$PKG_CONFIG
+  for ac_prog in pkg-config
+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_PKG_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_PKG_CONFIG"; then
+  ac_cv_prog_ac_ct_PKG_CONFIG="$ac_ct_PKG_CONFIG" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_PKG_CONFIG="$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_PKG_CONFIG=$ac_cv_prog_ac_ct_PKG_CONFIG
+if test -n "$ac_ct_PKG_CONFIG"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_PKG_CONFIG" >&5
+echo "${ECHO_T}$ac_ct_PKG_CONFIG" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$ac_ct_PKG_CONFIG" && break
+done
+
+  if test "x$ac_ct_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  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
+    PKG_CONFIG=$ac_ct_PKG_CONFIG
+  fi
+fi
+
+       PKG_CONFIG_PATH="/usr/local/lib/pkgconfig$PATH_SEPARATOR/sw/lib/pkgconfig$PATH_SEPARATOR/opt/local/lib/pkgconfig$PATH_SEPARATOR/opt/lib/pkgconfig$PATH_SEPARATOR$PKG_CONFIG_PATH"
+    export PKG_CONFIG_PATH
+       cs_prog_pkg_config_checked=yes
+fi
+
+    if test -z "$cs_cv_prog_pkg_config_ok"; then
+  if test -n "$PKG_CONFIG"; then
+  if $PKG_CONFIG --atleast-pkgconfig-version=0.9.0; then
+  cs_cv_prog_pkg_config_ok=yes
+else
+  cs_cv_prog_pkg_config_ok=no
+fi
+
+else
+  cs_cv_prog_pkg_config_ok=no
+fi
+
+fi
+
+    if test $cs_cv_prog_pkg_config_ok = yes; then
+  { echo "$as_me:$LINENO: checking if $PKG_CONFIG recognizes " >&5
+echo $ECHO_N "checking if $PKG_CONFIG recognizes ... $ECHO_C" >&6; }
+if test "${cs_cv_prog_pkg_config_+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if $PKG_CONFIG --exists ; then
+  cs_cv_prog_pkg_config_=yes
+else
+  cs_cv_prog_pkg_config_=no
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $cs_cv_prog_pkg_config_" >&5
+echo "${ECHO_T}$cs_cv_prog_pkg_config_" >&6; }
+       if test $cs_cv_prog_pkg_config_ = yes; then
+  if test -z "$cs_cv_prog_pkg_config__flags"; then
+  cs_check_lib_cflag=`{ (echo "$as_me:$LINENO: \$PKG_CONFIG --cflags ") >&5
+  ($PKG_CONFIG --cflags ) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } | tr '\\\\' '/' | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_check_lib_lflag=''
+       cs_check_lib_libs=`{ (echo "$as_me:$LINENO: \$PKG_CONFIG --libs ") >&5
+  ($PKG_CONFIG --libs ) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } | tr '\\\\' '/' | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_cv_prog_pkg_config__flags=`echo @$cs_check_lib_cflag@$cs_check_lib_lflag@$cs_check_lib_libs | sed 'y% %#%'`
+fi
+
+    cs_check_lib_flags="$cs_check_lib_flags $cs_cv_prog_pkg_config__flags"
+fi
+
+fi
+
+
+    if test "$cs_prog_path_prepared" != yes; then
+  cs_prog_path_prepared=yes
+       PATH="$PATH$PATH_SEPARATOR/usr/local/bin$PATH_SEPARATOR/sw/bin"
+       export PATH
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in -config
+  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_CONFIG_+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CONFIG_"; then
+  ac_cv_prog_CONFIG_="$CONFIG_" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CONFIG_="$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
+CONFIG_=$ac_cv_prog_CONFIG_
+if test -n "$CONFIG_"; then
+  { echo "$as_me:$LINENO: result: $CONFIG_" >&5
+echo "${ECHO_T}$CONFIG_" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+    test -n "$CONFIG_" && break
+  done
+fi
+if test -z "$CONFIG_"; then
+  ac_ct_CONFIG_=$CONFIG_
+  for ac_prog in -config
+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_CONFIG_+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CONFIG_"; then
+  ac_cv_prog_ac_ct_CONFIG_="$ac_ct_CONFIG_" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CONFIG_="$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_CONFIG_=$ac_cv_prog_ac_ct_CONFIG_
+if test -n "$ac_ct_CONFIG_"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_CONFIG_" >&5
+echo "${ECHO_T}$ac_ct_CONFIG_" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CONFIG_" && break
+done
+
+  if test "x$ac_ct_CONFIG_" = x; then
+    CONFIG_=""
+  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
+    CONFIG_=$ac_ct_CONFIG_
+  fi
+fi
+
+    if test -n "$CONFIG_"; then
+  if test -z "$cs_cv_prog_config__ok"; then
+  if $CONFIG_ --cflags --libs >/dev/null 2>&1; then
+  cs_cv_prog_config__ok=yes
+else
+  cs_cv_prog_config__ok=no
+fi
+
+fi
+
+       if test $cs_cv_prog_config__ok = yes; then
+  if test -z "$cs_cv_prog_config__flags"; then
+  cs_check_lib_cflag=`{ (echo "$as_me:$LINENO: \$CONFIG_ --cflags ") >&5
+  ($CONFIG_ --cflags ) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } | tr '\\\\' '/' | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_check_lib_lflag=''
+       cs_check_lib_libs=`{ (echo "$as_me:$LINENO: \$CONFIG_ --libs ") >&5
+  ($CONFIG_ --libs ) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } | tr '\\\\' '/' | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_cv_prog_config__flags=`echo @$cs_check_lib_cflag@$cs_check_lib_lflag@$cs_check_lib_libs | sed 'y% %#%'`
+fi
+
+    cs_check_lib_flags="$cs_check_lib_flags $cs_cv_prog_config__flags"
+fi
+
+fi
+
+
+fi
+
+
+       if test $with_cppunit != yes; then
+  cs_check_lib_paths=$with_cppunit
+else
+  cs_check_lib_paths="| /usr/local/include|/usr/local/lib \
+    /sw/include|/sw/lib \
+    /opt/local/include|/opt/local/lib \
+    /opt/include|/opt/lib "
+fi
+
+       for cs_lib_item in $cs_check_lib_paths
+    do
+       case $cs_lib_item in
+           *\|*)
+    set filler `echo "$cs_lib_item" | awk 'BEGIN { FS="|" }
+       { for (i=1; i <= NF; ++i)
+           { if ($i == "") print "filler"; else print $i } }'`
+    shift
+    if test $# -eq 0; then
+  cs_check_incdir=''
+else
+  if test "$1" = filler; then
+  cs_check_incdir=''
+else
+  cs_check_incdir=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_check_libdir=''
+else
+  if test "$1" = filler; then
+  cs_check_libdir=''
+else
+  cs_check_libdir=$1
+fi
+
+       shift
+fi
+
+               if test -n "$cs_check_incdir"; then
+  cs_check_lib_cflag="-I$cs_check_incdir"
+else
+  cs_check_lib_cflag=''
+fi
+
+    if test -n "$cs_check_libdir"; then
+  cs_check_lib_lflag="-L$cs_check_libdir"
+else
+  cs_check_lib_lflag=''
+fi
+
+    if test -n "cppunit"; then
+  cs_check_lib_libs="-lcppunit"
+       cs_check_lib_framework="-framework cppunit"
+else
+  cs_check_lib_libs=''
+       cs_check_lib_framework=''
+fi
+
+    cs_check_lib_flags="$cs_check_lib_flags
+       `echo @$cs_check_lib_cflag@$cs_check_lib_lflag@$cs_check_lib_framework | sed 'y% %#%'`
+       `echo @$cs_check_lib_cflag@$cs_check_lib_lflag@$cs_check_lib_libs | sed 'y% %#%'`"
+               ;;
+           *)  if test -n "$cs_lib_item/include"; then
+  cs_check_lib_cflag="-I$cs_lib_item/include"
+else
+  cs_check_lib_cflag=''
+fi
+
+    if test -n "$cs_lib_item/lib"; then
+  cs_check_lib_lflag="-L$cs_lib_item/lib"
+else
+  cs_check_lib_lflag=''
+fi
+
+    if test -n "cppunit"; then
+  cs_check_lib_libs="-lcppunit"
+       cs_check_lib_framework="-framework cppunit"
+else
+  cs_check_lib_libs=''
+       cs_check_lib_framework=''
+fi
+
+    cs_check_lib_flags="$cs_check_lib_flags
+       `echo @$cs_check_lib_cflag@$cs_check_lib_lflag@$cs_check_lib_framework | sed 'y% %#%'`
+       `echo @$cs_check_lib_cflag@$cs_check_lib_lflag@$cs_check_lib_libs | sed 'y% %#%'`"
+               if test -n "$cs_lib_item"; then
+  cs_check_lib_cflag="-I$cs_lib_item"
+else
+  cs_check_lib_cflag=''
+fi
+
+    if test -n "$cs_lib_item"; then
+  cs_check_lib_lflag="-L$cs_lib_item"
+else
+  cs_check_lib_lflag=''
+fi
+
+    if test -n "cppunit"; then
+  cs_check_lib_libs="-lcppunit"
+       cs_check_lib_framework="-framework cppunit"
+else
+  cs_check_lib_libs=''
+       cs_check_lib_framework=''
+fi
+
+    cs_check_lib_flags="$cs_check_lib_flags
+       `echo @$cs_check_lib_cflag@$cs_check_lib_lflag@$cs_check_lib_framework | sed 'y% %#%'`
+       `echo @$cs_check_lib_cflag@$cs_check_lib_lflag@$cs_check_lib_libs | sed 'y% %#%'`"
+               ;;
+       esac
+    done
+           for cs_lib_item in $cs_check_lib_paths
+    do
+       case $cs_lib_item in
+           *\|*)
+    set filler `echo "$cs_lib_item" | awk 'BEGIN { FS="|" }
+       { for (i=1; i <= NF; ++i)
+           { if ($i == "") print "filler"; else print $i } }'`
+    shift
+    if test $# -eq 0; then
+  cs_check_incdir=''
+else
+  if test "$1" = filler; then
+  cs_check_incdir=''
+else
+  cs_check_incdir=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_check_libdir=''
+else
+  if test "$1" = filler; then
+  cs_check_libdir=''
+else
+  cs_check_libdir=$1
+fi
+
+       shift
+fi
+
+               if test -n "$cs_check_incdir"; then
+  cs_check_lib_cflag="-I$cs_check_incdir"
+else
+  cs_check_lib_cflag=''
+fi
+
+    if test -n "$cs_check_libdir"; then
+  cs_check_lib_lflag="-L$cs_check_libdir"
+else
+  cs_check_lib_lflag=''
+fi
+
+    if test -n ""; then
+  cs_check_lib_libs="-l"
+       cs_check_lib_framework="-framework "
+else
+  cs_check_lib_libs=''
+       cs_check_lib_framework=''
+fi
+
+    cs_check_lib_flags="$cs_check_lib_flags
+       `echo @$cs_check_lib_cflag@$cs_check_lib_lflag@$cs_check_lib_framework | sed 'y% %#%'`
+       `echo @$cs_check_lib_cflag@$cs_check_lib_lflag@$cs_check_lib_libs | sed 'y% %#%'`"
+               ;;
+           *)  if test -n "$cs_lib_item/include"; then
+  cs_check_lib_cflag="-I$cs_lib_item/include"
+else
+  cs_check_lib_cflag=''
+fi
+
+    if test -n "$cs_lib_item/lib"; then
+  cs_check_lib_lflag="-L$cs_lib_item/lib"
+else
+  cs_check_lib_lflag=''
+fi
+
+    if test -n ""; then
+  cs_check_lib_libs="-l"
+       cs_check_lib_framework="-framework "
+else
+  cs_check_lib_libs=''
+       cs_check_lib_framework=''
+fi
+
+    cs_check_lib_flags="$cs_check_lib_flags
+       `echo @$cs_check_lib_cflag@$cs_check_lib_lflag@$cs_check_lib_framework | sed 'y% %#%'`
+       `echo @$cs_check_lib_cflag@$cs_check_lib_lflag@$cs_check_lib_libs | sed 'y% %#%'`"
+               if test -n "$cs_lib_item"; then
+  cs_check_lib_cflag="-I$cs_lib_item"
+else
+  cs_check_lib_cflag=''
+fi
+
+    if test -n "$cs_lib_item"; then
+  cs_check_lib_lflag="-L$cs_lib_item"
+else
+  cs_check_lib_lflag=''
+fi
+
+    if test -n ""; then
+  cs_check_lib_libs="-l"
+       cs_check_lib_framework="-framework "
+else
+  cs_check_lib_libs=''
+       cs_check_lib_framework=''
+fi
+
+    cs_check_lib_flags="$cs_check_lib_flags
+       `echo @$cs_check_lib_cflag@$cs_check_lib_lflag@$cs_check_lib_framework | sed 'y% %#%'`
+       `echo @$cs_check_lib_cflag@$cs_check_lib_lflag@$cs_check_lib_libs | sed 'y% %#%'`"
+               ;;
+       esac
+    done
+
+
+       if test "$cs_ignore_cache" != yes; then
+  { echo "$as_me:$LINENO: checking for libcppunit" >&5
+echo $ECHO_N "checking for libcppunit... $ECHO_C" >&6; }
+if test "${cs_cv_libcppunit+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+    cs_cflags_save="$CXXFLAGS"
+    cs_lflags_save="$LDFLAGS"
+    cs_libs_save="$LIBS"
+    cs_build_ok=no
+
+
+    for cs_build_item in $cs_check_lib_flags
+    do
+
+    set filler `echo "$cs_build_item" | awk 'BEGIN { FS="@" }
+       { for (i=1; i <= NF; ++i)
+           { if ($i == "") print "filler"; else print $i } }'`
+    shift
+    if test $# -eq 0; then
+  cs_dummy=''
+else
+  if test "$1" = filler; then
+  cs_dummy=''
+else
+  cs_dummy=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_cflags_test=''
+else
+  if test "$1" = filler; then
+  cs_cflags_test=''
+else
+  cs_cflags_test=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_lflags_test=''
+else
+  if test "$1" = filler; then
+  cs_lflags_test=''
+else
+  cs_lflags_test=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_libs_test=''
+else
+  if test "$1" = filler; then
+  cs_libs_test=''
+else
+  cs_libs_test=$1
+fi
+
+       shift
+fi
+
+    cs_cflags_test=`echo $cs_cflags_test | sed 'y%#% %'`
+    cs_lflags_test=`echo $cs_lflags_test | sed 'y%#% %'`
+    cs_libs_test=`echo $cs_libs_test | sed 'y%#% %'`
+
+       CXXFLAGS="$cs_cflags_test  $cs_cflags_save"
+       LDFLAGS="$cs_lflags_test  $cs_lflags_save"
+       LIBS="$cs_libs_test  $cs_libs_save"
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <cppunit/ui/text/TestRunner.h>
+int
+main ()
+{
+CppUnit::TextUi::TestRunner r; r.run();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cs_build_ok=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+       if test $cs_build_ok = yes; then
+  break
+fi
+
+    done
+
+
+    CXXFLAGS=$cs_cflags_save
+    LDFLAGS=$cs_lflags_save
+    LIBS=$cs_libs_save
+    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 $cs_build_ok = yes; then
+  cs_build_cflags=`echo x$cs_cflags_test  | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_build_lflags=`echo x$cs_lflags_test  | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_build_libs=`echo x$cs_libs_test  | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_cv_libcppunit=yes
+               cs_cv_libcppunit_cflags=$cs_build_cflags
+               cs_cv_libcppunit_lflags=$cs_build_lflags
+               cs_cv_libcppunit_libs=$cs_build_libs
+else
+  cs_cv_libcppunit=no
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $cs_cv_libcppunit" >&5
+echo "${ECHO_T}$cs_cv_libcppunit" >&6; }
+else
+  { echo "$as_me:$LINENO: checking for libcppunit" >&5
+echo $ECHO_N "checking for libcppunit... $ECHO_C" >&6; }
+           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
+
+    cs_cflags_save="$CXXFLAGS"
+    cs_lflags_save="$LDFLAGS"
+    cs_libs_save="$LIBS"
+    cs_build_ok=no
+
+
+    for cs_build_item in $cs_check_lib_flags
+    do
+
+    set filler `echo "$cs_build_item" | awk 'BEGIN { FS="@" }
+       { for (i=1; i <= NF; ++i)
+           { if ($i == "") print "filler"; else print $i } }'`
+    shift
+    if test $# -eq 0; then
+  cs_dummy=''
+else
+  if test "$1" = filler; then
+  cs_dummy=''
+else
+  cs_dummy=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_cflags_test=''
+else
+  if test "$1" = filler; then
+  cs_cflags_test=''
+else
+  cs_cflags_test=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_lflags_test=''
+else
+  if test "$1" = filler; then
+  cs_lflags_test=''
+else
+  cs_lflags_test=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_libs_test=''
+else
+  if test "$1" = filler; then
+  cs_libs_test=''
+else
+  cs_libs_test=$1
+fi
+
+       shift
+fi
+
+    cs_cflags_test=`echo $cs_cflags_test | sed 'y%#% %'`
+    cs_lflags_test=`echo $cs_lflags_test | sed 'y%#% %'`
+    cs_libs_test=`echo $cs_libs_test | sed 'y%#% %'`
+
+       CXXFLAGS="$cs_cflags_test  $cs_cflags_save"
+       LDFLAGS="$cs_lflags_test  $cs_lflags_save"
+       LIBS="$cs_libs_test  $cs_libs_save"
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <cppunit/ui/text/TestRunner.h>
+int
+main ()
+{
+CppUnit::TextUi::TestRunner r; r.run();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cs_build_ok=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+       if test $cs_build_ok = yes; then
+  break
+fi
+
+    done
+
+
+    CXXFLAGS=$cs_cflags_save
+    LDFLAGS=$cs_lflags_save
+    LIBS=$cs_libs_save
+    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 $cs_build_ok = yes; then
+  cs_build_cflags=`echo x$cs_cflags_test  | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_build_lflags=`echo x$cs_lflags_test  | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_build_libs=`echo x$cs_libs_test  | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_cv_libcppunit=yes
+               cs_cv_libcppunit_cflags=$cs_build_cflags
+               cs_cv_libcppunit_lflags=$cs_build_lflags
+               cs_cv_libcppunit_libs=$cs_build_libs
+else
+  cs_cv_libcppunit=no
+fi
+
+           { echo "$as_me:$LINENO: result: $cs_cv_libcppunit" >&5
+echo "${ECHO_T}$cs_cv_libcppunit" >&6; }
+fi
+
+    if test $cs_cv_libcppunit = yes; then
+  :
+else
+  cs_cv_libcppunit_cflags=''
+       cs_cv_libcppunit_lflags=''
+       cs_cv_libcppunit_libs=''
+
+fi
+
+else
+  cs_cv_libcppunit=no
+fi
+
+
+    cs_cv_with_cppunit="$with_cppunit"
+
+
+    if test $cs_cv_libcppunit = yes; then
+  if test "" != yes; then
+  { echo "$as_me:$LINENO: checking if cppunit is sufficiently recent" >&5
+echo $ECHO_N "checking if cppunit is sufficiently recent... $ECHO_C" >&6; }
+if test "${cs_cv_libcppunit_recent+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+    cs_cflags_save="$CXXFLAGS"
+    cs_lflags_save="$LDFLAGS"
+    cs_libs_save="$LIBS"
+    cs_build_ok=no
+
+
+    for cs_build_item in `echo @@@ | sed 'y% %#%'`
+    do
+
+    set filler `echo "$cs_build_item" | awk 'BEGIN { FS="@" }
+       { for (i=1; i <= NF; ++i)
+           { if ($i == "") print "filler"; else print $i } }'`
+    shift
+    if test $# -eq 0; then
+  cs_dummy=''
+else
+  if test "$1" = filler; then
+  cs_dummy=''
+else
+  cs_dummy=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_cflags_test=''
+else
+  if test "$1" = filler; then
+  cs_cflags_test=''
+else
+  cs_cflags_test=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_lflags_test=''
+else
+  if test "$1" = filler; then
+  cs_lflags_test=''
+else
+  cs_lflags_test=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_libs_test=''
+else
+  if test "$1" = filler; then
+  cs_libs_test=''
+else
+  cs_libs_test=$1
+fi
+
+       shift
+fi
+
+    cs_cflags_test=`echo $cs_cflags_test | sed 'y%#% %'`
+    cs_lflags_test=`echo $cs_lflags_test | sed 'y%#% %'`
+    cs_libs_test=`echo $cs_libs_test | sed 'y%#% %'`
+
+       CXXFLAGS="$cs_cflags_test $cs_cv_libcppunit_cflags $cs_cflags_save"
+       LDFLAGS="$cs_lflags_test $cs_cv_libcppunit_lflags $cs_lflags_save"
+       LIBS="$cs_libs_test $cs_cv_libcppunit_libs $cs_libs_save"
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <cppunit/BriefTestProgressListener.h>
+int
+main ()
+{
+CppUnit::BriefTestProgressListener b; b.startTest(0);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cs_build_ok=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+       if test $cs_build_ok = yes; then
+  break
+fi
+
+    done
+
+
+    CXXFLAGS=$cs_cflags_save
+    LDFLAGS=$cs_lflags_save
+    LIBS=$cs_libs_save
+    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 $cs_build_ok = yes; then
+  cs_build_cflags=`echo x$cs_cflags_test $cs_cv_libcppunit_cflags | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_build_lflags=`echo x$cs_lflags_test $cs_cv_libcppunit_lflags | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_build_libs=`echo x$cs_libs_test $cs_cv_libcppunit_libs | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_cv_libcppunit_recent=yes
+               cs_cv_libcppunit_recent_cflags=$cs_build_cflags
+               cs_cv_libcppunit_recent_lflags=$cs_build_lflags
+               cs_cv_libcppunit_recent_libs=$cs_build_libs
+else
+  cs_cv_libcppunit_recent=no
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $cs_cv_libcppunit_recent" >&5
+echo "${ECHO_T}$cs_cv_libcppunit_recent" >&6; }
+else
+  { echo "$as_me:$LINENO: checking if cppunit is sufficiently recent" >&5
+echo $ECHO_N "checking if cppunit is sufficiently recent... $ECHO_C" >&6; }
+           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
+
+    cs_cflags_save="$CXXFLAGS"
+    cs_lflags_save="$LDFLAGS"
+    cs_libs_save="$LIBS"
+    cs_build_ok=no
+
+
+    for cs_build_item in `echo @@@ | sed 'y% %#%'`
+    do
+
+    set filler `echo "$cs_build_item" | awk 'BEGIN { FS="@" }
+       { for (i=1; i <= NF; ++i)
+           { if ($i == "") print "filler"; else print $i } }'`
+    shift
+    if test $# -eq 0; then
+  cs_dummy=''
+else
+  if test "$1" = filler; then
+  cs_dummy=''
+else
+  cs_dummy=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_cflags_test=''
+else
+  if test "$1" = filler; then
+  cs_cflags_test=''
+else
+  cs_cflags_test=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_lflags_test=''
+else
+  if test "$1" = filler; then
+  cs_lflags_test=''
+else
+  cs_lflags_test=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_libs_test=''
+else
+  if test "$1" = filler; then
+  cs_libs_test=''
+else
+  cs_libs_test=$1
+fi
+
+       shift
+fi
+
+    cs_cflags_test=`echo $cs_cflags_test | sed 'y%#% %'`
+    cs_lflags_test=`echo $cs_lflags_test | sed 'y%#% %'`
+    cs_libs_test=`echo $cs_libs_test | sed 'y%#% %'`
+
+       CXXFLAGS="$cs_cflags_test $cs_cv_libcppunit_cflags $cs_cflags_save"
+       LDFLAGS="$cs_lflags_test $cs_cv_libcppunit_lflags $cs_lflags_save"
+       LIBS="$cs_libs_test $cs_cv_libcppunit_libs $cs_libs_save"
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <cppunit/BriefTestProgressListener.h>
+int
+main ()
+{
+CppUnit::BriefTestProgressListener b; b.startTest(0);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cs_build_ok=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+       if test $cs_build_ok = yes; then
+  break
+fi
+
+    done
+
+
+    CXXFLAGS=$cs_cflags_save
+    LDFLAGS=$cs_lflags_save
+    LIBS=$cs_libs_save
+    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 $cs_build_ok = yes; then
+  cs_build_cflags=`echo x$cs_cflags_test $cs_cv_libcppunit_cflags | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_build_lflags=`echo x$cs_lflags_test $cs_cv_libcppunit_lflags | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_build_libs=`echo x$cs_libs_test $cs_cv_libcppunit_libs | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_cv_libcppunit_recent=yes
+               cs_cv_libcppunit_recent_cflags=$cs_build_cflags
+               cs_cv_libcppunit_recent_lflags=$cs_build_lflags
+               cs_cv_libcppunit_recent_libs=$cs_build_libs
+else
+  cs_cv_libcppunit_recent=no
+fi
+
+           { echo "$as_me:$LINENO: result: $cs_cv_libcppunit_recent" >&5
+echo "${ECHO_T}$cs_cv_libcppunit_recent" >&6; }
+fi
+
+    if test $cs_cv_libcppunit_recent = yes; then
+  if test "$cs_cv_libcppunit" = yes; then
+  cs_build_prop_val="yes"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}CPPUNIT.AVAILABLE ?= \"$cs_build_prop_val\" ;
+"
+fi
+
+       cs_build_prop_val="$cs_cv_libcppunit_cflags"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}CPPUNIT.CFLAGS ?= \"$cs_build_prop_val\" ;
+"
+fi
+
+       cs_build_prop_val="$cs_cv_libcppunit_lflags $cs_cv_libcppunit_libs"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}CPPUNIT.LFLAGS ?= \"$cs_build_prop_val\" ;
+"
+fi
+
+fi
+
+else
+  cs_cv_libcppunit_recent_cflags=''
+       cs_cv_libcppunit_recent_lflags=''
+       cs_cv_libcppunit_recent_libs=''
+
+fi
+
+fi
+
+
+#----------------------------------------------------------------------------
+# Check for Crystal Space (CS)
+#----------------------------------------------------------------------------
+
+# Check whether --with-cs was given.
+if test "${with_cs+set}" = set; then
+  withval=$with_cs;
+fi
+
+if test -z "$with_cs"; then
+  with_cs=yes
+fi
+
+
+if test $with_cs != no; then
+
+# Check whether --with-cs-prefix was given.
+if test "${with_cs_prefix+set}" = set; then
+  withval=$with_cs_prefix; CRYSTAL="$withval"
+       export CRYSTAL
+fi
+
+
+# Check whether --enable-cstest was given.
+if test "${enable_cstest+set}" = set; then
+  enableval=$enable_cstest;
+else
+  enable_cstest=yes
+fi
+
+
+# Try to find an installed cs-config.
+cs_path=''
+if test -n "$CRYSTAL"; then
+  my_IFS=$IFS; IFS=$PATH_SEPARATOR
+    for cs_dir in $CRYSTAL; do
+       if test -n "$cs_path"; then
+  cs_path="$cs_path$PATH_SEPARATOR"
+fi
+
+       cs_path="$cs_path$cs_dir$PATH_SEPARATOR$cs_dir/bin"
+    done
+    IFS=$my_IFS
+fi
+
+
+if test -n "$cs_path"; then
+  cs_path="$cs_path$PATH_SEPARATOR"
+fi
+
+cs_path="$cs_path$PATH$PATH_SEPARATOR/usr/local/crystalspace/bin"
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}cs-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cs-config; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_CRYSTAL_CONFIG_TOOL+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $CRYSTAL_CONFIG_TOOL in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_CRYSTAL_CONFIG_TOOL="$CRYSTAL_CONFIG_TOOL" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $cs_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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_CRYSTAL_CONFIG_TOOL="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+CRYSTAL_CONFIG_TOOL=$ac_cv_path_CRYSTAL_CONFIG_TOOL
+if test -n "$CRYSTAL_CONFIG_TOOL"; then
+  { echo "$as_me:$LINENO: result: $CRYSTAL_CONFIG_TOOL" >&5
+echo "${ECHO_T}$CRYSTAL_CONFIG_TOOL" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_CRYSTAL_CONFIG_TOOL"; then
+  ac_pt_CRYSTAL_CONFIG_TOOL=$CRYSTAL_CONFIG_TOOL
+  # Extract the first word of "cs-config", so it can be a program name with args.
+set dummy cs-config; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_ac_pt_CRYSTAL_CONFIG_TOOL+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $ac_pt_CRYSTAL_CONFIG_TOOL in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_CRYSTAL_CONFIG_TOOL="$ac_pt_CRYSTAL_CONFIG_TOOL" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $cs_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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_CRYSTAL_CONFIG_TOOL="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_CRYSTAL_CONFIG_TOOL=$ac_cv_path_ac_pt_CRYSTAL_CONFIG_TOOL
+if test -n "$ac_pt_CRYSTAL_CONFIG_TOOL"; then
+  { echo "$as_me:$LINENO: result: $ac_pt_CRYSTAL_CONFIG_TOOL" >&5
+echo "${ECHO_T}$ac_pt_CRYSTAL_CONFIG_TOOL" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_pt_CRYSTAL_CONFIG_TOOL" = x; then
+    CRYSTAL_CONFIG_TOOL=""
+  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
+    CRYSTAL_CONFIG_TOOL=$ac_pt_CRYSTAL_CONFIG_TOOL
+  fi
+else
+  CRYSTAL_CONFIG_TOOL="$ac_cv_path_CRYSTAL_CONFIG_TOOL"
+fi
+
+
+if test -n "$CRYSTAL_CONFIG_TOOL"; then
+  cfg="$CRYSTAL_CONFIG_TOOL"
+
+    { echo "$as_me:$LINENO: checking if Crystal Space version >= 0.99" >&5
+echo $ECHO_N "checking if Crystal Space version >= 0.99... $ECHO_C" >&6; }
+if test "${cs_cv_prog_Crystal_Space_version_ok_annotated+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cs_prog_Crystal_Space_is_version=
+cs_prog_Crystal_Space_min_version=
+cs_prog_Crystal_Space_is_suffix=
+cs_prog_Crystal_Space_min_suffix=
+cs_prog_Crystal_Space_is_suffix_done=
+cs_prog_Crystal_Space_min_suffix_done=
+
+
+
+
+test -z $cs_prog_Crystal_Space_is_version && cs_prog_Crystal_Space_is_version=`$cfg --version | sed '/[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*/!d;s/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/;q'`
+test -n "$cs_prog_Crystal_Space_is_version" && test -z $cs_prog_Crystal_Space_is_suffix_done  && { cs_prog_Crystal_Space_is_suffix_done=yes ; cs_prog_Crystal_Space_is_suffix= ; }
+
+test -z $cs_prog_Crystal_Space_is_version && cs_prog_Crystal_Space_is_version=`$cfg --version | sed '/[0-9][0-9]*\.[0-9][0-9]*/!d;s/.*\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/;q'`
+test -n "$cs_prog_Crystal_Space_is_version" && test -z $cs_prog_Crystal_Space_is_suffix_done  && { cs_prog_Crystal_Space_is_suffix_done=yes ; cs_prog_Crystal_Space_is_suffix=.0 ; }
+
+
+
+
+
+
+test -z $cs_prog_Crystal_Space_min_version && cs_prog_Crystal_Space_min_version=`echo 0.99 | sed '/[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*/!d;s/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/;q'`
+test -n "$cs_prog_Crystal_Space_min_version" && test -z $cs_prog_Crystal_Space_min_suffix_done  && { cs_prog_Crystal_Space_min_suffix_done=yes ; cs_prog_Crystal_Space_min_suffix= ; }
+
+test -z $cs_prog_Crystal_Space_min_version && cs_prog_Crystal_Space_min_version=`echo 0.99 | sed '/[0-9][0-9]*\.[0-9][0-9]*/!d;s/.*\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/;q'`
+test -n "$cs_prog_Crystal_Space_min_version" && test -z $cs_prog_Crystal_Space_min_suffix_done  && { cs_prog_Crystal_Space_min_suffix_done=yes ; cs_prog_Crystal_Space_min_suffix=.0 ; }
+
+
+cs_prog_Crystal_Space_is_ver_1=`echo ${cs_prog_Crystal_Space_is_version}${cs_prog_Crystal_Space_is_suffix} | sed '/[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*/!d;s/.*\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\1/'`
+cs_prog_Crystal_Space_is_ver_2=`echo ${cs_prog_Crystal_Space_is_version}${cs_prog_Crystal_Space_is_suffix} | sed '/[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*/!d;s/.*\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\2/'`
+cs_prog_Crystal_Space_is_ver_3=`echo ${cs_prog_Crystal_Space_is_version}${cs_prog_Crystal_Space_is_suffix} | sed '/[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*/!d;s/.*\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\3/'`
+
+cs_prog_Crystal_Space_min_ver_1=`echo $cs_prog_Crystal_Space_min_version${cs_prog_Crystal_Space_min_suffix} | sed '/[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*/!d;s/.*\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\1/'`
+cs_prog_Crystal_Space_min_ver_2=`echo $cs_prog_Crystal_Space_min_version${cs_prog_Crystal_Space_min_suffix} | sed '/[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*/!d;s/.*\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\2/'`
+cs_prog_Crystal_Space_min_ver_3=`echo $cs_prog_Crystal_Space_min_version${cs_prog_Crystal_Space_min_suffix} | sed '/[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*/!d;s/.*\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\3/'`
+
+cs_cv_prog_Crystal_Space_version_ok=''
+test -z "$cs_cv_prog_Crystal_Space_version_ok" && { expr "$cs_prog_Crystal_Space_is_ver_1" ">=" "$cs_prog_Crystal_Space_min_ver_1" >/dev/null || cs_cv_prog_Crystal_Space_version_ok=no ; }
+test -z "$cs_cv_prog_Crystal_Space_version_ok" && { expr "$cs_prog_Crystal_Space_min_ver_1" ">=" "$cs_prog_Crystal_Space_is_ver_1" >/dev/null || cs_cv_prog_Crystal_Space_version_ok=yes ; }
+test -z "$cs_cv_prog_Crystal_Space_version_ok" && { expr "$cs_prog_Crystal_Space_is_ver_2" ">=" "$cs_prog_Crystal_Space_min_ver_2" >/dev/null || cs_cv_prog_Crystal_Space_version_ok=no ; }
+test -z "$cs_cv_prog_Crystal_Space_version_ok" && { expr "$cs_prog_Crystal_Space_min_ver_2" ">=" "$cs_prog_Crystal_Space_is_ver_2" >/dev/null || cs_cv_prog_Crystal_Space_version_ok=yes ; }
+test -z "$cs_cv_prog_Crystal_Space_version_ok" && { expr "$cs_prog_Crystal_Space_is_ver_3" ">=" "$cs_prog_Crystal_Space_min_ver_3" >/dev/null || cs_cv_prog_Crystal_Space_version_ok=no ; }
+test -z "$cs_cv_prog_Crystal_Space_version_ok" && { expr "$cs_prog_Crystal_Space_min_ver_3" ">=" "$cs_prog_Crystal_Space_is_ver_3" >/dev/null || cs_cv_prog_Crystal_Space_version_ok=yes ; }
+
+if test -z "$cs_cv_prog_Crystal_Space_version_ok"; then
+  cs_cv_prog_Crystal_Space_version_ok=yes
+fi
+
+cs_cv_prog_Crystal_Space_version_ok_annotated="$cs_cv_prog_Crystal_Space_version_ok"
+if test -n "$cs_prog_Crystal_Space_is_version"; then
+  cs_cv_prog_Crystal_Space_version_ok_annotated="$cs_cv_prog_Crystal_Space_version_ok_annotated (version $cs_prog_Crystal_Space_is_version)"
+fi
+
+
+fi
+{ echo "$as_me:$LINENO: result: $cs_cv_prog_Crystal_Space_version_ok_annotated" >&5
+echo "${ECHO_T}$cs_cv_prog_Crystal_Space_version_ok_annotated" >&6; }
+if test "$cs_cv_prog_Crystal_Space_version_ok" = yes; then
+  cs_sdk=yes
+else
+  cs_sdk=no
+fi
+
+
+    if test $cs_sdk = yes; then
+  cs_liblist="crystalspace"
+       cs_optlibs=`echo x | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       if test -n "$cs_optlibs"; then
+  cs_optlibs=`$cfg --available-libs $cs_optlibs`
+           cs_liblist="$cs_liblist $cs_optlibs"
+fi
+
+       CRYSTAL_VERSION=`$cfg --version $cs_liblist`
+       CRYSTAL_CFLAGS=`{ (echo "$as_me:$LINENO: \$cfg --cxxflags \$cs_liblist") >&5
+  ($cfg --cxxflags $cs_liblist) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } | tr '\\\\' '/' | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       CRYSTAL_LIBS=`{ (echo "$as_me:$LINENO: \$cfg --libs \$cs_liblist") >&5
+  ($cfg --libs $cs_liblist) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } | tr '\\\\' '/' | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       CRYSTAL_INCLUDE_DIR=`{ (echo "$as_me:$LINENO: \$cfg --includedir \$cs_liblist") >&5
+  ($cfg --includedir $cs_liblist) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } | tr '\\\\' '/' | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       CRYSTAL_AVAILABLE_LIBS=`$cfg --available-libs`
+       CRYSTAL_STATICDEPS=`$cfg --static-deps`
+       if test -z "$CRYSTAL_LIBS"; then
+  cs_sdk=no
+fi
+
+fi
+
+else
+  cs_sdk=no
+fi
+
+
+if test "$cs_sdk" = yes && test "$enable_cstest" = yes; then
+  if test "" != yes; then
+  { echo "$as_me:$LINENO: checking if Crystal Space SDK is usable" >&5
+echo $ECHO_N "checking if Crystal Space SDK is usable... $ECHO_C" >&6; }
+if test "${cs_cv_crystal_sdk+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+    cs_cflags_save="$CXXFLAGS"
+    cs_lflags_save="$LDFLAGS"
+    cs_libs_save="$LIBS"
+    cs_build_ok=no
+
+
+    for cs_build_item in `echo @$CRYSTAL_CFLAGS@@$CRYSTAL_LIBS | sed 'y% %#%'`
+    do
+
+    set filler `echo "$cs_build_item" | awk 'BEGIN { FS="@" }
+       { for (i=1; i <= NF; ++i)
+           { if ($i == "") print "filler"; else print $i } }'`
+    shift
+    if test $# -eq 0; then
+  cs_dummy=''
+else
+  if test "$1" = filler; then
+  cs_dummy=''
+else
+  cs_dummy=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_cflags_test=''
+else
+  if test "$1" = filler; then
+  cs_cflags_test=''
+else
+  cs_cflags_test=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_lflags_test=''
+else
+  if test "$1" = filler; then
+  cs_lflags_test=''
+else
+  cs_lflags_test=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_libs_test=''
+else
+  if test "$1" = filler; then
+  cs_libs_test=''
+else
+  cs_libs_test=$1
+fi
+
+       shift
+fi
+
+    cs_cflags_test=`echo $cs_cflags_test | sed 'y%#% %'`
+    cs_lflags_test=`echo $cs_lflags_test | sed 'y%#% %'`
+    cs_libs_test=`echo $cs_libs_test | sed 'y%#% %'`
+
+       CXXFLAGS="$cs_cflags_test  $cs_cflags_save"
+       LDFLAGS="$cs_lflags_test  $cs_lflags_save"
+       LIBS="$cs_libs_test  $cs_libs_save"
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <cssysdef.h>
+           #include <csutil/csstring.h>
+           csStaticVarCleanupFN csStaticVarCleanup;
+int
+main ()
+{
+csString s; s << "Crystal Space";
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cs_build_ok=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+       if test $cs_build_ok = yes; then
+  break
+fi
+
+    done
+
+
+    CXXFLAGS=$cs_cflags_save
+    LDFLAGS=$cs_lflags_save
+    LIBS=$cs_libs_save
+    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 $cs_build_ok = yes; then
+  cs_build_cflags=`echo x$cs_cflags_test  | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_build_lflags=`echo x$cs_lflags_test  | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_build_libs=`echo x$cs_libs_test  | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_cv_crystal_sdk=yes
+               cs_cv_crystal_sdk_cflags=$cs_build_cflags
+               cs_cv_crystal_sdk_lflags=$cs_build_lflags
+               cs_cv_crystal_sdk_libs=$cs_build_libs
+else
+  cs_cv_crystal_sdk=no
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $cs_cv_crystal_sdk" >&5
+echo "${ECHO_T}$cs_cv_crystal_sdk" >&6; }
+else
+  { echo "$as_me:$LINENO: checking if Crystal Space SDK is usable" >&5
+echo $ECHO_N "checking if Crystal Space SDK is usable... $ECHO_C" >&6; }
+           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
+
+    cs_cflags_save="$CXXFLAGS"
+    cs_lflags_save="$LDFLAGS"
+    cs_libs_save="$LIBS"
+    cs_build_ok=no
+
+
+    for cs_build_item in `echo @$CRYSTAL_CFLAGS@@$CRYSTAL_LIBS | sed 'y% %#%'`
+    do
+
+    set filler `echo "$cs_build_item" | awk 'BEGIN { FS="@" }
+       { for (i=1; i <= NF; ++i)
+           { if ($i == "") print "filler"; else print $i } }'`
+    shift
+    if test $# -eq 0; then
+  cs_dummy=''
+else
+  if test "$1" = filler; then
+  cs_dummy=''
+else
+  cs_dummy=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_cflags_test=''
+else
+  if test "$1" = filler; then
+  cs_cflags_test=''
+else
+  cs_cflags_test=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_lflags_test=''
+else
+  if test "$1" = filler; then
+  cs_lflags_test=''
+else
+  cs_lflags_test=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_libs_test=''
+else
+  if test "$1" = filler; then
+  cs_libs_test=''
+else
+  cs_libs_test=$1
+fi
+
+       shift
+fi
+
+    cs_cflags_test=`echo $cs_cflags_test | sed 'y%#% %'`
+    cs_lflags_test=`echo $cs_lflags_test | sed 'y%#% %'`
+    cs_libs_test=`echo $cs_libs_test | sed 'y%#% %'`
+
+       CXXFLAGS="$cs_cflags_test  $cs_cflags_save"
+       LDFLAGS="$cs_lflags_test  $cs_lflags_save"
+       LIBS="$cs_libs_test  $cs_libs_save"
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <cssysdef.h>
+           #include <csutil/csstring.h>
+           csStaticVarCleanupFN csStaticVarCleanup;
+int
+main ()
+{
+csString s; s << "Crystal Space";
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_cxx_werror_flag"                         || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cs_build_ok=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+       if test $cs_build_ok = yes; then
+  break
+fi
+
+    done
+
+
+    CXXFLAGS=$cs_cflags_save
+    LDFLAGS=$cs_lflags_save
+    LIBS=$cs_libs_save
+    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 $cs_build_ok = yes; then
+  cs_build_cflags=`echo x$cs_cflags_test  | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_build_lflags=`echo x$cs_lflags_test  | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_build_libs=`echo x$cs_libs_test  | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_cv_crystal_sdk=yes
+               cs_cv_crystal_sdk_cflags=$cs_build_cflags
+               cs_cv_crystal_sdk_lflags=$cs_build_lflags
+               cs_cv_crystal_sdk_libs=$cs_build_libs
+else
+  cs_cv_crystal_sdk=no
+fi
+
+           { echo "$as_me:$LINENO: result: $cs_cv_crystal_sdk" >&5
+echo "${ECHO_T}$cs_cv_crystal_sdk" >&6; }
+fi
+
+    if test $cs_cv_crystal_sdk = yes; then
+  :
+else
+  cs_cv_crystal_sdk_cflags=''
+       cs_cv_crystal_sdk_lflags=''
+       cs_cv_crystal_sdk_libs=''
+       cs_sdk=no
+fi
+
+fi
+
+
+if test "$cs_sdk" = yes; then
+  CRYSTAL_AVAILABLE=yes
+
+else
+  CRYSTAL_AVAILABLE=no
+   CRYSTAL_CFLAGS=''
+   CRYSTAL_VERSION=''
+   CRYSTAL_LIBS=''
+   CRYSTAL_INCLUDE_DIR=''
+   { { echo "$as_me:$LINENO: error:
+*** Crystal Space could not be found or was unusable. The latest version is
+*** always available from http://www.crystalspace3d.org/
+*** Also, be sure that you have either installed Crystal Space or set the
+*** CRYSTAL environment variable properly.
+" >&5
+echo "$as_me: error:
+*** Crystal Space could not be found or was unusable. The latest version is
+*** always available from http://www.crystalspace3d.org/
+*** Also, be sure that you have either installed Crystal Space or set the
+*** CRYSTAL environment variable properly.
+" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+cs_build_prop_val="$CRYSTAL_AVAILABLE"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}CRYSTAL.AVAILABLE ?= \"$cs_build_prop_val\" ;
+"
+fi
+
+cs_build_prop_val="$CRYSTAL_VERSION"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}CRYSTAL.VERSION ?= \"$cs_build_prop_val\" ;
+"
+fi
+
+cs_build_prop_val="$CRYSTAL_CFLAGS"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}CRYSTAL.CFLAGS ?= \"$cs_build_prop_val\" ;
+"
+fi
+
+cs_build_prop_val="$CRYSTAL_LIBS"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}CRYSTAL.LFLAGS ?= \"$cs_build_prop_val\" ;
+"
+fi
+
+cs_build_prop_val="$CRYSTAL_INCLUDE_DIR"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}CRYSTAL.INCLUDE_DIR ?= \"$cs_build_prop_val\" ;
+"
+fi
+
+cs_build_prop_val="$CRYSTAL_AVAILABLE_LIBS"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}CRYSTAL.AVAILABLE_LIBS ?= \"$cs_build_prop_val\" ;
+"
+fi
+
+cs_build_prop_val="$CRYSTAL_STATICDEPS"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}CRYSTAL.STATICDEPS ?= \"$cs_build_prop_val\" ;
+"
+fi
+
+
+fi
+
+
+#----------------------------------------------------------------------------
+# Check for Crystal Entity Layer (CEL)
+#----------------------------------------------------------------------------
+
+cs_build_prop_val="no"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}CEL.DESIRED ?= \"$cs_build_prop_val\" ;
+"
+fi
+
+
+
+#------------------------------------------------------------------------------
+# Determine if plugin meta-information should be embedded directly into plugin
+# modules or if it should exist in stand-alone .csplugin files.  On Unix,
+# embedding is accomplished via libbfd which carries a GPL license.  If your
+# project is compatible with GPL, then set gpl_compatible to "yes".  This will
+# cause embedding to be enabled on Unix by default. Otherwise, set it to "no",
+# which will cause embedding to be disabled by default on Unix. (In any event,
+# the user can override the default setting with the
+# --enable-meta-info-embedding option.)
+#------------------------------------------------------------------------------
+
+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
+{ 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; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if test "${ac_cv_prog_CPP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> 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 <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_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 <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_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_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+{ echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> 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 <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_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 <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_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 \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&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
+
+
+{ 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_executable_p "$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.*;;
+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_executable_p "$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.*;;
+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 <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_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 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 <string.h>
+
+_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 <stdlib.h>
+
+_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 <ctype.h>
+#include <stdlib.h>
+#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 { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+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
+
+# 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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  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 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 elf.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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_header_compiler=no
+fi
+
+rm -f 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 { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_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_c_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;}
+    ( cat <<\_ASBOX
+## -------------------------------- ##
+## Report this to ryan@tliquest.net ##
+## -------------------------------- ##
+_ASBOX
+     ) | sed "s/^/$as_me: WARNING:     /" >&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
+ cs_header_elf_h=yes
+else
+  cs_header_elf_h=no
+fi
+
+done
+
+    { echo "$as_me:$LINENO: checking whether to embed plugin meta-information" >&5
+echo $ECHO_N "checking whether to embed plugin meta-information... $ECHO_C" >&6; }
+    case $cs_host_target in
+       unix) if test $cs_header_elf_h = yes; then
+  cs_embed_meta_info_default=yes
+else
+  cs_embed_meta_info_default=yes
+fi
+ ;;
+       *) cs_embed_meta_info_default=yes ;;
+    esac
+    # Check whether --enable-meta-info-embedding was given.
+if test "${enable_meta_info_embedding+set}" = set; then
+  enableval=$enable_meta_info_embedding;
+else
+  enable_meta_info_embedding=$cs_embed_meta_info_default
+fi
+
+    { echo "$as_me:$LINENO: result: $enable_meta_info_embedding" >&5
+echo "${ECHO_T}$enable_meta_info_embedding" >&6; }
+    cs_build_prop_val="$enable_meta_info_embedding"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}EMBED_META ?= \"$cs_build_prop_val\" ;
+"
+fi
+
+    if test $enable_meta_info_embedding = yes; then
+
+    if test "$cs_prog_path_prepared" != yes; then
+  cs_prog_path_prepared=yes
+       PATH="$PATH$PATH_SEPARATOR/usr/local/bin$PATH_SEPARATOR/sw/bin"
+       export PATH
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in windres
+  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_WINDRES+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$WINDRES"; then
+  ac_cv_prog_WINDRES="$WINDRES" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_WINDRES="$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
+WINDRES=$ac_cv_prog_WINDRES
+if test -n "$WINDRES"; then
+  { echo "$as_me:$LINENO: result: $WINDRES" >&5
+echo "${ECHO_T}$WINDRES" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+    test -n "$WINDRES" && break
+  done
+fi
+if test -z "$WINDRES"; then
+  ac_ct_WINDRES=$WINDRES
+  for ac_prog in windres
+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_WINDRES+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_WINDRES"; then
+  ac_cv_prog_ac_ct_WINDRES="$ac_ct_WINDRES" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_WINDRES="$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_WINDRES=$ac_cv_prog_ac_ct_WINDRES
+if test -n "$ac_ct_WINDRES"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_WINDRES" >&5
+echo "${ECHO_T}$ac_ct_WINDRES" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$ac_ct_WINDRES" && break
+done
+
+  if test "x$ac_ct_WINDRES" = x; then
+    WINDRES=""
+  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
+    WINDRES=$ac_ct_WINDRES
+  fi
+fi
+
+    cs_build_prop_val="$WINDRES"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}CMD.WINDRES ?= \"$cs_build_prop_val\" ;
+"
+fi
+
+
+
+    if test "$cs_prog_path_prepared" != yes; then
+  cs_prog_path_prepared=yes
+       PATH="$PATH$PATH_SEPARATOR/usr/local/bin$PATH_SEPARATOR/sw/bin"
+       export PATH
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in objcopy
+  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_OBJCOPY+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$OBJCOPY"; then
+  ac_cv_prog_OBJCOPY="$OBJCOPY" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_OBJCOPY="$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
+OBJCOPY=$ac_cv_prog_OBJCOPY
+if test -n "$OBJCOPY"; then
+  { echo "$as_me:$LINENO: result: $OBJCOPY" >&5
+echo "${ECHO_T}$OBJCOPY" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+    test -n "$OBJCOPY" && break
+  done
+fi
+if test -z "$OBJCOPY"; then
+  ac_ct_OBJCOPY=$OBJCOPY
+  for ac_prog in objcopy
+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_OBJCOPY+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_OBJCOPY"; then
+  ac_cv_prog_ac_ct_OBJCOPY="$ac_ct_OBJCOPY" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_OBJCOPY="$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_OBJCOPY=$ac_cv_prog_ac_ct_OBJCOPY
+if test -n "$ac_ct_OBJCOPY"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_OBJCOPY" >&5
+echo "${ECHO_T}$ac_ct_OBJCOPY" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$ac_ct_OBJCOPY" && break
+done
+
+  if test "x$ac_ct_OBJCOPY" = x; then
+    OBJCOPY=""
+  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
+    OBJCOPY=$ac_ct_OBJCOPY
+  fi
+fi
+
+    if test -n "$OBJCOPY"; then
+  cs_build_prop_val="yes"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}OBJCOPY.AVAILABLE ?= \"$cs_build_prop_val\" ;
+"
+fi
+
+        cs_build_prop_val="$OBJCOPY"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}CMD.OBJCOPY ?= \"$cs_build_prop_val\" ;
+"
+fi
+
+fi
+
+        if test $cs_header_elf_h = yes; then
+  cs_build_prop_val="yes"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}ELF.AVAILABLE ?= \"$cs_build_prop_val\" ;
+"
+fi
+
+else
+  case $host_os in
+               mingw*|cygwin*) ;;
+               *)
+
+# Check whether --with-bfd was given.
+if test "${with_bfd+set}" = set; then
+  withval=$with_bfd;
+fi
+
+
+    # Backward compatibility: Recognize --with-libbfd as alias for --with-bfd.
+    if test -n "$with_libbfd" && test -z "$with_bfd"; then
+  with_bfd="$with_libbfd"
+fi
+
+
+    if test -z "$with_bfd"; then
+  with_bfd=yes
+fi
+
+    if test "$with_bfd" != no; then
+  # If --with-bfd value is same as cached value, then assume other
+        # cached values are also valid; otherwise, ignore all cached values.
+       if test "$with_bfd" != "$cs_cv_with_bfd"; then
+  cs_ignore_cache=yes
+else
+  cs_ignore_cache=no
+fi
+
+
+       cs_check_lib_flags=''
+       if test $with_bfd = yes; then
+  if test "$cs_prog_pkg_config_checked" != yes; then
+
+    if test "$cs_prog_path_prepared" != yes; then
+  cs_prog_path_prepared=yes
+       PATH="$PATH$PATH_SEPARATOR/usr/local/bin$PATH_SEPARATOR/sw/bin"
+       export PATH
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in pkg-config
+  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_PKG_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$PKG_CONFIG"; then
+  ac_cv_prog_PKG_CONFIG="$PKG_CONFIG" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_PKG_CONFIG="$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
+PKG_CONFIG=$ac_cv_prog_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+echo "${ECHO_T}$PKG_CONFIG" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+    test -n "$PKG_CONFIG" && break
+  done
+fi
+if test -z "$PKG_CONFIG"; then
+  ac_ct_PKG_CONFIG=$PKG_CONFIG
+  for ac_prog in pkg-config
+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_PKG_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_PKG_CONFIG"; then
+  ac_cv_prog_ac_ct_PKG_CONFIG="$ac_ct_PKG_CONFIG" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_PKG_CONFIG="$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_PKG_CONFIG=$ac_cv_prog_ac_ct_PKG_CONFIG
+if test -n "$ac_ct_PKG_CONFIG"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_PKG_CONFIG" >&5
+echo "${ECHO_T}$ac_ct_PKG_CONFIG" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$ac_ct_PKG_CONFIG" && break
+done
+
+  if test "x$ac_ct_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  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
+    PKG_CONFIG=$ac_ct_PKG_CONFIG
+  fi
+fi
+
+       PKG_CONFIG_PATH="/usr/local/lib/pkgconfig$PATH_SEPARATOR/sw/lib/pkgconfig$PATH_SEPARATOR/opt/local/lib/pkgconfig$PATH_SEPARATOR/opt/lib/pkgconfig$PATH_SEPARATOR$PKG_CONFIG_PATH"
+    export PKG_CONFIG_PATH
+       cs_prog_pkg_config_checked=yes
+fi
+
+    if test -z "$cs_cv_prog_pkg_config_ok"; then
+  if test -n "$PKG_CONFIG"; then
+  if $PKG_CONFIG --atleast-pkgconfig-version=0.9.0; then
+  cs_cv_prog_pkg_config_ok=yes
+else
+  cs_cv_prog_pkg_config_ok=no
+fi
+
+else
+  cs_cv_prog_pkg_config_ok=no
+fi
+
+fi
+
+    if test $cs_cv_prog_pkg_config_ok = yes; then
+  { echo "$as_me:$LINENO: checking if $PKG_CONFIG recognizes bfd" >&5
+echo $ECHO_N "checking if $PKG_CONFIG recognizes bfd... $ECHO_C" >&6; }
+if test "${cs_cv_prog_pkg_config_bfd+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if $PKG_CONFIG --exists bfd; then
+  cs_cv_prog_pkg_config_bfd=yes
+else
+  cs_cv_prog_pkg_config_bfd=no
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $cs_cv_prog_pkg_config_bfd" >&5
+echo "${ECHO_T}$cs_cv_prog_pkg_config_bfd" >&6; }
+       if test $cs_cv_prog_pkg_config_bfd = yes; then
+  if test -z "$cs_cv_prog_pkg_config_bfd_flags"; then
+  cs_check_lib_cflag=`{ (echo "$as_me:$LINENO: \$PKG_CONFIG --cflags bfd") >&5
+  ($PKG_CONFIG --cflags bfd) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } | tr '\\\\' '/' | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_check_lib_lflag=''
+       cs_check_lib_libs=`{ (echo "$as_me:$LINENO: \$PKG_CONFIG --libs bfd") >&5
+  ($PKG_CONFIG --libs bfd) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } | tr '\\\\' '/' | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_cv_prog_pkg_config_bfd_flags=`echo @$cs_check_lib_cflag@$cs_check_lib_lflag@$cs_check_lib_libs | sed 'y% %#%'`
+fi
+
+    cs_check_lib_flags="$cs_check_lib_flags $cs_cv_prog_pkg_config_bfd_flags"
+fi
+
+fi
+
+
+    if test "$cs_prog_path_prepared" != yes; then
+  cs_prog_path_prepared=yes
+       PATH="$PATH$PATH_SEPARATOR/usr/local/bin$PATH_SEPARATOR/sw/bin"
+       export PATH
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in bfd-config
+  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_CONFIG_BFD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CONFIG_BFD"; then
+  ac_cv_prog_CONFIG_BFD="$CONFIG_BFD" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CONFIG_BFD="$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
+CONFIG_BFD=$ac_cv_prog_CONFIG_BFD
+if test -n "$CONFIG_BFD"; then
+  { echo "$as_me:$LINENO: result: $CONFIG_BFD" >&5
+echo "${ECHO_T}$CONFIG_BFD" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+    test -n "$CONFIG_BFD" && break
+  done
+fi
+if test -z "$CONFIG_BFD"; then
+  ac_ct_CONFIG_BFD=$CONFIG_BFD
+  for ac_prog in bfd-config
+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_CONFIG_BFD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CONFIG_BFD"; then
+  ac_cv_prog_ac_ct_CONFIG_BFD="$ac_ct_CONFIG_BFD" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CONFIG_BFD="$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_CONFIG_BFD=$ac_cv_prog_ac_ct_CONFIG_BFD
+if test -n "$ac_ct_CONFIG_BFD"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_CONFIG_BFD" >&5
+echo "${ECHO_T}$ac_ct_CONFIG_BFD" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CONFIG_BFD" && break
+done
+
+  if test "x$ac_ct_CONFIG_BFD" = x; then
+    CONFIG_BFD=""
+  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
+    CONFIG_BFD=$ac_ct_CONFIG_BFD
+  fi
+fi
+
+    if test -n "$CONFIG_BFD"; then
+  if test -z "$cs_cv_prog_config_bfd_ok"; then
+  if $CONFIG_BFD --cflags --libs >/dev/null 2>&1; then
+  cs_cv_prog_config_bfd_ok=yes
+else
+  cs_cv_prog_config_bfd_ok=no
+fi
+
+fi
+
+       if test $cs_cv_prog_config_bfd_ok = yes; then
+  if test -z "$cs_cv_prog_config_bfd_flags"; then
+  cs_check_lib_cflag=`{ (echo "$as_me:$LINENO: \$CONFIG_BFD --cflags ") >&5
+  ($CONFIG_BFD --cflags ) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } | tr '\\\\' '/' | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_check_lib_lflag=''
+       cs_check_lib_libs=`{ (echo "$as_me:$LINENO: \$CONFIG_BFD --libs ") >&5
+  ($CONFIG_BFD --libs ) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } | tr '\\\\' '/' | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_cv_prog_config_bfd_flags=`echo @$cs_check_lib_cflag@$cs_check_lib_lflag@$cs_check_lib_libs | sed 'y% %#%'`
+fi
+
+    cs_check_lib_flags="$cs_check_lib_flags $cs_cv_prog_config_bfd_flags"
+fi
+
+fi
+
+               if test "$cs_prog_pkg_config_checked" != yes; then
+
+    if test "$cs_prog_path_prepared" != yes; then
+  cs_prog_path_prepared=yes
+       PATH="$PATH$PATH_SEPARATOR/usr/local/bin$PATH_SEPARATOR/sw/bin"
+       export PATH
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in pkg-config
+  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_PKG_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$PKG_CONFIG"; then
+  ac_cv_prog_PKG_CONFIG="$PKG_CONFIG" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_PKG_CONFIG="$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
+PKG_CONFIG=$ac_cv_prog_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+echo "${ECHO_T}$PKG_CONFIG" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+    test -n "$PKG_CONFIG" && break
+  done
+fi
+if test -z "$PKG_CONFIG"; then
+  ac_ct_PKG_CONFIG=$PKG_CONFIG
+  for ac_prog in pkg-config
+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_PKG_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_PKG_CONFIG"; then
+  ac_cv_prog_ac_ct_PKG_CONFIG="$ac_ct_PKG_CONFIG" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_PKG_CONFIG="$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_PKG_CONFIG=$ac_cv_prog_ac_ct_PKG_CONFIG
+if test -n "$ac_ct_PKG_CONFIG"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_PKG_CONFIG" >&5
+echo "${ECHO_T}$ac_ct_PKG_CONFIG" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$ac_ct_PKG_CONFIG" && break
+done
+
+  if test "x$ac_ct_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  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
+    PKG_CONFIG=$ac_ct_PKG_CONFIG
+  fi
+fi
+
+       PKG_CONFIG_PATH="/usr/local/lib/pkgconfig$PATH_SEPARATOR/sw/lib/pkgconfig$PATH_SEPARATOR/opt/local/lib/pkgconfig$PATH_SEPARATOR/opt/lib/pkgconfig$PATH_SEPARATOR$PKG_CONFIG_PATH"
+    export PKG_CONFIG_PATH
+       cs_prog_pkg_config_checked=yes
+fi
+
+    if test -z "$cs_cv_prog_pkg_config_ok"; then
+  if test -n "$PKG_CONFIG"; then
+  if $PKG_CONFIG --atleast-pkgconfig-version=0.9.0; then
+  cs_cv_prog_pkg_config_ok=yes
+else
+  cs_cv_prog_pkg_config_ok=no
+fi
+
+else
+  cs_cv_prog_pkg_config_ok=no
+fi
+
+fi
+
+    if test $cs_cv_prog_pkg_config_ok = yes; then
+  { echo "$as_me:$LINENO: checking if $PKG_CONFIG recognizes " >&5
+echo $ECHO_N "checking if $PKG_CONFIG recognizes ... $ECHO_C" >&6; }
+if test "${cs_cv_prog_pkg_config_+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if $PKG_CONFIG --exists ; then
+  cs_cv_prog_pkg_config_=yes
+else
+  cs_cv_prog_pkg_config_=no
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $cs_cv_prog_pkg_config_" >&5
+echo "${ECHO_T}$cs_cv_prog_pkg_config_" >&6; }
+       if test $cs_cv_prog_pkg_config_ = yes; then
+  if test -z "$cs_cv_prog_pkg_config__flags"; then
+  cs_check_lib_cflag=`{ (echo "$as_me:$LINENO: \$PKG_CONFIG --cflags ") >&5
+  ($PKG_CONFIG --cflags ) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } | tr '\\\\' '/' | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_check_lib_lflag=''
+       cs_check_lib_libs=`{ (echo "$as_me:$LINENO: \$PKG_CONFIG --libs ") >&5
+  ($PKG_CONFIG --libs ) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } | tr '\\\\' '/' | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_cv_prog_pkg_config__flags=`echo @$cs_check_lib_cflag@$cs_check_lib_lflag@$cs_check_lib_libs | sed 'y% %#%'`
+fi
+
+    cs_check_lib_flags="$cs_check_lib_flags $cs_cv_prog_pkg_config__flags"
+fi
+
+fi
+
+
+    if test "$cs_prog_path_prepared" != yes; then
+  cs_prog_path_prepared=yes
+       PATH="$PATH$PATH_SEPARATOR/usr/local/bin$PATH_SEPARATOR/sw/bin"
+       export PATH
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in -config
+  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_CONFIG_+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CONFIG_"; then
+  ac_cv_prog_CONFIG_="$CONFIG_" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CONFIG_="$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
+CONFIG_=$ac_cv_prog_CONFIG_
+if test -n "$CONFIG_"; then
+  { echo "$as_me:$LINENO: result: $CONFIG_" >&5
+echo "${ECHO_T}$CONFIG_" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+    test -n "$CONFIG_" && break
+  done
+fi
+if test -z "$CONFIG_"; then
+  ac_ct_CONFIG_=$CONFIG_
+  for ac_prog in -config
+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_CONFIG_+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CONFIG_"; then
+  ac_cv_prog_ac_ct_CONFIG_="$ac_ct_CONFIG_" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CONFIG_="$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_CONFIG_=$ac_cv_prog_ac_ct_CONFIG_
+if test -n "$ac_ct_CONFIG_"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_CONFIG_" >&5
+echo "${ECHO_T}$ac_ct_CONFIG_" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CONFIG_" && break
+done
+
+  if test "x$ac_ct_CONFIG_" = x; then
+    CONFIG_=""
+  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
+    CONFIG_=$ac_ct_CONFIG_
+  fi
+fi
+
+    if test -n "$CONFIG_"; then
+  if test -z "$cs_cv_prog_config__ok"; then
+  if $CONFIG_ --cflags --libs >/dev/null 2>&1; then
+  cs_cv_prog_config__ok=yes
+else
+  cs_cv_prog_config__ok=no
+fi
+
+fi
+
+       if test $cs_cv_prog_config__ok = yes; then
+  if test -z "$cs_cv_prog_config__flags"; then
+  cs_check_lib_cflag=`{ (echo "$as_me:$LINENO: \$CONFIG_ --cflags ") >&5
+  ($CONFIG_ --cflags ) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } | tr '\\\\' '/' | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_check_lib_lflag=''
+       cs_check_lib_libs=`{ (echo "$as_me:$LINENO: \$CONFIG_ --libs ") >&5
+  ($CONFIG_ --libs ) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } | tr '\\\\' '/' | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_cv_prog_config__flags=`echo @$cs_check_lib_cflag@$cs_check_lib_lflag@$cs_check_lib_libs | sed 'y% %#%'`
+fi
+
+    cs_check_lib_flags="$cs_check_lib_flags $cs_cv_prog_config__flags"
+fi
+
+fi
+
+
+fi
+
+
+       if test $with_bfd != yes; then
+  cs_check_lib_paths=$with_bfd
+else
+  cs_check_lib_paths="| /usr/local/include|/usr/local/lib \
+    /sw/include|/sw/lib \
+    /opt/local/include|/opt/local/lib \
+    /opt/include|/opt/lib "
+fi
+
+       for cs_lib_item in $cs_check_lib_paths
+    do
+       case $cs_lib_item in
+           *\|*)
+    set filler `echo "$cs_lib_item" | awk 'BEGIN { FS="|" }
+       { for (i=1; i <= NF; ++i)
+           { if ($i == "") print "filler"; else print $i } }'`
+    shift
+    if test $# -eq 0; then
+  cs_check_incdir=''
+else
+  if test "$1" = filler; then
+  cs_check_incdir=''
+else
+  cs_check_incdir=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_check_libdir=''
+else
+  if test "$1" = filler; then
+  cs_check_libdir=''
+else
+  cs_check_libdir=$1
+fi
+
+       shift
+fi
+
+               if test -n "$cs_check_incdir"; then
+  cs_check_lib_cflag="-I$cs_check_incdir"
+else
+  cs_check_lib_cflag=''
+fi
+
+    if test -n "$cs_check_libdir"; then
+  cs_check_lib_lflag="-L$cs_check_libdir"
+else
+  cs_check_lib_lflag=''
+fi
+
+    if test -n "bfd"; then
+  cs_check_lib_libs="-lbfd"
+       cs_check_lib_framework="-framework bfd"
+else
+  cs_check_lib_libs=''
+       cs_check_lib_framework=''
+fi
+
+    cs_check_lib_flags="$cs_check_lib_flags
+       `echo @$cs_check_lib_cflag@$cs_check_lib_lflag@$cs_check_lib_framework | sed 'y% %#%'`
+       `echo @$cs_check_lib_cflag@$cs_check_lib_lflag@$cs_check_lib_libs | sed 'y% %#%'`"
+               ;;
+           *)  if test -n "$cs_lib_item/include"; then
+  cs_check_lib_cflag="-I$cs_lib_item/include"
+else
+  cs_check_lib_cflag=''
+fi
+
+    if test -n "$cs_lib_item/lib"; then
+  cs_check_lib_lflag="-L$cs_lib_item/lib"
+else
+  cs_check_lib_lflag=''
+fi
+
+    if test -n "bfd"; then
+  cs_check_lib_libs="-lbfd"
+       cs_check_lib_framework="-framework bfd"
+else
+  cs_check_lib_libs=''
+       cs_check_lib_framework=''
+fi
+
+    cs_check_lib_flags="$cs_check_lib_flags
+       `echo @$cs_check_lib_cflag@$cs_check_lib_lflag@$cs_check_lib_framework | sed 'y% %#%'`
+       `echo @$cs_check_lib_cflag@$cs_check_lib_lflag@$cs_check_lib_libs | sed 'y% %#%'`"
+               if test -n "$cs_lib_item"; then
+  cs_check_lib_cflag="-I$cs_lib_item"
+else
+  cs_check_lib_cflag=''
+fi
+
+    if test -n "$cs_lib_item"; then
+  cs_check_lib_lflag="-L$cs_lib_item"
+else
+  cs_check_lib_lflag=''
+fi
+
+    if test -n "bfd"; then
+  cs_check_lib_libs="-lbfd"
+       cs_check_lib_framework="-framework bfd"
+else
+  cs_check_lib_libs=''
+       cs_check_lib_framework=''
+fi
+
+    cs_check_lib_flags="$cs_check_lib_flags
+       `echo @$cs_check_lib_cflag@$cs_check_lib_lflag@$cs_check_lib_framework | sed 'y% %#%'`
+       `echo @$cs_check_lib_cflag@$cs_check_lib_lflag@$cs_check_lib_libs | sed 'y% %#%'`"
+               ;;
+       esac
+    done
+           for cs_lib_item in $cs_check_lib_paths
+    do
+       case $cs_lib_item in
+           *\|*)
+    set filler `echo "$cs_lib_item" | awk 'BEGIN { FS="|" }
+       { for (i=1; i <= NF; ++i)
+           { if ($i == "") print "filler"; else print $i } }'`
+    shift
+    if test $# -eq 0; then
+  cs_check_incdir=''
+else
+  if test "$1" = filler; then
+  cs_check_incdir=''
+else
+  cs_check_incdir=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_check_libdir=''
+else
+  if test "$1" = filler; then
+  cs_check_libdir=''
+else
+  cs_check_libdir=$1
+fi
+
+       shift
+fi
+
+               if test -n "$cs_check_incdir"; then
+  cs_check_lib_cflag="-I$cs_check_incdir"
+else
+  cs_check_lib_cflag=''
+fi
+
+    if test -n "$cs_check_libdir"; then
+  cs_check_lib_lflag="-L$cs_check_libdir"
+else
+  cs_check_lib_lflag=''
+fi
+
+    if test -n ""; then
+  cs_check_lib_libs="-l"
+       cs_check_lib_framework="-framework "
+else
+  cs_check_lib_libs=''
+       cs_check_lib_framework=''
+fi
+
+    cs_check_lib_flags="$cs_check_lib_flags
+       `echo @$cs_check_lib_cflag@$cs_check_lib_lflag@$cs_check_lib_framework | sed 'y% %#%'`
+       `echo @$cs_check_lib_cflag@$cs_check_lib_lflag@$cs_check_lib_libs | sed 'y% %#%'`"
+               ;;
+           *)  if test -n "$cs_lib_item/include"; then
+  cs_check_lib_cflag="-I$cs_lib_item/include"
+else
+  cs_check_lib_cflag=''
+fi
+
+    if test -n "$cs_lib_item/lib"; then
+  cs_check_lib_lflag="-L$cs_lib_item/lib"
+else
+  cs_check_lib_lflag=''
+fi
+
+    if test -n ""; then
+  cs_check_lib_libs="-l"
+       cs_check_lib_framework="-framework "
+else
+  cs_check_lib_libs=''
+       cs_check_lib_framework=''
+fi
+
+    cs_check_lib_flags="$cs_check_lib_flags
+       `echo @$cs_check_lib_cflag@$cs_check_lib_lflag@$cs_check_lib_framework | sed 'y% %#%'`
+       `echo @$cs_check_lib_cflag@$cs_check_lib_lflag@$cs_check_lib_libs | sed 'y% %#%'`"
+               if test -n "$cs_lib_item"; then
+  cs_check_lib_cflag="-I$cs_lib_item"
+else
+  cs_check_lib_cflag=''
+fi
+
+    if test -n "$cs_lib_item"; then
+  cs_check_lib_lflag="-L$cs_lib_item"
+else
+  cs_check_lib_lflag=''
+fi
+
+    if test -n ""; then
+  cs_check_lib_libs="-l"
+       cs_check_lib_framework="-framework "
+else
+  cs_check_lib_libs=''
+       cs_check_lib_framework=''
+fi
+
+    cs_check_lib_flags="$cs_check_lib_flags
+       `echo @$cs_check_lib_cflag@$cs_check_lib_lflag@$cs_check_lib_framework | sed 'y% %#%'`
+       `echo @$cs_check_lib_cflag@$cs_check_lib_lflag@$cs_check_lib_libs | sed 'y% %#%'`"
+               ;;
+       esac
+    done
+
+
+       if test "$cs_ignore_cache" != yes; then
+  { echo "$as_me:$LINENO: checking for libbfd" >&5
+echo $ECHO_N "checking for libbfd... $ECHO_C" >&6; }
+if test "${cs_cv_libbfd+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+    cs_cflags_save="$CFLAGS"
+    cs_lflags_save="$LDFLAGS"
+    cs_libs_save="$LIBS"
+    cs_build_ok=no
+
+
+    for cs_build_item in $cs_check_lib_flags
+    do
+
+    set filler `echo "$cs_build_item" | awk 'BEGIN { FS="@" }
+       { for (i=1; i <= NF; ++i)
+           { if ($i == "") print "filler"; else print $i } }'`
+    shift
+    if test $# -eq 0; then
+  cs_dummy=''
+else
+  if test "$1" = filler; then
+  cs_dummy=''
+else
+  cs_dummy=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_cflags_test=''
+else
+  if test "$1" = filler; then
+  cs_cflags_test=''
+else
+  cs_cflags_test=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_lflags_test=''
+else
+  if test "$1" = filler; then
+  cs_lflags_test=''
+else
+  cs_lflags_test=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_libs_test=''
+else
+  if test "$1" = filler; then
+  cs_libs_test=''
+else
+  cs_libs_test=$1
+fi
+
+       shift
+fi
+
+    cs_cflags_test=`echo $cs_cflags_test | sed 'y%#% %'`
+    cs_lflags_test=`echo $cs_lflags_test | sed 'y%#% %'`
+    cs_libs_test=`echo $cs_libs_test | sed 'y%#% %'`
+
+       CFLAGS="$cs_cflags_test  $cs_cflags_save"
+       LDFLAGS="$cs_lflags_test  $cs_lflags_save"
+       LIBS="$cs_libs_test -liberty $cs_libs_save"
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <bfd.h>
+int
+main ()
+{
+bfd_init();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cs_build_ok=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+       if test $cs_build_ok = yes; then
+  break
+fi
+
+    done
+
+
+    CFLAGS=$cs_cflags_save
+    LDFLAGS=$cs_lflags_save
+    LIBS=$cs_libs_save
+    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 $cs_build_ok = yes; then
+  cs_build_cflags=`echo x$cs_cflags_test  | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_build_lflags=`echo x$cs_lflags_test  | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_build_libs=`echo x$cs_libs_test -liberty | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_cv_libbfd=yes
+               cs_cv_libbfd_cflags=$cs_build_cflags
+               cs_cv_libbfd_lflags=$cs_build_lflags
+               cs_cv_libbfd_libs=$cs_build_libs
+else
+  cs_cv_libbfd=no
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $cs_cv_libbfd" >&5
+echo "${ECHO_T}$cs_cv_libbfd" >&6; }
+else
+  { echo "$as_me:$LINENO: checking for libbfd" >&5
+echo $ECHO_N "checking for libbfd... $ECHO_C" >&6; }
+           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
+
+    cs_cflags_save="$CFLAGS"
+    cs_lflags_save="$LDFLAGS"
+    cs_libs_save="$LIBS"
+    cs_build_ok=no
+
+
+    for cs_build_item in $cs_check_lib_flags
+    do
+
+    set filler `echo "$cs_build_item" | awk 'BEGIN { FS="@" }
+       { for (i=1; i <= NF; ++i)
+           { if ($i == "") print "filler"; else print $i } }'`
+    shift
+    if test $# -eq 0; then
+  cs_dummy=''
+else
+  if test "$1" = filler; then
+  cs_dummy=''
+else
+  cs_dummy=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_cflags_test=''
+else
+  if test "$1" = filler; then
+  cs_cflags_test=''
+else
+  cs_cflags_test=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_lflags_test=''
+else
+  if test "$1" = filler; then
+  cs_lflags_test=''
+else
+  cs_lflags_test=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_libs_test=''
+else
+  if test "$1" = filler; then
+  cs_libs_test=''
+else
+  cs_libs_test=$1
+fi
+
+       shift
+fi
+
+    cs_cflags_test=`echo $cs_cflags_test | sed 'y%#% %'`
+    cs_lflags_test=`echo $cs_lflags_test | sed 'y%#% %'`
+    cs_libs_test=`echo $cs_libs_test | sed 'y%#% %'`
+
+       CFLAGS="$cs_cflags_test  $cs_cflags_save"
+       LDFLAGS="$cs_lflags_test  $cs_lflags_save"
+       LIBS="$cs_libs_test -liberty $cs_libs_save"
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <bfd.h>
+int
+main ()
+{
+bfd_init();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cs_build_ok=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+       if test $cs_build_ok = yes; then
+  break
+fi
+
+    done
+
+
+    CFLAGS=$cs_cflags_save
+    LDFLAGS=$cs_lflags_save
+    LIBS=$cs_libs_save
+    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 $cs_build_ok = yes; then
+  cs_build_cflags=`echo x$cs_cflags_test  | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_build_lflags=`echo x$cs_lflags_test  | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_build_libs=`echo x$cs_libs_test -liberty | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_cv_libbfd=yes
+               cs_cv_libbfd_cflags=$cs_build_cflags
+               cs_cv_libbfd_lflags=$cs_build_lflags
+               cs_cv_libbfd_libs=$cs_build_libs
+else
+  cs_cv_libbfd=no
+fi
+
+           { echo "$as_me:$LINENO: result: $cs_cv_libbfd" >&5
+echo "${ECHO_T}$cs_cv_libbfd" >&6; }
+fi
+
+    if test $cs_cv_libbfd = yes; then
+  :
+else
+  cs_cv_libbfd_cflags=''
+       cs_cv_libbfd_lflags=''
+       cs_cv_libbfd_libs=''
+
+fi
+
+else
+  cs_cv_libbfd=no
+fi
+
+
+    cs_cv_with_bfd="$with_bfd"
+
+
+    if test $cs_cv_libbfd = yes; then
+  if test "" != yes; then
+  { echo "$as_me:$LINENO: checking if libbfd is usable" >&5
+echo $ECHO_N "checking if libbfd is usable... $ECHO_C" >&6; }
+if test "${cs_cv_libbfd_ok+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+    cs_cflags_save="$CFLAGS"
+    cs_lflags_save="$LDFLAGS"
+    cs_libs_save="$LIBS"
+    cs_build_ok=no
+
+
+    for cs_build_item in `echo @@@ | sed 'y% %#%'` `echo @@-L/usr/lib@ | sed 'y% %#%'`
+    do
+
+    set filler `echo "$cs_build_item" | awk 'BEGIN { FS="@" }
+       { for (i=1; i <= NF; ++i)
+           { if ($i == "") print "filler"; else print $i } }'`
+    shift
+    if test $# -eq 0; then
+  cs_dummy=''
+else
+  if test "$1" = filler; then
+  cs_dummy=''
+else
+  cs_dummy=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_cflags_test=''
+else
+  if test "$1" = filler; then
+  cs_cflags_test=''
+else
+  cs_cflags_test=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_lflags_test=''
+else
+  if test "$1" = filler; then
+  cs_lflags_test=''
+else
+  cs_lflags_test=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_libs_test=''
+else
+  if test "$1" = filler; then
+  cs_libs_test=''
+else
+  cs_libs_test=$1
+fi
+
+       shift
+fi
+
+    cs_cflags_test=`echo $cs_cflags_test | sed 'y%#% %'`
+    cs_lflags_test=`echo $cs_lflags_test | sed 'y%#% %'`
+    cs_libs_test=`echo $cs_libs_test | sed 'y%#% %'`
+
+       CFLAGS="$cs_cflags_test $cs_cv_libbfd_cflags $cs_cflags_save"
+       LDFLAGS="$cs_lflags_test $cs_cv_libbfd_lflags $cs_lflags_save"
+       LIBS="$cs_libs_test $cs_cv_libbfd_libs $cs_libs_save"
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <bfd.h>
+int
+main ()
+{
+bfd* p;
+               asection* s;
+               bfd_init();
+               p = bfd_openr(0,0);
+               bfd_check_format(p,bfd_object);
+               bfd_get_section_by_name(p,0);
+               bfd_section_size(p,s);
+               bfd_get_section_contents(p,s,0,0,0);
+               bfd_close(p);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cs_build_ok=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+       if test $cs_build_ok = yes; then
+  break
+fi
+
+    done
+
+
+    CFLAGS=$cs_cflags_save
+    LDFLAGS=$cs_lflags_save
+    LIBS=$cs_libs_save
+    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 $cs_build_ok = yes; then
+  cs_build_cflags=`echo x$cs_cflags_test $cs_cv_libbfd_cflags | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_build_lflags=`echo x$cs_lflags_test $cs_cv_libbfd_lflags | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_build_libs=`echo x$cs_libs_test $cs_cv_libbfd_libs | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_cv_libbfd_ok=yes
+               cs_cv_libbfd_ok_cflags=$cs_build_cflags
+               cs_cv_libbfd_ok_lflags=$cs_build_lflags
+               cs_cv_libbfd_ok_libs=$cs_build_libs
+else
+  cs_cv_libbfd_ok=no
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $cs_cv_libbfd_ok" >&5
+echo "${ECHO_T}$cs_cv_libbfd_ok" >&6; }
+else
+  { echo "$as_me:$LINENO: checking if libbfd is usable" >&5
+echo $ECHO_N "checking if libbfd is usable... $ECHO_C" >&6; }
+           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
+
+    cs_cflags_save="$CFLAGS"
+    cs_lflags_save="$LDFLAGS"
+    cs_libs_save="$LIBS"
+    cs_build_ok=no
+
+
+    for cs_build_item in `echo @@@ | sed 'y% %#%'` `echo @@-L/usr/lib@ | sed 'y% %#%'`
+    do
+
+    set filler `echo "$cs_build_item" | awk 'BEGIN { FS="@" }
+       { for (i=1; i <= NF; ++i)
+           { if ($i == "") print "filler"; else print $i } }'`
+    shift
+    if test $# -eq 0; then
+  cs_dummy=''
+else
+  if test "$1" = filler; then
+  cs_dummy=''
+else
+  cs_dummy=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_cflags_test=''
+else
+  if test "$1" = filler; then
+  cs_cflags_test=''
+else
+  cs_cflags_test=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_lflags_test=''
+else
+  if test "$1" = filler; then
+  cs_lflags_test=''
+else
+  cs_lflags_test=$1
+fi
+
+       shift
+fi
+if test $# -eq 0; then
+  cs_libs_test=''
+else
+  if test "$1" = filler; then
+  cs_libs_test=''
+else
+  cs_libs_test=$1
+fi
+
+       shift
+fi
+
+    cs_cflags_test=`echo $cs_cflags_test | sed 'y%#% %'`
+    cs_lflags_test=`echo $cs_lflags_test | sed 'y%#% %'`
+    cs_libs_test=`echo $cs_libs_test | sed 'y%#% %'`
+
+       CFLAGS="$cs_cflags_test $cs_cv_libbfd_cflags $cs_cflags_save"
+       LDFLAGS="$cs_lflags_test $cs_cv_libbfd_lflags $cs_lflags_save"
+       LIBS="$cs_libs_test $cs_cv_libbfd_libs $cs_libs_save"
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <bfd.h>
+int
+main ()
+{
+bfd* p;
+               asection* s;
+               bfd_init();
+               p = bfd_openr(0,0);
+               bfd_check_format(p,bfd_object);
+               bfd_get_section_by_name(p,0);
+               bfd_section_size(p,s);
+               bfd_get_section_contents(p,s,0,0,0);
+               bfd_close(p);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cs_build_ok=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+       if test $cs_build_ok = yes; then
+  break
+fi
+
+    done
+
+
+    CFLAGS=$cs_cflags_save
+    LDFLAGS=$cs_lflags_save
+    LIBS=$cs_libs_save
+    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 $cs_build_ok = yes; then
+  cs_build_cflags=`echo x$cs_cflags_test $cs_cv_libbfd_cflags | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_build_lflags=`echo x$cs_lflags_test $cs_cv_libbfd_lflags | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_build_libs=`echo x$cs_libs_test $cs_cv_libbfd_libs | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+       cs_cv_libbfd_ok=yes
+               cs_cv_libbfd_ok_cflags=$cs_build_cflags
+               cs_cv_libbfd_ok_lflags=$cs_build_lflags
+               cs_cv_libbfd_ok_libs=$cs_build_libs
+else
+  cs_cv_libbfd_ok=no
+fi
+
+           { echo "$as_me:$LINENO: result: $cs_cv_libbfd_ok" >&5
+echo "${ECHO_T}$cs_cv_libbfd_ok" >&6; }
+fi
+
+    if test $cs_cv_libbfd_ok = yes; then
+  :
+else
+  cs_cv_libbfd_ok_cflags=''
+       cs_cv_libbfd_ok_lflags=''
+       cs_cv_libbfd_ok_libs=''
+
+fi
+
+else
+  cs_cv_libbfd_ok=no
+fi
+
+
+    if test $cs_cv_libbfd_ok = yes; then
+  if test "$cs_cv_libbfd_ok" = yes; then
+  cs_build_prop_val="yes"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}LIBBFD.AVAILABLE ?= \"$cs_build_prop_val\" ;
+"
+fi
+
+       cs_build_prop_val="$cs_cv_libbfd_ok_cflags"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}LIBBFD.CFLAGS ?= \"$cs_build_prop_val\" ;
+"
+fi
+
+       cs_build_prop_val="$cs_cv_libbfd_ok_lflags $cs_cv_libbfd_ok_libs"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}LIBBFD.LFLAGS ?= \"$cs_build_prop_val\" ;
+"
+fi
+
+fi
+
+       cs_build_prop_val="$cs_cv_libbfd_ok_cflags"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}EMBED_META.CFLAGS += \"$cs_build_prop_val\" ;
+"
+fi
+
+                       cs_build_prop_val="$cs_cv_libbfd_ok_lflags $cs_cv_libbfd_ok_libs"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}EMBED_META.LFLAGS += \"$cs_build_prop_val\" ;
+"
+fi
+
+fi
+
+                   ;;
+           esac
+fi
+
+fi
+
+if test $enable_meta_info_embedding = yes; then
+  cs_build_prop_val="\$(EMBED_META.CFLAGS)"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}COMPILER.CFLAGS += \"$cs_build_prop_val\" ;
+"
+fi
+
+    cs_build_prop_val="\$(EMBED_META.LFLAGS)"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}COMPILER.LFLAGS += \"$cs_build_prop_val\" ;
+"
+fi
+
+fi
+
+
+#----------------------------------------------------------------------------
+# Package configuration switches.
+#----------------------------------------------------------------------------
+# Check whether --enable-debug was given.
+if test "${enable_debug+set}" = set; then
+  enableval=$enable_debug;
+else
+  enable_debug=no
+fi
+
+
+{ echo "$as_me:$LINENO: checking build mode" >&5
+echo $ECHO_N "checking build mode... $ECHO_C" >&6; }
+if test $enable_debug = yes; then
+  build_mode=debug
+else
+  build_mode=optimize
+fi
+
+{ echo "$as_me:$LINENO: result: $build_mode" >&5
+echo "${ECHO_T}$build_mode" >&6; }
+
+cs_build_prop_val="$build_mode"
+    cs_build_prop_val=`echo x$cs_build_prop_val | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`
+    if test -n "$cs_build_prop_val"; then
+  cs_jamconfig_text="${cs_jamconfig_text}MODE ?= \"$cs_build_prop_val\" ;
+"
+fi
+
+
+#-----------------------------------------------------------------------------
+# Emit install paths and package information.
+#-----------------------------------------------------------------------------
+
+# Handle the case when no prefix is given, and the special case when a path
+# contains more than 2 slashes, these paths seem to be correct but Jam fails
+# on them.
+if test $prefix = NONE; then
+  cs_install_prefix="$ac_default_prefix"
+else
+  cs_install_prefix=`echo "$prefix" | sed -e 's:///*:/:g'`
+fi
+
+if test $exec_prefix = NONE; then
+  cs_install_exec_prefix="\$(prefix)"
+else
+  cs_install_exec_prefix=`echo "$exec_prefix" | sed -e 's:///*:/:g'`
+fi
+
+
+cs_jamconfig_text="${cs_jamconfig_text}prefix ?= \"`echo "$cs_install_prefix" | sed 's/\${\([a-zA-Z_][a-zA-Z_]*\)}/$(\1)/g;s/\\\\/\\\\\\\\/g'`\" ;
+"
+cs_jamconfig_text="${cs_jamconfig_text}exec_prefix ?= \"`echo "$cs_install_exec_prefix" | sed 's/\${\([a-zA-Z_][a-zA-Z_]*\)}/$(\1)/g;s/\\\\/\\\\\\\\/g'`\" ;
+"
+cs_jamconfig_text="${cs_jamconfig_text}bindir ?= \"`echo "$bindir" | sed 's/\${\([a-zA-Z_][a-zA-Z_]*\)}/$(\1)/g;s/\\\\/\\\\\\\\/g'`\" ;
+"
+cs_jamconfig_text="${cs_jamconfig_text}sbindir ?= \"`echo "$sbindir" | sed 's/\${\([a-zA-Z_][a-zA-Z_]*\)}/$(\1)/g;s/\\\\/\\\\\\\\/g'`\" ;
+"
+cs_jamconfig_text="${cs_jamconfig_text}libexecdir ?= \"`echo "$libexecdir" | sed 's/\${\([a-zA-Z_][a-zA-Z_]*\)}/$(\1)/g;s/\\\\/\\\\\\\\/g'`\" ;
+"
+cs_jamconfig_text="${cs_jamconfig_text}datadir ?= \"`echo "$datadir" | sed 's/\${\([a-zA-Z_][a-zA-Z_]*\)}/$(\1)/g;s/\\\\/\\\\\\\\/g'`\" ;
+"
+cs_jamconfig_text="${cs_jamconfig_text}sysconfdir ?= \"`echo "$sysconfdir" | sed 's/\${\([a-zA-Z_][a-zA-Z_]*\)}/$(\1)/g;s/\\\\/\\\\\\\\/g'`\" ;
+"
+cs_jamconfig_text="${cs_jamconfig_text}sharedstatedir ?= \"`echo "$sharedstatedir" | sed 's/\${\([a-zA-Z_][a-zA-Z_]*\)}/$(\1)/g;s/\\\\/\\\\\\\\/g'`\" ;
+"
+cs_jamconfig_text="${cs_jamconfig_text}localstatedir ?= \"`echo "$localstatedir" | sed 's/\${\([a-zA-Z_][a-zA-Z_]*\)}/$(\1)/g;s/\\\\/\\\\\\\\/g'`\" ;
+"
+cs_jamconfig_text="${cs_jamconfig_text}libdir ?= \"`echo "$libdir" | sed 's/\${\([a-zA-Z_][a-zA-Z_]*\)}/$(\1)/g;s/\\\\/\\\\\\\\/g'`\" ;
+"
+cs_jamconfig_text="${cs_jamconfig_text}includedir ?= \"`echo "$includedir" | sed 's/\${\([a-zA-Z_][a-zA-Z_]*\)}/$(\1)/g;s/\\\\/\\\\\\\\/g'`\" ;
+"
+cs_jamconfig_text="${cs_jamconfig_text}oldincludedir ?= \"`echo "$oldincludedir" | sed 's/\${\([a-zA-Z_][a-zA-Z_]*\)}/$(\1)/g;s/\\\\/\\\\\\\\/g'`\" ;
+"
+cs_jamconfig_text="${cs_jamconfig_text}infodir ?= \"`echo "$infodir" | sed 's/\${\([a-zA-Z_][a-zA-Z_]*\)}/$(\1)/g;s/\\\\/\\\\\\\\/g'`\" ;
+"
+cs_jamconfig_text="${cs_jamconfig_text}mandir ?= \"`echo "$mandir" | sed 's/\${\([a-zA-Z_][a-zA-Z_]*\)}/$(\1)/g;s/\\\\/\\\\\\\\/g'`\" ;
+"
+
+cs_jamconfig_text="${cs_jamconfig_text}PACKAGE_NAME ?= \"$PACKAGE_NAME\" ;
+"
+    cs_jamconfig_text="${cs_jamconfig_text}PACKAGE_VERSION ?= \"$PACKAGE_VERSION\" ;
+"
+    cs_jamconfig_text="${cs_jamconfig_text}PACKAGE_STRING ?= \"$PACKAGE_STRING\" ;
+"
+    cs_jamconfig_text="${cs_jamconfig_text}PACKAGE_BUGREPORT ?= \"$PACKAGE_BUGREPORT\" ;
+"
+    cs_jamconfig_text="${cs_jamconfig_text}PACKAGE_LONGNAME ?= \"$PACKAGE_LONGNAME\" ;
+"
+    cs_jamconfig_text="${cs_jamconfig_text}PACKAGE_HOMEPAGE ?= \"$PACKAGE_HOMEPAGE\" ;
+"
+    cs_jamconfig_text="${cs_jamconfig_text}PACKAGE_COPYRIGHT ?= \"$PACKAGE_COPYRIGHT\" ;
+"
+    for cs_veritem in 1 1; do
+       cs_jamconfig_text="${cs_jamconfig_text}PACKAGE_VERSION_LIST += \"$cs_veritem\" ;
+"
+    done
+
+
+#----------------------------------------------------------------------------
+# Emit generated files.
+#----------------------------------------------------------------------------
+ac_config_commands="$ac_config_commands Jamconfig"
+
+ac_config_files="$ac_config_files Jamfile"
+
+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 Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+
+# 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 (dirname -- /) >/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='mkdir -p'
+elif mkdirs . 2>/dev/null; then
+  as_mkdir_p='mkdirs'
+else
+  as_mkdir_p=''
+fi
+test -d ./-p && rmdir ./-p
+
+# Find out whether ``test -x'' works.  Don't use a zero-byte file, as
+# systems may use methods other than mode bits to determine executability.
+cat >conf$$.file <<_ASEOF
+#! /bin/sh
+exit 0
+_ASEOF
+chmod +x conf$$.file
+if test -x conf$$.file >/dev/null 2>&1; then
+  as_executable_p="test -x"
+else
+  as_executable_p=:
+fi
+rm -f conf$$.file
+
+# 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 skyscraper $as_me 1.1, which was
+generated by GNU Autoconf 2.59d.  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"
+config_commands="$ac_config_commands"
+
+_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, then exit
+  -q, --quiet      do not print progress messages
+  -d, --debug      don't remove temporary files
+      --recheck    update $as_me by reconfiguring in the same conditions
+  --file=FILE[:TEMPLATE]
+                  instantiate the configuration file FILE
+  --header=FILE[:TEMPLATE]
+                  instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <bug-autoconf@gnu.org>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+skyscraper config.status 1.1
+configured by $0, generated by GNU Autoconf 2.59d,
+  with options \\"`echo "$ac_configure_args" | sed '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'
+_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
+#
+# INIT-COMMANDS
+#
+cs_jamconfig_text='$cs_jamconfig_text'
+       cs_dir=`$as_dirname -- Jamconfig ||
+$as_expr XJamconfig : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        XJamconfig : 'X\(//\)[^/]' \| \
+        XJamconfig : 'X\(//\)$' \| \
+        XJamconfig : 'X\(/\)' \| . 2>/dev/null ||
+echo XJamconfig |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+       { if test -n "\$as_mkdir_p"; then
+    \$as_mkdir_p \$cs_dir
+  else
+    as_dir=\$cs_dir
+    as_dirs=
+    while test ! -d "\$as_dir"; do
+      as_dirs="\$as_dir \$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'\`
+    done
+    test ! -n "\$as_dirs" || mkdir \$as_dirs
+  fi || { { echo "\$as_me:\$LINENO: error: cannot create directory \$cs_dir" >&5
+echo "\$as_me: error: cannot create directory \$cs_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+
+
+_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" ;;
+    "Jamconfig") CONFIG_COMMANDS="$CONFIG_COMMANDS Jamconfig" ;;
+    "Jamfile") CONFIG_FILES="$CONFIG_FILES Jamfile" ;;
+
+  *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason 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
+CC!$CC$ac_delim
+CFLAGS!$CFLAGS$ac_delim
+LDFLAGS!$LDFLAGS$ac_delim
+CPPFLAGS!$CPPFLAGS$ac_delim
+ac_ct_CC!$ac_ct_CC$ac_delim
+EXEEXT!$EXEEXT$ac_delim
+OBJEXT!$OBJEXT$ac_delim
+CXX!$CXX$ac_delim
+CXXFLAGS!$CXXFLAGS$ac_delim
+ac_ct_CXX!$ac_ct_CXX$ac_delim
+RANLIB!$RANLIB$ac_delim
+WINDRES!$WINDRES$ac_delim
+ac_ct_WINDRES!$ac_ct_WINDRES$ac_delim
+DOXYGEN!$DOXYGEN$ac_delim
+DOT!$DOT$ac_delim
+ac_ct_DOT!$ac_ct_DOT$ac_delim
+TEXI2DVI!$TEXI2DVI$ac_delim
+TEXI2PDF!$TEXI2PDF$ac_delim
+DVIPS!$DVIPS$ac_delim
+DVIPDF!$DVIPDF$ac_delim
+MAKEINFO!$MAKEINFO$ac_delim
+INSTALL!$INSTALL$ac_delim
+LIBTOOL_TEST!$LIBTOOL_TEST$ac_delim
+ac_ct_LIBTOOL_TEST!$ac_ct_LIBTOOL_TEST$ac_delim
+LIBTOOL_PATH!$LIBTOOL_PATH$ac_delim
+LIBTOOL!$LIBTOOL$ac_delim
+ac_ct_LIBTOOL!$ac_ct_LIBTOOL$ac_delim
+CS_LT_APPLE!$CS_LT_APPLE$ac_delim
+APPLE_LIBTOOL!$APPLE_LIBTOOL$ac_delim
+MKDIR!$MKDIR$ac_delim
+MKDIRS!$MKDIRS$ac_delim
+PERL!$PERL$ac_delim
+TTREE!$TTREE$ac_delim
+PKG_CONFIG!$PKG_CONFIG$ac_delim
+ac_ct_PKG_CONFIG!$ac_ct_PKG_CONFIG$ac_delim
+CONFIG_CPPUNIT!$CONFIG_CPPUNIT$ac_delim
+ac_ct_CONFIG_CPPUNIT!$ac_ct_CONFIG_CPPUNIT$ac_delim
+CONFIG_!$CONFIG_$ac_delim
+ac_ct_CONFIG_!$ac_ct_CONFIG_$ac_delim
+CRYSTAL!$CRYSTAL$ac_delim
+CRYSTAL_CONFIG_TOOL!$CRYSTAL_CONFIG_TOOL$ac_delim
+CPP!$CPP$ac_delim
+GREP!$GREP$ac_delim
+EGREP!$EGREP$ac_delim
+OBJCOPY!$OBJCOPY$ac_delim
+ac_ct_OBJCOPY!$ac_ct_OBJCOPY$ac_delim
+CONFIG_BFD!$CONFIG_BFD$ac_delim
+ac_ct_CONFIG_BFD!$ac_ct_CONFIG_BFD$ac_delim
+LIBOBJS!$LIBOBJS$ac_delim
+LTLIBOBJS!$LTLIBOBJS$ac_delim
+_ACEOF
+
+  if test `grep -c "$ac_delim\$" conf$$subs.sed` = 95; 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=
+if grep '^CEOF$' conf$$subs.sed >/dev/null; then
+  ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF//p' conf$$subs.sed | sort -nru | sed 1q`
+  ac_eof=`expr 0$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 <conf$$subs.sed
+rm -f conf$$subs.sed
+cat >>$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    :C $CONFIG_COMMANDS
+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'`
+  { if test -n "$as_mkdir_p"; then
+    $as_mkdir_p "$ac_dir"
+  else
+    as_dir="$ac_dir"
+    as_dirs=
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`$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'`
+    done
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+   { (exit 1); exit 1; }; }; }
+
+  ac_builddir=.
+
+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
+  #
+
+_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=
+
+case `sed -n '/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+' $ac_file_inputs` in
+*datarootdir*) ;;
+*@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
+$ac_datarootdir_hack
+" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out
+
+  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
+  #
+
+  # 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=' ,'
+
+  ac_word_regexp=[_$as_cr_Letters][_$as_cr_alnum]*
+_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]*
+uniq confdefs.h |
+  sed -n '
+       t rset
+       :rset
+       s/^[     ]*#[    ]*define[       ][      ]*//
+       t ok
+       d
+       :ok
+       s/[\\&,]/\\&/g
+       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=96
+
+# 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:
+    echo '    # First, check the format of the line:
+    cat >"$tmp/defines.sed" <<CEOF
+/^[     ]*#[    ]*undef[        ][      ]*$ac_word_regexp[      ]*$/b def
+/^[     ]*#[    ]*define[       ][      ]*$ac_word_regexp[(     ]/b def
+b
+:def' >>$CONFIG_STATUS
+  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"
+ ;;
+
+  :C)  { echo "$as_me:$LINENO: executing $ac_file commands" >&5
+echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
+
+
+  case $ac_file$ac_mode in
+    "Jamconfig":C) echo $ECHO_N "$cs_jamconfig_text$ECHO_C" > $tmp/tcache
+       if diff Jamconfig $tmp/tcache >/dev/null 2>&1; then
+  { echo "$as_me:$LINENO: Jamconfig is unchanged" >&5
+echo "$as_me: Jamconfig is unchanged" >&6;}
+else
+  rm -f Jamconfig
+           cp $tmp/tcache Jamconfig
+fi
+
+       rm -f $tmp/tcache ;;
+
+  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
+
+
+{ echo "$as_me:$LINENO:
+
+Please note that this project uses Jam as its build tool,
+therefore you must type 'jam' to build the project.
+
+Jam home: http://www.perforce.com/jam/jam.html
+Jam source: ftp://ftp.perforce.com/jam/
+" >&5
+echo "$as_me:
+
+Please note that this project uses Jam as its build tool,
+therefore you must type 'jam' to build the project.
+
+Jam home: http://www.perforce.com/jam/jam.html
+Jam source: ftp://ftp.perforce.com/jam/
+" >&6;}
diff --git a/configure.ac b/configure.ac
new file mode 100644 (file)
index 0000000..cbf0efb
--- /dev/null
@@ -0,0 +1,194 @@
+#----------------------------------------------------------------------------
+# Autoconf input script. Invoke the ./autogen.sh script to generate a
+# configure script from this file.
+#----------------------------------------------------------------------------
+AC_PREREQ([2.54])
+
+#----------------------------------------------------------------------------
+# Initialize Autoconf.
+#----------------------------------------------------------------------------
+AC_INIT(
+    [skyscraper],
+    [1.1],
+    [ryan@tliquest.net])
+CS_PACKAGEINFO(
+    [Skyscraper],
+    [Copyright (C)2004-2006 Ryan Thoryk],
+    [http://www.tliquest.net/skyscraper])
+AC_CONFIG_SRCDIR([mk/jam/build.jam])
+AC_CONFIG_AUX_DIR([mk/autoconf])
+AC_CANONICAL_HOST
+
+#----------------------------------------------------------------------------
+# Setup for the configuration header.
+#----------------------------------------------------------------------------
+AC_CONFIG_HEADERS([config.h])
+
+#----------------------------------------------------------------------------
+# Check for tools.
+#----------------------------------------------------------------------------
+CS_PROG_CC
+AS_IF([test -z "$CC"],
+    [AC_MSG_ERROR([Could not find a usable C compiler.])])
+CS_PROG_CXX
+AS_IF([test -z "$CXX"],
+    [AC_MSG_ERROR([Could not find a usable C++ compiler.])])
+CS_PROG_LINK
+
+# The default RANLIB in Jambase is wrong on some platforms, and is also
+# unsuitable during cross-compilation, so we set the value unconditionally
+# (sixth argument of CS_EMIT_BUILD_PROPERTY).
+AC_PROG_RANLIB
+CS_EMIT_BUILD_PROPERTY([RANLIB], [$RANLIB], [], [], [], [Y])
+
+CS_CHECK_TOOLS([WINDRES], [windres])
+CS_EMIT_BUILD_PROPERTY([CMD.WINDRES], [$WINDRES])
+
+CS_CHECK_PROGS([DOXYGEN], [doxygen])
+CS_EMIT_BUILD_PROPERTY([CMD.DOXYGEN], [$DOXYGEN])
+
+CS_CHECK_TOOLS([DOT], [dot])
+CS_EMIT_BUILD_PROPERTY([CMD.DOT], [$DOT])
+
+CS_CHECK_PROGS([TEXI2DVI], [texi2dvi])
+CS_EMIT_BUILD_PROPERTY([CMD.TEXI2DVI], [$TEXI2DVI])
+
+CS_CHECK_PROGS([TEXI2PDF], [texi2pdf])
+CS_EMIT_BUILD_PROPERTY([CMD.TEXI2PDF], [$TEXI2PDF])
+
+CS_CHECK_PROGS([DVIPS], [dvips])
+CS_EMIT_BUILD_PROPERTY([CMD.DVIPS], [$DVIPS])
+
+CS_CHECK_PROGS([DVIPDF], [dvipdf])
+CS_EMIT_BUILD_PROPERTY([CMD.DVIPDF], [$DVIPDF])
+
+CS_CHECK_PROGS([MAKEINFO], [makeinfo])
+CS_EMIT_BUILD_PROPERTY([CMD.MAKEINFO], [$MAKEINFO])
+
+CS_CHECK_PROGS([INSTALL], [install])
+CS_EMIT_BUILD_PROPERTY([INSTALL], [$INSTALL])
+
+CS_CHECK_LIBTOOL
+CS_EMIT_BUILD_PROPERTY([LIBTOOL], [$LIBTOOL])
+CS_EMIT_BUILD_PROPERTY([APPLE_LIBTOOL], [$APPLE_LIBTOOL])
+
+CS_CHECK_MKDIR
+CS_EMIT_BUILD_PROPERTY([CMD.MKDIR], [$MKDIR])
+CS_EMIT_BUILD_PROPERTY([CMD.MKDIRS], [$MKDIRS])
+
+CS_CHECK_PROGS([PERL], [perl5 perl])
+CS_EMIT_BUILD_PROPERTY([PERL], [$PERL])
+
+CS_CHECK_TEMPLATE_TOOLKIT2([emit])
+
+#----------------------------------------------------------------------------
+# Determine system type
+#----------------------------------------------------------------------------
+CS_CHECK_HOST
+
+#----------------------------------------------------------------------------
+# Check for syntax problems / header files
+#----------------------------------------------------------------------------
+# Nothing yet.
+
+#----------------------------------------------------------------------------
+# Check for external libraries
+#----------------------------------------------------------------------------
+CS_CHECK_CPPUNIT([emit])
+
+#----------------------------------------------------------------------------
+# Check for Crystal Space (CS)
+#----------------------------------------------------------------------------
+AC_ARG_WITH([cs], [AC_HELP_STRING([--without-cs],
+  [do not look for an installed Crystal Space SDK; this option is useful only
+  if you need to perform routine maintenance tasks, such as generating
+  project files or converting documentation, without having the Crystal Space
+  SDK installed])])
+AS_IF([test -z "$with_cs"], [with_cs=yes])
+
+AS_IF([test $with_cs != no],
+[CS_PATH_CRYSTAL_EMIT([0.99], [],
+  [AC_MSG_ERROR([
+*** Crystal Space could not be found or was unusable. The latest version is
+*** always available from http://www.crystalspace3d.org/
+*** Also, be sure that you have either installed Crystal Space or set the
+*** CRYSTAL environment variable properly.
+])], [crystalspace])])
+
+#----------------------------------------------------------------------------
+# Check for Crystal Entity Layer (CEL)
+#----------------------------------------------------------------------------
+m4_define([cel_desired], [no])
+CS_EMIT_BUILD_PROPERTY([CEL.DESIRED], [cel_desired])
+m4_if(cel_desired, [yes],
+[AC_ARG_WITH([cel], [AC_HELP_STRING([--without-cel],
+  [do not look for an installed Crystal Entity Layer SDK; this option is useful
+  only if you need to perform routine maintenance tasks, such as generating
+  project files or converting documentation, without having the CEL SDK
+  installed])])
+AS_IF([test -z "$with_cel"], [with_cel=yes])
+
+AS_IF([test $with_cel != no],
+[CS_PATH_CEL_EMIT([0.99], [],
+  [AC_MSG_ERROR([
+*** CEL could not be found or was unusable. The latest version is always
+*** available from http://cel.crystalspace3d.org/
+])])
+AC_DEFINE([USE_CEL], [], [Define to enable CEL.])
+AC_DEFINE_UNQUOTED([CEL_PLUGIN_DIR], ["$CEL_PLUGIN_DIR"],
+  [Define with path to CEL plugins.])
+])])
+
+#------------------------------------------------------------------------------
+# Determine if plugin meta-information should be embedded directly into plugin
+# modules or if it should exist in stand-alone .csplugin files.  On Unix,
+# embedding is accomplished via libbfd which carries a GPL license.  If your
+# project is compatible with GPL, then set gpl_compatible to "yes".  This will
+# cause embedding to be enabled on Unix by default. Otherwise, set it to "no",
+# which will cause embedding to be disabled by default on Unix. (In any event,
+# the user can override the default setting with the
+# --enable-meta-info-embedding option.)
+#------------------------------------------------------------------------------
+m4_define([gpl_compatible], [yes])
+CS_META_INFO_EMBED([emit], gpl_compatible)
+AS_IF([test $enable_meta_info_embedding = yes],
+    [CS_EMIT_BUILD_PROPERTY([COMPILER.CFLAGS],
+       [AS_ESCAPE([$(EMBED_META.CFLAGS)])], [+])
+    CS_EMIT_BUILD_PROPERTY([COMPILER.LFLAGS],
+       [AS_ESCAPE([$(EMBED_META.LFLAGS)])], [+])])
+
+#----------------------------------------------------------------------------
+# Package configuration switches.
+#----------------------------------------------------------------------------
+AC_ARG_ENABLE([debug],
+    [AC_HELP_STRING([--enable-debug],
+       [build with debugging information (default NO)])],
+    [], [enable_debug=no])
+
+AC_MSG_CHECKING([build mode])
+AS_IF([test $enable_debug = yes], [build_mode=debug], [build_mode=optimize])
+AC_MSG_RESULT([$build_mode])
+
+CS_EMIT_BUILD_PROPERTY([MODE], [$build_mode])
+
+#-----------------------------------------------------------------------------
+# Emit install paths and package information.
+#-----------------------------------------------------------------------------
+CS_OUTPUT_INSTALLDIRS
+CS_EMIT_PACKAGEINFO
+
+#----------------------------------------------------------------------------
+# Emit generated files.
+#----------------------------------------------------------------------------
+CS_JAMCONFIG_OUTPUT([Jamconfig])
+AC_CONFIG_FILES([Jamfile])
+AC_OUTPUT
+
+AC_MSG_NOTICE([
+
+Please note that this project uses Jam as its build tool,
+therefore you must type 'jam' to build the project.
+
+Jam home: http://www.perforce.com/jam/jam.html
+Jam source: ftp://ftp.perforce.com/jam/
+])
diff --git a/mk/autoconf/cel.m4 b/mk/autoconf/cel.m4
new file mode 100644 (file)
index 0000000..f35178b
--- /dev/null
@@ -0,0 +1,188 @@
+# cel.m4                                                       -*- Autoconf -*-
+#==============================================================================
+# CEL detection macros
+# Copyright (C)2005 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#==============================================================================
+AC_PREREQ([2.56])
+
+m4_define([cel_min_version_default], [0.99])
+
+#------------------------------------------------------------------------------
+# CS_PATH_CEL_CHECK([MINIMUM-VERSION], [ACTION-IF-FOUND],
+#                   [ACTION-IF-NOT-FOUND], [REQUIRED-LIBS], [OPTIONAL-LIBS])
+#      Checks for Crystal Entity Layer (CEL) paths and libraries by consulting
+#      cel-config. It first looks for cel-config in the paths mentioned by
+#      $CEL, then in the paths mentioned by $PATH, and then in
+#      /usr/local/cel/bin.  Emits an error if it can not locate cel-config, if
+#      the CEL test program fails, or if the available version number is
+#      unsuitable.  Exports the variables CEL_CONFIG_TOOL, CEL_AVAILABLE,
+#      CEL_VERSION, CEL_CFLAGS, CEL_LIBS, CEL_INCLUDE_DIR, and
+#      CEL_AVAILABLE_LIBS.  If the check succeeds, then CEL_AVAILABLE will be
+#      'yes', and the other variables set to appropriate values. If it fails,
+#      then CEL_AVAILABLE will be 'no', and the other variables empty.  If
+#      REQUIRED-LIBS is specified, then it is a list of CEL libraries which
+#      must be present, and for which appropriate compiler and linker flags
+#      will be reflected in CEL_CFLAGS and CEL_LFLAGS. If OPTIONAL-LIBS is
+#      specified, then it is a list of CEL libraries for which appropriate
+#      compiler and linker flags should be returned if the libraries are
+#      available.  It is not an error for an optional library to be
+#      absent. The client can check CEL_AVAILABLE_LIBS for a list of all
+#      libraries available for this particular installation of CEL.  The
+#      returned list is independent of REQUIRED-LIBS and OPTIONAL-LIBS.  Use
+#      the results of the check like this: CFLAGS="$CFLAGS $CEL_CFLAGS" and
+#      LDFLAGS="$LDFLAGS $CEL_LIBS"
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_PATH_CEL_CHECK],
+[AC_REQUIRE([CS_PATH_CRYSTAL_CHECK])
+AC_ARG_WITH([cel-prefix], 
+    [AC_HELP_STRING([--with-cel-prefix=CEL_PREFIX],
+       [specify location of CEL installation; this is the \$prefix value used
+        when installing the SDK])],
+    [CEL="$withval"
+    export CEL])
+AC_ARG_VAR([CEL], [Prefix where CEL is installed])
+AC_ARG_ENABLE([celtest], 
+    [AC_HELP_STRING([--enable-celtest], 
+       [verify that the CEL SDK is actually usable (default YES)])], [],
+       [enable_celtest=yes])
+
+# Try to find an installed cel-config.
+cel_path=''
+AS_IF([test -n "$CEL"],
+    [my_IFS=$IFS; IFS=$PATH_SEPARATOR
+    for cel_dir in $CEL; do
+       AS_IF([test -n "$cel_path"], [cel_path="$cel_path$PATH_SEPARATOR"])
+       cel_path="$cel_path$cel_dir$PATH_SEPARATOR$cel_dir/bin"
+    done
+    IFS=$my_IFS])
+
+AS_IF([test -n "$cel_path"], [cel_path="$cel_path$PATH_SEPARATOR"])
+cel_path="$cel_path$PATH$PATH_SEPARATOR/usr/local/cel/bin"
+
+AC_PATH_TOOL([CEL_CONFIG_TOOL], [cel-config], [], [$cel_path])
+
+AS_IF([test -n "$CEL_CONFIG_TOOL"],
+    [cfg="$CEL_CONFIG_TOOL"
+
+    CS_CHECK_PROG_VERSION([CEL], [$cfg --version],
+       [m4_default([$1],[cel_min_version_default])], [9.9|.9],
+       [cel_sdk=yes], [cel_sdk=no])
+
+    AS_IF([test $cel_sdk = yes],
+       [cel_liblist="$4"
+       cel_optlibs=CS_TRIM([$5])
+       AS_IF([test -n "$cel_optlibs"],
+           [cel_optlibs=`$cfg --available-libs $cel_optlibs`
+           cel_liblist="$cel_liblist $cel_optlibs"])
+       CEL_VERSION=`$cfg --version $cel_liblist`
+       CEL_CFLAGS=CS_RUN_PATH_NORMALIZE([$cfg --cflags $cel_liblist])
+       CEL_LIBS=CS_RUN_PATH_NORMALIZE([$cfg --lflags $cel_liblist])
+       CEL_INCLUDE_DIR=CS_RUN_PATH_NORMALIZE(
+           [$cfg --includedir $cel_liblist])
+       CEL_AVAILABLE_LIBS=`$cfg --available-libs`
+       CEL_STATICDEPS=`$cfg --static-deps`
+       AS_IF([test -z "$CEL_LIBS"], [cel_sdk=no])])],
+    [cel_sdk=no])
+
+AS_IF([test "$cel_sdk" = yes && test "$enable_celtest" = yes],
+    [CS_CHECK_BUILD([if CEL SDK is usable], [cel_cv_cel_sdk],
+       [AC_LANG_PROGRAM(
+           [#include <cssysdef.h>
+           #include <physicallayer/entity.h>],
+           [/* TODO write a suitable test */])],
+       [CS_CREATE_TUPLE([$CEL_CFLAGS],[],[$CEL_LIBS])], [C++],
+       [], [cel_sdk=no], [],
+       [$CRYSTAL_CFLAGS], [], [$CRYSTAL_LIBS])])
+
+AS_IF([test "$cel_sdk" = yes],
+   [CEL_AVAILABLE=yes
+   $2],
+   [CEL_AVAILABLE=no
+   CEL_CFLAGS=''
+   CEL_VERSION=''
+   CEL_LIBS=''
+   CEL_INCLUDE_DIR=''
+   $3])
+])
+
+
+#------------------------------------------------------------------------------
+# CS_PATH_CEL_HELPER([MINIMUM-VERSION], [ACTION-IF-FOUND],
+#                        [ACTION-IF-NOT-FOUND], [REQUIRED-LIBS],
+#                        [OPTIONAL-LIBS])
+#      Deprecated: Backward compatibility wrapper for CS_PATH_CEL_CHECK().
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_PATH_CEL_HELPER],
+[CS_PATH_CEL_CHECK([$1],[$2],[$3],[$4],[$5])])
+
+
+#------------------------------------------------------------------------------
+# CS_PATH_CEL([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
+#                 [REQUIRED-LIBS], [OPTIONAL-LIBS])
+#      Convenience wrapper for CS_PATH_CEL_CHECK() which also invokes
+#      AC_SUBST() for CEL_AVAILABLE, CEL_VERSION, CEL_CFLAGS,
+#      CEL_LIBS, CEL_INCLUDE_DIR, and CEL_AVAILABLE_LIBS.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_PATH_CEL],
+[CS_PATH_CEL_CHECK([$1],[$2],[$3],[$4],[$5])
+AC_SUBST([CEL_AVAILABLE])
+AC_SUBST([CEL_VERSION])
+AC_SUBST([CEL_CFLAGS])
+AC_SUBST([CEL_LIBS])
+AC_SUBST([CEL_INCLUDE_DIR])
+AC_SUBST([CEL_AVAILABLE_LIBS])
+AC_SUBST([CEL_STATICDEPS])])
+
+
+#------------------------------------------------------------------------------
+# CS_PATH_CEL_EMIT([MINIMUM-VERSION], [ACTION-IF-FOUND],
+#                      [ACTION-IF-NOT-FOUND], [REQUIRED-LIBS], [OPTIONAL-LIBS],
+#                      [EMITTER])
+#      Convenience wrapper for CS_PATH_CEL_CHECK() which also emits
+#      CEL_AVAILABLE, CEL_VERSION, CEL_CFLAGS, CEL_LIBS,
+#      CEL_INCLUDE_DIR, and CEL_AVAILABLE_LIBS as the build properties
+#      CEL.AVAILABLE, CEL.VERSION, CEL.CFLAGS, CEL.LIBS,
+#      CEL.INCLUDE_DIR, and CEL.AVAILABLE_LIBS, respectively, using
+#      EMITTER.  EMITTER is a macro name, such as CS_JAMCONFIG_PROPERTY or
+#      CS_MAKEFILE_PROPERTY, which performs the actual task of emitting the
+#      property and value. If EMITTER is omitted, then
+#      CS_EMIT_BUILD_PROPERTY()'s default emitter is used.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_PATH_CEL_EMIT],
+[CS_PATH_CEL_CHECK([$1],[$2],[$3],[$4],[$5])
+_CS_PATH_CEL_EMIT([CEL.AVAILABLE],[$CEL_AVAILABLE],[$6])
+_CS_PATH_CEL_EMIT([CEL.VERSION],[$CEL_VERSION],[$6])
+_CS_PATH_CEL_EMIT([CEL.CFLAGS],[$CEL_CFLAGS],[$6])
+_CS_PATH_CEL_EMIT([CEL.LFLAGS],[$CEL_LIBS],[$6])
+_CS_PATH_CEL_EMIT([CEL.INCLUDE_DIR],[$CEL_INCLUDE_DIR],[$6])
+_CS_PATH_CEL_EMIT([CEL.AVAILABLE_LIBS],[$CEL_AVAILABLE_LIBS],[$6])
+_CS_PATH_CEL_EMIT([CEL.STATICDEPS],[$CEL_STATICDEPS],[$6])
+])
+
+AC_DEFUN([_CS_PATH_CEL_EMIT],
+[CS_EMIT_BUILD_PROPERTY([$1],[$2],[],[],[$3])])
+
+
+#------------------------------------------------------------------------------
+# CS_PATH_CEL_JAM([MINIMUM-VERSION], [ACTION-IF-FOUND],
+#                     [ACTION-IF-NOT-FOUND], [REQUIRED-LIBS], [OPTIONAL-LIBS])
+#      Deprecated: Jam-specific backward compatibility wrapper for
+#      CS_PATH_CEL_EMIT().
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_PATH_CEL_JAM],
+[CS_PATH_CEL_EMIT([$1],[$2],[$3],[$4],[$5],[CS_JAMCONFIG_PROPERTY])])
diff --git a/mk/autoconf/checkbuild.m4 b/mk/autoconf/checkbuild.m4
new file mode 100644 (file)
index 0000000..5776656
--- /dev/null
@@ -0,0 +1,230 @@
+# checkbuild.m4                                                -*- Autoconf -*-
+#==============================================================================
+# Copyright (C)2003 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#==============================================================================
+AC_PREREQ([2.56])
+
+#------------------------------------------------------------------------------
+# CS_SPLIT_TUPLE(TUPLE, OUTPUT-VARIABLES)
+#      Split a build-tuple into its component parts.  A build tuple is
+#      constructed by CS_CREATE_TUPLE() and is comprised of compiler flags,
+#      linker flags, and library references.  OUTPUT-VARIABLES is a
+#      comma-delimited list of shell variables which should receive the
+#      extracted compiler flags, linker flags, and library references,
+#      respectively.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_SPLIT_TUPLE],
+    [CS_SPLIT([$1], [cs_dummy,$2], [@])
+    m4_map([_CS_SPLIT_TUPLE], [$2])])
+
+AC_DEFUN([_CS_SPLIT_TUPLE],
+    [$1=`echo $$1 | sed 'y%@%:@% %'`
+    ])
+
+
+
+#------------------------------------------------------------------------------
+# CS_CREATE_TUPLE([CFLAGS], [LFLAGS], [LIBS])
+#      Construct a build-tuple which is comprised of compiler flags, linker
+#      flags, and library references.  Build tuples are encoded so as to
+#      preserve whitespace in each component.  This makes it possible for
+#      macros (such as CS_BUILD_IFELSE) which employ build tuples to accept
+#      whitespace-delimited lists of tuples, and for shell "for" statements to
+#      iterate over tuple lists without compromising whitespace embedded
+#      within individual flags or library references.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_CREATE_TUPLE], [`echo @$1@$2@$3 | sed 'y% %@%:@%'`])
+
+
+
+#------------------------------------------------------------------------------
+# CS_LANG_CFLAGS
+#      Return the literal string CFLAGS if the current language is C.  Return
+#      the literal string CXXFLAGS if the current language is C++.  Generic
+#      compiler test macros which need to modify or save the compiler flags
+#      can invoke this macro to get the name of the compiler flags environment
+#      variable (either CFLAGS or CXXFLAGS) depending upon the current
+#      language.  For example:
+#              CS_LANG_CFLAGS="$CS_LANG_CFLAGS -Wall"
+#      With C, this expands to:
+#              CFLAGS="$CFLAGS -Wall"
+#      With C++, it expands to:
+#              CXXFLAGS="$CXXFLAGS -Wall"
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_LANG_CFLAGS], [AC_LANG_CASE([C], [CFLAGS], [C++], [CXXFLAGS])])
+
+
+
+#------------------------------------------------------------------------------
+# CS_BUILD_IFELSE([PROGRAM], [FLAGS], [LANGUAGE], [ACTION-IF-BUILT],
+#                 [ACTION-IF-NOT-BUILT], [OTHER-CFLAGS], [OTHER-LFLAGS],
+#                 [OTHER-LIBS], [INHIBIT-OTHER-FLAGS], [ERROR-REGEX])
+#      Try building a program using the supplied compiler flags, linker flags,
+#      and library references.  PROGRAM is typically a program composed via
+#      AC_LANG_PROGRAM().  PROGRAM may be omitted if you are interested only
+#      in learning if the compiler or linker respects certain flags.  LANGUAGE
+#      is typically either C or C++ and specifies which compiler to use for
+#      the test.  If LANGUAGE is omitted, C is used.  FLAGS is a whitespace
+#      delimited list of build tuples.  Tuples are created with
+#      CS_CREATE_TUPLE() and are composed of up to three elements each.  The
+#      first element represents compiler flags, the second linker flags, and
+#      the third libraries used when linking the program.  Each tuple from
+#      FLAGS is attempted in order.  If you want a build attempted with no
+#      special flags prior to builds with specialized flags, create an empty
+#      tuple with CS_CREATE_TUPLE() at the start of the FLAGS list.  If the
+#      build is successful, then the shell variables cs_build_ok is set to
+#      "yes", cs_build_cflags, cs_build_lflags, and cs_build_libs are set to
+#      the tuple elements which resulted in the successful build, and
+#      ACTION-IF-BUILT is invoked.  Upon successful build, no further tuples
+#      are consulted.  If no tuple results in a successful build, then
+#      cs_build_ok is set to "no" and ACTION-IF-NOT-BUILT is invoked.
+#      OTHER-CFLAGS, OTHER-LFLAGS, and OTHER-LIBS specify additional compiler
+#      flags, linker flags, and libraries which should be used with each tuple
+#      build attempt.  Upon successful build, these additional flags are also
+#      reflected in the variables cs_build_cflags, cs_build_lflags, and
+#      cs_build_libs unless INHIBIT-OTHER-FLAGS is a non-empty string.  The
+#      optional ERROR-REGEX places an additional constraint upon the build
+#      check.  If specified, ERROR-REGEX, which is a standard `grep' regular
+#      expression, is applied to output captured from the compiler and linker.
+#      If ERROR-REGEX matches, then the build is deemed a failure, and
+#      cs_build_ok is set to "no".  This facility is useful for broken build
+#      tools which emit an error message yet still return success as a result.
+#      In such cases, it should be possible to detect the failure by scanning
+#      the tools' output.
+#
+# IMPLEMENTATION NOTES
+#
+#      In Autoconf 2.57 and earlier, AC_LINK_IFELSE() invokes AC_TRY_EVAL(),
+#      which does not provide access to the captured output.  To work around
+#      this limitation, we temporarily re-define AC_TRY_EVAL() as
+#      _AC_EVAL_STDERR(), which leaves the captured output in conftest.err
+#      (which we must also delete).  In Autoconf 2.58, however,
+#      AC_LINK_IFELSE() instead already invokes _AC_EVAL_STDERR() on our
+#      behalf, however we must be careful to apply ERROR-REGEX within the
+#      invocation AC_LINK_IFELSE(), since AC_LINK_IFELSE() deletes
+#      conftest.err before it returns.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_BUILD_IFELSE],
+    [AC_LANG_PUSH(m4_default([$3],[C]))
+    cs_cflags_save="$CS_LANG_CFLAGS"
+    cs_lflags_save="$LDFLAGS"
+    cs_libs_save="$LIBS"
+    cs_build_ok=no
+    m4_ifval([$10], [m4_pushdef([AC_TRY_EVAL], [_AC_EVAL_STDERR]($$[1]))])
+
+    for cs_build_item in m4_default([$2],[CS_CREATE_TUPLE()])
+    do
+       CS_SPLIT_TUPLE(
+           [$cs_build_item],[cs_cflags_test,cs_lflags_test,cs_libs_test])
+       CS_LANG_CFLAGS="$cs_cflags_test $6 $cs_cflags_save"
+       LDFLAGS="$cs_lflags_test $7 $cs_lflags_save"
+       LIBS="$cs_libs_test $8 $cs_libs_save"
+       AC_LINK_IFELSE(m4_default([$1], [AC_LANG_PROGRAM([],[])]),
+           [m4_ifval([$10],
+               [AS_IF([AC_TRY_COMMAND(
+                   [grep "AS_ESCAPE([$10])" conftest.err >/dev/null 2>&1])],
+                   [cs_build_ok=no], [cs_build_ok=yes])],
+               [cs_build_ok=yes])])
+       AS_IF([test $cs_build_ok = yes], [break])
+    done
+
+    m4_ifval([$10], [m4_popdef([AC_TRY_EVAL]) rm -f conftest.err])
+    CS_LANG_CFLAGS=$cs_cflags_save
+    LDFLAGS=$cs_lflags_save
+    LIBS=$cs_libs_save
+    AC_LANG_POP(m4_default([$3],[C]))
+
+    AS_IF([test $cs_build_ok = yes],
+       [cs_build_cflags=CS_TRIM([$cs_cflags_test[]m4_ifval([$9],[],[ $6])])
+       cs_build_lflags=CS_TRIM([$cs_lflags_test[]m4_ifval([$9],[],[ $7])])
+       cs_build_libs=CS_TRIM([$cs_libs_test[]m4_ifval([$9],[],[ $8])])
+       $4],
+       [$5])])
+
+
+
+#------------------------------------------------------------------------------
+# CS_CHECK_BUILD(MESSAGE, CACHE-VAR, [PROGRAM], [FLAGS], [LANGUAGE],
+#                [ACTION-IF-BUILT], [ACTION-IF-NOT-BUILT], [IGNORE-CACHE],
+#                [OTHER-CFLAGS], [OTHER-LFLAGS], [OTHER-LIBS],
+#                [INHIBIT-OTHER-FLAGS], [ERROR-REGEX])
+#      Like CS_BUILD_IFELSE() but also prints "checking" and result messages,
+#      and optionally respects the cache.  Sets CACHE-VAR to "yes" upon
+#      success, else "no" upon failure.  Additionally, sets CACHE-VAR_cflags,
+#      CACHE-VAR_lflags, and CACHE-VAR_libs to the values which resulted in a
+#      successful build.  If IGNORE-CACHE is "yes", then the cache variables
+#      are ignored upon entry to this macro, however they are still set to
+#      appropriate values upon exit.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_CHECK_BUILD],
+    [AS_IF([test "$8" != yes],
+       [AC_CACHE_CHECK([$1], [$2],
+           [CS_BUILD_IFELSE([$3], [$4], [$5],
+               [$2=yes
+               $2_cflags=$cs_build_cflags
+               $2_lflags=$cs_build_lflags
+               $2_libs=$cs_build_libs],
+               [$2=no], [$9], [$10], [$11], [$12], [$13])])],
+       [AC_MSG_CHECKING([$1])
+           CS_BUILD_IFELSE([$3], [$4], [$5],
+               [$2=yes
+               $2_cflags=$cs_build_cflags
+               $2_lflags=$cs_build_lflags
+               $2_libs=$cs_build_libs],
+               [$2=no], [$9], [$10], [$11], [$12], [$13])
+           AC_MSG_RESULT([$$2])])
+    AS_IF([test $$2 = yes], [$6],
+       [$2_cflags=''
+       $2_lflags=''
+       $2_libs=''
+       $7])])
+
+
+
+#------------------------------------------------------------------------------
+# CS_CHECK_BUILD_FLAGS(MESSAGE, CACHE-VAR, FLAGS, [LANGUAGE],
+#                     [ACTION-IF-RECOGNIZED], [ACTION-IF-NOT-RECOGNIZED],
+#                     [OTHER-CFLAGS], [OTHER-LFLAGS], [OTHER-LIBS],
+#                     [ERROR-REGEX])
+#      Like CS_CHECK_BUILD(), but checks only if the compiler or linker
+#      recognizes a command-line option or options.  MESSAGE is the "checking"
+#      message.  CACHE-VAR is the shell cache variable which receives the flag
+#      or flags recognized by the compiler or linker.  FLAGS is a
+#      whitespace-delimited list of build tuples created with
+#      CS_CREATE_TUPLE().  Each tuple from FLAGS is attempted in order until
+#      one is found which is recognized by the compiler.  After that, no
+#      further flags are checked.  LANGUAGE is typically either C or C++ and
+#      specifies which compiler to use for the test.  If LANGUAGE is omitted,
+#      C is used.  If a command-line option is recognized, then CACHE-VAR is
+#      set to the composite value of $cs_build_cflags, $cs_build_lflags, and
+#      $cs_build_libs of the FLAGS element which succeeded (not including the
+#      "other" flags) and ACTION-IF-RECOGNIZED is invoked.  If no options are
+#      recognized, then CACHE-VAR is set to the empty string, and
+#      ACTION-IF-NOT-RECOGNIZED is invoked. As a convenience, in case
+#      comparing CACHE-VAR against the empty string to test for failure is
+#      undesirable, a second variable named CACHE-VAR_ok is set to the literal
+#      "no" upon failure, and to the same value as CACHE-VAR upon success.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_CHECK_BUILD_FLAGS],
+    [AC_CACHE_CHECK([$1], [$2_ok],
+       [CS_BUILD_IFELSE([], [$3], [$4],
+           [$2=CS_TRIM([$cs_build_cflags $cs_build_lflags $cs_build_libs])
+           $2_ok="$$2"],
+           [$2=''
+           $2_ok=no], [$7], [$8], [$9], [Y], [$10])])
+    AS_IF([test "$$2_ok" != no], [$5], [$6])])
diff --git a/mk/autoconf/checkcommon.m4 b/mk/autoconf/checkcommon.m4
new file mode 100644 (file)
index 0000000..da1fb8c
--- /dev/null
@@ -0,0 +1,111 @@
+#==============================================================================
+# Copyright (C)2003-2006 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#==============================================================================
+AC_PREREQ([2.56])
+
+#------------------------------------------------------------------------------
+# CS_CHECK_COMMON_TOOLS_LINK
+#      Checks for common tools related to linking.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_CHECK_COMMON_TOOLS_LINK],
+    [
+    # The default RANLIB in Jambase is wrong on some platforms, and is also
+    # unsuitable during cross-compilation, so we set the value unconditionally
+    # (sixth argument of CS_EMIT_BUILD_PROPERTY).
+    AC_PROG_RANLIB
+    CS_EMIT_BUILD_PROPERTY([RANLIB], [$RANLIB], [], [], [], [Y])
+    
+    CS_CHECK_TOOLS([DLLTOOL], [dlltool])
+    CS_EMIT_BUILD_PROPERTY([CMD.DLLTOOL], [$DLLTOOL])
+    
+    CS_CHECK_TOOLS([DLLWRAP], [dllwrap])
+    CS_EMIT_BUILD_PROPERTY([CMD.DLLWRAP], [$DLLWRAP])
+    
+    CS_CHECK_TOOLS([WINDRES], [windres])
+    CS_EMIT_BUILD_PROPERTY([CMD.WINDRES], [$WINDRES])
+    
+    CS_CHECK_TOOLS([STRINGS], [strings])
+    CS_EMIT_BUILD_PROPERTY([CMD.STRINGS], [$STRINGS])
+
+    CS_CHECK_TOOLS([OBJCOPY], [objcopy])
+    CS_EMIT_BUILD_PROPERTY([CMD.OBJCOPY], [$OBJCOPY])
+    
+    CS_CHECK_LIBTOOL
+    CS_EMIT_BUILD_PROPERTY([LIBTOOL], [$LIBTOOL])
+    CS_EMIT_BUILD_PROPERTY([APPLE_LIBTOOL], [$APPLE_LIBTOOL])
+    ])
+
+
+#------------------------------------------------------------------------------
+# CS_CHECK_COMMON_TOOLS_BASIC
+#      Checks for basic tools for building things.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_CHECK_COMMON_TOOLS_BASIC],
+    [CS_CHECK_MKDIR
+    CS_EMIT_BUILD_PROPERTY([CMD.MKDIR], [$MKDIR])
+    CS_EMIT_BUILD_PROPERTY([CMD.MKDIRS], [$MKDIRS])
+
+    CS_CHECK_PROGS([INSTALL], [install])
+    CS_EMIT_BUILD_PROPERTY([INSTALL], [$INSTALL])])
+
+
+#------------------------------------------------------------------------------
+# CS_CHECK_COMMON_TOOLS_DOC_TEXINFO
+#      Checks for tools to generate documentation from texinfo files.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_CHECK_COMMON_TOOLS_DOC_TEXINFO],
+    [CS_CHECK_PROGS([TEXI2DVI], [texi2dvi])
+    CS_EMIT_BUILD_PROPERTY([CMD.TEXI2DVI], [$TEXI2DVI])
+
+    CS_CHECK_PROGS([TEXI2PDF], [texi2pdf])
+    CS_EMIT_BUILD_PROPERTY([CMD.TEXI2PDF], [$TEXI2PDF])
+
+    CS_CHECK_PROGS([DVIPS], [dvips])
+    CS_EMIT_BUILD_PROPERTY([CMD.DVIPS], [$DVIPS])
+
+    CS_CHECK_PROGS([DVIPDF], [dvipdf])
+    CS_EMIT_BUILD_PROPERTY([CMD.DVIPDF], [$DVIPDF])
+
+    CS_CHECK_PROGS([MAKEINFO], [makeinfo])
+    CS_EMIT_BUILD_PROPERTY([CMD.MAKEINFO], [$MAKEINFO])])
+
+
+#------------------------------------------------------------------------------
+# CS_CHECK_COMMON_TOOLS_DOC_DOXYGEN
+#      Checks for tools to generate source documentation via doxygen.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_CHECK_COMMON_TOOLS_DOC_DOXYGEN],
+    [CS_CHECK_PROGS([DOXYGEN], [doxygen])
+    CS_EMIT_BUILD_PROPERTY([CMD.DOXYGEN], [$DOXYGEN])
+
+    CS_CHECK_TOOLS([DOT], [dot])
+    CS_EMIT_BUILD_PROPERTY([CMD.DOT], [$DOT])])
+
+
+#------------------------------------------------------------------------------
+# CS_CHECK_COMMON_LIBS
+#       Check for typical required libraries (libm, libmx, libdl, libnsl).
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_CHECK_COMMON_LIBS],
+    [AC_LANG_PUSH([C])
+    AC_CHECK_LIB([m], [pow], [cs_cv_libm_libs=-lm], [cs_cv_libm_libs=])
+    AC_CHECK_LIB([m], [cosf], [cs_cv_libm_libs=-lm])
+    AC_CHECK_LIB([mx], [cosf])
+    AC_CHECK_LIB([dl], [dlopen], [cs_cv_libdl_libs=-ldl], [cs_cv_libdl_libs=])
+    AC_CHECK_LIB([nsl], [gethostbyname])
+    AC_LANG_POP([C])])
diff --git a/mk/autoconf/checkcppunit.m4 b/mk/autoconf/checkcppunit.m4
new file mode 100644 (file)
index 0000000..a773c49
--- /dev/null
@@ -0,0 +1,51 @@
+# checkcppunit.m4                                              -*- Autoconf -*-
+#==============================================================================
+# Copyright (C)2005 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#==============================================================================
+AC_PREREQ([2.56])
+
+#------------------------------------------------------------------------------
+# CS_CHECK_CPPUNIT([EMITTER])
+#      Check if CppUnit (http://cppunit.sourceforge.net/), the unit-testing
+#      framework is available. The shell variable cs_cv_libcppunit is set to
+#      "yes" if CppUnit is discovered, else "no".  If available, then the
+#      variables cs_cv_libcppunit_cflags, cs_cv_libcppunit_lflags, and
+#      cs_cv_libcppunit_libs are set. If EMITTER is provided, then
+#      CS_EMIT_BUILD_RESULT() is invoked with EMITTER in order to record the
+#      results in an output file. As a convenience, if EMITTER is the literal
+#      value "emit" or "yes", then CS_EMIT_BUILD_RESULT()'s default emitter
+#      will be used.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_CHECK_CPPUNIT],
+    [CS_CHECK_LIB_WITH([cppunit],
+       [AC_LANG_PROGRAM([[#include <cppunit/ui/text/TestRunner.h>]],
+           [CppUnit::TextUi::TestRunner r; r.run();])],
+       [], [C++])
+       
+    AS_IF([test $cs_cv_libcppunit = yes],
+       [CS_CHECK_BUILD([if cppunit is sufficiently recent],
+           [cs_cv_libcppunit_recent],
+           [AC_LANG_PROGRAM(
+               [[#include <cppunit/BriefTestProgressListener.h>]], 
+               [CppUnit::BriefTestProgressListener b; b.startTest(0);])],
+           [], [C++],
+           [CS_EMIT_BUILD_RESULT([cs_cv_libcppunit], [CPPUNIT],
+               CS_EMITTER_OPTIONAL([$1]))], [], [],
+           [$cs_cv_libcppunit_cflags],
+           [$cs_cv_libcppunit_lflags],
+           [$cs_cv_libcppunit_libs])])])
diff --git a/mk/autoconf/checkcswin32libs.m4 b/mk/autoconf/checkcswin32libs.m4
new file mode 100644 (file)
index 0000000..0a16fef
--- /dev/null
@@ -0,0 +1,59 @@
+# checkcswin32libs.m4                                         -*- Autoconf -*-
+#==============================================================================
+# Copyright (C)2005 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#==============================================================================
+AC_PREREQ([2.56])
+
+#------------------------------------------------------------------------------
+# CS_CHECK_CSWIN32LIBS
+#      Check for the cs-win32libs package. It is a convenience archive made 
+#      available to Crystal Space clients targetting Windows.  It contains 
+#      common libraries, headers, and tools (such as zlib, libjpeg, cal3d, 
+#      etc.) usable by MSVC, Mingw/MSYS, and Cygwin users as well as in cross-
+#      compile environments.  It saves users the bother of having to install 
+#      these packages manually one at a time.
+#      The package provides a script 'cslibs-config' which can report the 
+#      compiler and linker flags necessary to utilize the contained 
+#      third-party libraries. If this script is found, the reported flags are
+#      added to the global CFLAGS, CPPFLAGS and LDFLAGS variables.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_CHECK_CSWIN32LIBS],
+    [AC_REQUIRE([AC_CANONICAL_HOST])
+    case $host_os in
+    mingw*|cygwin*)
+        CS_CHECK_TOOLS([CSLIBS_CONFIG], [cslibs-config])
+        AS_IF([test $ac_compiler_gnu = yes],
+           [cs_cv_cslibs_compiler="--compiler gcc-`$CXX -dumpversion | 
+             sed 's/\([[0-9]]\?\)\.\([[0-9]]\?\)\.[[0-9]]\?/\1.\2/'`"])
+        AC_CACHE_CHECK([for cslibs package], [cs_cv_cslibs],
+           [AS_IF([test -n "$CSLIBS_CONFIG"],
+              [cs_cv_cslibs=yes
+              cs_cv_cslibs_cflags=CS_RUN_PATH_NORMALIZE(
+                   [$CSLIBS_CONFIG --cflags $cs_cv_cslibs_compiler])
+              cs_cv_cslibs_lflags=CS_RUN_PATH_NORMALIZE(
+                   [$CSLIBS_CONFIG --lflags $cs_cv_cslibs_compiler])
+              cs_cv_cslibs_binpath=CS_RUN_PATH_NORMALIZE(
+                   [$CSLIBS_CONFIG --binpath $cs_cv_cslibs_compiler])],
+              [cs_cv_cslibs=no])])
+        AS_IF([test $cs_cv_cslibs = yes],
+           [CFLAGS="$CFLAGS $cs_cv_cslibs_cflags"
+           CPPFLAGS="$CPPFLAGS $cs_cv_cslibs_cflags"
+           LDFLAGS="$LDFLAGS $cs_cv_cslibs_lflags"
+           PATH="$cs_cv_cslibs_binpath$PATH_SEPARATOR$PATH"])
+        ;;
+    esac])
diff --git a/mk/autoconf/checklib.m4 b/mk/autoconf/checklib.m4
new file mode 100644 (file)
index 0000000..119c4e8
--- /dev/null
@@ -0,0 +1,312 @@
+# checklib.m4                                                  -*- Autoconf -*-
+#==============================================================================
+# Copyright (C)2003-2005 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#==============================================================================
+AC_PREREQ([2.56])
+
+#------------------------------------------------------------------------------
+# cs_lib_paths_default
+#      Whitespace delimited list of directory tuples in which to search, by
+#      default, for external libraries.  Each list item can specify an
+#      include|library directory tuple (for example, "/usr/include|/usr/lib"),
+#      or a single directory (for example, "/usr").  If the second form is
+#      used, then "include" and "lib" subdirectories of the directory are
+#      searched.  If the library resources are not found, then the directory
+#      itself is searched.  Thus, "/proj" is shorthand for
+#      "/proj/include|/proj/lib /proj|/proj".
+#
+# Present Cases:
+#      /usr/local -- Not all compilers search here by default, so we specify
+#              it manually.
+#      /sw -- Fink, the MacOS/X manager of Unix packages, installs here by
+#              default.
+#      /opt/local -- DarwinPorts installs here by default.
+#------------------------------------------------------------------------------
+m4_define([cs_lib_paths_default],
+    [/usr/local/include|/usr/local/lib \
+    /sw/include|/sw/lib \
+    /opt/local/include|/opt/local/lib \
+    /opt/include|/opt/lib])
+
+
+
+#------------------------------------------------------------------------------
+# cs_pkg_paths_default
+#      Comma delimited list of additional directories in which the
+#      `pkg-config' command should search for its `.pc' files.
+#
+# Present Cases:
+#      /usr/local/lib/pkgconfig -- Although a common location for .pc files
+#              installed by "make install", many `pkg-config' commands neglect
+#              to search here automatically.
+#      /sw/lib/pkgconfig -- Fink, the MacOS/X manager of Unix packages,
+#              installs .pc files here by default.
+#      /opt/local/lib/pkgconfig -- DarwinPorts installs .pc files here by
+#              default.
+#------------------------------------------------------------------------------
+m4_define([cs_pkg_paths_default],
+    [/usr/local/lib/pkgconfig,
+    /sw/lib/pkgconfig,
+    /opt/local/lib/pkgconfig,
+    /opt/lib/pkgconfig])
+
+
+
+#------------------------------------------------------------------------------
+# CS_CHECK_LIB_WITH(LIBRARY, PROGRAM, [SEARCH-LIST], [LANGUAGE],
+#                   [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], [OTHER-CFLAGS],
+#                   [OTHER-LFLAGS], [OTHER-LIBS], [ALIASES])
+#      Very roughly similar in concept to AC_CHECK_LIB(), but allows caller to
+#      to provide list of directories in which to search for LIBRARY; allows
+#      user to override library location via --with-LIBRARY=dir; and consults
+#      `pkg-config' (if present) and `LIBRARY-config' (if present, i.e.
+#      `sdl-config') in order to obtain compiler and linker flags.  LIBRARY is
+#      the name of the library or MacOS/X framework which is to be located
+#      (for example, "readline" for `libreadline.a' or `readline.framework').
+#      PROGRAM, which is typically composed with AC_LANG_PROGRAM(), is a
+#      program which references at least one function or symbol in LIBRARY.
+#      SEARCH-LIST is a whitespace-delimited list of paths in which to search
+#      for the library and its header files, in addition to those searched by
+#      the compiler and linker by default, and those referenced by the
+#      cs_lib_paths_default macro.  Each list item can specify an
+#      `include|library' directory tuple (for example,
+#      "/usr/include|/usr/lib"), or a single directory (for example, "/usr").
+#      If the second form is used, then "include" and "lib" subdirectories of
+#      the directory are searched.  If the library resources are not found,
+#      then the directory itself is searched.  Thus, "/proj" is shorthand for
+#      "/proj/include|/proj/lib /proj|/proj".  Items in the search list can
+#      include wildcards.  SEARCH-LIST can be overridden by the user with the
+#      --with-LIBRARY=dir option, in which case only "dir/include|dir/lib" and
+#      "dir|dir" are searched.  If SEARCH-LIST is omitted and the user did not
+#      override the search list via --with-LIBRARY=dir, then only the
+#      directories normally searched by the compiler and the directories
+#      mentioned via cs_lib_paths_default are searched.  LANGUAGE is typically
+#      either C or C++ and specifies which compiler to use for the test.  If
+#      LANGUAGE is omitted, C is used.  OTHER-CFLAGS, OTHER-LFLAGS, and
+#      OTHER-LIBS can specify additional compiler flags, linker flags, and
+#      libraries needed to successfully link with LIBRARY.  The optional
+#      ALIASES is a comma-delimited list of library names for which to search
+#      in case LIBRARY is not located (for example "[sdl1.2, sdl12]" for
+#      libsdl1.2.a, sdl1.2.framework, libsdl12.a, and sdl12.framework).  If
+#      the library or one of its aliases is found and can be successfully
+#      linked into a program, then the shell cache variable cs_cv_libLIBRARY
+#      is set to "yes"; cs_cv_libLIBRARY_cflags, cs_cv_libLIBRARY_lflags, and
+#      cs_cv_libLIBRARY_libs are set, respectively, to the compiler flags
+#      (including OTHER-CFLAGS), linker flags (including OTHER-LFLAGS), and
+#      library references (including OTHER-LIBS) which resulted in a
+#      successful build; and ACTION-IF-FOUND is invoked.  If the library was
+#      not found or was unlinkable, or if the user disabled the library via
+#      --without-LIBRARY, then cs_cv_libLIBRARY is set to "no" and
+#      ACTION-IF-NOT-FOUND is invoked.  Note that the exported shell variable
+#      names are always composed from LIBRARY regardless of whether the test
+#      succeeded because the primary library was discovered or one of the
+#      aliases.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_CHECK_LIB_WITH],
+    [AC_ARG_WITH([$1], [AC_HELP_STRING([--with-$1=dir],
+       [specify location of lib$1 if not detected automatically; searches
+       dir/include, dir/lib, and dir])])
+
+    # Backward compatibility: Recognize --with-lib$1 as alias for --with-$1.
+    AS_IF([test -n "$with_lib$1" && test -z "$with_$1"],
+       [with_$1="$with_lib$1"])
+
+    AS_IF([test -z "$with_$1"], [with_$1=yes])
+    AS_IF([test "$with_$1" != no],
+       [# If --with-$1 value is same as cached value, then assume other
+        # cached values are also valid; otherwise, ignore all cached values.
+       AS_IF([test "$with_$1" != "$cs_cv_with_$1"],
+           [cs_ignore_cache=yes], [cs_ignore_cache=no])
+
+       cs_check_lib_flags=''
+       AS_IF([test $with_$1 = yes],
+           [m4_foreach([cs_check_lib_alias], [$1, $10],
+               [_CS_CHECK_LIB_PKG_CONFIG_FLAGS([cs_check_lib_flags],
+                   cs_check_lib_alias)
+               _CS_CHECK_LIB_CONFIG_FLAGS([cs_check_lib_flags],
+                   cs_check_lib_alias)
+               ])])
+
+       AS_IF([test $with_$1 != yes],
+           [cs_check_lib_paths=$with_$1],
+           [cs_check_lib_paths="| cs_lib_paths_default $3"])
+       m4_foreach([cs_check_lib_alias], [$1, $10],
+           [_CS_CHECK_LIB_CREATE_FLAGS([cs_check_lib_flags],
+               cs_check_lib_alias, [$cs_check_lib_paths])
+           ])
+
+       CS_CHECK_BUILD([for lib$1], [cs_cv_lib$1], [$2], [$cs_check_lib_flags],
+           [$4], [], [], [$cs_ignore_cache], [$7], [$8], [$9])],
+       [cs_cv_lib$1=no])
+
+    cs_cv_with_$1="$with_$1"
+    AS_IF([test "$cs_cv_lib$1" = yes], [$5], [$6])])
+
+
+
+#------------------------------------------------------------------------------
+# CS_CHECK_PKG_CONFIG
+#      Check if the `pkg-config' command is available and reasonably recent.
+#      This program acts as a central repository of build flags for various
+#      packages.  For example, to determine the compiler flags for FreeType2
+#      use, "pkg-config --cflags freetype2"; and "pkg-config --libs freetype2"
+#      to determine the linker flags. If `pkg-config' is found and is
+#      sufficiently recent, PKG_CONFIG is set and AC_SUBST() invoked.
+#------------------------------------------------------------------------------
+m4_define([CS_PKG_CONFIG_MIN], [0.9.0])
+AC_DEFUN([CS_CHECK_PKG_CONFIG],
+    [AS_IF([test "$cs_prog_pkg_config_checked" != yes],
+       [CS_CHECK_TOOLS([PKG_CONFIG], [pkg-config])
+       _CS_CHECK_PKG_CONFIG_PREPARE_PATH
+       cs_prog_pkg_config_checked=yes])
+    AS_IF([test -z "$cs_cv_prog_pkg_config_ok"],
+       [AS_IF([test -n "$PKG_CONFIG"],
+           [AS_IF([$PKG_CONFIG --atleast-pkgconfig-version=CS_PKG_CONFIG_MIN],
+               [cs_cv_prog_pkg_config_ok=yes],
+               [cs_cv_prog_pkg_config_ok=no])],
+           [cs_cv_prog_pkg_config_ok=no])])])
+
+AC_DEFUN([_CS_CHECK_PKG_CONFIG_PREPARE_PATH],
+    [PKG_CONFIG_PATH="m4_foreach([cs_pkg_path], [cs_pkg_paths_default],
+       [cs_pkg_path$PATH_SEPARATOR])$PKG_CONFIG_PATH"
+    export PKG_CONFIG_PATH])
+
+
+
+#------------------------------------------------------------------------------
+# _CS_CHECK_LIB_PKG_CONFIG_FLAGS(VARIABLE, LIBRARY)
+#      Helper macro for CS_CHECK_LIB_WITH().  Checks if `pkg-config' knows
+#      about LIBRARY and, if so, appends a build tuple consisting of the
+#      compiler and linker flags reported by `pkg-config' to the list of
+#      tuples stored in the shell variable VARIABLE.
+#------------------------------------------------------------------------------
+AC_DEFUN([_CS_CHECK_LIB_PKG_CONFIG_FLAGS],
+    [CS_CHECK_PKG_CONFIG
+    AS_IF([test $cs_cv_prog_pkg_config_ok = yes],
+       [AC_CACHE_CHECK([if $PKG_CONFIG recognizes $2], [_CS_CLPCF_CVAR([$2])],
+           [AS_IF([$PKG_CONFIG --exists $2],
+               [_CS_CLPCF_CVAR([$2])=yes], [_CS_CLPCF_CVAR([$2])=no])])
+       AS_IF([test $_CS_CLPCF_CVAR([$2]) = yes],
+           [_CS_CHECK_LIB_CONFIG_PROG_FLAGS([$1], [pkg_config_$2],
+               [$PKG_CONFIG], [$2])])])])
+
+AC_DEFUN([_CS_CLPCF_CVAR], [AS_TR_SH([cs_cv_prog_pkg_config_$1])])
+
+
+
+#------------------------------------------------------------------------------
+# _CS_CHECK_LIB_CONFIG_FLAGS(VARIABLE, LIBRARY)
+#      Helper macro for CS_CHECK_LIB_WITH().  Checks if `LIBRARY-config'
+#      (i.e. `sdl-config') exists and, if so, appends a build tuple consisting
+#      of the compiler and linker flags reported by `LIBRARY-config' to the
+#      list of tuples stored in the shell variable VARIABLE.
+#------------------------------------------------------------------------------
+AC_DEFUN([_CS_CHECK_LIB_CONFIG_FLAGS],
+    [CS_CHECK_TOOLS(_CS_CLCF_SHVAR([$2]), [$2-config])
+    AS_IF([test -n "$_CS_CLCF_SHVAR([$2])"],
+       [AS_IF([test -z "$_CS_CLCF_CVAR([$2])"],
+           [AS_IF([$_CS_CLCF_SHVAR([$2]) --cflags --libs >/dev/null 2>&1],
+               [_CS_CLCF_CVAR([$2])=yes], [_CS_CLCF_CVAR([$2])=no])])
+       AS_IF([test $_CS_CLCF_CVAR([$2]) = yes],
+           [_CS_CHECK_LIB_CONFIG_PROG_FLAGS([$1], [config_$2],
+               [$_CS_CLCF_SHVAR([$2])])])])])
+
+AC_DEFUN([_CS_CLCF_CVAR], [AS_TR_SH([cs_cv_prog_config_$1_ok])])
+AC_DEFUN([_CS_CLCF_SHVAR], [m4_toupper(AS_TR_SH([CONFIG_$1]))])
+
+
+
+#------------------------------------------------------------------------------
+# _CS_CHECK_LIB_CONFIG_PROG_FLAGS(VARIABLE, TAG, CONFIG-PROGRAM, [ARGS])
+#      Helper macro for _CS_CHECK_LIB_PKG_CONFIG_FLAGS() and
+#      _CS_CHECK_LIB_CONFIG_FLAGS(). CONFIG-PROGRAM is a command which
+#      responds to the --cflags and --libs options and returns suitable
+#      compiler and linker flags for some package. ARGS, if supplied, is
+#      passed to CONFIG-PROGRAM after the --cflags or --libs argument. The
+#      results of the --cflags and --libs options are packed into a build
+#      tuple and appended to the list of tuples stored in the shell variable
+#      VARIABLE. TAG is used to compose the name of the cache variable. A good
+#      choice for TAG is some unique combination of the library name and
+#      configuration program.
+#------------------------------------------------------------------------------
+AC_DEFUN([_CS_CHECK_LIB_CONFIG_PROG_FLAGS],
+    [AS_IF([test -z "$_CS_CLCPF_CVAR([$2])"],
+       [cs_check_lib_cflag=CS_RUN_PATH_NORMALIZE([$3 --cflags $4])
+       cs_check_lib_lflag=''
+       cs_check_lib_libs=CS_RUN_PATH_NORMALIZE([$3 --libs $4])
+       _CS_CLCPF_CVAR([$2])=CS_CREATE_TUPLE(
+           [$cs_check_lib_cflag],
+           [$cs_check_lib_lflag],
+           [$cs_check_lib_libs])])
+    $1="$$1 $_CS_CLCPF_CVAR([$2])"])
+
+AC_DEFUN([_CS_CLCPF_CVAR], [AS_TR_SH([cs_cv_prog_$1_flags])])
+
+
+
+#------------------------------------------------------------------------------
+# _CS_CHECK_LIB_CREATE_FLAGS(VARIABLE, LIBRARY, PATHS)
+#      Helper macro for CS_CHECK_LIB_WITH().  Constructs a list of build
+#      tuples suitable for CS_CHECK_BUILD() and appends the tuple list to the
+#      shell variable VARIABLE.  LIBRARY and PATHS have the same meanings as
+#      the like-named arguments of CS_CHECK_LIB_WITH().
+#------------------------------------------------------------------------------
+AC_DEFUN([_CS_CHECK_LIB_CREATE_FLAGS],
+    [for cs_lib_item in $3
+    do
+       case $cs_lib_item in
+           *\|*) CS_SPLIT(
+                   [$cs_lib_item], [cs_check_incdir,cs_check_libdir], [|])
+               _CS_CHECK_LIB_CREATE_FLAG([$1],
+                   [$cs_check_incdir], [$cs_check_libdir], [$2])
+               ;;
+           *)  _CS_CHECK_LIB_CREATE_FLAG([$1],
+                   [$cs_lib_item/include], [$cs_lib_item/lib], [$2])
+               _CS_CHECK_LIB_CREATE_FLAG(
+                   [$1], [$cs_lib_item], [$cs_lib_item], [$2])
+               ;;
+       esac
+    done])
+
+
+
+#------------------------------------------------------------------------------
+# _CS_CHECK_LIB_CREATE_FLAG(VARIABLE, HEADER-DIR, LIBRARY-DIR, LIBRARY)
+#      Helper macro for _CS_CHECK_LIB_CREATE_FLAGS().  Constructs build tuples
+#      suitable for CS_CHECK_BUILD() for given header and library directories,
+#      and appends the tuples to the shell variable VARIABLE. Synthesizes
+#      tuples which check for LIBRARY as a MacOS/X framework, and a standard
+#      link library.
+#------------------------------------------------------------------------------
+AC_DEFUN([_CS_CHECK_LIB_CREATE_FLAG],
+   [AS_IF([test -n "$2"], [cs_check_lib_cflag="-I$2"], [cs_check_lib_cflag=''])
+    AS_IF([test -n "$3"], [cs_check_lib_lflag="-L$3"], [cs_check_lib_lflag=''])
+    AS_IF([test -n "$4"],
+       [cs_check_lib_libs="-l$4"
+       cs_check_lib_framework="-framework $4"],
+       [cs_check_lib_libs=''
+       cs_check_lib_framework=''])
+    $1="$$1
+       CS_CREATE_TUPLE(
+           [$cs_check_lib_cflag],
+           [$cs_check_lib_lflag],
+           [$cs_check_lib_framework])
+       CS_CREATE_TUPLE(
+           [$cs_check_lib_cflag],
+           [$cs_check_lib_lflag],
+           [$cs_check_lib_libs])"])
diff --git a/mk/autoconf/checklibtool.m4 b/mk/autoconf/checklibtool.m4
new file mode 100644 (file)
index 0000000..0144283
--- /dev/null
@@ -0,0 +1,68 @@
+# checklibtool.m4                                              -*- Autoconf -*-
+#==============================================================================
+# Copyright (C)2004 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#==============================================================================
+AC_PREREQ([2.56])
+
+#------------------------------------------------------------------------------
+# CS_CHECK_LIBTOOL
+#      Find and identify the various implementations of libtool.  In
+#      particular, this macro is aware of GNU libtool and Apple's libtool
+#      (which serves a completely different purpose).  On MacOS/X, GNU libtool
+#      is typically named glibtool, however a user might also use Fink to
+#      install the unadorned libtool; and the Fink-installed version might
+#      shadow Apple's own libtool if it appears in the PATH before the Apple
+#      tool. This macro jumps through the necessary hoops to distinguish and
+#      locate the various implementations. Sets the shell variable LIBTOOL to
+#      the located GNU libtool (if any), and APPLE_LIBTOOL to the located
+#      Apple libtool. Invokes AC_SUBST() for LIBTOOL and APPLE_LIBTOOL.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_CHECK_LIBTOOL],
+[# GNU: Search for libtool before glibtool since Fink version is likely newer.
+m4_define([cs_lt_path_gnu],
+    [/sw/bin$PATH_SEPARATOR/usr/local/bin$PATH_SEPARATOR$PATH])
+AS_IF([test -z "$LIBTOOL"],
+    [CS_CHECK_TOOLS([LIBTOOL_TEST], [libtool glibtool gnulibtool], [],
+       [cs_lt_path_gnu])
+    AS_IF([test -n "$LIBTOOL_TEST"],
+       [CS_PATH_PROG([LIBTOOL_PATH], [$LIBTOOL_TEST], [], [cs_lt_path_gnu])
+       CS_LIBTOOL_CLASSIFY([$LIBTOOL_PATH],
+           [LIBTOOL="$LIBTOOL_PATH"],
+           [AS_IF([test -z "$APPLE_LIBTOOL"], [APPLE_LIBTOOL="$LIBTOOL_PATH"])
+           CS_CHECK_TOOLS([LIBTOOL], [glibtool gnulibtool])])])])
+AC_SUBST([LIBTOOL])
+
+# Apple: Ensure that Apple libtool will be found before GNU libtool from Fink.
+m4_define([cs_lt_path_apple],[/bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH])
+AS_IF([test -z "$APPLE_LIBTOOL"],
+    [CS_PATH_PROG([CS_LT_APPLE], [libtool], [], [cs_lt_path_apple])
+    CS_LIBTOOL_CLASSIFY([$CS_LT_APPLE], [],
+       [APPLE_LIBTOOL="$CS_LT_APPLE"])])
+AC_SUBST([APPLE_LIBTOOL])])
+
+AC_DEFUN([CS_LIBTOOL_CLASSIFY],
+    [AS_IF([test -n "$1"],
+       [AC_MSG_CHECKING([classification of $1])
+       CS_LIBTOOL_GNU_IFELSE([$1],
+           [AC_MSG_RESULT([gnu])
+           $2],
+           [AC_MSG_RESULT([apple])
+           $3])])])
+
+AC_DEFUN([CS_LIBTOOL_GNU_IFELSE],
+    [AS_IF([AC_RUN_LOG([$1 --version 1>&2])], [$2], [$3])])
diff --git a/mk/autoconf/checkopengl.m4 b/mk/autoconf/checkopengl.m4
new file mode 100644 (file)
index 0000000..05c965d
--- /dev/null
@@ -0,0 +1,235 @@
+#==============================================================================
+# Copyright (C)2003-2006 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#==============================================================================
+AC_PREREQ([2.56])
+
+#------------------------------------------------------------------------------
+# CS_CHECK_OPENGL
+#      Check for OpenGL.
+#
+# IMPLEMENTATION NOTES
+#
+# Some Mesa installations require pthread, so pthread flags are employed if
+# available.
+#
+# The check for opengl32 needs to precede other checks because Cygwin users
+# often have Mesa installed, and Mesa's OpenGL library is compiled without the
+# __stdcall flags which results in link errors, whereas Microsoft's native
+# opengl32 works fine.  Conversely, some Unix implementations have Wine
+# installed (Windows emulation layer) which includes an opengl32.so library.
+# We need to avoid detection of this library on Unix since it would cause an
+# undesirable dependence upon Wine.
+#
+# Many OpenGL libraries on Unix already contain GLX, so there is no separate
+# GLX library, thus we first check for GLX using the discovered OpenGL library
+# before attempting to locate a separate GLX-specific library.  
+#
+# On MacOS/X, some users have XFree86 installed which creates a link from
+# /usr/include/GL to /usr/X11R6/include/GL.  We want to ignore this directory
+# and instead check for Apple's OpenGL.framework, if we are not cross-building
+# for Darwin.  We accomplish this by placing the OpenGL.framework test ahead of
+# the other tests.
+#
+# At least one user (Jorrit) has a strange installation in which inclusion of
+# <windows.h> fails if an int32 is not present, thus we must take this into
+# account.
+#------------------------------------------------------------------------------
+m4_define([cs_define_int32],
+    [[#if !HAVE_TYPE_INT32
+    typedef long int32;
+    #endif
+    ]])
+
+# CS_GL_INCLUDE(CPP-MACRO,FALLBACK,HEADER)
+AC_DEFUN([CS_GL_INCLUDE],
+    [[#if HAVE_WINDOWS_H
+    #if !HAVE_TYPE_INT32
+    typedef long int32;
+    #endif
+    #include <windows.h>
+    #endif
+    #ifndef CS_HEADER_GLOBAL
+    #define CS_HEADER_GLOBAL(X,Y) CS_HEADER_GLOBAL_COMPOSE(X,Y)
+    #define CS_HEADER_GLOBAL_COMPOSE(X,Y) <X/Y>
+    #endif
+    #ifdef $1
+    #include CS_HEADER_GLOBAL($1,$3)
+    #else
+    #include <$2/$3>
+    #endif]])
+
+AC_DEFUN([CS_CHECK_OPENGL],
+    [AC_REQUIRE([CS_CHECK_HOST])
+    AC_REQUIRE([CS_CHECK_COMMON_LIBS])
+    AC_REQUIRE([CS_CHECK_PTHREAD])
+    AC_REQUIRE([AC_PATH_X])
+    AC_REQUIRE([AC_PATH_XTRA])
+    AC_CHECK_TYPE([int32], [AC_DEFINE([HAVE_TYPE_INT32], [], 
+       [Whether the int32 type is available])], [])
+    AC_CHECK_HEADERS([windows.h], [], [], [cs_define_int32])
+    
+    # Apply plaform-specific flags if necessary.
+    cs_gl_plat_cflags=''
+    cs_gl_plat_lflags=''
+    cs_gl_plat_libs=''
+    AS_IF([test -n "$cs_cv_libm_cflags$cs_cv_libm_lflags$cs_cv_libm_libs"],
+       [cs_gl_plat_cflags="$cs_cv_libm_cflags $cs_gl_plat_cflags"
+       cs_gl_plat_lflags="$cs_cv_libm_lflags $cs_gl_plat_lflags"
+       cs_gl_plat_libs="$cs_cv_libm_libs $cs_gl_plat_libs"])
+    AS_IF([test $cs_cv_sys_pthread = yes],
+       [cs_gl_plat_cflags="$cs_cv_sys_pthread_cflags $cs_gl_plat_cflags"
+       cs_gl_plat_lflags="$cs_cv_sys_pthread_lflags $cs_gl_plat_lflags"
+       cs_gl_plat_libs="$cs_cv_sys_pthread_libs $cs_gl_plat_libs"])
+    AS_IF([test "$no_x" != yes],
+       [cs_gl_plat_cflags="$X_CFLAGS $cs_gl_plat_cflags"
+       cs_gl_plat_lflags="$cs_gl_plat_lflags"
+       cs_gl_plat_libs="
+           $X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS $cs_gl_plat_libs"])
+
+    # Mesa requested?
+    AC_ARG_WITH([mesa], [AC_HELP_STRING([--with-mesa],
+           [use Mesa OpenGL library if available (default YES)])],
+           [], [with_mesa=yes])
+    
+    AS_IF([test $with_mesa != no],
+       [cs_mesa_gl=CS_CREATE_TUPLE([],[],[-lMesaGL])])
+    
+    # MacOS/X or Darwin?
+    AS_IF([test "x$cs_host_macosx" = "xyes"],
+       [cs_osx_gl=CS_CREATE_TUPLE([-DCS_OPENGL_PATH=OpenGL],[],[-framework OpenGL])])
+
+    # Windows?
+    AS_IF([test $cs_host_family = windows],
+       [cs_win32_gl=CS_CREATE_TUPLE([],[],[-lopengl32])])
+    
+    # Check for OpenGL.
+    CS_CHECK_BUILD([for OpenGL], [cs_cv_libgl],
+       [AC_LANG_PROGRAM([CS_GL_INCLUDE([CS_OPENGL_PATH],[GL],[gl.h])],[glEnd()])],
+       [$cs_win32_gl \
+       $cs_osx_gl \
+       CS_CREATE_TUPLE([],[],[-lGL]) \
+       CS_CREATE_TUPLE([],[],[-lgl]) \
+       $cs_mesa_gl], [],
+       [CS_EMIT_BUILD_RESULT([cs_cv_libgl], [GL])], [], [],
+       [$cs_gl_plat_cflags], [$cs_gl_plat_lflags], [$cs_gl_plat_libs])])
+
+
+#------------------------------------------------------------------------------
+# CS_CHECK_GLU
+#      Check for GLU.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_CHECK_GLU],
+    [AC_REQUIRE([CS_CHECK_OPENGL])
+    AS_IF([test $cs_cv_libgl = yes],
+        [AS_IF([test $with_mesa != no],
+           [cs_mesa_glu=CS_CREATE_TUPLE([],[],[-lMesaGLU])])
+       
+       # MacOS/X or Darwin?
+       AS_IF([test "x$cs_host_macosx" = "xyes"],
+           [cs_osx_glu=CS_CREATE_TUPLE([-DCS_GLU_PATH=OpenGL],[],[-framework OpenGL])])
+       
+       # Windows?
+       AS_IF([test $cs_host_family = windows],
+           [cs_win32_glu=CS_CREATE_TUPLE([],[],[-lglu32])])
+    
+       # Check for GLU.
+       CS_CHECK_BUILD([for GLU], [cs_cv_libglu],
+           [AC_LANG_PROGRAM(
+               [CS_GL_INCLUDE([CS_GLU_PATH],[GL],[glu.h])], [gluNewQuadric()])],
+           [$cs_osx_glu \
+           CS_CREATE_TUPLE() \
+           $cs_win32_glu \
+           CS_CREATE_TUPLE([],[],[-lGLU]) \
+           CS_CREATE_TUPLE([],[],[-lglu]) \
+           $cs_mesa_glu], [],
+           [CS_EMIT_BUILD_RESULT([cs_cv_libglu], [GLU])], [], [],
+           [$cs_cv_libgl_cflags], [$cs_cv_libgl_lflags], [$cs_cv_libgl_libs])])])
+
+
+#------------------------------------------------------------------------------
+# CS_CHECK_GLX
+#      Check for GLX.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_CHECK_GLX],
+    [AC_REQUIRE([CS_CHECK_OPENGL])
+    AS_IF([test $cs_cv_libgl = yes],
+        [AS_IF([test $with_mesa != no],
+            [cs_mesa_glx=CS_CREATE_TUPLE([],[],[-lMesaGLX])])
+       
+        # Check for GLX.
+       AS_IF([test "$no_x" != yes],
+           [CS_CHECK_BUILD([for GLX], [cs_cv_libglx],
+               [AC_LANG_PROGRAM([[#include <GL/glx.h>]], [glXWaitGL()])],
+               [CS_CREATE_TUPLE() \
+               CS_CREATE_TUPLE([],[],[-lGLX]) \
+               CS_CREATE_TUPLE([],[],[-lglx]) \
+               $cs_mesa_glx], [],
+               [CS_EMIT_BUILD_RESULT([cs_cv_libglx], [GLX])], [], [],
+               [$cs_cv_libgl_cflags], [$cs_cv_libgl_lflags], [$cs_cv_libgl_libs])])])])
+    
+
+#------------------------------------------------------------------------------
+# CS_CHECK_GLXEXT([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+#      Check for GLX extensions.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_CHECK_GLXEXT],
+    [AC_REQUIRE([CS_CHECK_GLX])
+    AS_IF([test x$cs_cv_libglx = "xyes"],
+       [# Check for GLX extensions.
+       CS_CHECK_BUILD([for GLX extensions], [cs_cv_libglx_extensions],
+           [AC_LANG_PROGRAM(
+               [[#define GLX_GLXEXT_PROTOTYPES
+               #include <GL/glx.h>]],
+               [glXGetProcAddressARB(0)])],
+           [CS_CREATE_TUPLE(
+               [$cs_cv_libglx_cflags],
+               [$cs_cv_libglx_lflags],
+               [$cs_cv_libglx_libs])],
+           [], [$1], [$2])])])
+
+
+
+#------------------------------------------------------------------------------
+# CS_CHECK_GLUT
+#      Check for GLUT.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_CHECK_GLUT],
+    [AC_REQUIRE([CS_CHECK_GLU])
+    AS_IF([test x$cs_cv_libglu = "xyes"],
+        [# MacOS/X or Darwin?
+       AS_IF([test "x$cs_host_macosx" = "xyes"],
+           [cs_osx_glut=CS_CREATE_TUPLE([-DCS_GLUT_PATH=GLUT],[],[-framework GLUT])])
+       
+       # Windows?
+       AS_IF([test $cs_host_family = windows],
+           [cs_win32_glut=CS_CREATE_TUPLE([],[],[-lglut32])])
+    
+       # Check for GLUT.
+       CS_CHECK_BUILD([for GLUT], [cs_cv_libglut],
+           [AC_LANG_PROGRAM(
+               [CS_GL_INCLUDE([CS_GLUT_PATH],[GL],[glut.h])], [glutSwapBuffers()])],
+           [$cs_osx_glut \
+           CS_CREATE_TUPLE() \
+           $cs_win32_glut \
+           CS_CREATE_TUPLE([],[],[-lGLUT]) \
+           CS_CREATE_TUPLE([],[],[-lglut])], [],
+           [CS_EMIT_BUILD_RESULT([cs_cv_libglut], [GLUT])], [], [],
+           [$cs_cv_libgl_cflags $cs_cv_libglu_cflags], 
+           [$cs_cv_libgl_lflags $cs_cv_libglu_lflags], 
+           [$cs_cv_libgl_libs   $cs_cv_libglu_libs])])])
+
diff --git a/mk/autoconf/checkpic.m4 b/mk/autoconf/checkpic.m4
new file mode 100644 (file)
index 0000000..d99bccb
--- /dev/null
@@ -0,0 +1,59 @@
+# checkpic.m4                                                  -*- Autoconf -*-
+#==============================================================================
+# Copyright (C)2005 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#==============================================================================
+AC_PREREQ([2.56])
+
+#------------------------------------------------------------------------------
+# CS_COMPILER_PIC([LANGUAGE], [CACHE-VAR], [ACTION-IF-FOUND],
+#                 [ACTION-IF-NOT-FOUND])
+#      Check if compiler can be instructed to produce
+#      position-independent-code (PIC).  This feature is required by some
+#      platforms when building plugin modules and shared libraries.  If
+#      LANGUAGE is not provided, then `C' is assumed (other options include
+#      `C++').  If CACHE-VAR is not provided, then it defaults to the name
+#      "cs_cv_prog_compiler_pic".  If a PIC-enabling option (such as `-fPIC')
+#      is discovered, then it is assigned to CACHE-VAR and ACTION-IF-FOUND is
+#      invoked; otherwise the empty string is assigned to CACHE-VAR and
+#      ACTION-IF-NOT-FOUND is invoked.
+#
+# IMPLEMENTATION NOTES
+#
+#      On some platforms (such as Windows), the -fPIC option is superfluous
+#      and emits a warning "-fPIC ignored for target (all code is position
+#      independent)", despite the fact that the compiler accepts the option
+#      and returns a success code. We want to re-interpret the warning as a
+#      failure in order to avoid unnecessary compiler diagnostics in case the
+#      client inserts the result of this check into CFLAGS, for instance. We
+#      do so by attempting to promote warnings to errors using the result of
+#      CS_COMPILER_ERRORS(). As an extra safe-guard, we also scan the compiler
+#      output for an appropriate diagnostic because some gcc warnings fail to
+#      promote to error status despite use of -Werror.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_COMPILER_PIC],
+    [CS_COMPILER_ERRORS([$1],
+       [m4_default([$2_werror],[cs_cv_prog_compiler_pic_werror])])
+    CS_CHECK_BUILD_FLAGS(
+       [how to enable m4_default([$1],[C]) PIC generation],
+       [m4_default([$2],[cs_cv_prog_compiler_pic])],
+       [CS_CREATE_TUPLE([-fPIC])], [$1], [$3], [$4],
+       [m4_default([$$2_werror],[$cs_cv_prog_compiler_pic_werror])], [], [],
+       [fPIC])])
+
+# Backward-compatiblity alias.
+AC_DEFUN([CS_CHECK_COMPILER_PIC], [CS_COMPILER_PIC([$1],[$2],[$3],[$4])])
diff --git a/mk/autoconf/checkprog.m4 b/mk/autoconf/checkprog.m4
new file mode 100644 (file)
index 0000000..cbf4975
--- /dev/null
@@ -0,0 +1,138 @@
+# checkprog.m4                                                 -*- Autoconf -*-
+#==============================================================================
+# Copyright (C)2004 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#==============================================================================
+AC_PREREQ([2.56])
+
+#------------------------------------------------------------------------------
+# cs_bin_paths_default
+#      Comma delimited list of additional directories in which tools and
+#      commands might be found.
+#
+# Present Cases:
+#      /usr/local/bin -- Although a common location for executables, it is
+#              now-and-then absent from the default PATH setting.
+#      /sw/bin -- Fink, the MacOS/X manager of Unix packages, installs
+#              executables here.
+#------------------------------------------------------------------------------
+m4_define([cs_bin_paths_default], [/usr/local/bin, /sw/bin])
+
+
+#------------------------------------------------------------------------------
+# CS_CHECK_PROG(VARIABLE, PROGRAM, VALUE-IF-FOUND, [VALUE-IF-NOT-FOUND],
+#              [PATH], [REJECT])
+#      Simple wrapper for AC_CHECK_PROG() which ensures that the search path
+#      is augmented by the directories mentioned in cs_bin_paths_default.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_CHECK_PROG],
+    [_CS_PROG_PATH_PREPARE
+    AC_CHECK_PROG([$1], [$2], [$3], [$4],
+       m4_ifval([$5], [_CS_PROG_CLIENT_PATH([$5])]), [$6])])
+
+
+#------------------------------------------------------------------------------
+# CS_CHECK_PROGS(VARIABLE, PROGRAMS, [VALUE-IF-NOT-FOUND], [PATH])
+#      Simple wrapper for AC_CHECK_PROGS() which ensures that the search path
+#      is augmented by the directories mentioned in cs_bin_paths_default.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_CHECK_PROGS],
+    [_CS_PROG_PATH_PREPARE
+    AC_CHECK_PROGS([$1], [$2], [$3],
+       m4_ifval([$4], [_CS_PROG_CLIENT_PATH([$4])]))])
+
+
+#------------------------------------------------------------------------------
+# CS_CHECK_TOOL(VARIABLE, TOOL, [VALUE-IF-NOT-FOUND], [PATH])
+#      Simple wrapper for AC_CHECK_TOOL() which ensures that the search path
+#      is augmented by the directories mentioned in cs_bin_paths_default.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_CHECK_TOOL],
+    [_CS_PROG_PATH_PREPARE
+    AC_CHECK_TOOL([$1], [$2], [$3],
+       m4_ifval([$4], [_CS_PROG_CLIENT_PATH([$4])]))])
+
+
+#------------------------------------------------------------------------------
+# CS_CHECK_TOOLS(VARIABLE, TOOLS, [VALUE-IF-NOT-FOUND], [PATH])
+#      Simple wrapper for AC_CHECK_TOOLS() which ensures that the search path
+#      is augmented by the directories mentioned in cs_bin_paths_default.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_CHECK_TOOLS],
+    [_CS_PROG_PATH_PREPARE
+    AC_CHECK_TOOLS([$1], [$2], [$3],
+       m4_ifval([$4], [_CS_PROG_CLIENT_PATH([$4])]))])
+
+
+#------------------------------------------------------------------------------
+# CS_PATH_PROG(VARIABLE, PROGRAM, [VALUE-IF-NOT-FOUND], [PATH])
+#      Simple wrapper for AC_PATH_PROG() which ensures that the search path
+#      is augmented by the directories mentioned in cs_bin_paths_default.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_PATH_PROG],
+    [_CS_PROG_PATH_PREPARE
+    AC_PATH_PROG([$1], [$2], [$3],
+       m4_ifval([$4], [_CS_PROG_CLIENT_PATH([$4])]))])
+
+
+#------------------------------------------------------------------------------
+# CS_PATH_PROGS(VARIABLE, PROGRAMS, [VALUE-IF-NOT-FOUND], [PATH])
+#      Simple wrapper for AC_PATH_PROGS() which ensures that the search path
+#      is augmented by the directories mentioned in cs_bin_paths_default.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_PATH_PROGS],
+    [_CS_PROG_PATH_PREPARE
+    AC_PATH_PROGS([$1], [$2], [$3],
+       m4_ifval([$4], [_CS_PROG_CLIENT_PATH([$4])]))])
+
+
+#------------------------------------------------------------------------------
+# CS_PATH_TOOL(VARIABLE, TOOL, [VALUE-IF-NOT-FOUND], [PATH])
+#      Simple wrapper for AC_PATH_TOOL() which ensures that the search path
+#      is augmented by the directories mentioned in cs_bin_paths_default.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_PATH_TOOL],
+    [_CS_PROG_PATH_PREPARE
+    AC_PATH_TOOL([$1], [$2], [$3],
+       m4_ifval([$4], [_CS_PROG_CLIENT_PATH([$4])]))])
+
+
+#------------------------------------------------------------------------------
+# _CS_PROG_PATH_PREPARE
+#      Ensure that the PATH environment variable mentions the set of
+#      directories listed in cs_bin_paths_default. These directories may not
+#      appear by default in the typical PATH, yet they might be common
+#      locations for tools and commands.
+#------------------------------------------------------------------------------
+AC_DEFUN([_CS_PROG_PATH_PREPARE],
+    [AS_REQUIRE([_AS_PATH_SEPARATOR_PREPARE])
+    AS_IF([test "$cs_prog_path_prepared" != yes],
+       [cs_prog_path_prepared=yes
+       PATH="$PATH[]m4_foreach([cs_bin_path], [cs_bin_paths_default],
+       [$PATH_SEPARATOR[]cs_bin_path])"
+       export PATH])])
+
+
+#------------------------------------------------------------------------------
+# _CS_PROG_CLIENT_PATH(CLIENT-PATH)
+#      Given a client-supplied replacement for PATH, augment the list by
+#      appending the locations mentioned in cs_bin_paths_default.
+#------------------------------------------------------------------------------
+AC_DEFUN([_CS_PROG_CLIENT_PATH],
+    [AS_REQUIRE([_AS_PATH_SEPARATOR_PREPARE])dnl
+    $1[]m4_foreach([cs_bin_path], [cs_bin_paths_default],
+       [$PATH_SEPARATOR[]cs_bin_path])])
diff --git a/mk/autoconf/checkpthread.m4 b/mk/autoconf/checkpthread.m4
new file mode 100644 (file)
index 0000000..e7aacf8
--- /dev/null
@@ -0,0 +1,102 @@
+# checkpthread.m4                                              -*- Autoconf -*-
+#==============================================================================
+# Copyright (C)2003-2005 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#==============================================================================
+AC_PREREQ([2.56])
+
+#------------------------------------------------------------------------------
+# CS_CHECK_PTHREAD([REJECT-MASK])
+#      Check for pthread.  Also check if the pthread implementation supports
+#      the recursive and timed mutex extensions. (Timed mutexes are needed for
+#      the NPTL: New Posix Thread Library on GNU/Linux if the mutex is going
+#      to be used with any of the timed condition-wait functions.) The shell
+#      variable cs_cv_sys_pthread is set to "yes" if pthread is available,
+#      else "no". If available, then the variables cs_cv_sys_pthread_cflags,
+#      cs_cv_sys_pthread_lflags, and cs_cv_sys_pthread_libs are set. (As a
+#      convenience, these variables can be emitted to an output file with
+#      CS_EMIT_BUILD_RESULT() by passing "cs_cv_sys_pthread" as its CACHE-VAR
+#      argument.)  If the recursive mutex extension is supported, then
+#      cs_cv_sys_pthread_mutex_recursive will be set with the literal name of
+#      the constant which must be passed to pthread_mutexattr_settype() to
+#      enable this feature. The constant name will be typically
+#      PTHREAD_MUTEX_RECURSIVE or PTHREAD_MUTEX_RECURSIVE_NP. If the recursive
+#      mutex extension is not available, then
+#      cs_cv_sys_pthread_mutex_recursive will be set to "no".  If the timed
+#      mutex extension is supported, then cs_cv_sys_pthread_mutex_timed will
+#      be set with the literal name of the constant which must be passed to
+#      pthread_mutexattr_settype() to enable this feature. The constant name
+#      will be typically PTHREAD_MUTEX_TIMED or PTHREAD_MUTEX_TIMED_NP. If the
+#      timed mutex extension is not available, then
+#      cs_cv_sys_pthread_mutex_timed will be set to "no".  REJECT-MASK can be
+#      used to limit the platforms on which the pthread test is performed. It
+#      is compared against $host_os; matches are rejected. If omitted, then
+#      the test is performed on all platforms. Examples: To avoid testing on
+#      Cygwin, use "cygwin*"; to avoid testing on Cygwin and AIX, use
+#      "cygwin*|aix*".
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_CHECK_PTHREAD],
+    [AC_REQUIRE([AC_CANONICAL_HOST])
+    case $host_os in
+       m4_ifval([$1],
+       [$1)
+           cs_cv_sys_pthread=no
+           ;;
+       ])
+       *)
+           CS_CHECK_BUILD([for pthread], [cs_cv_sys_pthread],
+               [AC_LANG_PROGRAM(
+                   [[#include <pthread.h>
+                   #include <semaphore.h>
+                   void* worker(void* p) { (void)p; return p; }]],
+                   [pthread_t tid;
+                   sem_t sem;
+                   pthread_create(&tid, 0, worker, 0);
+                   sem_init(&sem, 0, 0);
+                   sem_destroy(&sem);])],
+               [cs_pthread_flags])
+           ;;
+    esac
+    _CS_CHECK_MUTEX_FEATURE([PTHREAD_MUTEX_RECURSIVE],
+       [cs_cv_sys_pthread_mutex_recursive], [for pthread recursive mutexes])])
+
+# _CS_CHECK_MUTEX_FEATURE(FEATURE, CACHE-VAR, MESSAGE)
+AC_DEFUN([_CS_CHECK_MUTEX_FEATURE],
+    [AS_IF([test $cs_cv_sys_pthread = yes],
+       [AC_CACHE_CHECK([$3], [$2],
+           [CS_BUILD_IFELSE(
+               [AC_LANG_PROGRAM(
+                   [[#include <pthread.h>]],
+                   [pthread_mutexattr_t attr;
+                   pthread_mutexattr_settype(&attr, CS_MUTEX_FEATURE);])],
+               [CS_CREATE_TUPLE([-DCS_MUTEX_FEATURE=$1]) \
+               CS_CREATE_TUPLE([-DCS_MUTEX_FEATURE=$1_NP])],
+               [],
+               [$2=`echo $cs_build_cflags | sed 's/.*\($1_*N*P*\).*/\1/'`],
+               [$2=no],
+               [$cs_cv_sys_pthread_cflags -D_GNU_SOURCE],
+               [$cs_cv_sys_pthread_lflags],
+               [$cs_cv_sys_pthread_libs])])],
+       [$2=no])])
+
+m4_define([cs_pthread_flags],
+    [CS_CREATE_TUPLE() \
+    CS_CREATE_TUPLE([], [], [-lpthread]) \
+    CS_CREATE_TUPLE([], [], [-lpthread -lrt]) \
+    CS_CREATE_TUPLE([-pthread], [-pthread], []) \
+    CS_CREATE_TUPLE([-pthread], [-pthread], [-lpthread]) \
+    CS_CREATE_TUPLE([-pthread], [-pthread], [-lc_r])])
diff --git a/mk/autoconf/checkpython.m4 b/mk/autoconf/checkpython.m4
new file mode 100644 (file)
index 0000000..e233b66
--- /dev/null
@@ -0,0 +1,154 @@
+# checkpython.m4                                               -*- Autoconf -*-
+#==============================================================================
+# Copyright (C)2003,2004 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#==============================================================================
+AC_PREREQ([2.56])
+
+#------------------------------------------------------------------------------
+# CS_CHECK_PYTHON([EMITTER], [SDK-CHECK-DEFAULT], [WITH-DESCRIPTION])
+#      Check for Python and a working Python SDK.  Sets the shell variable
+#      PYTHON to the name of the Python interpreter and invokes AC_SUBST().
+#      The shell variable cs_cv_python is set to "yes" if a working Python SDK
+#      is discovered, else "no". If available, then the variables
+#      cs_cv_python_cflags, cs_cv_python_lflags, and cs_cv_python_libs are
+#      set. (As a convenience, these variables can be emitted to an output
+#      file with CS_EMIT_BUILD_RESULT() by passing "cs_cv_python" as its
+#      CACHE-VAR argument.) As a convenience, the shell variable
+#      cs_cv_python_ext is set to the suffix of Python extension modules (with
+#      leading dot; typically ".dll" or ".so").  The SDK check can be enabled
+#      or disabled with --with[out]-python.  SDK-CHECK-DEFAULT should be
+#      "with" or "without". If SDK-CHECK-DEFAULT is "with" or if it is
+#      ommitted, then --with-python is the default, else --without-python is
+#      the default.  WITH-DESCRIPTION is the description to use for the
+#      --with[out]-python option. The literal string "use" (or "do not use")
+#      is prepended to WITH-DESCRIPTION. If omitted, WITH-DESCRIPTION defaults
+#      to "Python".  If EMITTER is provided, then CS_EMIT_BUILD_RESULT() is
+#      invoked with EMITTER in order to record the results in an output
+#      file. As a convenience, if EMITTER is the literal value "emit" or
+#      "yes", then CS_EMIT_BUILD_RESULT()'s default emitter will be used.
+#      When EMITTER is provided, the following properties are emitted to the
+#      output file: PTYHON (the actual interpreter), PYTHON.AVAILABLE ("yes"
+#      or "no"), PYTHON.CFLAGS, PYTHON.LFLAGS, and PYTHON.MODULE_EXT.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_CHECK_PYTHON],
+    [AC_REQUIRE([CS_CHECK_PTHREAD])
+    CS_COMPILER_IGNORE_LONG_DOUBLE([C++], [cs_cv_prog_cxx_ignore_long_double])
+
+    AC_ARG_WITH([python],
+       [AC_HELP_STRING([--]m4_if([$2],[without],[with],[without])[-python],
+           m4_if([$2],[without],[use],[do not use])
+               m4_default([$3],[Python]))])
+    AS_IF([test -z "$with_python"],
+       [with_python=m4_if([$2], [without], [no], [yes])])
+
+    CS_CHECK_PROGS([PYTHON], [python])
+    AC_SUBST([PYTHON])
+    CS_EMIT_BUILD_PROPERTY([PYTHON],[$PYTHON],[],[],CS_EMITTER_OPTIONAL([$1]))
+
+    AS_IF([test -n "$PYTHON" && test "$with_python" != no],
+       [AC_CACHE_CHECK([for python SDK], [cs_cv_python_sdk],
+           [cs_pyver=`AC_RUN_LOG([$PYTHON -c 'import sys, string; \
+               print string.join(map(str,sys.version_info[[:2]]),".")'])`
+           cs_cv_pybase="python${cs_pyver}"
+
+           cs_cv_pybase_cflags=CS_RUN_PATH_NORMALIZE([$PYTHON -c \
+               'import distutils.sysconfig; \
+               print "-I" + distutils.sysconfig.get_python_inc()'])
+           cs_cv_pybase_cflags="$cs_cv_pybase_cflags \
+               $cs_cv_prog_cxx_ignore_long_double"
+
+           # Depending upon platform and installation, link library might
+           # reside in "get_python_lib()", "get_python_lib()/config",
+           # "${prefix}/lib" (Unix), or "${prefix}/libs" (Windows).
+           cs_cv_pybase_syslib=CS_RUN_PATH_NORMALIZE([$PYTHON -c \
+               'import distutils.sysconfig; \
+               print distutils.sysconfig.get_python_lib(0,1)'])
+           cs_cv_pybase_sysprefix=CS_RUN_PATH_NORMALIZE([$PYTHON -c \
+               'import sys; print sys.prefix'])
+           cs_cv_pybase_lflags=''
+           _CS_CHECK_PYTHON_LIBDIR([cs_cv_pybase_lflags],
+               [cs_cv_pybase_syslib])
+           _CS_CHECK_PYTHON_LIBDIR([cs_cv_pybase_lflags],
+               [cs_cv_pybase_syslib], [config])
+           _CS_CHECK_PYTHON_LIBDIR([cs_cv_pybase_lflags],
+               [cs_cv_pybase_sysprefix], [lib])
+           _CS_CHECK_PYTHON_LIBDIR([cs_cv_pybase_lflags],
+               [cs_cv_pybase_sysprefix], [libs])
+
+           cs_cv_pybase_libs=CS_RUN_PATH_NORMALIZE([$PYTHON -c \
+               'import distutils.sysconfig; \
+               print (distutils.sysconfig.get_config_var("LIBS") or "")+" "+ \
+                     (distutils.sysconfig.get_config_var("SYSLIBS") or "")'])
+
+           cs_cv_python_ext=`AC_RUN_LOG([$PYTHON -c \
+               'import distutils.sysconfig; \
+               print (distutils.sysconfig.get_config_var("SO") or "")'])`
+
+           AS_IF([test -n "$cs_pyver" &&
+                  test -n "$cs_cv_pybase_cflags" &&
+                  test -n "$cs_cv_pybase_lflags"],
+               [cs_cv_python_sdk=yes], [cs_cv_python_sdk=no])])
+
+       # Check if Python SDK is usable.  The most common library name is the
+       # basename with a few decorations (for example, libpython2.2.a),
+       # however some Windows libraries lack the decimal point (for example,
+       # libpython22.a or python22.lib), so we must check for both variations.
+       # Furthermore, MacOS/X 10.3 supplies a Python.framework, however,
+       # earlier releases did not.  Instead, Python on MacOS/X pre-10.3 uses a
+       # one-level linker namespace, which means that loadable Python modules
+       # do not link against the Python library; instead, unresolved symbols
+       # in the modules are satisfied automatically by the Python executable
+       # when the module is loaded into the executable.  For this reason,
+       # Python on MacOS/X does not even provide a Python link library.  We
+       # account for this by trying -bundle, rather than linking against the
+       # library.
+       AS_IF([test $cs_cv_python_sdk = yes],
+           [CS_EMIT_BUILD_PROPERTY([PYTHON.MODULE_EXT], [$cs_cv_python_ext],
+               [], [], CS_EMITTER_OPTIONAL([$1]))
+           cs_pywinlib=`echo "$cs_cv_pybase" | sed 's/\.//g'`
+           cs_pyflags="$cs_pyflags CS_CREATE_TUPLE([],[],[-framework Python])"
+           cs_pyflags="$cs_pyflags CS_CREATE_TUPLE([],[],[-l$cs_cv_pybase])"
+           cs_pyflags="$cs_pyflags CS_CREATE_TUPLE([],[],[-l$cs_pywinlib])"
+           cs_pyflags="$cs_pyflags CS_CREATE_TUPLE(
+           [],[-bundle -flat_namespace -undefined suppress])"
+           CS_CHECK_BUILD([if python SDK is usable], [cs_cv_python],
+               [AC_LANG_PROGRAM([[#include <Python.h>]],
+                   [Py_Initialize(); Py_Finalize();])],
+               [$cs_pyflags], [],
+               [CS_EMIT_BUILD_RESULT([cs_cv_python], [PYTHON],
+                   CS_EMITTER_OPTIONAL([$1]))], [], [],
+               [$cs_cv_pybase_cflags $cs_cv_sys_pthread_cflags],
+               [$cs_cv_pybase_lflags $cs_cv_sys_pthread_lflags],
+               [$cs_cv_pybase_libs   $cs_cv_sys_pthread_libs])],
+           [cs_cv_python=no])],
+       [cs_cv_python=no])])
+
+# _CS_CHECK_PYTHON_LIBDIR(LFLAGS-VAR, DIR-VAR, [SUBDIR])
+AC_DEFUN([_CS_CHECK_PYTHON_LIBDIR],
+    [AS_IF([test -d "$$2[]m4_ifval([$3],[/$3],[])"],
+       [$1="$$1 -L$$2[]m4_ifval([$3],[/$3],[])"])])
+
+
+
+#------------------------------------------------------------------------------
+# CS_EMIT_CHECK_PYTHON([SDK-CHECK-DEFAULT], [WITH-DESCRIPTION], [EMITTER])
+#      DEPRECATED: Previously, layered EMITTER functionality atop
+#      CS_CHECK_PYTHON() before CS_CHECK_PYTHON() supported emitters directly.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_EMIT_CHECK_PYTHON],
+    [CS_CHECK_PYTHON(m4_ifval([$3], [$3], [emit]), [$1], [$2])])
diff --git a/mk/autoconf/checktt2.m4 b/mk/autoconf/checktt2.m4
new file mode 100644 (file)
index 0000000..51584b6
--- /dev/null
@@ -0,0 +1,45 @@
+# checktt2.m4                                                  -*- Autoconf -*-
+#==============================================================================
+# Copyright (C)2004,2005 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#==============================================================================
+AC_PREREQ([2.56])
+
+#------------------------------------------------------------------------------
+# CS_CHECK_TEMPLATE_TOOLKIT2([EMITTER])
+#      Check if Template Toolkit 2 (http://www.tt2.org/) is available. The
+#      shell variable cs_cv_perl_tt2 is set to "yes" if the package is
+#      discovered, else "no". Also sets the shell variable TTREE to the name
+#      path of the 'ttree' utility program and invokes AC_SUBST().  If EMITTER
+#      is provided and the package was discovered, then
+#      CS_EMIT_BUILD_PROPERTY() is invoked with EMITTER in order to record the
+#      value of the TTREE variable in an output file. As a convenience, if
+#      EMITTER is the literal value "emit" or "yes", then
+#      CS_EMIT_BUILD_RESULT()'s default emitter will be used.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_CHECK_TEMPLATE_TOOLKIT2],
+    [CS_CHECK_PROGS([PERL], [perl5 perl])
+    AS_IF([test -n "$PERL"],
+       [AC_CACHE_CHECK([for TemplateToolkit], [cs_cv_perl_tt2],
+           [AS_IF([AC_RUN_LOG(
+               [$PERL -M'Template 2.11' -MTemplate::Plugin -e 0 1>&2])],
+               [cs_cv_perl_tt2=yes],
+               [cs_cv_perl_tt2=no])])
+       CS_PATH_PROGS([TTREE], [ttree])
+       AS_IF([test $cs_cv_perl_tt2 = yes && test -n "$TTREE"],
+           [CS_EMIT_BUILD_PROPERTY([TTREE], [$TTREE], [], [],
+               CS_EMITTER_OPTIONAL([$1]))])])])
diff --git a/mk/autoconf/compiler.m4 b/mk/autoconf/compiler.m4
new file mode 100644 (file)
index 0000000..c3a42a4
--- /dev/null
@@ -0,0 +1,99 @@
+# compiler.m4                                                  -*- Autoconf -*-
+#=============================================================================
+# Copyright (C)2003 by Matze Braun <matze@braunis.de>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#=============================================================================
+
+#-----------------------------------------------------------------------------
+# Detection of C and C++ compilers and setting flags
+#
+# CS_PROG_CC
+#       Detects the C compiler.  Also takes care of the CFLAGS, CPPFLAGS and CC
+#       environment variables.  This will filter out all -g and -O from the
+#       CFLAGS variable because Autoconf's -g and -O defaults are not always
+#       desired.  This will also set the CMD.CC and COMPILER.CFLAGS variables
+#       in Jamconfig
+# CS_PROG_CXX
+#       Detects the C++ compiler.  Also takes care of the CXXFLAGS, CPPFLAGS
+#       and CXX environment variables.  This will filter out all -g and -O from
+#       the CXXFLAGS variable because Autoconf's -g and -O defaults are not
+#       always desired.  This will also set the CMD.C++ and COMPILER.C++FLAGS
+#       variables in Jamconfig
+# CS_PROG_LINK
+#      Tries to determine a linker.  This is done by checking if a C++ or
+#       Objecctive-C++ compiler is available in which case it is used for
+#       linking; otherwise the C or Objective-C compiler is used.  This also
+#       sets the CMD.LINK and COMPILER.LFLAGS variables in Jamconfig and
+#       respects the LDFLAGS environment variable.  Finally, checks if linker
+#      recognizes -shared and sets PLUGIN.LFLAGS; and checks if linker
+#      recognizes -soname and sets PLUGIN.LFLAGS.USE_SONAME to "yes".
+#-----------------------------------------------------------------------------
+AC_DEFUN([CS_PROG_CC],[
+    CFLAGS="$CFLAGS" # Filter undesired flags
+    AC_PROG_CC
+    AS_IF([test -n "$CC"],[
+       CS_EMIT_BUILD_PROPERTY([CMD.CC], [$CC])
+       CS_EMIT_BUILD_PROPERTY([COMPILER.CFLAGS], [$CPPFLAGS $CFLAGS], [+])
+       
+       # Check if compiler recognizes -pipe directive.
+       CS_EMIT_BUILD_FLAGS([if $CC accepts -pipe], [cs_cv_prog_cc_pipe],
+         [CS_CREATE_TUPLE([-pipe])], [C], [COMPILER.CFLAGS], [+])
+    ])
+])
+
+AC_DEFUN([CS_PROG_CXX],[
+    CXXFLAGS="$CXXFLAGS" # Filter undesired flags
+    AC_PROG_CXX
+    AS_IF([test -n "$CXX"],[
+       CS_EMIT_BUILD_PROPERTY([CMD.C++], [$CXX])
+
+       CS_EMIT_BUILD_PROPERTY([COMPILER.C++FLAGS], [$CPPFLAGS $CXXFLAGS], [+])
+
+        # Check if compiler can be instructed to produce position-independent-code
+        # (PIC).  This feature is required by some platforms when building plugin
+        # modules and shared libraries.
+       CS_COMPILER_PIC([C++], [cs_cv_prog_cxx_pic],
+           [CS_EMIT_BUILD_PROPERTY([COMPILER.C++FLAGS.PIC],
+               [$cs_cv_prog_cxx_pic])])
+    ])
+])
+
+AC_DEFUN([CS_PROG_LINK],[
+    AS_IF([test -n "$CXX"],
+       [CS_EMIT_BUILD_PROPERTY([CMD.LINK], [AS_ESCAPE([$(CMD.C++)])])],
+       [CS_EMIT_BUILD_PROPERTY([CMD.LINK], [AS_ESCAPE([$(CMD.CC)])])])
+
+    CS_EMIT_BUILD_PROPERTY([COMPILER.LFLAGS], [$LDFLAGS], [+])
+
+    # Check if compiler/linker recognizes -shared directive which is needed for
+    # linking plugin modules.  Unfortunately, the Apple compiler (and possibly
+    # others) requires extra effort.  Even though the compiler does not recognize
+    # the -shared option, it nevertheless returns a "success" result after emitting
+    # the warning "unrecognized option `-shared'".  Worse, even -Werror fails to
+    # promote the warning to an error, so we must instead scan the compiler's
+    # output for an appropriate diagnostic.
+    CS_CHECK_BUILD_FLAGS([if -shared is accepted], [cs_cv_prog_link_shared],
+       [CS_CREATE_TUPLE([-shared])], [C++],
+       [CS_EMIT_BUILD_PROPERTY([PLUGIN.LFLAGS], [-shared], [+])], [],
+       [], [], [], [shared])
+
+    # Check if linker recognizes -soname which is used to assign a name internally
+    # to plugin modules.
+    CS_CHECK_BUILD([if -soname is accepted], [cs_cv_prog_link_soname], [],
+       [CS_CREATE_TUPLE([-Wl,-soname,foobar])], [C++],
+       [CS_EMIT_BUILD_PROPERTY([PLUGIN.LFLAGS.USE_SONAME], [yes])])
+])
diff --git a/mk/autoconf/config.guess b/mk/autoconf/config.guess
new file mode 100755 (executable)
index 0000000..dd1688b
--- /dev/null
@@ -0,0 +1,1459 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+
+timestamp='2004-06-11'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 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 <per@bothner.com>.
+# Please send patches to <config-patches@gnu.org>.  Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub.  If it succeeds, it prints the system name on stdout, and
+# exits with 0.  Otherwise, it exits with 1.
+#
+# The plan is that this can be called by configure scripts if you
+# don't specify an explicit build system type.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+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 ;;
+    arc:OpenBSD:*:*)
+       echo mipsel-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 ;;
+    pmax:OpenBSD:*:*)
+       echo mipsel-unknown-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    sgi:OpenBSD:*:*)
+       echo mipseb-unknown-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    sun3:OpenBSD:*:*)
+       echo m68k-unknown-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    wgrisc:OpenBSD:*:*)
+       echo mipsel-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*:OpenVMS:*:*)
+       echo alpha-hp-vms
+       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 <stdio.h>  /* for printf() prototype */
+       int main (int argc, char *argv[]) {
+#else
+       int main (argc, argv) int argc; char *argv[]; {
+#endif
+       #if defined (host_mips) && defined (MIPSEB)
+       #if defined (SYSTYPE_SYSV)
+         printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+       #endif
+       #if defined (SYSTYPE_SVR4)
+         printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+       #endif
+       #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+         printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+       #endif
+       #endif
+         exit (-1);
+       }
+EOF
+       $CC_FOR_BUILD -o $dummy $dummy.c \
+         && $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 <sys/systemcfg.h>
+
+               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 <stdlib.h>
+              #include <unistd.h>
+
+              int main ()
+              {
+              #if defined(_SC_KERNEL_BITS)
+                  long bits = sysconf(_SC_KERNEL_BITS);
+              #endif
+                  long cpu  = sysconf (_SC_CPU_VERSION);
+
+                  switch (cpu)
+               {
+               case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+               case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+               case CPU_PA_RISC2_0:
+              #if defined(_SC_KERNEL_BITS)
+                   switch (bits)
+                       {
+                       case 64: puts ("hppa2.0w"); break;
+                       case 32: puts ("hppa2.0n"); break;
+                       default: puts ("hppa2.0"); break;
+                       } break;
+              #else  /* !defined(_SC_KERNEL_BITS) */
+                   puts ("hppa2.0"); break;
+              #endif
+               default: puts ("hppa1.0"); break;
+               }
+                  exit (0);
+              }
+EOF
+                   (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+                   test -z "$HP_ARCH" && HP_ARCH=hppa
+               fi ;;
+       esac
+       if [ ${HP_ARCH} = "hppa2.0w" ]
+       then
+           # 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 <unistd.h>
+       int
+       main ()
+       {
+         long cpu = sysconf (_SC_CPU_VERSION);
+         /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+            true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
+            results, however.  */
+         if (CPU_IS_PA_RISC (cpu))
+           {
+             switch (cpu)
+               {
+                 case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+                 case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+                 case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+                 default: puts ("hppa-hitachi-hiuxwe2"); break;
+               }
+           }
+         else if (CPU_IS_HP_MC68K (cpu))
+           puts ("m68k-hitachi-hiuxwe2");
+         else puts ("unknown-hitachi-hiuxwe2");
+         exit (0);
+       }
+EOF
+       $CC_FOR_BUILD -o $dummy $dummy.c && $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 nv1-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:*:*)
+       # Determine whether the default compiler uses glibc.
+       eval $set_cc_for_build
+       sed 's/^        //' << EOF >$dummy.c
+       #include <features.h>
+       #if __GLIBC__ >= 2
+       LIBC=gnu
+       #else
+       LIBC=
+       #endif
+EOF
+       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+       # GNU/KFreeBSD systems have a "k" prefix to indicate we are using
+       # FreeBSD's kernel, but not the complete OS.
+       case ${LIBC} in gnu) kernel_only='k' ;; esac
+       echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
+       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 ;;
+    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 <features.h>
+       #ifdef __ELF__
+       # ifdef __GLIBC__
+       #  if __GLIBC__ >= 2
+       LIBC=gnu
+       #  else
+       LIBC=gnulibc1
+       #  endif
+       # else
+       LIBC=gnulibc1
+       # endif
+       #else
+       #ifdef __INTEL_COMPILER
+       LIBC=gnu
+       #else
+       LIBC=gnuaout
+       #endif
+       #endif
+       #ifdef __dietlibc__
+       LIBC=dietlibc
+       #endif
+EOF
+       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+       test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 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' </usr/options/cb.name`
+               echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+       elif /bin/uname -X 2>/dev/null >/dev/null ; then
+               UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+               (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+               (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+                       && UNAME_MACHINE=i586
+               (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+                       && UNAME_MACHINE=i686
+               (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+                       && UNAME_MACHINE=i686
+               echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+       else
+               echo ${UNAME_MACHINE}-pc-sysv32
+       fi
+       exit 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)
+       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 <Richard.M.Bartel@ccMail.Census.GOV>
+        echo i586-unisys-sysv4
+        exit 0 ;;
+    *:UNIX_System_V:4*:FTX*)
+       # From Gerald Hewes <hewes@openmarket.com>.
+       # 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:*:*)
+       case `uname -p` in
+           *86) UNAME_PROCESSOR=i686 ;;
+           powerpc) 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 ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
+     I don't know....  */
+  printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+  printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+          "4"
+#else
+         ""
+#endif
+         ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+  printf ("arm-acorn-riscix"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+  printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+  int version;
+  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+  if (version < 4)
+    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+  else
+    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+  exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+  printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+  printf ("ns32k-encore-mach\n"); exit (0);
+#else
+  printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+  printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+  printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+  printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+    struct utsname un;
+
+    uname(&un);
+
+    if (strncmp(un.version, "V2", 2) == 0) {
+       printf ("i386-sequent-ptx2\n"); exit (0);
+    }
+    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+       printf ("i386-sequent-ptx1\n"); exit (0);
+    }
+    printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+# if !defined (ultrix)
+#  include <sys/param.h>
+#  if defined (BSD)
+#   if BSD == 43
+      printf ("vax-dec-bsd4.3\n"); exit (0);
+#   else
+#    if BSD == 199006
+      printf ("vax-dec-bsd4.3reno\n"); exit (0);
+#    else
+      printf ("vax-dec-bsd\n"); exit (0);
+#    endif
+#   endif
+#  else
+    printf ("vax-dec-bsd\n"); exit (0);
+#  endif
+# else
+    printf ("vax-dec-ultrix\n"); exit (0);
+# endif
+#endif
+
+#if defined (alliant) && defined (i860)
+  printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+  exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $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 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+    ftp://ftp.gnu.org/pub/gnu/config/
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo               = `(hostinfo) 2>/dev/null`
+/bin/universe          = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch              = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM  = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/mk/autoconf/config.sub b/mk/autoconf/config.sub
new file mode 100755 (executable)
index 0000000..ba33103
--- /dev/null
@@ -0,0 +1,1549 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+
+timestamp='2004-03-12'
+
+# 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 <config-patches@gnu.org>.  Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support.  The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+#      CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+#      CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+       $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+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)
+               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-* | 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-* \
+       | msp430-* \
+       | none-* | np1-* | nv1-* | 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
+               ;;
+       cr16c)
+               basic_machine=cr16c-unknown
+               os=-elf
+               ;;
+       crds | unos)
+               basic_machine=m68k-crds
+               ;;
+       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
+               ;;
+       mmix*)
+               basic_machine=mmix-knuth
+               os=-mmixware
+               ;;
+       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
+               ;;
+       nv1)
+               basic_machine=nv1-cray
+               os=-unicosmp
+               ;;
+       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
+               ;;
+       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
+               ;;
+       *-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:
diff --git a/mk/autoconf/crystal.m4 b/mk/autoconf/crystal.m4
new file mode 100644 (file)
index 0000000..136f2f7
--- /dev/null
@@ -0,0 +1,189 @@
+# crystal.m4                                                   -*- Autoconf -*-
+#==============================================================================
+# Copyright (C)2005 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#==============================================================================
+AC_PREREQ([2.56])
+
+m4_define([cs_min_version_default], [0.99])
+
+#------------------------------------------------------------------------------
+# CS_PATH_CRYSTAL_CHECK([MINIMUM-VERSION], [ACTION-IF-FOUND],
+#                       [ACTION-IF-NOT-FOUND], [REQUIRED-LIBS],
+#                       [OPTIONAL-LIBS])
+#      Checks for Crystal Space paths and libraries by consulting
+#      cs-config. It first looks for cs-config in the paths mentioned by
+#      $CRYSTAL, then in the paths mentioned by $PATH, and then in
+#      /usr/local/crystalspace/bin.  Emits an error if it can not locate
+#      cs-config, if the Crystal Space test program fails, or if the available
+#      version number is unsuitable.  Exports the variables
+#      CRYSTAL_CONFIG_TOOL, CRYSTAL_AVAILABLE, CRYSTAL_VERSION,
+#      CRYSTAL_CFLAGS, CRYSTAL_LIBS, CRYSTAL_INCLUDE_DIR, and
+#      CRYSTAL_AVAILABLE_LIBS.  If the check succeeds, then CRYSTAL_AVAILABLE
+#      will be 'yes', and the other variables set to appropriate values. If it
+#      fails, then CRYSTAL_AVAILABLE will be 'no', and the other variables
+#      empty.  If REQUIRED-LIBS is specified, then it is a list of Crystal
+#      Space libraries which must be present, and for which appropriate
+#      compiler and linker flags will be reflected in CRYSTAL_CFLAGS and
+#      CRYSTAL_LFLAGS. If OPTIONAL-LIBS is specified, then it is a list of
+#      Crystal Space libraries for which appropriate compiler and linker flags
+#      should be returned if the libraries are available.  It is not an error
+#      for an optional library to be absent. The client can check
+#      CRYSTAL_AVAILABLE_LIBS for a list of all libraries available for this
+#      particular installation of Crystal Space.  The returned list is
+#      independent of REQUIRED-LIBS and OPTIONAL-LIBS.  Use the results of the
+#      check like this: CFLAGS="$CFLAGS $CRYSTAL_CFLAGS" and LDFLAGS="$LDFLAGS
+#      $CRYSTAL_LIBS"
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_PATH_CRYSTAL_CHECK],
+[AC_ARG_WITH([cs-prefix],
+    [AC_HELP_STRING([--with-cs-prefix=CRYSTAL_PREFIX],
+       [specify location of Crystal Space installation; this is the \$prefix
+       value used when installing the SDK])],
+       [CRYSTAL="$withval"
+       export CRYSTAL])
+AC_ARG_VAR([CRYSTAL], [Prefix where Crystal Space is installed])
+AC_ARG_ENABLE([cstest],
+    [AC_HELP_STRING([--enable-cstest],
+       [verify that the Crystal Space SDK is actually usable
+       (default YES)])], [], [enable_cstest=yes])
+
+# Try to find an installed cs-config.
+cs_path=''
+AS_IF([test -n "$CRYSTAL"],
+    [my_IFS=$IFS; IFS=$PATH_SEPARATOR
+    for cs_dir in $CRYSTAL; do
+       AS_IF([test -n "$cs_path"], [cs_path="$cs_path$PATH_SEPARATOR"])
+       cs_path="$cs_path$cs_dir$PATH_SEPARATOR$cs_dir/bin"
+    done
+    IFS=$my_IFS])
+
+AS_IF([test -n "$cs_path"], [cs_path="$cs_path$PATH_SEPARATOR"])
+cs_path="$cs_path$PATH$PATH_SEPARATOR/usr/local/crystalspace/bin"
+
+AC_PATH_TOOL([CRYSTAL_CONFIG_TOOL], [cs-config], [], [$cs_path])
+
+AS_IF([test -n "$CRYSTAL_CONFIG_TOOL"],
+    [cfg="$CRYSTAL_CONFIG_TOOL"
+
+    CS_CHECK_PROG_VERSION([Crystal Space], [$cfg --version],
+       [m4_default([$1],[cs_min_version_default])], [9.9|.9],
+       [cs_sdk=yes], [cs_sdk=no])
+
+    AS_IF([test $cs_sdk = yes],
+       [cs_liblist="$4"
+       cs_optlibs=CS_TRIM([$5])
+       AS_IF([test -n "$cs_optlibs"],
+           [cs_optlibs=`$cfg --available-libs $cs_optlibs`
+           cs_liblist="$cs_liblist $cs_optlibs"])
+       CRYSTAL_VERSION=`$cfg --version $cs_liblist`
+       CRYSTAL_CFLAGS=CS_RUN_PATH_NORMALIZE([$cfg --cxxflags $cs_liblist])
+       CRYSTAL_LIBS=CS_RUN_PATH_NORMALIZE([$cfg --libs $cs_liblist])
+       CRYSTAL_INCLUDE_DIR=CS_RUN_PATH_NORMALIZE(
+           [$cfg --includedir $cs_liblist])
+       CRYSTAL_AVAILABLE_LIBS=`$cfg --available-libs`
+       CRYSTAL_STATICDEPS=`$cfg --static-deps`
+       AS_IF([test -z "$CRYSTAL_LIBS"], [cs_sdk=no])])],
+    [cs_sdk=no])
+
+AS_IF([test "$cs_sdk" = yes && test "$enable_cstest" = yes],
+    [CS_CHECK_BUILD([if Crystal Space SDK is usable], [cs_cv_crystal_sdk],
+       [AC_LANG_PROGRAM(
+           [#include <cssysdef.h>
+           #include <csutil/csstring.h>
+           csStaticVarCleanupFN csStaticVarCleanup;],
+           [csString s; s << "Crystal Space";])],
+       [CS_CREATE_TUPLE([$CRYSTAL_CFLAGS],[],[$CRYSTAL_LIBS])], [C++],
+       [], [cs_sdk=no])])
+
+AS_IF([test "$cs_sdk" = yes],
+   [CRYSTAL_AVAILABLE=yes
+   $2],
+   [CRYSTAL_AVAILABLE=no
+   CRYSTAL_CFLAGS=''
+   CRYSTAL_VERSION=''
+   CRYSTAL_LIBS=''
+   CRYSTAL_INCLUDE_DIR=''
+   $3])
+])
+
+
+#------------------------------------------------------------------------------
+# CS_PATH_CRYSTAL_HELPER([MINIMUM-VERSION], [ACTION-IF-FOUND],
+#                        [ACTION-IF-NOT-FOUND], [REQUIRED-LIBS],
+#                        [OPTIONAL-LIBS])
+#      Deprecated: Backward compatibility wrapper for CS_PATH_CRYSTAL_CHECK().
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_PATH_CRYSTAL_HELPER],
+[CS_PATH_CRYSTAL_CHECK([$1],[$2],[$3],[$4],[$5])])
+
+
+#------------------------------------------------------------------------------
+# CS_PATH_CRYSTAL([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
+#                 [REQUIRED-LIBS], [OPTIONAL-LIBS])
+#      Convenience wrapper for CS_PATH_CRYSTAL_CHECK() which also invokes
+#      AC_SUBST() for CRYSTAL_AVAILABLE, CRYSTAL_VERSION, CRYSTAL_CFLAGS,
+#      CRYSTAL_LIBS, CRYSTAL_INCLUDE_DIR, and CRYSTAL_AVAILABLE_LIBS.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_PATH_CRYSTAL],
+[CS_PATH_CRYSTAL_CHECK([$1],[$2],[$3],[$4],[$5])
+AC_SUBST([CRYSTAL_AVAILABLE])
+AC_SUBST([CRYSTAL_VERSION])
+AC_SUBST([CRYSTAL_CFLAGS])
+AC_SUBST([CRYSTAL_LIBS])
+AC_SUBST([CRYSTAL_INCLUDE_DIR])
+AC_SUBST([CRYSTAL_AVAILABLE_LIBS])
+AC_SUBST([CRYSTAL_STATICDEPS])])
+
+
+#------------------------------------------------------------------------------
+# CS_PATH_CRYSTAL_EMIT([MINIMUM-VERSION], [ACTION-IF-FOUND],
+#                      [ACTION-IF-NOT-FOUND], [REQUIRED-LIBS], [OPTIONAL-LIBS],
+#                      [EMITTER])
+#      Convenience wrapper for CS_PATH_CRYSTAL_CHECK() which also emits
+#      CRYSTAL_AVAILABLE, CRYSTAL_VERSION, CRYSTAL_CFLAGS, CRYSTAL_LIBS,
+#      CRYSTAL_INCLUDE_DIR, and CRYSTAL_AVAILABLE_LIBS as the build properties
+#      CRYSTAL.AVAILABLE, CRYSTAL.VERSION, CRYSTAL.CFLAGS, CRYSTAL.LIBS,
+#      CRYSTAL.INCLUDE_DIR, and CRYSTAL.AVAILABLE_LIBS, respectively, using
+#      EMITTER.  EMITTER is a macro name, such as CS_JAMCONFIG_PROPERTY or
+#      CS_MAKEFILE_PROPERTY, which performs the actual task of emitting the
+#      property and value. If EMITTER is omitted, then
+#      CS_EMIT_BUILD_PROPERTY()'s default emitter is used.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_PATH_CRYSTAL_EMIT],
+[CS_PATH_CRYSTAL_CHECK([$1],[$2],[$3],[$4],[$5])
+_CS_PATH_CRYSTAL_EMIT([CRYSTAL.AVAILABLE],[$CRYSTAL_AVAILABLE],[$6])
+_CS_PATH_CRYSTAL_EMIT([CRYSTAL.VERSION],[$CRYSTAL_VERSION],[$6])
+_CS_PATH_CRYSTAL_EMIT([CRYSTAL.CFLAGS],[$CRYSTAL_CFLAGS],[$6])
+_CS_PATH_CRYSTAL_EMIT([CRYSTAL.LFLAGS],[$CRYSTAL_LIBS],[$6])
+_CS_PATH_CRYSTAL_EMIT([CRYSTAL.INCLUDE_DIR],[$CRYSTAL_INCLUDE_DIR],[$6])
+_CS_PATH_CRYSTAL_EMIT([CRYSTAL.AVAILABLE_LIBS],[$CRYSTAL_AVAILABLE_LIBS],[$6])
+_CS_PATH_CRYSTAL_EMIT([CRYSTAL.STATICDEPS],[$CRYSTAL_STATICDEPS],[$6])
+])
+
+AC_DEFUN([_CS_PATH_CRYSTAL_EMIT],
+[CS_EMIT_BUILD_PROPERTY([$1],[$2],[],[],[$3])])
+
+
+#------------------------------------------------------------------------------
+# CS_PATH_CRYSTAL_JAM([MINIMUM-VERSION], [ACTION-IF-FOUND],
+#                     [ACTION-IF-NOT-FOUND], [REQUIRED-LIBS], [OPTIONAL-LIBS])
+#      Deprecated: Jam-specific backward compatibility wrapper for
+#      CS_PATH_CRYSTAL_EMIT().
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_PATH_CRYSTAL_JAM],
+[CS_PATH_CRYSTAL_EMIT([$1],[$2],[$3],[$4],[$5],[CS_JAMCONFIG_PROPERTY])])
diff --git a/mk/autoconf/cs_check_host.m4 b/mk/autoconf/cs_check_host.m4
new file mode 100644 (file)
index 0000000..b899cc4
--- /dev/null
@@ -0,0 +1,144 @@
+#------------------------------------------------------------------------------
+# Determine host platform.  Recognized families: Unix, Windows, MacOS/X.
+# Orginial Macros Copyright (C)2003 Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#------------------------------------------------------------------------------
+
+#------------------------------------------------------------------------------
+# Determine host CPU.
+#
+# CS_CHECK_HOST_CPU
+#       Set the shell variable cs_host_cpu to a normalized form of the CPU name
+#       returned by config.guess/config.sub.  Typically, Crystal Space's
+#       conception of CPU name is the same as that returned by
+#       config.guess/config.sub, but there may be exceptions as seen in the
+#       `case' statement.  Also takes the normalized name, uppercases it to
+#       form a name suitable for the C preprocessor.  Additionally sets the
+#       TARGET.PROCESSOR Jamconfig property.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_CHECK_HOST_CPU],
+    [AC_REQUIRE([AC_CANONICAL_HOST])
+    case $host_cpu in
+        [[Ii][3-9]86*|[Xx]86*]) cs_host_cpu=x86 ;;
+        *) cs_host_cpu=$host_cpu ;;
+    esac
+    cs_host_cpu_normalized="AS_TR_CPP([$cs_host_cpu])"
+    CS_JAMCONFIG_PROPERTY([TARGET.PROCESSOR], [$cs_host_cpu_normalized])
+    ])
+
+
+#------------------------------------------------------------------------------
+# CS_CHECK_HOST
+#       Sets the shell variables cs_host_target cs_host_family,
+#       cs_host_os_normalized, and cs_host_os_normalized_uc.  Emits appropriate
+#       CS_PLATFORM_UNIX, CS_PLATFORM_WIN32, CS_PLATFORM_MACOSX via
+#       AC_DEFINE(), and TARGET.OS and TARGET.OS.NORMALIZED to Jamconfig.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_CHECK_HOST],
+    [AC_REQUIRE([AC_CANONICAL_HOST])
+    CS_CHECK_HOST_CPU
+    cs_host_os_normalized=''
+    case $host_os in
+        mingw*|cygwin*)
+            cs_host_target=win32gcc
+            cs_host_family=windows
+            ;;
+        darwin*)
+            _CS_CHECK_HOST_DARWIN
+            ;;
+        *)
+            # Everything else is assumed to be Unix or Unix-like.
+            cs_host_target=unix
+            cs_host_family=unix
+           ;;
+    esac
+
+    case $cs_host_family in
+       windows)
+            AC_DEFINE([CS_PLATFORM_WIN32], [],
+               [Define when compiling for Win32])
+           AS_IF([test -z "$cs_host_os_normalized"],
+               [cs_host_os_normalized='Win32'])
+           ;;
+       unix)
+            AC_DEFINE([CS_PLATFORM_UNIX], [],
+               [Define when compiling for Unix and Unix-like (i.e. MacOS/X)])
+           AS_IF([test -z "$cs_host_os_normalized"],
+               [cs_host_os_normalized='Unix'])
+           ;;
+    esac
+
+    cs_host_os_normalized_uc="AS_TR_CPP([$cs_host_os_normalized])"
+    CS_JAMCONFIG_PROPERTY([TARGET.OS], [$cs_host_os_normalized_uc])
+    CS_JAMCONFIG_PROPERTY([TARGET.OS.NORMALIZED], [$cs_host_os_normalized])
+])
+
+AC_DEFUN([_CS_CHECK_HOST_DARWIN],
+    [AC_REQUIRE([CS_PROG_CC])
+    AC_REQUIRE([CS_PROG_CXX])
+
+    # Both MacOS/X and Darwin are identified via $host_os as "darwin".  We need
+    # a way to distinguish between the two.  If Carbon.h is present, then
+    # assume MacOX/S; if not, assume Darwin.  If --with-x=yes was invoked, and
+    # Carbon.h is present, then assume that user wants to cross-build for
+    # Darwin even though build host is MacOS/X.
+    # IMPLEMENTATION NOTE *1*
+    # The QuickTime 7.0 installer removes <CarbonSound/CarbonSound.h>, which
+    # causes #include <Carbon/Carbon.h> to fail unconditionally. Re-installing
+    # the QuickTime SDK should restore the header, however not all developers
+    # know to do this, so we work around the problem of the missing
+    # CarbonSound.h by #defining __CARBONSOUND__ in the test in order to
+    # prevent Carbon.h from attempting to #include the missing header.
+    # IMPLEMENTATION NOTE *2*
+    # At least one MacOS/X user switches between gcc 2.95 and gcc 3.3 with a
+    # script which toggles the values of CC, CXX, and CPP.  Unfortunately, CPP
+    # was being set to run the preprocessor directly ("cpp", for instance)
+    # rather than running it via the compiler ("gcc -E", for instance).  The
+    # problem with running the preprocessor directly is that __APPLE__ and
+    # __GNUC__ are not defined, which causes the Carbon.h check to fail.  We
+    # avoid this problem by supplying a non-empty fourth argument to
+    # AC_CHECK_HEADER(), which causes it to test compile the header only (which
+    # is a more robust test), rather than also testing it via the preprocessor.
+
+    AC_DEFINE([__CARBONSOUND__], [],
+       [Avoid problem caused by missing <Carbon/CarbonSound.h>])
+    AC_CHECK_HEADER([Carbon/Carbon.h],
+       [cs_host_macosx=yes], [cs_host_macosx=no], [/* force compile */])
+
+    AS_IF([test $cs_host_macosx = yes],
+       [AC_MSG_CHECKING([for --with-x])
+       AS_IF([test "${with_x+set}" = set && test "$with_x" = "yes"],
+           [AC_MSG_RESULT([yes (assume Darwin)])
+           cs_host_macosx=no],
+           [AC_MSG_RESULT([no])])])
+
+    AS_IF([test $cs_host_macosx = yes],
+       [cs_host_target=macosx
+       cs_host_family=unix
+       cs_host_os_normalized='MacOS/X'
+        AC_DEFINE([CS_PLATFORM_MACOSX], [],
+           [Define when compiling for MacOS/X])
+
+       AC_CACHE_CHECK([for Objective-C compiler], [cs_cv_prog_objc],
+           [cs_cv_prog_objc="$CC"])
+       CS_JAMCONFIG_PROPERTY([CMD.OBJC], [$cs_cv_prog_objc])
+       AC_CACHE_CHECK([for Objective-C++ compiler], [cs_cv_prog_objcxx],
+           [cs_cv_prog_objcxx="$CXX"])
+       CS_JAMCONFIG_PROPERTY([CMD.OBJC++], [$cs_cv_prog_objcxx])],
+
+       [cs_host_target=unix
+       cs_host_family=unix])])
diff --git a/mk/autoconf/diagnose.m4 b/mk/autoconf/diagnose.m4
new file mode 100644 (file)
index 0000000..4fa7ffb
--- /dev/null
@@ -0,0 +1,31 @@
+# diagnose.m4                                                  -*- Autoconf -*-
+#==============================================================================
+# Copyright (C)2003 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#==============================================================================
+AC_PREREQ([2.56])
+
+#------------------------------------------------------------------------------
+# CS_MSG_ERROR(ERROR-DESCRIPTION, [EXIT-STATUS])
+#      A convenience wrapper for AC_MSG_ERROR() which invokes AC_CACHE_SAVE()
+#      before aborting the script.  Saving the cache should make subsequent
+#      re-invocations of the configure script faster once the user has
+#      corrected the problem(s) which caused the failure.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_MSG_ERROR],
+    [AC_CACHE_SAVE
+    AC_MSG_ERROR([$1], [$2])])
diff --git a/mk/autoconf/embed.m4 b/mk/autoconf/embed.m4
new file mode 100644 (file)
index 0000000..03c6cb7
--- /dev/null
@@ -0,0 +1,222 @@
+# embed.m4                                                     -*- Autoconf -*-
+#==============================================================================
+# Copyright (C)2003,2005 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#==============================================================================
+AC_PREREQ([2.56])
+
+#------------------------------------------------------------------------------
+# CS_META_INFO_EMBED([EMITTER], [GPL-OKAY])
+#      Determine if plugin meta-information should be embedded or if it should
+#      exist in a stand-alone .csplugin file, and check if necessary tools and
+#      libraries are present.  Sets the shell variable
+#      enable_meta_info_embedding to "yes" if the user requested embedding or
+#      if it was enabled by default; otherwise sets it to "no".
+#
+#      If EMITTER is provided, then a subset of the following variables
+#      (depending upon platform and availability) are recorded by invoking
+#      CS_EMIT_BUILD_PROPERTY() with EMITTER.  As a convenience, if EMITTER is
+#      the literal value "emit" or "yes", then CS_EMIT_BUILD_RESULT()'s
+#      default emitter will be used.
+#
+#      EMBED_META := yes or no
+#      EMBED_META.CFLAGS := compiler flags
+#      EMBED_META.LFLAGS := linker flags
+#      CMD.WINDRES := windres.exe
+#      OBJCOPY.AVAILABLE := yes or no
+#      CMD.OBJCOPY := objcopy.exe
+#      LIBBFD.AVAILABLE := yes or no
+#      LIBBFD.CFLAGS := libbfd compiler flags
+#      LIBBFD.LFLAGS := libbfd linker flags
+#      ELF.AVAILABLE := yes or no
+#
+#      In general, clients need only concern themselves with the various
+#      EMBED_META-related variables. For building plugin modules, utilize
+#      EMBED_META.CFLAGS when compiling, and EMBED_META.LFLAGS when linking.
+#
+#      On Unix, when CS' own ELF metadata reader can't be used (because the
+#      necessary header file elf.h was not found) embedding is accomplished
+#      via libbfd, which carries a GPL license. Projects which carry licenses
+#      not compatible with GPL should consider carefully before enabling
+#      embedding on Unix. If your project is GPL-compatible, then set GPL-OKAY
+#      to "yes". This will indicate that it is safe to use libbfd if the ELF
+#      reader can not be used.  If your project is not GPL-compatible, then
+#      set it to "no" in order to disable embedding on Unix if the ELF reader
+#      is not usable. (The user can still manually override the setting via
+#      the --enable-meta-info-embedding option.)
+#
+# IMPLEMENTATION NOTES
+#
+#      Recent versions of Mingw supply libbfd and libiberty.  Since Crystal
+#      Space uses native Win32 API for meta-information embedding on Windows,
+#      we do not require these libraries on Windows.  More importantly, users
+#      do not want to see these GPL-licensed libraries appear in the link
+#      statement for plugin modules, thus we explicitly disable the libbfd
+#      test on Windows.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_META_INFO_EMBED],
+    [AC_REQUIRE([AC_CANONICAL_HOST])
+    _CS_META_INFO_EMBED_ENABLE([$1], [$2])
+    AS_IF([test $enable_meta_info_embedding = yes],
+        [_CS_META_INFO_EMBED_TOOLS([$1])
+        AS_IF([test $cs_header_elf_h = yes],
+           [CS_EMIT_BUILD_PROPERTY([ELF.AVAILABLE], [yes], [], [],
+               CS_EMITTER_OPTIONAL([$1]))],
+            [case $host_os in
+               mingw*|cygwin*) ;;
+               *)
+                   CS_CHECK_LIBBFD([$1],
+                       [CS_EMIT_BUILD_PROPERTY([EMBED_META.CFLAGS],
+                           [$cs_cv_libbfd_ok_cflags], [+], [],
+                           CS_EMITTER_OPTIONAL([$1]))
+                       CS_EMIT_BUILD_PROPERTY([EMBED_META.LFLAGS],
+                           [$cs_cv_libbfd_ok_lflags $cs_cv_libbfd_ok_libs],
+                           [+], [], CS_EMITTER_OPTIONAL([$1]))])
+                   ;;
+           esac])])])
+
+
+#------------------------------------------------------------------------------
+# _CS_META_INFO_EMBED_ENABLE([EMITTER], [GPL-OKAY])
+#      Helper for CS_META_INFO_EMBED which adds an
+#      --enable-meta-info-embedding option to the configure script allowing
+#      the user to control embedding.  Sets the shell variable
+#      enable_meta_info_embedding to yes or no.
+#
+# IMPLEMENTATION NOTES
+#
+#      On Unix, embedding is enabled by default if elf.h is found and disabled
+#      by default unless overridden via GPL-OKAY because libbfd carries a GPL
+#      license which may be incompatible with a project's own license (such as
+#      LGPL).
+#------------------------------------------------------------------------------
+AC_DEFUN([_CS_META_INFO_EMBED_ENABLE],
+    [AC_REQUIRE([CS_CHECK_HOST])
+    AC_CHECK_HEADERS([elf.h], [cs_header_elf_h=yes], [cs_header_elf_h=no])
+    AC_MSG_CHECKING([whether to embed plugin meta-information])
+    case $cs_host_target in
+       unix) AS_IF([test $cs_header_elf_h = yes],
+              [cs_embed_meta_info_default=yes],
+              [cs_embed_meta_info_default=m4_ifval([$2],[$2],[no])]) ;;
+       *) cs_embed_meta_info_default=yes ;;
+    esac
+    AC_ARG_ENABLE([meta-info-embedding],
+       [AC_HELP_STRING([--enable-meta-info-embedding],
+           [store plugin meta-information directly inside plugin modules if
+           supported by platform; if disabled, meta-information is stored in
+           stand-alone .csplugin files; this option is enabled by default for
+           non-Unix platforms and on Unix platforms with ELF-format object
+           files; it is disabled by default on Unix platforms if ELF is not
+           available and the project uses a non-GPL-compatible license (such
+           as LGPL) since the non-ELF Unix embedding technology requires the
+           GPL-licensed libbfd library; if ELF is not available, enable this
+           option on Unix only if you are certain you want a GPL-licensed
+           library infecting your project])],
+       [], [enable_meta_info_embedding=$cs_embed_meta_info_default])
+    AC_MSG_RESULT([$enable_meta_info_embedding])
+    CS_EMIT_BUILD_PROPERTY([EMBED_META], [$enable_meta_info_embedding],
+       [], [], CS_EMITTER_OPTIONAL([$1]))])
+
+
+
+#------------------------------------------------------------------------------
+# _CS_META_INFO_EMBED_TOOLS([EMITTER])
+#      Helper for CS_META_INFO_EMBED() which searches for tools required for
+#      plugin meta-info embedding.
+#------------------------------------------------------------------------------
+AC_DEFUN([_CS_META_INFO_EMBED_TOOLS],
+    [CS_CHECK_TOOLS([WINDRES], [windres])
+    CS_EMIT_BUILD_PROPERTY([CMD.WINDRES], [$WINDRES], [], [],
+       CS_EMITTER_OPTIONAL([$1]))
+
+    CS_CHECK_TOOLS([OBJCOPY], [objcopy])
+    AS_IF([test -n "$OBJCOPY"],
+        [CS_EMIT_BUILD_PROPERTY([OBJCOPY.AVAILABLE], [yes], [], [],
+           CS_EMITTER_OPTIONAL([$1]))
+        CS_EMIT_BUILD_PROPERTY([CMD.OBJCOPY], [$OBJCOPY], [], [],
+           CS_EMITTER_OPTIONAL([$1]))])])
+
+
+
+#------------------------------------------------------------------------------
+# CS_CHECK_LIBBFD([EMITTER], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+#      Exhaustive check for a usable GPL-licensed libbfd, the Binary File
+#      Descriptor library, a component of binutils, which allows low-level
+#      manipulation of executable and object files.  If EMITTER is provided,
+#      then the following variables are recorded by invoking
+#      CS_EMIT_BUILD_PROPERTY() with EMITTER.  As a convenience, if EMITTER is
+#      the literal value "emit" or "yes", then CS_EMIT_BUILD_RESULT()'s
+#      default emitter will be used.
+#
+#      LIBBFD.AVAILABLE := yes or no
+#      LIBBFD.CFLAGS := libbfd compiler flags
+#      LIBBFD.LFLAGS := libbfd linker flags
+#
+#      The shell variable cs_cv_libbfd_ok is set to yes if a usable libbfd was
+#      discovered, else no. If found, the additional shell variables
+#      cs_cv_libbfd_ok_cflags, cs_cv_libbfd_ok_lflags, and
+#      cs_cv_libbfd_ok_libs are also set.
+#
+# WARNING
+#
+#      libbfd carries a GPL license which is incompatible with the LGPL
+#      license of Crystal Space. Do not use this library with projects under
+#      less restrictive licenses, such as LGPL.
+#
+# IMPLEMENTATION NOTES
+#
+#      It seems that some platforms have two version of libiberty installed:
+#      one from binutils and one from gcc.  The binutils version resides in
+#      /usr/lib, whereas the gcc version resides in the gcc installation
+#      directory.  The gcc version, by default, takes precedence at link time
+#      over the binutils version.  Unfortunately, in broken cases, the gcc
+#      version of libiberty is missing htab_create_alloc() which is required
+#      by some libbfd functions.  The extensive secondary check of libbfd
+#      catches this anomalous case of broken gcc libiberty.  It turns out that
+#      it is possible to make the linker prefer the binutils version by
+#      specifying -L/usr/lib, thus the extensive test attempts to do so in an
+#      effort to resolve this unfortunate issue.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_CHECK_LIBBFD],
+    [CS_CHECK_LIB_WITH([bfd],
+       [AC_LANG_PROGRAM([[#include <bfd.h>]], [bfd_init();])],
+       [], [], [], [], [], [], [-liberty])
+
+    AS_IF([test $cs_cv_libbfd = yes],
+       [CS_CHECK_BUILD([if libbfd is usable], [cs_cv_libbfd_ok],
+           [AC_LANG_PROGRAM([[#include <bfd.h>]],
+               [bfd* p;
+               asection* s;
+               bfd_init();
+               p = bfd_openr(0,0);
+               bfd_check_format(p,bfd_object);
+               bfd_get_section_by_name(p,0);
+               bfd_section_size(p,s);
+               bfd_get_section_contents(p,s,0,0,0);
+               bfd_close(p);])],
+           [CS_CREATE_TUPLE() CS_CREATE_TUPLE([],[-L/usr/lib],[])],
+           [], [], [], [],
+           [$cs_cv_libbfd_cflags],
+           [$cs_cv_libbfd_lflags],
+           [$cs_cv_libbfd_libs])],
+       [cs_cv_libbfd_ok=no])
+
+    AS_IF([test $cs_cv_libbfd_ok = yes],
+       [CS_EMIT_BUILD_RESULT([cs_cv_libbfd_ok], [LIBBFD],
+           CS_EMITTER_OPTIONAL([$1]))
+       $2],
+       [$3])])
diff --git a/mk/autoconf/emit.m4 b/mk/autoconf/emit.m4
new file mode 100644 (file)
index 0000000..1f2c377
--- /dev/null
@@ -0,0 +1,172 @@
+# emit.m4                                                      -*- Autoconf -*-
+#==============================================================================
+# Copyright (C)2003-2005 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#==============================================================================
+AC_PREREQ([2.56])
+
+#------------------------------------------------------------------------------
+# CS_EMIT_BUILD_PROPERTY(KEY, VALUE, [APPEND], [EMPTY-OKAY], [EMITTER],
+#                        [UNCONDITIONAL])
+#      A utility function which invokes an emitter to record the KEY/VALUE
+#      tuple if VALUE is not the empty string (after leading and trailing
+#      whitespace is stripped). If EMPTY-OKAY is not an empty string, then the
+#      property is emitted even if VALUE is empty; that is, it is emitted
+#      unconditionally.  If APPEND is the empty string, then the emitter sets
+#      the key's value directly (though it may be overridden by the
+#      environment), otherwise the emitter appends VALUE to the existing value
+#      of the key.  EMITTER is a macro name, such as CS_JAMCONFIG_PROPERTY or
+#      CS_MAKEFILE_PROPERTY, which performs the actual task of emitting the
+#      KEY/VALUE tuple; it should also accept APPEND as an optional third
+#      argument. If EMITTER is omitted, CS_JAMCONFIG_PROPERTY is used.  Some
+#      emitters accept an optional fourth argument, UNCONDITIONAL, which
+#      instructs it to set KEY's value unconditionally, even if KEY already
+#      had been assigned a value via some other mechanism (such as imported
+#      from the environment, or from Jambase, in the case of
+#      CS_JAMCONFIG_PROPERTY).
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_EMIT_BUILD_PROPERTY],
+    [cs_build_prop_val="$2"
+    cs_build_prop_val=CS_TRIM([$cs_build_prop_val])
+    m4_ifval([$4],
+       [CS_JAMCONFIG_PROPERTY([$1], [$cs_build_prop_val], [$3])],
+       AS_IF([test -n "$cs_build_prop_val"],
+           [m4_default([$5],[CS_JAMCONFIG_PROPERTY])(
+               [$1], [$cs_build_prop_val], [$3], [$6])]))])
+
+
+
+#------------------------------------------------------------------------------
+# CS_EMIT_BUILD_RESULT(CACHE-VAR, PREFIX, [EMITTER])
+#      Record the results of CS_CHECK_BUILD() or CS_CHECK_LIB_WITH() via some
+#      emitter.  If CACHE-VAR indicates that the build succeeded, then the
+#      following properties are emitted:
+#
+#      PREFIX.AVAILABLE = yes
+#      PREFIX.CFLAGS = $CACHE-VAR_cflags
+#      PREFIX.LFLAGS = $CACHE-VAR_lflags $CACHE-VAR_libs
+#
+#      EMITTER is a macro name, such as CS_JAMCONFIG_PROPERTY or
+#      CS_MAKEFILE_PROPERTY, which performs the actual task of emitting the
+#      KEY/VALUE tuple. If EMITTER is omitted, CS_JAMCONFIG_PROPERTY is used.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_EMIT_BUILD_RESULT],
+    [AS_IF([test "$$1" = yes],
+       [CS_EMIT_BUILD_PROPERTY([$2.AVAILABLE], [yes], [], [], [$3])
+       CS_EMIT_BUILD_PROPERTY([$2.CFLAGS], [$$1_cflags], [], [], [$3])
+       CS_EMIT_BUILD_PROPERTY([$2.LFLAGS], [$$1_lflags $$1_libs],
+           [], [], [$3])])])
+
+
+
+#------------------------------------------------------------------------------
+# CS_EMIT_BUILD_FLAGS(MESSAGE, CACHE-VAR, FLAGS, [LANGUAGE], EMITTER-KEY,
+#                     [APPEND], [ACTION-IF-RECOGNIZED],
+#                     [ACTION-IF-NOT-RECOGNIZED], [EMITTER])
+#      A convenience wrapper for CS_CHECK_BUILD_FLAGS() which also records the
+#      results via CS_EMIT_BUILD_PROPERTY().  Checks if the compiler or linker
+#      recognizes a command-line option.  MESSAGE is the "checking" message.
+#      CACHE-VAR is the shell cache variable which receives the flag
+#      recognized by the compiler or linker, or "no" if the flag was not
+#      recognized.  FLAGS is a whitespace- delimited list of build tuples
+#      created with CS_CREATE_TUPLE().  Each tuple from FLAGS is attempted in
+#      order until one is found which is recognized by the compiler.  After
+#      that, no further flags are checked.  LANGUAGE is typically either C or
+#      C++ and specifies which compiler to use for the test.  If LANGUAGE is
+#      omitted, C is used.  EMITTER-KEY is the name to pass as the emitter's
+#      "key" argument if a usable flag is encountered.  If APPEND is not the
+#      empty string, then the discovered flag is appended to the existing
+#      value of the EMITTER-KEY.  If the command-line option was recognized,
+#      then ACTION-IF-RECOGNIZED is invoked, otherwise
+#      ACTION-IF-NOT-RECOGNIZED is invoked.  EMITTER is a macro name, such as
+#      CS_JAMCONFIG_PROPERTY or CS_MAKEFILE_PROPERTY, which performs the
+#      actual task of emitting the KEY/VALUE tuple; it should also accept
+#      APPEND as an optional third argument. If EMITTER is omitted,
+#      CS_JAMCONFIG_PROPERTY is used.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_EMIT_BUILD_FLAGS],
+    [CS_CHECK_BUILD_FLAGS([$1], [$2], [$3], [$4],
+       [CS_EMIT_BUILD_PROPERTY([$5], [$$2], [$6], [], [$9])
+           $7],
+       [$8])])
+
+
+
+#------------------------------------------------------------------------------
+# CS_EMITTER_OPTIONAL([EMITTER])
+#      The CS_EMIT_FOO() macros optionally accept an emitter. If no emitter is
+#      supplied to those macros, then a default emitter is chosen.  Other
+#      macros, however, which perform testing and optionally emit the results
+#      may wish to interpret an omitted EMITTER as a request not to emit the
+#      results. CS_EMITTER_OPTIONAL() is a convenience macro to help in these
+#      cases. It should be passed to one of the CS_EMIT_FOO() macros in place
+#      of the literal EMITTER argument. It functions by re-interpretating
+#      EMITTER as follows:
+#
+#      - If EMITTER is omitted, then CS_NULL_EMITTER is returned, effectively
+#        disabling output by the CS_EMIT_FOO() macro.
+#      - If EMITTER is the literal string "emit" or "yes", then it returns an
+#        empty string, which signals to the CS_EMIT_FOO() macro that is should
+#        use its default emitter.
+#      - Any other value for EMITTER is passed along as-is to the
+#        CS_EMIT_FOO() macro.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_EMITTER_OPTIONAL],
+    [m4_case([$1],
+       [], [[CS_NULL_EMITTER]],
+       [emit], [],
+       [yes], [],
+       [[$1]])])
+
+
+
+#------------------------------------------------------------------------------
+# CS_NULL_EMITTER(KEY, VALUE, [APPEND])
+#      A do-nothing emitter suitable for use as the EMITTER argument of one of
+#      the CS_EMIT_FOO() macros.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_NULL_EMITTER], [:
+])
+
+
+
+#------------------------------------------------------------------------------
+# CS_SUBST_EMITTER(KEY, VALUE, [APPEND])
+#      An emitter wrapped around AC_SUBST(). Invokes
+#      AC_SUBST(AS_TR_SH(KEY),VALUE).  The APPEND argument is ignored.
+#      Suitable for use as the EMITTER argument of one of the CS_EMIT_FOO()
+#      macros.  The call to AS_TR_SH() ensures that KEY is transformed into a
+#      valid shell variable. For instance, if a macro attempts to emit
+#      MYLIB.CFLAGS and MYLIB.LFLAGS via CS_SUBST_EMITTER(), then the names
+#      will be transformed to MYLIB_CFLAGS and MYLIB_LFLAGS, respectively, for
+#      the invocation of AC_SUBST().
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_SUBST_EMITTER], [AC_SUBST(AS_TR_SH([$1]),[$2])])
+
+
+
+#------------------------------------------------------------------------------
+# CS_DEFINE_EMITTER(KEY, VALUE, [APPEND])
+#      An emitter wrapped around AC_DEFINE_UNQUOTED(). Invokes
+#      AC_DEFINE_UNQUOTED(AS_TR_CPP(KEY),VALUE).  The APPEND argument is
+#      ignored.  Suitable for use as the EMITTER argument of one of the
+#      CS_EMIT_FOO() macros. The call to AS_TR_CPP() ensures that KEY is a
+#      well-formed token for the C-preprocessor.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_DEFINE_EMITTER],
+    [AC_DEFINE_UNQUOTED(AS_TR_CPP([$1]),[$2],
+       [Define when feature is available])])
diff --git a/mk/autoconf/headercache.m4 b/mk/autoconf/headercache.m4
new file mode 100644 (file)
index 0000000..aa4b271
--- /dev/null
@@ -0,0 +1,48 @@
+# headercache.m4                                               -*- Autoconf -*-
+#==============================================================================
+# Copyright (C)2003 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#==============================================================================
+AC_PREREQ([2.56])
+
+#------------------------------------------------------------------------------
+# Text cache facility for C-style #define properties.  The cache is stored in
+# the shell variable cs_header_text.
+#
+# CS_HEADER_APPEND(TEXT)
+#      Append text to the C header text cache.  This is a cover for
+#      CS_TEXT_CACHE_APPEND().
+#
+# CS_HEADER_PREPEND(TEXT)
+#      Prepend text to the C header text cache.  This is a cover for
+#      CS_TEXT_CACHE_PREPEND().
+#
+# CS_HEADER_PROPERTY(KEY, [VALUE])
+#      Append a line of the form "#define KEY VALUE" to the C header text
+#      cache.  If the VALUE argument is omitted, then the appended line has
+#      the simplified form "#define KEY".
+#
+# CS_HEADER_OUTPUT(FILENAME)
+#      Instruct config.status to write the C header text cache to the given
+#      filename.  This is a cover for CS_TEXT_CACHE_OUTPUT().
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_HEADER_APPEND], [CS_TEXT_CACHE_APPEND([cs_header_text], [$1])])
+AC_DEFUN([CS_HEADER_PREPEND], [CS_TEXT_CACHE_PREPEND([cs_header_text], [$1])])
+AC_DEFUN([CS_HEADER_PROPERTY],
+[CS_HEADER_APPEND([@%:@define $1[]m4_ifval([$2], [ $2], [])
+])])
+AC_DEFUN([CS_HEADER_OUTPUT], [CS_TEXT_CACHE_OUTPUT([cs_header_text], [$1])])
diff --git a/mk/autoconf/install-sh b/mk/autoconf/install-sh
new file mode 100755 (executable)
index 0000000..b777f12
--- /dev/null
@@ -0,0 +1,322 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2004-07-05.00
+
+# 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 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 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:
diff --git a/mk/autoconf/installdirs.m4 b/mk/autoconf/installdirs.m4
new file mode 100644 (file)
index 0000000..238cee7
--- /dev/null
@@ -0,0 +1,100 @@
+#-----------------------------------------------------------------------------
+# installdirs.m4 (c) Matze Braun <matze@braunis.de>
+# Macro for emitting the installation paths gathered by Autoconf.
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#-----------------------------------------------------------------------------
+
+#-----------------------------------------------------------------------------
+# CS_OUTPUT_INSTALLDIRS([EMITTER], [RAW-BACKSLASHES])
+#   Emit installation directories collected by Autoconf.  EMITTER is a macro
+#   name, such as CS_JAMCONFIG_PROPERTY or CS_MAKEFILE_PROPERTY, which performs
+#   the actual task of emitting the KEY/VALUE tuple.  If EMITTER is omitted,
+#   CS_JAMCONFIG_PROPERTY is used.  If RAW-BACKSLASHES is not provided, then
+#   backslashes in emitted values are each escaped with an additional
+#   backslash. If RAW-BACKSLASHES is not the null value, then backslashes are
+#   emitted raw.  The following properties are emitted:
+#
+#       prefix
+#       exec_prefix
+#       bindir
+#       sbindir
+#       libexecdir
+#       datadir
+#       sysconfdir
+#       sharedstatedir
+#       localstatedir
+#       libdir
+#       includedir
+#       oldincludedir
+#       infodir
+#       mandir
+#-----------------------------------------------------------------------------
+AC_DEFUN([CS_OUTPUT_INSTALLDIRS],[
+# Handle the case when no prefix is given, and the special case when a path
+# contains more than 2 slashes, these paths seem to be correct but Jam fails
+# on them.
+AS_IF([test $prefix = NONE],
+    [cs_install_prefix="$ac_default_prefix"],
+    [cs_install_prefix=`echo "$prefix" | sed -e 's:///*:/:g'`])
+AS_IF([test $exec_prefix = NONE],
+    [cs_install_exec_prefix="AS_ESCAPE([$(prefix)])"],
+    [cs_install_exec_prefix=`echo "$exec_prefix" | sed -e 's:///*:/:g'`])
+
+_CS_OUTPUT_INSTALL_DIRS([$1], [prefix],
+    [CS_PREPARE_INSTALLPATH([$cs_install_prefix], [$2])])
+_CS_OUTPUT_INSTALL_DIRS([$1], [exec_prefix],
+    [CS_PREPARE_INSTALLPATH([$cs_install_exec_prefix], [$2])])
+_CS_OUTPUT_INSTALL_DIRS([$1], [bindir],
+    [CS_PREPARE_INSTALLPATH([$bindir], [$2])])
+_CS_OUTPUT_INSTALL_DIRS([$1], [sbindir],
+    [CS_PREPARE_INSTALLPATH([$sbindir], [$2])])
+_CS_OUTPUT_INSTALL_DIRS([$1], [libexecdir],
+    [CS_PREPARE_INSTALLPATH([$libexecdir], [$2])])
+_CS_OUTPUT_INSTALL_DIRS([$1], [datadir],
+    [CS_PREPARE_INSTALLPATH([$datadir], [$2])])
+_CS_OUTPUT_INSTALL_DIRS([$1], [sysconfdir], 
+    [CS_PREPARE_INSTALLPATH([$sysconfdir], [$2])])
+_CS_OUTPUT_INSTALL_DIRS([$1], [sharedstatedir], 
+    [CS_PREPARE_INSTALLPATH([$sharedstatedir], [$2])])
+_CS_OUTPUT_INSTALL_DIRS([$1], [localstatedir], 
+    [CS_PREPARE_INSTALLPATH([$localstatedir], [$2])])
+_CS_OUTPUT_INSTALL_DIRS([$1], [libdir],
+    [CS_PREPARE_INSTALLPATH([$libdir], [$2])])
+_CS_OUTPUT_INSTALL_DIRS([$1], [includedir], 
+    [CS_PREPARE_INSTALLPATH([$includedir], [$2])])
+_CS_OUTPUT_INSTALL_DIRS([$1], [oldincludedir], 
+    [CS_PREPARE_INSTALLPATH([$oldincludedir], [$2])])
+_CS_OUTPUT_INSTALL_DIRS([$1], [infodir],
+    [CS_PREPARE_INSTALLPATH([$infodir], [$2])])
+_CS_OUTPUT_INSTALL_DIRS([$1], [mandir],
+    [CS_PREPARE_INSTALLPATH([$mandir], [$2])])
+])
+
+AC_DEFUN([_CS_OUTPUT_INSTALL_DIRS],
+    [m4_default([$1], [CS_JAMCONFIG_PROPERTY])([$2], [$3])])
+
+
+#-----------------------------------------------------------------------------
+# CS_PREPARE_INSTALLPATH(VALUE, [RAW-BACKSLASHES])
+#   Transform variable references of the form ${bla} to $(bla) in VALUE and
+#   correctly quotes backslashes.  This is needed if you need to emit some of
+#   the paths from Autoconf. RAW-BACKSLASHES has the same meaning as in
+#   CS_OUTPUT_INSTALLDIRS.
+#-----------------------------------------------------------------------------
+AC_DEFUN([CS_PREPARE_INSTALLPATH],
+[`echo "$1" | sed 's/\${\([[a-zA-Z_][a-zA-Z_]]*\)}/$(\1)/g;m4_ifval([$2],
+    [s/\\/\\\\/g], [s/\\\\/\\\\\\\\/g])'`])
diff --git a/mk/autoconf/jamcache.m4 b/mk/autoconf/jamcache.m4
new file mode 100644 (file)
index 0000000..788fad7
--- /dev/null
@@ -0,0 +1,58 @@
+# jamcache.m4                                                  -*- Autoconf -*-
+#==============================================================================
+# Copyright (C)2003 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#==============================================================================
+AC_PREREQ([2.56])
+
+#------------------------------------------------------------------------------
+# Text cache facility for Jam-style properties.  The cache is stored in
+# the shell variable cs_jamfile_text.
+#
+# CS_JAMCONFIG_APPEND(TEXT)
+#      Append text to the Jam text cache.  This is a cover for
+#      CS_TEXT_CACHE_APPEND().
+#
+# CS_JAMCONFIG_PREPEND(TEXT)
+#      Prepend text to the Jam text cache.  This is a cover for
+#      CS_TEXT_CACHE_PREPEND().
+#
+# CS_JAMCONFIG_PROPERTY(KEY, VALUE, [APPEND], [UNCONDITIONAL])
+#      Append a line of the form "KEY ?= VALUE" to the Jam text cache.  If the
+#      APPEND argument is not the empty string, then VALUE is appended to the
+#      existing value of KEY using the form "KEY += VALUE".  If the
+#      UNCONDITIONAL argument is not empty, then the value of KEY is set
+#      unconditionally "KEY = VALUE", rather than via "KEY ?= VALUE".  APPEND
+#      takes precedence over UNCONDITIONAL.  Note that if VALUE references
+#      other Jam variables, for example $(OBJS), then be sure to protect the
+#      value with AS_ESCAPE().  For example:
+#      CS_JAMCONFIG_PROPERTY([ALLOBJS], [AS_ESCAPE([$(OBJS) $(LIBOBJS)])])
+#
+# CS_JAMCONFIG_OUTPUT(FILENAME)
+#      Instruct config.status to write the Jam text cache to the given
+#      filename.  This is a cover for CS_TEXT_CACHE_OUTPUT().
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_JAMCONFIG_APPEND],
+    [CS_TEXT_CACHE_APPEND([cs_jamconfig_text], [$1])])
+AC_DEFUN([CS_JAMCONFIG_PREPEND],
+    [CS_TEXT_CACHE_PREPEND([cs_jamconfig_text], [$1])])
+AC_DEFUN([CS_JAMCONFIG_PROPERTY],
+    [CS_JAMCONFIG_APPEND(
+       [$1 m4_ifval([$3], [+=], m4_ifval([$4], [=], [?=])) \"$2\" ;
+])])
+AC_DEFUN([CS_JAMCONFIG_OUTPUT],
+    [CS_TEXT_CACHE_OUTPUT([cs_jamconfig_text], [$1])])
diff --git a/mk/autoconf/makecache.m4 b/mk/autoconf/makecache.m4
new file mode 100644 (file)
index 0000000..bab31fe
--- /dev/null
@@ -0,0 +1,53 @@
+# makecache.m4                                                 -*- Autoconf -*-
+#==============================================================================
+# Copyright (C)2003 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#==============================================================================
+AC_PREREQ([2.56])
+
+#------------------------------------------------------------------------------
+# Text cache facility for makefile-style properties.  The cache is stored in
+# the shell variable cs_makefile_text.
+#
+# CS_MAKEFILE_APPEND(TEXT)
+#      Append text to the makefile text cache.  This is a cover for
+#      CS_TEXT_CACHE_APPEND().
+#
+# CS_MAKEFILE_PREPEND(TEXT)
+#      Prepend text to the makefile text cache.  This is a cover for
+#      CS_TEXT_CACHE_PREPEND().
+#
+# CS_MAKEFILE_PROPERTY(KEY, VALUE, [APPEND])
+#      Append a line of the form "KEY = VALUE" to the makefile text cache.  If
+#      the APPEND argument is not the empty string, then VALUE is appended to
+#      the existing value of KEY using the form "KEY += VALUE".  Note that if
+#      VALUE references other makefile variables, for example $(OBJS), then be
+#      sure to protect the value with AS_ESCAPE().  For example:
+#      CS_MAKEFILE_PROPERTY([ALLOBJS], [AS_ESCAPE([$(OBJS) $(LIBOBJS)])])
+#
+# CS_MAKEFILE_OUTPUT(FILENAME)
+#      Instruct config.status to write the makefile text cache to the given
+#      filename.  This is a cover for CS_TEXT_CACHE_OUTPUT().
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_MAKEFILE_APPEND],
+    [CS_TEXT_CACHE_APPEND([cs_makefile_text], [$1])])
+AC_DEFUN([CS_MAKEFILE_PREPEND],
+    [CS_TEXT_CACHE_PREPEND([cs_makefile_text], [$1])])
+AC_DEFUN([CS_MAKEFILE_PROPERTY],
+    [CS_MAKEFILE_APPEND([$1 m4_ifval([$3], [+=], [=]) $2
+])])
+AC_DEFUN([CS_MAKEFILE_OUTPUT],[CS_TEXT_CACHE_OUTPUT([cs_makefile_text], [$1])])
diff --git a/mk/autoconf/mkdir.m4 b/mk/autoconf/mkdir.m4
new file mode 100644 (file)
index 0000000..d60ea45
--- /dev/null
@@ -0,0 +1,93 @@
+# mkdir.m4                                                     -*- Autoconf -*-
+#==============================================================================
+# Copyright (C)2003 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#==============================================================================
+AC_PREREQ([2.56])
+
+#------------------------------------------------------------------------------
+# CS_CHECK_MKDIR
+#      Determine how to create a directory and a directory tree. Sets the
+#      shell variable MKDIR to the command which creates a directory, and
+#      MKDIRS to the command which creates a directory tree. Invokes
+#      AC_SUBST() for MKDIR and MKDIRS.
+#
+# IMPLEMENTATION NOTES
+#      We need to know the exact commands, so that we can emit them, thus the
+#      AS_MKDIR_P function is not what we want to use here since it does not
+#      provide access to the commands (and might not even discover suitable
+#      commands).  First try "mkdir -p", then try the older "mkdirs".
+#      Finally, if the mkdir command failed to recognize -p, then it might
+#      have created a directory named "-p", so clean up that bogus directory.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_CHECK_MKDIR],
+    [AC_CACHE_CHECK([how to create a directory], [cs_cv_shell_mkdir],
+       [cs_cv_shell_mkdir='mkdir'])
+    AC_SUBST([MKDIR], [$cs_cv_shell_mkdir])
+
+    AC_CACHE_CHECK([how to create a directory tree], [cs_cv_shell_mkdir_p],
+       [if $cs_cv_shell_mkdir -p . 2>/dev/null; then
+           cs_cv_shell_mkdir_p='mkdir -p'
+       elif mkdirs . 2>/dev/null; then
+           cs_cv_shell_mkdir_p='mkdirs'
+       fi
+       test -d ./-p && rmdir ./-p])
+    AS_VAR_SET_IF([cs_cv_shell_mkdir_p],
+       [AC_SUBST([MKDIRS], [$cs_cv_shell_mkdir_p])],
+       [CS_MSG_ERROR([do not know how to create a directory tree])])])
+
+
+
+#------------------------------------------------------------------------------
+# Replacement for AS_MKDIR_P() from m4sugar/m4sh.m4 which fixes two problems
+# which are present in Autoconf 2.57 and probably all earlier 2.5x versions.
+# This bug, along with a patch, was submitted to the Autoconf GNATS database by
+# Eric Sunshine as #227 on 17-Dec-2002.  The bogus "-p" directory bug was fixed
+# for Autoconf 2.58 on 26-Sep-2003.  The "mkdirs" optimization was not accepted
+# (since it is unnecessary; it's only an optimization).
+#
+# 1) Removes bogus "-p" directory which the stock AS_MKDIR_P() leaves laying
+#    around in the working directory if the mkdir command does not recognize
+#    the -p option.
+# 2) Takes advantage of the older "mkdirs" program if it exists and if "mkdir
+#    -p" does not work.
+#------------------------------------------------------------------------------
+m4_defun([_AS_MKDIR_P_PREPARE],
+[if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p'
+elif mkdirs . 2>/dev/null; then
+  as_mkdir_p='mkdirs'
+else
+  as_mkdir_p=''
+fi
+test -d ./-p && rmdir ./-p
+])# _AS_MKDIR_P_PREPARE
+
+m4_define([AS_MKDIR_P],
+[AS_REQUIRE([_$0_PREPARE])dnl
+{ if test -n "$as_mkdir_p"; then
+    $as_mkdir_p $1
+  else
+    as_dir=$1
+    as_dirs=
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`AS_DIRNAME("$as_dir")`
+    done
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || AS_ERROR([cannot create directory $1]); }
+])# AS_MKDIR_P
diff --git a/mk/autoconf/packageinfo.m4 b/mk/autoconf/packageinfo.m4
new file mode 100644 (file)
index 0000000..bba4fb2
--- /dev/null
@@ -0,0 +1,68 @@
+#==============================================================================
+# packageinfo.m4
+#    Macros for setting general info on the package, such as name and version
+#    numbers and propagate them to the generated make and Jam property files.
+#
+# Copyright (C)2003 by Matthias Braun <matze@braunis.de>
+# Copyright (C)2003,2004 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#==============================================================================
+
+#------------------------------------------------------------------------------
+# CS_PACKAGEINFO([LONGNAME], [COPYRIGHT, [HOMEPAGE])
+#      Set additional information for the package.  Note that the version
+#      number of your application should only contain numbers, because on
+#      Windows you can only set numerical values in some of the file
+#      properties (such as versioninfo .rc files).
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_PACKAGEINFO],
+    [PACKAGE_LONGNAME="[$1]"
+    PACKAGE_COPYRIGHT="[$2]"
+    PACKAGE_HOMEPAGE="[$3]"
+])
+
+
+#------------------------------------------------------------------------------
+# CS_EMIT_PACKAGEINFO([EMITTER])
+#      Emit extended package information using the provided EMITTER.  EMITTER
+#      is a macro name, such as CS_JAMCONFIG_PROPERTY or CS_MAKEFILE_PROPERTY,
+#      which performs the actual task of emitting the KEY/VALUE tuple.  If
+#      EMITTER is omitted, CS_JAMCONFIG_PROPERTY is used.  For backward
+#      compatibility, if EMITTER is the literal value "jam", then
+#      CS_JAMCONFIG_PROPERTY is used; if it is "make", then
+#      CS_MAKEFILE_PROPERTY is used; however use of these literal names is
+#      highly discouraged.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_EMIT_PACKAGEINFO],
+    [_CS_EMIT_PACKAGEINFO([$1], [PACKAGE_NAME], [$PACKAGE_NAME])
+    _CS_EMIT_PACKAGEINFO([$1], [PACKAGE_VERSION], [$PACKAGE_VERSION])
+    _CS_EMIT_PACKAGEINFO([$1], [PACKAGE_STRING], [$PACKAGE_STRING])
+    _CS_EMIT_PACKAGEINFO([$1], [PACKAGE_BUGREPORT], [$PACKAGE_BUGREPORT])
+    _CS_EMIT_PACKAGEINFO([$1], [PACKAGE_LONGNAME], [$PACKAGE_LONGNAME])
+    _CS_EMIT_PACKAGEINFO([$1], [PACKAGE_HOMEPAGE], [$PACKAGE_HOMEPAGE])
+    _CS_EMIT_PACKAGEINFO([$1], [PACKAGE_COPYRIGHT], [$PACKAGE_COPYRIGHT])
+    for cs_veritem in m4_translit(AC_PACKAGE_VERSION, [.], [ ]); do
+       _CS_EMIT_PACKAGEINFO([$1], [PACKAGE_VERSION_LIST], [$cs_veritem], [+])
+    done
+    ])
+
+AC_DEFUN([_CS_EMIT_PACKAGEINFO],
+    [m4_case([$1],
+       [make], [CS_MAKEFILE_PROPERTY([$2], [$3], [$4])],
+       [jam], [CS_JAMCONFIG_PROPERTY([$2], [$3], [$4])],
+       [], [CS_JAMCONFIG_PROPERTY([$2], [$3], [$4])],
+       [$1([$2], [$3], [$4])])])
diff --git a/mk/autoconf/path.m4 b/mk/autoconf/path.m4
new file mode 100644 (file)
index 0000000..cdb7ebd
--- /dev/null
@@ -0,0 +1,37 @@
+# path.m4                                                      -*- Autoconf -*-
+#==============================================================================
+# Copyright (C)2004 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#==============================================================================
+AC_PREREQ([2.56])
+
+#------------------------------------------------------------------------------
+# CS_PATH_NORMALIZE(STRING)
+#      Normalize a pathname at run-time by transliterating Windows/DOS
+#      backslashes to forward slashes.  Also collapses whitespace.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_PATH_NORMALIZE],
+[`echo "x$1" | tr '\\\\' '/' | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`])
+
+
+#------------------------------------------------------------------------------
+# CS_RUN_PATH_NORMALIZE(COMMAND)
+#      Normalize the pathname emitted by COMMAND by transliterating
+#      Windows/DOS backslashes to forward slashes.  Also collapses whitespace.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_RUN_PATH_NORMALIZE],
+[`AC_RUN_LOG([$1]) | tr '\\\\' '/' | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`])
diff --git a/mk/autoconf/progver.m4 b/mk/autoconf/progver.m4
new file mode 100644 (file)
index 0000000..c279a5e
--- /dev/null
@@ -0,0 +1,207 @@
+###############################################################################
+# progver.m4
+# Written by Norman Kramer <norman@users.sourceforge.net>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+###############################################################################
+#
+# From the input pattern we create regular expressions we send through sed
+# to extract the version information from the standard input to sed.
+# Then we extract from the resulting version string subparts.
+# The same happens with the supplied version string. It too is split into its
+# subparts according to the pattern.
+# Then the subparts from the gathered version string and the supplied one are
+# compared.
+#
+# How does the pattern look like ?
+# It is a sequence of 9s and _s and separators.
+# 9 denotes a non empty sequence of digits.
+# _ denotes a non empty sequence of characters from the class [a-zA-Z].
+# | everything behind is optional
+# Everything else is treated as a separator.
+# Consecutive 9s and _s are compressed to contain only one of each type.
+# For instance "99_.9.__abc9_" will become "9_.9._abc9_".
+#
+# How we find the parts we compare ?
+# From this transformed string we yield the parts we will later compare.
+# We break up the string as follows:
+# Any sequence of separators represent one breakup. Additional breakups are
+# placed behind every 9 and _ .
+# So the example from above will give:
+#
+# "99_.9.__abc9_"  ===compress==> "9_.9._abc9_" ===breakup==> "9" "_" "9" "_" "9" "_"
+#
+# How we create the regular expressions ?
+# We take the compressed pattern and quote every separator.
+# The we replace the 9s with [0-9][0-9]*
+# and the _s with [a-zA-Z][a-zA-Z]* .
+# The above example will become:
+#
+# "99_.9.__abc9_"  ===compress==> "9_.9._abc9_" ===rexify==>
+# [0-9][0-9]*[a-zA-Z][a-zA-Z]*\.[0-9][0-9]*\.[a-zA-Z][a-zA-Z]*\a\b\c[0-9][0-9]*[a-zA-Z][a-zA-Z]*
+#
+# Voila.
+#
+# To yield the subparts from the string we additionally enclose the
+# 9s and _s with \( and \).
+#
+###############################################################################
+
+# ****************************************************************
+# **                      helper definitions                    **
+# ****************************************************************
+m4_define([CS_VCHK_RUNTH], [m4_pushdef([i], [$1])m4_if($1,0,,[CS_VCHK_RUNTH(m4_decr($1), [$2])][$2])m4_popdef([i])])
+m4_define([CS_VCHK_PREFIX], [])
+m4_define([CS_VCHK_SUFFIX], [])
+m4_define([CS_VCHK_GROUPPREFIX], [\(])
+m4_define([CS_VCHK_GROUPSUFFIX], [\)])
+m4_define([CS_VCHK_CHAR], [[[[a-zA-Z]]]])
+m4_define([CS_VCHK_DIGIT], [[[0-9]]])
+m4_define([CS_VCHK_SEQUENCE], [CS_VCHK_PREFIX[]CS_VCHK_SINGLE[]CS_VCHK_SINGLE[]*CS_VCHK_SUFFIX[]])
+m4_define([CS_VCHK_OPTSEQUENCE], [CS_VCHK_PREFIX[]CS_VCHK_SINGLE[]*CS_VCHK_SUFFIX[]])
+m4_define([CS_VCHK_REXSEQ], [m4_bpatsubst($1, [$2], [[]CS_VCHK_SEQUENCE[]])])
+m4_define([CS_VCHK_GROUPINGON], [m4_pushdef([CS_VCHK_PREFIX], [CS_VCHK_GROUPPREFIX])m4_pushdef([CS_VCHK_SUFFIX], [CS_VCHK_GROUPSUFFIX])])
+m4_define([CS_VCHK_GROUPINGOFF], [m4_popdef([CS_VCHK_SUFFIX])m4_popdef([CS_VCHK_PREFIX])])
+m4_define([CS_VCHK_OPTON], [m4_pushdef([CS_VCHK_SEQUENCE], [CS_VCHK_OPTSEQUENCE])])
+m4_define([CS_VCHK_OPTOFF], [m4_popdef([CS_VCHK_SEQUENCE])])
+m4_define([CS_VCHK_RMOPT], [CS_VCHK_RMCHAR([$1], m4_index([$1], [|]))])
+m4_define([CS_VCHK_RMCHAR], [m4_if($2,-1,[$1],m4_substr([$1], 0, $2)[]m4_substr([$1], m4_incr($2)))])
+m4_define([CS_VCHK_RMALL], [m4_translit([$1], [|], [])])
+m4_define([CS_VCHK_CUTOFF], [m4_if(m4_index($1,[|]),-1, [$1], [m4_substr($1, 0, m4_index($1,[|]))])])
+m4_define([CS_VCHK_CYCLEOPT], [
+m4_if($2,-1,, [m4_pushdef([i], CS_VCHK_CUTOFF([$1])) m4_pushdef([j], CS_VCHK_DUMMY_TAIL([$1])) CS_VCHK_CYCLEOPT( CS_VCHK_RMOPT([$1]), m4_index($1, [|]), [$3])$3 m4_popdef([i]) m4_popdef([j])])
+])
+m4_define([CS_VCHK_TAIL], [m4_if(m4_index($1,[|]),-1, [], [m4_substr($1, m4_incr(m4_index($1,[|])))])])
+m4_define([CS_VCHK_DUMMY_COMPRESS], [m4_bpatsubst(m4_bpatsubst([$1], [__*], [A]), [99*], [0])])
+m4_define([CS_VCHK_DUMMY_TAIL], [CS_VCHK_DUMMY_COMPRESS(m4_translit(CS_VCHK_TAIL([$1]), [|], []))])
+
+# ****************************************************************
+# **                      FlagsOn / FlagsOff                    **
+# ****************************************************************
+m4_define([CS_VCHK_FLAGSON],
+[m4_if($#, 0, [],
+       $1, [], [],
+       [$1], [group], [CS_VCHK_GROUPINGON[]],
+       [$1], [opt], [CS_VCHK_OPTON[]])dnl
+m4_if($#, 0, [], $1, [], [], [CS_VCHK_FLAGSON(m4_shift($@))])])
+
+m4_define([CS_VCHK_FLAGSOFF],
+[m4_if($#, 0, [],
+       $1, [], [],
+       $1, [group], [CS_VCHK_GROUPINGOFF[]],
+       [$1], [opt], [CS_VCHK_OPTOFF[]])dnl
+m4_if($#, 0, [], $1, [], [], [CS_VCHK_FLAGSOFF(m4_shift($@))])])
+
+# ****************************************************************
+# **                      rexify / sedify                       **
+# ****************************************************************
+m4_define([CS_VCHK_REXIFY],
+[m4_pushdef([CS_VCHK_SINGLE], [$1])dnl
+CS_VCHK_FLAGSON(m4_shift(m4_shift(m4_shift($@))))dnl
+CS_VCHK_REXSEQ([$3], [$2])dnl
+CS_VCHK_FLAGSOFF(m4_shift(m4_shift(m4_shift($@))))dnl
+m4_popdef([CS_VCHK_SINGLE])])
+
+m4_define([CS_VCHK_QUOTESEP], [m4_bpatsubst($1, [[^9_]], [\\\&])])
+
+m4_define([CS_VCHK_REXCHAR], [CS_VCHK_REXIFY([CS_VCHK_CHAR], [__*], $@)])
+m4_define([CS_VCHK_REXDIGIT],  [CS_VCHK_REXIFY([CS_VCHK_DIGIT], [99*], $@)])
+m4_define([CS_VCHK_SEDIFY], [CS_VCHK_REXDIGIT([CS_VCHK_REXCHAR([CS_VCHK_QUOTESEP([$1])], m4_shift($@))], m4_shift($@))])
+m4_define([CS_VCHK_SEDEXPRALL], [/CS_VCHK_SEDIFY([$1])/!d;s/.*\(CS_VCHK_SEDIFY([$1])\).*/\1/;q])
+m4_define([CS_VCHK_SEDEXPRNTH], [/CS_VCHK_SEDIFY([$1])/!d;s/.*CS_VCHK_SEDIFY([$1],[group]).*/\$2/])
+
+# ****************************************************************
+# **                      Pattern splitting                     **
+# ****************************************************************
+m4_define([CS_VCHK_SPLITSEP], [CS_VCHK_REXIFY([s], [[^9_][^9_]*], $@)])
+m4_define([CS_VCHK_SPLITDIGIT], [CS_VCHK_REXIFY([d], [99*], $@)])
+m4_define([CS_VCHK_SPLITCHAR], [CS_VCHK_REXIFY([c], [__*], $@)])
+
+# ****************************************************************
+# ** return a list of 's' 'd' 'c' 'e' chars denoting the kind   **
+# ** pattern parts: separator, digit, char, end                 **
+# ****************************************************************
+m4_define([CS_VCHK_PATTERNLIST], [m4_pushdef([CS_VCHK_SEQUENCE], [CS_VCHK_SINGLE ])dnl
+m4_translit(CS_VCHK_SPLITDIGIT([CS_VCHK_SPLITCHAR([CS_VCHK_SPLITSEP([$1])])]), [ ], m4_if([$2],[],[ ],[$2]))e[]dnl
+m4_popdef([CS_VCHK_SEQUENCE])])
+
+# ****************************************************************
+# ** Build the shell commands we emit to the configure script.  **
+# ****************************************************************
+m4_define([CS_VCHK_PATCOUNT], [m4_len(m4_bpatsubst(CS_VCHK_PATTERNLIST([$1]), [[^dc]]))])
+
+# ****************************************************************************************
+# ** CS_VCHK_EXTRACTVERSION(EXTRACT_CALL, MIN_VERSION, PATTERN, PRGPREFIX, COMPARISION) **
+# ****************************************************************************************
+m4_define([CS_VCHK_EXTRACTVERSION],
+[cs_prog_$4_is_version=
+cs_prog_$4_min_version=
+cs_prog_$4_is_suffix=
+cs_prog_$4_min_suffix=
+cs_prog_$4_is_suffix_done=
+cs_prog_$4_min_suffix_done=
+CS_VCHK_CYCLEOPT([$3], [], 
+[test -z $cs_prog_$4_is_version && cs_prog_$4_is_version=`$1 | sed 'CS_VCHK_SEDEXPRALL([i])'`
+test -n "$cs_prog_$4_is_version" && test -z $cs_prog_$4_is_suffix_done  && { cs_prog_$4_is_suffix_done=yes ; cs_prog_$4_is_suffix=j ; }
+])
+CS_VCHK_CYCLEOPT([$3], , 
+[test -z $cs_prog_$4_min_version && cs_prog_$4_min_version=`echo $2 | sed 'CS_VCHK_SEDEXPRALL([i])'`
+test -n "$cs_prog_$4_min_version" && test -z $cs_prog_$4_min_suffix_done  && { cs_prog_$4_min_suffix_done=yes ; cs_prog_$4_min_suffix=j ; }
+])
+CS_VCHK_RUNTH([CS_VCHK_PATCOUNT([$3])],
+    [cs_prog_$4_is_ver_[]i=`echo ${cs_prog_$4_is_version}${cs_prog_$4_is_suffix} | sed 'CS_VCHK_SEDEXPRNTH([CS_VCHK_RMALL([$3])], [i])'`
+])
+CS_VCHK_RUNTH([CS_VCHK_PATCOUNT([$3])],
+    [cs_prog_$4_min_ver_[]i=`echo $cs_prog_$4_min_version${cs_prog_$4_min_suffix} | sed 'CS_VCHK_SEDEXPRNTH([CS_VCHK_RMALL([$3])], [i])'`
+])
+cs_cv_prog_$4_version_ok=''
+CS_VCHK_RUNTH([CS_VCHK_PATCOUNT([$3])],
+[test -z "$cs_cv_prog_$4_version_ok" && { expr "$cs_prog_$4_is_ver_[]i" "$5" "$cs_prog_$4_min_ver_[]i" >/dev/null || cs_cv_prog_$4_version_ok=no ; }
+test -z "$cs_cv_prog_$4_version_ok" && { expr "$cs_prog_$4_min_ver_[]i" "$5" "$cs_prog_$4_is_ver_[]i" >/dev/null || cs_cv_prog_$4_version_ok=yes ; }
+])
+AS_IF([test -z "$cs_cv_prog_$4_version_ok"], [cs_cv_prog_$4_version_ok=yes])
+cs_cv_prog_$4_version_ok_annotated="$cs_cv_prog_$4_version_ok"
+AS_IF([test -n "$cs_prog_$4_is_version"],
+    [cs_cv_prog_$4_version_ok_annotated="$cs_cv_prog_$4_version_ok_annotated (version $cs_prog_$4_is_version)"])
+])
+
+##############################################################################
+# CS_CHECK_PROG_VERSION(PROG, EXTRACT_CALL, VERSION, PATTERN,
+#                       [ACTION-IF-OKAY], [ACTION-IF-NOT-OKAY], [CMP])
+# Check the version of a program PROG.
+# Version information is emitted by EXTRACT_CALL (for instance "bison -V").
+# The discovered program version is compared against VERSION.
+# The pattern of the version string matches PATTERN
+# The extracted version and the supplied version are compared with the CMP
+# operator. i.e. EXTRACTED_VERSION CMP SUPPLIED_VERSION
+# CMP defaults to >= if not specified.
+# ACTION-IF-OKAY is invoked if comparision yields true, otherwise
+# ACTION-IF-NOT-OKAY is invoked.
+#
+# PATTERN literals: 9 .. marks a non empty sequence of digits
+#                   _ .. marks a non empty sequence of characters from [a-zA-Z]
+#                   | .. everything behind is optional
+#                     .. everything else is taken as separator - it is better
+#                        to not try stuff like space, slash or comma.
+#
+# The test results in cs_cv_prog_PROG_version_ok being either yes or no.
+##############################################################################
+AC_DEFUN([CS_CHECK_PROG_VERSION],
+[AC_CACHE_CHECK([if $1 version m4_default([$7],[>=]) $3],
+    [AS_TR_SH([cs_cv_prog_$1_version_ok_annotated])],
+    [CS_VCHK_EXTRACTVERSION([$2], [$3], [$4], AS_TR_SH([$1]),
+       m4_default([$7],[>=]))])
+AS_IF([test "$AS_TR_SH([cs_cv_prog_$1_version_ok])" = yes], [$5], [$6])])
diff --git a/mk/autoconf/qualify.m4 b/mk/autoconf/qualify.m4
new file mode 100644 (file)
index 0000000..37c56c7
--- /dev/null
@@ -0,0 +1,46 @@
+# qualify.m4                                                   -*- Autoconf -*-
+#==============================================================================
+# Copyright (C)2005 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#==============================================================================
+AC_PREREQ([2.56])
+
+#------------------------------------------------------------------------------
+# CS_SYMBOL_QUALIFIER(MESSAGE, CACHE-VAR, QUALIFIERS, [SYMBOL], [LANG],
+#                    [ACTION-IF-ACCEPTED], [ACTION-IF-NOT-ACCEPTED])
+#      Test if a symbol can be qualified by one of the elements of the
+#      comma-separated list of QUALIFIERS.  Examples of qualifiers include
+#      __attribute__((deprecated)), __declspec(dllimport), etc. MESSAGE is the
+#      "checking" message. CACHE-VAR is the variable which receives the
+#      qualifier which succeeded, or the the literal "no" if none were
+#      accepted. SYMBOL is the symbol to which the qualifier should be
+#      applied. If omitted, then SYMBOL defaults to "void f();". LANG is the
+#      language of the test, typically "C" or "C++". It defaults to "C" if
+#      omitted. ACTION-IF-ACCEPTED is invoked after CACHE-VAR is set if one of
+#      the qualifiers is accepted, else ACTION-IF-NOT-ACCEPTED is invoked.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_SYMBOL_QUALIFIER],
+    [AC_CACHE_CHECK([$1], [$2],
+       [$2='no'
+       m4_foreach([cs_symbol_qualifier], [$3],
+           [AS_IF([test "$$2" = no],
+               [CS_BUILD_IFELSE(
+                   [AC_LANG_PROGRAM(
+                       [cs_symbol_qualifier m4_default([$4],[void f()]);],
+                       [])],
+                   [], [$5], [$2='cs_symbol_qualifier'], [$2='no'])])])])
+    AS_IF([test $$2 != no], [$6], [$7])])
diff --git a/mk/autoconf/split.m4 b/mk/autoconf/split.m4
new file mode 100644 (file)
index 0000000..5bd4ad0
--- /dev/null
@@ -0,0 +1,49 @@
+# split.m4                                                     -*- Autoconf -*-
+#==============================================================================
+# Copyright (C)2003 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#==============================================================================
+AC_PREREQ([2.56])
+
+#------------------------------------------------------------------------------
+# CS_SPLIT(LINE, [OUTPUT-VARIABLES], [DELIMITER], [FILLER])
+#      Split LINE into individual tokens.  Tokens are delimited by DELIMITER,
+#      which is the space character if omitted.  OUTPUT-VARIABLES is a
+#      comma-delimited list of shell variables which should receive the
+#      extracted tokens.  If there are too few tokens to fill the output
+#      variables, then the excess variables will be assigned the empty string.
+#      If there are too few output variables, then the excess tokens will be
+#      ignored.  If OUTPUT-VARIABLES is omitted, then the split tokens will be
+#      assigned to the shell meta-variables $1, $2, $3, etc.  When
+#      OUTPUT-VARIABLES is omitted, FILLER is assigned to meta-variables in
+#      cases where DELIMITER delimits a zero-length token.  FILLER defaults
+#      to "filler".  For example, if DELIMITER is "+" and OUTPUT-VARIABLES is
+#      omitted, given the line "one++three", $1 will be "one", $2 will be
+#      "filler", and $3 will be "three".
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_SPLIT],
+    [m4_define([cs_split_filler], m4_default([$4],[filler]))
+    set cs_split_filler `echo "$1" | awk 'BEGIN { FS="m4_default([$3],[ ])" }
+       { for (i=1; i <= NF; ++i)
+           { if ($i == "") print "cs_split_filler"; else print $i } }'`
+    shift
+    m4_map([_CS_SPLIT], [$2])])
+
+AC_DEFUN([_CS_SPLIT],
+    [AS_IF([test $[@%:@] -eq 0], [$1=''],
+       [AS_IF([test "$[1]" = cs_split_filler], [$1=''], [$1=$[1]])
+       shift])])
diff --git a/mk/autoconf/textcache.m4 b/mk/autoconf/textcache.m4
new file mode 100644 (file)
index 0000000..9b412da
--- /dev/null
@@ -0,0 +1,78 @@
+# textcache.m4                                                 -*- Autoconf -*-
+#==============================================================================
+# Copyright (C)2003 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#==============================================================================
+AC_PREREQ([2.56])
+
+#------------------------------------------------------------------------------
+# Text cache facility.  These macros provide a way to incrementally store
+# arbitrary text in a shell variable, and to write the saved text to a file.
+#
+# CS_TEXT_CACHE_APPEND(VARIABLE, TEXT)
+#      Append text to the contents of the named shell variable.  If the text
+#      contains references to shell variables (such as $foo), then those
+#      references will be expanded.  If expansion is not desired, then protect
+#      the text with AS_ESCAPE().
+#
+# CS_TEXT_CACHE_PREPEND(VARIABLE, TEXT)
+#      Prepend text to the contents of the named shell variable.  If the text
+#      contains references to shell variables (such as $foo), then those
+#      references will be expanded.  If expansion is not desired, then protect
+#      the text with AS_ESCAPE().
+#
+# CS_TEXT_CACHE_OUTPUT(VARIABLE, FILENAME)
+#      Instruct config.status to write the contents of the named shell
+#      variable to the given filename.  If the file resides in a directory,
+#      the directory will be created, if necessary.  If the output file
+#      already exists, and if the cached text is identical to the contents of
+#      the existing file, then the existing file is left alone, thus its time
+#      stamp remains unmolested.  This heuristic may help to minimize rebuilds
+#      when the file is listed as a dependency in a makefile.
+#
+# *NOTE*
+#      There is a bug in Autoconf 2.57 and probably all earlier 2.5x versions
+#      which results in errors if AC_CONFIG_COMMANDS is invoked for a `tag'
+#      which represents a file in a directory which does not yet exist.
+#      Unfortunately, even invoking AS_MKDIR_P in the `cmd' portion of
+#      AC_CONFIG_COMMANDS does not solve the problem because the generated
+#      configure script attempts to access information about the directory
+#      before AS_MKDIR_P has a chance to create it.  This forces us to invoke
+#      AS_MKDIR_P in the third argument to AC_CONFIG_COMMANDS (the
+#      `init-cmds') rather than the second (the `cmds').  This is undesirable
+#      because it means that the directory will be created anytime
+#      config.status is invoked (even for a simple --help), rather than being
+#      created only when requested to output the text cache.  This bug was
+#      submitted to the Autoconf GNATS database by Eric Sunshine as #228 on
+#      27-Dec-2002.  It was fixed for Autoconf 2.58 on 26-Sep-2003.  The
+#      official fix makes the assumption that `tag' always represents a file
+#      (as opposed to some generic target), and creates the file's directory
+#      is not present.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_TEXT_CACHE_APPEND], [$1="${$1}$2"])
+AC_DEFUN([CS_TEXT_CACHE_PREPEND], [$1="$2${$1}"])
+AC_DEFUN([CS_TEXT_CACHE_OUTPUT],
+    [AC_CONFIG_COMMANDS([$2],
+       [echo $ECHO_N "$$1$ECHO_C" > $tmp/tcache
+       AS_IF([diff $2 $tmp/tcache >/dev/null 2>&1],
+           [AC_MSG_NOTICE([$2 is unchanged])],
+           [rm -f $2
+           cp $tmp/tcache $2])
+       rm -f $tmp/tcache],
+       [$1='$$1'
+       cs_dir=`AS_DIRNAME([$2])`
+       AS_ESCAPE(AS_MKDIR_P([$cs_dir]), [$`\])])])
diff --git a/mk/autoconf/trim.m4 b/mk/autoconf/trim.m4
new file mode 100644 (file)
index 0000000..6baad00
--- /dev/null
@@ -0,0 +1,27 @@
+# trim.m4                                                      -*- Autoconf -*-
+#==============================================================================
+# Copyright (C)2003 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#==============================================================================
+AC_PREREQ([2.56])
+
+#------------------------------------------------------------------------------
+# CS_TRIM(STRING)
+#      Strip leading and trailing spaces from STRING and collapse internal
+#      runs of multiple spaces to a single space.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_TRIM], [`echo x$1 | sed 's/^x//;s/   */ /g;s/^ //;s/ $//'`])
diff --git a/mk/autoconf/warnings.m4 b/mk/autoconf/warnings.m4
new file mode 100644 (file)
index 0000000..ab5f224
--- /dev/null
@@ -0,0 +1,151 @@
+# warnings.m4                                                  -*- Autoconf -*-
+#==============================================================================
+# Copyright (C)2005 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#==============================================================================
+AC_PREREQ([2.56])
+
+#------------------------------------------------------------------------------
+# CS_COMPILER_WARNINGS([LANGUAGE], [CACHE-VAR], [ACTION-IF-FOUND],
+#                      [ACTION-IF-NOT-FOUND])
+#      Check how to enable compilation warnings. If LANGUAGE is not provided,
+#      then `C' is assumed (other options include `C++').  If CACHE-VAR is not
+#      provided, then it defaults to the name
+#      "cs_cv_prog_compiler_enable_warnings".  If an option for enabling
+#      warnings (such as `-Wall') is discovered, then it is assigned to
+#      CACHE-VAR and ACTION-IF-FOUND is invoked; otherwise the empty string is
+#      assigned to CACHE-VAR and ACTION-IF-NOT-FOUND is invoked.
+#
+# IMPLEMENTATION NOTES
+#
+#      On some platforms, it is more appropriate to use -Wmost rather than
+#      -Wall even if the compiler understands both, thus we attempt -Wmost
+#      before -Wall.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_COMPILER_WARNINGS],
+    [CS_CHECK_BUILD_FLAGS(
+       [how to enable m4_default([$1],[C]) compilation warnings],
+       [m4_default([$2],[cs_cv_prog_compiler_enable_warnings])],
+       [CS_CREATE_TUPLE([-Wmost]) CS_CREATE_TUPLE([-Wall])],
+       [$1], [$3], [$4])])
+
+
+
+#------------------------------------------------------------------------------
+# CS_COMPILER_ERRORS([LANGUAGE], [CACHE-VAR], [ACTION-IF-FOUND],
+#                    [ACTION-IF-NOT-FOUND])
+#      Check how to promote compilation diganostics from warning to error
+#      status. If LANGUAGE is not provided, then `C' is assumed (other options
+#      include `C++').  If CACHE-VAR is not provided, then it defaults to the
+#      name "cs_cv_prog_compiler_enable_errors".  If an option for performing
+#      this promotion (such as `-Werror') is discovered, then it is assigned
+#      to CACHE-VAR and ACTION-IF-FOUND is invoked; otherwise the empty string
+#      is assigned to CACHE-VAR and ACTION-IF-NOT-FOUND is invoked.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_COMPILER_ERRORS],
+    [CS_CHECK_BUILD_FLAGS(
+       [how to treat m4_default([$1],[C]) warnings as errors],
+       [m4_default([$2],[cs_cv_prog_compiler_enable_errors])],
+       [CS_CREATE_TUPLE([-Werror])], [$1], [$3], [$4])])
+
+
+
+#------------------------------------------------------------------------------
+# CS_COMPILER_IGNORE_UNUSED([LANGUAGE], [CACHE-VAR], [ACTION-IF-FOUND],
+#                           [ACTION-IF-NOT-FOUND])
+#      Check how to instruct compiler to ignore unused variables and
+#      arguments.  This option may be useful for code generated by tools, such
+#      as Swig, Bison, and Flex, over which the client has no control, yet
+#      wishes to compile without excessive diagnostic spew.  If LANGUAGE is
+#      not provided, then `C' is assumed (other options include `C++').  If
+#      CACHE-VAR is not provided, then it defaults to the name
+#      "cs_cv_prog_compiler_ignore_unused".  If an option (such as
+#      `-Wno-unused') is discovered, then it is assigned to CACHE-VAR and
+#      ACTION-IF-FOUND is invoked; otherwise the empty string is assigned to
+#      CACHE-VAR and ACTION-IF-NOT-FOUND is invoked.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_COMPILER_IGNORE_UNUSED],
+    [CS_CHECK_BUILD_FLAGS(
+       [how to suppress m4_default([$1],[C]) unused variable warnings],
+       [m4_default([$2],[cs_cv_prog_compiler_ignore_unused])],
+       [CS_CREATE_TUPLE([-Wno-unused])], [$1], [$3], [$4])])
+
+
+
+#------------------------------------------------------------------------------
+# CS_COMPILER_IGNORE_UNINITIALIZED([LANGUAGE], [CACHE-VAR], [ACTION-IF-FOUND],
+#                                  [ACTION-IF-NOT-FOUND])
+#      Check how to instruct compiler to ignore uninitialized variables.  This
+#      option may be useful for code generated by tools, such as Swig, Bison,
+#      and Flex, over which the client has no control, yet wishes to compile
+#      without excessive diagnostic spew.  If LANGUAGE is not provided, then
+#      `C' is assumed (other options include `C++').  If CACHE-VAR is not
+#      provided, then it defaults to the name
+#      "cs_cv_prog_compiler_ignore_uninitialized".  If an option (such as
+#      `-Wno-uninitialized') is discovered, then it is assigned to CACHE-VAR
+#      and ACTION-IF-FOUND is invoked; otherwise the empty string is assigned
+#      to CACHE-VAR and ACTION-IF-NOT-FOUND is invoked.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_COMPILER_IGNORE_UNINITIALIZED],
+    [CS_CHECK_BUILD_FLAGS(
+       [how to suppress m4_default([$1],[C]) uninitialized warnings],
+       [m4_default([$2],
+           [cs_cv_prog_compiler_ignore_uninitialized_variables])],
+       [CS_CREATE_TUPLE([-Wno-uninitialized])], [$1], [$3], [$4])])
+
+
+
+#------------------------------------------------------------------------------
+# CS_COMPILER_IGNORE_PRAGMAS([LANGUAGE], [CACHE-VAR], [ACTION-IF-FOUND],
+#                            [ACTION-IF-NOT-FOUND])
+#      Check how to instruct compiler to ignore unrecognized #pragma
+#      directives.  This option may be useful for code which contains
+#      unprotected #pragmas which are not understood by all compilers.  If
+#      LANGUAGE is not provided, then `C' is assumed (other options include
+#      `C++').  If CACHE-VAR is not provided, then it defaults to the name
+#      "cs_cv_prog_compiler_ignore_unknown_pragmas".  If an option (such as
+#      `-Wno-unknown-pragmas') is discovered, then it is assigned to CACHE-VAR
+#      and ACTION-IF-FOUND is invoked; otherwise the empty string is assigned
+#      to CACHE-VAR and ACTION-IF-NOT-FOUND is invoked.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_COMPILER_IGNORE_PRAGMAS],
+    [CS_CHECK_BUILD_FLAGS(
+       [how to suppress m4_default([$1],[C]) unknown [#pragma] warnings],
+       [m4_default([$2],[cs_cv_prog_compiler_ignore_unknown_pragmas])],
+       [CS_CREATE_TUPLE([-Wno-unknown-pragmas])], [$1], [$3], [$4])])
+
+
+
+#------------------------------------------------------------------------------
+# CS_COMPILER_IGNORE_LONG_DOUBLE([LANGUAGE], [CACHE-VAR], [ACTION-IF-FOUND],
+#                                [ACTION-IF-NOT-FOUND])
+#      Check how to instruct compiler to suppress warnings about `long double'
+#      usage.  This option may be useful for code generated by tools, such as
+#      Swig, Bison, and Flex, over which the client has no control, yet wishes
+#      to compile without excessive diagnostic spew.  If LANGUAGE is not
+#      provided, then `C' is assumed (other options include `C++').  If
+#      CACHE-VAR is not provided, then it defaults to the name
+#      "cs_cv_prog_compiler_ignore_long_double".  If an option (such as
+#      `-Wno-long-double') is discovered, then it is assigned to CACHE-VAR and
+#      ACTION-IF-FOUND is invoked; otherwise the empty string is assigned to
+#      CACHE-VAR and ACTION-IF-NOT-FOUND is invoked.
+#------------------------------------------------------------------------------
+AC_DEFUN([CS_COMPILER_IGNORE_LONG_DOUBLE],
+    [CS_CHECK_BUILD_FLAGS(
+       [how to suppress m4_default([$1],[C]) `long double' warnings],
+       [m4_default([$2],[cs_cv_prog_compiler_ignore_long_double])],
+       [CS_CREATE_TUPLE([-Wno-long-double])], [$1], [$3], [$4])])
diff --git a/mk/jam/application.jam b/mk/jam/application.jam
new file mode 100644 (file)
index 0000000..9721fef
--- /dev/null
@@ -0,0 +1,159 @@
+#============================================================================
+# Rules for compiling applications
+# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#============================================================================
+
+# Use a more sensible and typical mode for executables than Jam's default.
+if "$(EXEMODE)" = "711" { EXEMODE = "+x" ; }
+
+##  Application appname : sources [ : options ]
+##    Build an application out of sourcefiles. All sourcefiles will be passed
+##    to the Objects rule which tries to compile them into object-files. You
+##    can create rules for your own filetypes with the UserObject rule. Header
+##    files will just be ignored. They are only used for MSVC projectfile
+##    generation.
+##    Possible options are "noinstall" if you don't want a default install
+##    target to be created and "console" if you're building a console
+##    application (an application without any graphical output which is
+##    intended to be used on commandline)
+##    Some notes: You should not add the .exe extension to the appname - jam
+##    will do that on win32.
+##    Options:
+##     console: Create a console application
+##     noinstall: Do not set up a default installation targets.
+##     independent: The target will not be made a dependency of the apps and
+##                  all target.
+##     nohelp: Do not invoke Help for this target.
+##      notest: Do not set up unit-testing support for this target.
+##     nomanifest: (Win32/MSVC) Don't generate manifest for application.
+rule Application
+{
+  # check options
+  CheckOptions noinstall console independent nohelp notest nomanifest : $(3) : $(<) ;
+
+  local target = [ ConstructApplicationTarget $(<) : $(3) ] ;
+  local sources = [ DoSourceGrist $(>) ] ;
+  local objects = [ CompileObjects $(sources) ] ;
+
+  $(<)_TYPE = application ;
+  $(<)_OBJECTS = $(objects) ;
+  $(<)_SOURCES = $(sources) ;
+  $(<)_TARGET = $(target) ;
+
+  # create target clean rule
+  Always $(<)clean ;
+  NotFile $(<)clean ;
+  Clean $(<)clean : $(objects) ; # create target clean rule 
+
+  # so 'jam foo' works when it's really foo.exe (Windows) or foo.app (MacOS/X)
+  if $(target) != $(<)
+  {
+    Depends $(<) : $(target) ;
+    NotFile $(<) ;
+  }
+
+  # make dependency on apps target
+  if ! [ IsElem independent : $(3) ]
+  {
+    Depends apps : $(<) ;
+  }
+
+  # construct Install target
+  if ! [ IsElem noinstall : $(3) ]
+  {
+    local install_opts ;
+    if [ IsElem console : $(3) ]
+    {
+      install_opts += console ;
+    }
+    SystemInstallApplication $(target) : : $(install_opts) ;
+  }
+
+  # Link
+  MakeLocate $(target) : $(LOCATE.TARGETS) ;
+  SystemLinkApplication $(<) : $(objects) : $(3) ;
+
+  local debugfile = [ SplitDebugInfo $(target) ] ;
+  Clean $(<)clean : $(debugfile) ;
+  if ! [ IsElem noinstall : $(3) ]
+  {
+    NoCare $(debugfile) ;
+    Depends install_bin : [ DoInstall $(debugfile) : $(bindir) : $(INSTALL_DATA) ] ;
+  }
+
+  CFlags $(<) : $(APPLICATION.CFLAGS) ;
+  LFlags $(<) : $(LINKLIBS) $(APPLICATION.LFLAGS) ;      
+
+  if ! [ IsElem nohelp : $(3) ]
+  {
+    local desc = [ Description $(<) ] ;
+    if ! $(desc) { desc = "$(<) application" ; }
+    Help $(<) : "Build the $(desc)" ;
+  }
+
+  if ! [ IsElem notest : $(options) ]
+  {
+    # @@@ Disabled for now; see docs/todo_jam.txt
+    #UnitTest $(<) ;
+  }
+}
+
+##  ShellScript scriptname : rule [ : options ]
+##    Build a shell script by invoking `rule', the script creation rule, which
+##    is passed `scriptname' and `options'.
+##    Options:
+##     noinstall: Do not set up a default installation target.
+##     nohelp: Do not invoke Help for this target.
+rule ShellScript
+{
+  CheckOptions noinstall nohelp : $(3) : $(<) ;
+
+  Always $(<)clean ;
+  NotFile $(<)clean ;
+  Clean clean : $(<) ;
+  Clean $(<)clean : $(<) ;
+  Depends apps : $(<) ;
+  MakeLocate $(<) : $(LOCATE.TARGETS) ;
+
+  if ! [ IsElem noinstall : $(3) ]
+  {
+    Depends install_bin : [ DoInstall $(<) : $(bindir) : $(INSTALL_PROGRAM) ] ;
+  }
+
+  $(2) $(<) : $(3) ;
+
+  MODE on $(<) = $(EXEMODE) ;
+  SUBDIR on $(<) = $(SUBDIR) ;
+  Chmod $(<) ;
+
+  if ! [ IsElem nohelp : $(3) ]
+  {
+    local desc = [ Description $(<) ] ;
+    if ! $(desc) { desc = "$(<) script" ; }
+    Help $(<) : "Build the $(desc)" ;
+  }
+}
+
+#----------------------------------------------------------------------------
+# private part
+
+# Construct pseudo target apps which is used instead of the pseudo target exe
+# in Jambase
+Depends exe : apps ;
+NotFile apps ;
+Help apps : "Build all applications" ;
diff --git a/mk/jam/assembler.jam b/mk/jam/assembler.jam
new file mode 100644 (file)
index 0000000..63a8ae5
--- /dev/null
@@ -0,0 +1,50 @@
+#============================================================================
+# Rules for handling assembler files
+# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#============================================================================
+
+if $(CMD.NASM)
+{
+
+rule NasmRule
+{
+  local object = [ DoObjectGrist [ PrefixSuffix $(>)_ : $(<) : $(SUFOBJ) ] ] ;
+  Nasm $(object) : $(<) ;
+  return $(object) ;
+}
+RegisterFileType NasmRule : .asm ;
+
+rule Nasm
+{
+  Depends $(<) : $(>) ;
+  NASM.FLAGS on $(<) += $(NASM.FLAGS) ;
+  # NASM doesn't scan for headers in current dir of the files, so add the dir of
+  # the file to the -I flags
+  local includeflags = [ FIncludes $(SEARCH_SOURCE)/$(<:D) $(SUBDIRHDRS) $(HDRS) ] ;
+  # NASM requires that -I paths have a trailing slash.
+  INCLUDEFLAGS on $(<) = $(includeflags)$(SLASH) ;
+}
+
+NASM.HDRPATTERN = "^[  ]*%[    ]*include[      ]*[<\"]([^\">]*)[\">].*$" ;
+RegisterHeaderRule HeaderRule : $(NASM.HDRPATTERN) : .asm .ash ;
+
+actions Nasm
+{
+  $(CMD.NASM) $(NASM.FLAGS) $(INCLUDEFLAGS) -o $(<) $(>)
+}
+}
diff --git a/mk/jam/bisonflex.jam b/mk/jam/bisonflex.jam
new file mode 100644 (file)
index 0000000..d1ce50f
--- /dev/null
@@ -0,0 +1,165 @@
+#============================================================================
+# Rules for flex and bison
+# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#============================================================================
+
+if $(CMD.FLEX)
+{
+  # Some versions of Flex-generated files want to include <unistd.h> which is
+  # not normally available on Windows, so we need to protect it.  We also
+  # filter out CVS `Header' keywords in order to prevent CVS from thinking that
+  # the file has changed simply because the Header information is different.
+  FLEX.SED_SCRIPT =
+    "'s/\\([   ]*#[    ]*include[      ][      ]*<unistd.h>\\)/#ifndef WIN32\\
+    \\1\\
+    #endif/;/\$Header:/d'" ;
+
+  # Compilers such as MSVC do not like #line directives.  Since the generated
+  # file might get stored in CVS and used by MSVC users (even if generated on
+  # Unix, for instance), we want to suppress #line directives in all cases.
+  FLEX.FLAGS += -L ;
+
+  rule FlexRule
+  {
+    local object ;
+    local cfile = [ DoObjectGrist $(<:S=.c) ] ;
+    
+    MakeLocate $(cfile) : $(LOCATE_TARGET) ;
+    SEARCH on $(cfile) = $(LOCATE_TARGET) ;
+   
+    Flex $(cfile) : $(<) ;
+    object = [ CompileObjects $(cfile) : $(>) ] ;
+    
+    return $(object) ;
+  }
+  RegisterFileType FlexRule : .l ;
+  
+  rule Flex++Rule
+  {
+    local object ;
+    local cppfile = [ DoObjectGrist $(<:S=.cpp) ] ;
+
+    MakeLocate $(cppfile) : $(LOCATE_TARGET) ;
+    SEARCH on $(cppfile) = $(LOCATE_TARGET) ;
+
+    Flex $(cppfile) : $(<) ;
+    object = [ CompileObjects $(cppfile) : $(>) ] ;
+
+    return $(object) ;
+  }
+  RegisterFileType Flex++Rule : .ll ;
+
+  rule Flex
+  {
+    Depends $(<) : $(>) ;
+    FLEX.FLAGS on $(<) += $(FLEX.FLAGS) ;
+  }
+
+  # Use -t and output redirection to avoid flex choosing undesirable names for
+  # its output files.  Also apply FLEX.SED_SCRIPT.
+  actions Flex
+  {
+    $(CMD.FLEX) -t $(FLEX.FLAGS) $(>) | $(SED) $(FLEX.SED_SCRIPT) > $(<)
+  }
+}
+
+if $(CMD.BISON)
+{
+  rule BisonRule
+  {
+    local object ;
+    local cfile = [ DoObjectGrist $(<:S=.c) ] ;
+    local headerfile = [ DoObjectGrist $(<:S=.h) ] ;
+
+    # Jam's header file scannning doesn't use grist so we have to workaround
+    # this here.
+    Includes $(headerfile:G=$(SOURCE_GRIST:E)!$(SUBVARIANT:J=!)) : $(headerfile) ;
+  
+    MakeLocate $(cfile) $(headerfile) : $(LOCATE_TARGET) ;
+    
+    BISON.FLAGS on $(cfile) = 
+      [ on [ DoSourceGrist $(<:S=.c) ] GetVar BISON.FLAGS ] ;
+    Bison $(cfile) : $(<) ;
+    # Work around for jam warning about independant target when we put both
+    # headerfile and cppfile in the bison line...
+    Includes $(cppfile) : $(headerfile) ;
+    object = [ CompileObjects $(cfile) : $(>) ] ;
+    SEARCH on $(cfile) = $(LOCATE_TARGET) ;
+    SEARCH on $(headerfile) = $(LOCATE_TARGET) ;
+
+    return $(object) ;
+  }
+  RegisterFileType BisonRule : .y ;
+
+  rule Bison++Rule
+  {
+    local object ;
+    local cppfile = [ DoObjectGrist $(<:S=.cpp) ] ;
+    local headerfile = [ DoObjectGrist $(<:S=.hpp) ] ;
+
+    # Jam's header file scannning doesn't use grist so we have to workaround
+    # this here.
+    Includes $(headerfile:G=$(SOURCE_GRIST:E)!$(SUBVARIANT:J=!)) : $(headerfile) ;
+
+    MakeLocate $(cppfile) : $(LOCATE_TARGET) ;
+    MakeLocate $(headerfile) : $(LOCATE_TARGET) ;
+    
+    BISON.FLAGS on $(cppfile) = 
+      [ on [ DoSourceGrist $(<:S=.cpp) ] GetVar BISON.FLAGS ] ;
+    Bison $(cppfile) : $(<) ;
+    # Work around for jam warning about independant target when we put both
+    # headerfile and cppfile in the bison line...
+    Includes $(cppfile) : $(headerfile) ;
+    object = [ CompileObjects $(cppfile) : $(>) ] ;
+    SEARCH on $(cppfile) = $(LOCATE_TARGET) ;
+    SEARCH on $(headerfile) = $(LOCATE_TARGET) ;
+
+    return $(object) ;
+  }
+  RegisterFileType Bison++Rule : .yy ;
+    
+  rule Bison
+  {
+    Depends $(<) : $(>) ;
+    BISON.FLAGS on $(<) += $(BISON.FLAGS) ;
+  }
+  rule BisonFlags
+  {
+    local target ;
+    
+    if $(<:S) = .yy
+    {
+      target = [ DoSourceGrist $(<:S=.cpp) $(<:S=.hpp) ] ;
+    }
+    else
+    {
+      target = [ DoSourceGrist $(<:S=.c) $(<:S=.h) ] ;
+    }
+    BISON.FLAGS on $(target) += $(>) ;
+  }
+       
+  # Compilers such as MSVC do not like #line directives.  Since the generated
+  # file might get stored in CVS and used by MSVC users (even if generated on
+  # Unix, for instance), we want to suppress #line directives in all cases.
+  BISON.FLAGS += --no-lines ;
+
+  actions Bison
+  {
+    $(CMD.BISON) -d $(BISON.FLAGS) -o $(<[1]) $(>)
+  }
+}
diff --git a/mk/jam/build.jam b/mk/jam/build.jam
new file mode 100644 (file)
index 0000000..954a03b
--- /dev/null
@@ -0,0 +1,83 @@
+#============================================================================
+# Main rules file - Includes all important rulefiles in correct order
+# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#============================================================================
+
+# Enable if you want debug messages.
+JAM_DEBUG ?= 1 ;
+
+jamrulesdir = $(TOP)/mk/jam ;
+
+# Utility and compatibility rules used by all other scripts.
+include $(jamrulesdir)/jamcompatibility.jam ;
+include $(jamrulesdir)/subdir.jam ;
+include $(jamrulesdir)/property.jam ;
+
+# This needs to be included before _and_ after all other includes (except the
+# super low-level utility files above) since it optionally overrides built-in
+# rules to glean information about targets being defined.
+include $(jamrulesdir)/dump.jam ;
+
+include $(jamrulesdir)/options.jam ;
+include $(jamrulesdir)/variant.jam ;
+include $(jamrulesdir)/resource.jam ;
+
+include $(jamrulesdir)/helper.jam ;
+include $(jamrulesdir)/help.jam ;
+include $(jamrulesdir)/groups.jam ;
+include $(jamrulesdir)/install.jam ;
+include $(jamrulesdir)/clean.jam ;
+
+include $(jamrulesdir)/objects.jam ;
+include $(jamrulesdir)/compiler.jam ;
+include $(jamrulesdir)/objectivec.jam ;
+include $(jamrulesdir)/assembler.jam ;
+include $(jamrulesdir)/bisonflex.jam ;
+include $(jamrulesdir)/swig.jam ;
+include $(jamrulesdir)/strip.jam ;
+
+include $(jamrulesdir)/flags.jam ;
+include $(jamrulesdir)/library.jam ;
+include $(jamrulesdir)/static.jam ;
+include $(jamrulesdir)/application.jam ;
+include $(jamrulesdir)/plugin.jam ;
+include $(jamrulesdir)/docs.jam ;
+include $(jamrulesdir)/unittest.jam ;
+
+# Include OS specific rules
+switch $(TARGET.OS)
+{
+case WIN32 :
+  include $(jamrulesdir)/win32.jam ;
+case MACOS_X :
+  include $(jamrulesdir)/macosx.jam ;
+case UNIX :
+  include $(jamrulesdir)/unix.jam ;
+case * :
+  echo "WARNING: TARGET.OS not defined. Using unix" ;
+  include $(jamrulesdir)/unix.jam ;
+}
+
+# This needs to be included after all others because it overrides some of the
+# earlier defined rules when enabled. It even overrides Win32 rules, so it
+# needs to be after platform-specific includes, as well.
+include $(jamrulesdir)/msvcgen.jam ;
+
+# This needs to included be before _and_ after all other includes since it
+# optionally overrides rules defined earlier.
+include $(jamrulesdir)/dump.jam ;
diff --git a/mk/jam/clean.jam b/mk/jam/clean.jam
new file mode 100644 (file)
index 0000000..df734e7
--- /dev/null
@@ -0,0 +1,37 @@
+#============================================================================
+# Rules for cleaning build detritus.
+# Copyright (C)2003 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#============================================================================
+
+# CleanDir <tag> : <dir> ...
+#   Forcibly delete a set of directories, even if they are not empty.
+#   Tag is one of the standard targets used with the "Clean" rule, such as
+#   "clean" or "distclean".
+rule CleanDir
+{
+  Always $(<) ;
+  NotFile $(<) ;
+  NoCare $(>) ;
+}
+
+actions piecemeal together existing CleanDir
+{
+  $(DELTREE) $(>)
+}
+
+Help clean : "Remove all built targets from project" ;
diff --git a/mk/jam/compiler.jam b/mk/jam/compiler.jam
new file mode 100644 (file)
index 0000000..b8e932a
--- /dev/null
@@ -0,0 +1,76 @@
+#============================================================================
+# Rules for C and C++ files
+# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#============================================================================
+
+if $(CMD.CC)
+{
+
+rule CcRule
+{
+    local object = 
+      [ DoObjectGrist [ PrefixSuffix $(>)_ : $(<) : $(SUFOBJ) ] ] ;
+    Cc $(object) : $(<) ;
+    return $(object) ;
+}
+RegisterFileType CcRule : .c ;
+RegisterHeaderRule HeaderRule : $(HDRPATTERN) : .c ;
+
+rule Cc
+{
+    Depends $(<) : $(>) ;
+
+    CCFLAGS on $(<) += $(CCFLAGS) $(SUBDIRCCFLAGS) ;
+    CCHDRS on $(<) = [ on $(<) FIncludes $(HDRS) ] ;
+    CCDEFS on $(<) = [ on $(<) FDefines $(DEFINES) ] ;
+}
+
+actions Cc
+{
+    $(CMD.CC) -c -o $(<) $(CCHDRS) $(CCFLAGS) $(CCDEFS) $(>)
+}
+} # end if $(CMD.CC)
+
+if $(CMD.C++)
+{
+
+rule C++Rule
+{
+    local object = 
+      [ DoObjectGrist [ PrefixSuffix $(>)_ : $(<) : $(SUFOBJ) ] ] ;
+    C++ $(object) : $(<) ;
+    return $(object) ;
+}
+RegisterFileType C++Rule : .cpp .cc .c++ ;
+RegisterHeaderRule HeaderRule : $(HDRPATTERN) : .cpp .cc .c++ ;
+
+rule C++
+{
+    Depends $(<) : $(>) ;
+
+    C++FLAGS on $(<) += $(C++FLAGS) $(SUBDIRC++FLAGS) ;
+    CCHDRS on $(<) = [ on $(<) FIncludes $(HDRS) ] ;
+    CCDEFS on $(<) = [ on $(<) FDefines $(DEFINES) ] ;
+}
+
+actions C++
+{
+    $(CMD.C++) -c -o $(<) $(CCHDRS) $(C++FLAGS) $(CCDEFS) $(>)
+}
+} # end if $(CMD:C++)
+
diff --git a/mk/jam/docs.jam b/mk/jam/docs.jam
new file mode 100644 (file)
index 0000000..f54fe6b
--- /dev/null
@@ -0,0 +1,688 @@
+#============================================================================
+# Rules for creating Documentation
+# Copyright (C)2005 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#============================================================================
+
+# Do-nothing implementations which avoid Jam error messages if client Jamfiles
+# attempt to invoke documantation-generation rules despite lack of availability
+# of appropriate tools. This simplifies client Jamfiles since the client does
+# not need to check for the presence of the various tools. These rules will be
+# re-defined later if the necessary tools are available.
+rule Texi2Info   { }
+rule Texi2HTML   { }
+rule Texi2DVI    { }
+rule Texi2PS     { }
+rule Texi2PDF    { }
+rule Doxygen     { }
+rule RepairNodes { }
+
+if $(PERL)
+{
+  PATH.TEXI2HTML.HOME ?= [ ConcatDirs $(TOP) docs support ] ;
+  PATH.TEXI2HTML ?= [ ConcatDirs $(PATH.TEXI2HTML.HOME) texi2html.pl ] ;
+  CMD.TEXI2HTML ?= "$(PERL) $(PATH.TEXI2HTML)" ;
+}
+
+if $(CMD.MAKEINFO)
+{
+##  Texi2Info targetname : texifiles : outputformat [ : subdir : [ outfile :
+##            [ options ]]]
+##    Invoke the makeinfo utility to convert Texinfo source (typically) to Info
+##    format when the pseudo target 'targetname' is invoked. 'texifiles' is a
+##    list of Texinfo files to be converted.  The first element of 'texifiles'
+##    should be the top-level Texinfo document which includes the remaining
+##    files. It is okay for 'texifiles' to mention only a single Texinfo source
+##    if the entire document is contained in the one file. 'outputformat' is
+##    one of "info", "html", "xml", or "docbook".  If not specified, it
+##    defaults to "info". The optional 'subdir' is a subdirectory of
+##    $(LOCATE.DOCS) into which the generated files should be placed. The
+##    optional 'outfile' is the name of the output file. Some output formats
+##    may generate multiple output files (such as "outfile.info",
+##    "outfile-1.info", "outfile-2.info", etc.). If 'outfile' is omitted, then
+##    the output filename is derived from the first element of 'texifiles' with
+##    the extension changed to reflect 'outputformat' (one of .info, .html,
+##    .xml, or .docbook). 'options' is a set of command-line flags passed
+##    directly to makeinfo. Returns the gristed output file name.
+rule Texi2Info
+{
+  local target    = $(1) ;
+  local texifiles = $(2) ;
+  local format    = $(3) ;
+  local subdir    = $(4) ;
+  local outfile   = $(5) ;
+  local options   = $(6) ;
+
+  if ! $(format) { format = info ; }
+
+  local fmtoptions ;
+  switch $(format)
+  {
+    case info    : fmtoptions =           ;
+    case html    : fmtoptions = --html    ;
+    case xml     : fmtoptions = --xml     ;
+    case docbook : fmtoptions = --docbook ;
+  }
+
+  return [ _Texinfo $(target) : $(texifiles) : $(format) : $(outfile) :
+    RunMakeInfo : $(fmtoptions) $(options) : $(subdir) ] ;
+}
+}
+
+if $(CMD.TEXI2HTML)
+{
+##  Texi2HTML targetname : texifiles [ : subdir : [ outfile : [ options ]]]
+##    Invoke the texi2html utility to convert Texinfo source to HTML format
+##    when the pseudo target 'targetname' is invoked. 'texifiles' is a list of
+##    Texinfo files to be converted.  The first element of 'texifiles' should
+##    be the top-level Texinfo document which includes the remaining files. It
+##    is okay for 'texifiles' to mention only a single Texinfo source if the
+##    entire document is contained in the one file.  The optional 'subdir' is a
+##    subdirectory of $(LOCATE.DOCS) into which the generated files should be
+##    placed. The optional 'outfile' is the name of the root output file
+##    (typically "index.html"). If the input files contain multiple Texinfo
+##    @nodes, then texi2html may generate multiple output files (depending upon
+##    local texi2html configuration) based upon the section numbering, and
+##    'outfile' will reference the other generated files.  If 'outfile' is
+##    omitted, then the output filename is derived from the first element of
+##    'texifiles' with the extension changed to .html. 'options' is a set of
+##    command-line flags passed directly to texi2html. Returns the gristed
+##    output file name.
+rule Texi2HTML
+{
+  local target    = $(1) ;
+  local texifiles = $(2) ;
+  local subdir    = $(3) ;
+  local outfile   = $(4) ;
+  local options   = $(5) ;
+  return [ _Texinfo $(target) : $(texifiles) : html : $(outfile) :
+    RunTexi2HTML : $(options) : $(subdir) ] ;
+}
+}
+
+if $(CMD.TEXI2DVI)
+{
+##  Texi2DVI targetname : texifiles [ : subdir [ : outfile [ : options ]]]
+##    Invoke the texi2dvi utility to convert Texinfo source to DVI format when
+##    the pseudo target 'targetname' is invoked. 'texifiles' is a list of
+##    Texinfo files to be converted.  The first element of 'texifiles' should
+##    be the top-level Texinfo document which includes the remaining files. It
+##    is okay for 'texifiles' to mention only a single Texinfo source if the
+##    entire document is contained in the one file.  The optional 'subdir' is a
+##    subdirectory of $(LOCATE.DOCS) into which the generated file should be
+##    placed. The optional 'outfile' is the name of the output file.  If
+##    'outfile' is omitted, then the output filename is derived from the first
+##    element of 'texifiles' with the extension changed to .dvi. 'options' is a
+##    set of command-line flags passed directly to texi2dvi.  Returns the
+##    gristed output file name.
+rule Texi2DVI
+{
+  return [ _Texi2DVI $(1) : $(2) : $(3) : $(4) : $(5) : dvi ] ;
+}
+
+if $(CMD.DVIPS)
+{
+##  Texi2PS targetname : texifile [ : subdir [ : outfile [ : psoptions
+##          [ : dvioptions ]]]]
+##    Invoke the texi2dvi and dvips utilities to convert Texinfo source to
+##    PostScript format when the pseudo target 'targetname' is invoked.
+##    'texifiles' is a list of Texinfo files to be converted. The first
+##    element of 'texifiles' should be the top-level Texinfo document which
+##    includes the remaining files. It is okay for 'texifiles' to mention only
+##    a single Texinfo source if the entire document is contained in the one
+##    file.  The optional 'subdir' is a subdirectory of $(LOCATE.DOCS) into
+##    which the generated file should be placed. The optional 'outfile' is the
+##    name of the output file.  If 'outfile' is omitted, then the output
+##    filename is derived from the first element of 'texifiles' with the
+##    extension changed to .ps. 'psoptions' is a set of command-line flags
+##    passed directly to dvips. 'dvioptions' is a set of command-line flags
+##    passed directly to texi2dvi. Returns the gristed output file name.
+rule Texi2PS
+{
+  local target     = $(1) ;
+  local texifiles  = $(2) ;
+  local subdir     = $(3) ;
+  local outfile    = $(4) ;
+  local psoptions  = $(5) ;
+  local dvioptions = $(6) ;
+  return [ _Dvi $(target) : $(texifiles) : ps : $(outfile:S=.ps) : RunDVIPS :
+    $(psoptions) : $(dvioptions) : $(subdir) ] ;
+}
+}
+
+if $(CMD.DVIPDF)
+{
+##  Texi2PDF targetname : texifiles [ : subdir [ : outfile [ : pdfoptions
+##    [ : dvioptions ]]]]
+##    Invoke the texi2dvi and dvipdf utilities to convert Texinfo source to PDF
+##    format when the pseudo target 'targetname' is invoked.  'texifiles' is a
+##    list of Texinfo files to be converted. The first element of 'texifiles'
+##    should be the top-level Texinfo document which includes the remaining
+##    files. It is okay for 'texifiles' to mention only a single Texinfo source
+##    if the entire document is contained in the one file.  The optional
+##    'subdir' is a subdirectory of $(LOCATE.DOCS) into which the generated
+##    file should be placed. The optional 'outfile' is the name of the output
+##    file.  If 'outfile' is omitted, then the output filename is derived from
+##    the first element of 'texifiles' with the extension changed to .pdf.
+##    'pdfoptions' is a set of command-line flags passed directly to
+##    dvipdf. 'dvioptions' is a set of command-line flags passed directly to
+##    texi2dvi. Returns the gristed output file name.
+rule Texi2PDF
+{
+  local target     = $(1) ;
+  local texifiles  = $(2) ;
+  local subdir     = $(3) ;
+  local outfile    = $(4) ;
+  local pdfoptions = $(5) ;
+  local dvioptions = $(6) ;
+
+  local pdffile = [ _Dvi $(target) : $(texifiles) : pdf : $(outfile:S=.pdf) :
+    RunDVIPDF : $(pdfoptions) : $(dvioptions) : $(subdir) ] ;
+  CONVERTER on $(pdffile) = $(CMD.DVIPDF) ;
+  return pdffile ;
+}
+}
+else if $(CMD.TEXI2PDF)
+{
+##  Texi2PDF targetname : texifiles [ : subdir [ : outfile [ : options ]]]
+##    Invoke the texi2pdf utility to convert Texinfo source to PDF format when
+##    the pseudo target 'targetname' is invoked. 'texifiles' is a list of
+##    Texinfo files to be converted.  The first element of 'texifiles' should
+##    be the top-level Texinfo document which includes the remaining files. It
+##    is okay for 'texifiles' to mention only a single Texinfo source if the
+##    entire document is contained in the one file.  The optional 'subdir' is a
+##    subdirectory of $(LOCATE.DOCS) into which the generated file should be
+##    placed. The optional 'outfile' is the name of the output file.  If
+##    'outfile' is omitted, then the output filename is derived from the first
+##    element of 'texifiles' with the extension changed to .pdf. 'options' is a
+##    set of command-line flags passed directly to texi2pdf.  Returns the
+##    gristed output file name.
+rule Texi2PDF
+{
+  local target    = $(1) ;
+  local texifiles = $(2) ;
+  local subdir    = $(3) ;
+  local outfile   = $(4) ;
+  local options   = $(5) ;
+  local pdffile = [ _Texinfo $(target) : $(texifiles) : pdf : $(outfile) :
+    RunTexi2DVI : -I $(SUBDIR) $(options) : $(subdir) ] ;
+  CONVERTER on $(pdffile) = $(CMD.TEXI2PDF) ;
+  OPTIONS on $(pdffile) += $(FLAGS.TEXI2PDF) ;
+  return pdffile ;
+}
+}
+}
+
+if $(PERL)
+{
+PATH.NODEFIX ?= [ ConcatDirs $(TOP) docs support nodefix.pl ] ;
+CMD.NODEFIX ?= $(PERL) $(PATH.NODEFIX) ;
+
+##  RepairNodes targetname : texifile [ : srcdir ]
+##    When 'targetname' is invoked, perform in-place repair of @node and @menu
+##    directives in 'texifile' so that they correctly reflect the documentation
+##    hierarchy defined by @chapter, @section, @subsection, etc. directives.
+##    'srcdir' is the directory containing 'texifile' as well as any files
+##    included via @include{} or @import{} directives. If 'srcdir' is omitted,
+##    then $(SUBDIR) is assumed.
+rule RepairNodes
+{
+  local target = $(1) ;
+  local texifile = $(2) ;
+  local srcdir = $(3) ;
+  if ! $(srcdir) { srcdir = $(SUBDIR) ; }
+
+  SEARCH on $(texifile) = $(srcdir) ;
+  TEXINFO.INCDIR on $(target) = $(srcdir) ;
+  Depends $(target) : $(texifile) ;
+  NotFile $(target) ;
+  Always $(target) ;
+}
+
+actions RepairNodes
+{
+  $(CMD.NODEFIX) --include-dir="$(TEXINFO.INCDIR)" "$(>)" ;
+}
+}
+
+if $(CMD.DOXYGEN)
+{
+
+actions WriteCppWrapper
+{
+  echo "$(DOXYCPP_COMMAND)" > "$(1)"
+}
+
+rule GenerateDoxygenCppWrapper
+{
+  local target = $(1) ;
+  local cxxcpp = $(2) ;
+  
+  local outfile cmdpath command ;
+  if $(TARGET.OS) = WIN32
+  {
+    # On Win32, MSYS is not used but the "native" process running, so we can't
+    # launch the preprocessor with sh.
+    outfile = "cpp.cmd" ;
+    local p = [ SplitToList $(LOCATE.DOCS) : "/" ] $(outfile) ;
+    cmdpath = $(p:J=\\\\) ;
+    command = "$(cxxcpp)" %1 ;
+  }
+  else
+  {
+    outfile = "cpp.sh" ;
+    local p = $(LOCATE.DOCS) $(outfile) ;
+    cmdpath = $(p:J=/) ;
+    command = "$(cxxcpp)" \\$1 ;
+  }
+  MakeLocate $(outfile) : $(LOCATE.DOCS) ;
+  DOXYCPP_COMMAND on $(outfile) = $(command) ;
+  WriteCppWrapper $(outfile) ;
+  MODE on $(outfile) = "+x" ;
+  Chmod $(outfile) ;
+    
+  Always $(outfile) ;
+  Depends $(target) : $(outfile) ;
+  Clean $(target)clean : $(outfile) ;
+  
+  return $(cmdpath) ;
+}
+
+##  Doxygen targetname : doxyprofile-and-resources [ : subdir [ : outfile
+##          [ : options ]]]
+##    Invoke the Doxygen utility to generate API documentation based upon
+##    'doxyprofile' when the pseudo target 'targetname' is invoked. The first
+##    element of 'doxyprofile-and-resources' is the Doxygen configuration file
+##    which controls the API generation. The remaining optional elements are
+##    additional resources which should be copied verbatim to the output
+##    directory. Typical additional resources include CSS and related image
+##    files.  It is assumed that the source files mentioned by
+##    'doxyprofile-and-resources' reside in $(SUBDIR).  The optional 'subdir'
+##    is a subdirectory of $(LOCATE.DOCS) into which the generated files should
+##    be placed. The optional 'outfile' is the name of the root output file
+##    (typically "index.html"). This file will reference any other files
+##    generated by Doxygen.  If 'outfile' is omitted, then the output filename
+##    defaults to "index.html".  'options' is a set of command-line flags
+##    passed directly to Doxygen. Returns the gristed output file name.
+rule Doxygen
+{
+  local target    = $(1) ;
+  local infiles   = $(2) ;
+  local subdir    = $(3) ;
+  local outfile   = $(4) ;
+  local optioins  = $(5) ;
+  local doxyfile  = $(infiles[1]) ;
+  local resources = $(infiles[2-]) ;
+  local outdir    = [ FDirName $(LOCATE.DOCS) $(subdir) ] ;
+  local grist     = "$(SOURCE_GRIST)!$(target)" ;
+
+  if ! $(outfile)
+  {
+    outfile = index.html ;
+  }
+  outfile = $(outfile:G=$(grist)) ;
+
+  local r ;
+  for r in $(resources)
+  {
+    local src = $(r:G=$(grist)!src) ;
+    local dst = $(r:G=$(grist)!dst) ;
+    SEARCH on $(src) = $(SUBDIR) ;
+    MakeLocate $(dst) : $(outdir) ;
+    Copy $(dst) : $(src) ;
+    Depends $(dst) : $(src) ;
+    Depends $(outfile) : $(dst) ;
+    Clean $(target)clean : $(dst) ;
+  }
+
+  local doxycpp ;
+  if $(CMD.C++CPP)
+  {
+    doxycpp = [ GenerateDoxygenCppWrapper $(outfile) : 
+      $(CMD.C++CPP) [ FDefines DOXYGEN_RUN ] ] ;
+  }
+  
+  local have_dot = "NO" ;
+  local dot_path ;
+  if $(CMD.DOT)
+  {
+    local dotpath = [ Reverse [ SplitToList $(CMD.DOT) : / ] ] ;
+    if $(dotpath[1]) != "dot"
+    {
+      Echo "doxygen expects the dot binary to be named 'dot' exactly" ;
+    }
+    else
+    {
+      dot_path = [ Reverse $(dotpath[2-]) ] ;
+      dot_path = $(dot_path:J=/) ;
+      have_dot = "YES" ;
+    }
+  }
+
+  SEARCH on $(doxyfile) = $(SUBDIR) ;
+  OPTIONS on $(target) = $(options) ;
+  DOXYCPP on $(target) = $(doxycpp) ;
+  HAVE_DOT on $(target) = $(have_dot) ;
+  DOT_PATH on $(target) = $(dot_path) ;
+  MakeLocate $(outfile) : $(outdir) ;
+  Depends $(outfile) : $(doxyfile) ;
+  Depends $(target) : $(outfile) ;
+  RunDoxygen $(target) : $(doxyfile) ;
+  NotFile $(target) ;
+  Always $(target) ;
+  Clean $(target)clean : $(outfile) ;
+  if $(subdir)
+  {
+    CleanDir $(target)clean : $(outdir) ;
+  }
+  Depends cleandoc : $(target)clean ;
+  return outfile ;
+}
+}
+
+#----------------------------------------------------------------------------
+# Private helper rules and actions.
+
+##  _Texinfo targetname : texifiles : format : [ outfile ] : converter
+##           [ : options [ : subdir ]]
+##    The workhorse of the various Texinfo conversion rules. This rule sets up
+##    a pseudo-target 'targetname' which takes care of copying image files to
+##    the output directory if needed by the output format, gristing intput and
+##    output files, invoking the specified low-level conversion rule, and
+##    cleaning up temporary files upon completion.  'texifiles' is a list of
+##    Texinfo files to be converted.  The first element of 'texifiles' should
+##    be the top-level Texinfo document which @includes the remaining files. It
+##    is okay for 'texifiles' to mention only a single Texinfo source if the
+##    entire document is contained in the one file. 'format' is one of "info",
+##    "html", "xml", "docbook", "dvi", "ps", or "pdf", and is used in the
+##    formulation of the grist, and as the extension of 'outfile' if omitted.
+##    The format also determines which type of image files (if any) should be
+##    copied to the output directory, and whether the copied images should be
+##    cleaned up upon completion.  'outfile' is the name of the root output
+##    file.  If 'outfile' is omitted, then the output filename is derived from
+##    the first element of 'texifiles' with the extension changed to reflect
+##    'format'. 'converter' is the Jam rule which will perform the actual
+##    conversion. It is passed 'outfile' as $(<), and the first element of
+##    'texifiles' as $(>).  The optional 'subdir' is a subdirectory of
+##    $(LOCATE.DOCS) into which the generated files should be placed.
+##    'options' is a set of command-line flags to be passed directly to the
+##    underlying conversion tool.  Returns the gristed output file name.  The
+##    following variables may be accessed from within the 'converter' action:
+##      $(SRCDIR)  - Value of $(SUBDIR) when this rule was invoked.
+##      $(OUTDIR)  - Directory into which output files should be emitted.
+##      $(OUTLOG)  - Name of a log file within $(OUTDIR) into which 'converter'
+##                   may direct diagnostic output of conversion tool if needed.
+##      $(FORMAT)  - Value of 'format'.
+##      $(OPTIONS) - Value of 'options'.
+rule _Texinfo
+{
+  local target    = $(1) ;
+  local texifiles = $(2) ;
+  local format    = $(3) ;
+  local outfile   = $(4) ;
+  local converter = $(5) ;
+  local options   = $(6) ;
+  local subdir    = $(7) ;
+  local outdir    = [ FDirName $(LOCATE.DOCS) $(subdir) ] ;
+  local grist     = "$(SOURCE_GRIST)!$(target)!$(format)" ;
+  local outlog ;
+
+  local texifile = $(texifiles[1]:G=$(grist)) ;
+  local texideps = $(texifiles[2-]) ;
+
+  if ! $(outfile)
+  {
+    outfile = $(texifile:BS=.$(format)) ;
+  }
+  outfile = $(outfile:G=$(grist)) ;
+  outlog = $(outfile:G=:R=$(outdir):S=$(outfile:S)log) ;
+
+  local inftypes = .txt ;
+  local xmltypes = .jpg .png .gif ;
+  local dvitypes = .eps .pdf ;
+  local pstypes  = .eps ;
+  local pdftypes = .eps .pdf ;
+  local imagetypes copyimages ;
+  switch $(format)
+  {
+    case info    : imagetypes = $(inftypes) ; copyimages = no  ;
+    case html    : imagetypes = $(xmltypes) ; copyimages = yes ;
+    case xml     : imagetypes = $(xmltypes) ; copyimages = yes ;
+    case docbook : imagetypes = $(xmltypes) ; copyimages = yes ;
+    case dvi     : imagetypes = $(dvitypes) ; copyimages = yes ;
+    case ps      : imagetypes = $(pstypes)  ; copyimages = no  ;
+    case pdf     : imagetypes = $(pdftypes) ; copyimages = no  ;
+    case *       : Error "Texinfo: unrecognized output format" $(format) ;
+  }
+
+  local images ;
+  if $(imagetypes) { images = [ Recurse : $(imagetypes) ] ; }
+
+  local image ;
+  for image in $(images)
+  {
+    local imagegrist = "$(grist)!$(image:D)" ;
+    local src = $(image:BSG=$(imagegrist)) ;
+    local srcdir = [ ConcatDirs $(SUBDIR) $(image:D) ] ;
+    SEARCH on $(src) = $(srcdir) ;
+    if $(copyimages) = no
+    {
+      Includes $(texifile) : $(src) ;
+    }
+    else
+    {
+      local dst = $(image:BSG=$(imagegrist)built) ;
+      local dstdir = [ ConcatDirs $(outdir) $(image:D) ] ;
+      MakeLocate $(dst) : $(dstdir) ;
+      Copy $(dst) : $(src) ;
+      Depends $(dst) : $(src) ;
+      Depends $(outfile) : $(dst) ;
+      Clean $(target)clean : $(dst) ;
+    }
+  }
+
+  SRCDIR  on $(outfile) = $(SUBDIR) ;
+  OUTDIR  on $(outfile) = $(outdir) ;
+  OUTLOG  on $(outfile) = $(outlog) ;
+  FORMAT  on $(outfile) = $(format) ;
+  OPTIONS on $(outfile) = $(options) ;
+
+  SEARCH on $(texifile) = $(SUBDIR) ;
+  SEARCH on $(texideps) = $(SUBDIR) ;
+  Includes $(texifile) : $(texideps) ;
+  MakeLocate $(outfile) : $(outdir) ;
+  Depends $(outfile) : $(texifile) ;
+  Depends $(target) : $(outfile) ;
+  $(converter) $(outfile) : $(texifile) ;
+  NotFile $(target) ;
+  Clean $(target)clean : $(outfile) ;
+  if $(subdir)
+  {
+    CleanDir $(target)clean : $(outdir) ;
+  }
+  Depends cleandoc : $(target)clean ;
+
+  return $(outfile) ;
+}
+
+##  _Texi2DVI targetname : texifiles [ : subdir [ : outfile [ : options
+##            [ : format ]]]]
+##    A thin wrapper around the _Texinfo rule which invokes TeX-wrapping tools
+##    such as texi2dvi and texi2pdf. The action for this rule captures the
+##    output of TeX into a log file and tells the user to consult the log file
+##    if TeX fails.  It also monitors the log file for TeX `hbox' warnings, and
+##    informs the user to consult the log if any are discovered. The log file
+##    is removed silently if no problems are detected.  Returns the gristed
+##    output DVI file name.  In addition to the variables exported by the
+##    _Texinfo rule, the following variables may be accessed from within the
+##    action:
+##      $(CONVERTER) - The actual command-line tool wrapping TeX.
+rule _Texi2DVI
+{
+  local target    = $(1) ;
+  local texifiles = $(2) ;
+  local subdir    = $(3) ;
+  local outfile   = $(4) ;
+  local options   = $(5) ;
+  local format    = $(6) ;
+  local dvifile = [ _Texinfo $(target) : $(texifiles) : $(format) :
+    $(outfile) : RunTexi2DVI : -I $(SUBDIR) $(options) : $(subdir) ] ;
+  CONVERTER on $(dvifile) = $(CMD.TEXI2DVI) ;
+  OPTIONS on $(dvifile) += $(FLAGS.TEXI2DVI) ;
+  return $(dvifile) ;
+}
+
+##  _Dvi targetname : texifiles : format : outfile : converter [ : options
+##       [ : dvioptions [ : subdir ]]]
+##    A wrapper around the _Texi2DVI rule which also runs a secondary
+##    conversion rule/action on the generated DVI file. Examples of secondary
+##    conversions include dvips, dvipdf, etc. The arguments 'targetname',
+##    'format', 'outfile', and 'subdir' have the same meaning as for the
+##    _Texinfo and _Texi2DVI rules. 'converter' is the rule/action which
+##    converts the generated DVI file to the final output format.  'options' is
+##    a set of command-line flags to be passed directly to the underlying
+##    secondary conversion tool.  'dvioptions' are the command-line options
+##    passed to _Texi2DVI.  As with the _Texi2DVI rule, this rule captures the
+##    output of the secondary conversion tool to a log file and instructs the
+##    user to consult it when a problem is detected.  Returns the gristed
+##    output file name.
+rule _Dvi
+{
+  local target     = $(1) ;
+  local texifiles  = $(2) ;
+  local format     = $(3) ;
+  local outfile    = $(4) ;
+  local converter  = $(5) ;
+  local options    = $(6) ;
+  local dvioptions = $(7) ;
+  local subdir     = $(8) ;
+
+  local dvifile = [ _Texi2DVI _$(target)_dvi : $(texifiles) : $(subdir) :
+    $(outfile:S=.dvi) : $(dvioptions) : $(format) ] ;
+
+  if ! $(outfile)
+  {
+    outfile = $(dvifile:BS=.$(format)) ;
+  }
+  local outdir = [ FDirName $(LOCATE.DOCS) $(subdir) ] ;
+  local outlog = $(outfile:G=:R=$(outdir):S=$(outfile:S)log) ;
+
+  SRCDIR  on $(outfile) = $(SUBDIR) ;
+  OUTLOG  on $(outfile) = $(outlog) ;
+  FORMAT  on $(outfile) = $(format) ;
+  OPTIONS on $(outfile) = $(psoptions) ;
+
+  MakeLocate $(outfile) : $(outdir) ;
+  Depends $(outfile) : $(dvifile) ;
+  Depends $(target) : $(outfile) ;
+  $(converter) $(outfile) : $(dvifile) ;
+  RmTemps $(outfile) : $(dvifile) ;
+  Clean $(target)clean : $(outfile) $(dvifile) ;
+  NotFile $(target) ;
+  NotFile $(target)clean ;
+  if $(subdir)
+  {
+    CleanDir $(target)clean : $(outdir) ;
+  }
+
+  return $(outfile) ;
+}
+
+# Unfortunately, `makeinfo' 4.3, which ships with MSYS, does not respect the
+# search path (-I) for @image{} directives, so we need to `cd' into the source
+# directory to work around this shortcoming.  With modern versions of
+# `makeinfo', we could instead just use `-I$(SRCDIR)' instead of the pwd/cd
+# goop.
+actions RunMakeInfo
+{
+  dir=`pwd` ; \
+  cd $(>:D) ; \
+  $(CMD.MAKEINFO) $(OPTIONS) $(FLAGS.MAKEINFO) --output="${dir}/$(<)" $(>:B)
+}
+
+actions RunTexi2HTML
+{
+  T2H_HOME="$(PATH.TEXI2HTML.HOME)" \
+  $(CMD.TEXI2HTML) $(OPTIONS) $(FLAGS.TEXI2HTML) -subdir="$(OUTDIR)" \
+    -top-file="$(<:BS)" "$(>)"
+}
+
+actions RunTexi2DVI
+{
+  $(CONVERTER) $(OPTIONS) --batch --output=$(<) $(>) > $(OUTLOG) 2>&1
+  if test $? -ne 0; then
+    echo "*** ERROR: $(CONVERTER) reported one or more errors."
+    echo "*** ERROR: See $(OUTLOG) for details."
+    false
+  fi
+  if test $? -eq 0; then
+    grep hbox $(OUTLOG) >/dev/null 2>&1
+    if test $? -eq 0; then
+      echo "*** WARNING: $(CONVERTER) reported 'hbox' warnings." && \
+      echo "*** WARNING: See $(OUTLOG) for details."
+    else
+      $(RM) $(OUTLOG)
+    fi
+    true
+  else
+    false
+  fi
+}
+
+actions RunDVIPS
+{
+  TEXPICTS="$(SRCDIR)" \
+  $(CMD.DVIPS) $(OPTIONS) -o $(<) $(>) > $(OUTLOG) 2>&1
+  if test $? -ne 0; then
+    echo "*** ERROR: $(CMD.DVIPS) reported one or more errors."
+    echo "*** ERROR: See $(OUTLOG) for details."
+    false
+  else
+    $(RM) $(OUTLOG)
+    true
+  fi
+}
+
+actions RunDVIPDF
+{
+  TEXPICTS="$(SRCDIR)" \
+  $(CMD.DVIPDF) $(OPTIONS) $(>) $(<) > $(OUTLOG) 2>&1
+  if test $? -ne 0; then
+    echo "*** ERROR: $(CMD.DVIPDF) reported one or more errors."
+    echo "*** ERROR: See $(OUTLOG) for details."
+    false
+  else
+    $(RM) $(OUTLOG)
+    true
+  fi
+}
+
+actions RunDoxygen
+{
+  TOP=$(TOP) DOXYCPP=$(DOXYCPP) HAVE_DOT=$(HAVE_DOT) DOT_PATH=$(DOT_PATH) $(CMD.DOXYGEN) $(OPTIONS) $(FLAGS.DOXYGEN) $(>)
+}
+
+#----------------------------------------------------------------------------
+# Additional clean rules.
+
+CleanDir cleandoc : $(LOCATE.DOCS) ;
+Depends clean : cleandoc ;
+Help cleandoc : "Remove built documentation files" ;
+
+Always docclean ;
+NotFile docclean ;
+Depends docclean : cleandoc ;
diff --git a/mk/jam/dump.jam b/mk/jam/dump.jam
new file mode 100644 (file)
index 0000000..1dde8b4
--- /dev/null
@@ -0,0 +1,128 @@
+#==============================================================================
+# Utility functions for collecting information about the Jam environment.
+# Copyright (C)2004 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#==============================================================================
+
+#------------------------------------------------------------------------------
+# When the target "dumptargets" is invoked, dump the top-level, user-visible
+# build targets as a whitespace-delimited list to the file named by the Jam
+# variable DUMPTARGETS_FILE.  Example:
+#
+#    jam -sDUMPTARGETS_FILE=targets.txt dumptargets
+#
+# This output might be useful, for instance, when composing documentation (via
+# some automated mechanism) which lists the targets visible to the user.
+#
+# IMPLEMENTATION NOTES
+#
+# The emitted target names are collected from several locations:
+#
+#    - All single-word arguments to NotFile composed of ._- and alphanumerics.
+#
+#    - Targets defined by the Application rule.  Unlike other rules (Plugin,
+#      Library, etc.) which compose a top-level pseudo-target using NotFile
+#      (which is thus caught by the above case), on Unix, the Application rule
+#      does not invoke NotFile since the top-level target has the same name as
+#      the generated executable.
+#
+#    - Targets defined by the ShellScript rule, since the emitted shell scripts
+#      have the same name as the top-level target.
+#
+# Collection occurs in two phases.  This file must be included by build.jam
+# before any other utility *.jam files are included, and it must also be
+# included after all other utility *.jam files are included.  In the first
+# phase, the NotFile rule is re-defined so that we can catch pseudo-targets
+# created by the other utility *.jam files (we must re-define NotFile before
+# they are included), as well as any NotFile pseudo-targets created by Jamfiles
+# throughout the project.  In the second phase, the Application and ShellScript
+# rules are re-defined (we must do so after application.jam has defined the
+# implementations which we override).  These overrides allow us to catch
+# application and shell-script targets which project-wide Jamfiles define.
+#------------------------------------------------------------------------------
+if $(DUMPTARGETS_FILE)
+{
+# Jam does not support arithmetic, so we fake it with Roman numerals.
+DUMPTARGETS_PASS ?= "" ;
+DUMPTARGETS_PASS = "$(DUMPTARGETS_PASS)I" ;
+
+switch $(DUMPTARGETS_PASS)
+{
+case I :
+
+actions InitPseudoTargets
+{
+  $(RM) $(<)
+}
+
+rule DumpPseudoTargets
+{
+  NotFile $(<) ;
+  Always $(<) ;
+  Depends $(<) : $(>) ;
+  Always $(>) ;
+  InitPseudoTargets $(>) ;
+}
+
+DumpPseudoTargets dumptargets : "$(DUMPTARGETS_FILE)" ;
+
+actions together piecemeal EmitPseudoTarget
+{
+  echo "$(>)" >> $(<)
+}
+
+rule PossiblePseudoTarget
+{
+  # NoCare and Includes are not actually required; they are used here merely to
+  # avoid Jam's "using independent target" warning.  Note, however, that Jam
+  # 2.4 and BoostJam try building the target despite the fact that we NoCare
+  # about it. (Presumably this is because the targets have updating actions,
+  # and those actions override the NoCare.)  Consequently, we have to put up
+  # with the "using independent target" warnings for these older Jam versions.
+  NoCare $(<) ;
+  if $(JAMVERSION) != 2.4 { Includes dumptargets : $(<) ; }
+
+  local i ;
+  for i in $(<)
+  {
+    local s = [ Match ^([A-Za-z0-9_.-]+)$ : $(i) ] ;
+    if $(s)
+    {
+      EmitPseudoTarget "$(DUMPTARGETS_FILE)" : $(i) ;
+    }
+  }
+}
+
+rule NotFile
+{
+  PossiblePseudoTarget $(<) ;
+}
+
+case II :
+
+rule Application
+{
+  PossiblePseudoTarget $(<) $(<)clean ;
+}
+
+rule ShellScript
+{
+  PossiblePseudoTarget $(<) $(<)clean ;
+}
+
+}
+}
diff --git a/mk/jam/flags.jam b/mk/jam/flags.jam
new file mode 100644 (file)
index 0000000..aac2daf
--- /dev/null
@@ -0,0 +1,172 @@
+#============================================================================
+# Rules for specifying compiler and linker flags
+# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#============================================================================
+
+##  LinkWith target : libs
+##    Link an application with libraries. The specified libraries should have
+##    build rules in the same project. For external libraries use the
+##    ExternalLibs rule. Specify the library names without any extensions or
+##    the leading "lib".
+rule LinkWith
+{
+  local rawlibs = [ ResolveLibs $(>) ] ;
+
+  if ( $($(<)_TYPE) = library ) && ( "$($(<)_SHARED)" = "" )
+  {
+    # LibDepends for shared libs invokes LinkWith, so prevent recursion
+    LibDepends $(<) : $(rawlibs) ;
+  }                           
+  
+  local i libs ;
+  for i in $(rawlibs)
+  {
+    libs += [ ConstructLibraryLinkTarget $(i) : $($(i)_SHARED) ] ;
+  }
+      
+  Depends $($(<)_TARGET) : $(libs) ;
+  NEEDLIBS on $($(<)_TARGET) += $(libs) ;
+  $(<).NEEDLIBS += $(rawlibs) ;
+
+  LFlags $(<) : $($($(rawlibs).EXTERNALLIBS).LFLAGS) ;
+}
+
+##  CFlags target : flags [ : options ]
+##    Sets cflags on all sourcefiles of a library, plugin or application target
+##    This rule affects c++ and c compiler flags.
+rule CFlags
+{
+  CheckOptions nostatic : $(3) : $(<) ;
+
+  CCFLAGS on $($(<)_OBJECTS) += $(>) ;
+  C++FLAGS on $($(<)_OBJECTS) += $(>) ;
+
+  UnitTestCFlags $(<) : $(>) : $(3) ;
+}
+
+##  MergeLFlags flags1 : flags2
+##    Merge two arrays of linker flags. Removes duplicate entries, however,
+##    ensures that the correct relative right-to-left order of both flag arrays
+##    is kept.
+rule MergeLFlags
+{
+  local result = ;
+  local libs2 = $(2) ;
+  for l in $(1)
+  {
+    if [ IsElem $(l) : $(libs2) ]
+    {
+      # If a flag from set 1 is in set 2, add all flags from start of set 2
+      # to the occurance of the flag to result.
+      while "$(libs2[1])" != "" && $(libs2[1]) != $(l)
+      {
+        result += $(libs2[1]) ;
+        libs2 = $(libs2[2-]) ;
+      }
+      result += $(libs2[1]) ;
+      libs2 = $(libs2[2-]) ;
+    }
+    else
+    {
+      # Just add the flag.
+      result += $(l) ;
+    }
+  }
+  result += $(libs2) ;
+  return $(result) ;
+}
+
+##  LFlags target : flags [ : options ]
+##    Sets linker flags for a library, plugin or application target
+rule LFlags
+{
+  CheckOptions nostatic : $(3) : $(<) ;
+
+  NotFile $(>) ;
+  NEEDLIBS on $($(<)_TARGET) += $(>) ;
+  $(<).LFLAGS += $(>) ;
+
+  UnitTestLFlags $(<) : $(>) : $(3) ;
+}
+
+##  ExternalLibs target : identifiers
+##    Specify a dependency between 'target' and the external libraries
+##    indicated by 'identifiers'.  If 'target' is an application or plugin,
+##    then it is linked against the indicated external libraries.  If 'target'
+##    is a library, then its dependency upon 'identifiers' is noted, and
+##    applications or plugins which link against 'target' will also be linked
+##    against the libraries indicated by 'identifiers'.  'identifiers' is a
+##    list of base names of a set of variables which provide build tool
+##    information about each external library.  In particular, assuming that
+##    `ident' is one element of `identifiers', the value of $(ident).CFLAGS
+##    should provide compiler flags needed for the external library indicated
+##    by 'ident'; and $(ident).LFLAGS should provide linker flags for the
+##    library.
+rule ExternalLibs
+{
+  local extlib ;
+  for extlib in $(>)
+  {
+    CFlags $(<) : $($(extlib).CFLAGS) ;
+    LFlags $(<) : $($(extlib).LFLAGS) ;
+    
+    $(<).EXTERNALLIBS += $(extlib) ;
+  }
+}
+
+##  ExtraObjects target : objectfiles [ : options ]
+##    Link additional object files with a target.
+##    Options:
+##      inheritcflags: The mentioned object files will inherit compiler flags
+##      assigned to target's normal object files (in addition to any flags
+##      already set manually).
+rule ExtraObjects
+{
+  CheckOptions inheritcflags : $(3) : $(<) ;
+  if [ IsElem inheritcflags : $(3) ]
+  {
+    $(<)_OBJECTS += $(>) ;
+  }
+  EXTRAOBJECTS on $($(<)_TARGET) += $(>) ;
+  Depends $($(<)_TARGET) : $(>) ;
+  Clean $(<)clean : $(>) ;
+  Clean clean : $(>) ;
+}
+
+#----------------------------------------------------------------------------
+# private part
+
+##  ResolveLibs libs
+##    Given a list of libraries, augment the list by adding other libraries
+##    upon which the given libraries depend.  Dependencies between libraries
+##    are specified via LibDepends (or LinkWith when the target is a library).
+##    The returned list is ordered such that it is suitable for Unix linkers
+##    which are sensitive to the order of libraries in the invocation
+##    statement.
+rule ResolveLibs
+{
+  local i libs ;
+  for i in $(<)
+  {
+      libs += $(i) $($(i)_depends) ;
+  }
+  # We must eliminate the duplicates in reverse order in order to ensure that
+  # we do not destroy the overall library ordering since Unix linkers are
+  # order-sensitive.
+  return [ Reverse [ RemoveDups [ Reverse $(libs) ] ] ] ;
+}
diff --git a/mk/jam/groups.jam b/mk/jam/groups.jam
new file mode 100644 (file)
index 0000000..ea511fc
--- /dev/null
@@ -0,0 +1,61 @@
+#============================================================================
+# Rules for building compile groups
+# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#============================================================================
+
+COMPILE_GROUPS = ;
+
+##  CompileGroups target : groups
+##    Adds a target to a list of compile groups. A compile group is a virtual
+##    target which combines several targets. This is useful for things like a
+##    creating a target which compiles all image loaders, all renderers, etc.
+rule CompileGroups
+{
+  local _i ;
+
+  for _i in $(>)
+  {
+    Depends $(_i) : $(<) ;
+    Depends $(_i)clean : $(<)clean ;
+
+    if ! [ IsElem $(_i) : $(COMPILE_GROUPS) ]
+    {
+      NotFile $(_i) ;
+      Echo "Warning: $(_i) not registered via RegisterCompileGroups" ;
+    }
+  }
+}
+
+##  RegisterCompileGroups
+##    Registers compile groups. You must specify all compile groups here before
+##    can use them.
+rule RegisterCompileGroups
+{
+  NotFile $(<) ;
+  COMPILE_GROUPS += $(<) ;
+
+  local i ;
+  for i in $(<)
+  {
+    local desc = [ Description $(i) ] ;
+    if $(desc)
+    {
+      Help $(i) : "Build the $(desc)" ;
+    }
+  }
+}
diff --git a/mk/jam/help.jam b/mk/jam/help.jam
new file mode 100644 (file)
index 0000000..2197767
--- /dev/null
@@ -0,0 +1,85 @@
+#============================================================================
+# Rules for collecting and emitting descriptions about targets
+# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
+# Copyright (C)2004 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#============================================================================
+
+##  Description target [ : description ]
+##    Provides access to the description of 'target'. The description may be
+##    used by other rules, such as those which generate project files, or which
+##    present informative messages to the user regarding 'target'. If invoked
+##    with two arguments, then it sets the description of 'target'. If invoked
+##    with one argument, then it returns the description of 'target'. You
+##    should invoke this rule to set the description before invoking other
+##    rules which might need access to target's description, such as the
+##    Application, Library, and Plugin rules. As a convenience, several generic
+##    rules, such as Application, Library, and Plugin will automatically invoke
+##    the Help rule for 'target' using the provided 'description'.
+rule Description
+{
+  local desc = $(>) ;
+  if $(desc)
+  {
+    $(<)_description = $(desc) ;
+  }
+  else
+  {
+    desc = $($(<)_description) ;
+  }
+  return $(desc) ;
+}
+
+
+##  Help target : description
+##    Specify the 'description' to emit for 'target' when the user invokes "jam
+##    help".
+rule Help
+{
+  local target = $(<) ;
+  local desc = $(>) ;
+
+  if ! $(target) { target = "" ; }
+  if ! $(desc) { desc = "" ; }
+
+  # target width:20, description width:54
+  local target_pad = "                    " ;
+  local target_pat = "...................." ;
+  local desc_pad = "                                                      " ;
+  local desc_pat = "......................................................" ;
+
+  local m = Match ; # Indirect invocation allows variables in pattern regex.
+  local target_str = [ $(m) "($(target_pat)).*" : "$(target)$(target_pad)" ] ;
+  local desc_str = [ $(m) "($(desc_pat)).*" : "$(desc)$(desc_pad)" ] ;
+  local help = "jam $(target_str) $(desc_str)" ;
+
+  target = $(target:G=help) ;
+  Depends help : $(target) ;
+  NotFile $(help) ;
+  PrintHelp $(target) : $(help) ;
+  Always $(target) ;
+  NotFile $(target) ;
+}
+
+actions quietly PrintHelp
+{
+  echo "$(>)"
+}
+
+NotFile help ;
+Always help ;
+Help all : "Build the entire project" ;
diff --git a/mk/jam/helper.jam b/mk/jam/helper.jam
new file mode 100644 (file)
index 0000000..867b535
--- /dev/null
@@ -0,0 +1,594 @@
+#============================================================================
+# Helper rules
+# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
+# Copyright (C)2004 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#============================================================================
+
+SED ?= sed ;
+DEEPCOPY ?= "cp -R" ;
+DELTREE ?= "rm -rf" ;
+
+# The -f option to `cp' is not supported on older platforms.
+# The convolution of the conditional arises because CP is defined in Jambase as
+# two tokens rather than a single string, so we must check the tokens
+# individually; yet we also check it as a simple string for future robustness.
+if $(CP) = "cp -f" || $(CP[1]) = "cp" && $(CP[2]) = "-f"
+{
+  CP = cp ;
+}
+
+##  IncludeDir [ dir [ : target [ : options ]]]
+##    Specify the location of a directory containing header files for a target,
+##    or for the whole project if no target is given.  "dir" is a list of
+##    components composing the path.  This rule will automatically generate the
+##    -I compiler flags and makes sure the dependency scanner is able to locate
+##    your header files.  "dir" is assumed to be relative to the current
+##    subdirectory specified with the SubDir rule unless the "literal"
+##    option is given, in which case "dir" is used literally.  If "dir" is
+##    omitted, then the current subdirectory specified with SubDir is used as
+##    the header directory.  An omitted "dir" and the "literal" option are
+##    mutually exclusive.  You may invoke this rule multiple times to specify
+##    any number of header file directories.
+##    Options:
+##     literal: "dir" is to be used literally without any interpretation.
+##     transient: "dir" is to be used at build-time only; and should not be
+##         recorded in any generated resources, such as project files.
+##
+##    Implementation: The directory is simply added to the HDRS variable which
+##    is respected by all Jam rules.
+rule IncludeDir
+{
+  local dir = $(1) ;
+  local target = $(2) ;
+  local options = $(3) ;
+
+  CheckOptions literal transient : $(options) : $(dir) ;
+  if ! $(dir)
+  {
+    dir = $(SUBDIR) ;
+  }
+  else if ! [ IsElem literal : $(options) ]
+  {
+    dir = $(SUBDIR) $(dir) ;
+  }
+  dir = [ ConcatDirs $(dir) ] ;
+
+  if $(target)
+  {
+    local o ;
+    for o in $($(target)_OBJECTS)
+    {
+      CCHDRS on $(o) += [ FIncludes $(dir) ] ;
+    }
+  }
+  else
+  {
+    HDRS += $(dir) ;
+  }   
+}
+
+##  Wildcard [ dir : ] patterns
+##    Create a list of files in a directory which match the pattern. You can
+##    optionally specify a subdirectory. The files will be returned with
+##    stripped pathnames. The difference from GLOB is that this rule respects
+##    subdirectories which may have been entered with the SubDir rule.
+rule Wildcard
+{
+  local files dir sdir wildcards ;
+  
+  # Is a directory given?
+  if $(>)
+  {
+    dir = $(<)/ ;
+    sdir = [ ConcatDirs $(<) ] ;
+    wildcards = $(>) ;
+  }
+  else
+  {
+    dir = "" ;
+    sdir = "" ;
+    wildcards = $(<) ;
+  }
+
+  files = [ GLOB [ ConcatDirs $(SUBDIR) $(dir) ] : $(wildcards) ] ;
+
+  return $(files:BSR=$(sdir)) ;
+}
+
+##  Recurse [ rule ] : types [ : prefix ]
+##    Recursively scan current directory, $(SUBDIR), for files matching 'types'
+##    and invoke 'rule' for each file which matches one of the 'types'.
+##    'types' is a list of file extensions (with the leading dot).  'rule' will
+##    be invoked with two arguments: (1) the basename of the file including the
+##    extension, (2) a list of the path components from the current directory
+##    to the file's directory.  When 'rule' is invoked, it will see a $(SUBDIR)
+##    value of the directory containing the file (as if the rule had been
+##    invoked from within the file's directory).  'prefix' is an optional list
+##    of path components which will be prepended to rule's second argument.
+##    Returns the list of visited files.  It is legal to omit 'rule', if you
+##    are interested only in obtaining the list of files matching 'types'.
+rule Recurse
+{
+  local innerrule = $(1) ;
+  local types = $(2) ;
+  local prefix = $(3) ;
+  local files = [ GLOB $(SUBDIR) : * ] ;
+  local visited ;
+  
+  local i ;
+  for i in $(files)
+  {
+    if [ IsElem $(i:S) : $(types) ]
+    {
+      visited += [ FDirName $(prefix) $(i:BS) ] ;
+      if $(innerrule)
+      {
+        $(innerrule) $(i:BS) : $(prefix) ;
+      }
+    }
+    else
+    {
+      if ! [ IsElem $(i:BS) : $(DOT) $(DOTDOT) ]
+      {
+        local SUBDIR = $(i) ; # Called rules see this new temporary value.
+       visited += [ Recurse $(innerrule) : $(types) : $(prefix) $(i:BS) ] ;
+      }
+    }
+  }
+  return $(visited) ;
+}
+
+##  ResponseFile file : [ items [ : options [ : directory [ : delim ]]]]
+##    Jam places a fairly restrictive limit on the length of the command string
+##    emitted by an 'actions' block.  If the limit is exceeded, Jam rudely
+##    aborts.  This problem is easily triggered when actions are invoked
+##    'together' but not 'piecemeal'; especially when the command arguments
+##    involve many lengthy pathnames.  To work around this type of problem,
+##    some tools allow the client to furnish a file containing information
+##    which would otherwise be specified via the command-line.  This is often
+##    called a "response file".  The ResponseFile rule can be used to create a
+##    response file named 'file' in 'directory' containing 'items', one per
+##    line.  As a convenience, if 'directory' is not specified, and if the
+##    MakeLocate rule has not already been invoked for 'file' or LOCATE has not
+##    been set for 'file', then the file is placed in $(LOCATE_TARGET).  If
+##    there is a possibility that the same 'file' name might be used in other
+##    contexts, be sure to grist it appropriately to avoid conflicts.  This
+##    rule assumes that 'items' contains bound entries unless the "notfile"
+##    option is specified, in which case the NotFile rule is automatically
+##    invoked for each item.  This rule may be invoked multiple times for the
+##    same 'file' in order to populate the file incrementally.  As an internal
+##    optimization to keep performance relatively sane, ResponseFile
+##    temporarily inserts 'delim' between 'items' when emitting them, and then
+##    substitutes newline for 'delim' just before writing the items to
+##    'file'. 'delim' must be a one-character string. If not specified, "@" is
+##    used. If "@" is likely to appear in 'items', then choose a different
+##    character for 'delim'; one which is known to not appear in 'items'.  The
+##    rule returns 'file' to make it convenient to daisy-chain with invocations
+##    of other rules, such as RmTemps, Depends, or Always.
+##    Options:
+##      notfile: Invoke NotFile for each item automatically; otherwise, assume
+##               that each item is a bound file.
+rule ResponseFile
+{
+  local file = $(1) ;
+  local items = $(2) ;
+  local options = $(3) ;
+  local dir = $(4) ;
+  local delim = $(5) ;
+
+  CheckOptions notfile : $(options) : $(file) ;
+
+  if ! $(delim) { delim = "@" ; }
+  DELIM on $(file) = $(delim) ;
+
+  local firsttime = no ;
+  if ! [ IsElem $(file) : $(RESPONSE_FILE_REGISTRY) ]
+  {
+    firsttime = yes ;
+    RESPONSE_FILE_REGISTRY += $(file) ;
+  }
+
+  if ! $(items) && $(firsttime) = yes
+  {
+    items = "" ; # Force file creation even if list is empty.
+    options += notfile ;
+  }
+
+  if [ IsElem notfile : $(options) ] && $(items)
+  {
+    NotFile $(items) ;
+  }
+
+  if $(dir)
+  {
+    MakeLocate $(file) : $(dir) ;
+  }
+  else
+  {
+    local target_dir = [ on $(file) GetVar LOCATE ] ;
+    if ! $(target_dir)
+    {
+      MakeLocate $(file) : $(LOCATE_TARGET) ;
+    }
+  }
+
+  local i ;
+  for i in $(items)
+  {
+    if $(firsttime) = yes
+    {
+      ResponseFile1 $(file) : $(i) ;
+      firsttime = no ;
+    }
+    else
+    {
+      ResponseFile2 $(file) : $(i) ;
+    }
+  }
+
+  return $(file) ;
+}
+
+actions ResponseFile1
+{
+  echo '$(>)' > $(<)
+}
+
+actions piecemeal together quietly ResponseFile2
+{
+  echo '$(>)$(DELIM)' | $(SED) 's/$(DELIM) /$(DELIM)/g' | tr '$(DELIM)' '
+' >> $(<)
+}
+
+##  Sort list
+##    Given a list of items, returns a list containing the items sorted
+##    alphabetically.
+rule Sort
+{
+  local i sorted ;
+  for i in $(<)
+  {
+    local inserted = no ;
+    local j accum ;
+    for j in $(sorted)
+    {
+      if $(inserted) != yes && $(i:L) < $(j:L)
+      {
+        accum += $(i) ;
+        inserted = yes ;
+      }
+      accum += $(j) ;
+    }
+    if $(inserted) != yes
+    {
+      accum += $(i) ;
+    }
+    sorted = $(accum) ;
+  }
+  return $(sorted) ;
+}
+
+##  StripCommon list1 : list2
+##    Strips from the beginning of list1 the items which it has in common with
+##    the beginning of list2 and returns what remains of list1.
+rule StripCommon
+{
+  local l = $(<) ;
+  local r = $(>) ;
+  FStripCommon l : r ;
+  return $(l) ;
+}
+
+##  MasterHeader header [ : files [ : pre-boilerplate [ : post-boilerplate
+##                      [ : options ]]]]
+##    Given a list of 'files', construct a 'header' file which #includes those
+##    files. If 'header' does not already have a suffix, ".h" will be
+##    appended. The generated header will be emitted to $(LOCATE_TARGET), and
+##    will be protected against multiple-inclusion via the standard
+##    #ifndef __HEADER_H__ / #define / #endif mechanism. If provided,
+##    'pre-boilerplate' will be inserted verbatim immediately after the opening
+##    multiple-inclusion protection, but before the first #include. Likewise,
+##    'post-boilerplate' will be inserted verbatim after the last #include, but
+##    before the closing multiple-inclusion protection. If the boilerplate
+##    arguments are lists, the items will be emitted one per line.  'files'
+##    is sorted before the #include statements are generated, unless the
+##    "nosort" option is given. For convenience, the gristed 'header' is
+##    returned. Also sets up the following pseudo-targets:
+##
+##      masterheaders: Synthesize all requested master headers.
+##      cleanmasterheaders: Delete synthesized files.
+##      freezemasterheaders: Copy synthesized files to back into the source
+##        tree at $(SUBDIR).
+##
+##    Options:
+##      nosort: Do not sort 'files'.
+rule MasterHeader
+{
+  local header = [ FAppendSuffix $(1) : .h ] ;
+  local files = $(2) ;
+  local boilerpre = $(3) ;
+  local boilerpost = $(4) ;
+  local options = $(5) ;
+  local target = $(header:G=masterheader) ;
+  local protect = "__$(header:US=)_H__" ;
+
+  CheckOptions nosort : $(options) : $(header) ;
+  if ! [ IsElem nosort : $(options) ]
+  {
+    files = [ Sort $(files) ] ;
+  }
+
+  Always $(target) ;
+  ResponseFile $(target) :
+    "/* $(header) -- Generated automatically; do not edit. */"
+    "#ifndef $(protect)"
+    "#define $(protect)"
+    $(boilerpre)
+    "#include \"$(files)\""
+    $(boilerpost)
+    "#endif /* $(protect) */"
+    : notfile ;
+  Depends masterheaders : $(target) ;
+  Clean cleanmasterheaders : $(target) ;
+  Clean clean : cleanmasterheaders ;
+
+  local frozen = $(target:G=frozenmasterheader) ;
+  MakeLocate $(frozen) : $(SUBDIR) ;
+  Depends $(frozen) : $(target) ;
+  Copy $(frozen) : $(target) ;
+  Depends freezemasterheaders : $(frozen) ;
+
+  if $(MASTER_HEADER_GLOBAL_TARGETS) != yes
+  {
+    MASTER_HEADER_GLOBAL_TARGETS = yes ;
+
+    Always masterheaders ;
+    NotFile masterheaders ;
+    Help masterheaders : "Generate master header files" ;
+
+    Always freezemasterheaders ;
+    NotFile freezemasterheaders ;
+    Help freezemasterheaders :
+      "Copy generated master headers to source tree" ;
+  }
+
+  return $(target) ;
+}
+
+##  DirectoryMasterHeaders dirs [ : pre-boilerplate [ : post-boilerplate
+##                              [ : options [ : rejects ]]]]
+##    A convenience wrapper around MasterHeader which generates a set of master
+##    header files for each directory in 'dirs', which are assumed to be
+##    subdirectories of the current directory. For each item in 'dirs', the
+##    subdirectory is recursively scanned for files, and MasterHeader is
+##    invoked with the gleaned file list. The generated header for a directory
+##    is emitted to the current directory; not within the subdirectory.  The
+##    optional 'rejects' is a list of header files which should not be emitted
+##    to the synthesized master headers.  'pre-boilerplate',
+##    'post-boilerplate', and 'options' carry the same interpretation as for
+##    MasterHeader.
+rule DirectoryMasterHeaders
+{
+  local dirs = $(1) ;
+  local boilerpre = $(2) ;
+  local boilerpost = $(3) ;
+  local options = $(4) ;
+  local rejects = $(5) ;
+  local masters ;
+  local d ;
+  for d in $(dirs)
+  {
+    local files ;
+    {
+      local SUBDIR = [ ConcatDirs $(SUBDIR) $(d) ] ; # Recurse from here...
+      files = [ Recurse : .h : $(d) ] ;
+    }
+    if $(rejects)
+    {
+      files = [ Filter $(files) : $(rejects) ] ;
+    }
+    masters += [ MasterHeader $(d) : $(files) : $(boilerpre) : $(boilerpost) :
+      $(options) ] ;
+  }
+  return $(masters) ;
+}
+
+##  Prefix list : prefix
+##    Adds a prefix to a all elements in list.
+rule Prefix
+{
+  return $(>)$(<) ;
+}
+
+if $(JAMVERSION) >= 2.5
+{
+
+##  IsElem element : list
+##    Returns "true" if the element is in the list. Otherwise nothing is
+##    returned.
+rule IsElem
+{
+  local i ;
+
+  for i in $(>)
+  {
+    if $(i) = $(<)
+    {
+      return "true" ;
+    }
+  }
+
+  return ;
+}
+
+}
+else
+{
+
+# Jam <2.4's return statement doesn't exit the function
+rule IsElem
+{
+  local i result ;
+
+  for i in $(>)
+  {
+    if $(i) = $(<)
+    {
+      result = "true" ;
+      $(>) = ;
+    }
+  }
+
+  return $(result) ;
+}
+
+}
+
+##  Filter list : filter
+##    Returns the list without the words contained in filter.
+rule Filter
+{
+  local i result ;
+
+  for i in $(<)
+  {
+    if ! [ IsElem $(i) : $(>) ]
+    {
+      result += $(i) ;
+    }
+  }
+
+  return $(result) ;
+}
+
+##  RemoveDups list
+##    Removes duplicates in the list (this function tries to preserve the list
+##    order)
+rule RemoveDups
+{
+  local i result ;
+
+  for i in $(<)
+  {
+    if ! [ IsElem $(i) : $(result) ]
+    {
+      result += $(i) ;
+    }  
+  }
+
+  return $(result) ;
+} 
+
+##  Reverse list
+##    Reverse the order of items in the list.
+rule Reverse
+{
+  local result ;
+  
+  for i in $(<)
+  {
+    result = $(i) $(result) ;
+  }
+  return $(result) ;
+}
+
+##  GetVar argument
+##    Simply returns the value of the variable with name argument.
+##    This is useful to query on target variables:
+##       bla = [ on TARGET GetVar CFlags ] ;
+rule GetVar
+{
+  return $($(<)) ;
+}
+
+##  ConcatDirs dirs
+##    Concatenates a set of directories. This is a substitute for FDirName in
+##    Jambase. It works also correctly for several rooted paths, where FDirName
+##    fails.
+##    The advantage over $(dir1)/$(dir2) is that this also works correctly if
+##    $(dir1) or $(dir2) is not set.
+rule ConcatDirs
+{
+  local i ;
+  local result = $(<[1]) ;
+  if ! $(result) { $result = "" ; }
+  local dir1 dir2 ;
+
+  for i in $(<[2-])
+  {
+    # eleminate multiple slashes because jam is somewhat buggy here
+    dir1 = [ MATCH (.*[^/]?) : $(result) ] ;
+    dir2 = [ MATCH ([^/].*) : $(i) ] ;
+    if ! $(dir1) { dir1 = "" ; }
+    if $(dir1) != "" { dir1 = $(dir1)/ ; }
+    if ! $(dir2) { dir2 = "" ; }
+    result = $(dir1)$(dir2) ;
+  }
+
+  return $(result) ;
+}
+
+##  SplitToList var [ : separator ]
+##    Splits the value of var into a list using space as the separator unless
+##    an alterante separator is specified.
+##  IMPLEMENTATION NOTE
+##    When Jam sees an invocation of the `Match' function, it treats its first
+##    argument as a literal regular expression, and does not do any variable
+##    interpolation. This means that an expression, such as "(.*)$(sep)(.*)"
+##    will not be interpreted as expected; it will instead be interpreted as an
+##    invalid regex. To work around this limitation, we invoke `Match'
+##    indirectly.
+rule SplitToList
+{
+  local list = ;
+  local matcher = Match ; # See IMPLEMENTATION NOTE above.
+  local unsplit = $(<) ;
+  local sep = $(2) ;
+  if ! $(sep) { sep = " " ; }
+  while $(unsplit) != ""
+  {
+    local split = [ $(matcher) "(.*)$(sep)(.*)" : $(unsplit) ] ;
+    if $(split[1]) = ""
+    {
+      list += $(unsplit) ;
+      unsplit = "" ;
+    }
+    else
+    {
+      list += $(split[2]) ;
+      unsplit = $(split[1]) ;
+    }
+  }
+  
+  return [ Reverse $(list) ] ;
+}
+
+##  Copy target : source
+##    Copy source to target.
+actions Copy
+{
+  $(RM) $(<)
+  $(CP) $(>) $(<)
+}
+
+##  Move target : source
+##    Move (or rename) source to target.
+actions ignore Move
+{
+  $(MV) $(>) $(<)
+}
diff --git a/mk/jam/install.jam b/mk/jam/install.jam
new file mode 100644 (file)
index 0000000..be54c59
--- /dev/null
@@ -0,0 +1,213 @@
+#============================================================================
+# Rules for installation
+# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
+# Copyright (C)2004 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#============================================================================
+
+INSTALL ?= "install" ;
+INSTALL_PROGRAM ?= $(INSTALL) ;
+INSTALL_DATA ?= "$(INSTALL) -m 644" ;
+
+# set some paths
+appdatadir ?= [ ConcatDirs $(datadir) $(PACKAGE_NAME) ] ;
+appdocdir ?= [ ConcatDirs $(datadir) doc $(PACKAGE_NAME)-$(PACKAGE_VERSION) ] ;
+appconfdir ?= [ ConcatDirs $(sysconfdir) $(PACKAGE_NAME) ] ;
+appincdir ?= [ ConcatDirs $(includedir) $(PACKAGE_NAME) ] ;
+plugindir ?= [ ConcatDirs $(libdir) $(PACKAGE_NAME) ] ;
+
+rule GristInstall
+{
+  local i, files ;
+  for i in $(<)
+  {
+    if $(i:G) { files += $(i) ; }
+    else { files += $(i:G=$(SUBDIR)) ; }
+  }
+  return $(files) ;
+}
+
+##  InstallHeader headername [ : subdir ]
+##    DoInstall a header file into the includedir directory. A subdirectory
+##    relative to the includedir can be specified.
+rule InstallHeader
+{
+    local files = [ GristInstall $(<) ] ;
+    SEARCH on $(files) = $(SUBDIR) ;
+    Depends install_include : [ DoInstall $(files) : $(appincdir) $(2) ] ;
+}
+
+##  InstallData files [ : subdir ]
+##    Installs data files
+rule InstallData
+{
+    local files = [ GristInstall $(<) ] ;
+    SEARCH on $(files) = $(SUBDIR) ;
+    Depends install_data : [ DoInstall $(files) : $(appdatadir) $(2) ] ;
+}
+
+##  InstallConfig files [ : subdir ]
+##    Installs configuration files
+rule InstallConfig
+{
+    local files = [ GristInstall $(<) ] ;
+    SEARCH on $(files) = $(SUBDIR) ;
+    Depends install_config : [ DoInstall $(files) : $(appconfdir) $(2) ] ;
+}
+
+##  InstallDoc files [ : subdir ]
+##    Installs documentation files
+rule InstallDoc
+{
+    local files = [ GristInstall $(<) ] ;
+    SEARCH on $(files) = $(SUBDIR) ;
+    Depends install_doc : [ DoInstall $(files) : $(appdocdir) $(2) ] ;
+}
+
+##  InstallMan files
+##    Installs Unix manual files
+rule InstallMan
+{
+    local files = [ GristInstall $(<) ] ;
+    SEARCH on $(files) = $(SUBDIR) ;
+
+    local i ;
+    for i in $(files)
+    {
+        local dir = $(mandir) ;
+        switch $(i:S)
+        {
+            case .1 : dir += man1 ;
+            case .2 : dir += man2 ;
+            case .3 : dir += man3 ;
+            case .4 : dir += man4 ;
+            case .5 : dir += man5 ;
+            case .6 : dir += man6 ;
+            case .7 : dir += man7 ;
+            case .8 : dir += man8 ;
+            case .9 : dir += man9 ;
+            case * :
+                echo "WARNING: manfile has no *.[0-9] ending." ;
+        }
+        Depends install_man : [ DoInstall $(i) : $(dir) ] ;
+    }
+}
+
+##  InstallProgram files [ : directories ]
+##    Installs program files (executable or shell script). This is a
+##    convenience wrapper for DoInstall when the resources to be installed is
+##    of an invocable nature. It sets SEARCH on `files', and uses
+##    $(INSTALL_PROGRAM) to perform the actual installation. Unlike
+##    SystemInstallApplication, it does not assume that all such targets should
+##    be installed into $(bindir); instead, you can provide `directories' to
+##    specify the installation location. If `directories' is not given, then
+##    $(bindir) is assumed. Also, unlike SystemInstallApplication, this rule
+##    does not have any platform-specific knowledge (such as how to install a
+##    Cocoa application wrapper on MacOS/X). Always use
+##    SystemInstallApplication for installation of full-fledged applications. A
+##    typical use for InstallProgram would be to install an already-existing
+##    shell script. This differs from the ShellScript rule which both creates a
+##    shell script from scratch at build time, and arranges for it to be
+##    installed. Like DoInstall, this rule returns the names of the installed
+##    targets, so it is convenient to use the results as the input for another
+##    rule, such as Depends.
+rule InstallProgram
+{
+    local files = [ GristInstall $(1) ] ;
+    local dir = $(2) ;
+    if ! $(dir) { dir = $(bindir) ; }
+    SEARCH on $(files) = $(SUBDIR) ;
+    return [ DoInstall $(files) : $(dir) : $(INSTALL_PROGRAM) ] ;
+}
+
+##  DoInstall sourcenames : directories [ : installapp : [ postinstallrules ]]
+##    Creates a new install target for the given sources named by
+##    `sourcenames'.  `directories' is a list of directory components
+##    indicating the installation directory for `sourcename'.  `installapp' is
+##    the actual program to run to install the sources.  If not specified, then
+##    $(INSTALL_DATA) is used.  If the optional `postinstallrules' is provided,
+##    it is a list of Jam rules to invoke on the installed target after it is
+##    installed.  Each rule is invoked with the installed target as the first
+##    argument, and the source target as the second. An obvious instance where
+##    `postinstallrules' proves useful is when the Ranlib rule should be
+##    invoked on just-installed static library (.a) files.  The DoInstall rule
+##    returns the names of the installed targets, so it is convenient to use
+##    the results as the input for another rule.  For example:
+##        Depends install : [ DoInstall $(docfiles) : $(installdocdir) ] ;
+##    (Implementation Note: We did not name this rule Install, because Jambase
+##    already defines an action named Install :-/)
+rule DoInstall
+{
+    local targets target i dir gdir ;
+    dir = [ ConcatDirs $(DESTDIR) $(2) ] ;
+
+    gdir = $(dir:G=dir) ;
+    MkDir $(gdir) ;
+  
+    for i in $(1)
+    {
+        target = $(i:BSR=$(dir):G=install) ;
+        targets += $(target) ;
+        Depends $(target) : $(gdir) $(i) ;
+        Install1 $(target) : $(i) ;
+
+        if "$(3)"
+       {
+            INSTALL_APP on $(target) = $(3) ;
+        }
+       else
+       {
+            INSTALL_APP on $(target) = $(INSTALL_DATA) ;
+        }
+
+       if "$(4)"
+       {
+           local postrule ;
+           for postrule in $(4)
+           {
+               $(postrule) $(target) : $(i) ;
+           }
+       }
+    }
+
+    Always $(targets) ;
+    return $(targets) ;
+}
+
+#----------------------------------------------------------------------------
+
+INSTALLTARGETS = install_bin install_plugin install_lib install_include
+                install_data install_config install_doc ;
+
+Always install $(INSTALLTARGETS) ;
+NotFile install $(INSTALLTARGETS) ;
+Depends install : $(INSTALLTARGETS) ;
+
+if ! $(PACKAGE_INSTALL_NAME) { PACKAGE_INSTALL_NAME = $(PACKAGE_LONGNAME) ; }
+if ! $(PACKAGE_INSTALL_NAME) { PACKAGE_INSTALL_NAME = $(PACKAGE_NAME) ; }
+if ! $(PACKAGE_INSTALL_NAME) { PACKAGE_INSTALL_NAME = "the project" ; }
+Help install : "Install $(PACKAGE_INSTALL_NAME)" ;
+
+actions Install1
+{
+  $(INSTALL_APP) $(INSTALLFLAGS) $(>) $(<)
+}
+
+actions CopyDirs
+{
+  $(DEEPCOPY) $(>) $(<)
+}
diff --git a/mk/jam/jamcompatibility.jam b/mk/jam/jamcompatibility.jam
new file mode 100644 (file)
index 0000000..6e36570
--- /dev/null
@@ -0,0 +1,349 @@
+#============================================================================
+# Several hacks to make the build compatible with certain old/broken jam
+# versions
+# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#============================================================================
+
+# BoostJam is evil: It is compatible to Jam 2.4 but has a version number 3.1,
+# we try to detect BoostJam with the ARGV extension.
+if $(ARGV[0])
+{
+  # BoostJam hacks.
+  JAMVERSION = 2.4 ;
+  rule FIncludes
+  {
+    return -I$(<) ;
+  }
+  rule FDefines
+  {
+    return -D$(<) ;
+  }
+}
+
+if $(JAMVERSION) < 2.4
+{
+    EXIT "Error: This buildsystem requires jam version 2.4 or later." ;
+}
+
+# All scripts invoked by the build system expect a Bourne or compatible shell.
+# Reject C-shell and its variants (such as tcsh).  Unfortunately, this is a bit
+# of an ugly hack.  It would be nicer to perform this logic at the very end of
+# this file as a last-minute assertion.  Unfortunately, however, it seems that
+# references to $(SHELL) in any of the included files get bound at the point
+# of reference, thus we need to perform this filtering as early as possible.
+# Furthermore, on Windows, if the MSYS installation path contains a space (such
+# as "c:\Program Files\msys"), the space will cause `actions' to fail which
+# employ $(SHELL) indirectly through some other variable.  Therefore, handle
+# this case as well.
+if [ Match (csh) : $(SHELL) ] || $(SHELL[2])
+{
+  SHELL = "/bin/sh" ;
+}
+
+# Jam 2.4's SubDir rule had some problems and misses the useful SUBDIRRULES
+# extension. So we override it here with a better version (from jam 2.5rc3).
+# Likewise, 2.4 is missing FReverse and FStrip, which are needed by SubDir and
+# other custom rules we define.
+if $(JAMVERSION) = 2.4
+{
+
+rule FReverse 
+{
+       # FReverse a1 a2 a3 ... ;
+       # return ... a3 a2 a1 ;
+
+       if $(1) { return [ FReverse $(1[2-]) ] $(1[1]) ; }
+}
+
+rule FStripCommon
+{
+       # FStripCommon v1 : v2 ;
+
+       # Strip common initial elements of variables v1 and v2.
+       # Modifies the variable values themselves.
+
+       if $($(<)[1]) && $($(<)[1]) = $($(>)[1])
+       {
+           $(<) = $($(<)[2-]) ;
+           $(>) = $($(>)[2-]) ;
+           FStripCommon $(<) : $(>) ;
+       }
+}
+
+rule SubDir
+{
+       #
+       # SubDir TOP d1 d2 ... ;
+       #
+       # Support for a project tree spanning multiple directories.
+       #
+       # SubDir declares a Jamfile's location in a project tree, setting
+       # Jambase variables (SEARCH_SOURCE, LOCATE_TARGET) so that source
+       # files can be found.
+       #
+       # TOP is a user-select variable name for root of the tree, and
+       # d1 d2 ...  are the directory elements that lead from the root
+       # of the tree to the directory of the Jamfile.
+       #
+       # TOP can be set externally, but normally the first SubDir call
+       # computes TOP as the path up from the current directory; the
+       # path contains one ../ for each of d1 d2 ...
+       #
+       # SubDir reads once the project-specific rules file Jamrules 
+       # in the TOP directory, if present.  This can be overridden
+       # with the variable TOPRULES.
+       #
+       # SubDir supports multiple, overlaid project trees:  SubDir
+       # invocations with different TOPs can appear in the same Jamfile.
+       # The location established by the first SubDir call is used set
+       # the TOPs for the subsequent SubDir calls.
+       #
+       # SubDir's public variables:
+       #
+       #       $(TOP) = path from CWD to root.
+       #       $(SUBDIR) = path from CWD to the directory SubDir names.
+       #       $(SUBDIR_TOKENS) = path from $(TOP) to $(SUBDIR) as dir names
+       #       $(SEARCH_SOURCE) = $(SUBDIR)
+       #       $(LOCATE_SOURCE) = $(ALL_LOCATE_TARGET) $(SUBDIR)
+       #       $(LOCATE_TARGET) = $(ALL_LOCATE_TARGET) $(SUBDIR)
+       #       $(SOURCE_GRIST) = $(SUBDIR_TOKENS) with !'s 
+       #
+
+       local _top = $(<[1]) ;
+       local _tokens = $(<[2-]) ;
+
+       #
+       # First time through sets up relative root and includes Jamrules.
+       #
+
+       if ! $(_top)
+       {
+           Exit SubDir syntax error ;
+       }
+
+       if ! $($(_top)-SET)
+       {
+           $(_top)-SET = true ;
+
+           # First time we've seen this TOP.
+           # We'll initialize a number of internal variables:
+           #
+           #   $(TOP-UP) = directories from ROOT to a common point
+           #   $(TOP-DOWN) = directories from common point to TOP
+           #   $(TOP-ROOT) = root directory for UP/DOWN -- normally CWD
+           #   $(SUBDIR_UP) = current value of $(TOP-UP)
+           #   $(SUBDIR_DOWN) = current value of $(TOP-DOWN)
+           #   $(SUBDIR_ROOT) = current value of $(TOP-ROOT)
+           #
+
+           if $($(_top))
+           {
+               # TOP externally set.
+               # We'll ignore the relative (UP/DOWN) path that
+               # got us here, and instead remember the hard ROOT.
+
+               $(_top)-UP = ;
+               $(_top)-DOWN = ;
+               $(_top)-ROOT = $($(_top)) ;
+           }
+           else
+           {
+               # TOP not preset.
+
+               # Establishing a new TOP.  In the simplest case,
+               # (SUBDIR_UP/SUBDIR_DOWN/SUBDIR_ROOT unset), it's
+               # merely a certain number of directories down from
+               # the current directory, and FSubDirPath will set
+               # TOP to a path consisting of ../ for each of the
+               # elements of _tokens, because that represents how 
+               # far below TOP the current directory sits.
+               #
+               # In the more complicated case, the starting directory
+               # isn't the directory of jam's invocation but an 
+               # location established by previous SubDir call.  The
+               # starting directory is SUBDIR_UP directories up from
+               # SUBDIR_ROOT, and then SUBDIR_DOWN directories down
+               # from that.   If SUBDIR_ROOT is not set, that means
+               # SUBDIR_DOWN and SUBDIR_UP represent the path from
+               # the directory of jam's invocation.
+               #
+               # In the most complicated case, the _tokens also 
+               # represents directories down, because TOP is being
+               # estalished in a directory other than TOP's root.
+               # Hopefully, _tokens and SUBDIR_DOWN represent the
+               # same final directory, relative to the new TOP and
+               # the previous SubDIr's TOP.  To find the new TOP,
+               # we have to chop off any common directories from
+               # then ends of _tokens and SUBDIR_DOWN.  To do so,
+               # we reverse each of them, call FStripCommon to
+               # remove the initial common elements, and then
+               # reverse them again.  After this process, if
+               # both _tokens and SUBDIR_DOWN have elements, it
+               # means the directory names estalished by the two
+               # SubDir calls don't match, and a warning is issued.
+               # All hell will likely break loose at this point,
+               # since the whole SubDir scheme relies on the SubDir
+               # calls accurately naming the current directory.
+
+               # Strip common trailing elements of _tokens and SUBDIR_DOWN.
+
+               _tokens = [ FReverse $(_tokens) ] ;
+               SUBDIR_DOWN = [ FReverse $(SUBDIR_DOWN) ] ;
+               FStripCommon _tokens : SUBDIR_DOWN ;
+               SUBDIR_DOWN = [ FReverse $(SUBDIR_DOWN) ] ;
+               _tokens = [ FReverse $(_tokens) ] ;
+
+               if $(SUBDIR_DOWN) && $(_tokens) 
+               { 
+                   Echo Warning: SubDir $(<) misplaced! ; 
+               }
+
+               # We'll remember the relative (UP/DOWN) path that
+               # got us here, plus any hard ROOT starting point
+               # for the UP/DOWN.  If TOP is never set externally,
+               # ROOT will always be "" (directory of jam's invocation).
+
+               $(_top)-UP = $(SUBDIR_UP) $(_tokens) ;
+               $(_top)-DOWN = $(SUBDIR_DOWN) ;
+               $(_top)-ROOT = $(SUBDIR_ROOT:E="") ;
+               $(_top) = [ FSubDirPath $(_top) ] ;
+           }
+
+           # Set subdir vars for the inclusion of the Jamrules,
+           # just in case they have SubDir rules of their own.
+           # Note that SUBDIR_DOWN is empty: it's all the way
+           # up where the Jamrules live.  These gets overrided
+           # just after the inclusion.
+
+           SUBDIR_UP = $($(_top)-UP) ;
+           SUBDIR_DOWN = ;
+           SUBDIR_ROOT = $($(_top)-ROOT) ;
+
+           # Include $(TOPRULES) or $(TOP)/Jamrules.
+           # Include $(TOPRULES) if set.
+           # Otherwise include $(TOP)/Jamrules if present.
+
+           if $($(_top)RULES) { 
+               include $($(_top)RULES) ;
+           } else { 
+               NoCare $(JAMRULES:R=$($(_top)):G=$(_top)) ;
+               include $(JAMRULES:R=$($(_top)):G=$(_top)) ;
+           }
+       }
+
+       # Get path from $(TOP) to named directory.
+       # Save dir tokens for other potential uses.
+
+       SUBDIR_UP = $($(_top)-UP) ;
+        SUBDIR_DOWN = $($(_top)-DOWN) $(_tokens) ;
+       SUBDIR_ROOT = $($(_top)-ROOT) ;
+        SUBDIR_TOKENS = $(SUBDIR_DOWN) ;
+
+       SUBDIR = [ FSubDirPath $(<) ] ;
+
+       # Now set up SEARCH_SOURCE, LOCATE_TARGET, SOURCE_GRIST
+       # These can be reset if needed.  For example, if the source
+       # directory should not hold object files, LOCATE_TARGET can
+       # subsequently be redefined.
+
+       SEARCH_SOURCE = $(SUBDIR) ;
+       LOCATE_SOURCE = $(ALL_LOCATE_TARGET) $(SUBDIR) ;
+       LOCATE_TARGET = $(ALL_LOCATE_TARGET) $(SUBDIR) ;
+       SOURCE_GRIST = [ FGrist $(SUBDIR_TOKENS) ] ;
+
+       # Reset per-directory ccflags, hdrs, etc,
+       # listed in SUBDIRRESET.
+       # Note use of variable expanded assignment var
+
+       SUBDIR$(SUBDIRRESET) = ;
+
+       # Invoke user-specific SubDir extensions,
+       # rule names listed in SUBDIRRULES.
+       # Note use of variable expanded rule invocation
+
+       $(SUBDIRRULES) $(<) ;
+}
+
+rule FSubDirPath
+{
+       # FSubDirPath TOP d1 ... ;
+
+       # Returns path to named directory.
+
+       # If jam is invoked in a subdirectory of the TOP, then we
+       # need to prepend a ../ for every level we must climb up
+       # (TOP-UP), and then append the directory names we must 
+       # climb down (TOP-DOWN), plus the named directories d1 ...
+       # If TOP was set externally, or computed from another TOP 
+       # that was, we'll have to reroot the whole thing at TOP-ROOT.
+
+       local _r = [ FRelPath $($(<[1])-UP) : $($(<[1])-DOWN) $(<[2-]) ] ;
+
+       return $(_r:R=$($(<[1])-ROOT)) ;
+}
+
+rule SubInclude
+{
+       # SubInclude TOP d1 ... ;
+       #
+       # Include a subdirectory's Jamfile.
+
+       # We use SubDir to get there, in case the included Jamfile
+       # either doesn't have its own SubDir (naughty) or is a subtree
+       # with its own TOP.
+
+       if ! $($(<[1]))
+       {
+           Exit SubInclude $(<[1]) without prior SubDir $(<[1]) ;
+       }
+
+       SubDir $(<) ;
+
+       include $(JAMFILE:D=$(SUBDIR)) ;
+}
+
+rule SubRules
+{
+       # SubRules TOP d1 ... : Other-TOP ;
+       #
+       # Read another tree's Jamrules, by giving it's path according
+       # to this tree and it's own name.
+
+       if ! $($(<[1]))
+       {
+           Exit SubRules $(<[1]) without prior SubDir $(<[1]) ;
+       }
+
+       SubDir $(<) ;
+       SubDir $(>) ;
+}
+
+## Now we try to fix up the already messed settings
+## XXX We can only hope that Jam 2.4 users don't try starting Jam from
+## subdirectories
+TOP-SET = true ;
+TOP-UP = ;
+TOP-DOWN = ;
+TOP-ROOT = $(TOP) ;
+SUBDIR_UP = $(TOP-UP) ;
+SUBDIR_DOWN = ;
+SUBDIR_ROOT = $(TOP-ROOT) ;
+
+#SubDir TOP ;
+
+} # end if $(JAMVERSION) = 2.4
diff --git a/mk/jam/library.jam b/mk/jam/library.jam
new file mode 100644 (file)
index 0000000..de5a6d3
--- /dev/null
@@ -0,0 +1,322 @@
+#============================================================================
+# Rules for library creation
+# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#============================================================================
+
+# Suppress ar's noisy report that it created the archive we asked it to create.
+if $(AR) && $(AR[2]) = ru { AR = $(AR[1]) ruc ; }
+
+##  Library libname : sources [ : options ]
+##    Build a library out of sourcefiles. All sourcefiles will be passed
+##    to the Objects rule which tries to compile them into object-files. You
+##    can create rules for your own filetypes with the UserObject rule. Header
+##    files will just be ignored. They are only used for MSVC projectfile
+##    generation.
+##    Available options are 'shared' if you want to build a shared library on
+##    platforms which support that. You can specify the 'noinstall' option if
+##    you don't want an install target generated.
+##    Don't specify any extensions for the library name, also leave out the
+##    leading "lib".
+##    Options:
+##     noinstall: Do not set up a default installation target.
+##     independent: The target will not be made a dependency of the libs and
+##                  all targets.
+##     shared: Create as a shared library on supported platforms.
+##     nohelp: Do not invoke Help for this target.
+##      notest: Do not set up unit-testing support for this target.
+##     optional: Affects handling of the library in cs-config; it is only
+##               reported as available when actually built.
+rule Library
+{
+  local options = $(3) ;
+  CheckOptions noinstall independent shared nohelp notest optional : $(options) : $(<) ;
+
+  local target = [ ConstructLibraryTarget $(<) : $(options) ] ;
+  local sources = [ DoSourceGrist $(>) ] ;
+  local objects ;
+  local i ;
+  for i in $(sources)
+  {
+    if $(i:S) = $(SUFOBJ)
+    {
+      objects += $(i) ;
+    }
+    else
+    {
+      objects += [ CompileObjects $(i) ] ;
+    }
+  }
+
+  $(<)_TYPE = library ;
+  $(<)_OBJECTS = $(objects) ;
+  $(<)_SOURCES = $(sources) ;
+  $(<)_TARGET = $(target) ;
+
+  # create target clean rule
+  Always $(<)clean ;
+  NotFile $(<)clean ;
+  Clean $(<)clean : $(objects) ; # create target clean rule 
+
+  # so 'jam foo' works when it's really foo.exe (Windows) or foo.app (MacOS/X)
+  if $(target) != $(<)
+  {
+    Depends $(<) : $(target) ;
+    NotFile $(<) ;
+  }
+
+  # library depends on its member objects
+  if ! [ IsElem independent : $(options) ]
+  {
+    if $(KEEPOBJS)
+    {
+      Depends obj : $(objects) ;
+    }
+    else
+    {
+      Depends libs : $(<) ;
+    }
+  }
+
+  if ( ! [ IsElem shared : $(options) ] ) || ( $(BUILD_SHARED_LIBS) != "yes" )
+  {
+    $(<)_SHARED = "" ;
+    LibraryStatic $(<) : $(objects) : [ Filter $(options) : shared ] :
+      $(target) ;
+  }
+  else
+  {
+    $(<)_SHARED = "shared" ;
+    LibraryShared $(<) : $(objects) : $(options) : $(target) ;
+  }
+  CFlags $(<) : $(LIBRARY.CFLAGS) ;
+  LFlags $(<) : $(LIBRARY.LFLAGS) ;
+
+  if ! [ IsElem nohelp : $(options) ]
+  {
+    local desc = [ Description $(<) ] ;
+    if ! $(desc) { desc = "$(<) library" ; }
+    Help $(<) : "Build the $(desc)" ;
+  }
+
+  if ! [ IsElem notest : $(options) ]
+  {
+    UnitTest $(<) ;
+  }
+}
+
+##  LibDepends libname : dependant libraries
+##    Make Library dependant on other libraries.  This will tell the build
+##    system that your library uses functions from other libraries in the
+##    project.  Note that a library shouldn't be linked with any external
+##    library that should be done by the final application which uses the
+##    library.
+rule LibDepends
+{
+  $(<)_depends += $(>) ;
+  
+  if "$($(<)_SHARED)"
+  {
+    LinkWith $(<) : $(>) ;
+  }
+
+  UnitTestLibDepends $(<) : $(>) ;
+}
+
+#----------------------------------------------------------------------------
+# private part
+
+# LibraryStatic libname : sources : options : decoratedtarget
+rule LibraryStatic
+{
+  local objects = $(>) ;
+  local options = $(3) ;
+  local target = $(4) ;
+
+  # Set LOCATE for the library and its contents.  The bound
+  # value shows up as $(NEEDLIBS) on the Link actions.
+  # For compatibility, we only do this if the library doesn't
+  # already have a path.
+  if ! $(target:D)
+  {
+    MakeLocate $(target) $(target)($(objects:BS)) : $(LOCATE.OBJECTS)/libs ;
+  }
+
+  if $(NOARSCAN)
+  {
+    # If we can't scan the library to timestamp its contents,
+    # we have to just make the library depend directly on the
+    # on-disk object files.  
+    Depends $(target) : $(objects) ;
+  }
+  else
+  {
+    # If we can scan the library, we make the library depend
+    # on its members and each member depend on the on-disk
+    # object file.
+    Depends $(target) : $(target)($(objects:BS)) ;
+
+    local i ;
+    for i in $(objects)
+    {
+      Depends $(target)($(i:BS)) : $(i) ;
+    }
+  }
+
+  # Generate install rules
+  if ! [ IsElem noinstall : $(options) ]
+  {
+    if "$(RANLIB)"
+    {
+      Depends install_lib : [ DoInstall $(target) : $(libdir) : : Ranlib ] ;
+    }
+    else
+    {
+      Depends install_lib : [ DoInstall $(target) : $(libdir)  ] ;
+    }
+    
+    # Add to global library list
+    if [ IsElem optional : $(options) ]
+    {
+      INSTALLEDLIBS_OPTIONAL += $(<) ;
+    }
+    else
+    {
+      INSTALLEDLIBS += $(<) ;
+    }
+  }
+
+  if $(CRELIB)
+  {
+    CreLib $(target) : $(objects[1]) ;
+  }
+
+  Archive $(target) : $(objects) ;
+  Clean $(<)clean : $(target) ;
+  Depends clean : $(<)clean ;
+
+  if $(RANLIB)
+  {
+    Ranlib $(target) ;
+  }
+
+  # If we can't scan the library, we have to leave the .o's around.
+  if ! ( $(NOARSCAN) || $(NOARUPDATE) || $(KEEPOBJS) )
+  {
+    RmTemps $(target) : $(objects) ;
+  }
+}
+
+# LibraryStatic libname : sources : options : decoratedtarget
+rule LibraryShared
+{
+  local objects = $(>) ;
+  local options = $(3) ;
+  local target = $(4) ;
+  local linklib = [ ConstructSharedLibraryLinkLib $(<) : $(options) ] ;
+  local deplibs ;
+
+  local i ;
+  for i in $(LIBDEPENDS)
+  {
+    deplibs += [ ConstructLibraryLinkTarget $(i) : $(options) ] ;
+  }
+  
+  # Generate install rules
+  if ! [ IsElem noinstall : $(options) ]
+  {
+    if $(TARGET.OS) != WIN32
+    {
+      Depends install_lib : [ DoInstall $(target) : $(libdir)  ] ;
+    }
+    else
+    {
+      Depends install_lib : [ DoInstall $(target) : $(bindir)  ] ;
+      Depends install_lib : [ DoInstall $(linklib) : $(libdir)  ] ;
+    }
+    
+    # Add to global library list
+    if [ IsElem optional : $(options) ]
+    {
+      INSTALLEDLIBS_OPTIONAL += $(<) ;
+    }
+    else
+    {
+      INSTALLEDLIBS += $(<) ;
+    }
+  }
+
+  Depends $(<) : $(linklib) ;
+  if $(linklib) != $(target)
+  {
+    Depends $(linklib) : $(target) ;
+    MakeLocate $(linklib) : $(LOCATE.OBJECTS)/libs ;
+    SEARCH on $(linklib) = $(LOCATE.OBJECTS)/libs ;
+  }
+  Depends $(target) : $(objects) ;
+  Clean $(<)clean : $(linklib) $(target) ;
+  Depends clean : $(<)clean ;
+  Depends $(target) : $(deplibs) ;
+    
+  CFlags $(<) : [ FDefines CS_$(<:U)_LIB  ] ;
+  LFlags $(<) : $(LINKLIBS) ;
+    
+  SystemLinkSharedLibrary $(target) : $(objects) $(deplibs) : $(linklib) ;
+  
+  local debugfile = [ SplitDebugInfo $(target) ] ;
+  Clean $(<)clean : $(debugfile) ;
+  if ! [ IsElem noinstall : $(options) ]
+  {
+    NoCare $(debugfile) ;
+    Depends install_lib : [ DoInstall $(debugfile) : $(libdir) : $(INSTALL_DATA) ] ;
+  }
+}
+
+rule ConstructLibraryTarget
+{
+  if ( ! [ IsElem shared : $(>) ] ) || ( $(BUILD_SHARED_LIBS) != "yes" )
+  {
+    return [ ConstructStaticLibraryTarget $(<) : [ Filter $(>) : shared ] ] ; 
+  }
+  else
+  {
+    return [ ConstructSharedLibraryTarget $(<) : $(>) ] ; 
+  }
+}
+
+rule ConstructLibraryLinkTarget
+{
+  if ( ! [ IsElem shared : $(>) ] ) || ( $(BUILD_SHARED_LIBS) != "yes" )
+  {
+    return [ ConstructStaticLibraryTarget $(<) : [ Filter $(>) : shared ] ] ; 
+  }
+  else
+  {
+    return [ ConstructSharedLibraryLinkLib $(<) : $(>) ] ; 
+  }
+}
+
+actions together Ranlib
+{
+  $(RANLIB) $(<)
+}
+
+# Construct pseudo target libs which is used instead of the pseudo target lib
+# in Jambase
+Depends lib : libs ;
+NotFile libs ;
+Help libs : "Build all link libraries" ;
diff --git a/mk/jam/macosx.jam b/mk/jam/macosx.jam
new file mode 100644 (file)
index 0000000..19c7fd8
--- /dev/null
@@ -0,0 +1,354 @@
+#==============================================================================
+# Jam configuration and actions for MacOS/X
+# Copyright (C) 2003-2005 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#==============================================================================
+SHELL ?= "/bin/sh" ;
+
+MACOSX_ENVIRONMENT = "export MACOSX_DEPLOYMENT_TARGET=10.2" ;
+PLUGIN.LFLAGS += "-bundle" ;
+# We use the ugly -Wl form, which does not contain embedded whitespace (unlike
+# "-framework AppKit"), to help external projects which use the result of
+# "cs-config --libs" in conjunction with GNU libtool, since libtool likes to
+# re-arrange arguments, not realizing that "-framwork" and "AppKit" need to
+# stay together.
+LINKLIBS += "-Wl,-framework,AppKit" "-Wl,-framework,Foundation" ;
+
+# Jambase in Jam 2.4 has a bug where it incorrectly defines RANLIB as "" for
+# MacOS/X, and this bogus value will override a RANLIB set via ?= in Jamconfig,
+# by a configure script, thus we must give RANLIB an appropriate value here if
+# we find that it has the bogus value.  Jam 2.5 does not contain this bug.
+# Furthermore, MacOS/X Panther expects us to use the -s option with ranlib.
+if ! $(RANLIB) { RANLIB = "ranlib" ; }
+RANLIB += "-s" ;
+
+# Experience seems to indicate that library scanning misbehaves on MacOS/X with
+# Jam 2.4, consequently we disable it.
+NOARSCAN = true ;
+
+#------------------------------------------------------------------------------
+# Public rules.
+#------------------------------------------------------------------------------
+
+# ConstructApplicationTarget target : options
+#    Constructs the application target name.
+rule ConstructApplicationTarget
+{
+  return $(<) ;
+}
+
+# ConstructStaticLibraryTarget target : options
+#    Constructs the static library target name.
+rule ConstructStaticLibraryTarget
+{
+  return lib$(<)$(SUFLIB) ;
+}
+
+# ConstructSharedLibraryTarget target : options
+#    Constructs the shared library target name.
+rule ConstructSharedLibraryTarget
+{
+  return lib$(<).$(PACKAGE_VERSION).dylib ; 
+}
+
+# ConstructSharedLibraryLinkLib target : options
+#    Constructs the name of a shared library against which some other target
+#    links.
+rule ConstructSharedLibraryLinkLib
+{
+  return lib$(<).$(PACKAGE_VERSION).dylib ; 
+}
+
+# ConstructPluginTarget target : options
+#    Constructs the plugin target name.
+rule ConstructPluginTarget
+{
+    return $(<).csbundle ;
+}
+
+# SystemLinkApplication target : objects : options
+#    Apply appropriate rule to link the application based upon the options.
+rule SystemLinkApplication
+{
+    local target = $($(<)_TARGET) ;
+    Depends $(target) : $(>) ;
+    if [ IsElem console : $(3) ]
+    {
+        LinkApplicationConsole $(target) : $(>) ;
+        Clean clean : $(target) ;
+        Clean $(<)clean : $(target) ;
+    }
+    else
+    {
+        CreateApplicationWrapper $(target) : $(>) ;
+        CleanDir clean : [ Wrapper $(<) : app ] ;
+        CleanDir $(<)clean : [ Wrapper $(<) : app ] ;
+    }
+}
+
+# SystemInstallApplication target : subdirs : options
+#    Apply appropriate rule to install the application based upon the options.
+rule SystemInstallApplication
+{
+    if [ IsElem console : $(3) ]
+    {
+        Depends install_bin : 
+            [ DoInstall $(<) : $(bindir) $(2) : $(INSTALL_PROGRAM) ] ;
+    }
+    else
+    {
+        InstallApplicationGUI $(<) : $(bindir) $(2) ;
+    }
+}
+
+# SystemInstallPlugin target : subdirs : options
+#    Apply appropriate rule to install the plugin based upon the options.
+rule SystemInstallPlugin
+{
+    Depends install_plugin :
+       [ DoInstall $(<) : $(plugindir) $(2) : $(INSTALL_PROGRAM) ] ;
+}
+
+# SystemLinkPlugin target : objects : options
+#    Link a plugin module and handle meta-data appropriately.
+rule SystemLinkPlugin
+{
+    local target = $($(<)_TARGET) ;
+    Depends $(target) : $(>) ;
+    LinkPlugin $(target) : $(>) ;
+    PluginMetaData $(<) : $($(<)_METAFILE) : $(3) ;
+    Clean clean : $(target) ;
+    Clean $(<)clean : $(target) ;
+}
+
+# LinkPlugin plugin : objects
+#    Link a plugin module from a set of object files.
+actions LinkPlugin bind NEEDLIBS bind EXTRAOBJECTS
+{
+    $(MACOSX_ENVIRONMENT)
+    $(CMD.LINK) -bundle -o $(<) $(>) $(EXTRAOBJECTS) $(NEEDLIBS) $(LINKLIBS)
+}
+
+# LinkApplicationConsole exe : objects
+#    Link a console (non-GUI) appliation from a set of object files.
+actions LinkApplicationConsole bind NEEDLIBS bind EXTRAOBJECTS
+{
+    $(MACOSX_ENVIRONMENT)
+    $(CMD.LINK) -o $(<) $(>) $(EXTRAOBJECTS) $(NEEDLIBS) $(LINKLIBS)
+}
+
+# CreateApplicationWrapper basename : objects
+#    Create a complete, though minimal, application wrapper given a set of
+#    object files.  The rules ApplicationIconDefault and ApplicationIcon
+#    control the icon associated with the application wrapper.
+rule CreateApplicationWrapper
+{
+    WrapFile $(<) : $(<) : Contents MacOS : AppExe : $(>) ;
+    WrapFile $(<) : PkgInfo : Contents : AppPkgInfo : $(>) ;
+    WrapFile $(<) : version.plist : Contents : AppVersionPlist : $(>) ;
+    WrapFile $(<) : Info.plist : Contents : AppInfoPlist : $(>) ;
+    WrapFile $(<) : InfoPlist.strings : Contents Resources English.lproj : 
+        AppInfoPlistStrings : $(>) ;
+
+    local icon = [ ApplicationIcon macosx : $(<) ] ;
+    if ! $(icon)
+    {
+      local apptype = gui ;
+      if [ IsElem console : $(>) ] { apptype = console ; }
+      icon = [ ApplicationIconDefault macosx : $(apptype) ] ;
+    }
+    if $(icon)
+    {
+       $(<)_APPICON = $(icon) ;
+        AppIcon $(<) : $(icon) ;
+    }
+}
+
+# Wrapper basename : suffix [ : pathcomponents ]
+#    Returns wrapper name in the directory specified by pathcomponents for
+#    the given basename.  If pathcomponents is omitted, LOCATE.TARGETS is
+#    used.
+rule Wrapper
+{
+    local dir ;
+    if $(3) { dir = [ FDirName $(3) ] ; }
+    else { dir = $(LOCATE.TARGETS) ; }
+    return [ FDirName $(dir) $(1).$(2) ] ;
+}
+
+# WrapFile basename : file : pathcomponents : rule [ : objects : [ suffix ] ]
+#    Generate a file within a wrapper.  pathcomponents is a list of names
+#    which compose the relative path within the wrapper where file should be
+#    placed.  pathcomponents may be the empty list if the file should reside
+#    at the top-level of the wrapper.  rule is rule/action which should be
+#    invoked to generate file.  rule is invoked with arguments
+#    <basename.suffix/pathcomponents/file>, <objects>, and <basename>.
+#    objects is an optional list of files from which file should be built.  It
+#    may be omitted if file does not depend upon any other files.  suffix is
+#    the extension of the wrapper (not of file).  If suffix is omitted, "app"
+#    is assumed.
+#
+#    Implementation note: If basename and file are the same, then we do not
+#    grist file.  (Obviously, we also do not want to set the file dependent
+#    upon itself.)  The reason we do not grist file in this case is that the
+#    LinkWith, and LFlags rules associate the variables NEEDLIBS and
+#    LINKLIBS with the ungristed name, therefore in order to get access to
+#    these variables at AppExe action time, we must use the same (ungristed)
+#    name.  It is otherwise impossible to gain access to those variables.
+#    This is an unfortunate hack which pollutes the otherwise general-purpose
+#    WrapFile rule.
+rule WrapFile
+{
+    local suffix ;
+    if $(6) { suffix = $(6) ; } else { suffix = app ; }
+    local target = $(2) ;
+    if $(target) != $(1)
+    {
+        target = $(target:G=$(1)) ;
+        Depends $(1) : $(target) ;
+    }
+    local dir = [ FDirName [ Wrapper $(1) : $(suffix) ] $(3) ] ;
+    MakeLocate $(target) : $(dir) ;
+    if $(5) { Depends $(target) : $(5) ; }
+    BASENAME on $(target) = $(1) ;
+    $(4) $(target) : $(5) : $(1) ;
+
+    Clean clean : [ FDirName $(dir) $(target) ] ;
+    Clean $(1)clean : [ FDirName $(dir) $(target) ] ;
+}
+
+# LinkApplication exe : objects
+actions AppExe bind NEEDLIBS bind EXTRAOBJECTS
+{
+    $(MACOSX_ENVIRONMENT)
+    $(CMD.LINK) -o $(<) $(>) $(EXTRAOBJECTS) $(NEEDLIBS) $(LINKLIBS)
+}
+
+# AppPkgInfo file
+actions AppPkgInfo
+{
+    echo 'APPL????' > $(<) ;
+}
+
+# AppInfoPlistStrings file
+actions AppInfoPlistStrings
+{
+  cat << EOT > $(<)
+CFBundleName = "$(BASENAME)";
+CFBundleShortVersionString = "$(PACKAGE_VERSION)";
+CFBundleGetInfoString = "$(BASENAME), $(PACKAGE_VERSION)";
+EOT
+}
+
+# AppVersionPlist file
+actions AppVersionPlist
+{
+  cat << EOT > $(<)
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
+<plist version="0.9">
+  <dict>
+    <key>CFBundleShortVersionString</key>
+    <string>$(PACKAGE_VERSION)</string>
+    <key>CFBundleVersion</key>
+    <string>$(PACKAGE_VERSION)</string>
+    <key>ProjectName</key>
+    <string>$(BASENAME)</string>
+  </dict>
+</plist>
+EOT
+}
+
+# AppInfoPlist filename : placeholder : basename
+#    Implementation Note: $(BASENAME)_APPICON might be empty in the actions of
+#    this rule, if the client did not specify a default icon or a
+#    target-specific icon, in which case we need to omit both the
+#    CFBundleIconFile key and value.  To accomplish this, the key and value
+#    are placed on a single line with no intervening whitespace.  When Jam
+#    interpolates a variable, if the variable is empty, it removes all
+#    adjacent text (the key and value, in this case) which is just what we
+#    desire.
+actions AppInfoPlist
+{
+  cat << EOT > $(<)
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
+<plist version="0.9">
+  <dict>
+    <key>CFBundleDevelopmentRegion</key>
+    <string>English</string>
+    <key>CFBundleName</key>
+    <string>$(BASENAME)</string>
+    <key>CFBundleExecutable</key>
+    <string>$(BASENAME)</string>
+    <key>CFBundleIconFile</key><string>$($(BASENAME)_APPICON)</string>
+    <key>CFBundleInfoDictionaryVersion</key>
+    <string>6.0</string>
+    <key>CFBundlePackageType</key>
+    <string>APPL</string>
+    <key>CFBundleSignature</key>
+    <string>????</string>
+    <key>CFBundleVersion</key>
+    <string>0</string>
+    <key>CFBundleShortVersionString</key>
+    <string>$(PACKAGE_VERSION)</string>
+    <key>NSPrincipalClass</key>
+    <string>NSApplication</string>
+  </dict>
+</plist>
+EOT
+}
+
+# AppIcon <basename> : <icon>
+#    Copy an icon into the wrapper.  It is assumed that some other agent has
+#    already set SEARCH on the icon, if necessary.
+rule AppIcon
+{
+    local icon = $(>:G=$(<)) ;
+    Depends $(<) : $(icon) ; 
+    Depends $(icon) : $(>) ;
+    MakeLocate $(icon) : 
+      [ FDirName [ Wrapper $(<) : app ] Contents Resources ] ;
+    Copy $(icon) : $(>) ;
+    Clean clean : $(icon) ;
+    Clean $(<)clean : $(icon) ;
+}
+
+# InstallApplicationGUI app : installdirs
+#    Install a GUI application.  Unlike applications on other platforms which
+#    exist as a single executable file, on MacOS/X, an application is wrapped
+#    in a directory hierarchy, thus a deep copy is needed (i.e. the typical
+#    Install rule does not work).
+rule InstallApplicationGUI
+{
+    local wrapper = $(<).app ;
+    Depends $(wrapper) : $(<) ;
+    SEARCH on $(wrapper) = $(LOCATE.TARGETS) ;
+
+    # Yuck! Internal knowledge of how DoInstall composes 'dir' and 'target'.
+    local dir = [ ConcatDirs $(DESTDIR) $(2) ] ;
+    local target = $(wrapper:BSR=$(dir):G=install) ;
+
+    InstallApplicationWrapperPrepare $(target) ;
+    Depends install_bin :
+       [ DoInstall $(wrapper) : $(2) : "$(DEEPCOPY)" ] ; 
+}
+
+actions InstallApplicationWrapperPrepare
+{
+    $(DELTREE) $(<) ;
+}
diff --git a/mk/jam/msvcgen.jam b/mk/jam/msvcgen.jam
new file mode 100644 (file)
index 0000000..5d7da84
--- /dev/null
@@ -0,0 +1,1558 @@
+#==============================================================================
+# Rules for creating MSVC project files.
+# Copyright (C) 2004 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#==============================================================================
+#
+# During a project file synthesis run, the property name 'projgen' in the
+# container 'build' will be given a value describing which type of project
+# files are being generated. For MSVC project files, the value of the 'projgen'
+# property will be "msvc". When project file synthesis supports multiple tool
+# versions, the 'projgen_version' property will have a value indicating the
+# version of the tool for which project files are being created. For instance,
+# when generating MSVC7 project files, 'projgen' will be set to "msvc" and
+# 'projgen_version' will have the value "7".
+#
+# Jamfiles throughout the project, if they need to alter their behavior (for
+# one reason or another), can invoke the Property rule to determine whether
+# project files are being synthesized.  For example, to learn if project file
+# synthesis is active:
+#
+# if [ Property build : projgen ] { ... do something ... }
+#
+# To take action if only a particular type of project file is being generated
+# (i.e. "msvc"):
+#
+# if [ Property build : projgen ] = msvc { ... do something ... }
+#
+#==============================================================================
+
+MSVCGEN_SUPPORTED_VERSIONS = 6 7 71 8 ;
+MSVCGEN_BUILD_ROOT ?= [ ConcatDirs $(BUILDTOP) out ] ;
+MSVCGEN_BUILD_TEMP ?= [ ConcatDirs $(MSVCGEN_BUILD_ROOT) msvcgen ] ;
+
+#------------------------------------------------------------------------------
+# Public rule stubs. May be implemented by msvcgen phase 1 or phase 2 or both.
+
+## MsvcGenConfig variable [ : value ]
+##   Specify additional configuration information to augment the msvcgen
+##   environment.  The Jam variable named by 'variable' is set to 'value' for
+##   the msvcgen run.  If 'value' is omitted, then 'variable' is cleared.
+##   Invocations of MsvcGenConfig are cumulative, so variable/value tuples can
+##   be provided incrementally.  It is legal to use this rule in conjunction
+##   with MsvcGenConfigFile; they are not mutually exclusive.
+##
+##   The most common reason to invoke this rule is to provide MSVC-specific
+##   fallback values for the library checks typically performed by an Autoconf
+##   configure script, which the Jamfiles reference via the ExternalLibs rule.
+##   Such fallbacks consist of variables named TAG.CFLAGS, TAG.LFLAGS, and
+##   TAG.LIBS, where TAG represents the library's identifier exported by the
+##   configure script.  Because project generation allows for finer-grained
+##   control, you can also optionally set the variables TAG.DEFINES,
+##   TAG.INCDIRS, and TAG.LIBDIRS.  TAG.DEFINES is a set of tokens of the form
+##   "key" or "key=value".  For instance, to provide MSVC-specific fallback
+##   values for the FreeType2 library, which the configure script might
+##   identify as FT2, you can define variables named FT2.CFLAGS, FT2.LFLAGS,
+##   FT2.LIBS, FT2.DEFINES, FT2.INCDIRS, and FT2.LIBDIRS.  The msvcgen process
+##   will consult these variables when it encounters invocations of the
+##   ExternalLibs rule, and apply the overrides to the generated project files.
+##   If yours is a multi-platform project which conditionally defines
+##   Application, Plugin, and Library targets based upon the platform, then you
+##   should also define whatever additional variables or properties are needed
+##   to ensure that your project's Jamfiles invoke the Application, Plugin, and
+##   Library rules for modules suitable for Windows, and that they do not
+##   invoke those rules for modules specific to other platforms.
+rule MsvcGenConfig { MsvcGenConfig1 $(1) : $(2) ; }
+rule MsvcGenConfig1 { }
+
+## MsvcGenConfigFile file
+##   Similar to MsvcGenConfig, except that the configuration is provided via a
+##   file containing Jam statements.  In the common case, the file will contain
+##   a series of simple Jam variable assignment statements.  May be invoked
+##   multiple times to specify additional configuration files.  It is legal to
+##   use this rule in conjunction with MsvcGenConfig; they are not mutually
+##   exclusive.
+rule MsvcGenConfigFile { MsvcGenConfigFile1 $(1) : $(2) ; }
+rule MsvcGenConfigFile1 { }
+
+## MsvcGenVariable variable [ : value ]
+##   Define a variable for direct interpolation into msvcgen template files.
+##   'variable' is the name of the variable to define.  'value' is the value
+##   which should be assigned to 'variable'.  If 'value' is omitted, then
+##   'variable' is defined as the null (empty) string.  You may invoke this
+##   rule multiple times to define any number of interpolation variables.  You
+##   may also invoke it multiple times for the same variable name to give the
+##   variable multiple values.  In the template file, reference the variable as
+##   `[% variable.0 %]' to retrieve the first element, `[% variable.1 %]' to
+##   retrieve the second, and so on.  Even if you have only invoked this rule
+##   once for a variable, you must still reference it in the template as
+##   `[% variable.0 %]'. If the variable has multiple values, then it is common
+##   to reference it in the template via a FOREACH loop, as in
+##   `[% FOREACH v IN variable %]'.
+rule MsvcGenVariable { MsvcGenVariable1 $(1) : $(2) ; }
+rule MsvcGenVariable1 { }
+
+## MsvcGenWorkspace name [ : accepts [ : rejects ]]
+##   Specify the name of a workspace which the 'msvcgen' target should create.
+##   The generated workspace file name will be prefixed by "wks".  By default,
+##   a workspace contains all projects resulting from invocations of the
+##   Application, Plugin, Library, and CompileGroups rules. It is possible to
+##   restrict the projects placed into the workspace by providing the optional
+##   'accepts' and/or 'rejects'. These are lists of Perl regular expressions
+##   matched against the project names. (Project names are composed of "app",
+##   "plg", "lib", and "grp" prepended to the target name given to the
+##   Application, Plugin, Library, and CompileGroups rules, respectively.)
+##   Reject patterns take precedence over accept patterns.  This rule must be
+##   invoked before any invocations of Application, Plugin, Library, or
+##   CompileGroups.  You may invoke this rule multiple times to produce
+##   multiple workspaces, but you must invoke it at least once in order for the
+##   'msvcgen' target to produce any output.
+rule MsvcGenWorkspace { MsvcGenWorkspace1 $(1) : $(2) : $(3) ; }
+rule MsvcGenWorkspace1 { }
+
+## MsvcGenSubDir dircomponents [ : version ]
+##   Invoke this rule with the location of the project file directory as a
+##   whitepace-delimited set of tokens, much as you would the SubDir rule.
+##   This information is used in two ways.  (1) The directory structure for the
+##   generated files will be duplicated under $(MSVCGEN_BUILD_ROOT).  For
+##   instance, if your project files are at "$(TOP)/proj/msvc", then the
+##   generated files will be deposited at "$(MSVCGEN_BUILD_ROOT)/proj/msvc".
+##   (2) The depth of the directory indicated by 'dircomponents' will be taken
+##   into account when generating references to resources in your project tree.
+##   For example, if your project files reside at "$(TOP)/proj/msvc", and you
+##   have set "$(TOP)/resources/game.ico" as the application icon with the
+##   ApplicationIconDefault or ApplicationIcon rule, then msvcgen will know
+##   that game.ico can be found relative to the project file directory via the
+##   path "../../resources/game.ico".  If 'version' is specified, then
+##   'dircomponents' applies to generated files for that version of MSVC only.
+##   If 'version' is not specified, then the path will be composed of
+##   'dircomponents' and the version number.  For instance, if 'dircomponents'
+##   is "$(TOP)/proj/msvc" and 'version' was not provided, then it will be
+##   assumed that MSVC7 project files should reside at $(TOP)/proj/msvc7".  You
+##   must invoke this rule at least once to ensure that 'msvcgen' targets are
+##   made available for user invocation.
+rule MsvcGenSubDir { msvcgen_path_version MsvcGenSubDir1 : $(1) : $(2) ; }
+rule MsvcGenSubDir1 { }
+
+## MsvcGenTemplateDir dircomponents
+##   Invoke this rule with the location of the msvcgen template directory as a
+##   whitepace-delimited set of tokens.
+rule MsvcGenTemplateDir { MsvcGenTemplateDir1 $(1) ; }
+rule MsvcGenTemplateDir1 { }
+
+## MsvcExternalLibrary target [ : libs [ : mode ]]
+##   Invoke this rule to link 'target' with one or more MSVC-specific external
+##   libraries.  For example, 'libs' might be "wsock32.lib".  'mode' should be
+##   "release" or "debug". If 'mode' is omitted, then 'libs' is used for
+##   release and debug.
+rule MsvcExternalLibrary { MsvcExternalLibrary1 $(1) : $(2) : $(3) ; }
+rule MsvcExternalLibrary1 { }
+
+## MsvcDefine target [ : key [ : value [ : mode ]]]
+##   Invoke this rule to define an MSVC-specific preprocessor macro 'key'
+##   having 'value' for 'target'.  'mode' should be "release" or "debug". If
+##   'mode' is omitted, then 'key/value' is used for release and debug.
+rule MsvcDefine { MsvcDefine1 $(1) : $(2) : $(3) : $(4) ; }
+rule MsvcDefine1 { }
+
+## MsvcIncDirs target : directories [ : mode ]
+##   Invoke this rule to define an MSVC-specific additional include directories.
+##   'mode' should be "release" or "debug". If 'mode' is omitted, then 
+##   'directories' is used for release and debug.
+rule MsvcIncDirs { MsvcIncDirs1 $(1) : $(2) : $(3) ; }
+rule MsvcIncDirs1 { }
+
+## MsvcCFlags target [ : cflags [ : mode ]]
+##   Invoke this rule to set additional MSVC-specific compiler flags for
+##   'target'.  'mode' should be "release" or "debug". If 'mode' is omitted,
+##   then 'cflags' is used for release and debug.
+rule MsvcCFlags { MsvcCFlags1 $(1) : $(2) : $(3) ; }
+rule MsvcCFlags1 { }
+
+## MsvcLFlags target [ : lflags [ : mode ]]
+##   Invoke this rule to set additional MSVC-specific linker flags for
+##   'target'.  'mode' should be "release" or "debug". If 'mode' is omitted,
+##   then 'lflags' is used for release and debug.
+rule MsvcLFlags { MsvcLFlags1 $(1) : $(2) : $(3) ; }
+rule MsvcLFlags1 { }
+
+## MsvcExtraFile target : files
+##   Use this rule to add extra file resources to the "Resource files" 
+##   filter of the generated project. Commonly, those files are auxiliary
+##   files not specified in the source file list, e.g. ".inc" files.
+rule MsvcExtraFile { MsvcExtraFile1 $(1) : $(2) ; }
+rule MsvcExtraFile1 { }
+
+## MsvcGenName target : name
+##   Assign an MSVC project name to 'target'.  Normally, the project name is
+##   'target' with a prefix of "app", "grp", "lib", "plg", or "wks", depending
+##   upon the target's type.  The MsvcGenName rule allows you to override the
+##   default name.  This rule must be invoked prior to the Application,
+##   Library, Plugin, or MsvcGenWorkspace rule for 'target' in order for 'name'
+##   to be accepted.  As an alternative to invoking this rule, if you wish to
+##   change the default prefixes used by all targets you can use the MsvcConfig
+##   rule to set the MSVC.PREFIX.appcon, MSVC.PREFIX.appgui, MSVC.PREFIX.group,
+##   MSVC.PREFIX.library, MSVC.PREFIX.plugin, and MSVC.PREFIX.workspace
+##   variables to whatever values you like.
+rule MsvcGenName { MsvcGenName1 $(1) : $(2) ; }
+rule MsvcGenName1 { }
+
+#------------------------------------------------------------------------------
+# Private utility rules. Common to all phases.
+
+## msvcgen_path_version rule : dircomponents [ : version ]
+##   If 'version' is provided, invoke 'rule' once with 'dircomponents' and
+##   'version' as arguments.  If 'version' is not provided, invoke 'rule' once
+##   per supported MSVC version with 'dircomponents' augmented so that
+##   'version' is appended to the very last element of 'dircomponents'.  For
+##   example, if 'version' is omitted, and 'dircomponents' is "TOP proj msvc",
+##   then 'rule' will be invoked as "rule TOP proj msvc6 : 6", then "rule TOP
+##   proj msvc7 : 7", etc.
+rule msvcgen_path_version
+{
+  local subrule = $(1) ;
+  local path = $(2) ;
+  local version = $(3) ;
+  if $(version)
+  {
+    msvcgen_version_check $(version) ;
+    $(subrule) $(path) : $(version) ;
+  }
+  else
+  {
+    local v ;
+    for v in $(MSVCGEN_SUPPORTED_VERSIONS)
+    {
+      local p = [ FReverse $(path) ] ;
+      $(subrule) [ FReverse $(p[1])$(v) $(p[2-]) ] : $(v) ;
+    }
+  }
+}
+
+rule msvcgen_resolve_dir
+{ return $($(<[1])) $(<[2-]) ; }
+rule msvcgen_target_dir
+{ return [ ConcatDirs $(MSVCGEN_BUILD_ROOT) $(<[2-]) ] ; }
+rule msvcgen_build_dir
+{ return [ ConcatDirs $(MSVCGEN_BUILD_TEMP) build$(<) ] ; }
+rule msvcgen_work_dir
+{ return [ ConcatDirs $(MSVCGEN_BUILD_TEMP) temp$(<) ] ; }
+rule msvcgen_template_dir
+{ return [ ConcatDirs [ msvcgen_resolve_dir $(<) ] ] ; }
+rule msvcgen_version_check
+{
+  if $(<) != common && ! [ IsElem $(<) : $(MSVCGEN_SUPPORTED_VERSIONS) ]
+  {
+    exit "Error: `$(<)' is not a supported msvcgen version number; valid "
+      "numbers are:" $(MSVCGEN_SUPPORTED_VERSIONS) ;
+  }
+}
+
+rule MsvcRmTemps
+{
+  if $(MSVCGEN_KEEPTEMPS) != yes
+  {
+    RmTemps $(<) : $(>) ;
+  }
+}
+
+#------------------------------------------------------------------------------
+# Phase 1
+
+if ! $(DO_MSVCGEN)
+{
+JAM ?= jam ;
+MSVCGEN_JAMOPTIONS ?= ;
+MSVCGEN_TTREEOPTIONS ?= ;
+MSVCGEN_SILENT ?= no ;
+MSVCGEN_VERBOSE ?= no ;
+MSVCGEN_KEEPTEMPS ?= no ;
+if $(MSVCGEN_SILENT) = yes
+{
+  MSVCGEN_JAMOPTIONS += -d0 ;
+}
+else
+{
+  MSVCGEN_TTREEOPTIONS += "--verbose" ;
+  if $(MSVCGEN_VERBOSE) = yes
+  {
+    if $(JAMVERSION) <= 2.4
+    {
+      MSVCGEN_JAMOPTIONS += -d+2 ;
+    }
+    else
+    {
+      MSVCGEN_JAMOPTIONS += -d5 ;
+    }
+  }
+}
+if $(MSVCGEN_KEEPTEMPS) = yes
+{
+  MSVCGEN_JAMOPTIONS += "-sMSVCGEN_KEEPTEMPS=yes" ;
+}
+
+## MsvcGenConfigFile file
+##   (See documentation above.)
+rule MsvcGenConfigFile1
+{
+  MSVCGEN_CONFIG_FILES += $(<) ;
+}
+
+## MsvcGenSubDir dircomponents [ : version ]
+##   (See documentation above.)
+rule MsvcGenSubDir1
+{
+  local path = $(1) ;
+  local version = $(2) ;
+  if ! [ Property msvcgen : pathset$(version) ]
+  {
+    SetProperty msvcgen : pathset$(version) ;
+    MsvcGenTarget $(path) : $(version) ;
+  }
+  else
+  {
+    Echo "Warning: MsvcGenSubDir already invoked for version $(version)" ;
+  }
+}
+
+## MsvcGenTarget dircomponents : version
+##   Create pseudo-targets for building and removing project files for the
+##   specified version of MSVC.  'dircomponents' is interpreted as described
+##   for the MsvcGenSubDir rule.  Also populates the list MSVCGEN_TARGETS with
+##   names of the targets.  Clients which need to perform some pre-processing
+##   prior to the actual msvcgen run may set the targets in this list to depend
+##   upon client-supplied targets.
+rule MsvcGenTarget
+{
+  local path = $(1) ;
+  local version = $(2) ;
+  if $(version) = common
+  {
+    CleanDir msvccommonclean : [ msvcgen_target_dir $(path) ] ;
+    Depends msvcclean : msvccommonclean ;
+  }
+  else
+  {
+    MsvcGenUmbrella ;
+    Always msvc$(version)gen ;
+    NotFile msvc$(version)gen ;
+    MSVC_VERSION on msvc$(version)gen = $(version) ;
+    MsvcGen msvc$(version)gen ;
+    Depends msvcgen : msvc$(version)gen ;
+    Help msvc$(version)gen : "Create MSVC$(version) project files" ;
+    MSVCGEN_TARGETS += msvc$(version)gen ;
+    local commonworkdir = [ msvcgen_work_dir common ] ;
+    CleanDir msvc$(version)clean :
+      [ msvcgen_target_dir $(path) ]
+      [ msvcgen_build_dir $(version) ]
+      [ msvcgen_work_dir $(version) ] 
+      $(commonworkdir) ;
+    Depends msvcclean : msvc$(version)clean ;
+    Help msvc$(version)clean : "Remove built MSVC$(version) project files" ;
+  }
+}
+
+actions MsvcGen bind MSVCGEN_CONFIG_FILES
+{
+  $(JAM) $(MSVCGEN_JAMOPTIONS) \
+    -sDO_MSVCGEN=yes \
+    -sMSVC_VERSION=$(MSVC_VERSION) \
+    -sMSVCGEN_TTREEOPTIONS='$(MSVCGEN_TTREEOPTIONS)' \
+    -sMSVCGEN_CONFIG_FILES='$(MSVCGEN_CONFIG_FILES)' \
+    -sTARGET.OS=WIN32 \
+    msvcgen
+}
+
+## MsvcGenUmbrella
+##   Create pseudo-targets for building and removing project files for all
+##   version of MSVC.
+rule MsvcGenUmbrella
+{
+  if ! [ Property msvcgen : umbrella ]
+  {
+    SetProperty msvcgen : umbrella ;
+
+    Always msvcgen ;
+    NotFile msvcgen ;
+    Help msvcgen : "Create MSVC project files (all versions)" ;
+
+    Always msvcclean ;
+    NotFile msvcclean ;
+    Help msvcclean : "Remove built MSVC project files (all versions)" ;
+    CleanDir msvcclean : $(MSVCGEN_BUILD_TEMP) ;
+    Depends clean : msvcclean ;
+  }
+}
+
+}
+else
+{
+
+#------------------------------------------------------------------------------
+# Phase 2
+
+if $(MSVCGEN_CONFIG_FILES)
+{
+  local f ;
+  for f in $(MSVCGEN_CONFIG_FILES)
+  {
+    include $(f) ;
+  }
+}
+
+if $(TTREE)
+{
+  PERL ?= perl ;
+  RUN_TTREE ?= $(PERL) "\"$(TTREE)\"" ;
+}
+else
+{
+  TTREE ?= ttree ;
+  RUN_TTREE ?= $(TTREE) ;
+}
+
+# Implementation note: The --strip-root directives are order-sensitive when the
+# build directory is the same as the source directory, in which case TOP is "."
+# and MSVCGEN_BUILD_ROOT is "./out".  If TOP incorrectly appeared first, then
+# it would invalidate the following --strip-root option since TOP is a prefix
+# of MSVCGEN_BUILD_ROOT.
+MSVCGEN_STRIP_ROOT = $(MSVCGEN_BUILD_ROOT)/ $(TOP)/ ;
+
+# When generating the icon file .rc, we compose a 'sed' expression out of
+# MSVCGEN_BUILD_ROOT in order to ensure that the referenced icon paths are
+# correct. However, we must take care to protect characters in
+# MSVCGEN_BUILD_ROOT which have special meaning to 'sed'.  For instance, in
+# MSVCGEN_BUILD_ROOT, if $(TOP)/ is "./", then we want it to match a literal
+# period followed by a slash, not 'any character' followed by a slash, so it
+# must be transformed to "\./". (Presently we take the simple-minded approach
+# of protecting only "." since it arises frequently.)
+MSVCGEN_SED_PROTECT = "$(SED) 's:\\.:\\\\\\.:g'" ;
+
+MSVC_VERSION ?= 7 ;
+if $(MSVC_VERSION) = 6
+{
+  SUFPRJ = dsp ;
+  SUFWSP = dsw ;
+  MSVC_FORCE_CRLF = yes ;
+  MSVC_TEMPLATE_SUFFIX = 6 ;
+}
+else if $(MSVC_VERSION) = 7 || $(MSVC_VERSION) = 71 || $(MSVC_VERSION) = 8
+{
+  SUFPRJ = vcproj ;
+  SUFWSP = sln ;
+  MSVC_FORCE_CRLF = no ;
+  MSVC_TEMPLATE_SUFFIX = 7 ;
+  if $(MSVC_VERSION) = 7
+  {
+    MSVC_FORMATVERSION_PRJ = 7.00 ;
+    MSVC_FORMATVERSION_WSP = 7.00 ;
+  }
+  else if $(MSVC_VERSION) = 71
+  {
+    MSVC_FORMATVERSION_PRJ = 7.10 ;
+    MSVC_FORMATVERSION_WSP = 8.00 ;
+  }
+  else if $(MSVC_VERSION) = 8
+  {
+    MSVC_FORMATVERSION_PRJ = 8.00 ;
+    MSVC_FORMATVERSION_WSP = 9.00 ;
+  }
+}
+else
+{
+  exit "No msvcgen support for MSVC version $(MSVC_VERSION) yet!" ;
+}
+  
+MSVC.TSUFPRJ = tproj ;
+MSVC.TSUFWKP = twks ;
+
+MSVC.DEPEND ?= ;
+MSVC.DEPEND_DEBUG ?= ;
+MSVC.LIBRARY ?= ;
+MSVC.LIBRARY_DEBUG ?= ;
+MSVC.LFLAGS ?= ;
+MSVC.LFLAGS_DEBUG ?= ;
+MSVC.LIBRARY_DELAY ?= ;
+MSVC.CFLAGS ?= ;
+MSVC.CFLAGS_DEBUG ?= ;
+MSVC.DEFINES ?= ;
+MSVC.DEFINES_DEBUG ?= ;
+MSVC.DEPEND.appgui ?= ;
+MSVC.DEPEND_DEBUG.appgui ?= ;
+MSVC.LIBRARY.appgui ?= ;
+MSVC.LIBRARY_DEBUG.appgui ?= ;
+MSVC.LFLAGS.appgui ?= ;
+MSVC.LFLAGS_DEBUG.appgui ?= ;
+MSVC.CFLAGS.appgui ?= ;
+MSVC.CFLAGS_DEBUG.appgui ?= ;
+MSVC.DEFINES.appgui ?= ;
+MSVC.DEFINES_DEBUG.appgui ?= ;
+MSVC.DEPEND.appcon ?= ;
+MSVC.DEPEND_DEBUG.appcon ?= ;
+MSVC.LIBRARY.appcon ?= ;
+MSVC.LIBRARY_DEBUG.appcon ?= ;
+MSVC.LFLAGS.appcon ?= ;
+MSVC.LFLAGS_DEBUG.appcon ?= ;
+MSVC.CFLAGS.appcon ?= ;
+MSVC.CFLAGS_DEBUG.appcon ?= ;
+MSVC.DEFINES.appcon ?= ;
+MSVC.DEFINES_DEBUG.appcon ?= ;
+MSVC.DEPEND.plugin ?= ;
+MSVC.DEPEND_DEBUG.plugin ?= ;
+MSVC.LIBRARY.plugin ?= ;
+MSVC.LIBRARY_DEBUG.plugin ?= ;
+MSVC.LIBRARY_DELAY.plugin ?= ;
+MSVC.LFLAGS.plugin ?= ;
+MSVC.LFLAGS_DEBUG.plugin ?= ;
+MSVC.CFLAGS.plugin ?= ;
+MSVC.CFLAGS_DEBUG.plugin ?= ;
+MSVC.DEFINES.plugin ?= ;
+MSVC.DEFINES_DEBUG.plugin ?= ;
+MSVC.DEPEND.library ?= ;
+MSVC.DEPEND_DEBUG.library ?= ;
+MSVC.LIBRARY.library ?= ;
+MSVC.LIBRARY_DEBUG.library ?= ;
+MSVC.LFLAGS.library ?= ;
+MSVC.LFLAGS_DEBUG.library ?= ;
+MSVC.CFLAGS.library ?= ;
+MSVC.CFLAGS_DEBUG.library ?= ;
+MSVC.DEFINES.library ?= ;
+MSVC.DEFINES_DEBUG.library ?= ;
+
+MSVC.PREFIX.appgui    ?= app ;
+MSVC.PREFIX.appcon    ?= app ;
+MSVC.PREFIX.plugin    ?= plg ;
+MSVC.PREFIX.library   ?= lib ;
+MSVC.PREFIX.group     ?= grp ;
+MSVC.PREFIX.workspace ?= wks ;
+
+SetProperty build : projgen : msvc ;
+SetProperty build : projgen_version : $(MSVC_VERSION) ;
+
+# MsvcAddPrefix name : type
+rule MsvcAddPrefix
+{
+  local name = $(1) ;
+  local type = $(2) ;
+  local prefix = $(MSVC.PREFIX.$(type)) ;
+  if $(prefix) { name = "$(prefix)$(name)" ; }
+  return $(name) ;
+}
+
+#----------------------------------------------------------------------------
+# Override some rules
+
+actions GenerateWin32ManifestRc
+{
+    cat > $(<) << __EOF__
+// This file is generated automatically.
+
+#if !defined(PROJECTGEN_VERSION) || (PROJECTGEN_VERSION != 8)
+1 24 "$(MANIFEST_NAME)"
+#endif
+__EOF__
+}
+
+## MsvcGenConfig variable [ : value ]
+##   (See documentation above.)
+rule MsvcGenConfig1
+{
+  $(<) = $(>) ;
+}
+
+## MsvcGenVariable variable [ : value ]
+##   (See documentation above.)
+rule MsvcGenVariable1
+{
+  MSVCGEN_VARIABLES += "$(<)|$(>)" ;
+}
+
+## MsvcGenWorkspace name [ : accepts [ : rejects ]]
+##   (See documentation above.)
+rule MsvcGenWorkspace1
+{
+  local name = $(1) ;
+  local accepts = $(2) ;
+  local rejects = $(3) ;
+  local builddir = [ msvcgen_build_dir $(MSVC_VERSION) ] ;
+  local workdir = [ msvcgen_work_dir $(MSVC_VERSION) ] ;
+  local wksname = $(MSVC.NAME_OVERRIDE.$(name)) ;
+  if ! $(wksname) { wksname = [ MsvcAddPrefix $(name) : workspace ] ; }
+
+  MSVC.WORKSPACES += $(name) ;
+
+  local respdir = $(workdir) ;
+  local respfile = $(wksname:G=msvcresp:S=.resp) ;
+  Always $(respfile) ;
+  $(name)_WKS_RESPFILE = $(respfile) ;
+  $(name)_WKS_RESPDIR = $(respdir) ;
+
+  # Boilerplate.
+  ResponseFile $(respfile) :
+    "key|value"
+    "accept|$(accepts)"
+    "reject|$(rejects)"
+    "formatversion|$(MSVC_FORMATVERSION_WSP)"
+    $(MSVCGEN_VARIABLES)
+    : notfile : $(respdir) ;
+  MsvcRmTemps msvcgen : $(respfile) ;
+
+  local buildfile = $(wksname:G=msvcworkspace:S=.$(MSVC.TSUFWKP)) ;
+  Always $(buildfile) ;
+  MakeLocate $(buildfile) : $(builddir) ;
+  Includes $(buildfile) : $(respfile) ;
+  MSVC_BUILD_TYPE on $(buildfile) = workspace ;
+  MsvcBuildFile $(buildfile) : $(respfile) ;
+  Depends msvcgenrun : $(buildfile) ;
+  MsvcRmTemps msvcgen : $(buildfile) ;
+}
+
+## MsvcGenSubDir dircomponents [ : version ]
+##   (See documentation above.)
+rule MsvcGenSubDir1
+{
+  local path = $(1) ;
+  local version = $(2) ;
+
+  local relpath ;
+  if ! $(path[2])
+  {
+    relpath = $(DOT) ;
+  }
+  else
+  {
+    local i ;
+    for i in $(path[2-])
+    {
+      relpath += $(DOTDOT) ;
+    }
+  }
+
+  SetProperty msvcgen : outdir$(version) : [ msvcgen_target_dir $(path) ] ;
+  SetProperty msvcgen : relpath$(version) : $(relpath) ;
+
+  MSVCGEN_OUTDIR_$(version) = [ Property msvcgen : outdir$(version) ] ;
+}
+
+## MsvcGenTemplateDir dircomponents
+##   (See documentation above.)
+rule MsvcGenTemplateDir1
+{
+  SetProperty msvcgen : templatedir : [ msvcgen_template_dir $(<) ] ;
+
+  MSVCGEN_TEMPLATEDIR = [ Property msvcgen : templatedir ] ;
+}
+
+## MsvcGenName target : name
+##   (See documentation above.)
+rule MsvcGenName1
+{
+  MSVC.NAME_OVERRIDE.$(<) = $(>) ;
+}
+
+## MsvcProject target : type : target-with-ext : sources : options
+##   Create a project file for 'target', which is the project's raw name.
+##   'sources' is a list of files comprising the target.
+rule MsvcProject
+{
+  local rawname = $(1) ;
+  local type = $(2) ;
+  local decorated = $(3) ;
+  local sources = $(4) ;
+  local options = $(5) ;
+  local relpath = [ Property msvcgen : relpath$(MSVC_VERSION) ] ;
+  local outdir = [ Property msvcgen : outdir$(MSVC_VERSION) ] ;
+  local outdircommon = [ Property msvcgen : outdircommon ] ;
+  if "$(outdircommon)" = ""
+  {
+    outdircommon = $(outdir) ;
+  }
+  local builddir = [ msvcgen_build_dir $(MSVC_VERSION) ] ;
+  local workdir = [ msvcgen_work_dir $(MSVC_VERSION) ] ;
+  local workdircommon = [ msvcgen_work_dir common ] ;
+
+  local msvcname = $(MSVC.NAME_OVERRIDE.$(rawname)) ;
+  if ! $(msvcname) { msvcname = [ MsvcAddPrefix $(rawname) : $(type) ] ; }
+  $(rawname)_MSVCNAME = $(msvcname) ;
+      
+  local respdir = $(workdir) ;
+  local respfile = $(msvcname:G=msvcresp:S=.resp) ;
+  Always $(respfile) ;
+  $(rawname)_PRJ_RESPFILE = $(respfile) ;
+  $(rawname)_PRJ_RESPDIR = $(respdir) ;
+
+  # Boilerplate.
+  ResponseFile $(respfile) :
+    "key|value"
+    "formatversion|$(MSVC_FORMATVERSION_PRJ)"
+    "projtype|$(type)"
+    "project|$(msvcname)"
+    "rawtarget|$(rawname)"
+    "target|$(decorated)"
+    "sourceroot|$(relpath:J=/)"
+    "buildroot|$(relpath:J=/)"
+    "striproot|$(MSVCGEN_STRIP_ROOT)"
+    "define|$(MSVC.DEFINES)"
+    "define|$(MSVC.DEFINES.$(type))"
+    "definedebug|$(MSVC.DEFINES_DEBUG)"
+    "definedebug|$(MSVC.DEFINES_DEBUG.$(type))"
+    "cflags|$(MSVC.CFLAGS)"
+    "cflags|$(MSVC.CFLAGS.$(type))"
+    "cflagsdebug|$(MSVC.CFLAGS_DEBUG)"
+    "cflagsdebug|$(MSVC.CFLAGS_DEBUG.$(type))"
+    "lflags|$(MSVC.LFLAGS)"
+    "lflags|$(MSVC.LFLAGS.$(type))"
+    "lflagsdebug|$(MSVC.LFLAGS_DEBUG)"
+    "lflagsdebug|$(MSVC.LFLAGS_DEBUG.$(type))"
+    "library|$(MSVC.LIBRARY)"
+    "library|$(MSVC.LIBRARY.$(type))"
+    "librarydebug|$(MSVC.LIBRARY_DEBUG)"
+    "librarydebug|$(MSVC.LIBRARY_DEBUG.$(type))"
+    "librarydelay|$(MSVC.LIBRARY_DELAY)"
+    "librarydelay|$(MSVC.LIBRARY_DELAY.$(type))"
+    "msvcversion|$(MSVC_VERSION)"
+    "static|$($(rawname)_STATIC)"
+    $(MSVCGEN_VARIABLES)
+    : notfile : $(respdir) ;
+  MsvcRmTemps msvcgen : $(respfile) ;
+
+  # Only include source and headers files for now.  In the future, we also
+  # want to include .cfg files and any other textual resources which which the
+  # user might care to read/view in the MSVC IDE.
+  local i ;
+  for i in $(sources)
+  {
+    if [ IsElem $(i:S) : .h .hpp .hxx .H .c .cc .cpp .cxx .C .m .mm .M ]
+    {
+      local fileinproj ;
+      if $($(rawname)_STATIC) = "yes"
+      {
+       fileinproj = $(i) ;
+      }
+      else
+      {
+       fileinproj = $(i:R=$(SEARCH_SOURCE)) ;
+      }
+      ResponseFile $(respfile) : "file|$(fileinproj)" : notfile :
+       $(respdir) ;
+    }
+  }
+
+  # Add resource file.
+  if [ IsElem $(type) : plugin appgui appcon ]
+  {
+    local resource = $(msvcname:S=.rc) ;
+    Depends msvcgen : $(resource) ;
+    MakeLocate $(resource) : $(outdircommon) ;
+    SEARCH on $(resource) = $(outdircommon) ;
+    NAME on $(resource) = $(rawname) ;
+    $(rawname)_RCNAME = $(resource) ;
+    ResponseFile $(respfile) : "file|$(resource:R=$(outdircommon))" : notfile :
+      $(respdir) ;
+  
+    local versionrc = $(resource:S=.vrctmp) ;
+    MakeLocate $(versionrc) : $(workdircommon) ;
+    MakeVersionRc $(versionrc) : $(rawname) ;
+    Depends $(versionrc) : $(TOP)/Jamconfig ;
+    Depends $(versionrc) : $(SUBDIR)/Jamfile ;
+    Win32Resource $(rawname) : $(versionrc) ;
+    MsvcRmTemps $(resource) : $(versionrc) ;
+    
+    if $(type) = "plugin" 
+    {
+      local metarc = $(resource:S=.mrctmp) ;
+      MakeLocate $(metarc) : $(workdircommon) ;
+      SEARCH on $(metarc) = $(SEARCH_SOURCE) ;
+      Depends $(metarc) : $($(rawname)_METAFILE) ;
+      GenerateWin32MetadataRc $(metarc) : $($(rawname)_METAFILE) ;
+      
+      Win32Resource $(rawname) : $(metarc) ;
+      MsvcRmTemps $(resource) : $(metarc) ;
+      ResponseFile $(respfile) :
+       "file|$($(rawname)_METAFILE:R=$(SEARCH_SOURCE))" : notfile :
+       $(respdir) ;
+    }
+
+    if [ IsElem $(type) : appgui appcon ]
+    {
+      if ! [ IsElem nomanifest : $(options) ]
+      {
+        local manifest = $(msvcname:S=.manifest) ; 
+        MakeLocate $(manifest) : $(outdircommon) ;
+        MakeManifestFile $(manifest) : $(rawname) ;
+        Depends $(manifest) : $(TOP)/Jamconfig ;
+        Depends $(manifest) : $(SUBDIR)/Jamfile ;
+        Depends msvcgen : $(manifest) ;
+      
+        local manifestrc = $(resource:S=.mfrctmp) ;
+        MakeLocate $(manifestrc) : $(workdircommon) ;
+        MANIFEST_NAME on $(manifestrc) = $(manifest) ;
+        GenerateWin32ManifestRc $(manifestrc) ;
+        Depends $(manifestrc) : $(manifest) ;
+        if $(MSVC_VERSION) = 8
+        {
+          # VC8: Manifest appears in project along other files, a special build
+          # tool cares about the embedding into a resource. (The resource goop
+          # still has to be generated since it is shared with other VCs.)
+         ResponseFile $(respfile) : "file|$(manifest:R=$(outdircommon))" : notfile :
+           $(respdir) ;
+        }
+      
+        Win32Resource $(rawname) : $(manifestrc) ;
+        MsvcRmTemps $(resource) : $(manifestrc) ;
+      }
+      
+      local icon = [ ApplicationIcon win32 : $(rawname) ] ;
+      if ! $(icon)
+      {
+        local apptype = gui ;
+        if $(type) = "appcon" { apptype = console ; }
+        icon = [ ApplicationIconDefault win32 : $(apptype) ] ;
+      }
+      if $(icon)
+      {
+       local iconrc = $(resource:S=.iconrctmp) ;
+       # RELPATH includes trailing slash (hence the "" in ConcatDirs).
+       RELPATH on $(iconrc) =
+         [ ConcatDirs [ Property msvcgen : relpath$(MSVC_VERSION) ] "" ] ;
+       MakeLocate $(iconrc) : $(workdircommon) ;
+       Depends $(iconrc) : $(icon) ;
+        Depends $(iconrc) : $(SUBDIR)/Jamfile ;
+        GenerateIconRc $(iconrc) : $(icon) ;
+       Win32Resource $(rawname) : $(iconrc) ;
+       MsvcRmTemps $(resource) : $(iconrc) ;
+      }
+    }
+  }
+  
+  local inckeys = "include" includedebug ;
+  local incdirs = $(MSVC.INCDIRS_LITERAL) $(MSVC.INCDIRS_LITERAL.$(rawname)) ;
+  ResponseFile $(respfile) : "$(inckeys)|$(incdirs)" : notfile : $(respdir) ;
+
+  local incdir ;
+  for incdir in $(MSVC.INCDIRS) $(MSVC.INCDIRS.$(rawname))
+  {
+    if $(incdir) = "."
+    {
+      incdir = [ ConcatDirs $(relpath) ] ;
+    }
+    else
+    {
+      incdir = [ ConcatDirs $(relpath) $(incdir) ] ;
+    }
+    ResponseFile $(respfile) : "$(inckeys)|$(incdir)" : notfile : $(respdir) ;
+  }
+
+  if ! [ Property msvcgen : templatedir ]
+  {
+    exit "Error: You must invoke MsvcGenTemplateDir for project generation." ;
+  }
+
+  local buildfile = $(msvcname:G=msvcproject:S=.$(MSVC.TSUFPRJ)) ;
+  Always $(buildfile) ;
+  MakeLocate $(buildfile) : $(builddir) ;
+  Includes $(buildfile) : $(respfile) ;
+  MSVC_BUILD_TYPE on $(buildfile) = project ;
+  MsvcBuildFile $(buildfile) : $(respfile) ;
+  Depends msvcgenrun : $(buildfile) ;
+  MsvcRmTemps msvcgen : $(buildfile) ;
+
+  if ! $(MSVC.WORKSPACES)
+  {
+    exit "You must specify at least one workspace via MsvcGenWorkspace" ;
+  }
+
+  local w ;
+  for w in $(MSVC.WORKSPACES)
+  {
+    ResponseFile $($(w)_WKS_RESPFILE) : "project|$(msvcname)" : notfile :
+      $($(w)_WKS_RESPDIR) ;
+  }
+
+  Clean msvcclean : $(target) ;
+}
+
+#----------------------------------------------------------------------------
+
+# Ensure that the pseudo-groups exist with which the overridden Application,
+# Plugin, and Library rules will register their targets. We have to do this
+# here rather than at the top-level (outside of any rule invocation) because we
+# need to give the client time to invoke MsvcGenWorkspace first to set up the
+# workspaces into which these groups will be inserted. If we tried registering
+# theses pseudo-groups at the top-level, registration would occur before the
+# client has had a chance to invoke MsvcGenWorkspace, thus these pseudo-groups
+# would not inhabit any workspaces.
+rule RegisterWellKnownCompileGroup1
+{
+  local group = $(1) ;
+  if $(MSVCGEN.WELL_KNOWN_GROUP_REGISTERED.$(group)) != yes
+  {
+    MSVCGEN.WELL_KNOWN_GROUP_REGISTERED.$(group) = yes ;
+    RegisterCompileGroups $(group) ;
+  }
+}
+
+rule RegisterWellKnownCompileGroup
+{
+  RegisterWellKnownCompileGroup1 all ;
+  RegisterWellKnownCompileGroup1 $(1) ;
+}
+
+rule LinkStaticPlugins
+{
+  local package target plugins optplugins ;
+  # Fetch the parameters
+  target = $(1) ;
+  plugins = $(2) ;
+  optplugins = $(3) ;
+  package = $(4) ;
+  
+  if $(package)
+  {
+    # External static plugins.
+    # First include static plugin info
+    if ! $(HAVE_STATICDEPS.$(package))
+    {
+      include $($(package).STATICDEPS) ;
+      HAVE_STATICDEPS.$(package) = yes ;
+    }
+    local lflags.debug lflags.release p mode ;
+    # Collect optional plugins
+    for p in $(optplugins)
+    {
+      if [ IsElem $(p) : $(STATICPLUGINS.AVAILABLE) ]
+      {
+       plugins += $(p) ;
+      }
+    }
+    # Grab flags
+    for p in $(plugins)
+    {
+      NotFile $(p) ;
+      for mode in debug release
+      {
+       MsvcCFlags $(target) : $(STATICPLUGIN.$(p).CFLAGS.$(mode)) : $(mode) ;
+       lflags.$(mode) += $(STATICPLUGIN.$(p).LFLAGS.$(mode)) ;
+      }
+    }
+    for mode in debug release
+    {
+      MsvcLFlags $(target) : 
+       [ Reverse [ RemoveDups [ Reverse $(lflags.$(mode)) ] ] ] : $(mode) ;
+    }
+  }
+  else
+  {
+    # link with static plugins
+    LinkWith $(target) : $(STATICPLUGINS.LIBRARY) ;
+    
+    # Local static plugins
+    local libs p ;
+    # Collect optional plugins
+    for p in $(optplugins)
+    {
+      if $($(p)_TYPE)
+      {
+       plugins += $(p) ;
+      }
+    }
+    # Grab flags
+    for p in $(plugins)
+    {
+      libs += $($(p).NEEDLIBS) ;
+
+      ExternalLibs $(target) : $($(p).EXTERNALLIBS) ;
+      for mode in debug release
+      {
+       MsvcExternalLibrary $(target) : $($(p)_$(mode)_EXTERNALLIBS) : $(mode) ;
+       MsvcExternalLibrary $(target) : $($(p)_$(mode)_EXTERNALLIBS) : $(mode) ;
+      }
+    }
+    LinkWith $(target) : $(libs) ;
+  }
+
+  # Generate static plugin instantiation
+  local outdir = [ Property msvcgen : outdircommon ] ;
+  if "$(outdir)" = ""
+  {
+    outdir = [ Property msvcgen : outdir$(MSVC_VERSION) ] ;
+  }
+  local staticuse_out ;
+  if $(package)
+  {
+    # @@@ Prefix hardcoded
+    staticuse_out = $(MSVC.PREFIX.appgui)$(<)_staticuse_$(package).cpp ; 
+  }
+  else
+  {
+    staticuse_out =
+      $(MSVC.PREFIX.appgui)$(<)_staticuse.cpp ; # @@@ Prefix hardcoded
+  }
+  MakeLocate $(staticuse_out) : $(outdir) ;
+  SEARCH on $(staticuse_out) = $(outdir) ;
+  
+  GenerateStaticPluginInstantiation $(staticuse_out) : $(plugins) ;
+  Depends msvcgen : $(staticuse_out) ;
+
+  # Add usefile to project
+  ResponseFile $($(target)_PRJ_RESPFILE) : 
+    "file|$(staticuse_out:R=$(outdir))" : notfile :
+    $($(target)_PRJ_RESPDIR) ;
+  Depends $(target) : $(staticuse_out) ;
+}
+
+rule Application
+{
+  RegisterWellKnownCompileGroup apps ;
+
+  local projtype ;
+  if [ IsElem console : $(3) ]
+  {
+    projtype = appcon ;
+  }
+  else
+  {
+    projtype = appgui ;
+  }
+  MsvcProject $(<) : $(projtype) : $(<:S=.exe) : $(>) : $(3) ;
+  
+  CompileGroups $(<) : all apps ;
+}
+
+rule Plugin
+{
+  RegisterWellKnownCompileGroup plugins ;
+
+  $(<)_TYPE = plugin ;
+  
+  local metafile ;
+  metafile = [ FAppendSuffix $(<) : $(SUFMETA) ] ;
+  SEARCH on $(metafile) = $(SEARCH_SOURCE) ;
+  $(<)_METAFILE = $(metafile) ;
+  MsvcProject $(<) : plugin : $(<:S=$(MSVCGEN.PLUGIN_EXT.$(<):E=.dll)) : $(>) ;
+  CompileGroups $(<) : all plugins ;
+
+  STATICPLUGINS.SOURCES.$(<) += $(>:R=$(SEARCH_SOURCE)) ;
+  STATICPLUGINS.SUBTARGETS += $(<) ;
+
+  # Generate static variant of plugin
+  #  Static registry
+  local outdir = [ Property msvcgen : outdircommon ] ;
+  local staticreg_out = $(MSVC.PREFIX.library)$(<)_staticreg.cpp ;
+  MakeLocate $(staticreg_out) : $(outdir) ;
+  SEARCH on $(staticreg_out) = $(outdir) ;
+  GenerateStaticPluginRegistration $(staticreg_out) : $(metafile) ;
+  Depends msvcgen : $(staticreg_out) ;
+  STATICPLUGINS.SOURCES.$(<) += $(outdir)/$(staticreg_out) ;
+}
+
+rule Library
+{
+  RegisterWellKnownCompileGroup libs ;
+  $(<)_TYPE = library ;
+  MsvcProject $(<) : library : $(<:S=.lib) : $(>) ;
+  CompileGroups $(<) : all libs ;
+}
+
+rule StaticPluginLibrary
+{
+  local name = $(<) ;
+  local rejects = $(>) ;
+  local t ;
+
+  local targets = $(STATICPLUGINS.SUBTARGETS) ;
+  if $(rejects)
+  {
+    targets = [ Filter $(targets) : $(rejects) ] ;
+  }
+  local sources extlibs ;
+  for t in $(targets)
+  {
+    sources += $(STATICPLUGINS.SOURCES.$(t)) ;
+    extlibs += $($(t).EXTERNALLIBS) ;
+  }
+
+  $(name)_STATIC = "yes" ;
+  # Set up library
+  Library $(name) : $(sources) ;
+  MsvcDefine $(name) : CS_STATIC_LINKED ;
+  _MsvcDefine $(name) : $(STATICPLUGINS.MSVC_DEFINES) ;
+  ExternalLibs $(name) : [ RemoveDups $(extlibs) ] ;
+
+  # Write out needed CFLAGS, LFLAGS
+  local outdir = [ Property msvcgen : outdircommon ] ;
+  if $(outdir) = ""
+  {
+    outdir = [ Property msvcgen : outdir$(MSVC_VERSION) ] ;
+  }
+  STATICPLUGINS.DEPENDENCIES = $(name)_msvc.jam ;
+  MakeLocate $(STATICPLUGINS.DEPENDENCIES) : $(outdir) ;
+  SEARCH on $(STATICPLUGINS.DEPENDENCIES) = $(outdir) ;
+  for t in $(targets)
+  {
+    NotFile $(t) ;
+    WriteDependencies $(STATICPLUGINS.DEPENDENCIES) : $(t) : $(name) ;
+  }
+  Always $(STATICPLUGINS.DEPENDENCIES) ;
+  Depends msvcgen : $(STATICPLUGINS.DEPENDENCIES) ;
+  
+  STATICPLUGINS.LIBRARY = $(name) ;
+}
+
+# Write out CFLAGS, LFLAGS needed by a plugin
+rule WriteDependencies
+{
+  local cflags.debug cflags.release ;
+  local lflags.debug lflags.release ;
+  local depfile = $(<) ;
+  local plugin = $(>) ;
+  local libname = $(3) ;
+  local depfile_gristed = $(depfile:G=$(plugin)) ;
+  MakeLocate $(depfile_gristed) : [ on $(depfile) GetVar LOCATE ] ;
+  
+  # "Artificially" insert static library itself
+  lflags.debug += $(MSVC.PREFIX.library)$(libname)_d.lib ;
+  lflags.release += $(MSVC.PREFIX.library)$(libname).lib ;
+  # Collect other libs
+  local libs = [ ResolveLibs $($(plugin).NEEDLIBS) ] ;
+  lflags.debug += $(MSVC.PREFIX.library)$(libs)_d.lib ;
+  lflags.release += $(MSVC.PREFIX.library)$(libs).lib ;
+  
+  # Defines
+  local l ;
+  for l in $($(plugin).EXTERNALLIBS)
+  {
+    if $($(l).DEFINES.DEBUG)
+    {
+      cflags.debug += "\"/D $($(l).DEFINES.DEBUG)\"" ;
+      cflags.release += "\"/D $($(l).DEFINES)\"" ;
+    }
+    else
+    {
+      cflags.debug += "\"/D $($(l).DEFINES)\"" ;
+      cflags.release += "\"/D $($(l).DEFINES)\"" ;
+    }
+  }
+  # Link flags
+  local mode ;
+  for mode in debug release
+  {
+    lflags.$(mode) += $($(plugin).LFLAGS.$(mode))  ;
+    lflags.$(mode) += $($(plugin)_$(mode)_EXTERNALLIBS)  ;
+  }
+  CFLAGS.DEBUG on $(depfile_gristed) = "$(cflags.debug)" ;
+  CFLAGS.RELEASE on $(depfile_gristed) = "$(cflags.release)" ;
+  lflags.debug = [ RemoveDups $(lflags.debug) ] ;
+  LFLAGS.DEBUG on $(depfile_gristed) = "$(lflags.debug)" ;
+  lflags.release = [ RemoveDups $(lflags.release) ] ;
+  LFLAGS.RELEASE on $(depfile_gristed) = "$(lflags.release)" ;
+  LIBNAME on $(depfile_gristed) = $(libname) ;
+  
+  if $($(depfile).FIRSTTIME) != "yes"
+  {
+    WriteDepFlags1 $(depfile_gristed) : $(plugin) ;
+    $(depfile).FIRSTTIME = "yes" ;
+  }
+  else
+  {
+    WriteDepFlags2 $(depfile_gristed) : $(plugin) ;
+  }
+  Depends $(depfile) : $(depfile_gristed) ;
+  Always $(depfile_gristed) ;
+}
+
+actions WriteDepFlags1 
+{
+  cat << EOT > $(<)
+# This file is automatically generated to be used together with $(LIBNAME)
+# and must be integrated by setting the correct values for the 
+# HAVE_STATICDEPS.<package> and <package>.STATICDEPS via MsvcGenConfig.
+# Furthermore, this file might require manual updates from the master copy 
+# (usually found in the package's source repository) every now and then.
+STATICPLUGINS.AVAILABLE += $(>) ;
+STATICPLUGIN.$(>).CFLAGS.debug = $(CFLAGS.DEBUG) ;
+STATICPLUGIN.$(>).CFLAGS.release = $(CFLAGS.RELEASE) ;
+STATICPLUGIN.$(>).LFLAGS.debug = $(LFLAGS.DEBUG) ;
+STATICPLUGIN.$(>).LFLAGS.release = $(LFLAGS.RELEASE) ;
+EOT
+}
+
+actions WriteDepFlags2 
+{
+  cat << EOT >> $(<)
+STATICPLUGINS.AVAILABLE += $(>) ;
+STATICPLUGIN.$(>).CFLAGS.debug = $(CFLAGS.DEBUG) ;
+STATICPLUGIN.$(>).CFLAGS.release = $(CFLAGS.RELEASE) ;
+STATICPLUGIN.$(>).LFLAGS.debug = $(LFLAGS.DEBUG) ;
+STATICPLUGIN.$(>).LFLAGS.release = $(LFLAGS.RELEASE) ;
+EOT
+}
+
+rule RegisterCompileGroups
+{
+  local i ;
+  for i in $(<)_$(MSVC.WORKSPACES)
+  {
+    MsvcProject $(i) : group ;
+  }
+}
+
+rule CompileGroups
+{
+  local w ;
+  for w in $(MSVC.WORKSPACES)
+  {
+    local i ;
+    for i in $(>)_$(w)
+    {
+      local m  = $($(<)_MSVCNAME) ;
+      if ! $(m) { m = $($(<)_$(w)_MSVCNAME) ; } # Might be a "group".
+      if $(m)
+      {
+        ResponseFile $($(w)_WKS_RESPFILE) : "$($(i)_MSVCNAME)|$(m)" :
+         notfile : $($(w)_WKS_RESPDIR) ;
+      }
+    }
+  }
+}
+
+rule LinkWith
+{
+  local libs = [ ResolveLibs $(>) ] ;
+  ExternalLibs $(<) : $($(>).EXTERNALLIBS) ;
+  local w ;
+  for w in $(MSVC.WORKSPACES)
+  {
+    local l ;
+    for l in $(libs)_MSVCNAME
+    {
+      if $($(l))
+      {
+       ResponseFile $($(w)_WKS_RESPFILE) : "$($(<)_MSVCNAME)|$($(l))" :
+         notfile : $($(w)_WKS_RESPDIR) ;
+      }
+    }
+  }
+  $(<).NEEDLIBS = $(libs) ;
+}
+
+rule MsvcClassifyMode
+{
+  local c ;
+  switch $(<)
+  {
+    case release : c = "" ;
+    case debug : c = debug ;
+    case * : c = "" debug ;
+  }
+  return $(c) ;
+}
+
+# _MsvcRespEmit target : items : tag [ : mode [ : options ]]
+#   Emit `items' to the response file for `target' using the response file tag
+#   `tag'. `mode' is either "release", "debug", or empty, in which case it
+#   applies to release and debug modes. If options contains "ignoremode", then
+#   `mode' is not consulted.
+rule _MsvcRespEmit
+{
+  local target = $(1) ;
+  local items = $(2) ;
+  local tag = $(3) ;
+  local mode = $(4) ;
+  local options = $(5) ;
+  local modes = "" ;
+
+  CheckOptions ignoremode : $(options) : $(target) ;
+  if ! [ IsElem ignoremode ] { modes = [ MsvcClassifyMode $(mode) ] ; }
+
+  ResponseFile $($(target)_PRJ_RESPFILE) : "$(tag)$(modes)|$(items)" :
+    notfile : $($(target)_PRJ_RESPDIR) ;
+}
+
+# MsvcExternalLibrary target [ : libs [ : mode ]]
+#   (See documentation above.)
+rule MsvcExternalLibrary1
+{
+  _MsvcRespEmit $(1) : $(2) : library : $(3) ;
+  local mode = $(3) ;
+  mode ?= debug release ;
+  $(1)_$(mode)_EXTERNALLIBS += $(2) ;
+}
+
+# MsvcDefine target [ : key [ : value [ : mode ]]]
+#   (See documentation above.)
+rule MsvcDefine1
+{
+  local target = $(1) ;
+  local key = $(2) ;
+  local value = $(3) ;
+  local mode = $(4) ;
+  if $(key)
+  {
+    local def ;
+    if $(value)
+    {
+      def = "$(key)=$(value)" ;
+    }
+    else
+    {
+      def = $(key) ;
+    }
+    _MsvcRespEmit $(target) : $(def) : define : $(mode) ;
+    STATICPLUGINS.MSVC_DEFINES += $(def) ;
+  }
+}
+
+# MsvcIncDirs target : directory [ : mode ]
+#   (See documentation above.)
+rule MsvcIncDirs1 
+{ 
+  _MsvcIncDirs $(1) : $(2) : $(3) ;
+}
+
+# _MsvcDefine target : tuples [ : mode ]
+#   Similar to MsvcDefine, but works with a list of `key=value' tuples. Also
+#   understands `key' with no value.
+rule _MsvcDefine
+{
+  _MsvcRespEmit $(1) : $(2) : define : $(3) ;
+}
+
+# MsvcCFLags target [ : cflags [ : mode ]]
+#   (See documentation above.)
+rule MsvcCFlags1
+{
+  _MsvcRespEmit $(1) : $(2) : cflags : $(3) ;
+}
+
+# MsvcLFlags target [ : lflags [ : mode ]]
+#   (See documentation above.)
+rule MsvcLFlags1
+{
+  local modes = [ MsvcClassifyMode $(3) ] ;
+  $(target).LFLAGS.$(modes) += $(2) ;
+  _MsvcRespEmit $(1) : $(2) : lflags : $(3) ;
+}
+
+# MsvcLFlags target : files
+#   (See documentation above.)
+rule MsvcExtraFile1 
+{
+  local rawname = $(1) ;
+  local files = $(2) ;
+
+  local respfile = $($(rawname)_PRJ_RESPFILE) ;
+  local respdir = $($(rawname)_PRJ_RESPDIR) ;
+  
+  ResponseFile $(respfile) : "file|$(files)" : notfile :
+    $(respdir) ;
+}
+
+# _MsvcIncDirs target : incdirs [ : mode ]
+#   Helper for ExternalLibs which processes the contents of TAG.INCDIRS for
+#   an external library.
+rule _MsvcIncDirs
+{
+  _MsvcRespEmit $(1) : $(2) : include : $(3) ;
+}
+
+# _MsvcLibDirs target : libdirs [ : mode ]
+#   Helper for ExternalLibs which processes the contents of TAG.LIBDIRS for
+#   an external library.
+rule _MsvcLibDirs
+{
+  _MsvcRespEmit $(1) : $(2) : libdir : $(3) ;
+}
+
+# _ExternalLibsHelperMsvc target : libtag : subrule : attribute
+rule _ExternalLibsHelperMsvc
+{
+  local target = $(1) ;
+  local lib = $(2) ;
+  local rulename = $(3) ;
+  local attrib = $(4) ;
+
+  if $($(lib).$(attrib).DEBUG.$(MSVC_VERSION))
+  {
+    $(rulename) $(target) : $($(lib).$(attrib).DEBUG.$(MSVC_VERSION)) : debug ;
+  }
+  else if $($(lib).$(attrib).DEBUG)
+  {
+    $(rulename) $(target) : $($(lib).$(attrib).DEBUG) : debug ;
+  }
+  else
+  {
+    $(rulename) $(target) : $($(lib).$(attrib)) : debug ;
+  }
+  if $($(lib).$(attrib).$(MSVC_VERSION))
+  {
+    $(rulename) $(target) : $($(lib).$(attrib).$(MSVC_VERSION)) : release ;
+  }
+  else
+  {
+    $(rulename) $(target) : $($(lib).$(attrib)) : release ;
+  }
+}
+
+rule ExternalLibs
+{
+  local i ;
+  for i in $(>)
+  {
+    _ExternalLibsHelperMsvc $(<) : $(i) : MsvcCFlags : CFLAGS ;
+    _ExternalLibsHelperMsvc $(<) : $(i) : MsvcLFlags : LFLAGS ;
+    _ExternalLibsHelperMsvc $(<) : $(i) : MsvcExternalLibrary : LIBS ;
+    _ExternalLibsHelperMsvc $(<) : $(i) : _MsvcDefine  : DEFINES ;
+    _ExternalLibsHelperMsvc $(<) : $(i) : _MsvcIncDirs : INCDIRS ;
+    _ExternalLibsHelperMsvc $(<) : $(i) : _MsvcLibDirs : LIBDIRS ;
+    
+    $(<).EXTERNALLIBS += $(i) ;
+  }
+}
+
+rule IncludeDir
+{
+  local dir = $(1) ;
+  local target = $(2) ;
+  local options = $(3) ;
+
+  if ! [ IsElem transient : $(options) ]
+  {
+    local tag = "INCDIRS" ;
+    if [ IsElem literal : $(options) ] { tag = "INCDIRS_LITERAL" ; }
+
+    if $(dir)
+    {
+      dir = [ ConcatDirs $(dir) ] ;
+    }
+    else
+    {
+      dir = "." ;
+    }
+
+    if $(target)
+    {
+      MSVC.$(tag).$(target) += $(dir) ;
+    }
+    else
+    {
+      MSVC.$(tag) += $(dir) ;
+    }
+  }
+}
+
+# Normal invocations of these two rules are made using Unix-style flags;
+# possibly determined by an Autoconf configuration script.  Such flags are
+# unsuitable for MSVC, so we ignore them.
+rule CFlags { }
+rule LFlags { }
+
+rule Win32Resource
+{
+  Depends $(<) : $($(<)_RCNAME) ;
+  Depends $($(<)_RCNAME) : $(>) ;
+  MergeResources $($(<)_RCNAME) : $(>) ;
+}
+
+#----------------------------------------------------------------------------
+
+actions MsvcBuildFile
+{
+  cat > $(<) <<EOF
+[% INCLUDE '$(MSVC_BUILD_TYPE)$(MSVC_TEMPLATE_SUFFIX).tlib' respfile='$(>)' -%]
+EOF
+}
+
+actions together MergeResources
+{
+  cat $(>) > $(<)
+}
+
+actions GenerateIconRc
+{
+  sedexpr=`echo 's^$(MSVCGEN_STRIP_ROOT)^^;' | $(MSVCGEN_SED_PROTECT)`
+  icon=`echo "$(>)" | sed "$sedexpr"`
+  echo "1 ICON \"$(RELPATH)$icon\"" > $(<)
+}
+
+#----------------------------------------------------------------------------
+
+rule MsvcTTreeRc
+{
+  local target = $(<:G=ttreerc$(MSVC_VERSION)) ;
+  local builddir = [ msvcgen_build_dir $(MSVC_VERSION) ] ;
+  local workdir = [ msvcgen_work_dir $(MSVC_VERSION) ] ;
+
+  WORKDIR on $(target) = $(workdir) ;
+  BUILDDIR on $(target) = $(builddir) ;
+
+  MakeLocate $(target) : $(workdir) ;
+  MsvcTTreeRc1 $(target) ;
+  Always $(target) ;
+  Depends msvcgenrun : $(target) ;
+  MsvcRmTemps msvcgen : $(target) ;
+
+  return $(target) ;
+}
+
+actions MsvcTTreeRc1
+{
+  cat > $(<) <<EOF
+lib = $(MSVCGEN_TEMPLATEDIR)
+lib = $(WORKDIR)
+src = $(BUILDDIR)
+dest = $(MSVCGEN_OUTDIR_$(MSVC_VERSION))
+suffix $(MSVC.TSUFPRJ)=$(SUFPRJ)
+suffix $(MSVC.TSUFWKP)=$(SUFWSP)
+EOF
+}
+
+#----------------------------------------------------------------------------
+
+rule MsvcTTree
+{
+  NotFile $(<) ;
+  Always $(<) ;
+}
+
+if $(MSVC_FORCE_CRLF) = yes
+{
+  actions MsvcTTree
+  {
+    $(RUN_TTREE) -f \$(>) $(MSVCGEN_TTREEOPTIONS) --load_perl --all
+    $(PERL) -pi.bak \
+      -e 'if ($ARGV ne $prev) { $prev = $ARGV; binmode(ARGVOUT) }' \
+      -e 's:(?<!\015)\012:\015\012:g' \
+      $(MSVCGEN_OUTDIR_$(MSVC_VERSION))/*.$(SUFPRJ) \
+      $(MSVCGEN_OUTDIR_$(MSVC_VERSION))/*.$(SUFWSP)
+    $(RM) $(MSVCGEN_OUTDIR_$(MSVC_VERSION))/*.bak
+  }
+}
+else
+{
+  actions MsvcTTree
+  {
+    $(RUN_TTREE) -f \$(>) $(MSVCGEN_TTREEOPTIONS) --load_perl --all
+  }
+}
+
+MsvcTTree msvcgenrun : [ MsvcTTreeRc ttree.rc ] ;
+
+NotFile msvcgen ;
+Always msvcgen ;
+Depends msvcgen : msvcgenrun ;
+}
diff --git a/mk/jam/objectivec.jam b/mk/jam/objectivec.jam
new file mode 100644 (file)
index 0000000..3a9e990
--- /dev/null
@@ -0,0 +1,80 @@
+#============================================================================
+# Rules for compiling Objective-C and Objective-C++ files
+# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#============================================================================
+
+if $(CMD.OBJC)
+{
+
+rule ObjCRule
+{
+  local object = [ DoObjectGrist [ PrefixSuffix $(>)_ : $(<) : $(SUFOBJ) ] ] ;
+  ObjC $(object) : $(<) ;
+  return $(object) ;
+}
+RegisterFileType ObjCRule : .m ;
+RegisterHeaderRule HeaderRule : $(HDRPATTERN) : .m ;
+
+rule ObjC
+{
+  Depends $(<) : $(>) ;
+
+  CCFLAGS on $(<) += $(CCFLAGS) $(SUBDIRCCFLAGS) ;
+  OBJCFLAGS on $(<) += $(OBJCFLAGS) ;
+  CCHDRS on $(<) = [ on $(<) FIncludes $(HDRS) ] ;
+  CCDEFS on $(<) = [ on $(<) FDefines $(DEFINES) ] ;
+}
+
+actions ObjC
+{
+  $(CMD.OBJC) -c -o $(<) $(CCHDRS) $(CCFLAGS) $(OBJCFLAGS) $(CCDEFS) $(>)
+}
+}
+
+if $(CMD.OBJC++)
+{
+rule ObjC++Rule
+{
+  local object = [ DoObjectGrist [ PrefixSuffix $(>)_ : $(<) : $(SUFOBJ) ] ] ;
+  ObjC++ $(object) : $(<) ;
+  return $(object) ;
+}
+RegisterFileType ObjC++Rule : .mm .M ;
+RegisterHeaderRule HeaderRule : $(HDRPATTERN) : .mm .M ;
+
+rule ObjC++
+{
+  Depends $(<) : $(>) ;
+  
+  # Ugly hack: Apple's gcc4 does not accept -fvisibility-inlines-hidden in
+  # Objective-C++ mode. Ideally, this issue should be resolved by the
+  # configure script, but it does not currently distinguish between flags
+  # intended for the C++ compiler and those intended for the Objective-C++
+  # compiler.
+  local rejects = -fvisibility-inlines-hidden ;
+  C++FLAGS on $(<) += [ Filter $(C++FLAGS) $(SUBDIRC++FLAGS) : $(rejects) ] ;
+  OBJC++FLAGS on $(<) += [ Filter $(OBJC++FLAGS) : $(rejects) ] ;
+  CCHDRS on $(<) = [ on $(<) FIncludes $(HDRS) ] ;
+  CCDEFS on $(<) = [ on $(<) FDefines $(DEFINES) ] ;
+}
+
+actions ObjC++
+{
+  $(CMD.OBJC++) -c -o $(<) $(CCHDRS) $(C++FLAGS) $(OBJC++FLAGS) $(CCDEFS) $(>)
+}
+}
diff --git a/mk/jam/objects.jam b/mk/jam/objects.jam
new file mode 100644 (file)
index 0000000..7fda0bd
--- /dev/null
@@ -0,0 +1,250 @@
+#============================================================================
+# Rules for compiling a set of sources to object files
+# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#============================================================================
+# These are slightly modified versions of the Object and Objects rules from
+# jam. The problem with the original rules in Jambase is the handling of
+# custom file types. The solution with the UserObject rule is monolithic, you
+# can only have 1 such rule. Thus we construct a more flexible toolkit here
+# which let's you register rules for certain filetypes.
+
+##  RegisterFileType Rulename : extensions
+##    Register a rule which is used to compile a filetype into object
+##    files. The registered rule is called with the name of the
+##    sourcefile as argument and should return a list of objectfiles which are
+##    created. You should set the grist of the object files by using the
+##    DoObjectGrist function.
+rule RegisterFileType
+{
+  local suffix ;
+  for suffix in $(>)
+  {
+    FILETYPE_$(suffix) = $(<) ;
+  }
+}
+
+##  RegisterHeaderRule rulename : regexpattern : extensions
+##    Registers a rule and a regular expression which will be used for header
+##    file scanning of the specified extensions.
+rule RegisterHeaderRule
+{
+  local suffix ;
+  for suffix in $(3)
+  {
+    HDRRULE_$(suffix) = $(<) ;
+    HDRPATTERN_$(suffix) = $(>) ;
+  }
+}
+
+##  CompileObjects sources [: objectfileprefix]
+##    Compile a set of sourcefiles into objectfiles (extension: SUFOBJ,
+##    usually .o). This rule takes care of setting the SEARCH and LOCATE
+##    variables to the values of $(SEARCH_SOURCE) and $(LOCATE_TARGET).
+##    The Application, Plugin and Library rules already use this rule
+##    internally. You should only use this rule if you have to avoid the
+##    Application, Plugin or Library rules.
+rule CompileObjects
+{
+  local source ;
+  local targets ;
+
+  # Search the source
+  SEARCH on $(<) = $(SEARCH_SOURCE) ;      
+
+  for source in $(<)
+  {
+    # compile the sourcefile to targetfile
+    targets += [ CompileObject $(source) : $(>) ] ;
+  }
+  
+  # locate the targets
+  MakeLocate $(targets) : $(LOCATE_TARGET) ;
+
+  return $(targets) ;
+}
+
+##  PrefixSuffix [prefix] : filename : suffix
+##    Replaces the suffix of 'filename' with 'suffix' and prepends 'prefix' to
+##    it. 
+rule PrefixSuffix
+{
+  local prefix = $(1) ;
+  local name = $(2) ;
+  local suffix = $(3) ;
+  if ! $(prefix) { prefix = "" ; }
+  return $(name:B=$(prefix)$(name:B):S=$(suffix)) ;
+}
+
+#----------------------------------------------------------------------------
+# private part
+
+# helper rule: Compiles a source file to an object file. Does header file
+# scanning, sets LOCATE and SEARCH for source and target, grists the files
+# with the current subdir and searches for the correct registered rule.
+rule CompileObject
+{
+  # handle #includes for source: Jam scans for headers with
+  # the regexp pattern $(HDRSCAN) and then invokes $(HDRRULE)
+  # with the scanned file as the target and the found headers
+  # as the sources.  HDRSEARCH is the value of SEARCH used for
+  # the found header files.  Finally, if jam must deal with 
+  # header files of the same name in different directories,
+  # they can be distinguished with HDRGRIST.
+
+  # $(SEARCH_SOURCE:E) is where cc first looks for #include 
+  # "foo.h" files.  If the source file is in a distant directory, 
+  # look there.  Else, look in "" (the current directory).
+  if $(HDRRULE_$(<:S))
+  {
+    HDRSEARCH on $(<) = 
+       $(SEARCH_SOURCE:E) $(SUBDIRHDRS) $(HDRS) $(STDHDRS) ;  
+    HDRGRIST on $(<) = $(HDRGRIST) ;                               
+    HDRRULE on $(<) = $(HDRRULE_$(<:S)) ;
+    HDRSCAN on $(<) = $(HDRPATTERN_$(<:S)) ;
+  }
+
+  local targets ;
+  # Invoke filetype specific rule
+  if $(FILETYPE_$(<:S))
+  {
+    targets = [ $(FILETYPE_$(<:S)) $(<) : $(>) ] ;
+  }
+  else
+  {
+    echo Warning: no rules for file type $(<:S) defined (at file $(<)). ;
+  }
+
+  if $(targets)
+  {
+    # construct clean target
+    Clean clean : $(targets) ;
+
+    # Save HDRS for -I$(HDRS) on compile.
+    # We shouldn't need -I$(SEARCH_SOURCE) as cc can find headers
+    # in the .c file's directory, but generated .c files (from
+    # yacc, lex, etc) are located in $(LOCATE_TARGET), possibly
+    # different from $(SEARCH_SOURCE).
+    HDRS on $(<) = $(SEARCH_SOURCE) $(SUBDIRHDRS) $(HDRS) ;
+
+    # propagate target specific-defines
+    DEFINES on $(<) += $(DEFINES) ;
+  }
+
+  return $(targets) ;
+}
+
+##  HeaderRule source : headers
+##    This rule is the default header rule used by the objects rules. You
+##    might register custom rules with the RegisterHeaderRule rule.
+rule HeaderRule
+{
+  # N.B.  This rule is called during binding, potentially after
+  # the fate of many targets has been determined, and must be
+  # used with caution: don't add dependencies to unrelated
+  # targets, and don't set variables on $(<).
+                                                                                
+  # Tell Jam that anything depending on $(<) also depends on $(>),
+  # set SEARCH so Jam can find the headers, but then say we don't
+  # care if we can't actually find the headers (they may have been
+  # within ifdefs),
+  local s = $(>:G=$(HDRGRIST:E)) ;
+
+  Includes $(<) : $(s) ;
+  SEARCH on $(s) = $(HDRSEARCH) ;
+  NoCare $(s) ;
+  local i ;
+  for i in $(s)
+  {
+    HDRGRIST on $(i) = $(HDRGRIST) ;
+    HDRSEARCH on $(i) = $(HDRSEARCH) ;
+    HDRRULE on $(i) = [ on $(<) GetVar HDRRULE ] ;
+    HDRSCAN on $(i) = [ on $(<) GetVar HDRPATTERN ] ;
+  }
+}
+
+if $(JAMVERSION) < 2.5
+{
+## XXX XXX XXX a bug in jam 2.4 let's the version above fail. I'll let this
+##    non-optimal version in here until jam 2.5 is out.
+
+rule HeaderRule
+{
+  local s = $(>:G=$(HDRGRIST:E)) ;
+
+  Includes $(<) : $(s) ;
+  SEARCH on $(s) = $(HDRSEARCH) ;
+  NoCare $(s) ;
+  local i ;
+  for i in $(s)
+  {
+    if $(HDRRULE_$(i:S))
+    {
+      HDRGRIST on $(i) = $(HDRGRIST) ;
+      HDRSEARCH on $(i) = $(HDRSEARCH) ;       
+      HDRRULE on $(i) = $(HDRRULE_$(i:S)) ;
+      HDRSCAN on $(i) = $(HDRPATTERN_$(i:S)) ;
+    }
+    else if $(JAM_DEBUG)
+    {
+      #echo "No Header rule for $(i:S) file $(i) " ;
+    }
+  }
+}
+
+} # end of if $(JAMVERSION) < 1.5
+
+# Dummy rule: .o files are used as is.
+rule UseObjectFile
+{
+  return $(<) ;
+}
+RegisterFileType UseObjectFile : .o ;
+
+# Ignore header files.
+rule UseHeaderFile
+{
+  return ;
+}
+RegisterFileType UseHeaderFile : .h .hpp ;
+RegisterHeaderRule HeaderRule : $(HDRPATTERN) : .h .hpp .inc ;
+
+# Generates a grist suitable for output objects based on
+# SUBVARIANT and SUBDIR variable.
+rule DoObjectGrist
+{
+  return $(<:G=$(SOURCE_GRIST:E)!$(SUBVARIANT:J=!)) ;
+}
+
+# Generates a grist suitable for source files based on SUBDIR variable.
+# Doesn't change an existing grist.
+rule DoSourceGrist
+{
+  local gristed ;
+  for g in $(<)
+  {
+    local grist ;
+    if $(g:G)
+    {
+      grist = $(g:G) ;
+    }
+    gristed += $(g:G=$(grist:E=$(SOURCE_GRIST:E))) ;
+  }
+  return $(gristed) ;
+}
diff --git a/mk/jam/options.jam b/mk/jam/options.jam
new file mode 100644 (file)
index 0000000..3316217
--- /dev/null
@@ -0,0 +1,38 @@
+#============================================================================
+# Rule for setting options at targets
+# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#============================================================================
+
+#----------------------------------------------------------------------------
+# private rule - please specify the options in Application, Plugin or Library
+# rule and don't use this rule here directly.
+
+##  CheckOptions candidates : Options : target
+rule CheckOptions
+{
+  local i ;
+
+  for i in $(>)
+  {
+    if ! [ IsElem $(i) : $(<) ]
+    {
+      echo "WARNING: Unknown option $(i) specified at $(3)." ;
+    }
+  }
+}
+
diff --git a/mk/jam/plugin.jam b/mk/jam/plugin.jam
new file mode 100644 (file)
index 0000000..c0d82f3
--- /dev/null
@@ -0,0 +1,174 @@
+#============================================================================
+# Rules for plugin creation
+# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#============================================================================
+
+SUFMETA ?= .csplugin ;
+GRISTMETA ?= pluginmeta ;
+
+##  Plugin pluginname : sources [ : options ]
+##    Build a plugin out of sourcefiles. All sourcefiles will be passed
+##    to the Objects rule which tries to compile them into object-files. You
+##    can create rules for your own filetypes with the UserObject rule. Header
+##    files will just be ignored. They are only used for MSVC projectfile
+##    generator.
+##    You can specify the noinstall option if you don't want that an install
+##    target is created.
+##    Options:
+##     noinstall: Don't setup a default installation target.
+##     independent: The target will not be made a dependency of the plugins
+##                  and all target.
+##     nohelp: Do not invoke Help for this target.
+##      notest: Do not set up unit-testing support for this target.
+rule Plugin
+{
+  # check options
+  CheckOptions noinstall independent nohelp notest : $(3) : $(<) ;
+
+  local metafile ;
+  metafile = [ FAppendSuffix $(<) : $(SUFMETA) ] ;
+  SEARCH on $(metafile) = $(SEARCH_SOURCE) ;
+
+  local target = [ ConstructPluginTarget $(<) : $(3) ] ;
+  local sources = [ DoSourceGrist $(>) ] ;
+  local objects = [ CompileObjects $(sources) ] ;
+
+  $(<)_TYPE = plugin ;
+  $(<)_OBJECTS = $(objects) ;
+  $(<)_SOURCES = $(sources) ;
+  $(<)_TARGET = $(target) ;
+  $(<)_METAFILE = $(metafile) ;
+
+  # create target clean rule
+  Always $(<)clean ;
+  NotFile $(<)clean ;
+  Clean $(<)clean : $(objects) ; # create target clean rule 
+
+  # Create a target for eventual static linking
+  if ! $(NO_STATIC_LINKING)
+  {
+    SubVariant static ;
+    local staticreginfoobject = [ BuildStaticRegFile $(<) : $(statictarget) ] ;
+
+    # Add objects to the list of candidates for potential inclusion in a
+    # monolithic static library containing objects for all plugins (useful for
+    # statically linking the plugins into an application if the client so
+    # desires).
+    local staticobjects = [ CompileObjects $(sources) : $(<) ] ;
+
+    local obj_remain = $(objects) ;
+    local staticobj_remain = $(staticobjects) ;
+    
+    while $(obj_remain)
+    {
+      local obj = $(obj_remain[1]) ;
+      local staticobj = $(staticobj_remain[1]) ;
+    
+      STATICPLUGINS.OBJECTS.$(staticobj) = $(obj) ;
+
+      obj_remain = $(obj_remain[2-]) ;
+      staticobj_remain = $(staticobj_remain[2-]) ;
+    }
+
+    MakeLocate $(staticobjects) : $(LOCATE_TARGET) ;
+    STATICPLUGINS.OBJECTS.$(<) += $(staticreginfoobject) ;
+    STATICPLUGINS.OBJECTS.$(<)  += $(staticobjects) ;
+    STATICPLUGINS.SUBTARGETS += $(<) ;
+    
+    SubVariant ;
+  }
+
+  # so 'jam foo' works when it's really foo.dll (Windows) or foo.csbundle
+  # (MacOS/X)
+  if $(target) != $(<)
+  {
+    Depends $(<) : $(target) ;
+    NotFile $(<) ;
+  }
+
+  if ! [ IsElem independent : $(3) ]
+  {
+    Depends plugins : $(<) ;
+  }
+
+  # construct install target
+  if ! [ IsElem noinstall : $(3) ]
+  {
+    SystemInstallPlugin $(target) ;
+  }
+
+  # Link
+  MakeLocate $(target) : $(LOCATE.TARGETS) ;
+  SystemLinkPlugin $(<) : $(objects) : $(3) ;
+  
+  local debugfile = [ SplitDebugInfo $(target) ] ;
+  Clean $(<)clean : $(debugfile) ;
+  if ! [ IsElem noinstall : $(3) ]
+  {
+    NoCare $(debugfile) ;
+    Depends install_plugin : [ DoInstall $(debugfile) : $(plugindir) : $(INSTALL_DATA) ] ;
+  }
+
+  CFlags $(<) : $(PLUGIN.CFLAGS) : nostatic ;
+  LFlags $(<) : $(LINKLIBS) $(PLUGIN.LFLAGS) : nostatic ;
+
+  if ! [ IsElem nohelp : $(3) ]
+  {
+    local desc = [ Description $(<) ] ;
+    if ! $(desc) { desc = "$(<) plugin" ; }
+    Help $(<) : "Build the $(desc)" ;
+  }
+
+  if ! [ IsElem notest : $(options) ]
+  {
+    # @@@ Disabled for now; see docs/todo_jam.txt
+    #UnitTest $(<) ;
+  }
+}
+
+#----------------------------------------------------------------------------
+# private rules
+
+#  PluginMetaData pluginname : metafile [ : options ]
+#    Copy a plugin's meta file so that it resides alongside the generated
+#    plugin module.  This utility rule may be used by SystemLinkPlugin rules
+#    which employ the default behavior of having a plugin's meta-data file
+#    reside alongside the plugin executable (as opposed to bundling the
+#    metadata directly into the plugin).
+#    Options:
+#      noinstall: Don't setup a default installation target.
+rule PluginMetaData
+{
+  local target = $(>:G=$(GRISTMETA)) ;
+  Depends $(<) : $(target) ;
+  Depends $(target) : $(>) ;
+  MakeLocate $(target) : $(LOCATE.TARGETS) ;
+  Copy $(target) : $(>) ;
+  Clean clean : $(target) ;
+  Clean $(<)clean : $(target) ;
+
+  if ! [ IsElem noinstall : $(3) ]
+  {
+    Depends install_plugin : [ DoInstall $(target) : $(plugindir) ] ;
+  }
+}
+
+# Construct pseudo target plugins
+Depends exe : plugins ;
+NotFile plugins ;
+Help plugins : "Build all plugin modules" ;
diff --git a/mk/jam/property.jam b/mk/jam/property.jam
new file mode 100644 (file)
index 0000000..d095f51
--- /dev/null
@@ -0,0 +1,58 @@
+#==============================================================================
+# Generic property-bag mechanism.
+# Copyright (C) 2004 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#==============================================================================
+
+# Property bag : name
+#   Returns the value of property 'name' in container 'bag' if present, else
+#   returns a null value.  'bag' and 'name' should be simple identifiers
+#   composed of alphanumeric characters and underscore, and with an alphabetic
+#   or an underscore as the first character.
+rule Property
+{
+  local p = [ _PropertyName $(<) : $(>) ] ;
+  return $($(p)) ;
+}
+
+# SetProperty bag : name [ : value ]
+#   Add property 'name' to container 'bag'. If 'value' is not provided, sets
+#   the property to "true".
+rule SetProperty
+{
+  local p = [ _PropertyName $(<) : $(>) ] ;
+  local v = $(3) ;
+  if ! $(v) { v = "true" ; }
+  $(p) = $(v) ;
+}
+
+# ClearProperty bag : name
+#   Remove property 'name' from container 'bag'.
+rule ClearProperty
+{
+  local p = [ _PropertyName $(<) : $(>) ] ;
+  $(p) = "" ;
+}
+
+
+#------------------------------------------------------------------------------
+# Private utilitiy rules.
+#------------------------------------------------------------------------------
+rule _PropertyName
+{
+  return "__property_$(<)_$(>)" ;
+}
diff --git a/mk/jam/resource.jam b/mk/jam/resource.jam
new file mode 100644 (file)
index 0000000..78337f5
--- /dev/null
@@ -0,0 +1,109 @@
+#============================================================================
+# Rules for handling additional resources.
+# Platform-specific Jam files may override these if needed.
+#
+# Copyright (C)2004 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#============================================================================
+
+## ApplicationIconDefault platform : type [ : icon [ : pathcomponents ]]
+##    If invoked with three or more arguments, specifies the default icon for
+##    applications of the specified type for the given platform, which may be
+##    'macosx', 'win32', or 'unix'.  Type should be 'all', 'gui', or 'console'.
+##    If pathcomponents is omitted, SEARCH_SOURCE is used.  This setting can be
+##    overriden for an individual application with the ApplicationIcon rule.
+##    This rule must be invoked before invoking any Application rules if it is
+##    to have any effect.  If invoked with two arguments, returns the default
+##    icon (if any) for the given platform and type.
+rule ApplicationIconDefault
+{
+  local platform = $(1) ;
+  local type = $(2) ;
+  local icon = $(3) ;
+  local iconpath = $(4) ;
+  local key = default_$(platform)_$(type) ;
+
+  if $(icon)
+  {
+    SetProperty appicon : $(key) : $(icon) ;
+    if $(iconpath)
+    {
+      SEARCH on $(icon) = [ ConcatDirs $(iconpath) ] ;
+    }
+    else
+    {
+      SEARCH on $(icon) = $(SEARCH_SOURCE) ;
+    }
+  }
+
+  local result = [ Property appicon : $(key) ] ;
+  if ! $(result) && $(type) != all
+  {
+    result = [ Property appicon : default_$(platform)_all ] ;
+  }
+  return $(result) ;
+}
+
+## ApplicationIcon platform : basename [ : icon [ : pathcomponents ]]
+##    If invoked with three or more arguments, specifies the icon for the
+##    application given by basename for the indicated platform, which may be
+##    'macosx', 'win32', or 'unix'.  If pathcomponents is omitted,
+##    SEARCH_SOURCE is used.  If this rule is not invoked, then the icon
+##    specified via ApplicationIconDefault is used, if any.  This rule must be
+##    invoked before the Application rule to which this icon will apply.  If
+##    invoked with two arguments, returns the icon (if any) explicitly
+##    registered for basename for the given platform.
+rule ApplicationIcon
+{
+  local platform = $(1) ;
+  local target = $(2) ;
+  local icon = $(3) ;
+  local iconpath = $(4) ;
+  local key = app_$(platform)_$(target) ;
+
+  if $(icon)
+  {
+    SetProperty appicon : $(key) : $(icon) ;
+    if $(iconpath)
+    {
+      SEARCH on $(icon) = [ ConcatDirs $(iconpath) ] ;
+    }
+    else
+    {
+      SEARCH on $(icon) = $(SEARCH_SOURCE) ;
+    }
+
+    # An ugly but effective way to detect incorrect usage.
+    if $($(target)_TARGET)
+    {
+      Echo "Warning: `ApplicationIcon:$(target):$(icon)' incorrectly invoked"
+        "after Application rule." ;
+    }
+  }
+
+  return [ Property appicon : $(key) ] ;
+}
+
+##  Win32Resource basename : rcfiles
+##    Specify .rc files for the target known as basename.  The .rc files should
+##    already have SEARCH set appropriately.
+rule Win32Resource { }
+
+##  Win32RcFlags basename : rcfiles
+##    Specify flags passed to the resource compiler when compiling resources
+##    for the target known as basename.
+rule Win32RcFlags { }
diff --git a/mk/jam/static.jam b/mk/jam/static.jam
new file mode 100644 (file)
index 0000000..fcdce54
--- /dev/null
@@ -0,0 +1,353 @@
+#============================================================================
+# Utility rules for static builds without plugins
+# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#============================================================================
+# all private
+
+rule GenerateStaticPluginBoilerplate
+{
+  ResponseFile $(<) :
+    "// This file is automatically generated."
+    "#include \"cssysdef.h\""
+    "#include \"csutil/scf.h\""
+    ""
+    "// Put static linking stuff into own section."
+    "// The idea is that this allows the section to be swapped out but not"
+    "// swapped in again b/c something else in it was needed."
+    "#if !defined(CS_DEBUG) && defined(CS_COMPILER_MSVC)"
+    "#pragma const_seg(\".CSmetai\")"
+    "#pragma comment(linker, \"/section:.CSmetai,r\")"
+    "#pragma code_seg(\".CSmeta\")"
+    "#pragma comment(linker, \"/section:.CSmeta,er\")"
+    "#pragma comment(linker, \"/merge:.CSmetai=.CSmeta\")"
+    "#endif"
+    : notfile ;
+}
+
+rule GenerateStaticPluginInstantiation
+{
+  GenerateStaticPluginBoilerplate $(<) ;
+  ResponseFile $(<) : "SCF_USE_STATIC_PLUGIN($(>:B))" : notfile ;
+}
+
+rule GenerateStaticPluginRegistration
+{
+  GenerateStaticPluginBoilerplate $(<) ;
+  GenerateStaticPluginRegistration1 $(<) : $(>) ;
+}
+
+rule BuildStaticRegFile
+{
+  local statictarget = $(>) ;
+  # prepare source files
+  local sources = [ DoObjectGrist _$(<)_static_reg.cpp ] ;
+  local object = [ CompileObject $(sources) ] ;
+
+  MakeLocate $(sources) : $(LOCATE_TARGET) ;
+  MakeLocate $(object) : $(LOCATE_TARGET) ;
+
+  local metalist metafile i ;
+  for i in $(<)
+  {
+    metafile = $($(i)_METAFILE) ;
+    metalist += $(metafile) ;
+    Depends $(sources) : $(metafile) ;
+  }
+  
+  GenerateStaticPluginRegistration $(sources) : $(metalist) ;
+  Clean $(statictarget)clean : $(sources) ; 
+  Clean $(statictarget)clean : $(object) ; 
+  return $(object) ;
+}
+
+rule BuildStaticUseFile
+{
+  local statictarget = $(2) ;
+  local package = $(3) ;
+  # prepare source files
+  local sources ;
+  if $(3)
+  {
+    sources = [ DoObjectGrist _cs_static_use_$(package).cpp ] ;
+  }
+  else
+  {
+    sources = [ DoObjectGrist _cs_static_use.cpp ] ;
+  }
+  local object = [ CompileObject $(sources) ] ;
+
+  MakeLocate $(sources) : $(LOCATE_TARGET) ;
+  SEARCH on $(sources) = $(LOCATE_TARGET) ;
+  MakeLocate $(object) : $(LOCATE_TARGET) ;
+  
+  C++FLAGS on $(object) += $($($(>).EXTERNALLIBS).CFLAGS) ;
+
+  GenerateStaticPluginInstantiation $(sources) : $(<) ;
+  Clean $(statictarget)clean : $(sources) ; 
+  Clean $(statictarget)clean : $(object) ; 
+  return $(object) ;
+}
+
+##  LinkStaticPlugins target : plugins [: optionalplugins] [: package]
+##    Builds the plugins in 'plugins' (and 'optionalplugins') statically into 
+##    'target'. Can be used both for static plugins from the local project or
+##    an external project. In the latter case, the project's static plugin
+##    library has to have been built, also, the "<package>.STATICDEPS" 
+##    variable must contain a path to a specially generated Jamfile that 
+##    contains information about the plugins provided by as well as external
+##    dependencies. The static plugins library for both local and external 
+##    package must be explicitly linked into 'target'.
+rule LinkStaticPlugins
+{
+  local package target plugins optplugins ;
+  # Fetch the parameters
+  target = $(1) ;
+  plugins = $(2) ;
+  optplugins = $(3) ;
+  package = $(4) ;
+  
+  if $(package)
+  {
+    # External static plugins.
+    # First include static plugin info
+    if ! $(HAVE_STATICDEPS.$(package))
+    {
+      include $($(package).STATICDEPS) ;
+      HAVE_STATICDEPS.$(package) = yes ;
+    }
+    local lflags p ;
+    # Collect optional plugins
+    for p in $(optplugins)
+    {
+      if [ IsElem $(p) : $(STATICPLUGINS.AVAILABLE) ]
+      {
+       plugins += $(p) ;
+      }
+    }
+    # Grab flags
+    for p in $(plugins)
+    {
+      NotFile $(p) ;
+      CFlags $(target) : $(STATICPLUGIN.$(p).CFLAGS) ;
+      lflags = [ MergeLFlags $(lflags) : $(STATICPLUGIN.$(p).LFLAGS) ] ;
+    }
+    LFlags $(target) : $(lflags) ;
+  }
+  else
+  {
+    # Local static plugins
+    local lflags libs p ;
+    # Collect optional plugins
+    for p in $(optplugins)
+    {
+      if $($(p)_TARGET)
+      {
+       plugins += $(p) ;
+      }
+    }
+    # Grab flags
+    for p in $(plugins)
+    {
+      lflags += [ Filter $($(p).LFLAGS) : $(LINKLIBS) $(PLUGIN.LFLAGS) ] ;
+      libs += $($(p).NEEDLIBS) ;
+    }
+    LFlags $(target) : [ Reverse [ RemoveDups [ Reverse $(lflags) ] ] ] ;
+    LinkWith $(target) : [ Reverse [ RemoveDups [ Reverse $(libs) ] ] ] ;
+  }
+  
+  # construct initialization sourcefile
+  local staticobject = [ BuildStaticUseFile $(plugins) : $(target) : $(package) ] ;
+  ExtraObjects $(target) : $(staticobject) : inheritcflags ;
+}
+
+##  StaticPluginLibrary name [: rejects]
+##    Create a library that monolithically contains statically linkable 
+##    versions of all plugins, and also provides a target to install this
+##    library ("install_staticplugins") as well as resources to facilitate the
+##    use of that library from external projects. Also, most plugins will
+##    probably themselves depend on other libraries; while those are correctly
+##    linked in with the static plugins, they are not built or installed when
+##    the static plugin library is.
+##    This library is intended to be used together with the 
+##    "LinkStaticPlugins" rule.
+rule StaticPluginLibrary
+{
+  local name = $(<) ;
+  local rejects = $(>) ;
+  local t ;
+
+  local targets = $(STATICPLUGINS.SUBTARGETS) ;
+  if $(rejects)
+  {
+    targets = [ Filter $(targets) : $(rejects) ] ;
+  }
+  local objects ;
+  for t in $(targets)
+  {
+    objects += $(STATICPLUGINS.OBJECTS.$(t)) ;
+  }
+  
+  # Set up library
+  Library $(name) : $(objects) : noinstall notest independent nohelp ;
+  SEARCH on $(name) += $(LOCATE_TARGET) ;
+  MsvcDefine $(name) : $(STATICPLUGINS.MSVC_DEFINES) ;
+  CFlags $(name) : 
+    [ FDefines CS_STATIC_LINKED ] 
+    : nostatic ;
+  
+  # Copy a variety of flags
+  local o ;
+  for o in $(objects)
+  {
+    local sourceobj = $(STATICPLUGINS.OBJECTS.$(o)) ;
+    if $(sourceobj)
+    {
+      CCFLAGS on $(o) += [ on $(sourceobj) GetVar CCFLAGS ] ;
+      C++FLAGS on $(o) += [ on $(sourceobj) GetVar C++FLAGS ] ;
+    }
+  }
+
+  # Write out needed CFLAGS, LFLAGS
+  STATICPLUGINS.DEPENDENCIES = $(name).jam ;
+  MakeLocate $(STATICPLUGINS.DEPENDENCIES) : $(LOCATE.OBJECTS)/libs ;
+  for t in $(targets)
+  {
+    WriteDependencies $(STATICPLUGINS.DEPENDENCIES) : $(t) : $(name) ;
+  }
+  Depends $(name) : $(STATICPLUGINS.DEPENDENCIES) ;
+  Clean $(name)clean : $(STATICPLUGINS.DEPENDENCIES) ;
+  # Install targets
+  Depends install_staticplugins : 
+    [ DoInstall [ ConstructLibraryTarget $(name) ] : $(libdir) ] ;
+  Depends install_staticplugins : $(STATICPLUGINS.DEPENDENCIES) ;
+  Depends install_staticplugins : 
+    [ DoInstall $(STATICPLUGINS.DEPENDENCIES) : $(libdir) ] ;
+  Depends install_staticplugins : install_libs ;
+    
+  INSTALLEDLIBS_OPTIONAL += $(name) ;
+  
+  # Collect library dependencies. The idea is to built all libs needed by the
+  # static plugins when "jam staticplugins" is invoked.
+  for t in $(targets)
+  {
+    local deplibs ;
+    if $($(t).NEEDLIBS)
+    {
+      deplibs += $($(t).NEEDLIBS) ;
+    }
+    deplibs = [ RemoveDups $(deplibs) ] ;
+    Depends staticplugins : $(deplibs) ;
+  }  
+  Help staticplugins : 
+    "Build the library with static versions of all plugins" ;
+  Depends staticplugins : libs $(name) ;
+}
+
+#----------------------------------------------------------------------------
+
+# Write out CFLAGS, LFLAGS needed by a plugin
+rule WriteDependencies
+{
+  local cflags ;
+  local lflags ;
+  local depfile = $(<) ;
+  local plugin = $(>) ;
+  local name = $(3) ;
+  local depfile_gristed = $(depfile:G=$(plugin)) ;
+  MakeLocate $(depfile_gristed) : [ on $(depfile) GetVar LOCATE ] ;
+  
+  # Collect flags
+  lflags += -l$(name) ;
+  local libs = [ ResolveLibs $($(plugin).NEEDLIBS) ] ;
+  lflags += -l$(libs) ;
+  
+  local l ;
+  for l in $($(plugin).EXTERNALLIBS)
+  {
+    cflags += $($(l).CFLAGS) ;
+    lflags += [ Filter $($(l).LFLAGS) : $(LINKLIBS) $(PLUGIN.LFLAGS) ] ;
+  }
+  lflags += [ Filter $($(plugin).LFLAGS) : $(LINKLIBS) $(PLUGIN.LFLAGS) ] ;
+  CFLAGS on $(depfile_gristed) = "$(cflags)" ;
+  LFLAGS on $(depfile_gristed) = "$(lflags)" ;
+  
+  if $($(depfile).FIRSTTIME) != "yes"
+  {
+    WriteDepFlags1 $(depfile_gristed) : $(plugin) ;
+    $(depfile).FIRSTTIME = "yes" ;
+  }
+  else
+  {
+    WriteDepFlags2 $(depfile_gristed) : $(plugin) ;
+  }
+  Depends $(depfile) : $(depfile_gristed) ;
+}
+
+actions WriteDepFlags1 
+{
+  cat << EOT > $(<)
+STATICPLUGINS.AVAILABLE += $(>) ;
+STATICPLUGIN.$(>).CFLAGS = $(CFLAGS) ;
+STATICPLUGIN.$(>).LFLAGS = $(LFLAGS) ;
+EOT
+}
+
+actions WriteDepFlags2 
+{
+  cat << EOT >> $(<)
+STATICPLUGINS.AVAILABLE += $(>) ;
+STATICPLUGIN.$(>).CFLAGS = $(CFLAGS) ;
+STATICPLUGIN.$(>).LFLAGS = $(LFLAGS) ;
+EOT
+}
+
+actions piecemeal GenerateStaticPluginRegistration1
+{
+  echo 'namespace csStaticPluginInit' >> $(<)
+  echo '{' >> $(<)
+  for x in $(>)
+  do
+    n=`basename $x $(SUFMETA)`
+    echo "static char const metainfo_${n}[] =" >> $(<)
+    $(SED) 's:\\:\\\\:g;s:":\\":g;s:\(.*\):"\1":' < $x >>$(<)
+    echo ";" >> $(<)
+    $(SED) '/<implementation>/!d;s:[   ]*<implementation>\(..*\)</implementation>:  #ifndef \1_FACTORY_REGISTER_DEFINED \
+  #define \1_FACTORY_REGISTER_DEFINED \
+    SCF_DEFINE_FACTORY_FUNC_REGISTRATION(\1) \
+  #endif:g' < $x >> $(<)
+  done
+  echo '' >> $(<)
+  for x in $(>)
+  do
+    n=`basename $x $(SUFMETA)`
+    echo "class ${n}" >> $(<)
+    echo "{" >> $(<)
+    echo "SCF_REGISTER_STATIC_LIBRARY($n,metainfo_${n})" >>$(<)
+    $(SED) '/<implementation>/!d;s:[   ]*<implementation>\(..*\)</implementation>:  #ifndef \1_FACTORY_REGISTERED \
+  #define \1_FACTORY_REGISTERED \
+    \1_StaticInit \1_static_init__; \
+  #endif:g' < $x >> $(<)
+    echo "public:" >> $(<)
+    echo " ${n}();" >> $(<)
+    echo "};" >> $(<)
+    echo "$n::$n() {}" >> $(<)
+    echo "" >> $(<)
+  done
+  echo '}' >> $(<)
+}
diff --git a/mk/jam/strip.jam b/mk/jam/strip.jam
new file mode 100644 (file)
index 0000000..6b51b9e
--- /dev/null
@@ -0,0 +1,36 @@
+#============================================================================
+# Rules for stripping binaries
+# Copyright (C)2006 by Frank Richter
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#============================================================================
+
+##  SplitDebugInfo binary
+##    Strips the debugging information into a separate external file.
+rule SplitDebugInfo
+{
+  local binary = $(1) ;
+  DoSplitDebugInfo $(binary) ;
+  return $(binary).dbg ;
+}
+
+actions DoSplitDebugInfo
+{
+  $(CMD.OBJCOPY) --only-keep-debug $(<) $(<).dbg
+  $(CMD.OBJCOPY) --strip-unneeded $(<)
+  $(CMD.OBJCOPY) --add-gnu-debuglink=$(<).dbg $(<)
+  if [ "$(CHMOD)" ] ; then $(CHMOD) a-x $(<).dbg ; fi
+}
diff --git a/mk/jam/subdir.jam b/mk/jam/subdir.jam
new file mode 100644 (file)
index 0000000..4f7d231
--- /dev/null
@@ -0,0 +1,109 @@
+#============================================================================
+# Work around problems the SubDir rule of Jambase
+#      (until jampeople accept my patches :-/ )
+# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#============================================================================
+
+LOCATE.OBJECTS ?= $(BUILDTOP)/out/$(OSFULL[1]:L) ;
+LOCATE.TARGETS ?= $(BUILDTOP) ;
+LOCATE.DOCS ?= $(BUILDTOP)/out/docs ;
+
+SUBDIRRULES += FixSubDirPath ;
+
+CMD.MKDIR ?= mkdir ;
+CMD.MKDIRS ?= "$(CMD.MKDIR) -p" ;
+
+rule FixSubDirPath
+{
+    LOCATE_SOURCE = [ FDirName $(LOCATE.OBJECTS) $(SUBDIR_TOKENS) ] ;
+    LOCATE_TARGET = [ FDirName $(LOCATE.OBJECTS) $(SUBDIR_TOKENS) ] ;
+}
+
+# Fix bug in Jambase where SubInclude in the middle of a Jamfile made it break.
+rule SubInclude
+{
+    if ! $($(<[1]))
+    {
+        Exit SubInclude $(<[1]) without prior SubDir $(<[1]) ;
+    }
+
+    local save_SUBDIR_TOKENS = $(SUBDIR_TOKENS) ;
+
+    SubDir $(<) ;
+
+    include $(JAMFILE:D=$(SUBDIR)) ;
+
+    SubDir $(<[1]) $(save_SUBDIR_TOKENS) ;
+}
+
+# This MakeLocate rule differs from the Jambase one in that it also works with
+# files being in subdirectories.
+rule MakeLocate
+{
+    # MakeLocate targets : directory ;
+
+    # Sets special variable LOCATE on targets, and arranges
+    # with MkDir to create target directory.
+
+    # Note we grist the directory name with 'dir',
+    # so that directory path components and other
+    # targets don't conflict.
+
+    if $(>) && $(>) != ""
+    {
+        local i ;
+        for i in $(<)
+       {
+            LOCATE on $(i) = $(>) ;
+
+            local targetfile = $(i:R=$(>)) ;
+           local targetdir = $(targetfile:D) ;
+           if ! $(targetdir) { targetdir = "." ; }
+           targetdir = $(targetdir:G=dir) ;
+            Depends $(i) : $(targetdir) ;
+            MkDir $(targetdir) ;
+        }
+    }
+}
+
+# The default MkDir rule in Jambase has problems when paths contains a sequence
+# of multiple slashes (ie. bla////fup). We solve these problems and greatly
+# simply this rule by using the "mkdir -p" or mkdirs command.
+rule MkDir
+{
+    # MkDir directory ;
+
+    # Make a directory and all its parent directories.
+
+    # Ignore timestamps on directories: we only care if they
+    # exist.
+
+    NoUpdate $(<) ;
+
+    # don't create the dir multiple times
+    if ! $($(<)-mkdir)
+    {
+        $(<)-mkdir = true ;
+        MkDir1 $(<) ;
+    }
+}
+
+actions MkDir1
+{
+        $(CMD.MKDIRS) "$(<)"
+}
diff --git a/mk/jam/swig.jam b/mk/jam/swig.jam
new file mode 100644 (file)
index 0000000..6d340a1
--- /dev/null
@@ -0,0 +1,225 @@
+#============================================================================
+# Rules for swig
+# Copyright (C)2004 by Eric Sunshine <sunshine@sunshineco.com>
+# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#============================================================================
+
+if $(CMD.SWIG)
+{
+  # Post-processing of the Swig-generated C++ file.
+  #
+  # (1) We need to ensure that <stdint.h> defines INT64_C() and cousins, which
+  # means that the __STDC_CONSTANT_MACROS and __STDC_LIMIT_MACROS macros must
+  # be defined before <stdint.h> is included.  In some Python installations,
+  # Python.h includes <stdint.h>, and Swig-generated output includes Python.h
+  # before we ever have a chance to define the __STDC_* macros.  There is no
+  # Swig-supported mechanism allowing us to insert these #defines before
+  # Python.h is included, so we post-process the output file.
+  #
+  # (2) We #undefine _DEBUG, to ensure that python23.lib is used by MSVC
+  # instead of python23_d.lib.
+  #
+  # (3) Delete any lines containing the CVS `Header' keyword to ensure that CVS
+  # does not consider the file changed simply because `Header' expansion
+  # differs.
+  #
+  # (4) Swig 1.3.22 for Perl emits illegal expressions `new (sometype)[n]'
+  # rather than `new sometype[n]' (at least gcc considers it illegal),
+  # therefore, we transform the expression by dropping the parentheses.
+  #
+  # (5) cs_pyth.cpp contains a macro "#define SWIG_init init_cspace". However,
+  # cs_pyth.cpp may reside in a shared lib, so we rather want the name 
+  # SWIG_init and define init_cspace as a simple forwared ourselves.
+  #
+  # (6) perl.h includes dirent.h on some configurations which conflicts with
+  # the CS definitions of dirent, opendir, etc.  So define _DIRENT_H_ to 
+  # make dirent.h skip its body.  This is hackish but no better solution
+  # has been found.
+  #
+  # (Despite the fact that these customizations might seem project-specific,
+  # they should be safe for all projects.)
+  SWIG.SED_SCRIPT =
+    "'s/\\([   ]*#[    ]*include[      ][      ]*[<\"]Python.h[>\"]\\)/\\
+    #ifndef __STDC_CONSTANT_MACROS\\
+    #define __STDC_CONSTANT_MACROS\\
+    #endif\\
+    #ifndef __STDC_LIMIT_MACROS\\
+    #define __STDC_LIMIT_MACROS\\
+    #endif\\
+    #ifndef DEBUG_PYTHON\\
+    #undef _DEBUG\\
+    #endif\\
+    \\1/g
+    /\$Header:/d
+    s/new[     ][      ]*(\\([^)][^)]*\\))[    ]*\\[/new \\1 [/g
+    s/[        ]*#[    ]*define[       ][      ]*SWIG_init[    ]*init_\\(.*\\)/#define SWIG_init SWIG_init_\\1/g
+    s/\\([      ]*#[    ]*include[      ][      ]*[<\"]perl.h[>\"]\\)/\\
+    #ifndef _DIRENT_H_\\
+    #define _DIRENT_H_\\
+    #endif\\
+    \\1/g'" ;
+
+  ## Swig targets : swigfile : language [ : swigflags [ : swigincdirs
+  ##     [ : swigfiledir [ : frozendirs [ : tag [ : outdir ]]]]]]
+  ##   Given a Swig input file `swigfile', generate `targets' for scripting
+  ##   language `language'.  The first element of `targets' should name the
+  ##   generated C or C++ file, and the remaining optional elements should name
+  ##   any other language-specific scripting files which Swig will generate.
+  ##   For instance, the files widgets.cpp and widgets.py might be emitted by
+  ##   Swig for the input file widgets.i.  The generated files are placed in
+  ##   $(LOCATE_TARGET).  `swigflags' specifies additional flags to pass to
+  ##   Swig.  `swigincdirs' is a list of additional directories which Swig
+  ##   should search for files which it includes.  `swigfiledir' specifies the
+  ##   location of `swigfile' if it does not reside in the present source
+  ##   directory.  This rule defines top-level targets named "$(tag)swig",
+  ##   which generates `targets' on-demand; and "$(tag)swigclean", which
+  ##   deletes the generated files.  `tag' is a simple identifier out of which
+  ##   top-level pseudo-targets names are constructed.  If `tag' is not
+  ##   provided, then `language' is used instead.  If `frozentargdirs' is
+  ##   provided, then an additional top-level target named "$(tag)freeze" is
+  ##   defined, which copies the generated files to the specified directories.
+  ##   If `frozentargdirs' contains only one element, then all generated files
+  ##   are copied to that directory.  If it contains two elements, then the
+  ##   first element of `targets' is copied to the first element of
+  ##   `frozentargdirs', and all remaining elements of `targets' are copied to
+  ##   the second element of `frozentargdirs'. `outdir', if provided, is a list
+  ##   of path components which specify a subdirectory in which Swig should
+  ##   place the language-specific support files, rather than placing them in
+  ##   $(LOCATE_TARGET).  This might be useful, for instance, when Swig is in
+  ##   Java mode, and the .java files must be placed in a directory hierarchy
+  ##   which reflects the full package name.
+  rule Swig
+  {
+    local target = $(1[1]) ;
+    local othertargets = $(1[2-]) ;
+    local swigfile = $(2) ;
+    local language = $(3) ;
+    local swigflags = $(4) ;
+    local swigincdirs = $(5) ;
+    local swigfiledir = $(6) ;
+    local frozentargetdir = $(7[1]) ;
+    local frozenotherdir = $(7[2-]) ;
+    local tag = $(8) ;
+    local outdir = $(9) ;
+
+    if ! $(frozenotherdir) { frozenotherdir = $(frozentargetdir) ; }
+    if ! $(tag) { tag = $(language) ; }
+    if ! $(outdir) { outdir = $(LOCATE_TARGET) ; }
+
+    Depends $(target) : $(swigfile) ;
+    MakeLocate $(target) : $(LOCATE_TARGET) ;
+    if $(othertargets)
+    {
+      MakeLocate $(othertargets) : $(outdir) ;
+
+      # If any target, such as an install target, depends upon the other files,
+      # we force them to be built with a dependency upon the target.
+      Depends $(othertargets) : $(target) ;
+    }
+
+    SWIG.FLAGS on $(target) +=
+      $(SWIG.FLAGS) -$(language) $(swigflags) -I$(swigincdirs)
+      -outdir [ ConcatDirs $(outdir) ] ;
+
+    # Allow Swig input file to reside at location other than $(SEARCH_SOURCE).
+    if $(swigfiledir)
+    {
+      SEARCH on $(swigfile) = $(swigfiledir) ;
+    }
+    else
+    {
+      SEARCH on $(swigfile) = $(SEARCH_SOURCE) ;
+    }
+
+    # Scan for special Swig includes.
+    HDRGRIST on $(swigfile) = $(HDRGRIST) ;
+    HDRSEARCH on $(swigfile) =
+      $(SEARCH_SOURCE:E) $(SUBDIRHDRS) $(HDRS) $(STDHDRS) ;
+    HDRRULE on $(swigfile) = HeaderRule ;
+    HDRSCAN on $(swigfile) = $(SWIG.HDRPATTERN) ;
+
+    RunSwig $(target) : $(swigfile) ;
+    Depends $(tag)swig : $(target) ;
+    NotFile $(tag)swig ;
+    Always $(tag)swig ;
+    Help $(tag)swig : "Generate Swig files for $(tag)" ;
+
+    Clean $(tag)swigclean : $(target) $(othertargets) ;
+    Depends clean : $(tag)swigclean ;
+
+    if $(frozentargetdir)
+    {
+      local frozen_target = $(target:G=$(tag)freeze) ;
+      MakeLocate $(frozen_target) : $(frozentargetdir) ;
+      Depends $(frozen_target) : $(target) ;
+      Copy $(frozen_target) : $(target) ;
+      Depends $(tag)freeze : $(frozen_target) ;
+
+      if $(othertargets)
+      {
+        local frozen_other = $(othertargets:G=$(tag)freeze) ;
+        MakeLocate $(frozen_other) : $(frozenotherdir) ;
+        Depends $(frozen_other) : $(othertargets) ;
+        Copy $(frozen_other) : $(othertargets) ;
+        Depends $(tag)freeze : $(frozen_other) ;
+      }
+
+      NotFile $(tag)freeze ;
+      Help $(tag)freeze : "Copy generated Swig files to source directory" ;
+    }
+  }
+
+  actions RunSwig
+  {
+    $(CMD.SWIG) $(SWIG.FLAGS) -o $(<) $(>)
+    $(SED) $(SWIG.SED_SCRIPT) < $(<) > $(<).sed
+    $(RM) $(<)
+    $(MV) $(<).sed $(<)
+  }
+
+  SWIG.SIMPLE.LANGUAGE ?= python ;
+  SWIG.SIMPLE.EXT ?= py ;
+  SWIG.SIMPLE.FLAGS ?= -c++ -shadow ;
+
+  ## SimpleSwig swigfile
+  ##   Given a Swig input file (.i), invokes Swig to generate a .cpp file with
+  ##   the same basename, and a script file with the same basename.
+  ##   SWIG.SIMPLE.LANGUAGE specifies the language for which Swig should emit a
+  ##   binding; SWIG.SIMPLE.EXT indicates the file extension of the generated
+  ##   script file; SWIG.SIMPLE.FLAGS specifies additional flags for Swig.
+  rule SimpleSwig
+  {
+    local object = [ DoObjectGrist $(<:S=$(SUFOBJ)) ] ;
+    local cppfile = $(<:S=.cpp) ;
+    local script = $(<:S=.$(SWIG.SIMPLE.EXT)) ;
+
+    C++ $(object) : $(cppfile) ;
+    Swig $(cppfile) $(script) : $(<) : $(SWIG.SIMPLE.LANGUAGE) :
+      $(SWIG.SIMPLE.FLAGS) ;
+
+    return $(object) ;
+  }
+  RegisterFileType SimpleSwig : .i ;
+
+  if ! $(NO_SWIG_HEADER_SCANNING)
+  {
+    SWIG.HDRPATTERN =
+      "^[      ]*[%#][         ]*include[      ]*[<\"]([^\">]*)[\">].*$" ;
+    RegisterHeaderRule HeaderRule : $(SWIG.HDRPATTERN) : .i ;
+  }
+}
diff --git a/mk/jam/unittest.jam b/mk/jam/unittest.jam
new file mode 100644 (file)
index 0000000..f871865
--- /dev/null
@@ -0,0 +1,576 @@
+#==============================================================================
+# Jam rules for unit testing with CppTest (http://cpptest.sourceforge.net/)
+# Copyright (C) 2005 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#==============================================================================
+if $(CPPUNIT.AVAILABLE) = yes
+{
+
+UNITTEST_VERBOSE ?= yes ;
+UNITTEST_RUNFLAGS ?= ;
+if $(UNITTEST_VERBOSE) = yes
+{
+  UNITTEST_RUNFLAGS += "--verbose" ;
+}
+
+## UnitTest module [ : testdirs [ : extensions ] ]
+##
+## This rule provides a dynamic unit testing framework which utilizes CppUnit
+## (http://cpptest.sourceforge.net/).  The invocation:
+##
+##    UnitTest <module> ;
+##
+## sets up unit testing support for `module' if $(SUBDIR)/t/ exists for
+## `module' and contains test fragment files (*.t) and/or header (*.h) files.
+## If `testdirs' is provided, then it is a list of directory to scan for test
+## fragments instead of `t/'. If `extensions' is provided, then it is a list of
+## file extensions for which to search instead of `.t'.
+##
+## It is safe to invoke this rule for modules which do not have a `t/'
+## subdirectory, in which case the rule invocation is silently ignored. The
+## UnitTest rule automatically synthesizes an appropriate driver program which
+## incorporates the test fragment files (*.t), thus eliminating a boring and
+## error-prone task.
+##
+## The Application, Library, and Plugin rules automatically invoke UnitTest on
+## behalf of the client (unless given the `notest' option), so the vast
+## majority of modules in a project inherit unit testing support automatically
+## and for free. Simply populating a `t/' subdirectory with unit testing
+## fragment files (*.t) is typically all that is needed to enable unit testing
+## for an application, library, or plugin.
+##
+## The unit testing Jam target for `module' is named "check_module". In
+## addition to this module-level granularity, the UnitTest rule also provides
+## dynamic directory-based granularity. For example, presume that the following
+## abbreviated list of directories exist in a project tree:
+##
+##     apps/example
+##     libs/common
+##     plugins/bindings/perl_b
+##     plugins/bindings/python_b
+##     plugins/bindings/ruby_b
+##
+## The following module-based unit testing Jam targets will be created
+## (assuming that the appropriate test fragment files, $(SUBDIR)/t/*.t, exist
+## in each directory):
+##
+##     check_example
+##     check_common
+##     check_perl_b
+##     check_python_b
+##     check_ruby_b
+##
+## Furthermore, the following directory-based targets also will be created
+## dynamically:
+##
+##     check (and its alias check_all)
+##     check_apps
+##     check_apps_example
+##     check_libs
+##     check_libs_common
+##     check_plugins
+##     check_plugins_bindings
+##     check_plugins_bindings_perl_b
+##     check_plugins_bindings_python_b
+##     check_plugins_bindings_ruby_b
+##
+## The very neat thing about the directory-based targets is that they
+## automatically synthesize a driver program which incorporates all of the
+## tests contained in child directories. For instance, the `check_plugins'
+## target creates a unit testing driver which incorporates the tests from the
+## bindings/perl_b/t, bindings/python_b/t, and bindings/ruby_b/t directories;
+## and the `check_all' target creates a driver which incorporates all tests in
+## the entire project. This allows entire selected branches of tests to be run
+## all at once rather than having to run several different driver programs to
+## get a complete report.
+##
+## The unit testing framework automatically wraps each test fragment file (*.t)
+## into a synthesized C++ source file containing CppUnit boilerplate, such as
+## necessary #include directives, #defines, etc.  This allows the fragment
+## files to be as simple as possible. They need #include only headers related
+## to the actual module being tested, but need not worry about setting up the
+## CppUnit environment since that is done automatically.  A typical fragment
+## file might look like this:
+##
+##     /* Test file: libs/common/t/array.t */
+##
+##     #include "common/myarray.h"
+##
+##     class MyArrayTest : public CppUnit::TestFixture
+##     {
+##     public:
+##       void setUp()      { ...set up test data... }
+##       void tearDown()   { ...destroy test data... }
+##
+##       void testInsert() { ...test array insertion methods... }
+##       void testDelete() { ...test array deletion methods... }
+##
+##       CPPUNIT_TEST_SUITE(MyArrayTest);
+##         CPPUNIT_TEST(testInsert);
+##         CPPUNIT_TEST(testDelete);
+##       CPPUNIT_TEST_SUITE_END();
+##     };
+##
+## When the UnitTest rule synthesizes C++ wrappers for the test fragments, it
+## needs to figure out the names of classes which contain tests. The synthesis
+## process makes this determination by examining *.t and *.h files for
+## subclasses of CppUnit::TestFixture. For this to work correctly, the
+## "class Foo : public CppUnit::TestFixture" declaration must not be split over
+## multiple lines.
+##
+## It is possible to have extra text added at the beginning and end of the
+## synthesized C++ source code for both the *.t wrappers and the driver
+## programs by optionally defining the following Jam variables (perhaps in
+## Jamrules) with whatever text you would like inserted into the synthesized
+## files:
+##
+##     UNITTEST_BOILERPLATE_TEST_PRE
+##     UNITTEST_BOILERPLATE_TEST_POST
+##     UNITTEST_BOILERPLATE_MAIN_PRE
+##     UNITTEST_BOILERPLATE_MAIN_POST
+##
+## Thest `TEST' variables apply to the *.t wrappers, and the `MAIN' variables
+## apply to the driver programs into which the wrappers are linked. If you find
+## that you are including common code in all of your *.t files, then you may
+## want to simplify by propagating the common code to the `TEST' boilerplate
+## instead.
+##
+rule UnitTest
+{
+  local mod = $(1) ;
+  local testdirs = $(2) ;
+  local exts = $(3) ;
+  if ! $(testdirs) { testdirs = t ; }
+  if ! $(exts) { exts = .t ; }
+
+  local test_clean = [ UnitTestNameClean $(mod) ] ;
+  local oldsubdir = $(SUBDIR_TOKENS) ;
+
+  local testdir ;
+  for testdir in $(testdirs)
+  {
+    SubDir TOP $(oldsubdir) $(testdir)  ;
+
+    local tests_obj ;
+    local tests   = [ Recurse : $(exts) ] ;
+    local headers = [ Recurse : .h .hpp .hxx .H ] ;
+    if $(tests) || $(headers)
+    {
+      tests = [ DoSourceGrist $(tests) ] ;
+      SEARCH on $(tests) = $(SEARCH_SOURCE) ;
+
+      local tests_src = $(tests:S=.cpp) ;
+      MakeLocate $(tests_src) : $(LOCATE_TARGET) ;
+      Clean $(test_clean) : $(tests_src) ;
+
+      # For each fragment (*.t), create a C++ wrapper. Automatically register
+      # subclasses of CppUnit::TestFixture.
+      local i ;
+      for i in $(tests)
+      {
+       Includes $(i:S=.cpp) : $(i) ;
+       UnitTestSource $(i:S=.cpp) : $(i) ;
+      }
+
+      # Also search for CppUnit::TestFixture subclasses in headers (*.h) and
+      # synthesize a C++ wrapper which registers them.
+      if $(headers)
+      {
+       headers = [ DoSourceGrist $(headers) ] ;
+       SEARCH on $(headers) = $(SEARCH_SOURCE) ;
+       local suitereg = [ DoSourceGrist __suitereg.cpp ] ;
+       MakeLocate $(suitereg) : $(LOCATE_TARGET) ;
+       UnitTestSource $(suitereg) : $(headers) ;
+       Includes $(suitereg) : $(headers) ;
+       tests_src += $(suitereg) ;
+      }
+
+      # Compile all synthesized sources.
+      tests_obj = [ CompileObjects $(tests_src) ] ;
+      CCHDRS on $(tests_obj) += [ FIncludes $(SEARCH_SOURCE) ] ;
+      C++FLAGS on $(tests_obj) += $(COMPILER.C++FLAGS.EXCEPTIONS.ENABLE)
+       $(CPPUNIT.CFLAGS) ;
+      Clean $(test_clean) : $(tests_obj) ;
+
+      # Create the driver for "check_module".
+      UnitTestDriver $(mod) : $(tests_obj) ;
+      # Dynamically create the drivers for all parent directories.
+      UnitTestDynamicTargets $(mod) : $(tests_obj) : $(oldsubdir) ;
+    }
+  }
+
+  SubDir TOP $(oldsubdir) ;
+}
+
+#------------------------------------------------------------------------------
+# PRIVATE UTILITY RULES
+#------------------------------------------------------------------------------
+
+# UnitTestDriver module : objs [ : owner ]
+#   Given a set of object files which represent test fragment wrappers for
+#   `module', set up the driver program which incorporates them, and create the
+#   "check_module" and "check_moduleclean" targets. For invocations which arise
+#   from the UnitTest rule, `module' will be the actual module for which
+#   testing is being arranged, and `objs' will be the complete set of test
+#   objects for `module'. For directory-based testing drivers, `module' will be
+#   the dynamically synthesized module name representing the directory for
+#   which testing is being arranged, and `objs' will be only a subset of all
+#   objects which ultimately will be incorporated into this synthesized driver
+#   (specifically, the subset will be the objects belonging to `owner'). This
+#   rule may be invoked multiple times for the same synthesized directory-based
+#   driver `module' in order to accumulate the object files from all child
+#   directories (recursively).
+#
+#   Since the driver programs in parent directories are actually conglomerates
+#   of the objects from many different modules, this rule is invoked multiple
+#   times for any given directory-based driver program. Each invocations
+#   presents it with a different set of object files. Therefore, it must take
+#   special care. In particular, the first time this rule is invoked for a
+#   synthesized driver in a particular directory, it actually creates the
+#   application target; on subsequent invocations for the same directory, it
+#   merely adds `objs' to the already-created application target.  This way,
+#   the a directory's dynamically synthesized driver program can incorporate
+#   objects from all of its child directories (recursively).
+#
+#   The `owner' is the module which owns the object files, `objs'. In the
+#   example illustrated for the UnitTest rule, when the "check_libs" driver
+#   program is under creation from within the `UnitTest common' invocation, the
+#   owner will be "common". This information is needed in order to ensure that
+#   the driver program synthesized at the "libs" level, which incorporates
+#   "common"'s object files, can gain access to "common's" linker flags (since
+#   they will be needed for linking the directory-based driver). If `owner' is
+#   not provided, then it defaults to `module'.
+rule UnitTestDriver
+{
+  local mod = $(1) ;
+  local objs = $(2) ;
+  local owner = $(3) ;
+  if ! $(owner) { owner = $(mod) ; }
+
+  local test_name  = [ UnitTestNameTest  $(mod) ] ;
+  local test_clean = [ UnitTestNameClean $(mod) ] ;
+
+  # This is the low-level target name by which a unit testing driver program is
+  # known. We only create the target the first time we are called at a
+  # particular directory level (thus the module_UNITTESTS check). Upon
+  # subsequent invocations, we merely add the new objects files to the existing
+  # driver.
+
+  local test_driver = $(mod)_unittest ;
+  if ! $($(mod)_UNITTESTS)
+  {
+    $(mod)_UNITTESTS = $(test_driver) ;
+
+    # Create the actual driver program represented by the `test_driver' target.
+    local test_driver_target =
+      [ DoObjectGrist [ ConstructApplicationTarget __unittest : console ] ] ;
+    MakeLocate $(test_driver_target) : $(LOCATE_TARGET) ;
+    $(test_driver)_TYPE = application ;
+    $(test_driver)_TARGET = $(test_driver_target) ;
+    $(test_driver)_OBJECTS = $(objs) ;
+    SystemLinkApplication $(test_driver) : $(objs) [ UnitTestCommonObj ] :
+      console ;
+    CFlags $(test_driver) : $(APPLICATION.CFLAGS) ;
+    LFlags $(test_driver) : $(LINKLIBS) $(APPLICATION.LFLAGS)
+      $(CPPUNIT.LFLAGS) ;
+
+    Depends $(test_name) : $(test_driver_target) ;
+    Clean $(test_clean) : $(test_driver_target) ;
+
+    # Actually run the unit tests.
+    NotFile $(test_name) $(test_clean) ;
+    Always  $(test_name) $(test_clean) ;
+    Depends checkclean : $(test_clean) ;
+    UnitTestRun $(test_name) : $(test_driver_target) ;
+  }
+  else
+  {
+    ExtraObjects $(test_driver) : $(objs) ;
+  }
+
+  # Apply appropriate linker flags to the driver program. This has two parts:
+  # (1) If these are the unit tests for a library, then, as a convenience,
+  #     assume that the tests need to link against that library.
+  # (2) For directory-based test targets, the driver needs all of the linker
+  #     flags required by its child directories (recursively). For example, in
+  #     the earlier cited illustration, the "check_all", and "check_libs"
+  #     targets will also need whatever linker flags libs/common itself
+  #     requires.
+
+  if $($(owner)_TYPE) = library { LinkWith $(test_driver) : $(owner) ; }
+  LinkWith $(test_driver) : [ on $($(owner)_TARGET) GetVar NEEDLIBS ] ;
+
+  return $(test_driver) ;
+}
+
+# UnitTestCommonObj
+#   Create object files common to all driver programs. Presently, the only
+#   common component is the main() function, which utilizes CppUnit's automatic
+#   test discovery protocol to discover test classes. (These are the subclasses
+#   of CppUnit::TestFixture for which we scan and pass to the
+#   CPPUNIT_TEST_SUITE_REGISTRATION() macro.)
+rule UnitTestCommonObj
+{
+  if ! $(UNITTEST_COMMON_OBJ)
+  {
+    local test_main_dir = [ ConcatDirs $(LOCATE.OBJECTS) __unittest_common ] ;
+    local test_main_src = main.cpp ;
+    test_main_src = $(test_main_src:G=__unittest) ;
+    MakeLocate $(test_main_src) : $(test_main_dir) ;
+    UnitTestMain $(test_main_src) ;
+    Clean checkclean : $(test_main_src) ;
+
+    local test_main_obj = [ CompileObjects $(test_main_src) ] ;
+    MakeLocate $(test_main_obj) : $(test_main_dir) ;
+    C++FLAGS on $(test_main_obj) += $(COMPILER.C++FLAGS.EXCEPTIONS.ENABLE)
+      $(CPPUNIT.CFLAGS) ;
+    Clean checkclean : $(test_main_obj) ;
+
+    UNITTEST_COMMON_OBJ = $(test_main_obj) ;
+  }
+  return $(UNITTEST_COMMON_OBJ) ;
+}
+
+# UnitTestDynamicTargets module : objs : subdir_tokens
+#   Given a set of subdirectory tokens representing the location of `module' in
+#   the source tree, dynamically synthesize a test driver program in each
+#   parent directory leading up to module's location. Each synthesized test
+#   program will incorporate module's `objs', as well as the objects of all
+#   other children (recursively) of the directory containing each driver. (The
+#   additional objects will be incorporated by subsequent invocations for the
+#   same directories.)
+rule UnitTestDynamicTargets
+{
+  local mod = $(1) ;
+  local objs = $(2) ;
+  local subdir_tokens = $(3) ;
+
+  # There is no need to synthesize a driver for the directory in which `module'
+  # itself resides, since we already have a "check_module" target for that.
+  # Therefore, simply alias this directory entry to the existing "check_module"
+  # target.
+
+  local deepest_name  = [ UnitTestNameTest  $(subdir_tokens:J=_) ] ;
+  local deepest_clean = [ UnitTestNameClean $(subdir_tokens:J=_) ] ;
+  NotFile $(deepest_name) $(deepest_clean) ;
+  Depends $(deepest_name)  : [ UnitTestNameTest  $(mod) ] ;
+  Depends $(deepest_clean) : [ UnitTestNameClean $(mod) ] ;
+
+  # For each parent directory of `module', synthesize a driver target.
+  local tokens = [ FReverse $(subdir_tokens) ] ;
+  tokens = $(tokens[2-]) ;
+  while $(tokens)
+  {
+    UnitTestDynamicTarget $(mod) : $(objs) : [ FReverse $(tokens) ] ;
+    tokens = $(tokens[2-]) ;
+  }
+
+  # Synthesize a "check_all" target which incorporates all tests projectwide.
+  UnitTestDynamicTarget $(mod) : $(objs) : : all ;
+}
+
+# UnitTestDynamicTarget module : objs : dir_tokens [ : dyn_module ]
+#   The workhorse for UnitTestDynamicTargets which actually changes to the
+#   specified directory and creates the driver program. The "check_foo" target
+#   name is normally composed of the directory tokens joined with underscores
+#   (i.e. "check_dir_tokens") unless the optional `dyn_module' is provided, in
+#   which case the target name becomes "check_dyn_module".
+rule UnitTestDynamicTarget
+{
+  local mod = $(1) ;
+  local objs = $(2) ;
+  local dir_tokens = $(3) ;
+  local dyn_mod = $(4) ;
+  if ! $(dyn_mod) { dyn_mod = $(dir_tokens:J=_) ; }
+
+  local olddir = $(SUBDIR_TOKENS) ;
+  SubDir TOP $(dir_tokens) ;
+
+  local test_driver = [ UnitTestDriver $(dyn_mod) : $(objs) : $(mod) ] ;
+
+  # Use module_UNITTESTS to remember that this dynamically synthesized driver
+  # has a relation to `module'. This information is needed later when clients
+  # invoke CFlags, LFlags, and LibDepends for `module'. Not only must those
+  # settings be applied to `module', but we must also apply them to module's
+  # test driver, as well as all of the directory-based drivers which
+  # incorporate module's test objects.  This is what the UnitTestCFlags,
+  # UnitTestLFlags, and UnitTestLibDepends rules do.
+
+  $(mod)_UNITTESTS += $(test_driver) ;
+
+  SubDir TOP $(olddir) ;
+}
+
+# UnitTestNameTest module
+#   Return the name of the "check_module" target for `module'.
+rule UnitTestNameTest
+{ return check_$(<) ; }
+
+# UnitTestNameClean module
+#   Return the name of the "check_moduleclean" target for `module'.
+rule UnitTestNameClean
+{ local n = [ UnitTestNameTest $(<) ] ; return $(n)clean ; }
+
+# UnitTestCFlags module : flags [ : options ]
+#   Hook invoked automatically by CFlags. Applies `flags' also to module's test
+#   driver.
+rule UnitTestCFlags
+{
+  # Empty for now. Presumably the compiler flags are needed only by the actual
+  # sources of `module'; not by its tests which merely link against module's
+  # objects. This assumption may be wrong, and may change in the future.
+}
+
+# UnitTestLFlags module : flags [ : options ]
+#   Hook invoked automatically by LFlags. Applies `flags' also to module's test
+#   driver and to all directory-based drivers which incorporate module's test
+#   objects.
+rule UnitTestLFlags
+{
+  local mod       = $(1) ;
+  local flags     = $(2) ;
+  local options   = $(3) ;
+  local unittests = $($(mod)_UNITTESTS) ;
+  local u ;
+  for u in $(unittests)
+  {
+    LFlags $(u) : $(flags) : $(options) ;
+  }
+}
+
+# UnitTestLibDepends module : deps
+#   Hook invoked automatically by LibDepends. Applies `deps' also to module's
+#   test driver and to all directory-based drivers which incorporate module's
+#   test objects.
+rule UnitTestLibDepends
+{
+  local mod       = $(1) ;
+  local libs      = $(2) ;
+  local unittests = $($(mod)_UNITTESTS) ;
+  local u ;
+  for u in $(unittests)
+  {
+    LinkWith $(u) : $(libs) ;
+  }
+}
+
+# UnitTestSource wrapper : files
+#   Create a `wrapper' which #includes all `files' (which are probably *.t test
+#   fragments or headers). Also scan `files' for subclasses of
+#   CppUnit::TestFixture and invoke CPPUNIT_TEST_SUITE_REGISTRATION() for each
+#   discovery.
+actions UnitTestSource
+{
+  cat <<EOF > $(<)
+// Automatically generated; do not edit.
+#include <string>
+#include <cppunit/TestCaller.h>
+#include <cppunit/TestFixture.h>
+#include <cppunit/TestSuite.h>
+#include <cppunit/extensions/HelperMacros.h>
+$(UNITTEST_BOILERPLATE_TEST_PRE)
+EOF
+  for i in $(>:BS); do
+    echo '#include "'$i'"' >> $(<)
+  done
+  for i in $(>); do
+    classes=`sed '/public[     ][      ]*CppUnit::TestFixture/!d;\
+      s/class[         ][      ]*\([^  ][^     ]*\)[   ]*:.*/\1/' < $i`
+    for c in $classes; do
+      echo "CPPUNIT_TEST_SUITE_REGISTRATION($c);" >> $(<)
+    done
+  done
+  cat <<EOF >> $(<)
+$(UNITTEST_BOILERPLATE_TEST_POST)
+EOF
+}
+
+# UnitTestMain file
+#   Create a generic main() which is used for all test driver programs.  It
+#   uses CppUnit's automated test class discovery protocol to discover classes
+#   containing tests, therefore it is entirely generic and can be used by any
+#   number of driver programs.
+actions UnitTestMain
+{
+  cat <<EOF > $(<)
+// Automatically generated; do not edit.
+#include <string>
+#include <cppunit/BriefTestProgressListener.h>
+#include <cppunit/TestResult.h>
+#include <cppunit/extensions/TestFactoryRegistry.h>
+#include <cppunit/ui/text/TestRunner.h>
+$(UNITTEST_BOILERPLATE_MAIN_PRE)
+int main(int argc, char** argv)
+{
+  bool verbose = false;
+  for (int i = 1; i < argc; i++)
+  {
+    char const* s = argv[i];
+    if (*s == '-')
+    {
+      do { s++; } while (*s == '-');
+      verbose = (*s == 'v' || *s == 'V');
+      if (verbose)
+        break;
+    }
+  }
+
+  CppUnit::TextUi::TestRunner runner;
+  CppUnit::TestFactoryRegistry& registry =
+    CppUnit::TestFactoryRegistry::getRegistry();
+  CppUnit::BriefTestProgressListener listener;
+  if (verbose)
+    runner.eventManager().addListener(&listener);
+  runner.addTest(registry.makeTest());
+  return runner.run("", false, true, !verbose) ? 0 : -1;
+}
+$(UNITTEST_BOILERPLATE_MAIN_POST)
+EOF
+}
+
+# UnitTestRun check_target : program
+#   Actually run the unit test driver `program' for the invocation target
+#   `check_target'.
+actions UnitTestRun
+{
+  $(>) $(UNITTEST_RUNFLAGS)
+}
+
+}
+else # !CPPUNIT.AVAILABLE
+{
+
+rule UnitTest { }
+rule UnitTestCFlags { }
+rule UnitTestLFlags { }
+rule UnitTestLibDepends { }
+
+actions UnitTestDisabled
+{
+  echo "$(<): Unit testing disabled (CppUnit not installed)."
+}
+
+Always check_all ;
+Depends check : check_all ;
+UnitTestDisabled check_all ;
+
+}
+
+NotFile check checkclean check_all check_allclean ;
+Depends check : check_all ;
+Depends clean : checkclean ;
+Help check : "Run unit tests" ;
diff --git a/mk/jam/unix.jam b/mk/jam/unix.jam
new file mode 100644 (file)
index 0000000..b9d7143
--- /dev/null
@@ -0,0 +1,156 @@
+#============================================================================
+# Jam configuration and actions for Unix (GNU/Linux, BSD, Darwin, etc.)
+# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#============================================================================
+SHELL ?= "/bin/sh" ;
+
+# Only use nasm on x86 for now...
+NASM.FLAGS += -f elf ;
+
+PLUGIN.CFLAGS += $(COMPILER.C++FLAGS.PIC) ;
+LIBRARY.CFLAGS += $(COMPILER.C++FLAGS.PIC) ;
+
+# The BFD tag name under which to embed meta-information into a plugin module.
+# This much match the name expected by csGetPluginMetadata() (bfdplugins.cpp).
+SECTION_TAG_NAME ?= .crystalspace ;
+
+#----------------------------------------------------------------------------
+# platform specific rules
+
+##  ConstructApplicationTarget target : options
+##    Constructs the application target name (ie. foo.exe for foo)
+rule ConstructApplicationTarget
+{
+  return $(<) ;
+}
+rule ConstructStaticLibraryTarget
+{
+  return lib$(<)$(SUFLIB) ;
+}
+rule ConstructSharedLibraryTarget
+{
+  return lib$(<).so.$(PACKAGE_VERSION) ; 
+}
+rule ConstructSharedLibraryLinkLib
+{
+  return lib$(<).so.$(PACKAGE_VERSION) ; 
+}
+rule ConstructPluginTarget
+{
+  return $(<).so ;
+}
+
+# SystemLinkApplication target : objects : options
+#  do system specific actions needed for linking the application and construct
+#  correct clean targets.
+rule SystemLinkApplication
+{
+  local target = $($(<)_TARGET) ;
+  
+  Depends $(target) : $(>) ;
+  LinkApplication $(target) : $(>) ;
+  # setup clean rules
+  Clean clean : $(target) ;
+  Clean $(<)clean : $(target) ;
+}
+
+rule SystemInstallApplication
+{
+  Depends install_bin :
+    [ DoInstall $(<) : $(bindir) $(2) : $(INSTALL_PROGRAM) ] ;
+}
+
+rule SystemInstallPlugin
+{
+  Depends install_plugin : [ DoInstall $(<) : $(plugindir) $(2) :
+      $(INSTALL_PROGRAM) ] ;
+}
+
+# Put the meta data into the object file headers
+rule ObjTagMetaData
+{
+  Depends $(<) : $(>) ;
+}
+actions ObjTagMetaData
+{
+  $(CMD.OBJCOPY) --add-section $(SECTION_TAG_NAME)=$(>) $(<)
+}
+
+# SystemLinkPlugin target : objects : options
+#  do system specific actions needed for linking the plugin and construct
+#  correct clean targets.
+rule SystemLinkPlugin
+{
+  local target = $($(<)_TARGET) ;
+  
+  Depends $(target) : $(>) ;
+  LinkPlugin $(target) : $(>) ;
+  if $(EMBED_META) = "yes" && $(OBJCOPY.AVAILABLE) = "yes"
+  {
+    ObjTagMetaData $(target) : $($(<)_METAFILE) ;
+  }
+  else
+  {
+    PluginMetaData $(<) : $($(<)_METAFILE) : $(3) ;
+  }
+  # setup clean rules
+  Clean clean : $(target) ;
+  Clean $(<)clean : $(target) ;
+}
+
+rule SystemLinkSharedLibrary
+{
+  LFlags $(<) : $(LINKLIBS) ;
+  Depends $(<) : $(>) ;
+  local response = $(<).resp ;
+  MakeLocate $(response) : $(LOCATE.OBJECTS)/libs ;
+  ResponseFile $(response) : $(>) ;
+  Depends $(response) : $(>) ;
+  Depends $(<) : $(response) ;
+  LinkSharedLibrary $(<) : $(response) ;
+
+  Clean clean : $(<) ;
+  Clean $(<)clean : $(<) ;
+}
+
+actions LinkApplication bind NEEDLIBS bind EXTRAOBJECTS
+{
+  $(CMD.LINK) -o $(<) $(>) $(EXTRAOBJECTS) $(NEEDLIBS) $(LINKLIBS)
+}
+
+if $(PLUGIN.LFLAGS.USE_SONAME) = "yes"
+{
+  actions LinkPlugin bind NEEDLIBS bind EXTRAOBJECTS
+  {
+    $(CMD.LINK) -o $(<) $(>) $(EXTRAOBJECTS) $(NEEDLIBS) $(LINKLIBS) \
+      -Wl,-soname,$(<:BS)
+  }
+}
+else
+{
+  actions LinkPlugin bind NEEDLIBS bind EXTRAOBJECTS
+  {
+    $(CMD.LINK) -o $(<) $(>) $(EXTRAOBJECTS) $(NEEDLIBS) $(LINKLIBS)
+  }
+}
+
+actions LinkSharedLibrary bind NEEDLIBS bind EXTRAOBJECTS
+{
+  $(CMD.LINK) -shared -o $(<) -Wl,@$(>) $(EXTRAOBJECTS) $(NEEDLIBS) $(LINKLIBS) \
+    -Wl,-soname,$(<:BS)
+}
diff --git a/mk/jam/variant.jam b/mk/jam/variant.jam
new file mode 100644 (file)
index 0000000..0705864
--- /dev/null
@@ -0,0 +1,58 @@
+#============================================================================
+# Setup of compiler/linker flags for debug/optimize mode
+# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#============================================================================
+
+if ! $(VARIANT)
+{
+  VARIANT = $(MODE) ;
+}
+
+if $(VARIANT) != "debug" && $(VARIANT) != "optimize" && $(VARIANT) != "profile"
+{
+  exit "Invalid modus set, please set VARIANT to debug, profile or optimize" ;
+}
+
+# Set modus related flags
+CCFLAGS += $(COMPILER.CFLAGS) $(COMPILER.CFLAGS.$(VARIANT)) ;
+C++FLAGS += $(COMPILER.CFLAGS) $(COMPILER.C++FLAGS)
+           $(COMPILER.CFLAGS.$(VARIANT)) $(COMPILER.C++FLAGS.$(VARIANT)) ;
+LINKLIBS += $(COMPILER.LFLAGS) $(COMPILER.LFLAGS.$(VARIANT)) ;
+LOCATE.OBJECTS = $(LOCATE.OBJECTS)/$(VARIANT) ;
+
+##  SubVariant variantname
+##    Specify subvariant which are placed in separate compilation directories.
+SUBVARIANT ?= "" ;
+SAVED_LOCATE_TARGET = "" ;
+rule SubVariant
+{
+  if ! $(<)
+  {
+    SUBVARIANT = $(SUBVARIANT[2]) ;
+    SUBVARIANT ?= "" ;
+    LOCATE_TARGET = $(SAVED_LOCATE_TARGET[1]) ;
+    SAVED_LOCATE_TARGET = $(SAVED_LOCATE_TARGET[2-]) ;
+  }
+  else
+  {
+    SUBVARIANT = $(<) $(SUBVARIANT) ;
+    SAVED_LOCATE_TARGET = $(LOCATE_TARGET) $(SAVED_LOCATE_TARGET) ;
+    LOCATE_TARGET = $(LOCATE_TARGET)/$(<) ;
+  }
+}
+
diff --git a/mk/jam/win32.jam b/mk/jam/win32.jam
new file mode 100644 (file)
index 0000000..9d1328e
--- /dev/null
@@ -0,0 +1,563 @@
+#============================================================================
+# Jam configuration and actions for Win32
+# Copyright (C)2003 by Matze Braun <matzebraun@users.sourceforge.net>
+# Copyright (C)2004 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#============================================================================
+SHELL ?= "/bin/sh" ;
+
+CMD.WINDRES ?= windres ;
+# DLL-tools not used by this script, but clients might have a need for them.
+CMD.DLLTOOL ?= dlltool ;
+CMD.DLLWRAP ?= dllwrap ;
+
+USE_DLLWRAP ?= no ;
+
+NASM.FLAGS += -f win32 -DEXTERNC_UNDERSCORE ;
+CCFLAGS += -pipe ;
+C++FLAGS += -pipe ;
+LINKLIBS += -L/usr/lib/w32api -lgdi32 -lshell32 ;
+PLUGIN.LFLAGS += -mwindows ;
+WINDRES.FLAGS = --use-temp-file ;
+
+if "$(USE_DLLWRAP)" = "yes"
+{
+PLUGIN.LFLAGS = [ Filter $(PLUGIN.LFLAGS) : -shared ] ;
+}
+
+# Natively-built Jam 2.5 (and probably earlier) on Cygwin fails to perform
+# library scanning properly and think that all object files need to be rebuilt
+# (along with everything which depends upon them) when "jam install" follows
+# "jam all", so disable this feature.
+if $(OS) = "CYGWIN"
+{
+NOARSCAN = true ;
+}
+
+#----------------------------------------------------------------------------
+# resource handling
+# Unfortunately we can't simply specify resources on the source list, because
+# Mingw/Cygwin have the limitation that they can only link 1 resource file
+# in. So we have to concatenate all resourcefiles here before compiling them.
+
+actions GenerateWin32VersionRc
+{
+    cat > $(<) << __EOF__
+// This file is generated automatically.
+
+1 VERSIONINFO
+FILEVERSION $(PACKAGE_VERSION_LIST[1]), $(PACKAGE_VERSION_LIST[2]), $(PACKAGE_VERSION_LIST[3]), $(PACKAGE_VERSION_LIST[4])
+PRODUCTVERSION $(PACKAGE_VERSION_LIST[1]), $(PACKAGE_VERSION_LIST[2]), $(PACKAGE_VERSION_LIST[3]), $(PACKAGE_VERSION_LIST[4])
+#ifdef CS_DEBUG
+FILEFLAGS 0x1
+#else
+FILEFLAGS 0x0
+#endif
+{
+  BLOCK "StringFileInfo"
+  {
+    BLOCK "040904E4"
+    {
+      VALUE "ProductName", "$(PRODUCT_NAME)"
+      VALUE "ProductVersion", "$(PACKAGE_VERSION)"
+      VALUE "FileVersion", "$(PACKAGE_VERSION)"
+      VALUE "LegalCopyright", "$(PACKAGE_COPYRIGHT)"
+      VALUE "FileDescription", "$(PRODUCT_DESCRIPTION)"
+#ifdef CS_DEBUG
+      VALUE "Comments", "Debug build"
+#else
+      VALUE "Comments", "Release build"
+#endif
+      VALUE "WWW", "$(PACKAGE_HOMEPAGE)"
+    }
+  }
+}
+__EOF__
+}
+
+actions GenerateWin32ManifestRc
+{
+    cat > $(<) << __EOF__
+// This file is generated automatically.
+1 24 "$(MANIFEST_NAME)"
+__EOF__
+}
+
+actions GenerateWin32Manifest
+{
+    cat > $(<) << __EOF__
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!-- This file is generated automatically. -->
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+<assemblyIdentity
+__EOF__
+
+    # Filter out non-numerical characters from the version number. Windows does
+    # not like them.
+    echo '$(PACKAGE_VERSION_LIST[1]).$(PACKAGE_VERSION_LIST[2]).$(PACKAGE_VERSION_LIST[3]).$(PACKAGE_VERSION_LIST[4])' | $(SED) 's/[^0123456789.]//g' | $(SED) 's/\(.*\)/    version="\1"/' >> $(<)
+  
+    cat >> $(<) << __EOF__
+    processorArchitecture="X86"
+    name="$(PRODUCT_NAME)"
+    type="win32"
+/>
+<description>$(PRODUCT_DESCRIPTION)</description>
+<dependency>
+    <dependentAssembly>
+         <assemblyIdentity
+             type="win32"
+             name="Microsoft.Windows.Common-Controls"
+             version="6.0.0.0"
+             processorArchitecture="X86"
+             publicKeyToken="6595b64144ccf1df"
+             language="*"
+         />
+    </dependentAssembly>
+</dependency>
+</assembly>
+__EOF__
+}
+
+actions GenerateWin32MetadataRc
+{
+    cat > $(<) << __EOF__
+// This file is automatically generated.
+
+17485 RCDATA 
+{
+__EOF__
+
+    cat $(>) | $(SED) "s:\":\"\":g" | $(SED) "s:\(.*\):  \"\1\",:g" >> $(<)
+
+    cat >> $(<) << __EOF__
+  "\0"
+}
+__EOF__
+
+}
+
+actions GenerateIconRc
+{
+  echo '1 ICON "$(>)"' > $(<)
+}
+
+actions together CompileResources
+{
+    cat $(>) | $(CMD.WINDRES) $(WINDRES.FLAGS) $(RCFLAGS) --include-dir=$(>:D) -o $(<)
+}
+
+rule CompileResources
+{
+    Depends $(<) : $(>) ;
+}
+
+##  Win32Resource basename : rcfiles
+##    Specify .rc files for the target known as basename.  The .rc files should
+##    already have SEARCH set appropriately.
+rule Win32Resource
+{
+    local target = $($(<)_TARGET) ;
+    local rcobject = [ DoObjectGrist $(<)_resource.o ] ;
+    LOCATE on $(rcobject) = $(LOCATE_TARGET) ;
+    SEARCH on $(rcobject) = $(LOCATE_TARGET) ;
+    
+    # only add 1 resource object per target
+    if ! $($(<)_HASWIN32RESOURCE)
+    {
+       $(<)_HASWIN32RESOURCE = yes ;
+       ExtraObjects $(<) : $(rcobject) ;
+    }
+
+    CompileResources $(rcobject) : $(>) ;
+}
+
+##  Win32RcFlags basename : rcfiles
+##    Specify flags passed to the resource compiler when compiling resources
+##    for the target known as basename.
+rule Win32RcFlags
+{
+    local rcobject = [ DoObjectGrist $(<)_resource.o ] ;
+    RCFLAGS on $(rcobject) += $(>) ;
+}
+
+if $(USE_DLLWRAP) = "yes"
+{
+rule GenerateExportDefs
+{
+  SEARCH on $(<) = $(LOCATE_TARGET) ;
+  MakeLocate $(<) : $(LOCATE_TARGET) ;
+  Depends $(<) : $(>) ;
+}
+
+actions GenerateExportDefs
+{
+  echo "EXPORTS" > $(<)
+  echo "  plugin_compiler" >> $(<)
+  $(SED) '/<implementation>/!d;s:[     ]*<implementation>\(..*\)</implementation>:  \1_scfInitialize:;p;s:_scfInitialize:_scfFinalize:;p;s:_scfFinalize:_Create:' < $(>) >> $(<)
+}
+}
+
+#----------------------------------------------------------------------------
+# linking part
+
+##  ConstructApplicationTarget target : options
+##    Constructs the application target name (ie. foo.exe for foo)
+rule ConstructApplicationTarget
+{
+  return $(<).exe ;
+}
+rule ConstructStaticLibraryTarget
+{
+  return lib$(<)$(SUFLIB) ;
+}
+rule ConstructSharedLibraryTarget
+{
+  return $(<)-$(COMPILER.TYPE).dll ;
+}
+rule ConstructSharedLibraryLinkLib
+{
+  return lib$(<)$(SUFLIB) ;
+}
+rule ConstructPluginTarget
+{
+  return $(<).dll ;
+}
+
+# Also invoked by msvcgen.jam.
+rule MakeVersionRc
+{
+  # normalize version list
+  local v1, v2, v3, v4 ;
+  v1 = $(PACKAGE_VERSION_LIST[1]) ;
+  if ! $(v1) { v1 = 0 ; }
+  v2 = $(PACKAGE_VERSION_LIST[2]) ;
+  if ! $(v2) { v2 = 0 ; }
+  v3 = $(PACKAGE_VERSION_LIST[3]) ;
+  if ! $(v3) { v3 = 0 ; }
+  v4 = $(PACKAGE_VERSION_LIST[4]) ;
+  if ! $(v4) { v4 = 0 ; }
+  PACKAGE_VERSION_LIST on $(<) = $(v1) $(v2) $(v3) $(v4) ;
+      
+  local desc = [ Description $(>) ] ;
+  if ! $(desc) { desc = "$(>)" ; }
+  PRODUCT_DESCRIPTION on $(<) = $(desc) ;
+
+  local name ;
+  if $(PACKAGE_LONGNAME) { name = $(PACKAGE_LONGNAME) ; }
+  else if $(PACKAGE_NAME) { name = $(PACKAGE_NAME) ; }
+  else { name = $(>) ; }
+  PRODUCT_NAME on $(<) = $(name) ;
+      
+  GenerateWin32VersionRc $(<) ;
+}
+
+rule MakeManifestFile
+{
+  # normalize version list
+  local v1, v2, v3, v4 ;
+  v1 = $(PACKAGE_VERSION_LIST[1]) ;
+  if ! $(v1) { v1 = 0 ; }
+  v2 = $(PACKAGE_VERSION_LIST[2]) ;
+  if ! $(v2) { v2 = 0 ; }
+  v3 = $(PACKAGE_VERSION_LIST[3]) ;
+  if ! $(v3) { v3 = 0 ; }
+  v4 = $(PACKAGE_VERSION_LIST[4]) ;
+  if ! $(v4) { v4 = 0 ; }
+  PACKAGE_VERSION_LIST on $(<) = $(v1) $(v2) $(v3) $(v4) ;
+      
+  local desc = [ Description $(>) ] ;
+  if ! $(desc) { desc = "$(>)" ; }
+  PRODUCT_DESCRIPTION on $(<) = $(desc) ;
+
+  local name ;
+  if $(PACKAGE_NAME) { name = $(PACKAGE_NAME).$(>) ; }
+  else { name = $(>) ; }
+  PRODUCT_NAME on $(<) = $(name) ;
+      
+  GenerateWin32Manifest $(<) ;
+}
+
+rule MakeManifestRc
+{
+  manifestfile = $(<:S=.manifest) ;
+  MakeLocate $(manifestfile) : [ on $(<) GetVar LOCATE ] ;
+  MakeManifestFile $(manifestfile) : $(>) ;
+  MANIFEST_NAME on $(<) = $(manifestfile:G=) ;
+  GenerateWin32ManifestRc $(<) ;
+  Depends $(<) : $(manifestfile) ;
+}
+
+rule MakeMetadataRc
+{
+  local metafile = $($(>)_METAFILE) ;
+  local metarc = $(<) ;
+  Depends $(metarc) : $(metafile) ;
+  GenerateWin32MetadataRc $(metarc) : $(metafile) ;
+  Clean $(>)clean : $(metarc) ;
+  Clean clean : $(metarc) ;
+}
+
+rule AppResourceWin32
+{
+  local options = $(2) ;
+
+  local versionrc = [ DoObjectGrist _versionrc.rc ] ;
+  LOCATE on $(versionrc) = $(LOCATE_TARGET) ;
+  SEARCH on $(versionrc) = $(LOCATE_TARGET) ;
+  
+  MakeVersionRc $(versionrc) : $(<) ;
+  Clean $(<)clean : $(versionrc) ;
+  Clean clean : $(versionrc) ;
+  Win32Resource $(<) : $(versionrc) ;
+
+  if ! [ IsElem nomanifest : $(options) ]
+  {
+    local manifestrc = [ DoObjectGrist _manifestrc.rc ] ;
+    LOCATE on $(manifestrc) = $(LOCATE_TARGET) ;
+    SEARCH on $(manifestrc) = $(LOCATE_TARGET) ;
+  
+    MakeManifestRc $(manifestrc) : $(<) ;
+    Clean $(<)clean : $(manifestrc) ;
+    Clean clean : $(manifestrc) ;
+    Win32Resource $(<) : $(manifestrc) ;
+  }
+
+  local icon = [ ApplicationIcon win32 : $(<) ] ;
+  if ! $(icon)
+  {
+    local apptype = gui ;
+    if [ IsElem console : $(>) ] { apptype = console ; }
+    icon = [ ApplicationIconDefault win32 : $(apptype) ] ;
+  }
+  if $(icon)
+  {
+    local iconcopy = [ DoObjectGrist $(icon) ] ;
+    MakeLocate $(iconcopy) : $(LOCATE_TARGET) ;
+    Depends $(iconcopy) : $(icon) ;
+    Copy $(iconcopy) : $(icon) ;
+    Clean $(<)clean : $(iconcopy) ;
+    Clean clean : $(iconcopy) ;
+
+    local iconrc = [ DoObjectGrist $(<)_iconrc.rc ] ;
+    MakeLocate $(iconrc) : $(LOCATE_TARGET) ;
+    Depends $(iconrc) : $(iconcopy) ;
+    GenerateIconRc $(iconrc) : $(iconcopy) ;
+    Clean $(<)clean : $(iconrc) ;
+    Clean clean : $(iconrc) ;
+
+    Win32Resource $(<) : $(iconrc) ;
+  }
+}    
+
+rule PluginResourceWin32
+{
+  local versionrc, metarc ;
+
+  versionrc = [ DoObjectGrist $(<)_versionrc.rc ] ;
+    MakeLocate $(versionrc) : $(LOCATE_TARGET) ;
+  MakeVersionRc $(versionrc) : $(<) ;
+  
+  if $(EMBED_META) = "yes"
+  {
+    metarc = [ DoObjectGrist $(<)_metarc.rc ] ;
+    MakeLocate $(metarc) : $(LOCATE_TARGET) ;
+    MakeMetadataRc $(metarc) : $(<) ;
+  }
+
+  Clean clean : $(versionrc) $(metarc) ;
+  Clean $(<)clean : $(versionrc) $(metarc) ;
+
+  Win32Resource $(<) : $(versionrc) $(metarc) ;
+}
+
+# SystemLinkApplication target : objects : options
+rule SystemLinkApplication
+{
+  local target = $($(<)_TARGET) ;
+
+  Depends $(target) : $(>) ;
+  LinkApplication $(target) : $(>) ;
+  # setup clean rules
+  Clean clean : $(target) ;
+  Clean $(<)clean : $(target) ;
+
+  AppResourceWin32 $(<) : $(3) ;
+}
+
+rule SystemInstallApplication
+{
+  Depends install_bin :
+    [ DoInstall $(<) : $(bindir) $(2) : $(INSTALL_PROGRAM) ] ;
+}
+
+rule SystemInstallPlugin
+{
+  Depends install_plugin : [ DoInstall $(<) : $(plugindir) $(2) :
+      $(INSTALL_PROGRAM) ] ;
+}
+
+# SystemLinkPlugin target : objects : options
+rule SystemLinkPlugin
+{
+  local target = $($(<)_TARGET) ;
+
+  if $(USE_DLLWRAP) = "yes"
+  {
+    local exportdefs = [ DoObjectGrist $(<).def ] ;
+    NAME on $(exportdefs) = $(<) ;
+    GenerateExportDefs $(exportdefs) : $($(<)_METAFILE) ;
+    Depends $(target) : $(exportdefs) ;
+    EXPORTDEFS on $(target) = $(exportdefs) ;
+  }
+
+  Depends $(target) : $(>) ;
+  LinkPlugin $(target) : $(>) ;
+  PluginResourceWin32 $(<) ;
+
+  if $(EMBED_META) != "yes"
+  {
+    PluginMetaData $(<) : $($(<)_METAFILE) : $(3) ;
+  }
+
+  Clean clean : $(target) ;
+  Clean $(<)clean : $(target) ;
+}
+
+rule MakeDllDefFile
+{
+  local def = $(<) ;
+  local objects = $(>) ;
+  
+  MakeLocate $(def) : $(LOCATE.OBJECTS)/libs ;
+  WriteDefHeader $(def) ;
+  for i in $(objects)
+  {
+    local drectve = $(i).drectve ;
+    MakeLocate $(drectve) : [ on $(i) GetVar LOCATE ] ;
+    Depends $(drectve) : $(i) ;
+    Depends $(def) : $(drectve) ;
+    ExtractDrectve $(drectve) : $(i) ;
+    DrectveToDef $(def) : $(drectve) ;
+    Clean clean : $(drectve) ;
+    Clean $(def)clean : $(drectve) ;
+  }
+}
+
+rule SystemLinkSharedLibrary
+{
+  LFlags $(<) : $(LINKLIBS) ;
+  
+  # The "crystalspace" library is so massive that it blows Jam's command line
+  # length limit when all object files are passed in at once to some command.
+  # However, a DLL, like an executable, needs to be built with all objects at 
+  # once. 
+  # Problem is, since dllwrap etc. don't support response files, there is no 
+  # way to pass all objects at once to it. But, a static library can be built
+  # piecemeal, so we take the detour of creating a static library out of the
+  # DLL objects first.
+  # However, another bug hits us: on MinGW, symbols exported from objects in
+  # static libraries are not automatically exported from the DLL.
+  # We work this around by constructing a .DEF file with all exports of the 
+  # DLL. Conveniently (somewhat), all exported symbols are into a section
+  # ".drectve" of an object file by gcc. After extracting these sections and
+  # some postprocessing, we finally have all .DEF entries. Phew.
+  local lib = $(<).a ;
+  MakeLocate $(lib) $(lib)($(>:BS)) : $(LOCATE.OBJECTS)/libs ;
+  Depends $(lib) : $(lib)($(>:BS)) ;
+  local i ;
+  for i in $(>)
+  {
+    Depends $(lib)($(i:BS)) : $(i) ;
+  }
+  Archive $(lib) : $(>) ;
+  Ranlib $(lib) ;
+  #RmTemps $(lib) : $(>) ;
+  
+  Depends $(<) : $(lib) ;
+  
+  local def = $(<).def ;
+  MakeDllDefFile $(def) : $(>) ;
+  Depends $(<) : $(def) ;
+  Clean clean : $(def) ;
+  Clean $(<)clean : $(def) ;
+  Depends $(<)clean : $(def)clean ;
+  
+  EXPORTDEFS on $(<) = $(def) ;
+  IMPLIB on $(<) = $(3) ;
+  Depends $(3) : $(<) ;
+  LinkSharedLibrary $(<) : $(lib) ;
+
+  Clean clean : $(target) ;
+  Clean $(<)clean : $(target) ;
+}
+
+actions ExtractDrectve
+{
+  $(CMD.OBJCOPY) -j .drectve -O binary $(>) $(<).tmp
+  echo >> $(<).tmp # Cheap trick to ensure there's always a .tmp file; 
+                   # the action should not break with no .drectve - no exports
+                   # is a valid scenario.
+  $(CMD.STRINGS) -n 1 $(<).tmp > $(<) # Run strings since the section data may be 
+                               # padded with zeroes, get rid of those.
+  rm $(<).tmp
+}
+
+actions WriteDefHeader
+{
+  echo "EXPORTS" > $(<)
+}
+
+actions piecemeal together DrectveToDef
+{
+  for d in $(>)
+  do
+    sed -e "s/ /\\
+/g" $d | sed -e "s/-export:\(.*\)/\1/g" | sed -e "s/,data/ DATA/g" >> $(<)
+  done
+}
+
+actions GenerateImportLib
+{
+  $(CMD.DLLTOOL) -d $(>) -l $(<)
+}
+
+actions LinkApplication bind NEEDLIBS bind EXTRAOBJECTS
+{
+  $(CMD.LINK) -o $(<) $(>) $(EXTRAOBJECTS) $(NEEDLIBS) $(LINKLIBS)
+}
+
+if $(USE_DLLWRAP) != "yes"
+{
+  actions LinkPlugin bind NEEDLIBS bind EXTRAOBJECTS
+  {
+    $(CMD.LINK) -o $(<) $(>) $(EXTRAOBJECTS) $(NEEDLIBS) $(LINKLIBS)
+  }
+}
+else
+{
+  actions LinkPlugin bind NEEDLIBS bind EXTRAOBJECTS bind EXPORTDEFS
+  {
+    $(CMD.DLLWRAP) --driver-name=$(CMD.LINK) --dllname $(<:B) --def=$(EXPORTDEFS) -o $(<) $(>) $(EXTRAOBJECTS) $(NEEDLIBS) $(LINKLIBS)
+  }
+}
+
+actions LinkSharedLibrary bind NEEDLIBS bind EXTRAOBJECTS bind EXPORTDEFS bind IMPLIB
+{
+  $(CMD.DLLWRAP) --driver-name=$(CMD.LINK) --dllname $(<:B).dll --def=$(EXPORTDEFS) --implib $(IMPLIB) -o $(<) $(>) $(EXTRAOBJECTS) $(NEEDLIBS) $(LINKLIBS)
+  touch $(IMPLIB) # ensure the IMPLIB is always newer than the DLL, 
+                  # since the IMPLIB depends on the DLL.
+}
diff --git a/mk/msvcgen/control.tlib b/mk/msvcgen/control.tlib
new file mode 100644 (file)
index 0000000..ff857f2
--- /dev/null
@@ -0,0 +1,168 @@
+[% FILTER null;
+#==============================================================================
+# TemplateToolkit2 common control values for MSVC6 and MSVC7 project generation
+# Copyright (C) 2004 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#==============================================================================
+
+#------------------------------------------------------------------------------
+# Within the project, the listing of files comprising that project is broken
+# into groups based upon file types.  The groups[] array of hashes defines the
+# groups into which the file will be placed.  Each hash contains the following
+# keys:
+#
+#    name
+#        Provides a human-readable name for the group within the project file.
+#    types
+#        Regular expression controlling which files will be used to populate
+#        the group.  Filenames matching `types' will be included in the group.
+#------------------------------------------------------------------------------
+groups = [
+  {
+    name => 'Source Files'
+    types => '\.(?i:c|cc|cpp|cxx|m|mm)$'
+  },
+  {
+    name => 'Header Files'
+    types => '\.(?i:h|hh|hpp|hxx)$'
+  },
+  {
+    name => 'Resource Files'
+    types => '\.(?!(?i:h|hh|hpp|hxx|c|cc|cpp|cxx|m|mm)$)\w*$'
+  }
+];
+
+#------------------------------------------------------------------------------
+# Each project file can support multiple build configurations, such as Release
+# and Debug.  The builds[] array of hashes defines the build modes which will
+# appear in the project file.  Each hash provides fine-grained control of
+# settings specific to a particular build modes.  Other than `tag', `name', and
+# `priority', the hash keys are fairly arbitrary.  The remaining keys are
+# accessed by the compose() macro (macros.tlib) based upon an essentially
+# arbitrary name given to compose() upon each invocation.
+#
+#    tag
+#        String often used in construction of pathnames for temporary
+#        build-time files in order to prevent one build configuration from
+#        stomping upon the files of another.  Also used in composition of macro
+#        names by interpolate() (macros.tlib) when searching for customizations
+#        contained in the projectx{6,7}.tlib files.
+#    name
+#        Human-readable name of this configuration.
+#    priority
+#        Assign a relative priority to this build mode over others.  Lower
+#        numbers indicate higher priority.  MSVC6 determines the "default"
+#        build mode based upon the (reverse) order in which it encounters build
+#        mode names in the project file header, so the MSVC6 project template
+#        utilizes this field to ensure that the mode with the highest priority
+#        is the one chosen by default by MSVC6.
+#
+# These keys are optional; they are accessed by the compose() macro
+# (macros.tlib) when compose() is invoked by the project template to retrieve a
+# list of preprocessor #defines, compiler flags, etc.
+#
+#    defines
+#        Array of additional preprocessor #defines for this build mode.
+#    defineskey
+#        Name of key in `my.doc' hash specifying array of additional #defines
+#        for this build mode for the specific project being generated.
+#    cflags
+#        Array of additional compiler flags for this build mode.
+#    cflagsskey
+#        Name of key in `my.doc' hash specifying array of additional compiler
+#        flags for this build mode for the specific project being generated.
+#    incdirskey
+#        Name of the key in `my.doc' hash specifying array of additional header
+#        search directories for this build mode for the specific project being
+#        generated.
+#    lflags
+#        Array of additional linker flags for this build mode.
+#    lflagskey
+#        Name of key in `my.doc' hash specifying array of additional linker
+#        flags for this build mode for the specific project being generated.
+#    libs
+#        Array of additional library dependencies (including .lib suffix) for
+#        this build mode.
+#    libskey
+#        Name of key in `my.doc' hash specifying array of additional library
+#        dependencies for this build mode for the specific project being
+#        generated.
+#    libdirskey
+#        Name of the key in `my.doc' hash specifying array of additional
+#        library search directories for this build mode for the specific
+#        project being generated.
+#------------------------------------------------------------------------------
+builds = [
+  {
+    tag => 'release',
+    name => 'Release',
+    defines => ['NDEBUG'],
+    defineskey => 'define',
+    cflagskey => 'cflags',
+    incdirskey => 'include',
+    lflagskey => 'lflags',
+    libskey => 'library',
+    libdirskey => 'libdir',
+    priority => 100
+  },
+  {
+    tag => 'debug',
+    name => 'Debug',
+    defines => ['_DEBUG'],
+    defineskey => 'definedebug',
+    cflagskey => 'cflagsdebug',
+    incdirskey => 'includedebug',
+    lflagskey => 'lflagsdebug',
+    libskey => 'librarydebug',
+    libdirskey => 'libdirdebug',
+    priority => 200
+  }
+];
+
+#------------------------------------------------------------------------------
+# The projtypes[] array defines the different types of built targets (GUI
+# application, DLL, library, etc.) which a project file might represent.  The
+# client will choose one of these keys as the type of project desired.  The
+# value of each key is a hash specifying additional customization of the
+# project based upon its type.  The keys of the subhash are the same as the
+# optional keys described above for the builds[] array ('defines', 'cflags',
+# and so forth; but not the 'defineskey', 'cflagskey', etc.).
+#------------------------------------------------------------------------------
+projtypes = {
+  appcon =>
+  {
+    defines = ['_CONSOLE']
+  },
+  appgui =>
+  {
+    defines = ['_WINDOWS']
+  },
+  group =>
+  {
+  },
+  library =>
+  {
+    defines = ['_LIB', '_WINDOWS']
+  },
+  plugin =>
+  {
+    defines = ['_WINDOWS'],
+    libs = ['delayimp.lib']
+  }
+};
+
+END %]
diff --git a/mk/msvcgen/custom.cslib b/mk/msvcgen/custom.cslib
new file mode 100644 (file)
index 0000000..e5959f8
--- /dev/null
@@ -0,0 +1,43 @@
+[% FILTER null;
+#==============================================================================
+# TemplateToolkit2 CrystalSpace customizations for MSVC project generation
+# Copyright (C) 2004 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#==============================================================================
+
+#------------------------------------------------------------------------------
+# Search the default 'debug' build configuration to add the CS_DEBUG define
+#------------------------------------------------------------------------------
+builddebug = {};
+FOREACH build IN builds;
+  IF build.tag == 'debug';
+    builddebug = build;
+    BREAK;
+  END;
+END;
+# Add CS_DEBUG define
+builddebug.import({defines => builddebug.defines.merge(['CS_DEBUG'])});
+
+#------------------------------------------------------------------------------
+# Go over all configurations and add CS-specific defines needed by all
+# configurations.
+#------------------------------------------------------------------------------
+FOREACH build IN builds;
+  build.defines = build.defines.merge(['CS_WIN32_CSCONFIG','__CRYSTAL_SPACE__']);
+END;
+
+END %]
diff --git a/mk/msvcgen/macros.tlib b/mk/msvcgen/macros.tlib
new file mode 100644 (file)
index 0000000..f89e6af
--- /dev/null
@@ -0,0 +1,301 @@
+[% FILTER null;
+#==============================================================================
+# TemplateToolkit2 utility macros for MSVC project generation
+# Copyright (C) 2004 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#==============================================================================
+
+#------------------------------------------------------------------------------
+# Return input string with forward slashes changed to backward slashes.
+#------------------------------------------------------------------------------
+MACRO slash(s) GET s.replace('/','\\');
+
+#------------------------------------------------------------------------------
+# Given a path, strip off any prefix found in the my.doc.striproot[] array.
+# For example, if my.doc.striproot[] contains '/usr/local/', and this macro is
+# invoked as striproot('/usr/local/foo.bar'), then the return value will be
+# 'foo.bar'.
+#------------------------------------------------------------------------------
+MACRO striproot(p) BLOCK;
+  IF my.doc.striproot;
+    UNLESS my.doc.striprootpat;
+      r = [];
+      FOREACH c IN my.doc.striproot;
+       IF c != '.';
+         c = c.replace('[/\\\\]?$', '/?') IF c != './';
+         r.push(c.replace('[.]', '\\.'));
+       END;
+      END;
+      my.doc.striprootpat = '^(?i:' _ r.join('|') _ ')';
+    END;
+    p.replace(my.doc.striprootpat, '');
+  ELSE;
+    GET p;
+  END;
+END;
+
+#------------------------------------------------------------------------------
+# Given an array of paths, invoke striproot() upon each and return the results.
+# Note that, because TemplateToolkit macros can not return true lists, the
+# return value is actually a string with the elements delimited by the token
+# `|'; thus clients must split() the return value if a real list result is
+# desired.  For instance: myfiles = striproots(allfiles).split('|')
+#------------------------------------------------------------------------------
+MACRO striproots(p) BLOCK;
+  r = [];
+  FOREACH c IN p;
+    r.push(striproot(c));
+  END;
+  r.join('|');
+END;
+
+#------------------------------------------------------------------------------
+# Given an array of path components, return the concatenation of the components
+# (using backslash '\' as a delimiter) after possibly stripping an optional
+# prefix from each component.  The list of prefixes which may be stripped are
+# found in the my.doc.striproot[] array.  For example, if my.doc.striproot[]
+# contains '/usr/local/', and this macro is invoked as
+# path(['/usr/local/foo', 'bar', 'cow.baz']), then the return value will be
+# 'foo\bar\cow.baz'.
+#------------------------------------------------------------------------------
+MACRO path(p) BLOCK;
+  r = [];
+  FOREACH c IN p;
+    r.push(striproot(c));
+  END;
+  slash(r.join('\\'));
+END;
+
+#------------------------------------------------------------------------------
+# Given a string specifying a set of options for a tool (compiler, linker,
+# etc.) of the form `/opt1 "arg1" /opt2 "arg2"' (or `/opt1:arg1 /opt2:arg2', or
+# the like), translate forward slashes in `arg' (which is assumed to be a
+# pathname) to backward slashes.  For example, given
+# `/I "foo/bar" /out:cow/baz', returns `/I "foo\bar" /out:cow\baz'.
+#------------------------------------------------------------------------------
+MACRO flags(s) GET slash(s).replace('\A\\\\','/').replace('\s\\\\',' /');
+
+#------------------------------------------------------------------------------
+# Given an array of items, return only the items which match the set of regular
+# expressions in my.doc.accept[] and which do not match the set of expressions
+# in my.doc.reject[].  For example, if my.doc.accept[] contains the one pattern
+# '\.cpp$', and my.doc.reject[] contains the one pattern 'ow', then, given the
+# list ['foo.h', 'bar.cpp', 'cow.cpp'], the list of returned items will be
+# ['bar.cpp'].  Note that, because TemplateToolkit macros can not return true
+# lists, the return value is actually a string with the elements delimited by
+# the token `|'; thus clients must split() the return value if a real list
+# result is desired.  For instance: myfiles = filter(allfiles).split('|')
+#------------------------------------------------------------------------------
+MACRO filter(x) BLOCK;
+  IF my.doc.accept;
+    UNLESS my.doc.acceptpat;
+      my.doc.acceptpat = my.doc.accept.join('|');
+    END;
+    x = x.grep(my.doc.acceptpat);
+  END;
+  IF my.doc.reject;
+    UNLESS my.doc.acceptpat;
+      my.doc.rejectpat = my.doc.reject.join('|');
+    END;
+    y = [];
+    FOREACH i IN x;
+      UNLESS i.match(my.doc.rejectpat);
+       y.push(i);
+      END;
+    END;
+    y.join('|');
+  ELSE;
+    x.join('|');
+  END;
+END;
+
+#------------------------------------------------------------------------------
+# Given an input string, return a globally unique identifier (GUID)
+# representing the string (essentially a textual representation of an MD5
+# checksum).  The returned string has the form
+# XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX, where each `X' represents some
+# (uppercase) hexadecimal digit.
+#------------------------------------------------------------------------------
+MACRO guid(s) BLOCK;
+  USE md5 = Digest::MD5;
+  CALL md5.add(s);
+  digest = md5.hexdigest.chunk(4);
+  GET digest.0 _
+      digest.1 _ '-' _
+      digest.2 _ '-' _
+      digest.3 _ '-' _
+      digest.4 _ '-' _
+      digest.5 _
+      digest.6 _
+      digest.7 | upper;
+END;
+
+#------------------------------------------------------------------------------
+# Given an arbitrary identifier (the `tag'), attempt to locate macros named
+# after variations of that tag and the current build mode and project type;
+# then invoke any discovered macros and concatenate their results, delimited by
+# `delim' (which may be omitted if no explicit delimiter is needed).  Macro
+# names are composed of `tag', the current build mode (given by the global
+# `build.mode' property, where `build' typically is a reference to a hash
+# contained in the global builds[] array), and the current project type as
+# indicated by the global my.doc.projtype.0 property.  The full list of macros
+# consulted by interpolate() is presented below.  The macros are invoked in the
+# order shown.
+#
+#    tag_build
+#    tag_projtype
+#    tag_projtype_build
+#------------------------------------------------------------------------------
+MACRO interpolate(tag, delim) BLOCK;
+  p = [];
+  s = ${"${tag}_${build.tag}"};
+  p.push(s) IF s.length > 0;
+  s = ${"${tag}_${my.doc.projtype.0}"};
+  p.push(s) IF s.length > 0;
+  s = ${"${tag}_${my.doc.projtype.0}_${build.tag}"};
+  p.push(s) IF s.length > 0;
+  GET p.join(delim);
+END;
+
+#------------------------------------------------------------------------------
+# Given an array of strings, return the concatenation of the elements,
+# delimited by `delim'.  Prior to concatenation, `prefix' and `suffix' (if
+# provided) are attached to each element.  For example,
+# glue(['foo','bar'],':','<','>') returns "<foo>:<bar>".
+#------------------------------------------------------------------------------
+MACRO glue(array, delim, prefix, suffix) BLOCK;
+  delim = suffix _ delim _ prefix;
+  s = array.join(delim);
+  IF s.length > 0;
+    s = prefix _ s _ suffix;
+  END;
+  GET s;
+END;
+
+#------------------------------------------------------------------------------
+# Given an arbitrary identifier (the `tag'), attempt to access several in-scope
+# or globally visible arrays in order to extract additional options for a given
+# build mode and project type.  The elements of the accessed arrays, along with
+# a `seed' array, are concatentated, delimited by `delim'.  Each element is
+# optionally modified by `prefix' and `suffix' as described in the glue()
+# macro.  The actual list of arrays consulted is:
+#
+#    build.tag
+#    projtypes.projtype.tag
+#    my.doc.tagkey
+#
+# The above list assumes that a hash named `build' is in scope.  Typically,
+# this is a reference to an element of the global builds[] array
+# (control.tlib).  Furthermore, `projtype' is shorthand for my.doc.projtype.0,
+# which is assumed to exist globally, and is specific to the project being
+# generated.  Finally, `tagkey' is actually the value of the "${tag}key" key
+# within the `build' hash.  As a practical example, if generating a project
+# file for a "plugin" and emitting the "debug" configuration, given a `tag' of
+# "cflags", then the following arrays may be consulted:
+#
+#    build.cflags
+#    projtypes.plugin.cflags
+#    my.doc.cflagsdebug
+#
+# In this example, the name "cflagsdebug" comes from the
+# builds['debug'].cflagskey property (control.tlib).
+#------------------------------------------------------------------------------
+MACRO compose(tag, seed, delim, prefix, suffix) BLOCK;
+  p = [];
+  p = p.merge(build.$tag).
+    merge(projtypes.${my.doc.projtype.0}.$tag).
+    merge(my.doc.${${"build.${tag}key"}}).
+    merge(seed);
+  GET glue(p, delim, prefix, suffix);
+END;
+
+#------------------------------------------------------------------------------
+# Given an arbitrary `tag', concatenate the list of pathnames in my.doc.tag[],
+# along with a `seed' list, delimited by `delim'.  Each item is mutated by
+# path() prior to concatenation.  The optional `prefix' and `suffix' modify
+# each item as described in the glue() macro.  For example, if my.doc.libdir[]
+# contains the elements "foo/bar" and "baz/snorz", then the invocation
+# composepaths('libdir',['cow/fish'],' ','/I "','"') will return the string
+# `/I "cow\fish" /I "foo\bar" /I "baz\snorz"'. Likewise,
+# composepaths('libdir',[],',') will return `foo\bar,baz\snorz'.
+#------------------------------------------------------------------------------
+MACRO composepaths(tag, seed, delim, prefix, suffix) BLOCK;
+  p = seed;
+  FOREACH d IN my.doc.$tag;
+    p.push(path([d]).replace('\\\\$',''));
+  END;
+  GET glue(p, delim, prefix, suffix);
+END;
+
+#------------------------------------------------------------------------------
+# Loads a data file containing key/value tuples and stores the tuples in the
+# hash named my.tag, where `tag' is provided by the caller.  The key/value
+# tuples appear one per line in the data file, and the key must be separated
+# from the value via a literal '|'.  The very first line of the data file
+# _must_ be the literal string "key|value" (sans quotes).  Each key in the data
+# file becomes a key in the my.tag hash.  Typically, the name "doc" is used for
+# `tag', and is meant to represent attributes (such as special compiler and
+# linker flags, list of files, etc.) of the current "project file document"
+# under construction.  Indeed, many of the macros defined here (macros.tlib)
+# assume the presence of the my.doc hash, and consult it to learn about
+# properties specific to the project file being synthesized.  It is legal for
+# the same key to appear multiple times in the data file; this is how an array
+# of values is defined for a given key.  In fact, _all_ values in the hash are
+# assumed to be arrays.  Consequently, even if you know that a particular key
+# will appear in the data file only a single time, you must still perform an
+# array access to obtain its value (for instance, `my.doc.projtype.0').  Values
+# from the loaded data file are typically accessed via the FOREACH directive
+# (for example, `FOREACH cflag IN my.doc.cflags'), but can also be accessed
+# individually (`my.doc.cflags.0', `my.doc.cflags.1', etc.).
+#------------------------------------------------------------------------------
+MACRO load(path, tag) BLOCK;
+  my.$tag = {};
+  USE f = datafile(path, delim = '|');
+  FOREACH r IN f;
+    IF my.$tag.exists(r.key);
+      my.$tag.${r.key}.push(r.value);
+    ELSE;
+      my.$tag.${r.key} = [ r.value ];
+    END;
+  END;
+END;
+
+#------------------------------------------------------------------------------
+# Build-specific path composition macros.
+#
+#    workroot
+#        Return the root of the directory hierarchy in which build temporaries
+#        and some targets will be placed.
+#    worklibout
+#        Return the location where built static libraries will be placed.
+#    workbuild
+#        Return the location of a build temporary.  If `tail' is omitted, then
+#        this will be the directory into which temporary build output will be
+#        placed (a subdirectory of `workroot').  If `tail', an array of
+#        pathname components, is provided, then it can specify a directory or
+#        file beneath the `workbuild' directory.  The elements of `tail' are
+#        concatenated without any delimiter.  For example, workbuild([]) might
+#        return "..\out\build", whereas workbuild(['myapp']) would return
+#        "..\out\build\myapp", and workbuild(['myapp/test','.obj']) would
+#        return "..\out\build\myapp\test.obj".
+#------------------------------------------------------------------------------
+MACRO workroot GET path([my.doc.buildroot.0, 'out', glue([build.tag, my.doc.msvcversion.0])]);
+MACRO worklibout GET path([workroot, 'libs']);
+MACRO workbuild(tail)
+  GET path([workroot, 'build', my.doc.project.0, tail.join('')]);
+
+END %]
diff --git a/mk/msvcgen/project6.tlib b/mk/msvcgen/project6.tlib
new file mode 100644 (file)
index 0000000..e299994
--- /dev/null
@@ -0,0 +1,129 @@
+[% FILTER null;
+#==============================================================================
+# TemplateToolkit2 template for MSVC6 project (dsp) file.
+# Copyright (C) 2004 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#==============================================================================
+  PROCESS macros.tlib;
+  PROCESS control.tlib;
+  PROCESS projectx6.tlib;
+
+  MACRO composedefs(defs) GET compose('defines', defs, ' ', '/D "', '"');
+  MACRO composedirs(tag, seed, directive) BLOCK;
+    prefix = directive _ '"';
+    GET composepaths(${"build.${tag}key"}, seed, ' ', prefix, '"');
+  END;
+
+  my = {};
+  load(respfile, 'doc');
+  FOREACH f IN my.doc.customize; PROCESS $f | null; END;
+
+  files = striproots(filter(my.doc.file).split('\|')).split('\|').sort;
+  builds = builds.nsort('priority');
+END -%]
+# Microsoft Developer Studio Project File - Name="[% my.doc.project.0 %]" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) [% projtypes.${my.doc.projtype.0}.type %]" [% projtypes.${my.doc.projtype.0}.typecode %]
+
+CFG=[% my.doc.project.0 %] - Win32 [% builds.0.name %]
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "[% my.doc.project.0 %].mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "[% my.doc.project.0 %].mak" CFG="[% my.doc.project.0 %] - Win32 [% builds.0.name %]"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+[% # MSVC6 uses the last listed build mode as default, so we reverse the list.
+FOREACH build IN builds.reverse -%]
+!MESSAGE "[% my.doc.project.0 %] - Win32 [% build.name %]" (based on "Win32 (x86) [% projtypes.${my.doc.projtype.0}.type %]")
+[% END -%]
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+[% FOREACH build IN builds -%]
+![% IF loop.first; 'IF'; ELSE; 'ELSEIF'; END %]  "$(CFG)" == "[% my.doc.project.0 %] - Win32 [% build.name %]"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries [% interpolate('usedebuglibs') %]
+# PROP BASE Output_Dir "[% build.tag %]"
+# PROP BASE Intermediate_Dir "[% build.tag %]"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries [% interpolate('usedebuglibs') %]
+# PROP Output_Dir "[% workbuild([]) %]"
+# PROP Intermediate_Dir "[% workbuild([]) %]"
+[% interpolate('ignoreexportlib') -%]
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /vmb /vms /W3 /Gm /G5 /D "WIN32" /FD /c
+# ADD CPP /nologo /vmb /vms /W3 /Gm /GX /G5 /FD /c [% interpolate('addcpp', ' ') %] /D "_MT" /D "_MBCS" [% composedefs(['WIN32']) %] [% flags(compose('cflags', [], ' ')) %] [% composedirs('incdirs', ['.'], '/I ') %]
+# ADD BASE MTL /nologo /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /mktyplib203 /o "NUL" /win32 [% composedefs([]) %]
+# ADD BASE RSC /l 0x409
+# ADD RSC /l 0x409 /fo".\[% workbuild([my.doc.project.0,'.res']) %]" [% composedefs([]) %] [% composedirs('incdirs', ['.'], '/i ') %]
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo [% interpolate('addlib32') %]
+LINK32=link.exe
+# ADD BASE LINK32 user32.lib gdi32.lib advapi32.lib /nologo /machine:I386
+# ADD LINK32 shell32.lib user32.lib gdi32.lib advapi32.lib [% compose('libs', [], ' ') %] [% interpolate('delaylibs', ' ') %] /nologo /version:4.0 /machine:I386 [% interpolate('linkeropts', ' ') %] [% interpolate('addlink32') %] [% composedirs('libdirs', [], '/libpath:') %] [% flags(compose('lflags', [], ' ')) %]
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+[% interpolate('postbuild') -%]
+# End Special Build Tool
+
+[% END -%]
+!ENDIF 
+
+# Begin Target
+
+[% FOREACH build IN builds -%]
+# Name "[% my.doc.project.0 %] - Win32 [% build.name %]"
+[% END -%]
+[% FOREACH group IN groups -%]
+[% items = files.grep(group.types) -%]
+[% IF items.size > 0 -%]
+# Begin Group "[% group.name %]"
+
+# PROP Default_Filter ""
+[% FOREACH file IN items -%]
+# Begin Source File
+
+SOURCE=[% path([my.doc.sourceroot.0, file]) %]
+# End Source File
+[% END -%]
+# End Group
+[% END -%]
+[% END -%]
+# End Target
+# End Project
diff --git a/mk/msvcgen/project7.tlib b/mk/msvcgen/project7.tlib
new file mode 100644 (file)
index 0000000..6b283ab
--- /dev/null
@@ -0,0 +1,145 @@
+[% FILTER null;
+#==============================================================================
+# TemplateToolkit2 template for MSVC7 project (vcproj) file.
+# Copyright (C) 2004 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#==============================================================================
+  PROCESS macros.tlib;
+  PROCESS control.tlib;
+  PROCESS projectx7.tlib;
+
+  MACRO composedefs(defs) GET compose('defines', defs, ';');
+  MACRO composedirs(tag, seed) GET composepaths(${"build.${tag}key"},seed,';');
+
+  my = {};
+  load(respfile, 'doc');
+  FOREACH f IN my.doc.customize; PROCESS $f | null; END;
+
+  files = striproots(filter(my.doc.file).split('\|')).split('\|').sort;
+END -%]
+<?xml version="1.0" encoding = "Windows-1252"?>
+<VisualStudioProject
+       ProjectType="Visual C++"
+       Version="[% my.doc.formatversion.0 %]"
+       Name="[% my.doc.project.0 %]"
+       ProjectGUID="{[% guid(my.doc.project.0) %]}"
+       SccProjectName=""
+       SccLocalPath="">
+       <Platforms>
+               <Platform
+                       Name="Win32"/>
+       </Platforms>
+       <Configurations>
+[% FOREACH build IN builds -%]
+               <Configuration
+                       Name="[% build.name %]|Win32"
+                       OutputDirectory="[% workbuild([]) %]"
+                       IntermediateDirectory="[% workbuild([]) %]"
+[% interpolate('global') -%]
+                       UseOfMFC="0"
+                       ATLMinimizesCRunTimeLibraryUsage="FALSE">
+                       <Tool
+                               Name="VCCLCompilerTool"
+[% interpolate('compiler') -%]
+                               PreprocessorDefinitions="
+[%- composedefs(['WIN32']) %]"
+                               OptimizeForProcessor="1"
+                               AdditionalOptions="[% flags(compose('cflags', [], ' ')) | html %] [% flags(compose('cflags7', [], ' ')) | html %]"
+                               AdditionalIncludeDirectories="[% composedirs('incdirs', ['.']) %]"
+                               PrecompiledHeaderFile="[% workbuild([my.doc.project.0,'.pch']) %]"
+                               AssemblerListingLocation="[% workbuild([]) %]"
+                               ObjectFile="[% workbuild([]) %]"
+                               ProgramDataBaseFileName="[% workbuild([my.doc.rawtarget.0,'.pdb']) %]"
+                               WarningLevel="3"
+                               SuppressStartupBanner="TRUE"
+                               Detect64BitPortabilityProblems="TRUE"
+                               TreatWChar_tAsBuiltInType="false"
+                               CompileAs="0"/>
+                       <Tool
+                               Name="VCCustomBuildTool"/>
+                       <Tool
+                               Name="VCLinkerTool"
+[% interpolate('linker') -%]
+                               AdditionalOptions="[% flags(compose('lflags', [], ' ')) | html %] [% flags(compose('lflags7', [], ' ')) | html %]"
+                               AdditionalDependencies="[% compose('libs', [], ' ') %]"
+                               IgnoreImportLibrary="TRUE"
+                               SuppressStartupBanner="TRUE"
+                               AdditionalLibraryDirectories="[% composedirs('libdirs', []) %]"
+                               ProgramDatabaseFile="[% workbuild([my.doc.rawtarget.0,'.pdb']) %]"
+                               TargetMachine="1"/>
+                       <Tool
+                               Name="VCLibrarianTool"
+[% interpolate('librarian') -%]
+                               SuppressStartupBanner="TRUE"/>
+                       <Tool
+                               Name="VCMIDLTool"
+                               PreprocessorDefinitions="[% composedefs([]) %]"
+                               MkTypLibCompatible="TRUE"
+                               SuppressStartupBanner="TRUE"
+                               TargetEnvironment="1"
+                               TypeLibraryName="[% workbuild([my.doc.project.0,'.tlb']) %]"/>
+                       <Tool
+                               Name="VCPostBuildEventTool"
+[% interpolate('postbuild') -%]
+                               />
+                       <Tool
+                               Name="VCPreBuildEventTool"/>
+                       <Tool
+                               Name="VCPreLinkEventTool"/>
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                               PreprocessorDefinitions="[% composedefs([glue (['PROJECTGEN_VERSION', my.doc.msvcversion.0], '=')]) %]"
+                               AdditionalIncludeDirectories="[% composedirs('incdirs', ['.']) %]"
+                               Culture="1033"/>
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"/>
+                       <Tool
+                               Name="VCWebDeploymentTool"/>
+               </Configuration>
+[% END -%]
+       </Configurations>
+       <Files>
+               [%- FOREACH group IN groups %]
+               [%- items = files.grep(group.types) %]
+               [%- IF items.size > 0 %]
+               <Filter
+                       Name="[% group.name %]"
+                       Filter="">
+                       [%- FOREACH file IN items %]
+                       <File
+                               RelativePath="[% path([my.doc.sourceroot.0, file]) %]">
+                               [%- IF my.doc.static %]
+                               [%- UNLESS file.match('\\.(h|hpp|rc)$') %]
+                               [%- FOREACH build IN builds %]
+                               <FileConfiguration
+                                       Name="[% build.name %]|Win32">
+                                       <Tool
+                                               Name="VCCLCompilerTool"
+                                               ObjectFile="[% workbuild([file.replace('/', '_'), '.obj']) %]"/>
+                               </FileConfiguration>
+                               [%- END %]
+                               [%- END %]
+                               [%- END %]
+                       </File>
+                       [%- END %]
+               </Filter>
+               [%- END %]
+               [%- END %]
+       </Files>
+       <Globals>
+       </Globals>
+</VisualStudioProject>
diff --git a/mk/msvcgen/projectx6.tlib b/mk/msvcgen/projectx6.tlib
new file mode 100644 (file)
index 0000000..32829df
--- /dev/null
@@ -0,0 +1,99 @@
+#==============================================================================
+# TemplateToolkit2 template extension for MSVC6 project (vcproj) file.
+# Copyright (C) 2004 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#==============================================================================
+#------------------------------------------------------------------------------
+# This file, projectx6.tlib, provides additional support for the main MSVC6
+# project file template, project6.tlib, in the form of macros which customize
+# the file generation based upon combinations of build mode and target type.
+#
+# project6.tlib will look for macros named "tag_build", "tag_type", and
+# "tag_type_build".  `tag' is an arbitrary name, such as "addcpp", "addlink32",
+# or "linkeropts".  which project6.tlib will use when looking for
+# customizations for a particular section of the project file (such as the
+# compiler or linker sections, for instance).  `build' is one of the build mode
+# tag names (typically "release" or "debug") from the build[] array
+# (control.tlib).  `type' is one of the project types (typically "appcon",
+# "appgui", "group", "library", or "plugin") named by the projtypes[] array
+# (control.tlib).
+#
+# For example, to add customization entries to the post-build portion of the
+# project file in release mode for all project types, provide a macro named
+# "postbuild_release".  To customize the post-build for plugins only but for
+# all build modes, provide the macro "postbuild_plugin".  To add customizations
+# for the post-build in debug mode for GUI application projects only, provide a
+# macro named "postbuild_appgui_debug".
+#------------------------------------------------------------------------------
+
+[%
+projtypes.appcon.type = 'Console Application';
+projtypes.appcon.typecode = '0x0103';
+projtypes.appgui.type = 'Application';
+projtypes.appgui.typecode = '0x0101';
+projtypes.group.type = 'Static Library';
+projtypes.group.typecode = '0x0104';
+projtypes.library.type = 'Static Library';
+projtypes.library.typecode = '0x0104';
+projtypes.plugin.type = 'Dynamic-Link Library';
+projtypes.plugin.typecode = '0x0102';
+%]
+
+[% MACRO delaylibs_plugin
+GET glue(my.doc.librarydelay,' ','/DELAYLOAD:','.dll') %]
+
+[% MACRO linkeropts_release GET '/OPT:NOREF' %]
+[% MACRO linkeropts_debug   GET '/debug /pdbtype:sept' %]
+[% MACRO linkeropts_plugin  GET '/dll' %]
+
+[% MACRO usedebuglibs_release GET '0' %]
+[% MACRO usedebuglibs_debug   GET '1' %]
+
+[% MACRO addcpp_release GET '/Gy /GF /MD /Ob2 /Og /Oi /Ot /Oy' %]
+[% MACRO addcpp_debug   GET '/GR /MDd /ZI /Od' %]
+[% MACRO addcpp_library GET '/D "_LIB"' %]
+
+[% MACRO ignoreexportlib_common(bool) BLOCK -%]
+# PROP Ignore_Export_Lib [% bool %]
+[% END %]
+[% MACRO ignoreexportlib_appcon_release GET ignoreexportlib_common('0') %]
+[% MACRO ignoreexportlib_appcon_debug   GET ignoreexportlib_common('1') %]
+[% MACRO ignoreexportlib_appgui_release GET ignoreexportlib_common('0') %]
+[% MACRO ignoreexportlib_appgui_debug   GET ignoreexportlib_common('1') %]
+[% MACRO ignoreexportlib_group          GET ignoreexportlib_common('0') %]
+[% MACRO ignoreexportlib_library        GET ignoreexportlib_common('0') %]
+[% MACRO ignoreexportlib_plugin         GET ignoreexportlib_common('1') %]
+
+[% MACRO addlib32_outfile(suffix) BLOCK -%]
+/out:"[% worklibout %]\[% my.doc.project.0 %][% suffix %].lib"
+[%- END %]
+[% MACRO addlib32_library_release GET addlib32_outfile('')   %]
+[% MACRO addlib32_library_debug   GET addlib32_outfile('_d') %]
+[% MACRO addlib32_group           GET addlib32_outfile('')   %]
+
+[% MACRO addlink32_subsystem(subsys) BLOCK -%]
+/subsystem:[% subsys %]
+[%- END %]
+[% MACRO addlink32_common(subsys) BLOCK -%]
+/out:"[% path([my.doc.buildroot.0, my.doc.target.0]) %]" [%
+addlink32_subsystem(subsys) %]
+[%- END %]
+[% MACRO addlink32_appcon GET addlink32_common('console') %]
+[% MACRO addlink32_appgui_release GET addlink32_common('windows') %]
+[% MACRO addlink32_appgui_debug GET addlink32_common('console') %]
+[% MACRO addlink32_library GET addlink32_subsystem('windows') %]
+[% MACRO addlink32_plugin GET addlink32_common('windows') %]
diff --git a/mk/msvcgen/projectx7.tlib b/mk/msvcgen/projectx7.tlib
new file mode 100644 (file)
index 0000000..d77a85a
--- /dev/null
@@ -0,0 +1,121 @@
+#==============================================================================
+# TemplateToolkit2 template extension for MSVC7 project (vcproj) file.
+# Copyright (C) 2004 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#==============================================================================
+#------------------------------------------------------------------------------
+# This file, projectx7.tlib, provides additional support for the main MSVC7
+# project file template, project7.tlib, in the form of macros which customize
+# the file generation based upon combinations of build mode and target type.
+#
+# project7.tlib will look for macros named "tag_build", "tag_type", and
+# "tag_type_build".  `tag' is an arbitrary name, such as "compiler" or "linker"
+# which project7.tlib will use when looking for customizations for a particular
+# section of the project file (such as the compiler or linker sections, for
+# instance).  `build' is one of the build mode tag names (typically "release"
+# or "debug") from the build[] array (control.tlib).  `type' is one of the
+# project types (typically "appcon", "appgui", "group", "library", or "plugin")
+# named by the projtypes[] array (control.tlib).
+#
+# For example, to add customization entries to the compiler portion of the
+# project file in release mode for all project types, provide a macro named
+# "compiler_release".  To customize linker for plugins only but for all build
+# modes, provide the macro "linker_plugin".  To add customizations for the
+# compiler in debug mode for GUI application projects only, provide a macro
+# named "compiler_appgui_debug".
+#------------------------------------------------------------------------------
+
+[% MACRO global_app BLOCK -%]
+                       ConfigurationType="1"
+                       CharacterSet="2"
+[% END %]
+[% MACRO global_app_release BLOCK -%]
+                       WholeProgramOptimization="1"
+[% END %]
+[% MACRO global_appcon GET global_app %]
+[% MACRO global_appcon_release GET global_app_release %]
+[% MACRO global_appgui GET global_app %]
+[% MACRO global_appgui_release GET global_app_release %]
+
+[% MACRO global_group BLOCK -%]
+                       ConfigurationType="4"
+[% END %]
+
+[% MACRO global_library BLOCK -%]
+                       ConfigurationType="4"
+[% END %]
+
+[% MACRO global_plugin BLOCK -%]
+                       ConfigurationType="2"
+[% END %]
+[% MACRO global_plugin_release BLOCK -%]
+                       WholeProgramOptimization="1"
+[% END %]
+
+[% MACRO compiler_release BLOCK -%]
+                               Optimization="2"
+                               StringPooling="TRUE"
+                               EnableFunctionLevelLinking="TRUE"
+                               RuntimeLibrary="2"
+                               DebugInformationFormat="3"
+                               BufferSecurityCheck="FALSE"
+[% END %]
+[% MACRO compiler_debug BLOCK -%]
+                               Optimization="0"
+                               MinimalRebuild="TRUE"
+                               DebugInformationFormat="4"
+                               RuntimeTypeInfo="TRUE"
+                               RuntimeLibrary="3"
+[% END %]
+
+[% MACRO linker_release BLOCK -%]
+                               LinkIncremental="1"
+                               OptimizeReferences="2"
+                               EnableCOMDATFolding="2"
+                               GenerateDebugInformation="TRUE"
+                               IgnoreDefaultLibraryNames="LIBC,LIBCD,LIBCMT,LIBCMTD"
+[% END %]
+[% MACRO linker_debug BLOCK -%]
+                               LinkIncremental="2"
+                               GenerateDebugInformation="TRUE"
+                               IgnoreDefaultLibraryNames="LIBC,LIBCD,LIBCMT,LIBCMTD,MSVCRT"
+[% END %]
+
+[% MACRO linker_common BLOCK -%]
+                               OutputFile="[% path([my.doc.buildroot.0, my.doc.target.0]) %]"
+[% END %]
+
+[% MACRO linker_app(subsys) BLOCK -%]
+[% linker_common -%]
+                               SubSystem="[% subsys %]"
+[% END %]
+[% MACRO linker_appcon GET linker_app(1) %]
+[% MACRO linker_appgui_release GET linker_app(2) %]
+[% MACRO linker_appgui_debug GET linker_app(1) %]
+
+[% MACRO linker_plugin BLOCK -%]
+[% linker_common -%]
+                               DelayLoadDLLs="[% glue(my.doc.librarydelay,';','','.dll') %]"
+                               ImportLibrary="[% workbuild([my.doc.project.0,'.lib']) %]"
+[% END %]
+
+[% MACRO library_outfile(suffix) BLOCK -%]
+                               OutputFile="[% worklibout %]\[% my.doc.project.0 %][% suffix %].lib"
+[% END %]
+[% MACRO librarian_library_release GET library_outfile('') %]
+[% MACRO librarian_library_debug   GET library_outfile('_d') %]
+[% MACRO librarian_group          GET library_outfile('') %]
diff --git a/mk/msvcgen/workspace6.tlib b/mk/msvcgen/workspace6.tlib
new file mode 100644 (file)
index 0000000..c9eb07e
--- /dev/null
@@ -0,0 +1,65 @@
+[% FILTER null;
+#==============================================================================
+# TemplateToolkit2 template for MSVC6 workspace (dsw) file.
+# Copyright (C) 2004 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#==============================================================================
+  PROCESS macros.tlib;
+  PROCESS control.tlib;
+
+  my = {};
+  load(respfile, 'doc');
+  FOREACH f IN my.doc.customize; PROCESS $f | null; END;
+
+  projects = filter(my.doc.project).split('\|').sort;
+END -%]
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+[% FOREACH project IN projects -%]
+###############################################################################
+
+Project: "[% project %]"=.\[% project %].dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+[% FOREACH dep IN filter(my.doc.$project).split('\|').sort -%]
+    Begin Project Dependency
+    Project_Dep_Name [% dep %]
+    End Project Dependency
+[% END -%]
+}}}
+
+[% END -%]
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/mk/msvcgen/workspace7.tlib b/mk/msvcgen/workspace7.tlib
new file mode 100644 (file)
index 0000000..e13eafb
--- /dev/null
@@ -0,0 +1,66 @@
+[% FILTER null;
+#==============================================================================
+# TemplateToolkit2 template for MSVC7 solution (sln) file.
+# Copyright (C) 2004 by Eric Sunshine <sunshine@sunshineco.com>
+#
+#    This library is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU Library General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or (at your
+#    option) any later version.
+#
+#    This library 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 Library General Public
+#    License for more details.
+#
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; if not, write to the Free Software Foundation,
+#    Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#==============================================================================
+  PROCESS macros.tlib;
+  PROCESS control.tlib;
+
+  my = {};
+  load(respfile, 'doc');
+  FOREACH f IN my.doc.customize; PROCESS $f | null; END;
+
+  projects = filter(my.doc.project).split('\|').sort;
+  guids = {};
+  FOREACH project IN projects;
+    guids.$project = guid(project);
+  END;
+END -%]
+Microsoft Visual Studio Solution File, Format Version [% my.doc.formatversion.0 %]
+# Visual C++ Express 2005
+[% FOREACH project IN projects -%]
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "[% project %]", "
+    [%- project %].vcproj", "{[% guids.$project %]}"
+EndProject
+[% END -%]
+Global
+       GlobalSection(SolutionConfiguration) = preSolution
+[% n = 0; FOREACH build IN builds -%]
+               ConfigName.[% n; n = n + 1 %] = [% build.name %]
+[% END -%]
+       EndGlobalSection
+       GlobalSection(ProjectDependencies) = postSolution
+[% FOREACH project IN projects; g = guids.$project; n = 0 -%]
+[% FOREACH dep IN filter(my.doc.$project).split('\|').sort -%]
+               {[% g %]}.[% n; n = n + 1 %] = {[% guids.$dep %]}
+[% END -%]
+[% END -%]
+       EndGlobalSection
+       GlobalSection(ProjectConfiguration) = postSolution
+[% FOREACH project IN projects; g = guids.$project -%]
+[% FOREACH build IN builds -%]
+               {[% g %]}.[% build.name %].ActiveCfg = [% build.name %]|Win32
+               {[% g %]}.[% build.name %].Build.0 = [% build.name %]|Win32
+[% END -%]
+[% END -%]
+       EndGlobalSection
+       GlobalSection(ExtensibilityGlobals) = postSolution
+       EndGlobalSection
+       GlobalSection(ExtensibilityAddIns) = postSolution
+       EndGlobalSection
+EndGlobal
diff --git a/msvc/README b/msvc/README
new file mode 100644 (file)
index 0000000..37d7702
--- /dev/null
@@ -0,0 +1,11 @@
+This directory contains MSVC version 6 and 7 project files for
+Skyscraper.
+
+If the project files become outdated, you can re-generate them by invoking
+"jam msvcgen". Copy the generated files from the build subdirectory `out/msvc'
+to `skyscraper/msvc'.
+
+MSVC6 project and workspace files (.dsp and .dsw) must be committed to a CVS
+repository as "binary" files.  For example: `cvs add -kb *.dsp *.dsw'.
+Generated .rc files and all MSVC7 project and solution files can be committed
+as plain text.  For example: `cvs add *.rc *.vcproj *.sln'.
diff --git a/msvc/Skyscraper.sln b/msvc/Skyscraper.sln
new file mode 100644 (file)
index 0000000..71fa024
--- /dev/null
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual C++ Express 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Skyscraper", "Skyscraper.vcproj", "{899501B5-1571-4301-B4D0-5FAADAE2A607}"
+EndProject
+Global
+       GlobalSection(SolutionConfigurationPlatforms) = preSolution
+               Debug|Win32 = Debug|Win32
+               Release|Win32 = Release|Win32
+       EndGlobalSection
+       GlobalSection(ProjectConfigurationPlatforms) = postSolution
+               {899501B5-1571-4301-B4D0-5FAADAE2A607}.Debug|Win32.ActiveCfg = Debug|Win32
+               {899501B5-1571-4301-B4D0-5FAADAE2A607}.Debug|Win32.Build.0 = Debug|Win32
+               {899501B5-1571-4301-B4D0-5FAADAE2A607}.Release|Win32.ActiveCfg = Release|Win32
+               {899501B5-1571-4301-B4D0-5FAADAE2A607}.Release|Win32.Build.0 = Release|Win32
+       EndGlobalSection
+       GlobalSection(SolutionProperties) = preSolution
+               HideSolutionNode = FALSE
+       EndGlobalSection
+EndGlobal
diff --git a/msvc/Skyscraper.vcproj b/msvc/Skyscraper.vcproj
new file mode 100644 (file)
index 0000000..757c506
--- /dev/null
@@ -0,0 +1,313 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+       ProjectType="Visual C++"
+       Version="8.00"
+       Name="Skyscraper"
+       ProjectGUID="{899501B5-1571-4301-B4D0-5FAADAE2A607}"
+       >
+       <Platforms>
+               <Platform
+                       Name="Win32"
+               />
+       </Platforms>
+       <ToolFiles>
+       </ToolFiles>
+       <Configurations>
+               <Configuration
+                       Name="Release|Win32"
+                       OutputDirectory=".\Release"
+                       IntermediateDirectory=".\Release"
+                       ConfigurationType="1"
+                       UseOfMFC="0"
+                       ATLMinimizesCRunTimeLibraryUsage="false"
+                       >
+                       <Tool
+                               Name="VCPreBuildEventTool"
+                       />
+                       <Tool
+                               Name="VCCustomBuildTool"
+                       />
+                       <Tool
+                               Name="VCXMLDataGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCMIDLTool"
+                               PreprocessorDefinitions="NDEBUG"
+                               MkTypLibCompatible="true"
+                               SuppressStartupBanner="true"
+                               TargetEnvironment="1"
+                               TypeLibraryName=".\Release/Skyscraper.tlb"
+                               HeaderFileName=""
+                       />
+                       <Tool
+                               Name="VCCLCompilerTool"
+                               Optimization="2"
+                               InlineFunctionExpansion="1"
+                               AdditionalIncludeDirectories=""
+                               AdditionalUsingDirectories=""
+                               PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;CS_WIN32_CSCONFIG;__CRYSTAL_SPACE__;CS_RELEASE"
+                               StringPooling="true"
+                               RuntimeLibrary="2"
+                               EnableFunctionLevelLinking="true"
+                               UsePrecompiledHeader="0"
+                               PrecompiledHeaderFile=".\Release/Skyscraper.pch"
+                               AssemblerListingLocation=".\Release/"
+                               ObjectFile=".\Release/"
+                               ProgramDataBaseFileName=".\Release/"
+                               BrowseInformation="1"
+                               WarningLevel="3"
+                               SuppressStartupBanner="true"
+                               DebugInformationFormat="0"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                               PreprocessorDefinitions="NDEBUG"
+                               Culture="1033"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLinkerTool"
+                               AdditionalDependencies="libcrystalspace.lib libcrystalspaceirectx.lib libcrystalspace_opengl.lib libcrystalspace_windows.lib comctl32.lib rpcrt4.lib winmm.lib wsock32.lib opengl32.lib kernel32.lib user32.lib gdi32.lib uuid.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib"
+                               OutputFile="../Skyscraper.exe"
+                               LinkIncremental="1"
+                               SuppressStartupBanner="true"
+                               AdditionalLibraryDirectories=""
+                               SubSystem="1"
+                               TargetMachine="1"
+                       />
+                       <Tool
+                               Name="VCALinkTool"
+                       />
+                       <Tool
+                               Name="VCManifestTool"
+                       />
+                       <Tool
+                               Name="VCXDCMakeTool"
+                       />
+                       <Tool
+                               Name="VCBscMakeTool"
+                               SuppressStartupBanner="true"
+                               OutputFile=".\Release/Skyscraper.bsc"
+                       />
+                       <Tool
+                               Name="VCFxCopTool"
+                       />
+                       <Tool
+                               Name="VCAppVerifierTool"
+                       />
+                       <Tool
+                               Name="VCWebDeploymentTool"
+                       />
+                       <Tool
+                               Name="VCPostBuildEventTool"
+                       />
+               </Configuration>
+               <Configuration
+                       Name="Debug|Win32"
+                       OutputDirectory=".\Debug"
+                       IntermediateDirectory=".\Debug"
+                       ConfigurationType="1"
+                       UseOfMFC="0"
+                       ATLMinimizesCRunTimeLibraryUsage="false"
+                       >
+                       <Tool
+                               Name="VCPreBuildEventTool"
+                       />
+                       <Tool
+                               Name="VCCustomBuildTool"
+                       />
+                       <Tool
+                               Name="VCXMLDataGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCMIDLTool"
+                               PreprocessorDefinitions="_DEBUG"
+                               MkTypLibCompatible="true"
+                               SuppressStartupBanner="true"
+                               TargetEnvironment="1"
+                               TypeLibraryName=".\Debug/Skyscraper.tlb"
+                               HeaderFileName=""
+                       />
+                       <Tool
+                               Name="VCCLCompilerTool"
+                               Optimization="0"
+                               AdditionalIncludeDirectories=""
+                               AdditionalUsingDirectories=""
+                               PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;CS_WIN32_CSCONFIG;__CRYSTAL_SPACE__;CS_DEBUG"
+                               MinimalRebuild="true"
+                               BasicRuntimeChecks="3"
+                               RuntimeLibrary="3"
+                               UsePrecompiledHeader="0"
+                               PrecompiledHeaderFile=".\Debug/Skyscraper.pch"
+                               AssemblerListingLocation=".\Debug/"
+                               ObjectFile=".\Debug/"
+                               ProgramDataBaseFileName=".\Debug/"
+                               BrowseInformation="1"
+                               WarningLevel="3"
+                               SuppressStartupBanner="true"
+                               DebugInformationFormat="4"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                               PreprocessorDefinitions="_DEBUG"
+                               Culture="1033"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLinkerTool"
+                               AdditionalDependencies="libcrystalspace_d.lib libcrystalspace_directx_d.lib libcrystalspace_opengl_d.lib libcrystalspace_windows_d.lib comctl32.lib rpcrt4.lib winmm.lib wsock32.lib opengl32.lib kernel32.lib user32.lib gdi32.lib uuid.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib"
+                               OutputFile="../Skyscraper.exe"
+                               LinkIncremental="2"
+                               SuppressStartupBanner="true"
+                               AdditionalLibraryDirectories=""
+                               GenerateDebugInformation="true"
+                               ProgramDatabaseFile=".\Debug/Skyscraper.pdb"
+                               SubSystem="1"
+                               TargetMachine="1"
+                       />
+                       <Tool
+                               Name="VCALinkTool"
+                       />
+                       <Tool
+                               Name="VCManifestTool"
+                       />
+                       <Tool
+                               Name="VCXDCMakeTool"
+                       />
+                       <Tool
+                               Name="VCBscMakeTool"
+                               SuppressStartupBanner="true"
+                               OutputFile=".\Debug/Skyscraper.bsc"
+                       />
+                       <Tool
+                               Name="VCFxCopTool"
+                       />
+                       <Tool
+                               Name="VCAppVerifierTool"
+                       />
+                       <Tool
+                               Name="VCWebDeploymentTool"
+                       />
+                       <Tool
+                               Name="VCPostBuildEventTool"
+                       />
+               </Configuration>
+       </Configurations>
+       <References>
+       </References>
+       <Files>
+               <Filter
+                       Name="Source Files"
+                       Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+                       >
+                       <File
+                               RelativePath="..\src\camera.cpp"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\src\elevator.cpp"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\src\fileio.cpp"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\src\floor.cpp"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\src\sbs.cpp"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\src\shaft.cpp"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\src\skyscraper.cpp"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\src\stairs.cpp"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\src\unix.cpp"
+                               >
+                       </File>
+               </Filter>
+               <Filter
+                       Name="Header Files"
+                       Filter="h;hpp;hxx;hm;inl"
+                       >
+                       <File
+                               RelativePath="..\src\camera.h"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\src\elevator.h"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\src\fileio.h"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\src\floor.h"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\src\globals.h"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\src\sbs.h"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\src\shaft.h"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\src\skyscraper.h"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\src\stairs.h"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\src\unix.h"
+                               >
+                       </File>
+               </Filter>
+               <Filter
+                       Name="Resource Files"
+                       Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+                       >
+                       <File
+                               RelativePath="..\skyscraper.ico"
+                               >
+                       </File>
+               </Filter>
+       </Files>
+       <Globals>
+       </Globals>
+</VisualStudioProject>
diff --git a/readme.txt b/readme.txt
deleted file mode 100755 (executable)
index b9140f3..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-Skyscraper version 1.1
-©2003-2006 Ryan Thoryk
-http://www.tliquest.net/skyscraper
-http://sourceforge.net/projects/skyscraper
-email: ryan@tliquest.net
-
-Legal Notice
-------------------------------
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-Release Notes
-------------------------------
-This 1.1 release is a milestone release, and is a continuation/rewrite of the 0.97 (unreleased) development code
-Newer features, a completely rewritten simulation engine, loadable buildings, better graphics, etc are all
-being developed for a 2.0 release.  This version is a C++ port of the VB6 version.
-
-This software uses the CrystalSpace3D CVS 5/19/2006 (or later) graphics engine library.
-
-Skyscraper is a 3D virtual building simulator written in C++ using the
-CrystalSpace graphics engine which can be found at http://www.crystalspace3d.com.
-
-See the changelog for new features and fixes for this release.
diff --git a/skyscraper.ico b/skyscraper.ico
new file mode 100644 (file)
index 0000000..92badb9
Binary files /dev/null and b/skyscraper.ico differ