Browse Source

The first klish tree.

git-svn-id: https://klish.googlecode.com/svn/trunk@13 0eaa4687-2ee9-07dd-09d9-bcdd2d2dd5fb
Serj Kalichev 12 years ago
parent
commit
c30fc7a7e8
100 changed files with 31418 additions and 0 deletions
  1. 565 0
      CHANGES
  2. 91 0
      ISSUES
  3. 456 0
      LICENCE
  4. 45 0
      Makefile.am
  5. 887 0
      Makefile.in
  6. 160 0
      README
  7. 8951 0
      aclocal.m4
  8. 136 0
      aux_scripts/compile
  9. 1463 0
      aux_scripts/config.guess
  10. 1579 0
      aux_scripts/config.sub
  11. 522 0
      aux_scripts/depcomp
  12. 322 0
      aux_scripts/install-sh
  13. 8413 0
      aux_scripts/ltmain.sh
  14. 360 0
      aux_scripts/missing
  15. 46 0
      bin/clish.cpp
  16. 329 0
      bin/confd.c
  17. 49 0
      bin/lubheap.c
  18. 42 0
      bin/module.am
  19. 111 0
      bin/tclish.cpp
  20. 53 0
      cliconf/buf.h
  21. 278 0
      cliconf/buf/buf.c
  22. 2 0
      cliconf/buf/module.am
  23. 22 0
      cliconf/buf/private.h
  24. 62 0
      cliconf/conf.h
  25. 253 0
      cliconf/conf/conf.c
  26. 37 0
      cliconf/conf/conf_dump.c
  27. 3 0
      cliconf/conf/module.am
  28. 22 0
      cliconf/conf/private.h
  29. 21 0
      cliconf/module.am
  30. 18 0
      cliconf/net.h
  31. 2 0
      cliconf/net/module.am
  32. 107 0
      cliconf/net/net.c
  33. 11 0
      cliconf/net/private.h
  34. 31 0
      cliconf/query.h
  35. 2 0
      cliconf/query/module.am
  36. 18 0
      cliconf/query/private.h
  37. 255 0
      cliconf/query/query.c
  38. 384 0
      clish.xsd
  39. 13 0
      clish/README
  40. 47 0
      clish/clish_access_callback.c
  41. 334 0
      clish/clish_config_callback.c
  42. 21 0
      clish/clish_script_callback.c
  43. 18 0
      clish/clish_shutdown.c
  44. 56 0
      clish/clish_startup.c
  45. 97 0
      clish/command.h
  46. 475 0
      clish/command/command.c
  47. 48 0
      clish/command/command_dump.c
  48. 4 0
      clish/command/module.am
  49. 28 0
      clish/command/private.h
  50. 195 0
      clish/conf/conf.c
  51. 37 0
      clish/conf/conf_dump.c
  52. 3 0
      clish/conf/module.am
  53. 15 0
      clish/conf/private.h
  54. 47 0
      clish/module.am
  55. 64 0
      clish/nspace.h
  56. 3 0
      clish/nspace/module.am
  57. 273 0
      clish/nspace/nspace.c
  58. 29 0
      clish/nspace/nspace_dump.c
  59. 17 0
      clish/nspace/private.h
  60. 89 0
      clish/param.h
  61. 3 0
      clish/param/module.am
  62. 289 0
      clish/param/param.c
  63. 47 0
      clish/param/param_dump.c
  64. 23 0
      clish/param/private.h
  65. 83 0
      clish/pargv.h
  66. 3 0
      clish/pargv/module.am
  67. 442 0
      clish/pargv/pargv.c
  68. 33 0
      clish/pargv/pargv_dump.c
  69. 16 0
      clish/pargv/private.h
  70. 33 0
      clish/private.h
  71. 133 0
      clish/ptype.h
  72. 4 0
      clish/ptype/module.am
  73. 36 0
      clish/ptype/private.h
  74. 622 0
      clish/ptype/ptype.c
  75. 22 0
      clish/ptype/ptype_dump.c
  76. 328 0
      clish/shell.h
  77. 30 0
      clish/shell/module.am
  78. 120 0
      clish/shell/private.h
  79. 12 0
      clish/shell/shell__get_client_cookie.c
  80. 12 0
      clish/shell/shell__get_tinyrl.c
  81. 12 0
      clish/shell/shell__get_view.c
  82. 12 0
      clish/shell/shell__get_viewid.c
  83. 198 0
      clish/shell/shell_command_generator.c
  84. 75 0
      clish/shell/shell_delete.c
  85. 35 0
      clish/shell/shell_dump.c
  86. 285 0
      clish/shell/shell_execute.c
  87. 39 0
      clish/shell/shell_find_create_ptype.c
  88. 27 0
      clish/shell/shell_find_create_view.c
  89. 12 0
      clish/shell/shell_find_view.c
  90. 18 0
      clish/shell/shell_getfirst_command.c
  91. 13 0
      clish/shell/shell_getnext_command.c
  92. 136 0
      clish/shell/shell_help.c
  93. 12 0
      clish/shell/shell_insert_ptype.c
  94. 12 0
      clish/shell/shell_insert_view.c
  95. 63 0
      clish/shell/shell_new.c
  96. 34 0
      clish/shell/shell_parse.c
  97. 29 0
      clish/shell/shell_pop_file.c
  98. 27 0
      clish/shell/shell_push_file.c
  99. 45 0
      clish/shell/shell_pwd.c
  100. 22 0
      clish/shell/shell_resolve_command.c

+ 565 - 0
CHANGES

@@ -0,0 +1,565 @@
+/**
+\page _changes_page Changes
+
+<HR>
+
+The following updates were introduced as part of work undertaken as an employee
+of Newport Networks. (http://www.newport-networks.com)
+
+    Graeme McKerrell
+
+\section _0_7_3 0.7.3
+- minor bug fix from Cliff Martin which avoids a SEGV when CTRL-C is invoked
+  on an empty line.
+
+\section _0_7_2 0.7.2
+- updated the default value fix slightly to ensure that if the default is set
+  to the empty string then the parameter will not be translated. This means
+  that legacy code which uses an empty default as an indicator of a parameter
+  not being provided will continue to work.
+  
+- incorporated bug from Charlie (nmsguru at sourceforge dot net) to make
+  sure that default values are correctly translated. e.g. a SELECT parameter
+  can be given the textual name in the XML and will be translated into the
+  appropriate interpretation when used.
+
+- updated the configuration so that the --enable-lubheap option is disabled by default. There
+  were a number of people which were having problems compiling the memory management code and tests.
+
+- added in lub_partition component which provides a fast local memory heap for the current thread
+  as well as a global mutex controlled heap which is used by multiple threads.
+  
+- added statistics to lub_blockpool component
+
+- performance overhaul of lub_heap component. Added a cache for smaller sized blocks which provides
+  a boost to the alocation/deallocation speed.
+  
+- updated escape_decode() function in vt100.c to become non-blocking for
+  the scope of decoding an escape sequence. This prevents hanging the
+  input if a user presses the ESC key.
+  
+- added a lub_heap_show_allocs() function which enables any leak detection
+  tracked allocations to be output. This is useful in the case where memory
+  corruption is preventing a scan from taking place.
+  
+- updated lub_heap__set_framecount() so that when you disable leak detection
+  the tainting state is returned to that before leak detection was enabled.
+
+- implemented correct alignement allocations of sizes other than 
+  native alignment. Changed the naming convention to 
+  LUB_HEAP_ALIGN_2_POWER_X and provided support upto 128MB alignment.
+  
+- updated the memInit() function in lubheap/vxwork/memLib.c to call
+  memLibInit() and memPartLibInit(). This is necessary for systems which
+  only call memInit() in usrRoot() routine.
+
+- updated the root-view.xml example file to demonstrate the use of different
+  parameter types.
+
+- updated the named-view.xml example file to demonstrate the use of viewid.
+
+- added patch from Anselmo Lacerda Silveira de Melo to add CTRL-U key
+  combination to tinyrl which deletes the current line contents.
+
+- fixed "const-ness" issue in lub/heap/context.c
+
+- added error checking to posix/heap_leak_mutex.c in case the pthread
+  calls fail.
+  
+- added heap address to the details output by lub_heap_show()
+
+- fixed possible uninitialised variable in heap_realloc.c
+
+- updated clish.xsd to make sure the "PARAM" tag is named.
+
+\section _0_7_1 0.7.1
+-  Cleaned up configure.ac, added --enable-lubheap experimental option which can
+   be used to replace the normal system memory libraries with a lub/heap implementation.
+   Added librt and libintl support as well as POSIXifiying the build for clean
+   building under LINUX.
+
+-  Updated the shell_spawn.c file to enable tilde expansion in CLISH_PATH.
+
+-  split lub_heap platform specifics into two parts 
+   1) the platform specific support code required by the core 
+      lub_heap implementation. 
+   2) a lubheap component which can be linked in to replace the normal
+      platform memory libraries.
+
+-  updated lub_heap component so that memory scanning is handled by specific functions
+   rather than assume the naming conventions of particular sections during the link.
+   The platform specific code now has to perform the scanning.
+
+-  refactored lub/heap/vxworks to better override vxworks libraries when linked in
+   as a library.
+
+-  fixed lub_heap component so that it compiles on 64 bit architecture, and with GCC-4.0
+
+-  updated tinyxml to version 2.5.1
+
+-  updated lub/heap/vxworks/malloc.c/free.c/realloc.c to undefine any
+   MACRO set with their function name. This ensures that they always get compiled 
+   with the correct name, even if the rest of the CLISH framework is being 
+   compiled to use an alternative memory heap, via -D options
+   
+-  Fixed issue in tinyrl_readline where raw mode was enabled (and input buffer
+   flushed) between printing prompt and accepting input. This was causing
+   things like expect scripts to fail. Fix was to change to raw mode prior to
+   printing the prompt.
+
+-  Fixed lub_heap component to work with latest version of Cygwin.
+   The areas which use the __builtin_return_address() function,
+   provided by GCC, now uses the lub_heap_data_start value to
+   check whether a returned address is beyond the "text" section.
+   Hence a stack trace is deemed to come to an end if either the return
+   address is 0 or greater than lub_heap_data_start.
+   
+- Changed next pointer in lub_heap_s to be "lub_heap_s *"as opposed 
+  to "lub_heap_t *" so that GDB does not give incomplete type.
+
+  Fixed memory stomp in tinyrl_completion.
+
+- Updated to account for obscure problem related to C-strings
+  being signed and the ctype.h API taking a signed integer.
+
+  If a string contains characters greater than 127 then the signed bit
+  will be set and when calling a ctype.h utility this can get sign
+  extended.
+  e.g. 
+  char *ptr = "£10"; isspace(*ptr);  will have the value -100
+  passed to the function (or MACRO) as the '£' character (decimal 156)
+  is negative when held as a signed char.
+
+  The solution is to ensure that you always used unsigned chars to
+  pass to the utility functions. This was achieved by adding a lub_ctype 
+  component which provides 8-bit safe versions of these functions.
+
+- added ability to have scripts stop on error or not by introducing a new
+  clish_source_no_stop entry point,
+
+- added ability to limit the maximum line length in tinyrl.
+
+- fixed bug in tinyrl_completion which was stomping on memory when there
+  were an exact multiple of 10 completions. Fix is to allocate one extra
+  entry for the NULL terminator.
+
+- added lub_heap_destroy() operation which frees up a heap object so
+  that the memory segments used for it can be reused for something else.
+  
+- Updated lub_heap so that leak scanning will account for
+  any non-monitored allocated blocks in the system. This 
+  prevents false leaks from being reported. However it
+  cannot account for any of the non-monitored blocks being
+  leaked themselves.
+
+- stripped out some spurious code in vxworks/heap_symShow.c
+
+- lubMallocTest.exe now exercises stress test on lub_heap component.
+  mallocTest.exe runs the same test on the native heap manager for the
+  host platform.
+
+- fixed lub_heap__get_max_free() to work when no free blocks are present.
+
+- added a generic lub_heap_scan_stack() function which can be used
+  to scan any variables held in the current stack up to 32 levels.
+  (needed for non VxWorks systems)
+
+- made lub_heap_scan_memory() take a const void* argument.
+
+- updated lub/heap.h to work when included from C++ file.
+
+- updated the posix/heap_symShow.c to use libbfd for symbol decoding.
+  A lub_heap_init() operation now exists which is called to
+  provide the filename of the current program so that symbols can be
+  loaded.
+
+- disabled memory leak detection and memory taiting by default for
+  the POSIX platform.
+
+- changed default behaviour to tainting and leak detection off.
+
+- when leak detection is enabled for the first time an exit handler is
+  registered to dump memory when a program completes.
+
+- updated configure.ac so that -disable-gpl may be used to prevent
+  linking with GPL licenced libraries.
+
+- fixed bug in tinyrl_completion which was stomping on memory when there
+  were an exact multiple of 10 completions. Fix is to allocate one extra
+  entry for the NULL terminator.
+
+- fixed bug in clish_pargv_new() which was only allocating enough memory 
+  for the number of arguments entered on the command-line. In the case of
+  optional trailing parameters, which were not entered, this caused a memory
+  stomp! Fixed by allocating enough memory for the maximum of the entered 
+  parameters or the command parameters.
+
+- added clish_command__get_param_count() method to obtain the number of 
+  parameters associated with a command.
+
+- fixed bug in lub_heap_graft_to_bottom; the tail was not getting it's 
+  free and segment fields set up.
+
+\section _0_7_0 0.7.0
+- Updated shell_execute.c to ensure that directories are not executed
+
+- fixed minor bug in autocompletion of parameters. 
+  clish_shell_parameter_generator() needed to account for trailing space 
+  when giving context sensitive help for parameters.
+  
+- updated lub_heap to maintain the length of blocks inclusive of the block
+  headers and tail. This reduces the overhead of manipulating sizes during
+  operations and also addresses an issue with the re-use of previously freed blocks.
+
+- added dblockpool component for creating dynamic chunks to be used as 
+  blockpools. The lub_heap implementation now uses this for holding
+  context instances, which both reduces the overhead memory used and
+  greatly reduces fragmentation when detecting leaks.
+  
+- fixed double insert bug in the lub_bintree_insert.c file.
+  Although the function was correctly returning -1 it was also 
+  replacing the root node with the provided client node!
+
+- updated shell_tinyrl.c so that typing "?" whilst in the middle of a 
+  quoted string inserts the '?' character rather than giving context
+  sensitive help.
+
+- fixed memory leaks which occurred when clish thread is cancelled during 
+  execution of a script.
+
+- updated to make the execution of a script asynchronously cancellable.
+
+- modified clish_shell's history command to use new methods 
+
+- added tinyrl_history_entry__get_index() method and removed 
+  tinyrl_history__get_base()
+
+- modified tinyrl_history so that index is held in the history_entry 
+  instances Then updated the history insertion code so that duplicate
+  entries are only held once in the history. This means that numeric
+  gaps can now occur in the history list, but a stifled list will no
+  longer force recent commands off the list through the repetition of 
+  a single command.
+  
+- updated tinyrl_completion() so that if the completion list contains
+  words which have a common (case insensitive) prefix are correctly
+  handled. Before this fix if commands "one" and "OneTwoThree" both
+  existed in the same view then the user would be unable to type
+  anything beyond "one".
+
+- fixed bug in clish_shell_tinyrl_key_enter() where a pointer to the line
+  for the current tinyrl instance was being held onto after it had been 
+  changed by an auto-completion, hence was now referencing freed memory.
+
+- ensure that when reading a script and an error occurs we don't bother
+  to show the errored command line after the "DING"
+
+- ensure that after reading a script the prompt isn't duplicated.
+
+- fixed memory leak in clish_pargv_init() where the 'args' parameter wasn't
+  releasing its working string.
+
+- fixed tinyrl_redisplay so that CTRL-K works; wasn't accounting for 
+  insertion point movements before erasing characters from end of line.
+
+- fixed history.c so that stifled history lists add_n_replace() properly.
+  This also addresses an assertion which was occuring with "history 1"
+
+- updated clish_shell class so that when an error occurs in a script, 
+  execution is terminated in any parent scripts. 
+  This doesn't terminate an interactive session.
+  This means that a script will now only run until it's first error 
+  (or the first error of a child script etc...)
+
+- plugged a poential memory leak in lub_string_catn() function.
+
+- fixed clish_shell_delete() so that the file stack is cleared out.
+
+- updated lub/argv class to be more resilient when memory
+  allocation failures occur.
+
+- reduced the terminal noise generated by tinyrl when 
+  auto-completion occurs.
+
+- reduced the termnal noise generated by tinyrl when user deletes
+  characters from the end of a line.
+   
+- VxWorks has an issue with its pthreads library which means that a
+  cleanup hook can be called multiple times (recursively)!!!. Updated
+  the cleanup function to set the pthread cancel state to 
+  PTHREAD_CANCEL_DISABLE to prevent this.
+  
+- found and fixed a memory leak in the stack of files being used for input.
+
+- updated auto-completion code to handle quoted arguments.
+
+- fixed echoing issue when echoing should be hidden.
+
+- overhauled the auto-completion code. Now capable of autocompleting 
+  parameters as well as commands. Parameters are now validated as they
+  are typed. This has involved some restructuring of the
+  tinyrl_completion interfaces.
+
+- fixed so that validation of integers works correctly.
+
+- removing the spurious auto-completions has had the side effect of not 
+  echoing commands executed from scripts. fixed this issue.
+  
+- modified the help system so that if a command has possible other
+  commands which are an extension of the current command name 
+  (e.g. slot, slotOne, slotTwo) then the command help will be augmented
+  the summary help of the possile completion commands.
+  
+- fixed bug where the SPACE key could cause spurious completion 
+  information to be displayed before entering a space character.
+
+- fixed clish_shell_help.c so that any detailed help held for
+  "place-holder" commands (e.g. "show slot" has a place holder command 
+  called "show") will be displayed when ?? is entered.
+
+- fixed bug where entering a command which happened to be a prefix
+  of other commands, caused spurious completion information to be
+  displayed before executing the command.
+
+- cleaned up the tinyrl.c to remove a spurious tinyrl_crlf() call
+  when reading a line. If a command outputs no text to stdout/stderr
+  then the prompt will now reappear on the following
+  line rather than leave a blank.
+
+- Updated the context sensitive help so that any parmeters which
+  have specific ranges e.g. "integer" or "selection" indicate
+  these possible values in the help text.
+  
+- Updated the ptype class to allow for pre-processing of parameter
+  before validation. See the XML schema for details.
+
+- Updated the ptype class to allow three methods for parameter validation.
+ "regexp"[default], "integer" and "select" See the XML schema for details.
+
+- Went through the code cleaning up PC Lint issues.
+
+- Added a last_buffer field to the tinyrl class to cache the last
+ displayed line. This can then be used to reduce the number of output
+ characters when only a single char has been added to the end. 
+ This simplifies the automated testing/interaction with the CLI.
+ e.g. expect scripts.
+ 
+- updated tinyrl.c to cache the isatty settings. This provides a
+  new operation called tinyrl__get_isatty()
+
+- removed nested shell support for a single client. It is no longer
+  needed as the "clish_source" command is used instead of spawning
+  another shell.
+
+- changed so that history entries are only added for interactive lines.
+  So if for example a user were to "clish_source" another file, 
+  the commands so issued from that file will not be added to the history.
+  
+- changed "clish_spawn" back to "clish_source" and implemented a stack of 
+  file handles per shell instance. The spawning of a sub-script was 
+  resource intensive, and had issues with spawned pthreads not having 
+  the attributes (e.g. stack size) as the parent thread. It also felt
+  too clunky to have multiple shell associated with a single client.
+
+- fixed tinyrl_readline() to make sure that lines longer than 80 chars are
+  handled correctly when read from a script.
+  
+- modified tinyrl_replace_line() to only modify the insertion point if
+  the buffer shrinks beyond the current insertion point. This
+  addresses the inserting spaces in the middle of a line issue.
+  
+- fixed clish_shell_spawn_from_file() so that it returns 
+  BOOL_TRUE upon success.
+
+- fixed tclish executable to read input from files correctly.
+
+- updated tinyrl.c to simply read non-tty input streams rather than
+  try and treat them like an interactive session.
+  
+- fixed tclish executable to account for nested shells being attached
+  to a single client. (using the "clish_spawn" builtin command.) 
+  Only when the root shell is initialised or finalised will
+  the resources be allocated and freed.
+
+- renamed the "clish_source" builtin command to "clish_spawn"; it takes
+  a filename and spawns a new shell to interpret the contents of the file.
+
+- added tinyrl__get_istream() tinyrl__get_ostream(), 
+  tinyrl_vt100__get_istream() and tinyrl_vt100__get_ostream() operations. 
+  This means that a client of CLISH can identify which file handles are 
+  being used. This is useful in the case of a client which is sourcing 
+  files using the "clish_source" builtin command.
+
+- Fixed to ensure that SPACE auto-completion works with commands which
+  take "args" type parameters.
+  
+\section _0_6_3 0.6.3
+- Updated tinyrl.c to ensure that SPACE auto-completes multi-word commands.
+  
+- Updated tinyrl.c to ensure that the line is redisplayed after a
+  completion has been performed. This is needed to ensure that when
+  a line is complete e.g. when pressing ENTER, the completion is 
+  shown before moving on.
+
+- fixed a freed memory usage in clish/shell/shell_tinyrl.c where a 
+  line pointer was obtained before completion was performed, then used. 
+  Needed to re-aquire the line pointer after completion, because it
+  could have changed.
+
+- fixed a memory corruption in tinyrl/history.c where a spurious NULL
+  terminator was being added to the vector of history entries
+  and corrupting the heap.
+
+- Updated command help to show the full multi-word command in the
+  detailed help. Also shows required parameters &lt;like_this&gt;
+
+\section _0_6_2 0.6.2
+- removed any non-interpreter specific setup/restore details from
+  tclish_init_callback and tclishell_fini_callback and put them into 
+  tclish.cpp
+  
+- updated tinyrl_readline() to change the terminal input mode on the fly 
+  to raw mode and then restore it when the line has been entered. This
+  is needed to ensure that the terminal is in the correct mode for any 
+  sub-shells which are launched. This means that clish_init_callback.c
+  and clish_fini_callback.c are redundant so have been removed.
+
+- updated clish_shell_spawn interface to take a pthread attibute as
+  a parameter this makes it possible for a client to control the
+  thread details.  
+
+- Documentation cleanups; added link to sourceforge pages, removed
+  redundant issues, started a doxygen todo list.
+
+\section _0_6_1 0.6.1
+- Fixed a bug where trying to insert text in the middle of a line
+  caused the remains of the line to be deleted.
+
+- updated the tdemo script to use the normal installation location for TCL
+  /usr/share/tcl8.4 rather than /usr/local/share/tcl8.4 which is used when 
+  you build it from scratch.
+
+\section _0_6_0 0.6.0
+
+    
+\subsection _0_6_0e 0.6.0e
+- Fixed shell_spawn.c so that client initialisation can fail hence cause the 
+  creation of the shell instance to be terminated. This means that client's 
+  may choose to perform user authentication at this point if they so wish.
+
+- Added a cmd_line hook which is called to provide the client details of 
+  each command line accepted by the shell. This enables logging of this
+  detail if so required. 
+
+\subsection _0_6_0d 0.6.0d
+- updated the autoconf system to use the TCL version for the tclishX.X name.
+
+- fixed clish/tclish_init_callback.c so that Tcl_FindExecutable() is called.
+  This is required to setup the TCL environment correctly. 0.6.0c release 
+  didn't load init.tcl correctly and was also crashing when file operations
+  were performed (e.g. glob, pwd)
+
+- finalized clish.xsd with proper namespace details
+
+
+\subsection _0_6_0c 0.6.0c
+- Fixed autoconf scripts to check for pthreads and TCL library.
+
+- Updated lub_argv class to be able to tell you when a parameter was quoted.
+  The paramter value itself will not contain the " marks.
+  
+- Introduced "args" and "args_help" attributes to the COMMAND element. 
+  This enables the remenant of a command line, after the parameters defined in
+  the PARAMS elements, to be assigned to a psuedo parameter variable.
+
+- Introduced a "escape_chars" attribute to the COMMAND element. This allows 
+  commands to override the default selection of characters which are escaped 
+  (e.g. \$) when expanded from a variable. Escaping of special characters is a
+  security feature to prevent the user from executing an underlying shell
+  command through the use of "clever" parameters. e.g. "fred`rm -rf \*`bloggs"
+  would be a rather unfortunate parameter on a UNIX system!!!
+
+- Introduced a "builtin" attribute to the ACTION element. Also enabled clients
+  to register their own built commands when spawning a shell. The XML MUST now
+  specify a builtin attribute to invoke a builtin command callback.
+  
+- entering an empty line simply redisplays the prompt. This enables a user to 
+  create some clear space on the screen.
+
+- Added tinyxml into the distibution; currently the tarball of this 
+  component (available from http://www.grinninglizard.com/tinyxml/index.html)
+  doesn't support autoconf, so by adding this in (plus a module.am) you get 
+  autoconf support. This library is 'much' smaller than libxml2 and hence is
+  more appropriate for an embedded system. libxml2 is no longer needed by 
+  clish.
+  
+- Added spawn interface to the shell class. This causes a separate thread to 
+  be lauched to handle the shell session. This is required for flat namespace 
+  embedded envrioments where you may need to sustain multiple concurrent
+  sessions.
+  
+- Introduced tinyrl component. This is a simplistic replacement for the 
+  readline library, which cannot be used in embedded-single memory space 
+  systems due to the use of global variables. Tinyrl implements sufficient 
+  functionality for the clish component to function, and no-more although more 
+  may be added in the future. readline is no longer needed to build clish.
+
+- Updated clish component so that "viewid" tag can be used to define view
+  specific variables. The syntax is of the form "fred=hello world;bert=goodbye"
+  and causes ${fred} and ${bert} to expand to the assigned values whilst in the
+  new view.
+  NB. the values themselves may be based on variables available in the current
+  context (e.g. environment, parameters or current viewid variables.)
+  
+- Updated clish component to use history escape sequences via an external
+  history_expand function. 
+  tinyrl_history currently supports "!!" "!N" and "!-N" expansion.
+  
+- Updated clish component to not use the exit(1) command to terminate the shell
+  instead a "close" instruction can be given to the shell and it will exit it's
+  external loop and terminate normally. This is for ease of use in 
+  single-memory-space embedded systems.
+  
+- Added a partial string test, which confirmed a bug in the VxWorks standard
+  headers which was causing lub_string_nocase_cmp() to work incorrectly.
+  
+- Updated clish component to support STARTUP XML element. This is used to 
+  display a banner and perform a startup action when a shell is first started.
+
+- Updated clish component to support OVERVIEW XML element. This is used to 
+  display some textual help when the clish_overview internal command is 
+  specified in an ACTION element.
+  
+- Updated clish component to support the DETAILS XML element.
+  These enhance the context sensitive help with the ability to provide more
+  details for a particular command. (a repeated press of the '?' key displays
+  this extra detail)
+  
+- Introduces more built in commands (can be specified in the ACTION element)
+  There are now four in total.
+  "clish_close"        - terminates the session.
+  "clish_overview"     - displays the text defined in the OVERVIEW element
+                         of the XML.
+  "clish_history [n]"  - displays the currently held history of command lines.
+                         Also enables the stifling of the history list to a
+                         value specified by the optional parameter 'n'. 
+                         A value of zero means unstifled.                   
+  "clish_source file"  - spawn a separate clish session reading the input from
+                         the specified file. Output still goes to the current
+                         output stream.
+
+- Mapped [space] and [enter] to auto-complete commands if appropriate.
+
+
+<HR>
+
+\section _0_5_4 0.5.4
+This work was done as an employee of 3Com (http://www.3com.com)
+
+    Graeme McKerrell
+
+- Initial public release
+
+
+*/
+*/

+ 91 - 0
ISSUES

@@ -0,0 +1,91 @@
+/**
+\page _issues_page Issues
+
+\todo
+- placing a "?" character in a text file doesn't display help text when 
+  passed into clish.
+
+- ACTIONS which are meant to handle signals like CTRL-C 
+  don't seem to work properly, either the sub-script fails and the
+  shell breaks, or the sub-script never handles the signal (depending on 
+  platform).
+  
+- the heap unittest current has 10 failures
+
+- no unittests for the dblockpool component yet...
+
+- lub_heap_destroy() method should be provided which will de-register any allocated blocks from the
+  leak detection trees.
+
+- update leak detection to scan non-monitored allocated memory blocks, for references. This requires
+  the ability to iterate all the heaps in the system.
+
+- auto-completion currently doesn't handle optional parameters (defined using the "prefix" attribute).
+  
+- If a multi-word command is defined in global and local views then
+auto-completion currently works for both, but resolving doesn't seem to.
+\verbatim
+e.g. "mode"     - local view
+     "mode qos" - global view
+     Will auto-complete "mode qos" but won't run it...
+\endverbatim
+- Doesn't handle wrapping of long lines properly; get multiple lines scrolling
+  down the screen.
+- Not all files have been split out into one file per function...
+- need to complete the Doxygen documentation for clish, tinyrl and lub/argv
+
+\section _nice Nice to have
+- when importing from a namespace, allow the specification of the following:
+  no-help         - defaults to false but may be set true to prevent display in the help menu.
+  no-completion   - defaults to false but may be set true to prevent auto-completion. 
+  no-context-help - defaults to false but may be set true to prevent context sensitive help for 
+                    commands.
+
+- place an access level on namespaces; saves worrying about defining access for
+  every single command. e.g. device_show namespace could have different access
+  to device_config namespace. device view simply imports both namespaces.
+
+- When defining a default attribute if you could include a variable in the 
+  definition, default could be given meaningful values.
+- Augment the XML schema for support of dynamic variables.
+  e.g. 
+  \verbatim
+  <VARIABLE name="fred"><ACTION>puts "hello world"</ACTION></VARIABLE>
+  \endverbatim
+  will get the value of "hello world" when expanded as ${fred}... 
+  This is simple for TCL as the result is returned... what about for clish ,  
+  how do we get a return value into the execitable?
+
+- Currently handles commands in one view or all views. Better model is to be able
+  to specify a namespace for commands and then assign a view to a namespace.
+  e.g.
+  \verbatim
+ <NAMESPACE name="fred">
+    <COMMAND>
+ </NAMESPACE>
+ <VIEW name=" kdjkdj"...>
+    <IMPORT namespace="fred">
+    <COMMAND ...>
+ </VIEW>
+  \endverbatim
+  by default a view imports commands from the global namespace.
+  NB. need to be able to resolve commands from all included namespaces.
+  
+- In addition a command could become an alias for an entire namespace's worth
+  of sub-commands.
+  e.g.
+  \verbatim
+ <NAMESPACE name="config">
+   <COMMAND name="show"...>
+   <COMMAND name="show ip"...>
+   ...
+ </NAMESPACE>
+  
+ <VIEW name="foobar"...>
+    <COMMAND      name="do" 
+                  help="perform a configuration command" 
+             namespace="config"/>
+ </VIEW>
+  \endverbatim
+
+*/

+ 456 - 0
LICENCE

@@ -0,0 +1,456 @@
+/**
+\page _licence_page Licence
+
+\section Overview
+This package contains code which is copyrighted to multiple sources.
+
+<HR>
+
+\section _3com 3Com Corporation
+The intial public release of this software was developed by Graeme McKerrell
+whilst in the employment of 3Com Europe Ltd.
+
+\verbatim
+clish/
+clish/command
+clish/param
+clish/pargv
+clish/ptype
+clish/shell
+clish/variable
+clish/view
+
+lub/
+lub/argv
+lub/bintree
+lub/blockpool
+lub/test
+lub/dump
+lub/string
+\endverbatim
+
+
+Copyright (c) 2005, 3Com Corporation
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice,
+      this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright notice,
+      this list of conditions and the following disclaimer in the documentation
+      and/or other materials provided with the distribution.
+    * Neither the name of 3Com Corporation nor the names of its contributors may
+      be used to endorse or promote products derived from this software without
+      specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+<HR>
+
+\section _newport Newport Networks Ltd.
+The 0.6-0.7 releases of this software was developed by Graeme McKerrell whilst in the 
+employment of Newport Networks Ltd.
+As well as enhancing the existing code the following new modules were developed.
+
+\verbatim
+tinyrl/
+tinyrl/history
+tinyrl/vt100
+
+lub/heap/
+lub/heap/vxworks
+lub/heap/posix
+lub/dblockpool
+lubheap/
+lubheap/vxworks
+lubheap/posix
+
+\endverbatim
+
+
+Copyright (c) 2005,2006, Newport Networks Ltd
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice,
+      this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright notice,
+      this list of conditions and the following disclaimer in the documentation
+      and/or other materials provided with the distribution.
+    * Neither the name of Newport Networks Ltd nor the names of its contributors may
+      be used to endorse or promote products derived from this software without
+      specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+<HR>
+
+\section _tinyxml Yves Berquin
+As of release 0.6 the tinyxml library is included (unchanged) as part of the
+distribution.
+\verbatim
+tinyxml (v2.5.1)
+\endverbatim
+
+http://www.sourceforge.net/projects/tinyxml
+Original file by Yves Berquin.
+
+This software is provided 'as-is', without any express or implied 
+warranty. In no event will the authors be held liable for any 
+damages arising from the use of this software.
+
+Permission is granted to anyone to use this software for any 
+purpose, including commercial applications, and to alter it and 
+redistribute it freely, subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must 
+not claim that you wrote the original software. If you use this 
+software in a product, an acknowledgment in the product documentation 
+would be appreciated but is not required.
+
+2. Altered source versions must be plainly marked as such, and
+must not be misrepresented as being the original software.
+
+3. This notice may not be removed or altered from any source 
+distribution.
+
+<HR>
+
+\section _binutils GNU binutils
+As of release 0.7.1 libbfd can be used to resolve symbols for
+stacktraces. This feature can be turned off if linking with GPL code
+is problematic, using "configure --without-gpl".
+
+The Binary File Descriptor library is part of GNU binutils
+http://www.gnu.org/software/binutils/
+
+The following file is licenced under the GPLv2.
+
+\verbatim
+lub/heap/posix/heap_symShow.c
+
+This file is part of the CLISH project http://clish.sourceforge.net/
+
+The code in 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; version 2
+   
+This code 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+Derived from addr2line.c in the GNU binutils package by Ulrich.Lauther@mchp.siemens.de 
+
+\endverbatim
+
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+             
+<HR>
+
+*/

+ 45 - 0
Makefile.am

@@ -0,0 +1,45 @@
+## Process this file with automake to generate Makefile.in
+AUTOMAKE_OPTIONS        = foreign nostdinc
+
+AM_CPPFLAGS             = -I. -I$(top_srcdir)
+AM_LD                   = $(CXX)
+
+if DEBUG
+  DEBUG_CFLAGS = -DDEBUG
+endif
+
+AM_CFLAGS               = -ansi -pedantic -Werror -Wall -D_POSIX_C_SOURCE=199309 $(DEBUG_CFLAGS)
+
+bin_PROGRAMS            =
+lib_LTLIBRARIES         =
+lib_LIBRARIES           =
+nobase_include_HEADERS  =
+
+EXTRA_DIST              =  \
+    bin/module.am          \
+    clish/module.am        \
+    lub/module.am          \
+    lubheap/module.am      \
+    tinyrl/module.am       \
+    tinyxml/module.am      \
+    test/module.am         \
+    xml-examples/module.am \
+    cliconf/module.am      \
+    doxygen.config         \
+    clish.xsd              \
+    LICENCE                \
+    README                 \
+    CHANGES                \
+    ISSUES
+
+
+
+include $(top_srcdir)/bin/module.am
+include $(top_srcdir)/clish/module.am
+include $(top_srcdir)/lub/module.am
+include $(top_srcdir)/lubheap/module.am
+include $(top_srcdir)/tinyrl/module.am
+include $(top_srcdir)/tinyxml/module.am
+include $(top_srcdir)/test/module.am
+include $(top_srcdir)/xml-examples/module.am
+include $(top_srcdir)/cliconf/module.am

File diff suppressed because it is too large
+ 887 - 0
Makefile.in


+ 160 - 0
README

@@ -0,0 +1,160 @@
+/**
+\mainpage
+
+\section abstract Abstract
+A modular framework for implementing a CISCO-like CLI on a *NIX system.
+Arbitary command menus and actions can be defined using XML files.
+This software handles the user interaction, and forks the appropriate system
+commands to perform any actions. 
+
+- \ref _licence_page 
+- \ref _changes_page 
+- \ref _issues_page
+
+\section downloads Downloads
+This project is hosted on 
+<A HREF="http://sourceforge.net/projects/clish/">sourceforge.</A> from where
+the source-code can be downloaded.
+
+\section background Background
+The CISCO-like CLI has become a de-facto standard in the domain of network 
+devices. It is a much more restricted interface than traditional *NIX shells,
+hence is simpler to use and inherently more secure. As more devices move to 
+using an embedded *NIX operating systems, a simple, scalable means of producing 
+such a CLI becomes valuable.
+
+\section existing Existing Solutions
+
+\subsection Libcli
+<A HREF="http://libcli.sourceforge.net/">Libcli</A>
+provides a similar facility but has the following main limitations:-
+
+1) In order to add new commands a monolithic executable (which uses the
+   library) needs to be recompiled, after editing the source code to add the
+   newly required commands and actions.
+
+2) libcli takes responsiblity for attaching to a socket (telnet-like). This 
+   limits the usage of the CLI; difficult to use over SSH for example, similarly
+   cannot get the menus directly from an existing shell.
+
+3) The implementation of the command actions is hard-linked into the monolithic
+   executable, this can cause licence concerns/issues when a commercial company
+   wishes to control proprietry software from within the CLI.
+
+4) libcli takes responsiblity for the authentication of the user. This is
+   different from other "shells" which do not deal with authentication, but are
+   simply spawned as the required user.
+   
+\subsection GNU-zebra
+<A HREF="http://www.zebra.org/">Zebra</A>
+is a routing package, and comes with it's own integrated CLI, to handle its
+configuration (VTYSH).
+
+\section project CLISH Project
+The project is written (mostly) in ANSI-C and provides two example executables
+which can be used as a drop-in replacement for a more conventional "shell".
+
+The software was initially developed as part of some internal work at 3Com and
+due to the dependancy on 3rd party open-source packages, and it's self contained
+nature, it is being released into the public domain.
+
+It is designed to run on any *NIX system e.g. Linux, BSD, Cygwin and makes use
+of the following other opensource packages (glibc,tinyxml,doxygen)
+
+\subsection clish  clish  (pronounced see-lish)
+This application is a standard UNIX shell replacement. The ACTION tags in the XML
+specification are mapped to the system() call and hence will be interpreted as
+a Bourne-shell script.
+
+\subsection tclish tclish (pronounced tickle-ish)
+This application is built if the TCL libraries are present on the build system.
+The name of the executable produced will reflect the version of TCL used. e.g. 
+tclish8.4 will be generated if TCL8.4 is present on the system.
+
+This application will spawn a TCL interpreter when started, and the contents of
+the ACTION tags will be interpreted as TCL scripts within that interpreter for
+the duration of the shell.
+  
+\subsection Features
+The "clish" shell has the following features:-
+
+-	Provides CLI tree handling facilities
+	-	Tree built from multiple XML encoded files. (uses tinyxml)
+	        This means that XML configuration files can be be made part of
+		3rd party packages and simply installing them integrates
+		commands into the CLI.
+	
+-	Access permissions are defined as part of the CLI tree definition; a CLI
+	node/branch may be limited to a specific *NIX group.
+
+-	Provides interface to user
+	-	Handles auto-completion of commands
+	-	Only appropriate commands for the current user's "group" will be 
+		available.
+	-	Provides parameter type verification facility
+		*	Each parameter may be of a specific type, which the
+		        framework will ensure is correctly entered by the user.
+	-	Provides key-handling for the interface (uses tinyrl)
+		*	Provides command line editing facilities
+		*	up/down arrow keys
+		*	[TAB] command completion 
+		*	[CTRL-A] move to start of command line
+		*	[?] provides context sensitive help.
+
+- 	Able to be launched non-interactively
+	- textual scripts can be written to drive the CLI
+
+-	Executes a specified CLI command by launching the appropriate
+        (as defined in the CLI tree) system command line to perform the
+        required action
+	-	Only commands permitted for the current user are available.
+	-	During execution the I/O streams are handed over to the new 
+	        program.
+	-	Able to spawn a 3rd party shell, where necessary
+	        This will take over control of the  I/O channel until that
+		sub-shell exits.
+
+
+"clish" makes use of multiple XML files to define it's behaviour these...
+
+-	Identify scope of the commands (global or specific view(s))
+
+-	Include access permissions. By default a command will be
+        accessible to all users, but the schema will provide
+	the ability to limit the command based on UNIX group membership.
+
+-	Includes help text for menus
+
+-	Includes parameter definitions (with types where appropriate)
+
+-	Includes prompt modifications (different views)
+
+-	Includes full command line which each leaf node should execute
+        to achieve result.
+
+-	Separate set of files for each localization (language) can be
+        provided and determined by the user logging in.
+
+-	"packages" can contribute files to define their facilities
+        within the CLI; this makes augmentation of the CLI as simple
+	as including/excluding a particular package.
+
+\section example xml-example directory
+
+\include README
+
+Some of the example files are put here for reference:
+
+\subsection global_xml global-command.xml
+\include global-commands.xml
+
+\subsection startup_xml startup.xml
+\include startup.xml
+
+\subsection types_xml types.xml
+\include types.xml
+
+\subsection debug_xml debug-view.xml
+\include debug-view.xml
+
+*/

+ 8951 - 0
aclocal.m4

@@ -0,0 +1,8951 @@
+# generated automatically by aclocal 1.11 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.64],,
+[m4_warning([this file was generated for autoconf 2.64.
+You have another version of autoconf.  It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically `autoreconf'.])])
+
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+#
+#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+#                 2006, 2007, 2008 Free Software Foundation, Inc.
+#   Written by Gordon Matzigkeit, 1996
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+m4_define([_LT_COPYING], [dnl
+#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+#                 2006, 2007, 2008 Free Software Foundation, Inc.
+#   Written by Gordon Matzigkeit, 1996
+#
+#   This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING.  If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+])
+
+# serial 56 LT_INIT
+
+
+# LT_PREREQ(VERSION)
+# ------------------
+# Complain and exit if this libtool version is less that VERSION.
+m4_defun([LT_PREREQ],
+[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
+       [m4_default([$3],
+		   [m4_fatal([Libtool version $1 or higher is required],
+		             63)])],
+       [$2])])
+
+
+# _LT_CHECK_BUILDDIR
+# ------------------
+# Complain if the absolute build directory name contains unusual characters
+m4_defun([_LT_CHECK_BUILDDIR],
+[case `pwd` in
+  *\ * | *\	*)
+    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
+esac
+])
+
+
+# LT_INIT([OPTIONS])
+# ------------------
+AC_DEFUN([LT_INIT],
+[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
+AC_BEFORE([$0], [LT_LANG])dnl
+AC_BEFORE([$0], [LT_OUTPUT])dnl
+AC_BEFORE([$0], [LTDL_INIT])dnl
+m4_require([_LT_CHECK_BUILDDIR])dnl
+
+dnl Autoconf doesn't catch unexpanded LT_ macros by default:
+m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
+m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
+dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
+dnl unless we require an AC_DEFUNed macro:
+AC_REQUIRE([LTOPTIONS_VERSION])dnl
+AC_REQUIRE([LTSUGAR_VERSION])dnl
+AC_REQUIRE([LTVERSION_VERSION])dnl
+AC_REQUIRE([LTOBSOLETE_VERSION])dnl
+m4_require([_LT_PROG_LTMAIN])dnl
+
+dnl Parse OPTIONS
+_LT_SET_OPTIONS([$0], [$1])
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+_LT_SETUP
+
+# Only expand once:
+m4_define([LT_INIT])
+])# LT_INIT
+
+# Old names:
+AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
+AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
+dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
+
+
+# _LT_CC_BASENAME(CC)
+# -------------------
+# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+m4_defun([_LT_CC_BASENAME],
+[for cc_temp in $1""; do
+  case $cc_temp in
+    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+])
+
+
+# _LT_FILEUTILS_DEFAULTS
+# ----------------------
+# It is okay to use these file commands and assume they have been set
+# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
+m4_defun([_LT_FILEUTILS_DEFAULTS],
+[: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+])# _LT_FILEUTILS_DEFAULTS
+
+
+# _LT_SETUP
+# ---------
+m4_defun([_LT_SETUP],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+_LT_DECL([], [host_alias], [0], [The host system])dnl
+_LT_DECL([], [host], [0])dnl
+_LT_DECL([], [host_os], [0])dnl
+dnl
+_LT_DECL([], [build_alias], [0], [The build system])dnl
+_LT_DECL([], [build], [0])dnl
+_LT_DECL([], [build_os], [0])dnl
+dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+dnl
+AC_REQUIRE([AC_PROG_LN_S])dnl
+test -z "$LN_S" && LN_S="ln -s"
+_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
+dnl
+AC_REQUIRE([LT_CMD_MAX_LEN])dnl
+_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
+_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
+dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_CMD_RELOAD])dnl
+m4_require([_LT_CHECK_MAGIC_METHOD])dnl
+m4_require([_LT_CMD_OLD_ARCHIVE])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+
+_LT_CONFIG_LIBTOOL_INIT([
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
+fi
+])
+if test -n "${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
+fi
+
+_LT_CHECK_OBJDIR
+
+m4_require([_LT_TAG_COMPILER])dnl
+_LT_PROG_ECHO_BACKSLASH
+
+case $host_os in
+aix3*)
+  # AIX sometimes has problems with the GCC collect2 program.  For some
+  # reason, if we set the COLLECT_NAMES environment variable, the problems
+  # vanish in a puff of smoke.
+  if test "X${COLLECT_NAMES+set}" != Xset; then
+    COLLECT_NAMES=
+    export COLLECT_NAMES
+  fi
+  ;;
+esac
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([["`\\]]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+_LT_CC_BASENAME([$compiler])
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    _LT_PATH_MAGIC
+  fi
+  ;;
+esac
+
+# Use C for the default configuration in the libtool script
+LT_SUPPORTED_TAG([CC])
+_LT_LANG_C_CONFIG
+_LT_LANG_DEFAULT_CONFIG
+_LT_CONFIG_COMMANDS
+])# _LT_SETUP
+
+
+# _LT_PROG_LTMAIN
+# ---------------
+# Note that this code is called both from `configure', and `config.status'
+# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
+# `config.status' has no value for ac_aux_dir unless we are using Automake,
+# so we pass a copy along to make sure it has a sensible value anyway.
+m4_defun([_LT_PROG_LTMAIN],
+[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
+_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
+ltmain="$ac_aux_dir/ltmain.sh"
+])# _LT_PROG_LTMAIN
+
+
+
+# So that we can recreate a full libtool script including additional
+# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
+# in macros and then make a single call at the end using the `libtool'
+# label.
+
+
+# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
+# ----------------------------------------
+# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL_INIT],
+[m4_ifval([$1],
+          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
+                     [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_INIT])
+
+
+# _LT_CONFIG_LIBTOOL([COMMANDS])
+# ------------------------------
+# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL],
+[m4_ifval([$1],
+          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
+                     [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
+
+
+# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
+# -----------------------------------------------------
+m4_defun([_LT_CONFIG_SAVE_COMMANDS],
+[_LT_CONFIG_LIBTOOL([$1])
+_LT_CONFIG_LIBTOOL_INIT([$2])
+])
+
+
+# _LT_FORMAT_COMMENT([COMMENT])
+# -----------------------------
+# Add leading comment marks to the start of each line, and a trailing
+# full-stop to the whole comment if one is not present already.
+m4_define([_LT_FORMAT_COMMENT],
+[m4_ifval([$1], [
+m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
+              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
+)])
+
+
+
+
+
+# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
+# -------------------------------------------------------------------
+# CONFIGNAME is the name given to the value in the libtool script.
+# VARNAME is the (base) name used in the configure script.
+# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
+# VARNAME.  Any other value will be used directly.
+m4_define([_LT_DECL],
+[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
+    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
+	[m4_ifval([$1], [$1], [$2])])
+    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
+    m4_ifval([$4],
+	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
+    lt_dict_add_subkey([lt_decl_dict], [$2],
+	[tagged?], [m4_ifval([$5], [yes], [no])])])
+])
+
+
+# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
+# --------------------------------------------------------
+m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
+
+
+# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_tag_varnames],
+[_lt_decl_filter([tagged?], [yes], $@)])
+
+
+# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
+# ---------------------------------------------------------
+m4_define([_lt_decl_filter],
+[m4_case([$#],
+  [0], [m4_fatal([$0: too few arguments: $#])],
+  [1], [m4_fatal([$0: too few arguments: $#: $1])],
+  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
+  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
+  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
+])
+
+
+# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
+# --------------------------------------------------
+m4_define([lt_decl_quote_varnames],
+[_lt_decl_filter([value], [1], $@)])
+
+
+# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_dquote_varnames],
+[_lt_decl_filter([value], [2], $@)])
+
+
+# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_varnames_tagged],
+[m4_assert([$# <= 2])dnl
+_$0(m4_quote(m4_default([$1], [[, ]])),
+    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
+    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
+m4_define([_lt_decl_varnames_tagged],
+[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
+
+
+# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_all_varnames],
+[_$0(m4_quote(m4_default([$1], [[, ]])),
+     m4_if([$2], [],
+	   m4_quote(lt_decl_varnames),
+	m4_quote(m4_shift($@))))[]dnl
+])
+m4_define([_lt_decl_all_varnames],
+[lt_join($@, lt_decl_varnames_tagged([$1],
+			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
+])
+
+
+# _LT_CONFIG_STATUS_DECLARE([VARNAME])
+# ------------------------------------
+# Quote a variable value, and forward it to `config.status' so that its
+# declaration there will have the same value as in `configure'.  VARNAME
+# must have a single quote delimited value for this to work.
+m4_define([_LT_CONFIG_STATUS_DECLARE],
+[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`'])
+
+
+# _LT_CONFIG_STATUS_DECLARATIONS
+# ------------------------------
+# We delimit libtool config variables with single quotes, so when
+# we write them to config.status, we have to be sure to quote all
+# embedded single quotes properly.  In configure, this macro expands
+# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
+#
+#    <var>='`$ECHO "X$<var>" | $Xsed -e "$delay_single_quote_subst"`'
+m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
+    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAGS
+# ----------------
+# Output comment and list of tags supported by the script
+m4_defun([_LT_LIBTOOL_TAGS],
+[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
+available_tags="_LT_TAGS"dnl
+])
+
+
+# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
+# -----------------------------------
+# Extract the dictionary values for VARNAME (optionally with TAG) and
+# expand to a commented shell variable setting:
+#
+#    # Some comment about what VAR is for.
+#    visible_name=$lt_internal_name
+m4_define([_LT_LIBTOOL_DECLARE],
+[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
+					   [description])))[]dnl
+m4_pushdef([_libtool_name],
+    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
+m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
+    [0], [_libtool_name=[$]$1],
+    [1], [_libtool_name=$lt_[]$1],
+    [2], [_libtool_name=$lt_[]$1],
+    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
+m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
+])
+
+
+# _LT_LIBTOOL_CONFIG_VARS
+# -----------------------
+# Produce commented declarations of non-tagged libtool config variables
+# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
+# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
+# section) are produced by _LT_LIBTOOL_TAG_VARS.
+m4_defun([_LT_LIBTOOL_CONFIG_VARS],
+[m4_foreach([_lt_var],
+    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
+    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAG_VARS(TAG)
+# -------------------------
+m4_define([_LT_LIBTOOL_TAG_VARS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
+    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
+
+
+# _LT_TAGVAR(VARNAME, [TAGNAME])
+# ------------------------------
+m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
+
+
+# _LT_CONFIG_COMMANDS
+# -------------------
+# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
+# variables for single and double quote escaping we saved from calls
+# to _LT_DECL, we can put quote escaped variables declarations
+# into `config.status', and then the shell code to quote escape them in
+# for loops in `config.status'.  Finally, any additional code accumulated
+# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
+m4_defun([_LT_CONFIG_COMMANDS],
+[AC_PROVIDE_IFELSE([LT_OUTPUT],
+	dnl If the libtool generation code has been placed in $CONFIG_LT,
+	dnl instead of duplicating it all over again into config.status,
+	dnl then we will have config.status run $CONFIG_LT later, so it
+	dnl needs to know what name is stored there:
+        [AC_CONFIG_COMMANDS([libtool],
+            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
+    dnl If the libtool generation code is destined for config.status,
+    dnl expand the accumulated commands and init code now:
+    [AC_CONFIG_COMMANDS([libtool],
+        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
+])#_LT_CONFIG_COMMANDS
+
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
+[
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+_LT_CONFIG_STATUS_DECLARATIONS
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# Quote evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_quote_varnames); do
+    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+    *[[\\\\\\\`\\"\\\$]]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+# Double-quote double-evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_dquote_varnames); do
+    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+    *[[\\\\\\\`\\"\\\$]]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+# Fix-up fallback echo if it was mangled by the above quoting rules.
+case \$lt_ECHO in
+*'\\\[$]0 --fallback-echo"')dnl "
+  lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\`
+  ;;
+esac
+
+_LT_OUTPUT_LIBTOOL_INIT
+])
+
+
+# LT_OUTPUT
+# ---------
+# This macro allows early generation of the libtool script (before
+# AC_OUTPUT is called), incase it is used in configure for compilation
+# tests.
+AC_DEFUN([LT_OUTPUT],
+[: ${CONFIG_LT=./config.lt}
+AC_MSG_NOTICE([creating $CONFIG_LT])
+cat >"$CONFIG_LT" <<_LTEOF
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate a libtool stub with the current configuration.
+
+lt_cl_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_LTEOF
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+AS_SHELL_SANITIZE
+_AS_PREPARE
+
+exec AS_MESSAGE_FD>&1
+exec AS_MESSAGE_LOG_FD>>config.log
+{
+  echo
+  AS_BOX([Running $as_me.])
+} >&AS_MESSAGE_LOG_FD
+
+lt_cl_help="\
+\`$as_me' creates a local libtool stub from the current configuration,
+for use in further configure time tests before the real libtool is
+generated.
+
+Usage: $[0] [[OPTIONS]]
+
+  -h, --help      print this help, then exit
+  -V, --version   print version number, then exit
+  -q, --quiet     do not print progress messages
+  -d, --debug     don't remove temporary files
+
+Report bugs to <bug-libtool@gnu.org>."
+
+lt_cl_version="\
+m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
+m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
+configured by $[0], generated by m4_PACKAGE_STRING.
+
+Copyright (C) 2008 Free Software Foundation, Inc.
+This config.lt script is free software; the Free Software Foundation
+gives unlimited permision to copy, distribute and modify it."
+
+while test $[#] != 0
+do
+  case $[1] in
+    --version | --v* | -V )
+      echo "$lt_cl_version"; exit 0 ;;
+    --help | --h* | -h )
+      echo "$lt_cl_help"; exit 0 ;;
+    --debug | --d* | -d )
+      debug=: ;;
+    --quiet | --q* | --silent | --s* | -q )
+      lt_cl_silent=: ;;
+
+    -*) AC_MSG_ERROR([unrecognized option: $[1]
+Try \`$[0] --help' for more information.]) ;;
+
+    *) AC_MSG_ERROR([unrecognized argument: $[1]
+Try \`$[0] --help' for more information.]) ;;
+  esac
+  shift
+done
+
+if $lt_cl_silent; then
+  exec AS_MESSAGE_FD>/dev/null
+fi
+_LTEOF
+
+cat >>"$CONFIG_LT" <<_LTEOF
+_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
+_LTEOF
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+AC_MSG_NOTICE([creating $ofile])
+_LT_OUTPUT_LIBTOOL_COMMANDS
+AS_EXIT(0)
+_LTEOF
+chmod +x "$CONFIG_LT"
+
+# configure is writing to config.log, but config.lt does its own redirection,
+# appending to config.log, which fails on DOS, as config.log is still kept
+# open by configure.  Here we exec the FD to /dev/null, effectively closing
+# config.log, so it can be properly (re)opened and appended to by config.lt.
+if test "$no_create" != yes; then
+  lt_cl_success=:
+  test "$silent" = yes &&
+    lt_config_lt_args="$lt_config_lt_args --quiet"
+  exec AS_MESSAGE_LOG_FD>/dev/null
+  $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
+  exec AS_MESSAGE_LOG_FD>>config.log
+  $lt_cl_success || AS_EXIT(1)
+fi
+])# LT_OUTPUT
+
+
+# _LT_CONFIG(TAG)
+# ---------------
+# If TAG is the built-in tag, create an initial libtool script with a
+# default configuration from the untagged config vars.  Otherwise add code
+# to config.status for appending the configuration named by TAG from the
+# matching tagged config vars.
+m4_defun([_LT_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_CONFIG_SAVE_COMMANDS([
+  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
+  m4_if(_LT_TAG, [C], [
+    # See if we are running on zsh, and set the options which allow our
+    # commands through without removal of \ escapes.
+    if test -n "${ZSH_VERSION+set}" ; then
+      setopt NO_GLOB_SUBST
+    fi
+
+    cfgfile="${ofile}T"
+    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+    $RM "$cfgfile"
+
+    cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+_LT_COPYING
+_LT_LIBTOOL_TAGS
+
+# ### BEGIN LIBTOOL CONFIG
+_LT_LIBTOOL_CONFIG_VARS
+_LT_LIBTOOL_TAG_VARS
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+  case $host_os in
+  aix3*)
+    cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program.  For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+  COLLECT_NAMES=
+  export COLLECT_NAMES
+fi
+_LT_EOF
+    ;;
+  esac
+
+  _LT_PROG_LTMAIN
+
+  # We use sed instead of cat because bash on DJGPP gets confused if
+  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+  # text mode, it properly converts lines to CR/LF.  This bash problem
+  # is reportedly fixed, but why not run on old versions too?
+  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+    || (rm -f "$cfgfile"; exit 1)
+
+  _LT_PROG_XSI_SHELLFNS
+
+  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+    || (rm -f "$cfgfile"; exit 1)
+
+  mv -f "$cfgfile" "$ofile" ||
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+],
+[cat <<_LT_EOF >> "$ofile"
+
+dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
+dnl in a comment (ie after a #).
+# ### BEGIN LIBTOOL TAG CONFIG: $1
+_LT_LIBTOOL_TAG_VARS(_LT_TAG)
+# ### END LIBTOOL TAG CONFIG: $1
+_LT_EOF
+])dnl /m4_if
+],
+[m4_if([$1], [], [
+    PACKAGE='$PACKAGE'
+    VERSION='$VERSION'
+    TIMESTAMP='$TIMESTAMP'
+    RM='$RM'
+    ofile='$ofile'], [])
+])dnl /_LT_CONFIG_SAVE_COMMANDS
+])# _LT_CONFIG
+
+
+# LT_SUPPORTED_TAG(TAG)
+# ---------------------
+# Trace this macro to discover what tags are supported by the libtool
+# --tag option, using:
+#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
+AC_DEFUN([LT_SUPPORTED_TAG], [])
+
+
+# C support is built-in for now
+m4_define([_LT_LANG_C_enabled], [])
+m4_define([_LT_TAGS], [])
+
+
+# LT_LANG(LANG)
+# -------------
+# Enable libtool support for the given language if not already enabled.
+AC_DEFUN([LT_LANG],
+[AC_BEFORE([$0], [LT_OUTPUT])dnl
+m4_case([$1],
+  [C],			[_LT_LANG(C)],
+  [C++],		[_LT_LANG(CXX)],
+  [Java],		[_LT_LANG(GCJ)],
+  [Fortran 77],		[_LT_LANG(F77)],
+  [Fortran],		[_LT_LANG(FC)],
+  [Windows Resource],	[_LT_LANG(RC)],
+  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
+    [_LT_LANG($1)],
+    [m4_fatal([$0: unsupported language: "$1"])])])dnl
+])# LT_LANG
+
+
+# _LT_LANG(LANGNAME)
+# ------------------
+m4_defun([_LT_LANG],
+[m4_ifdef([_LT_LANG_]$1[_enabled], [],
+  [LT_SUPPORTED_TAG([$1])dnl
+  m4_append([_LT_TAGS], [$1 ])dnl
+  m4_define([_LT_LANG_]$1[_enabled], [])dnl
+  _LT_LANG_$1_CONFIG($1)])dnl
+])# _LT_LANG
+
+
+# _LT_LANG_DEFAULT_CONFIG
+# -----------------------
+m4_defun([_LT_LANG_DEFAULT_CONFIG],
+[AC_PROVIDE_IFELSE([AC_PROG_CXX],
+  [LT_LANG(CXX)],
+  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_F77],
+  [LT_LANG(F77)],
+  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_FC],
+  [LT_LANG(FC)],
+  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
+
+dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
+dnl pulling things in needlessly.
+AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+  [LT_LANG(GCJ)],
+  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+    [LT_LANG(GCJ)],
+    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
+      [LT_LANG(GCJ)],
+      [m4_ifdef([AC_PROG_GCJ],
+	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
+       m4_ifdef([A][M_PROG_GCJ],
+	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
+       m4_ifdef([LT_PROG_GCJ],
+	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
+
+AC_PROVIDE_IFELSE([LT_PROG_RC],
+  [LT_LANG(RC)],
+  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
+])# _LT_LANG_DEFAULT_CONFIG
+
+# Obsolete macros:
+AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
+AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
+AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
+AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
+dnl AC_DEFUN([AC_LIBTOOL_F77], [])
+dnl AC_DEFUN([AC_LIBTOOL_FC], [])
+dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
+
+
+# _LT_TAG_COMPILER
+# ----------------
+m4_defun([_LT_TAG_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
+
+_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
+_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
+_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
+_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_TAG_COMPILER
+
+
+# _LT_COMPILER_BOILERPLATE
+# ------------------------
+# Check for compiler boilerplate output or warnings with
+# the simple compiler test code.
+m4_defun([_LT_COMPILER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+])# _LT_COMPILER_BOILERPLATE
+
+
+# _LT_LINKER_BOILERPLATE
+# ----------------------
+# Check for linker boilerplate output or warnings with
+# the simple link test code.
+m4_defun([_LT_LINKER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+])# _LT_LINKER_BOILERPLATE
+
+# _LT_REQUIRED_DARWIN_CHECKS
+# -------------------------
+m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
+  case $host_os in
+    rhapsody* | darwin*)
+    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
+    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
+    AC_CHECK_TOOL([LIPO], [lipo], [:])
+    AC_CHECK_TOOL([OTOOL], [otool], [:])
+    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
+    _LT_DECL([], [DSYMUTIL], [1],
+      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
+    _LT_DECL([], [NMEDIT], [1],
+      [Tool to change global to local symbols on Mac OS X])
+    _LT_DECL([], [LIPO], [1],
+      [Tool to manipulate fat objects and archives on Mac OS X])
+    _LT_DECL([], [OTOOL], [1],
+      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
+    _LT_DECL([], [OTOOL64], [1],
+      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
+
+    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
+      [lt_cv_apple_cc_single_mod=no
+      if test -z "${LT_MULTI_MODULE}"; then
+	# By default we will add the -single_module flag. You can override
+	# by either setting the environment variable LT_MULTI_MODULE
+	# non-empty at configure time, or by adding -multi_module to the
+	# link flags.
+	rm -rf libconftest.dylib*
+	echo "int foo(void){return 1;}" > conftest.c
+	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
+	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+        _lt_result=$?
+	if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+	  lt_cv_apple_cc_single_mod=yes
+	else
+	  cat conftest.err >&AS_MESSAGE_LOG_FD
+	fi
+	rm -rf libconftest.dylib*
+	rm -f conftest.*
+      fi])
+    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
+      [lt_cv_ld_exported_symbols_list],
+      [lt_cv_ld_exported_symbols_list=no
+      save_LDFLAGS=$LDFLAGS
+      echo "_main" > conftest.sym
+      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+	[lt_cv_ld_exported_symbols_list=yes],
+	[lt_cv_ld_exported_symbols_list=no])
+	LDFLAGS="$save_LDFLAGS"
+    ])
+    case $host_os in
+    rhapsody* | darwin1.[[012]])
+      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+    darwin1.*)
+      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+    darwin*) # darwin 5.x on
+      # if running on 10.5 or later, the deployment target defaults
+      # to the OS version, if on x86, and 10.4, the deployment
+      # target defaults to 10.4. Don't you love it?
+      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
+	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+	10.[[012]]*)
+	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+	10.*)
+	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+      esac
+    ;;
+  esac
+    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+      _lt_dar_single_mod='$single_module'
+    fi
+    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+    else
+      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    fi
+    if test "$DSYMUTIL" != ":"; then
+      _lt_dsymutil='~$DSYMUTIL $lib || :'
+    else
+      _lt_dsymutil=
+    fi
+    ;;
+  esac
+])
+
+
+# _LT_DARWIN_LINKER_FEATURES
+# --------------------------
+# Checks for linker and compiler features on darwin
+m4_defun([_LT_DARWIN_LINKER_FEATURES],
+[
+  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
+  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+  _LT_TAGVAR(hardcode_direct, $1)=no
+  _LT_TAGVAR(hardcode_automatic, $1)=yes
+  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+  _LT_TAGVAR(whole_archive_flag_spec, $1)=''
+  _LT_TAGVAR(link_all_deplibs, $1)=yes
+  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
+  case $cc_basename in
+     ifort*) _lt_dar_can_shared=yes ;;
+     *) _lt_dar_can_shared=$GCC ;;
+  esac
+  if test "$_lt_dar_can_shared" = "yes"; then
+    output_verbose_link_cmd=echo
+    _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+    _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+    _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+    m4_if([$1], [CXX],
+[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+      _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+      _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+    fi
+],[])
+  else
+  _LT_TAGVAR(ld_shlibs, $1)=no
+  fi
+])
+
+# _LT_SYS_MODULE_PATH_AIX
+# -----------------------
+# Links a minimal program and checks the executable
+# for the system default hardcoded library path. In most cases,
+# this is /usr/lib:/lib, but when the MPI compilers are used
+# the location of the communication and MPI libs are included too.
+# If we don't find anything, use the default library path according
+# to the aix ld manual.
+m4_defun([_LT_SYS_MODULE_PATH_AIX],
+[m4_require([_LT_DECL_SED])dnl
+AC_LINK_IFELSE(AC_LANG_PROGRAM,[
+lt_aix_libpath_sed='
+    /Import File Strings/,/^$/ {
+	/^0/ {
+	    s/^0  *\(.*\)$/\1/
+	    p
+	}
+    }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi],[])
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+])# _LT_SYS_MODULE_PATH_AIX
+
+
+# _LT_SHELL_INIT(ARG)
+# -------------------
+m4_define([_LT_SHELL_INIT],
+[ifdef([AC_DIVERSION_NOTICE],
+	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
+	 [AC_DIVERT_PUSH(NOTICE)])
+$1
+AC_DIVERT_POP
+])# _LT_SHELL_INIT
+
+
+# _LT_PROG_ECHO_BACKSLASH
+# -----------------------
+# Add some code to the start of the generated configure script which
+# will find an echo command which doesn't interpret backslashes.
+m4_defun([_LT_PROG_ECHO_BACKSLASH],
+[_LT_SHELL_INIT([
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$lt_ECHO in
+X*--fallback-echo)
+  # Remove one level of quotation (which was required for Make).
+  ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
+  ;;
+esac
+
+ECHO=${lt_ECHO-echo}
+if test "X[$]1" = X--no-reexec; then
+  # Discard the --no-reexec flag, and continue.
+  shift
+elif test "X[$]1" = X--fallback-echo; then
+  # Avoid inline document here, it may be left over
+  :
+elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
+  # Yippee, $ECHO works!
+  :
+else
+  # Restart under the correct shell.
+  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
+fi
+
+if test "X[$]1" = X--fallback-echo; then
+  # used as fallback echo
+  shift
+  cat <<_LT_EOF
+[$]*
+_LT_EOF
+  exit 0
+fi
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test -z "$lt_ECHO"; then
+  if test "X${echo_test_string+set}" != Xset; then
+    # find a string as large as possible, as long as the shell can cope with it
+    for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
+      # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+      if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
+	 { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
+      then
+        break
+      fi
+    done
+  fi
+
+  if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
+     echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
+     test "X$echo_testing_string" = "X$echo_test_string"; then
+    :
+  else
+    # The Solaris, AIX, and Digital Unix default echo programs unquote
+    # backslashes.  This makes it impossible to quote backslashes using
+    #   echo "$something" | sed 's/\\/\\\\/g'
+    #
+    # So, first we look for a working echo in the user's PATH.
+
+    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    for dir in $PATH /usr/ucb; do
+      IFS="$lt_save_ifs"
+      if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+         test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+         echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+         test "X$echo_testing_string" = "X$echo_test_string"; then
+        ECHO="$dir/echo"
+        break
+      fi
+    done
+    IFS="$lt_save_ifs"
+
+    if test "X$ECHO" = Xecho; then
+      # We didn't find a better echo, so look for alternatives.
+      if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
+         echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
+         test "X$echo_testing_string" = "X$echo_test_string"; then
+        # This shell has a builtin print -r that does the trick.
+        ECHO='print -r'
+      elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
+	   test "X$CONFIG_SHELL" != X/bin/ksh; then
+        # If we have ksh, try running configure again with it.
+        ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+        export ORIGINAL_CONFIG_SHELL
+        CONFIG_SHELL=/bin/ksh
+        export CONFIG_SHELL
+        exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
+      else
+        # Try using printf.
+        ECHO='printf %s\n'
+        if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
+	   echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
+	   test "X$echo_testing_string" = "X$echo_test_string"; then
+	  # Cool, printf works
+	  :
+        elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+	     test "X$echo_testing_string" = 'X\t' &&
+	     echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+	     test "X$echo_testing_string" = "X$echo_test_string"; then
+	  CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+	  export CONFIG_SHELL
+	  SHELL="$CONFIG_SHELL"
+	  export SHELL
+	  ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
+        elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+	     test "X$echo_testing_string" = 'X\t' &&
+	     echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+	     test "X$echo_testing_string" = "X$echo_test_string"; then
+	  ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
+        else
+	  # maybe with a smaller string...
+	  prev=:
+
+	  for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
+	    if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
+	    then
+	      break
+	    fi
+	    prev="$cmd"
+	  done
+
+	  if test "$prev" != 'sed 50q "[$]0"'; then
+	    echo_test_string=`eval $prev`
+	    export echo_test_string
+	    exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
+	  else
+	    # Oops.  We lost completely, so just stick with echo.
+	    ECHO=echo
+	  fi
+        fi
+      fi
+    fi
+  fi
+fi
+
+# Copy echo and quote the copy suitably for passing to libtool from
+# the Makefile, instead of quoting the original, which is used later.
+lt_ECHO=$ECHO
+if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
+   lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
+fi
+
+AC_SUBST(lt_ECHO)
+])
+_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
+_LT_DECL([], [ECHO], [1],
+    [An echo program that does not interpret backslashes])
+])# _LT_PROG_ECHO_BACKSLASH
+
+
+# _LT_ENABLE_LOCK
+# ---------------
+m4_defun([_LT_ENABLE_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+  [AS_HELP_STRING([--disable-libtool-lock],
+    [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.$ac_objext` in
+      *ELF-32*)
+	HPUX_IA64_MODE="32"
+	;;
+      *ELF-64*)
+	HPUX_IA64_MODE="64"
+	;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+*-*-irix6*)
+  # Find out which ABI we are using.
+  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    if test "$lt_cv_prog_gnu_ld" = yes; then
+      case `/usr/bin/file conftest.$ac_objext` in
+	*32-bit*)
+	  LD="${LD-ld} -melf32bsmip"
+	  ;;
+	*N32*)
+	  LD="${LD-ld} -melf32bmipn32"
+	  ;;
+	*64-bit*)
+	  LD="${LD-ld} -melf64bmip"
+	;;
+      esac
+    else
+      case `/usr/bin/file conftest.$ac_objext` in
+	*32-bit*)
+	  LD="${LD-ld} -32"
+	  ;;
+	*N32*)
+	  LD="${LD-ld} -n32"
+	  ;;
+	*64-bit*)
+	  LD="${LD-ld} -64"
+	  ;;
+      esac
+    fi
+  fi
+  rm -rf conftest*
+  ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.o` in
+      *32-bit*)
+	case $host in
+	  x86_64-*kfreebsd*-gnu)
+	    LD="${LD-ld} -m elf_i386_fbsd"
+	    ;;
+	  x86_64-*linux*)
+	    LD="${LD-ld} -m elf_i386"
+	    ;;
+	  ppc64-*linux*|powerpc64-*linux*)
+	    LD="${LD-ld} -m elf32ppclinux"
+	    ;;
+	  s390x-*linux*)
+	    LD="${LD-ld} -m elf_s390"
+	    ;;
+	  sparc64-*linux*)
+	    LD="${LD-ld} -m elf32_sparc"
+	    ;;
+	esac
+	;;
+      *64-bit*)
+	case $host in
+	  x86_64-*kfreebsd*-gnu)
+	    LD="${LD-ld} -m elf_x86_64_fbsd"
+	    ;;
+	  x86_64-*linux*)
+	    LD="${LD-ld} -m elf_x86_64"
+	    ;;
+	  ppc*-*linux*|powerpc*-*linux*)
+	    LD="${LD-ld} -m elf64ppc"
+	    ;;
+	  s390*-*linux*|s390*-*tpf*)
+	    LD="${LD-ld} -m elf64_s390"
+	    ;;
+	  sparc*-*linux*)
+	    LD="${LD-ld} -m elf64_sparc"
+	    ;;
+	esac
+	;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+
+*-*-sco3.2v5*)
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -belf"
+  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+    [AC_LANG_PUSH(C)
+     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+     AC_LANG_POP])
+  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+    CFLAGS="$SAVE_CFLAGS"
+  fi
+  ;;
+sparc*-*solaris*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.o` in
+    *64-bit*)
+      case $lt_cv_prog_gnu_ld in
+      yes*) LD="${LD-ld} -m elf64_sparc" ;;
+      *)
+	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+	  LD="${LD-ld} -64"
+	fi
+	;;
+      esac
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+esac
+
+need_locks="$enable_libtool_lock"
+])# _LT_ENABLE_LOCK
+
+
+# _LT_CMD_OLD_ARCHIVE
+# -------------------
+m4_defun([_LT_CMD_OLD_ARCHIVE],
+[AC_CHECK_TOOL(AR, ar, false)
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+_LT_DECL([], [AR], [1], [The archiver])
+_LT_DECL([], [AR_FLAGS], [1])
+
+AC_CHECK_TOOL(STRIP, strip, :)
+test -z "$STRIP" && STRIP=:
+_LT_DECL([], [STRIP], [1], [A symbol stripping program])
+
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+test -z "$RANLIB" && RANLIB=:
+_LT_DECL([], [RANLIB], [1],
+    [Commands used to install an old-style archive])
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+    ;;
+  *)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+_LT_DECL([], [old_postinstall_cmds], [2])
+_LT_DECL([], [old_postuninstall_cmds], [2])
+_LT_TAGDECL([], [old_archive_cmds], [2],
+    [Commands used to build an old-style archive])
+])# _LT_CMD_OLD_ARCHIVE
+
+
+# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([_LT_COMPILER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$3"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&AS_MESSAGE_LOG_FD
+   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       $2=yes
+     fi
+   fi
+   $RM conftest*
+])
+
+if test x"[$]$2" = xyes; then
+    m4_if([$5], , :, [$5])
+else
+    m4_if([$6], , :, [$6])
+fi
+])# _LT_COMPILER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
+dnl aclocal-1.4 backwards compatibility: