aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMu Qiao <qiaomuf@gentoo.org>2011-06-28 20:35:12 +0800
committerPetteri Räty <petsku@petteriraty.eu>2011-07-03 22:50:09 +0300
commit23776966a6f54657349622ffce6ae0bc89da48e3 (patch)
tree646cefa43da619e01fa85e0a1d39d13cb56adf07
parentCore: fix headers that don't follow the coding style (diff)
downloadlibbash-23776966a6f54657349622ffce6ae0bc89da48e3.tar.gz
libbash-23776966a6f54657349622ffce6ae0bc89da48e3.tar.bz2
libbash-23776966a6f54657349622ffce6ae0bc89da48e3.zip
Build: remove auto generated files
.gitignore is updated to avoid such cases in future.
-rw-r--r--.gitignore1
-rw-r--r--libbash-0.1/AUTHORS3
-rw-r--r--libbash-0.1/COPYING339
-rw-r--r--libbash-0.1/Makefile.am377
-rw-r--r--libbash-0.1/README44
-rw-r--r--libbash-0.1/_build/cgrammar.run.tmp0
-rw-r--r--libbash-0.1/_build/javagrammar.run.tmp0
-rwxr-xr-xlibbash-0.1/autogen.sh2
-rw-r--r--libbash-0.1/bashast/bashast.g773
-rw-r--r--libbash-0.1/bashast/features_script/features.sh121
-rw-r--r--libbash-0.1/bashast/features_script/features.sh.ast1
-rw-r--r--libbash-0.1/bashast/gunit/arith_main.gunit139
-rw-r--r--libbash-0.1/bashast/gunit/array.gunit53
-rw-r--r--libbash-0.1/bashast/gunit/assoc_array.gunit28
-rw-r--r--libbash-0.1/bashast/gunit/brace.gunit34
-rw-r--r--libbash-0.1/bashast/gunit/command_sub.gunit26
-rw-r--r--libbash-0.1/bashast/gunit/comment.gunit33
-rw-r--r--libbash-0.1/bashast/gunit/compound.gunit197
-rw-r--r--libbash-0.1/bashast/gunit/cond_main.gunit35
-rw-r--r--libbash-0.1/bashast/gunit/continued_lines.gunit30
-rw-r--r--libbash-0.1/bashast/gunit/expansions.gunit30
-rw-r--r--libbash-0.1/bashast/gunit/fname.gunit73
-rw-r--r--libbash-0.1/bashast/gunit/function.gunit53
-rw-r--r--libbash-0.1/bashast/gunit/list.gunit46
-rw-r--r--libbash-0.1/bashast/gunit/param_main.gunit72
-rw-r--r--libbash-0.1/bashast/gunit/pipeline.gunit32
-rw-r--r--libbash-0.1/bashast/gunit/process_substitution.gunit23
-rw-r--r--libbash-0.1/bashast/gunit/redir.gunit38
-rwxr-xr-xlibbash-0.1/bashast/gunit/runtests.sh21
-rw-r--r--libbash-0.1/bashast/gunit/simp_command.gunit36
-rw-r--r--libbash-0.1/bashast/gunit/simp_prog.gunit38
-rw-r--r--libbash-0.1/bashast/libbashWalker.g1153
-rw-r--r--libbash-0.1/configure.ac73
-rw-r--r--libbash-0.1/doxygen.am186
-rw-r--r--libbash-0.1/m4/ax_boost_base.m4252
-rw-r--r--libbash-0.1/m4/ax_boost_filesystem.m4118
-rw-r--r--libbash-0.1/m4/ax_boost_program_options.m4108
-rw-r--r--libbash-0.1/m4/ax_boost_system.m4120
-rw-r--r--libbash-0.1/m4/doxample.m4321
-rw-r--r--libbash-0.1/m4/gtest.m474
-rw-r--r--libbash-0.1/m4/libtool.m47450
-rw-r--r--libbash-0.1/m4/ltoptions.m4369
-rw-r--r--libbash-0.1/m4/ltsugar.m4123
-rw-r--r--libbash-0.1/m4/ltversion.m423
-rw-r--r--libbash-0.1/m4/lt~obsolete.m498
-rw-r--r--libbash-0.1/scripts/arithmetic_assignment.bash24
-rw-r--r--libbash-0.1/scripts/arithmetic_assignment.bash.result22
-rw-r--r--libbash-0.1/scripts/bar.eclass5
-rw-r--r--libbash-0.1/scripts/binary_arithmetic.bash67
-rw-r--r--libbash-0.1/scripts/binary_arithmetic.bash.result64
-rw-r--r--libbash-0.1/scripts/command_execution.bash59
-rw-r--r--libbash-0.1/scripts/command_execution.bash.result67
-rw-r--r--libbash-0.1/scripts/compound_command.bash353
-rw-r--r--libbash-0.1/scripts/compound_command.bash.result61
-rw-r--r--libbash-0.1/scripts/foo.eclass5
-rw-r--r--libbash-0.1/scripts/function_def.bash89
-rw-r--r--libbash-0.1/scripts/function_def.bash.result29
-rw-r--r--libbash-0.1/scripts/illegal_script.sh1
-rw-r--r--libbash-0.1/scripts/isolated_functions.bash13
-rw-r--r--libbash-0.1/scripts/isolated_functions.bash.result12
-rw-r--r--libbash-0.1/scripts/source_false.sh1
-rw-r--r--libbash-0.1/scripts/source_return.sh2
-rw-r--r--libbash-0.1/scripts/source_true.sh6
-rw-r--r--libbash-0.1/scripts/sunpinyin-2.0.3-r1.ebuild34
-rw-r--r--libbash-0.1/scripts/sunpinyin-2.0.3-r1.ebuild.result22
-rw-r--r--libbash-0.1/scripts/test_expr.bash54
-rw-r--r--libbash-0.1/scripts/test_expr.bash.result28
-rw-r--r--libbash-0.1/scripts/var_def.bash42
-rw-r--r--libbash-0.1/scripts/var_def.bash.result35
-rw-r--r--libbash-0.1/scripts/var_expansion.bash115
-rw-r--r--libbash-0.1/scripts/var_expansion.bash.result110
-rw-r--r--libbash-0.1/src/builtins/boolean_builtins.h40
-rw-r--r--libbash-0.1/src/builtins/break_builtin.cpp51
-rw-r--r--libbash-0.1/src/builtins/break_builtin.h35
-rw-r--r--libbash-0.1/src/builtins/builtin_exceptions.h97
-rw-r--r--libbash-0.1/src/builtins/continue_builtin.cpp51
-rw-r--r--libbash-0.1/src/builtins/continue_builtin.h35
-rw-r--r--libbash-0.1/src/builtins/declare_builtin.cpp114
-rw-r--r--libbash-0.1/src/builtins/declare_builtin.h46
-rw-r--r--libbash-0.1/src/builtins/echo_builtin.cpp120
-rw-r--r--libbash-0.1/src/builtins/echo_builtin.h56
-rw-r--r--libbash-0.1/src/builtins/eval_builtin.cpp38
-rw-r--r--libbash-0.1/src/builtins/eval_builtin.h46
-rw-r--r--libbash-0.1/src/builtins/inherit_builtin.cpp129
-rw-r--r--libbash-0.1/src/builtins/inherit_builtin.h54
-rw-r--r--libbash-0.1/src/builtins/let_builtin.cpp37
-rw-r--r--libbash-0.1/src/builtins/let_builtin.h35
-rw-r--r--libbash-0.1/src/builtins/printf_builtin.cpp63
-rw-r--r--libbash-0.1/src/builtins/printf_builtin.h35
-rw-r--r--libbash-0.1/src/builtins/return_builtin.cpp38
-rw-r--r--libbash-0.1/src/builtins/return_builtin.h35
-rw-r--r--libbash-0.1/src/builtins/shopt_builtin.cpp68
-rw-r--r--libbash-0.1/src/builtins/shopt_builtin.h37
-rw-r--r--libbash-0.1/src/builtins/source_builtin.cpp72
-rw-r--r--libbash-0.1/src/builtins/source_builtin.h46
-rw-r--r--libbash-0.1/src/builtins/tests/boolean_tests.cpp44
-rw-r--r--libbash-0.1/src/builtins/tests/break_tests.cpp69
-rw-r--r--libbash-0.1/src/builtins/tests/continue_tests.cpp69
-rw-r--r--libbash-0.1/src/builtins/tests/declare_tests.cpp121
-rw-r--r--libbash-0.1/src/builtins/tests/echo_tests.cpp59
-rw-r--r--libbash-0.1/src/builtins/tests/printf_tests.cpp67
-rw-r--r--libbash-0.1/src/builtins/tests/return_tests.cpp43
-rw-r--r--libbash-0.1/src/builtins/tests/shopt_tests.cpp76
-rw-r--r--libbash-0.1/src/builtins/tests/source_tests.cpp103
-rw-r--r--libbash-0.1/src/builtins/unset_builtin.cpp57
-rw-r--r--libbash-0.1/src/builtins/unset_builtin.h35
-rw-r--r--libbash-0.1/src/common.h30
-rw-r--r--libbash-0.1/src/core/bash_ast.cpp218
-rw-r--r--libbash-0.1/src/core/bash_ast.h114
-rw-r--r--libbash-0.1/src/core/bash_condition.cpp186
-rw-r--r--libbash-0.1/src/core/bash_condition.h40
-rw-r--r--libbash-0.1/src/core/divide_by_zero_error.h47
-rw-r--r--libbash-0.1/src/core/exceptions.h35
-rw-r--r--libbash-0.1/src/core/function.cpp38
-rw-r--r--libbash-0.1/src/core/function.h44
-rw-r--r--libbash-0.1/src/core/illegal_argument_exception.h47
-rw-r--r--libbash-0.1/src/core/interpreter.cpp437
-rw-r--r--libbash-0.1/src/core/interpreter.h517
-rw-r--r--libbash-0.1/src/core/interpreter_exception.h46
-rw-r--r--libbash-0.1/src/core/parse_exception.h47
-rw-r--r--libbash-0.1/src/core/readonly_exception.h47
-rw-r--r--libbash-0.1/src/core/runtime_exception.h47
-rw-r--r--libbash-0.1/src/core/symbols.hpp246
-rw-r--r--libbash-0.1/src/core/tests/bash_ast_test.cpp56
-rw-r--r--libbash-0.1/src/core/tests/bash_condition_test.cpp191
-rw-r--r--libbash-0.1/src/core/tests/interpreter_test.cpp263
-rw-r--r--libbash-0.1/src/core/tests/symbols_test.cpp152
-rw-r--r--libbash-0.1/src/core/unsupported_exception.h47
-rw-r--r--libbash-0.1/src/cppbash_builtin.cpp104
-rw-r--r--libbash-0.1/src/cppbash_builtin.h132
-rw-r--r--libbash-0.1/src/libbash.cpp80
-rw-r--r--libbash-0.1/src/libbash.h62
-rw-r--r--libbash-0.1/test/api_test.cpp85
-rwxr-xr-xlibbash-0.1/test/ast_printer_test.sh33
-rwxr-xr-xlibbash-0.1/test/ebuild_compiler.sh11
-rw-r--r--libbash-0.1/test/post_check.cpp49
-rw-r--r--libbash-0.1/test/run_tests.cpp37
-rwxr-xr-xlibbash-0.1/test/script_compiler.sh14
-rw-r--r--libbash-0.1/test/test.cpp34
-rw-r--r--libbash-0.1/test/test.h30
-rwxr-xr-xlibbash-0.1/test/verify_bashs_test.sh5
-rwxr-xr-xlibbash-0.1/test/verify_error_output_test.sh5
-rw-r--r--libbash-0.1/test/walker_test.cpp102
-rwxr-xr-xlibbash-0.1/test_coverage.sh35
-rw-r--r--libbash-0.1/utils/ast_printer.cpp240
-rw-r--r--libbash-0.1/utils/command_line.cpp88
-rw-r--r--libbash-0.1/utils/command_line.h62
-rw-r--r--libbash-0.1/utils/instruo.cpp263
-rwxr-xr-xlibbash-0.1/utils/isolated-functions.sh55
-rw-r--r--libbash-0.1/utils/metadata.cpp117
-rw-r--r--libbash-0.1/utils/metadata.h30
-rwxr-xr-xlibbash-0.1/utils/metadata_diff.sh36
-rw-r--r--libbash-0.1/utils/metadata_generator.cpp45
-rw-r--r--libbash-0.1/utils/variable_printer.cpp77
154 files changed, 1 insertions, 21332 deletions
diff --git a/.gitignore b/.gitignore
index df9d332..93c80f9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,6 +9,7 @@
*.class
*.java
*.tokens
+libbash-*
.deps
.libs
.dirstamp
diff --git a/libbash-0.1/AUTHORS b/libbash-0.1/AUTHORS
deleted file mode 100644
index 55ec4a1..0000000
--- a/libbash-0.1/AUTHORS
+++ /dev/null
@@ -1,3 +0,0 @@
-Nathan Eloe <powerofazure@gmail.com>
-Petteri Räty <betelgeuse@gentoo.org>
-Mu Qiao <qiaomuf@gentoo.org>
diff --git a/libbash-0.1/COPYING b/libbash-0.1/COPYING
deleted file mode 100644
index d159169..0000000
--- a/libbash-0.1/COPYING
+++ /dev/null
@@ -1,339 +0,0 @@
- 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
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
diff --git a/libbash-0.1/Makefile.am b/libbash-0.1/Makefile.am
deleted file mode 100644
index fb36438..0000000
--- a/libbash-0.1/Makefile.am
+++ /dev/null
@@ -1,377 +0,0 @@
-###############################################
-#Please use git log for copyright holder and year information
-#
-#This file is part of libbash.
-#
-#libbash 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.
-#
-#libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-###############################################
-# Makefile.am for libbash
-# Author: Nathan Eloe
-###############################################
-include doxygen.am
-
-ACLOCAL_AMFLAGS = -I m4
-
-TEST_EXTENSIONS= .gunit .bash .ebuild
-GUNIT_LOG_COMPILER = $(srcdir)/bashast/gunit/runtests.sh
-AM_GUNIT_LOG_FLAGS = @antlr_cp@:.
-GUNIT_TESTS = bashast/gunit/arith_main.gunit \
- bashast/gunit/array.gunit \
- bashast/gunit/assoc_array.gunit \
- bashast/gunit/brace.gunit \
- bashast/gunit/command_sub.gunit \
- bashast/gunit/comment.gunit \
- bashast/gunit/compound.gunit \
- bashast/gunit/cond_main.gunit \
- bashast/gunit/continued_lines.gunit \
- bashast/gunit/expansions.gunit \
- bashast/gunit/fname.gunit \
- bashast/gunit/function.gunit \
- bashast/gunit/list.gunit \
- bashast/gunit/param_main.gunit \
- bashast/gunit/pipeline.gunit \
- bashast/gunit/process_substitution.gunit \
- bashast/gunit/redir.gunit \
- bashast/gunit/simp_command.gunit \
- bashast/gunit/simp_prog.gunit
-
-BASH_LOG_COMPILER = $(srcdir)/test/script_compiler.sh
-BASH_TESTS = scripts/var_def.bash \
- scripts/var_expansion.bash \
- scripts/command_execution.bash \
- scripts/function_def.bash \
- scripts/arithmetic_assignment.bash \
- scripts/isolated_functions.bash \
- scripts/compound_command.bash \
- scripts/test_expr.bash \
- scripts/binary_arithmetic.bash
-BASH_RESULT = scripts/var_def.bash.result \
- scripts/var_expansion.bash.result \
- scripts/command_execution.bash.result \
- scripts/function_def.bash.result \
- scripts/arithmetic_assignment.bash.result \
- scripts/isolated_functions.bash.result \
- scripts/compound_command.bash.result \
- scripts/test_expr.bash.result \
- scripts/binary_arithmetic.bash.result
-
-EBUILD_LOG_COMPILER = $(srcdir)/test/ebuild_compiler.sh
-EBUILD_TESTS = scripts/sunpinyin-2.0.3-r1.ebuild
-EBUILD_RESULT = scripts/sunpinyin-2.0.3-r1.ebuild.result
-
-TESTS = $(GUNIT_TESTS) $(BASH_TESTS) $(EBUILD_TESTS)
-# these get cleaned so only add autogenerated stuff or modify CLEANFILES
-check_JAVA = bashast/java_libbashLexer.java bashast/java_libbashParser.java
-AM_JAVACFLAGS = -source 1.4 -classpath @antlr_cp@
-
-AM_CXXFLAGS = -std=c++0x
-AM_CPPFLAGS = -I$(top_srcdir)/src
-
-if DEVELOPER_MODE
-# -Weffc++ seems to be giving false positives on protected non
-# virtual destructors in base classes
-AM_CXXFLAGS += -Wall \
- -Wextra \
- -Wold-style-cast \
- -Woverloaded-virtual \
- -Wsign-promo \
- -pedantic-errors \
- -Werror
-AM_CPPFLAGS += -D_GLIBCXX_DEBUG
-endif
-
-if HAVE_GTEST
-TESTS += cppunittests \
- test/ast_printer_test.sh \
- test/verify_bashs_test.sh \
- test/verify_error_output_test.sh
-check_PROGRAMS = cppunittests
-
-cppunittests_SOURCES = test/run_tests.cpp \
- src/core/tests/symbols_test.cpp \
- src/core/tests/interpreter_test.cpp \
- src/core/tests/bash_ast_test.cpp \
- src/core/tests/bash_condition_test.cpp \
- src/builtins/tests/continue_tests.cpp \
- src/builtins/tests/break_tests.cpp \
- src/builtins/tests/echo_tests.cpp \
- src/builtins/tests/declare_tests.cpp \
- src/builtins/tests/boolean_tests.cpp \
- src/builtins/tests/source_tests.cpp \
- src/builtins/tests/shopt_tests.cpp \
- src/builtins/tests/return_tests.cpp \
- src/builtins/tests/printf_tests.cpp \
- test/test.h \
- test/test.cpp \
- test/post_check.cpp \
- test/api_test.cpp \
- test/walker_test.cpp
-cppunittests_LDADD = libcppbash.la \
- $(GTEST_LIBS) \
- $(BOOST_SYSTEM_LIB) \
- $(BOOST_FILESYSTEM_LIB)
-cppunittests_LDFLAGS = -static
-cppunittests_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/test/
-
-endif
-
-noinst_LIBRARIES = libmetadata.a
-
-libmetadata_a_SOURCES = utils/metadata.h utils/metadata.cpp
-libmetadata_a_CPPFLAGS = $(AM_CPPFLAGS) -Iutils
-
-noinst_PROGRAMS = variable_printer metadata_generator ast_printer instruo
-
-variable_printer_SOURCES = utils/variable_printer.cpp
-variable_printer_LDADD = libcppbash.la
-
-metadata_generator_SOURCES = utils/metadata_generator.cpp
-metadata_generator_LDADD = libcppbash.la libmetadata.a
-metadata_generator_CPPFLAGS = $(AM_CPPFLAGS) -Iutils
-
-instruo_SOURCES = utils/instruo.cpp utils/command_line.cpp utils/command_line.h
-instruo_LDADD = libcppbash.la @PALUDIS_LIBS@ libmetadata.a
-instruo_CPPFLAGS = $(AM_CPPFLAGS) @PALUDIS_CFLAGS@ -Iutils
-instruo_CXXFLAGS = $(AM_CXXFLAGS) -Wno-extra
-
-ast_printer_SOURCES = utils/ast_printer.cpp
-ast_printer_LDADD = libcppbash.la $(BOOST_PROGRAM_OPTIONS_LIB)
-ast_printer_LDFLAGS = -static
-# boost is probably compiled without debug STL so if that is used
-# linking will fail
-ast_printer_CPPFLAGS = $(AM_CPPFLAGS) -U_GLIBCXX_DEBUG $(BOOST_CPPFLAGS)
-
-GENERATED_LEXER_CPP = libbashLexer.cpp
-GENERATED_LEXER_H = libbashLexer.h
-GENERATED_PARSER_CPP = libbashParser.cpp
-GENERATED_PARSER_H = libbashParser.h
-GENERATED_WALKER_CPP = libbashWalker.cpp
-GENERATED_WALKER_H = libbashWalker.h
-BUILT_SOURCES = $(GENERATED_PARSER_CPP) \
- $(GENERATED_PARSER_H) \
- $(GENERATED_LEXER_CPP) \
- $(GENERATED_LEXER_H) \
- $(GENERATED_WALKER_CPP) \
- $(GENERATED_WALKER_H) \
- $(check_JAVA)
-CLEANFILES = $(GENERATED_PARSER_CPP) \
- $(GENERATED_PARSER_H) \
- $(GENERATED_LEXER_CPP) \
- $(GENERATED_LEXER_H) \
- $(GENERATED_WALKER_CPP) \
- $(GENERATED_WALKER_H) \
- $(check_JAVA) \
- libbash.g \
- java_libbash.g \
- libbash.tokens \
- libbash.tokens.md5 \
- libbashWalker.h.md5 \
- bashast/java_libbash.tokens \
- libbashWalker.tokens \
- javagrammar.run \
- cgrammar.run \
- walker.run \
- massif.out \
- callgrind.out
-
-lib_LTLIBRARIES = libcppbash.la
-libcppbash_la_SOURCES = src/common.h \
- src/libbash.h \
- src/libbash.cpp \
- src/cppbash_builtin.cpp \
- src/cppbash_builtin.h \
- src/builtins/continue_builtin.cpp \
- src/builtins/continue_builtin.h \
- src/builtins/break_builtin.cpp \
- src/builtins/break_builtin.h \
- src/builtins/echo_builtin.cpp \
- src/builtins/echo_builtin.h \
- src/builtins/eval_builtin.cpp \
- src/builtins/eval_builtin.h \
- src/builtins/declare_builtin.cpp \
- src/builtins/declare_builtin.h \
- src/builtins/boolean_builtins.h \
- src/builtins/source_builtin.h \
- src/builtins/source_builtin.cpp \
- src/builtins/shopt_builtin.h \
- src/builtins/shopt_builtin.cpp \
- src/builtins/return_builtin.h \
- src/builtins/return_builtin.cpp \
- src/builtins/printf_builtin.h \
- src/builtins/printf_builtin.cpp \
- src/builtins/let_builtin.h \
- src/builtins/let_builtin.cpp \
- src/builtins/inherit_builtin.h \
- src/builtins/inherit_builtin.cpp \
- src/builtins/unset_builtin.h \
- src/builtins/unset_builtin.cpp \
- src/builtins/builtin_exceptions.h \
- $(GENERATED_PARSER_C) \
- $(GENERATED_PARSER_H) \
- src/core/divide_by_zero_error.h \
- src/core/exceptions.h \
- src/core/illegal_argument_exception.h \
- src/core/interpreter_exception.h \
- src/core/parse_exception.h \
- src/core/readonly_exception.h \
- src/core/runtime_exception.h \
- src/core/unsupported_exception.h \
- src/core/interpreter.cpp \
- src/core/interpreter.h \
- src/core/symbols.hpp \
- src/core/function.h \
- src/core/function.cpp \
- src/core/bash_condition.h \
- src/core/bash_condition.cpp \
- src/core/bash_ast.cpp \
- src/core/bash_ast.h
-
-# separate library because we need per file CXXFLAGS
-# as antlr generated code does not pass our strict developer
-# warning settings
-noinst_LTLIBRARIES = libparser.la libwalker.la
-libparser_la_SOURCES = $(GENERATED_PARSER_CPP) \
- $(GENERATED_PARSER_H) \
- $(GENERATED_LEXER_CPP) \
- $(GENERATED_LEXER_H)
-
-libparser_la_CXXFLAGS = -std=c++0x \
- -fvisibility=hidden \
- -fvisibility-inlines-hidden
-
-libwalker_la_SOURCES = $(GENERATED_WALKER_CPP) \
- $(GENERATED_WALKER_H)
-
-libwalker_la_CXXFLAGS = -std=c++0x \
- -fvisibility=hidden \
- -fvisibility-inlines-hidden
-
-libcppbash_la_CXXFLAGS = $(AM_CXXFLAGS) \
- -fvisibility=hidden \
- -fvisibility-inlines-hidden
-if DEVELOPER_MODE
-# Paludis cannot get compiled with these flags.
-# So we only turn them on for our library.
-libcppbash_la_CXXFLAGS += -Wconversion -Wsign-conversion
-endif
-libcppbash_la_CFLAGS = $(AM_CFLAGS) -fvisibility=hidden
-libcppbash_la_LIBADD = libparser.la libwalker.la
-
-EXTRA_DIST = bashast/bashast.g \
- bashast/libbashWalker.g \
- bashast/features_script/features.sh \
- bashast/features_script/features.sh.ast \
- bashast/features_script/features.sh.tokens \
- bashast/features_script/features.sh.walker.tokens \
- test/ast_printer_test.sh \
- test/verify_bashs_test.sh \
- test/verify_error_output_test.sh \
- scripts/source_false.sh \
- scripts/source_true.sh \
- scripts/source_return.sh \
- scripts/illegal_script.sh \
- scripts/illegal_script.sh.tokens \
- scripts/foo.eclass \
- scripts/bar.eclass \
- utils/metadata_diff.sh \
- utils/isolated-functions.sh \
- test_coverage.sh \
- autogen.sh \
- $(BASH_TESTS) \
- $(BASH_RESULT) \
- $(EBUILD_TESTS) \
- $(EBUILD_RESULT) \
- $(GUNIT_TESTS) \
- $(GUNIT_LOG_COMPILER) \
- $(BASH_LOG_COMPILER) \
- $(EBUILD_LOG_COMPILER)
-
-coding_standard.pdf: coding_standard/coding_standard.tex
- $(AM_V_GEN)@PDFLATEX@ coding_standard/coding_standard.tex 2&>1 > /dev/null
-
-ANTLR = @JAVA@ -classpath @antlr_cp@ org.antlr.Tool -Xconversiontimeout 5000
-
-cgrammar.run: libbash.g
- $(AM_V_at)touch $@.tmp
- $(AM_V_GEN)$(ANTLR) -fo . $<
- $(AM_V_at)mv libbashParser.{c,cpp}
- $(AM_V_at)mv libbashLexer.{c,cpp}
- $(AM_V_at)mv $@.tmp $@
-
-libbash.g: bashast/bashast.g
- $(AM_V_at)$(CC) -E -x c++ -D OUTPUT_C $< > $@
- $(AM_V_at)sed -i '/^#.*/d' $@
- $(AM_V_at)sed -i 's/C_INCLUDE \(.*\)/\1/' $@
-
-# http://www.kolpackov.net/pipermail/notes/2004-September.txt
-libbash.tokens.md5: libbash.tokens
- $(AM_V_at)md5sum $< | cmp -s $@ -; if test $$? -ne 0; then md5sum $< > $@; fi
-
-# Avoid initializing C++ type to NULL by sed, variables whose name
-# starts with libbash_ will be stripped
-# The date information is removed from libbashWalker.h in order to make the md5 trick working
-walker.run: bashast/libbashWalker.g libbash.tokens.md5
- $(AM_V_at)touch $@.tmp
- $(AM_V_at)if test -a libbashWalker.h; then mv libbashWalker.h libbashWalker.h.bak; fi
- $(AM_V_GEN)$(ANTLR) -fo . $<
- $(AM_V_at)sed -i '/ * - On/d' libbashWalker.h
- $(AM_V_at)md5sum libbashWalker.h | cmp -s libbashWalker.h.md5 -; \
- if test $$? -ne 0; then \
- md5sum libbashWalker.h > libbashWalker.h.md5; \
- elif test -a libbashWalker.h.bak; then \
- mv libbashWalker.h.bak libbashWalker.h; \
- fi
- $(AM_V_at)sed -i -e 's/\(libbash_.*\) = NULL/\1/' libbashWalker.c
- $(AM_V_at)mv libbashWalker.{c,cpp}
- $(AM_V_at)mv $@.tmp $@
-
-$(GENERATED_PARSER_CPP): cgrammar.run
-$(GENERATED_PARSER_H): cgrammar.run
-$(GENERATED_LEXER_CPP): cgrammar.run
-$(GENERATED_LEXER_H): cgrammar.run
-libbash.tokens: cgrammar.run
-
-$(GENERATED_WALKER_CPP): walker.run
-$(GENERATED_WALKER_H): walker.run
-
-java_libbash.g: bashast/bashast.g
- $(AM_V_at)$(CC) -E -x c++ -D OUTPUT_JAVA $< > $@
- $(AM_V_at)sed -i '/^#.*/d' $@
-
-javagrammar.run: java_libbash.g
- $(AM_V_at)touch $@.tmp
- $(AM_V_GEN)$(ANTLR) -fo bashast $<
- $(AM_V_at)mv $@.tmp $@
-
-$(check_JAVA): javagrammar.run
-
-massif.out: ast_printer
- libtool --mode=execute valgrind \
- --tool=massif --massif-out-file=massif.out \
- ./ast_printer -nsf /usr/portage/eclass/versionator.eclass
-
-massif: massif.out
- ms_print --threshold=10 $<
-
-callgrind.out: ast_printer
- libtool --mode=execute valgrind \
- --tool=callgrind --callgrind-out-file=callgrind.out \
- ./ast_printer -s -f /usr/portage/eclass/versionator.eclass
-
-benchmark_parser: callgrind.out
- callgrind_annotate callgrind.out
-
-test_coverage: dist
- MAKE=$(MAKE) DIST_ARCHIVES=$(DIST_ARCHIVES) ./test_coverage.sh
- rm $(DIST_ARCHIVES)
diff --git a/libbash-0.1/README b/libbash-0.1/README
deleted file mode 100644
index 8e00feb..0000000
--- a/libbash-0.1/README
+++ /dev/null
@@ -1,44 +0,0 @@
-#############################################
-#Please use git log for copyright holder and year information
-#
-#This file is part of libbash.
-#
-#libbash 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.
-#
-#libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-###############################################
-
-This is the README file for libbash
-
-Directory information:
-bashast/: Grammar file
-bashast/gunit: Grammar gunit tests
-src/: source directory for libbash library
-src/builtins: source directory for built in bash functionality classes
-src/builtins/tests: Unit tests for builtins
-coding_standard/: LaTeX coding standard for the project
-docs/: output folder for Doxygen generated documentation
-
-Build Instructions:
-
-./autogen.sh
-
-This will run ./configure for you so you are ready to build the thing.
-Now you can run make check to build the library and run tests. Other
-available targets:
-
-To build ANTLR C runtime libraries from grammar:
- make grammar.run
-To generate the coding standard from the latex file (with pdflatex):
- make coding_standard.pdf
-To generate the doxygen documentation:
- make doxygen-doc
diff --git a/libbash-0.1/_build/cgrammar.run.tmp b/libbash-0.1/_build/cgrammar.run.tmp
deleted file mode 100644
index e69de29..0000000
--- a/libbash-0.1/_build/cgrammar.run.tmp
+++ /dev/null
diff --git a/libbash-0.1/_build/javagrammar.run.tmp b/libbash-0.1/_build/javagrammar.run.tmp
deleted file mode 100644
index e69de29..0000000
--- a/libbash-0.1/_build/javagrammar.run.tmp
+++ /dev/null
diff --git a/libbash-0.1/autogen.sh b/libbash-0.1/autogen.sh
deleted file mode 100755
index d845062..0000000
--- a/libbash-0.1/autogen.sh
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-autoreconf -W all -i && ./configure --enable-gtest --enable-developer "$@"
diff --git a/libbash-0.1/bashast/bashast.g b/libbash-0.1/bashast/bashast.g
deleted file mode 100644
index 8903c02..0000000
--- a/libbash-0.1/bashast/bashast.g
+++ /dev/null
@@ -1,773 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-#ifdef OUTPUT_C
-grammar libbash;
-#else
-grammar java_libbash;
-#endif
-options
-{
- backtrack = true;
- output = AST;
- memoize = true;
-#ifdef OUTPUT_C
- language = C;
- ASTLabelType = pANTLR3_BASE_TREE;
-#else
- language = Java;
- ASTLabelType = CommonTree;
-#endif
-}
-tokens{
- ARG;
- ARRAY;
- ARRAY_SIZE;
- BRACE_EXP;
- COMMAND_SUB;
- CASE_PATTERN;
- CASE_COMMAND;
- SUBSHELL;
- CURRENT_SHELL;
- COMPOUND_COND;
- CFOR;
- FOR_INIT;
- FOR_COND;
- FOR_MOD;
- IF_STATEMENT;
- FNAME;
- OP;
- PRE_INCR;
- PRE_DECR;
- POST_INCR;
- POST_DECR;
- PROCESS_SUBSTITUTION;
- VAR_REF;
- NEGATION;
- LIST;
- STRING;
- COMMAND;
- FILE_DESCRIPTOR;
- FILE_DESCRIPTOR_MOVE;
- REDIR;
- ARITHMETIC_CONDITION;
- ARITHMETIC_EXPRESSION;
- KEYWORD_TEST;
- BUILTIN_TEST;
- MATCH_ANY_EXCEPT;
- EXTENDED_MATCH_EXACTLY_ONE;
- EXTENDED_MATCH_AT_MOST_ONE;
- EXTENDED_MATCH_NONE;
- EXTENDED_MATCH_ANY;
- EXTENDED_MATCH_AT_LEAST_ONE;
- MATCH_PATTERN;
- MATCH_REGULAR_EXPRESSION;
- NOT_MATCH_PATTERN;
- MATCH_ANY;
- MATCH_ANY_EXCEPT;
- MATCH_ALL;
- MATCH_ONE;
- CHARACTER_CLASS;
- EQUIVALENCE_CLASS;
- COLLATING_SYMBOL;
- DOUBLE_QUOTED_STRING;
- SINGLE_QUOTED_STRING;
- VARIABLE_DEFINITIONS;
- // parameter expansion operators
- USE_DEFAULT_WHEN_UNSET;
- USE_ALTERNATE_WHEN_UNSET;
- DISPLAY_ERROR_WHEN_UNSET;
- ASSIGN_DEFAULT_WHEN_UNSET;
- USE_DEFAULT_WHEN_UNSET_OR_NULL;
- USE_ALTERNATE_WHEN_UNSET_OR_NULL;
- DISPLAY_ERROR_WHEN_UNSET_OR_NULL;
- ASSIGN_DEFAULT_WHEN_UNSET_OR_NULL;
- OFFSET;
- LIST_EXPAND;
- REPLACE_FIRST;
- REPLACE_ALL;
- REPLACE_AT_START;
- REPLACE_AT_END;
- LAZY_REMOVE_AT_START;
- LAZY_REMOVE_AT_END;
- // Avoid ambiguity (being a sign or an operator)
- PLUS_SIGN;
- MINUS_SIGN;
- // Operators
- NOT_EQUALS;
- BUILTIN_LOGIC;
-}
-
-@lexer::members
-{
-#ifdef OUTPUT_C
- bool double_quoted = false;
-#else
- boolean double_quoted = false;
-#endif
-}
-
-#ifdef OUTPUT_C
-@includes {
- C_INCLUDE #include <iostream>
- C_INCLUDE #include <string>
-
- C_INCLUDE #include <boost/numeric/conversion/cast.hpp>
-}
-@members
-{
- static std::string get_string(pANTLR3_COMMON_TOKEN token)
- {
- if(!token || !token->start)
- return "";
- // Use reinterpret_cast here because we have to cast C code.
- // The real type here is int64_t which is used as a pointer.
- // token->stop - token->start + 1 should be bigger than 0.
- return std::string(reinterpret_cast<const char *>(token->start),
- boost::numeric_cast<unsigned>(token->stop - token->start + 1));
- }
-
- static bool is_here_end(plibbashParser ctx, const std::string& here_doc_word, int number_of_tokens_in_word)
- {
- std::string word;
- for(int i = 1; i <= number_of_tokens_in_word; ++i)
- word += get_string(LT(i));
- return (word == here_doc_word);
- }
-
- static void free_redirect_atom(plibbashParser_redirect_atom_SCOPE scope)
- {
- (&(scope->here_doc_word))->std::string::~string();
- }
-}
-#endif
-
-start : (flcomment)? EOL* clist BLANK* (SEMIC|AMP|EOL)? EOF -> clist;
-//Because the comment token doesn't handle the first comment in a file if it's on the first line, have a parser rule for it
-flcomment
- : POUND ~(EOL)* EOL;
-clist
- : list_level_2 -> ^(LIST list_level_2);
-list_level_1
- : pipeline (BLANK!*(LOGICAND^|LOGICOR^)(BLANK!|EOL!)* pipeline)*;
-// ';' '&' and EOL have lower operator precedence than '&&' and '||' so we need level2 here
-list_level_2
- : list_level_1 (BLANK!? command_separator (BLANK!? EOL!)* BLANK!? list_level_1)*;
-command_separator
- : SEMIC!
- | AMP^
- | EOL!;
-pipeline
- : BLANK!* time? ((BANG) => (BANG BLANK!+))? command^ (BLANK!* PIPE^ BLANK!* command)*;
-time : TIME^ BLANK!+ ((time_posix) => time_posix)?;
-time_posix
- : MINUS! LETTER BLANK!+;
-//The structure of a command in bash
-command
- : command_atom redirect? -> ^(COMMAND command_atom redirect?);
-command_atom
- : compound_command
- | function
- | simple_command;
-//Simple bash commands
-simple_command
- : variable_definitions BLANK+ bash_command -> bash_command variable_definitions
- | variable_definitions -> ^(VARIABLE_DEFINITIONS variable_definitions)
- | bash_command;
-variable_definitions
- : var_def (BLANK!+ var_def)*
- | LOCAL BLANK!+ local_item (BLANK!+ local_item)*
- | EXPORT! (BLANK!+ export_item)+;
-local_item
- :var_def
- |name -> ^(EQUALS name);
-export_item
- :var_def
- |name ->;
-bash_command
- : fname_no_res_word (BLANK!+ bash_command_arguments)*;
-bash_command_arguments
- : bash_command_arguments_atom+ -> ^(STRING bash_command_arguments_atom+);
-bash_command_arguments_atom
- : brace_expansion|LBRACE|RBRACE|fname_part;
-redirect: (BLANK!* redirect_atom)*;
-redirect_atom
-#ifdef OUTPUT_C
-scope {
- std::string here_doc_word;
- int number_of_tokens_in_word;
-}
-@init {
- // http://antlr.1301665.n2.nabble.com/C-target-initialization-of-return-scope-structures-td5078478.html
- new (&($redirect_atom::here_doc_word)) std::string;
- $redirect_atom::number_of_tokens_in_word = 0;
- ctx->plibbashParser_redirect_atomTop->free = &free_redirect_atom;
-}
-#endif
- : HERE_STRING_OP^ BLANK!* fname
-#ifdef OUTPUT_C
- | here_doc_op BLANK* here_doc_begin redirect?
-#else
- | here_doc_op BLANK* n=NAME redirect?
-#endif
- EOL heredoc -> ^(here_doc_op ^(STRING heredoc) redirect?)
- | redir_op BLANK* redir_dest -> ^(REDIR redir_op redir_dest)
- | process_substitution;
-#ifdef OUTPUT_C
-here_doc_begin
- :( {
- if(LA(1) != BLANK && LA(1) != EOL)
- {
- $redirect_atom::here_doc_word += get_string(LT(1));
- ++$redirect_atom::number_of_tokens_in_word;
- }
- } (~(EOL|BLANK)))+;
-here_doc_end
- : ({ ($redirect_atom::number_of_tokens_in_word) != 0 }? => .{ ($redirect_atom::number_of_tokens_in_word)--; })+;
-heredoc : ({ !is_here_end(ctx, $redirect_atom::here_doc_word, $redirect_atom::number_of_tokens_in_word) }? => .)+ here_doc_end!;
-#else
-heredoc : (fname_part EOL!)*;
-#endif
-redir_dest
- : file_desc_as_file //handles file descriptors
- | fname; //path to a file
-file_desc_as_file
- : DIGIT -> ^(FILE_DESCRIPTOR DIGIT)
- | DIGIT MINUS -> ^(FILE_DESCRIPTOR_MOVE DIGIT);
-here_doc_op
- : LSHIFT MINUS -> OP["<<-"]
- | LSHIFT -> OP["<<"];
-redir_op: AMP LESS_THAN -> OP["&<"]
- | GREATER_THAN AMP -> OP[">&"]
- | LESS_THAN AMP -> OP["<&"]
- | LESS_THAN GREATER_THAN -> OP["<>"]
- | RSHIFT -> OP[">>"]
- | AMP GREATER_THAN -> OP["&>"]
- | AMP RSHIFT -> OP ["&>>"]
- | LESS_THAN
- | GREATER_THAN
- | DIGIT redir_op;
-brace_expansion
- : LBRACE BLANK* brace_expansion_inside BLANK* RBRACE -> ^(BRACE_EXP brace_expansion_inside);
-brace_expansion_inside
- : commasep|range;
-range : DIGIT DOTDOT^ DIGIT
- | LETTER DOTDOT^ LETTER;
-brace_expansion_part
- : (((~COMMA) => fname_part)+ -> ^(STRING fname_part+))+
- | -> ^(STRING);
-commasep: brace_expansion_part(COMMA! brace_expansion_part)+;
-command_sub
- : DOLLAR LPAREN clist BLANK? RPAREN -> ^(COMMAND_SUB clist)
- | TICK clist BLANK? TICK -> ^(COMMAND_SUB clist) ;
-//compound commands
-compound_command
- : for_expr
- | sel_expr
- | if_expr
- | while_expr
- | until_expr
- | case_expr
- | subshell
- | current_shell
- | arithmetic_expression
- | cond_comparison;
-//Expressions allowed inside a compound command
-for_expr: FOR BLANK+ name (wspace IN (BLANK+ fname)+)? semiel DO wspace* clist semiel DONE -> ^(FOR name (fname+)? clist)
- | FOR BLANK* LLPAREN EOL? (BLANK* init=arithmetic BLANK*|BLANK+)? (SEMIC (BLANK? fcond=arithmetic BLANK*|BLANK+)? SEMIC|DOUBLE_SEMIC) (BLANK* mod=arithmetic)? wspace* RPAREN RPAREN semiel DO wspace clist semiel DONE
- -> ^(CFOR ^(FOR_INIT $init)? ^(FOR_COND $fcond)? clist ^(FOR_MOD $mod)?)
- ;
-sel_expr: SELECT BLANK+ name (wspace IN BLANK+ fname)? semiel DO wspace* clist semiel DONE -> ^(SELECT name fname? clist)
- ;
-if_expr : IF wspace+ ag=clist semiel THEN wspace+ iflist=clist semiel wspace* (elif_expr)* (ELSE wspace+ else_list=clist semiel EOL*)? FI
- -> ^(IF_STATEMENT ^(IF $ag $iflist) (elif_expr)* ^(ELSE $else_list)?)
- ;
-elif_expr
- : ELIF BLANK+ ag=clist semiel THEN wspace+ iflist=clist semiel -> ^(IF["if"] $ag $iflist);
-while_expr
- : WHILE wspace? istrue=clist semiel DO wspace dothis=clist semiel DONE -> ^(WHILE $istrue $dothis)
- ;
-until_expr
- : UNTIL wspace? istrue=clist semiel DO wspace dothis=clist semiel DONE -> ^(UNTIL $istrue $dothis)
- ;
-// double semicolon is optional for the last alternative
-case_expr
- : CASE BLANK+ fname wspace IN wspace case_body? ESAC -> ^(CASE fname case_body?);
-case_body
- : case_stmt (wspace* DOUBLE_SEMIC case_stmt)* wspace* DOUBLE_SEMIC? wspace* -> case_stmt*;
-case_stmt
- : wspace* (LPAREN BLANK*)? fname (BLANK* PIPE BLANK? fname)* BLANK* RPAREN (wspace* clist)?
- -> ^(CASE_PATTERN fname+ (CASE_COMMAND clist)?);
-//A grouping of commands executed in a subshell
-subshell: LPAREN wspace? clist (BLANK* SEMIC)? (BLANK* EOL)* BLANK* RPAREN -> ^(SUBSHELL clist );
-//A grouping of commands executed in the current shell
-current_shell
- : LBRACE wspace clist semiel wspace* RBRACE -> ^(CURRENT_SHELL clist);
-//Bash arithmetic expression (( expression ))
-arithmetic_expression
- : LLPAREN wspace? arithmetic wspace? RPAREN RPAREN -> ^(ARITHMETIC_EXPRESSION arithmetic);
-cond_comparison
- : cond_expr -> ^(COMPOUND_COND cond_expr);
-//Variables
-//Defining a variable
-//It's not legal to do FOO[1]=(a b c)
-var_def
- : name LSQUARE BLANK? explicit_arithmetic BLANK* RSQUARE EQUALS fname? -> ^(EQUALS ^(name explicit_arithmetic) fname?)
- | name EQUALS^ value?
- | name PLUS_ASSIGN array_value -> ^(PLUS_ASSIGN name array_value)
- | name PLUS_ASSIGN fname_part? -> ^(EQUALS name ^(STRING ^(VAR_REF name) fname_part?));
-//Possible values of a variable
-value : fname
- | array_value;
-//allow the parser to create array variables
-array_value
- : LPAREN wspace* (array_atom wspace*)* RPAREN -> ^(ARRAY array_atom*);
-array_atom
- : (LSQUARE) => LSQUARE! BLANK!* explicit_arithmetic BLANK!? RSQUARE! EQUALS^ fname
- | fname;
-//Referencing a variable (different possible ways/special parameters)
-var_ref
- : DOLLAR LBRACE BLANK* var_exp BLANK* RBRACE -> ^(VAR_REF var_exp)
- | DOLLAR name -> ^(VAR_REF name)
- | DOLLAR num -> ^(VAR_REF num)
- | DOLLAR TIMES -> ^(VAR_REF TIMES)
- | DOLLAR AT -> ^(VAR_REF AT)
- | DOLLAR POUND -> ^(VAR_REF POUND)
- | DOLLAR QMARK -> ^(VAR_REF QMARK)
- | DOLLAR MINUS -> ^(VAR_REF MINUS)
- | DOLLAR DOLLAR -> ^(VAR_REF DOLLAR)
- | DOLLAR BANG -> ^(VAR_REF BANG);
-//Variable expansions
-var_exp : var_name (
- parameter_value_operator parameter_expansion_value
- -> ^(parameter_value_operator var_name parameter_expansion_value)
- | COLON wspace* os=explicit_arithmetic (COLON len=explicit_arithmetic)?
- -> ^(OFFSET var_name $os ^($len)?)
- | parameter_delete_operator parameter_expansion_value
- -> ^(parameter_delete_operator var_name parameter_expansion_value)
- | parameter_replace_operator parameter_replace_pattern (SLASH parameter_expansion_value?)?
- -> ^(parameter_replace_operator var_name parameter_replace_pattern parameter_expansion_value?)
- | -> var_name
- )
- | BANG var_name_for_bang (
- TIMES -> ^(BANG var_name_for_bang TIMES)
- | AT -> ^(BANG var_name_for_bang AT)
- | LSQUARE (op=TIMES|op=AT) RSQUARE -> ^(LIST_EXPAND var_name_for_bang $op)
- | -> ^(VAR_REF var_name_for_bang)
- )
- | var_size_ref;
-parameter_delete_operator
- : POUND -> LAZY_REMOVE_AT_START
- | POUNDPOUND -> REPLACE_AT_START
- | PCT -> LAZY_REMOVE_AT_END
- | PCTPCT -> REPLACE_AT_END;
-parameter_value_operator
- : COLON MINUS -> USE_DEFAULT_WHEN_UNSET_OR_NULL
- | COLON EQUALS -> ASSIGN_DEFAULT_WHEN_UNSET_OR_NULL
- | COLON QMARK -> DISPLAY_ERROR_WHEN_UNSET_OR_NULL
- | COLON PLUS -> USE_ALTERNATE_WHEN_UNSET_OR_NULL
- | MINUS -> USE_DEFAULT_WHEN_UNSET
- | EQUALS -> ASSIGN_DEFAULT_WHEN_UNSET
- | QMARK -> DISPLAY_ERROR_WHEN_UNSET
- | PLUS -> USE_ALTERNATE_WHEN_UNSET;
-parameter_replace_pattern
- : ((~SLASH) => parameter_pattern_part)+ -> ^(STRING parameter_pattern_part+);
-parameter_pattern_part
- : fname_part|BLANK|SEMIC;
-parameter_expansion_value
- : parameter_pattern_part+ -> ^(STRING parameter_pattern_part+)
- | -> ^(STRING);
-parameter_replace_operator
- : SLASH SLASH -> REPLACE_ALL
- | SLASH PCT -> REPLACE_AT_END
- | SLASH POUND -> REPLACE_AT_START
- | SLASH -> REPLACE_FIRST;
-//Allowable refences to values
-//either directly or through array
-var_name
- : num
- | name LSQUARE AT RSQUARE -> ^(ARRAY name AT)
- | name LSQUARE TIMES RSQUARE -> ^(ARRAY name TIMES)
- | var_name_no_digit
- | DOLLAR
- | TIMES
- | AT
- | POUND;
-//Inside arithmetic we can't allow digits
-var_name_no_digit
- : name^ LSQUARE! (explicit_arithmetic) RSQUARE!
- | name;
-//with bang the array syntax is used for array indexes
-var_name_for_bang
- : num|name|POUND;
-var_size_ref
- : POUND name LSQUARE array_size_index RSQUARE -> ^(POUND ^(name array_size_index))
- | POUND^ name;
-array_size_index
- : DIGIT+
- | (AT|TIMES) -> ARRAY_SIZE;
-//Conditional Expressions
-cond_expr
- : LSQUARE LSQUARE wspace keyword_cond wspace RSQUARE RSQUARE -> ^(KEYWORD_TEST keyword_cond)
- | LSQUARE wspace builtin_cond wspace RSQUARE -> ^(BUILTIN_TEST builtin_cond)
- | TEST_EXPR wspace builtin_cond-> ^(BUILTIN_TEST builtin_cond);
-cond_primary
- : LPAREN! BLANK!* keyword_cond BLANK!* RPAREN!
- | keyword_cond_binary
- | keyword_cond_unary
- | fname;
-keyword_cond_binary
- : cond_part BLANK* EQUALS TILDE BLANK? bash_pattern_part -> ^(MATCH_REGULAR_EXPRESSION cond_part ^(STRING bash_pattern_part))
- | cond_part BLANK!* binary_str_op_keyword^ BLANK!? cond_part;
-bash_pattern_part
- :( ESC BLANK |ESC RSQUARE | (~(BLANK|RSQUARE)))+;
-keyword_cond_unary
- : uop^ BLANK!+ cond_part;
-builtin_cond_primary
- : LPAREN! BLANK!* builtin_cond BLANK!* RPAREN!
- | builtin_cond_binary
- | builtin_cond_unary
- | fname;
-builtin_cond_binary
- : cond_part BLANK!* binary_string_op_builtin^ BLANK!* cond_part;
-builtin_cond_unary
- : uop^ BLANK!+ cond_part;
-keyword_cond
- : (negate_primary|cond_primary) (BLANK!* (LOGICOR^|LOGICAND^) BLANK!* keyword_cond)?;
-builtin_cond
- : (negate_builtin_primary|builtin_cond_primary) (BLANK!* builtin_logic_operator^ BLANK!* builtin_cond)?;
-negate_primary
- : BANG BLANK+ cond_primary -> ^(NEGATION cond_primary);
-negate_builtin_primary
- : BANG BLANK+ builtin_cond_primary -> ^(NEGATION builtin_cond_primary);
-binary_str_op_keyword
- : bop
- | EQUALS EQUALS -> MATCH_PATTERN
- | EQUALS
- | BANG EQUALS -> NOT_MATCH_PATTERN
- | LESS_THAN
- | GREATER_THAN;
-binary_string_op_builtin
- : bop
- | EQUALS EQUALS -> EQUALS
- | EQUALS
- | BANG EQUALS -> NOT_EQUALS
- | ESC_LT
- | ESC_GT;
-bop : MINUS! NAME^;
-unary_cond
- : uop^ BLANK! cond_part;
-uop : MINUS! LETTER;
-builtin_logic_operator : uop -> ^(BUILTIN_LOGIC uop);
-//Allowable parts of conditions
-cond_part: brace_expansion
- | fname;
-//Rules for whitespace/line endings
-wspace : BLANK+|EOL+;
-semiel : BLANK* (SEMIC EOL?|EOL) BLANK*;
-
-num
-options{k=1;backtrack=false;}
- : DIGIT|NUMBER;
-//A rule for filenames/strings
-res_word_str
- : CASE|DO|DONE|ELIF|ELSE|ESAC|FI|FOR|FUNCTION|IF|IN|SELECT|THEN|UNTIL|WHILE|TIME;
-//Any allowable part of a string, including slashes, no pounds
-str_part
- : ns_str_part
- | SLASH;
-//Parts of strings, no slashes, no reserved words
-//Using negation leads to code that doesn't compile with the C backend
-//Should be investigated and filed upstream
-//Problematic: ~(CASE|DO|DONE|ELIF|ELSE|ESAC|FI|FOR|FUNCTION|IF|IN|SELECT|THEN|UNTIL|WHILE|TIME)
-ns_str_part
- : num
- | name
- | esc_char
- |OTHER|EQUALS|PCT|PCTPCT|MINUS|DOT|DOTDOT|COLON|TEST_EXPR
- |TILDE|MUL_ASSIGN|DIVIDE_ASSIGN|MOD_ASSIGN|PLUS_ASSIGN|MINUS_ASSIGN
- |LSHIFT_ASSIGN|RSHIFT_ASSIGN|AND_ASSIGN|XOR_ASSIGN
- |OR_ASSIGN|CARET|POUND|POUNDPOUND|COMMA|EXPORT|LOCAL;
-
-//Generic strings/filenames.
-fname : (~POUND) => fname_part fname_part* -> ^(STRING fname_part+);
-//A string that is NOT a bash reserved word
-fname_no_res_word
- : (~POUND) => nqstr_part+ fname_part* -> ^(STRING nqstr_part+ fname_part*);
-fname_part
- : nqstr_part
- | res_word_str;
-//non-quoted string part rule, allows expansions
-nqstr_part
- : extended_pattern_match
- | bracket_pattern_match
- | var_ref
- | command_sub
- | arithmetic_expansion
- | brace_expansion
- | dqstr
- | SINGLE_QUOTED_STRING_TOKEN -> ^(SINGLE_QUOTED_STRING SINGLE_QUOTED_STRING_TOKEN)
- | str_part
- | pattern_match_trigger
- | BANG;
-//double quoted string rule, allows expansions
-dqstr : DQUOTE dqstr_part* DQUOTE -> ^(DOUBLE_QUOTED_STRING dqstr_part*);
-dqstr_part
- : var_ref
- | command_sub
- | arithmetic_expansion
- | ESC DQUOTE -> DQUOTE
- | ESC TICK -> TICK
- | ESC DOLLAR -> DOLLAR
- | ~(DOLLAR|TICK|DQUOTE);
-//certain tokens that trigger pattern matching
-pattern_match_trigger
- : LSQUARE
- | RSQUARE
- | QMARK
- | PLUS
- | TIMES
- | AT;
-//Pattern matching using brackets
-bracket_pattern_match
- : LSQUARE! bracket_pattern_match_operator^ pattern_match RSQUARE!
- | TIMES -> MATCH_ALL
- | QMARK -> MATCH_ONE;
-bracket_pattern_match_operator
- : (BANG) => BANG -> MATCH_ANY_EXCEPT
- | (CARET) => CARET -> MATCH_ANY_EXCEPT
- | -> MATCH_ANY;
-//allowable patterns with bracket pattern matching
-pattern_match
- : (pattern_class_match|fname_part) (pattern_class_match| (~RSQUARE) => fname_part)*;
-
-//special class patterns to match: [:alpha:] etc
-pattern_class_match
- : LSQUARE COLON NAME COLON RSQUARE -> ^(CHARACTER_CLASS NAME)
- | LSQUARE EQUALS pattern_char EQUALS RSQUARE -> ^(EQUIVALENCE_CLASS pattern_char)
- | LSQUARE DOT NAME DOT RSQUARE -> ^(COLLATING_SYMBOL NAME);
-//Characters allowed in matching equivalence classes
-pattern_char
- : LETTER|DIGIT|OTHER|QMARK|COLON|AT|SEMIC|POUND|SLASH|BANG|TIMES|COMMA|PIPE|AMP|MINUS|PLUS|PCT|EQUALS|LSQUARE|RSQUARE|RPAREN|LPAREN|RBRACE|LBRACE|DOLLAR|TICK|DOT|LESS_THAN|GREATER_THAN|SQUOTE|DQUOTE;
-//extended pattern matching
-extended_pattern_match
- : QMARK LPAREN fname (PIPE fname)* RPAREN -> ^(EXTENDED_MATCH_AT_MOST_ONE fname+)
- | TIMES LPAREN fname (PIPE fname)* RPAREN -> ^(EXTENDED_MATCH_ANY fname+)
- | PLUS LPAREN fname (PIPE fname)* RPAREN -> ^(EXTENDED_MATCH_AT_LEAST_ONE fname+)
- | AT LPAREN fname (PIPE fname)* RPAREN -> ^(EXTENDED_MATCH_EXACTLY_ONE fname+)
- | BANG LPAREN fname (PIPE fname)* RPAREN -> ^(EXTENDED_MATCH_NONE fname+);
-//The base of the arithmetic operator. Used for order of operations
-arithmetic_var_ref:
- var_ref -> ^(VAR_REF var_ref);
-primary : num
- | var_ref
- | command_sub
- | var_name_no_digit -> ^(VAR_REF var_name_no_digit)
- | LPAREN! (arithmetics) RPAREN!;
-pre_post_primary: arithmetic_var_ref | primary;
-post_inc_dec
- : pre_post_primary BLANK? PLUS PLUS -> ^(POST_INCR pre_post_primary)
- | pre_post_primary BLANK? MINUS MINUS -> ^(POST_DECR pre_post_primary);
-pre_inc_dec
- : PLUS PLUS BLANK? pre_post_primary -> ^(PRE_INCR pre_post_primary)
- | MINUS MINUS BLANK? pre_post_primary -> ^(PRE_DECR pre_post_primary);
-unary : post_inc_dec
- | pre_inc_dec
- | primary BLANK!*
- | PLUS BLANK* unary -> ^(PLUS_SIGN unary)
- | MINUS BLANK* unary -> ^(MINUS_SIGN unary)
- | (TILDE|BANG)^ BLANK!* unary;
-exponential
- : unary (EXP^ BLANK!* unary)* ;
-times_division_modulus
- : exponential ((TIMES^|SLASH^|PCT^) BLANK!* exponential)*;
-addsub : times_division_modulus ((PLUS^|MINUS^) BLANK!* times_division_modulus)*;
-shifts : addsub ((LSHIFT^|RSHIFT^) BLANK!* addsub)*;
-compare : shifts (compare_operator^ BLANK!* shifts)?;
-compare_operator
- : LEQ
- | GEQ
- | LESS_THAN
- | GREATER_THAN
- | BANG EQUALS -> NOT_EQUALS;
-bitwiseand
- : compare (AMP^ BLANK!* compare)*;
-bitwisexor
- : bitwiseand (CARET^ BLANK!* bitwiseand)*;
-bitwiseor
- : bitwisexor (PIPE^ BLANK!* bitwisexor)*;
-logicand: bitwiseor (LOGICAND^ BLANK!* bitwiseor)*;
-logicor : logicand (LOGICOR^ BLANK!* logicand)*;
-
-arithmetic_condition
- : cnd=logicor QMARK t=logicor COLON f=logicor -> ^(ARITHMETIC_CONDITION $cnd $t $f);
-
-arithmetic_assignment_operator
- : EQUALS|MUL_ASSIGN|DIVIDE_ASSIGN|MOD_ASSIGN|PLUS_ASSIGN|MINUS_ASSIGN|LSHIFT_ASSIGN|RSHIFT_ASSIGN|AND_ASSIGN|XOR_ASSIGN|OR_ASSIGN;
-
-arithmetic_assignment
- : ((var_name_no_digit|arithmetic_var_ref) BLANK!* arithmetic_assignment_operator^ BLANK!*)? logicor;
-arithmetic
- : arithmetic_condition
- | arithmetic_assignment;
-//The comma operator for arithmetic expansions
-arithmetics
- : arithmetic (COMMA! BLANK!* arithmetic)*;
-//explicit arithmetic in places like array indexes
-explicit_arithmetic
- : (DOLLAR LLPAREN BLANK*)? arithmetics (RPAREN RPAREN)? -> arithmetics
- | (DOLLAR LSQUARE BLANK*)? arithmetics RSQUARE? -> arithmetics;
-//Arithmetic expansion
-//the square bracket from is deprecated
-//http://permalink.gmane.org/gmane.comp.shells.bash.bugs/14479
-arithmetic_expansion
- : DOLLAR LLPAREN BLANK* arithmetics BLANK* RPAREN RPAREN -> ^(ARITHMETIC_EXPRESSION arithmetics)
- | DOLLAR LSQUARE BLANK* arithmetics BLANK* RSQUARE -> ^(ARITHMETIC_EXPRESSION arithmetics);
-
-process_substitution
- : (dir=LESS_THAN|dir=GREATER_THAN)LPAREN clist BLANK* RPAREN -> ^(PROCESS_SUBSTITUTION $dir clist);
-//the biggie: functions
-function: FUNCTION BLANK+ function_name ((BLANK* parens wspace*)|wspace) compound_command -> ^(FUNCTION ^(STRING function_name) compound_command)
- | function_name BLANK* parens wspace* compound_command -> ^(FUNCTION["function"] ^(STRING function_name) compound_command);
-//http://article.gmane.org/gmane.comp.shells.bash.bugs/16424
-//the rules from bash 3.2 general.c:
-//Make sure that WORD is a valid shell identifier, i.e.
-//does not contain a dollar sign, nor is quoted in any way. Nor
-//does it consist of all digits.
-function_name
- : (NUMBER|DIGIT)? ~(DOLLAR|SQUOTE|DQUOTE|LPAREN|RPAREN|BLANK|EOL|NUMBER|DIGIT|SINGLE_QUOTED_STRING_TOKEN) ~(DOLLAR|SQUOTE|DQUOTE|LPAREN|RPAREN|BLANK|EOL)*;
-parens : LPAREN BLANK* RPAREN;
-name : NAME
- | LETTER
- | UNDERSCORE;
-esc_char: ESC (DIGIT DIGIT? DIGIT?|LETTER ALPHANUM ALPHANUM?|.);
-
-//****************
-// TOKENS/LEXER RULES
-//****************
-
-COMMENT
- : { !double_quoted }?=> (BLANK|EOL) '#' ~('\n'|'\r')* {$channel=HIDDEN;}
- ;
-//Bash "reserved words"
-BANG : '!';
-CASE : 'case';
-DO : 'do';
-DONE : 'done';
-ELIF : 'elif';
-ELSE : 'else';
-ESAC : 'esac';
-FI : 'fi';
-FOR : 'for';
-FUNCTION: 'function';
-IF : 'if';
-IN : 'in';
-SELECT : 'select';
-THEN : 'then';
-UNTIL : 'until';
-WHILE : 'while';
-LBRACE : '{';
-RBRACE : '}';
-TIME : 'time';
-
-//Other special useful symbols
-RPAREN : ')';
-LPAREN : '(';
-LLPAREN : '((';
-LSQUARE : '[';
-RSQUARE : ']';
-TICK : '`';
-DOLLAR : '$';
-AT : '@';
-DOT : '.';
-DOTDOT : '..';
-//Arith ops
-TIMES : '*';
-EQUALS : '=';
-MINUS : '-';
-PLUS : '+';
-EXP : '**';
-AMP : '&';
-LEQ : '<=';
-GEQ : '>=';
-CARET : '^';
-LESS_THAN : '<';
-GREATER_THAN : '>';
-LSHIFT : '<<';
-RSHIFT : '>>';
-MUL_ASSIGN : '*=';
-DIVIDE_ASSIGN : '/=';
-MOD_ASSIGN : '%=';
-PLUS_ASSIGN : '+=';
-MINUS_ASSIGN : '-=';
-LSHIFT_ASSIGN : '<<=';
-RSHIFT_ASSIGN : '>>=';
-AND_ASSIGN : '&=';
-XOR_ASSIGN : '^=';
-OR_ASSIGN : '|=';
-//some separators
-SEMIC : ';';
-DOUBLE_SEMIC
- : ';;';
-PIPE : '|';
-DQUOTE : '"' { double_quoted = !double_quoted; };
-SQUOTE : { double_quoted }? => '\'';
-SINGLE_QUOTED_STRING_TOKEN : { !double_quoted }? => '\'' .* '\'';
-COMMA : ',';
-//Because bash isn't exactly whitespace dependent... need to explicitly handle blanks
-BLANK : (' '|'\t')+;
-EOL : ('\r'?'\n')+ ;
-//some fragments for creating words...
-DIGIT : '0'..'9';
-NUMBER : DIGIT DIGIT+;
-LETTER : ('a'..'z'|'A'..'Z');
-fragment
-ALPHANUM: (DIGIT|LETTER);
-//Some special redirect operators
-TILDE : '~';
-HERE_STRING_OP
- : '<<<';
-//Tokens for parameter expansion
-POUND : '#';
-POUNDPOUND
- : '##';
-PCT : '%';
-PCTPCT : '%%';
-SLASH : '/';
-COLON : ':';
-QMARK : '?';
-//Operators for conditional statements
-TEST_EXPR : 'test';
-LOCAL : 'local';
-EXPORT : 'export';
-LOGICAND : '&&';
-LOGICOR : '||';
-//Tokens for strings
-CONTINUE_LINE
- : (ESC EOL)+{$channel=HIDDEN;};
-ESC_RPAREN
- : ESC RPAREN;
-ESC_LPAREN
- : ESC LPAREN;
-ESC_LT : ESC'<';
-ESC_GT : ESC'>';
-//Handle ANSI C escaped characters: escaped octal, escaped hex, escaped ctrl+ chars, then all others
-ESC : '\\';
-UNDERSCORE : '_';
-NAME : (LETTER|UNDERSCORE)(ALPHANUM|UNDERSCORE)+;
-OTHER : .;
diff --git a/libbash-0.1/bashast/features_script/features.sh b/libbash-0.1/bashast/features_script/features.sh
deleted file mode 100644
index 7efa24c..0000000
--- a/libbash-0.1/bashast/features_script/features.sh
+++ /dev/null
@@ -1,121 +0,0 @@
-#!/bin/bash
-# A "featureful" script that demonstrates all the functionality of the parser
-
-#############################################
-#Please use git log for copyright holder and year information
-#
-#This file is part of libbash.
-#
-#libbash 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.
-#
-#libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-##############################################
-
-#comment
-#demonstrates expansions in strings both double- and non-quoted
-function lots_o_echo() {
- echo "The number of tests that have failed: $failedtests"
- echo '$failedtests'
- echo $failedtests
-}
-
-do_some_arith() {
- (( 5*4 ))
- (( 5**4 ))
- (( $failedtests+5/4 ))
- (( $z+-3 ))
-}
-
-function arrays() (
- asdf=(a b c d)
- echo ${asdf[3]}
- foo=(`echo 6` b c d)
- arr[foo]=3
- bar=(a b [5]=c);
-)
-
-echo {a,b}
-echo {a..d}
-echo {{a,b},c,d}
-echo a{b,c}
-
-$(echo foobar)
-ls |grep gunit >> filelist
-
-case `echo asdf` in
-gz)
-echo yay
-;;
-bzip)
-echo three
-;;
-*) echo woo
-;;
-esac
-
-for each in `ls |grep log`; do
- echo $each
- cat each
-done
-
-for ((5+3;6+2;3+1)); do echo yay; done
-
-select each in `ls |grep output`; do
- echo asdf 2> /dev/null
-done
-
-if echo yay2; then
- echo yay
-fi
-
-until [[ -a this/is.afile ]]; do
- touch this/is.afile
-done
-
-while [ -n foobar ]; do
- echo "file found"
-done
-
-if test 5 -eq 6; then
- echo "something's wrong"
-fi
-
-echo this command has multiple arguments
-
-wc <(cat /usr/share/dict/linux.words)
-
-cd build && ./configure && make && make_install || echo fail
-
-cd /usr/bin; ls -al|grep more
-
-asdf=parameters
-${asdf:-foo}
-${asdf:8}
-${!asdf*}
-${!asdf@}
-${#foo}
-${replaice/with/pattern}
-${asdf#bar}
-${asdf##bar}
-${asdf%bar}
-${asdf%bar}
-$1 $@ $*
-$?
-${PV//./_}
-${PV/#foo/bar}
-${PV/%foo/bar}
-
-MY_PN=${PN/asterisk-}
-
-cat asdf |grep three 2>&1 > /dev/null
-echo asdf >> APPEND
-echo cat <<<word
diff --git a/libbash-0.1/bashast/features_script/features.sh.ast b/libbash-0.1/bashast/features_script/features.sh.ast
deleted file mode 100644
index ad37b9c..0000000
--- a/libbash-0.1/bashast/features_script/features.sh.ast
+++ /dev/null
@@ -1 +0,0 @@
-(LIST (COMMAND (function (STRING lots_o_echo) (CURRENT_SHELL (LIST (COMMAND (STRING echo) (STRING (DOUBLE_QUOTED_STRING The number of tests that have failed : (VAR_REF failedtests)))) (COMMAND (STRING echo) (STRING (SINGLE_QUOTED_STRING '$failedtests'))) (COMMAND (STRING echo) (STRING (VAR_REF failedtests))))))) (COMMAND (function (STRING do_some_arith) (CURRENT_SHELL (LIST (COMMAND (ARITHMETIC_EXPRESSION (* 5 4))) (COMMAND (ARITHMETIC_EXPRESSION (** 5 4))) (COMMAND (ARITHMETIC_EXPRESSION (+ (VAR_REF failedtests) (/ 5 4)))) (COMMAND (ARITHMETIC_EXPRESSION (+ (VAR_REF z) (MINUS_SIGN 3)))))))) (COMMAND (function (STRING arrays) (SUBSHELL (LIST (COMMAND (VARIABLE_DEFINITIONS (= asdf (ARRAY (STRING a) (STRING b) (STRING c) (STRING d))))) (COMMAND (STRING echo) (STRING (VAR_REF (asdf 3)))) (COMMAND (VARIABLE_DEFINITIONS (= foo (ARRAY (STRING (COMMAND_SUB (LIST (COMMAND (STRING echo) (STRING 6))))) (STRING b) (STRING c) (STRING d))))) (COMMAND (VARIABLE_DEFINITIONS (= (arr (VAR_REF foo)) (STRING 3)))) (COMMAND (VARIABLE_DEFINITIONS (= bar (ARRAY (STRING a) (STRING b) (= 5 (STRING c)))))))))) (COMMAND (STRING echo) (STRING (BRACE_EXP (STRING a) (STRING b)))) (COMMAND (STRING echo) (STRING (BRACE_EXP (.. a d)))) (COMMAND (STRING echo) (STRING (BRACE_EXP (STRING (BRACE_EXP (STRING a) (STRING b))) (STRING c) (STRING d)))) (COMMAND (STRING echo) (STRING a (BRACE_EXP (STRING b) (STRING c)))) (COMMAND (STRING (COMMAND_SUB (LIST (COMMAND (STRING echo) (STRING foobar)))))) (| (COMMAND (STRING ls)) (COMMAND (STRING grep) (STRING gunit) (REDIR >> (STRING filelist)))) (COMMAND (case (STRING (COMMAND_SUB (LIST (COMMAND (STRING echo) (STRING asdf))))) (CASE_PATTERN (STRING gz) CASE_COMMAND (LIST (COMMAND (STRING echo) (STRING yay)))) (CASE_PATTERN (STRING bzip) CASE_COMMAND (LIST (COMMAND (STRING echo) (STRING three)))) (CASE_PATTERN (STRING MATCH_ALL) CASE_COMMAND (LIST (COMMAND (STRING echo) (STRING woo)))))) (COMMAND (for each (STRING (COMMAND_SUB (LIST (| (COMMAND (STRING ls)) (COMMAND (STRING grep) (STRING log)))))) (LIST (COMMAND (STRING echo) (STRING (VAR_REF each))) (COMMAND (STRING cat) (STRING each))))) (COMMAND (CFOR (FOR_INIT (+ 5 3)) (FOR_COND (+ 6 2)) (LIST (COMMAND (STRING echo) (STRING yay))) (FOR_MOD (+ 3 1)))) (COMMAND (select each (STRING (COMMAND_SUB (LIST (| (COMMAND (STRING ls)) (COMMAND (STRING grep) (STRING output)))))) (LIST (COMMAND (STRING echo) (STRING asdf) (STRING 2) (REDIR > (STRING / dev / null)))))) (COMMAND (IF_STATEMENT (if (LIST (COMMAND (STRING echo) (STRING yay2))) (LIST (COMMAND (STRING echo) (STRING yay)))))) (COMMAND (until (LIST (COMMAND (COMPOUND_COND (KEYWORD_TEST (a (STRING this / is . afile)))))) (LIST (COMMAND (STRING touch) (STRING this / is . afile))))) (COMMAND (while (LIST (COMMAND (COMPOUND_COND (BUILTIN_TEST (n (STRING foobar)))))) (LIST (COMMAND (STRING echo) (STRING (DOUBLE_QUOTED_STRING file found)))))) (COMMAND (IF_STATEMENT (if (LIST (COMMAND (COMPOUND_COND (BUILTIN_TEST (eq (STRING 5) (STRING 6)))))) (LIST (COMMAND (STRING echo) (STRING (DOUBLE_QUOTED_STRING something ' s wrong))))))) (COMMAND (STRING echo) (STRING this) (STRING command) (STRING has) (STRING multiple) (STRING arguments)) (COMMAND (STRING wc) (PROCESS_SUBSTITUTION < (LIST (COMMAND (STRING cat) (STRING / usr / share / dict / linux . words))))) (|| (&& (&& (&& (COMMAND (STRING cd) (STRING build)) (COMMAND (STRING . / configure))) (COMMAND (STRING make))) (COMMAND (STRING make_install))) (COMMAND (STRING echo) (STRING fail))) (COMMAND (STRING cd) (STRING / usr / bin)) (| (COMMAND (STRING ls) (STRING - al)) (COMMAND (STRING grep) (STRING more))) (COMMAND (VARIABLE_DEFINITIONS (= asdf (STRING parameters)))) (COMMAND (STRING (VAR_REF (USE_DEFAULT_WHEN_UNSET_OR_NULL asdf (STRING foo))))) (COMMAND (STRING (VAR_REF (OFFSET asdf 8)))) (COMMAND (STRING (VAR_REF (! asdf *)))) (COMMAND (STRING (VAR_REF (! asdf @)))) (COMMAND (STRING (VAR_REF (# foo)))) (COMMAND (STRING (VAR_REF (REPLACE_FIRST replaice (STRING with) (STRING pattern))))) (COMMAND (STRING (VAR_REF (LAZY_REMOVE_AT_START asdf (STRING bar))))) (COMMAND (STRING (VAR_REF (REPLACE_AT_START asdf (STRING bar))))) (COMMAND (STRING (VAR_REF (LAZY_REMOVE_AT_END asdf (STRING bar))))) (COMMAND (STRING (VAR_REF (LAZY_REMOVE_AT_END asdf (STRING bar))))) (COMMAND (STRING (VAR_REF 1)) (STRING (VAR_REF @)) (STRING (VAR_REF *))) (COMMAND (STRING (VAR_REF ?))) (COMMAND (STRING (VAR_REF (REPLACE_ALL PV (STRING .) (STRING _))))) (COMMAND (STRING (VAR_REF (REPLACE_AT_START PV (STRING foo) (STRING bar))))) (COMMAND (STRING (VAR_REF (REPLACE_AT_END PV (STRING foo) (STRING bar))))) (COMMAND (VARIABLE_DEFINITIONS (= MY_PN (STRING (VAR_REF (REPLACE_FIRST PN (STRING asterisk -))))))) (| (COMMAND (STRING cat) (STRING asdf)) (COMMAND (STRING grep) (STRING three) (STRING 2) (REDIR >& (FILE_DESCRIPTOR 1)) (REDIR > (STRING / dev / null)))) (COMMAND (STRING echo) (STRING asdf) (REDIR >> (STRING APPEND))) (COMMAND (STRING echo) (STRING cat) (<<< (STRING word))))
diff --git a/libbash-0.1/bashast/gunit/arith_main.gunit b/libbash-0.1/bashast/gunit/arith_main.gunit
deleted file mode 100644
index 38c8e2e..0000000
--- a/libbash-0.1/bashast/gunit/arith_main.gunit
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-gunit java_libbash;
-
-//for this set of unittests, we'll start from the
-//top of the order of ops
-
-primary:
-"3" -> "3"
-"foo" -> (VAR_REF foo)
-"foo[1]" -> (VAR_REF (foo 1))
-
-post_inc_dec:
-"b--" -> (POST_DECR (VAR_REF b))
-"i++" -> (POST_INCR (VAR_REF i))
-
-pre_inc_dec:
-"++i" -> (PRE_INCR (VAR_REF i))
-"--b" -> (PRE_DECR (VAR_REF b))
-
-unary:
-"6" -> "6"
-"+9" -> (PLUS_SIGN 9)
-"-15" -> (MINUS_SIGN 15)
-"++ z" -> (PRE_INCR (VAR_REF z))
-"f--" -> (POST_DECR (VAR_REF f))
-"~8" -> (~ 8)
-"!8" -> (! 8)
-"!!8" -> (! (! 8))
-"--8" -> (PRE_DECR 8)
-"+++${a}" -> (PLUS_SIGN (PRE_INCR (VAR_REF (VAR_REF a))))
-"++++${a}" -> (PLUS_SIGN (PLUS_SIGN (PRE_INCR (VAR_REF (VAR_REF a)))))
-"+-++${a}" -> (PLUS_SIGN (MINUS_SIGN (PRE_INCR (VAR_REF (VAR_REF a)))))
-
-exponential:
-"8" -> "8"
-"6**2" -> (** 6 2)
-"-5**+4" -> (** (MINUS_SIGN 5) (PLUS_SIGN 4))
-
-times_division_modulus:
-"9" -> "9"
-"7 * 9" -> (* 7 9)
-"7 / 9" -> (/ 7 9)
-"7 % 9" -> (% 7 9)
-"6*4*3" -> (* (* 6 4) 3)
-"6*4/3" -> (/ (* 6 4) 3)
-"6%4*3" -> (* (% 6 4) 3)
-"7/3**6" -> (/ 7 (** 3 6))
-"7/-3**6" -> (/ 7 (** (MINUS_SIGN 3) 6))
-
-addsub:
-"10" -> "10"
-"9+27" -> (+ 9 27)
-"9-27" -> (- 9 27)
-"9-27+8" -> (+ (- 9 27) 8)
-"9-35*-2" -> (- 9 (* 35 (MINUS_SIGN 2)))
-"9*5+2" -> (+ (* 9 5) 2)
-
-shifts:
-"16" -> "16"
-"16+2>>3" -> (>> (+ 16 2) 3)
-"16+2<<3" -> (<< (+ 16 2) 3)
-
-compare:
-"17" ->"17"
-"19<20" -> (< 19 20)
-"19!=20" -> (NOT_EQUALS 19 20)
-
-bitwiseand:
-"17" -> "17"
-"17 & 15" -> (& 17 15)
-
-bitwisexor:
-"17" -> "17"
-"17 ^ 15" -> (^ 17 15)
-
-bitwiseor:
-"17" -> "17"
-"17 | 15" -> (| 17 15)
-
-logicand:
-"17" -> "17"
-"17 && 15" -> (&& 17 15)
-
-logicor:
-"17" -> "17"
-"17 || 15" -> (|| 17 15)
-
-arithmetic_assignment:
-"13"->"13"
-"foo=5+3" -> (= foo (+ 5 3))
-"foo[5]=5+3" -> (= (foo 5) (+ 5 3))
-"${foo[5]}=3" -> (= (VAR_REF (VAR_REF (foo 5))) 3)
-"${foo[5]}*=3" -> (*= (VAR_REF (VAR_REF (foo 5))) 3)
-"${foo[5]}^=3" -> (^= (VAR_REF (VAR_REF (foo 5))) 3)
-"var *= 5" -> (*= var 5)
-"var /= 5" -> (/= var 5)
-"var %= 5" -> (%= var 5)
-"asdf += 5" -> (+= asdf 5)
-"var -= 5" -> (-= var 5)
-"var <<= 5" -> (<<= var 5)
-"var >>= 5" -> (>>= var 5)
-"var &= 5" -> (&= var 5)
-"var ^= 5" -> (^= var 5)
-"var |= 5" -> (|= var 5)
-"3=7" FAIL
-
-arithmetic_condition:
-"5?7:2"->(ARITHMETIC_CONDITION 5 7 2)
-"(4-3)?0:1"->(ARITHMETIC_CONDITION (- 4 3) 0 1)
-
-arithmetics:
-"~ 10" -> (~ 10)
-
-arithmetic_expansion:
-"$((5+4, 3+2, a*b))" -> (ARITHMETIC_EXPRESSION (+ 5 4) (+ 3 2) (* (VAR_REF a) (VAR_REF b)))
-"$[1]" -> (ARITHMETIC_EXPRESSION 1)
-
-start:
-"echo $(( 3 + 2 ))" -> (LIST (COMMAND (STRING echo) (STRING (ARITHMETIC_EXPRESSION (+ 3 2)))))
-"echo $((++i))" -> (LIST (COMMAND (STRING echo) (STRING (ARITHMETIC_EXPRESSION (PRE_INCR (VAR_REF i))))))
-"echo $(( ++i ))" -> (LIST (COMMAND (STRING echo) (STRING (ARITHMETIC_EXPRESSION (PRE_INCR (VAR_REF i))))))
-"echo \"The solution is: $(( 3+2 ))\""-> (LIST (COMMAND (STRING echo) (STRING (DOUBLE_QUOTED_STRING The solution is : (ARITHMETIC_EXPRESSION (+ 3 2))))))
diff --git a/libbash-0.1/bashast/gunit/array.gunit b/libbash-0.1/bashast/gunit/array.gunit
deleted file mode 100644
index ce0b344..0000000
--- a/libbash-0.1/bashast/gunit/array.gunit
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-gunit java_libbash;
-
-var_def:
-"asdf=(a b c d)"->(= asdf (ARRAY (STRING a) (STRING b) (STRING c) (STRING d)))
-"asdf=(`echo 6` b c d)"-> (= asdf (ARRAY (STRING (COMMAND_SUB (LIST (COMMAND (STRING echo) (STRING 6))))) (STRING b) (STRING c) (STRING d)))
-"asdf=(${P} b c d)"->(= asdf (ARRAY (STRING (VAR_REF P)) (STRING b) (STRING c) (STRING d)))
-"asdf=($(echo a))" -> (= asdf (ARRAY (STRING (COMMAND_SUB (LIST (COMMAND (STRING echo) (STRING a)))))))
-"asdf=(
- --disable-dependency-tracking
- ${VAR}
-)" -> (= asdf (ARRAY (STRING - - disable - dependency - tracking) (STRING (VAR_REF VAR))))
-"asdf=()" -> (= asdf ARRAY)
-"asdf+=()" -> (+= asdf ARRAY)
-"asdf+=(a)" -> (+= asdf (ARRAY (STRING a)))
-
-var_ref:
-"$asdf" -> (VAR_REF asdf)
-"${asdf[0]:-default}" -> (VAR_REF (USE_DEFAULT_WHEN_UNSET_OR_NULL (asdf 0) (STRING default)))
-"${asdf[3]}" -> (VAR_REF (asdf 3))
-"${asdf[4] }" -> (VAR_REF (asdf 4))
-"${asdf[i*2]}" -> (VAR_REF (asdf (* (VAR_REF i) 2))))
-"${asdf[1]:2:2}" -> (VAR_REF (OFFSET (asdf 1) 2 2))
-"${asdf[2]##word}" -> (VAR_REF (REPLACE_AT_START (asdf 2) (STRING word)))
-"${asdf[3]%%word}" -> (VAR_REF (REPLACE_AT_END (asdf 3) (STRING word)))
-"${asdf[4]//pattern}" -> (VAR_REF (REPLACE_ALL (asdf 4) (STRING pattern)))
-"${asdf}" -> (VAR_REF asdf)
-"${#asdf[0]}" -> (VAR_REF (# (asdf 0)))
-"${asdf[@]}" -> (VAR_REF (ARRAY asdf @))
-"${asdf[*]}" -> (VAR_REF (ARRAY asdf *))
-"${#asdf[@]}" -> (VAR_REF (# (asdf ARRAY_SIZE)))
-"${#asdf[*]}" -> (VAR_REF (# (asdf ARRAY_SIZE)))
-"${asdf[@]:0:1}" -> (VAR_REF (OFFSET (ARRAY asdf @) 0 1))
-"${asdf[*]#path}" -> (VAR_REF (LAZY_REMOVE_AT_START (ARRAY asdf *) (STRING path)))
-"${asdf[@]%word}" -> (VAR_REF (LAZY_REMOVE_AT_END (ARRAY asdf @) (STRING word)))
-"${asdf[*]/pattern/string}" -> (VAR_REF (REPLACE_FIRST (ARRAY asdf *) (STRING pattern) (STRING string)))
diff --git a/libbash-0.1/bashast/gunit/assoc_array.gunit b/libbash-0.1/bashast/gunit/assoc_array.gunit
deleted file mode 100644
index 3bdca9a..0000000
--- a/libbash-0.1/bashast/gunit/assoc_array.gunit
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-gunit java_libbash;
-
-var_def:
-"arr[foo]=\"asdf\"" -> (= (arr (VAR_REF foo)) (STRING (DOUBLE_QUOTED_STRING asdf)))
-"arr=(a b [4]=c)" -> (= arr (ARRAY (STRING a) (STRING b) (= 4 (STRING c))))
-"asdf[idx]=${var}" -> (= (asdf (VAR_REF idx)) (STRING (VAR_REF var)))
-"asdf[++i]=${var}" -> (= (asdf (PRE_INCR (VAR_REF i))) (STRING (VAR_REF var)))
-"asdf[++i,j]=${var}" -> (= (asdf (PRE_INCR (VAR_REF i)) (VAR_REF j)) (STRING (VAR_REF var)))
-"asdf[$((i))]=${var}" -> (= (asdf (VAR_REF i)) (STRING (VAR_REF var)))
-"asdf[1]=(a b c)" FAIL
diff --git a/libbash-0.1/bashast/gunit/brace.gunit b/libbash-0.1/bashast/gunit/brace.gunit
deleted file mode 100644
index 5d33d83..0000000
--- a/libbash-0.1/bashast/gunit/brace.gunit
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-gunit java_libbash;
-
-brace_expansion:
-"{a,b}"-> (BRACE_EXP (STRING a) (STRING b))
-"{$a/$b,b}"-> (BRACE_EXP (STRING (VAR_REF a) / (VAR_REF b)) (STRING b))
-"{a,b,c}" -> (BRACE_EXP (STRING a) (STRING b) (STRING c))
-"{a..d}" -> (BRACE_EXP (.. a d))
-"{{a,b},c,d}" -> (BRACE_EXP (STRING (BRACE_EXP (STRING a) (STRING b))) (STRING c) (STRING d))
-"{.txt,,}" -> (BRACE_EXP (STRING . txt) STRING STRING)
-"{GNUmakefile,{M,m}akefile}" -> (BRACE_EXP (STRING GNUmakefile) (STRING (BRACE_EXP (STRING M) (STRING m)) akefile))
-
-fname:
-"a{b,c}" -> (STRING a (BRACE_EXP (STRING b) (STRING c)))
-"{c..d}f" -> (STRING (BRACE_EXP (.. c d)) f)
-"a{a,b}b{c,d}" -> (STRING a (BRACE_EXP (STRING a) (STRING b)) b (BRACE_EXP (STRING c) (STRING d)))
-"[{a,b}-c]*" -> (STRING (MATCH_ANY (BRACE_EXP (STRING a) (STRING b)) - c) MATCH_ALL)
diff --git a/libbash-0.1/bashast/gunit/command_sub.gunit b/libbash-0.1/bashast/gunit/command_sub.gunit
deleted file mode 100644
index e2d0021..0000000
--- a/libbash-0.1/bashast/gunit/command_sub.gunit
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-gunit java_libbash;
-
-command_sub:
-"$(echo \"foo\")" -> (COMMAND_SUB (LIST (COMMAND (STRING echo) (STRING (DOUBLE_QUOTED_STRING foo)))))
-"$(ls |grep file)" -> (COMMAND_SUB (LIST (| (COMMAND (STRING ls)) (COMMAND (STRING grep) (STRING file)))))
-"$(CONTROL= command arg )" -> (COMMAND_SUB (LIST (COMMAND (STRING command) (STRING arg) (= CONTROL))))
-"`cat output.log |grep error|cut`" -> (COMMAND_SUB (LIST (| (| (COMMAND (STRING cat) (STRING output . log)) (COMMAND (STRING grep) (STRING error))) (COMMAND (STRING cut)))))
-"$(function foo() { echo 'hello'; }; foo)" -> (COMMAND_SUB (LIST (COMMAND (function (STRING foo) (CURRENT_SHELL (LIST (COMMAND (STRING echo) (STRING (SINGLE_QUOTED_STRING 'hello'))))))) (COMMAND (STRING foo))))
diff --git a/libbash-0.1/bashast/gunit/comment.gunit b/libbash-0.1/bashast/gunit/comment.gunit
deleted file mode 100644
index 5245b93..0000000
--- a/libbash-0.1/bashast/gunit/comment.gunit
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-gunit java_libbash;
-
-start:
-"./hello #comment" -> (LIST (COMMAND (STRING . / hello)))
-"
-#comment
-./hello" -> (LIST (COMMAND (STRING . / hello)))
-"#!/bin/bash
-#author: Nathan Eloe
-./hello" -> (LIST (COMMAND (STRING . / hello)))
-"#!/bin/bash
-#lots of comments!
-#comment
-./command #comment
-#comment" -> (LIST (COMMAND (STRING . / command)))
diff --git a/libbash-0.1/bashast/gunit/compound.gunit b/libbash-0.1/bashast/gunit/compound.gunit
deleted file mode 100644
index 5e2a098..0000000
--- a/libbash-0.1/bashast/gunit/compound.gunit
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-gunit java_libbash;
-
-cond_comparison:
-"[[ -a this/is.afile ]]" -> (COMPOUND_COND (KEYWORD_TEST (a (STRING this / is . afile))))
-"[[ -a this/is.afile]]" FAIL
-"[[-a this/is.afile ]]" FAIL
-"[[
--a this/is.afile ]]" -> (COMPOUND_COND (KEYWORD_TEST (a (STRING this / is . afile))))
-"test ! -a this/is.afile" -> (COMPOUND_COND (BUILTIN_TEST (NEGATION (a (STRING this / is . afile)))))
-"[[ asdf > qwert ]]" -> (COMPOUND_COND (KEYWORD_TEST (> (STRING asdf) (STRING qwert))))
-"[ asdf \> qwert ]" -> (COMPOUND_COND (BUILTIN_TEST (\> (STRING asdf) (STRING qwert))))
-
-arithmetic_expression:
-"((5+3))" -> (ARITHMETIC_EXPRESSION (+ 5 3))
-"(( 5+3 ))" -> (ARITHMETIC_EXPRESSION (+ 5 3))
-
-current_shell:
-"{ time cat; }" -> (CURRENT_SHELL (LIST (COMMAND (STRING cat) time)))
-"{ time cat
-}" -> (CURRENT_SHELL (LIST (COMMAND (STRING cat) time)))
-// there's a tab on the empty line
-"{
- echo
-
-}" -> (CURRENT_SHELL (LIST (COMMAND (STRING echo))))
-"{time cat}" FAIL
-"{ time cat }" FAIL
-
-subshell:
-"(time cat)" -> (SUBSHELL (LIST (COMMAND (STRING cat) time)))
-"(time cat )" ->(SUBSHELL (LIST (COMMAND (STRING cat) time)))
-"( time cat)" -> (SUBSHELL (LIST (COMMAND (STRING cat) time)))
-"( time cat;
-)" -> (SUBSHELL (LIST (COMMAND (STRING cat) time)))
-
-case_expr:
-"case a in esac" -> (case (STRING a))
-"case `echo asdf` in
-esac" -> (case (STRING (COMMAND_SUB (LIST (COMMAND (STRING echo) (STRING asdf))))))
-
-"case `echo asdf` in
-gz)
-echo yay
-;;
-bzip)
-echo three
-;;
-*) echo woo
-;;
-esac" -> (case (STRING (COMMAND_SUB (LIST (COMMAND (STRING echo) (STRING asdf))))) (CASE_PATTERN (STRING gz) CASE_COMMAND (LIST (COMMAND (STRING echo) (STRING yay)))) (CASE_PATTERN (STRING bzip) CASE_COMMAND (LIST (COMMAND (STRING echo) (STRING three)))) (CASE_PATTERN (STRING MATCH_ALL) CASE_COMMAND (LIST (COMMAND (STRING echo) (STRING woo)))))
-
-"case asdf in
- gz)
- echo yay
- ;;
- bzip)
- echo three
- ;;
- *) echo woo
-esac" -> (case (STRING asdf) (CASE_PATTERN (STRING gz) CASE_COMMAND (LIST (COMMAND (STRING echo) (STRING yay)))) (CASE_PATTERN (STRING bzip) CASE_COMMAND (LIST (COMMAND (STRING echo) (STRING three)))) (CASE_PATTERN (STRING MATCH_ALL) CASE_COMMAND (LIST (COMMAND (STRING echo) (STRING woo)))))
-
-"case `echo asdf` in gz|asdf) echo yay ;; bzip) echo three ;; *) echo woo esac" FAIL
-"case asdf in gz|asdf) echo yay ;; bzip) echo three ;; *) echo woo ;; esac" -> (case (STRING asdf) (CASE_PATTERN (STRING gz) (STRING asdf) CASE_COMMAND (LIST (COMMAND (STRING echo) (STRING yay)))) (CASE_PATTERN (STRING bzip) CASE_COMMAND (LIST (COMMAND (STRING echo) (STRING three)))) (CASE_PATTERN (STRING MATCH_ALL) CASE_COMMAND (LIST (COMMAND (STRING echo) (STRING woo)))))
-
-for_expr:
-"for each in `ls |grep log`; do
- echo \"file found\"
-done" -> (for each (STRING (COMMAND_SUB (LIST (| (COMMAND (STRING ls)) (COMMAND (STRING grep) (STRING log)))))) (LIST (COMMAND (STRING echo) (STRING (DOUBLE_QUOTED_STRING file found)))))
-"for each in `ls |grep log`; do echo \"file found\"; done" -> (for each (STRING (COMMAND_SUB (LIST (| (COMMAND (STRING ls)) (COMMAND (STRING grep) (STRING log)))))) (LIST (COMMAND (STRING echo) (STRING (DOUBLE_QUOTED_STRING file found)))))
-"for i in 'foo' 'bar'; do echo $i; done" -> (for i (STRING (SINGLE_QUOTED_STRING 'foo')) (STRING (SINGLE_QUOTED_STRING 'bar')) (LIST (COMMAND (STRING echo) (STRING (VAR_REF i)))))
-"for i in foo$var bar; do echo $i; done" -> (for i (STRING foo (VAR_REF var)) (STRING bar) (LIST (COMMAND (STRING echo) (STRING (VAR_REF i)))))
-"for each in `ls |grep log`; do echo file done" FAIL
-
-"for ((5+3;5+3;5+3)); do echo yay; done" -> (CFOR (FOR_INIT (+ 5 3)) (FOR_COND (+ 5 3)) (LIST (COMMAND (STRING echo) (STRING yay))) (FOR_MOD (+ 5 3)))
-"for ((5+3; ;5+3)); do echo yay; done" -> (CFOR (FOR_INIT (+ 5 3)) (LIST (COMMAND (STRING echo) (STRING yay))) (FOR_MOD (+ 5 3)))
-"for ((;5+3 ;5+3)); do echo yay; done" -> (CFOR (FOR_COND (+ 5 3)) (LIST (COMMAND (STRING echo) (STRING yay))) (FOR_MOD (+ 5 3)))
-"for ((5+3;;5+3)); do echo yay; done" -> (CFOR (FOR_INIT (+ 5 3)) (LIST (COMMAND (STRING echo) (STRING yay))) (FOR_MOD (+ 5 3)))
-
-sel_expr:
-"select each in `ls |grep log`; do
- echo \"file found\"
- done" -> (select each (STRING (COMMAND_SUB (LIST (| (COMMAND (STRING ls)) (COMMAND (STRING grep) (STRING log)))))) (LIST (COMMAND (STRING echo) (STRING (DOUBLE_QUOTED_STRING file found)))))
-"select each in `ls |grep log`; do echo \"file found\"; done" -> (select each (STRING (COMMAND_SUB (LIST (| (COMMAND (STRING ls)) (COMMAND (STRING grep) (STRING log)))))) (LIST (COMMAND (STRING echo) (STRING (DOUBLE_QUOTED_STRING file found)))))
-"select each in `ls |grep log`; do echo file done" FAIL
-
-if_expr:
-"if echo yay2; then
-echo yay
-fi" -> (IF_STATEMENT (if (LIST (COMMAND (STRING echo) (STRING yay2))) (LIST (COMMAND (STRING echo) (STRING yay)))))
-"if echo yay2; then echo yay ;fi" -> (IF_STATEMENT (if (LIST (COMMAND (STRING echo) (STRING yay2))) (LIST (COMMAND (STRING echo) (STRING yay)))))
-"if echo yay2 then echo yay; fi" FAIL
-
-"if echo yay2;
-then
-echo yay
-elif echo yay3; then
-echo boo
-fi" -> (IF_STATEMENT (if (LIST (COMMAND (STRING echo) (STRING yay2))) (LIST (COMMAND (STRING echo) (STRING yay)))) (if (LIST (COMMAND (STRING echo) (STRING yay3))) (LIST (COMMAND (STRING echo) (STRING boo)))))
-
-"if echo yay2; then
-echo yay
-elif echo yay3; then
-echo boo
-elif echo yay4; then echo hurrah
-else echo darn
-fi" -> (IF_STATEMENT (if (LIST (COMMAND (STRING echo) (STRING yay2))) (LIST (COMMAND (STRING echo) (STRING yay)))) (if (LIST (COMMAND (STRING echo) (STRING yay3))) (LIST (COMMAND (STRING echo) (STRING boo)))) (if (LIST (COMMAND (STRING echo) (STRING yay4))) (LIST (COMMAND (STRING echo) (STRING hurrah)))) (else (LIST (COMMAND (STRING echo) (STRING darn)))))
-
-"if true; then
- echo true
- # comment
- elif false; then
- echo false
- fi" -> (IF_STATEMENT (if (LIST (COMMAND (STRING true))) (LIST (COMMAND (STRING echo) (STRING true)))) (if (LIST (COMMAND (STRING false))) (LIST (COMMAND (STRING echo) (STRING false)))))
-
-while_expr:
-"while echo true; do
-echo \"file found\"
-done" -> (while (LIST (COMMAND (STRING echo) (STRING true))) (LIST (COMMAND (STRING echo) (STRING (DOUBLE_QUOTED_STRING file found)))))
-"while echo true; do echo \"file found\"; done" -> (while (LIST (COMMAND (STRING echo) (STRING true))) (LIST (COMMAND (STRING echo) (STRING (DOUBLE_QUOTED_STRING file found)))))
-"while(( 1>0 )); do echo ok; done" -> (while (LIST (COMMAND (ARITHMETIC_EXPRESSION (> 1 0)))) (LIST (COMMAND (STRING echo) (STRING ok))))
-"while echo true`; do echo file done" FAIL
-"while [[ -n \"$ver_str\" ]] ; do
- echo true
- done" -> (while (LIST (COMMAND (COMPOUND_COND (KEYWORD_TEST (n (STRING (DOUBLE_QUOTED_STRING (VAR_REF ver_str)))))))) (LIST (COMMAND (STRING echo) (STRING true))))
-
-until_expr:
-"until echo true; do
-echo \"file found\"
-done" -> (until (LIST (COMMAND (STRING echo) (STRING true))) (LIST (COMMAND (STRING echo) (STRING (DOUBLE_QUOTED_STRING file found)))))
-"until echo true; do echo \"file found\"; done" -> (until (LIST (COMMAND (STRING echo) (STRING true))) (LIST (COMMAND (STRING echo) (STRING (DOUBLE_QUOTED_STRING file found)))))
-"until echo true`; do echo file done" FAIL
-
-case_expr:
-"case \"$1\" in
-*)
-echo \"Usage: $0 start|stop\" >&2
-exit 3
-;;
-esac" -> (case (STRING (DOUBLE_QUOTED_STRING (VAR_REF 1))) (CASE_PATTERN (STRING MATCH_ALL) CASE_COMMAND (LIST (COMMAND (STRING echo) (STRING (DOUBLE_QUOTED_STRING Usage : (VAR_REF 0) start | stop)) (REDIR >& (FILE_DESCRIPTOR 2))) (COMMAND (STRING exit) (STRING 3)))))
-
-"case $asdf in
-a)
-echo \"yay\"
-;;
-esac" -> (case (STRING (VAR_REF asdf)) (CASE_PATTERN (STRING a) CASE_COMMAND (LIST (COMMAND (STRING echo) (STRING (DOUBLE_QUOTED_STRING yay))))))
-"case asdf in
-asdf)
-echo \"yay\"
-;;
-esac" -> (case (STRING asdf) (CASE_PATTERN (STRING asdf) CASE_COMMAND (LIST (COMMAND (STRING echo) (STRING (DOUBLE_QUOTED_STRING yay))))))
-"case 1 in 1) echo yay ;; esac" -> (case (STRING 1) (CASE_PATTERN (STRING 1) CASE_COMMAND (LIST (COMMAND (STRING echo) (STRING yay)))))
-"case /usr/bin in 1) echo yay ;; esac" -> (case (STRING / usr / bin) (CASE_PATTERN (STRING 1) CASE_COMMAND (LIST (COMMAND (STRING echo) (STRING yay)))))
-"case \"$1\" in
-stop)
-;;
-*)
-echo \"Usage: $0 start|stop\" >&2
-exit 3
-;;
-esac" -> (case (STRING (DOUBLE_QUOTED_STRING (VAR_REF 1))) (CASE_PATTERN (STRING stop)) (CASE_PATTERN (STRING MATCH_ALL) CASE_COMMAND (LIST (COMMAND (STRING echo) (STRING (DOUBLE_QUOTED_STRING Usage : (VAR_REF 0) start | stop)) (REDIR >& (FILE_DESCRIPTOR 2))) (COMMAND (STRING exit) (STRING 3)))))
-
-command:
-"[[ asdf > qwert ]] > /dev/null" -> (COMMAND (COMPOUND_COND (KEYWORD_TEST (> (STRING asdf) (STRING qwert)))) (REDIR > (STRING / dev / null)))
-"(( 5+3 )) > /dev/null" -> (COMMAND (ARITHMETIC_EXPRESSION (+ 5 3)) (REDIR > (STRING / dev / null)))
-"{ time cat; } > /dev/null" -> (COMMAND (CURRENT_SHELL (LIST (COMMAND (STRING cat) time))) (REDIR > (STRING / dev / null)))
-"(time cat) > /dev/null" -> (COMMAND (SUBSHELL (LIST (COMMAND (STRING cat) time))) (REDIR > (STRING / dev / null)))
-"case a in esac >/dev/null" -> (COMMAND (case (STRING a)) (REDIR > (STRING / dev / null)))
-"for i in foo$var bar; do echo $i; done >/dev/null" -> (COMMAND (for i (STRING foo (VAR_REF var)) (STRING bar) (LIST (COMMAND (STRING echo) (STRING (VAR_REF i))))) (REDIR > (STRING / dev / null)))
-"for ((5+3;;5+3)); do echo yay; done >/dev/null" -> (COMMAND (CFOR (FOR_INIT (+ 5 3)) (LIST (COMMAND (STRING echo) (STRING yay))) (FOR_MOD (+ 5 3))) (REDIR > (STRING / dev / null)))
-"select each in `ls |grep log`; do echo \"file found\"; done >/dev/null" -> (COMMAND (select each (STRING (COMMAND_SUB (LIST (| (COMMAND (STRING ls)) (COMMAND (STRING grep) (STRING log)))))) (LIST (COMMAND (STRING echo) (STRING (DOUBLE_QUOTED_STRING file found))))) (REDIR > (STRING / dev / null)))
-
-"if echo yay2;
-then
-echo yay
-elif echo yay3; then
-echo boo
-fi > /dev/null" -> (COMMAND (IF_STATEMENT (if (LIST (COMMAND (STRING echo) (STRING yay2))) (LIST (COMMAND (STRING echo) (STRING yay)))) (if (LIST (COMMAND (STRING echo) (STRING yay3))) (LIST (COMMAND (STRING echo) (STRING boo))))) (REDIR > (STRING / dev / null)))
-"while echo true; do echo \"file found\"; done > /dev/null" -> (COMMAND (while (LIST (COMMAND (STRING echo) (STRING true))) (LIST (COMMAND (STRING echo) (STRING (DOUBLE_QUOTED_STRING file found))))) (REDIR > (STRING / dev / null)))
-"until echo true; do echo \"file found\"; done >/dev/null" -> (COMMAND (until (LIST (COMMAND (STRING echo) (STRING true))) (LIST (COMMAND (STRING echo) (STRING (DOUBLE_QUOTED_STRING file found))))) (REDIR > (STRING / dev / null)))
diff --git a/libbash-0.1/bashast/gunit/cond_main.gunit b/libbash-0.1/bashast/gunit/cond_main.gunit
deleted file mode 100644
index 943fd9d..0000000
--- a/libbash-0.1/bashast/gunit/cond_main.gunit
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-gunit java_libbash;
-
-cond_expr:
-"[[ -a this/is.afile ]]" -> (KEYWORD_TEST (a (STRING this / is . afile)))
-"[ -n \"yar53\" ]" -> (BUILTIN_TEST (n (STRING (DOUBLE_QUOTED_STRING yar53))))
-"test 5 -eq 6" -> (BUILTIN_TEST (eq (STRING 5) (STRING 6)))
-"[[ \"asdf\" != \"boo\" && -a filename ]]" -> (KEYWORD_TEST (&& (NOT_MATCH_PATTERN (STRING (DOUBLE_QUOTED_STRING asdf)) (STRING (DOUBLE_QUOTED_STRING boo))) (a (STRING filename))))
-"[[ a = b ]]" -> (KEYWORD_TEST (= (STRING a) (STRING b)))
-"[[ a == b ]]" -> (KEYWORD_TEST (MATCH_PATTERN (STRING a) (STRING b)))
-"[[ true ]]" -> (KEYWORD_TEST (STRING true))
-"[[ true && (false || three) ]]" -> (KEYWORD_TEST (&& (STRING true) (|| (STRING false) (STRING three))))
-"[ a = b ]" -> (BUILTIN_TEST (= (STRING a) (STRING b)))
-"[ a == b ]" -> (BUILTIN_TEST (= (STRING a) (STRING b)))
-"[ a != b ]" -> (BUILTIN_TEST (NOT_EQUALS (STRING a) (STRING b)))
-"[[ \"${DISTUTILS_SRC_TEST}\" =~ ^(setup\.py|nosetests|py\.test|trial(\ .*)?)$ ]]" -> (KEYWORD_TEST (MATCH_REGULAR_EXPRESSION (STRING (DOUBLE_QUOTED_STRING (VAR_REF DISTUTILS_SRC_TEST))) (STRING ^ ( setup \ . py | nosetests | py \ . test | trial ( \ . * ) ? ) $)))
-"[ -n "$FROM_LANG" -a -n "$TO_LANG" ]" -> (BUILTIN_TEST (BUILTIN_LOGIC a (n (STRING (DOUBLE_QUOTED_STRING (VAR_REF FROM_LANG)))) (n (STRING (DOUBLE_QUOTED_STRING (VAR_REF TO_LANG))))))
-"[ -n "$FROM_LANG" -o -n "$TO_LANG" ]" -> (BUILTIN_TEST (BUILTIN_LOGIC o (n (STRING (DOUBLE_QUOTED_STRING (VAR_REF FROM_LANG)))) (n (STRING (DOUBLE_QUOTED_STRING (VAR_REF TO_LANG))))))
diff --git a/libbash-0.1/bashast/gunit/continued_lines.gunit b/libbash-0.1/bashast/gunit/continued_lines.gunit
deleted file mode 100644
index 4be7059..0000000
--- a/libbash-0.1/bashast/gunit/continued_lines.gunit
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-gunit java_libbash;
-
-start:
-
-"ech\
-o Hello\
- world" -> (LIST (COMMAND (STRING ech o) (STRING Hello) (STRING world)))
-
-"sed -i \
- -e 's/three/\
- four/'" -> (LIST (COMMAND (STRING sed) (STRING - i) (STRING - e) (STRING (SINGLE_QUOTED_STRING 's/three/\
- four/'))))
diff --git a/libbash-0.1/bashast/gunit/expansions.gunit b/libbash-0.1/bashast/gunit/expansions.gunit
deleted file mode 100644
index a36d4da..0000000
--- a/libbash-0.1/bashast/gunit/expansions.gunit
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-gunit java_libbash;
-
-clist:
-"echo a{b,c,d}" -> (LIST (COMMAND (STRING echo) (STRING a (BRACE_EXP (STRING b) (STRING c) (STRING d)))))
-"((5+5))" -> (LIST (COMMAND (ARITHMETIC_EXPRESSION (+ 5 5))))
-"(( 4 + asdf ))" -> (LIST (COMMAND (ARITHMETIC_EXPRESSION (+ 4 (VAR_REF asdf)))))
-"[[ while=while ]] && echo true" -> (LIST (&& (COMMAND (COMPOUND_COND (KEYWORD_TEST (STRING while = while)))) (COMMAND (STRING echo) (STRING true))))
-"[[ while = while ]] && echo true" -> (LIST (&& (COMMAND (COMPOUND_COND (KEYWORD_TEST (= (STRING while) (STRING while))))) (COMMAND (STRING echo) (STRING true))))
-"for each in `ls |grep output`; do
-echo $each
-done" -> (LIST (COMMAND (for each (STRING (COMMAND_SUB (LIST (| (COMMAND (STRING ls)) (COMMAND (STRING grep) (STRING output)))))) (LIST (COMMAND (STRING echo) (STRING (VAR_REF each)))))))
-"wc <(cat /usr/share/dict/linux.words)" -> (LIST (COMMAND (STRING wc) (PROCESS_SUBSTITUTION < (LIST (COMMAND (STRING cat) (STRING / usr / share / dict / linux . words))))))
diff --git a/libbash-0.1/bashast/gunit/fname.gunit b/libbash-0.1/bashast/gunit/fname.gunit
deleted file mode 100644
index fce198f..0000000
--- a/libbash-0.1/bashast/gunit/fname.gunit
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-gunit java_libbash;
-
-fname:
-"+%Y%m%d" -> (STRING + % Y % m % d)
-"\"http://www.gnu.org/software/autoconf/autoconf.html\"" -> (STRING (DOUBLE_QUOTED_STRING http : / / www . gnu . org / software / autoconf / autoconf . html))
-"\"http://dev.gentoo.org/~mpagano/genpatches\"" -> (STRING (DOUBLE_QUOTED_STRING http : / / dev . gentoo . org / ~ mpagano / genpatches))
-"\"\"" -> (STRING DOUBLE_QUOTED_STRING)
-"\"For more info on this patchset, and how to report problems, see:\"" -> (STRING (DOUBLE_QUOTED_STRING For more info on this patchset , and how to report problems , see :))
-"\"asdf;!\"" -> (STRING (DOUBLE_QUOTED_STRING asdf ; !))
-"\"$(whoami)\"" -> (STRING (DOUBLE_QUOTED_STRING (COMMAND_SUB (LIST (COMMAND (STRING whoami))))))
-"\"`whoami`\"" -> (STRING (DOUBLE_QUOTED_STRING (COMMAND_SUB (LIST (COMMAND (STRING whoami))))))
-"'`whoami`'" -> (STRING (SINGLE_QUOTED_STRING '`whoami`'))
-"'$(whoami)'" -> (STRING (SINGLE_QUOTED_STRING '$(whoami)'))
-"\"${P}\"" -> (STRING (DOUBLE_QUOTED_STRING (VAR_REF P)))
-"'${P}'" -> (STRING (SINGLE_QUOTED_STRING '${P}'))
-"asdf#" -> (STRING asdf #)
-"'asdf'" -> (STRING (SINGLE_QUOTED_STRING 'asdf'))
-"'asdf\"asdf'" -> (STRING (SINGLE_QUOTED_STRING 'asdf"asdf'))
-"\"asdf'asdf\"" -> (STRING (DOUBLE_QUOTED_STRING asdf ' asdf))
-"!/bin/bash" -> (STRING ! / bin / bash)
-"ab?(g|h)"-> (STRING ab (EXTENDED_MATCH_AT_MOST_ONE (STRING g) (STRING h)))
-"ab*(gh|i)" -> (STRING ab (EXTENDED_MATCH_ANY (STRING gh) (STRING i)))
-"ab+(gh|i)" -> (STRING ab (EXTENDED_MATCH_AT_LEAST_ONE (STRING gh) (STRING i)))
-"ab@(gh|i)" -> (STRING ab (EXTENDED_MATCH_EXACTLY_ONE (STRING gh) (STRING i)))
-"ab!(gh|i)" -> (STRING ab (EXTENDED_MATCH_NONE (STRING gh) (STRING i)))
-"\"abc\"\'\"\'\"def\"" -> (STRING (DOUBLE_QUOTED_STRING abc) (SINGLE_QUOTED_STRING '"') (DOUBLE_QUOTED_STRING def))
-"my\ name\ is" -> (STRING my \ name \ is)
-"octal\007" -> (STRING octal \ 007)
-"hex\xaF" -> (STRING hex \ xaF)
-"ctrlx\cx" -> (STRING ctrlx \ cx)
-"tab\\ttab" -> "(STRING tab \\ \t tab)"
-"abc[def]" -> (STRING abc (MATCH_ANY def))
-"abc[d${more}]" -> (STRING abc (MATCH_ANY d (VAR_REF more)))
-"abc[#d]" -> (STRING abc (MATCH_ANY # d))
-"abc[d#]" -> (STRING abc (MATCH_ANY d #))
-"a[]" -> (STRING a [ ])
-"ab[d-h]" -> (STRING ab (MATCH_ANY d - h))
-"ab[!d-h]" -> (STRING ab (MATCH_ANY_EXCEPT d - h))
-"ab[^d-h]" -> (STRING ab (MATCH_ANY_EXCEPT d - h))
-"ab[]c]" -> (STRING ab (MATCH_ANY ] c))
-"ab[]!]" -> (STRING ab (MATCH_ANY ] !))
-"ab[:alpha:]" -> (STRING ab (MATCH_ANY : alpha :))
-"ab[=c=]" -> (STRING ab (MATCH_ANY = c =))
-"ab[.c.]" -> (STRING ab (MATCH_ANY . c .))
-"ab[[:alpha:]]" -> (STRING ab (MATCH_ANY (CHARACTER_CLASS alpha)))
-"ab[[:alpha:][:digit:]]" -> (STRING ab (MATCH_ANY (CHARACTER_CLASS alpha) (CHARACTER_CLASS digit)))
-"ab[^[:alpha:]]" -> (STRING ab (MATCH_ANY_EXCEPT (CHARACTER_CLASS alpha)))
-"ab[[=c=]]" -> (STRING ab (MATCH_ANY (EQUIVALENCE_CLASS c)))
-"ab[[.backslash.]]" -> (STRING ab (MATCH_ANY (COLLATING_SYMBOL backslash)))
-"ab[12[:alpha:]]" -> (STRING ab (MATCH_ANY 12 (CHARACTER_CLASS alpha)))
-"\"'foo'\"" -> (STRING (DOUBLE_QUOTED_STRING ' foo '))
-"--preserve=timestamps,mode" -> (STRING - - preserve = timestamps , mode)
-
-dqstr:
-"\"\\\\\"\$\`\"" -> (DOUBLE_QUOTED_STRING \ " $ `)
diff --git a/libbash-0.1/bashast/gunit/function.gunit b/libbash-0.1/bashast/gunit/function.gunit
deleted file mode 100644
index a046bd1..0000000
--- a/libbash-0.1/bashast/gunit/function.gunit
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-gunit java_libbash;
-
-function:
-"function quit {
- exit
-}" -> (function (STRING quit) (CURRENT_SHELL (LIST (COMMAND (STRING exit)))))
-
-"function quit{ exit; }" FAIL
-"function quit { exit }" FAIL
-"function 'foo' { exit; }" FAIL
-"function quit { exit; }" -> (function (STRING quit) (CURRENT_SHELL (LIST (COMMAND (STRING exit)))))
-"function foo() { :; }" -> (function (STRING foo) (CURRENT_SHELL (LIST (COMMAND (STRING :)))))
-"function foo(){ :; }" -> (function (STRING foo) (CURRENT_SHELL (LIST (COMMAND (STRING :)))))
-"foo() { :; }" -> (function (STRING foo) (CURRENT_SHELL (LIST (COMMAND (STRING :)))))
-"foo(){ :; }" -> (function (STRING foo) (CURRENT_SHELL (LIST (COMMAND (STRING :)))))
-
-"xorg-2_reconf_source() { :; }" -> (function (STRING xorg - 2 _reconf_source) (CURRENT_SHELL (LIST (COMMAND (STRING :)))))
-
-"function out() { function inner() { :; }; }" -> (function (STRING out) (CURRENT_SHELL (LIST (COMMAND (function (STRING inner) (CURRENT_SHELL (LIST (COMMAND (STRING :)))))))))
-
-function_name:
-"xemacs-packages_src_unpack" OK
-"while" OK
-"aa'bb" FAIL
-"a\"" FAIL
-"333" FAIL
-"aa$aa" FAIL
-
-command:
-"function quit { exit; } > /dev/null" -> (COMMAND (function (STRING quit) (CURRENT_SHELL (LIST (COMMAND (STRING exit))))) (REDIR > (STRING / dev / null)))
-"function quit {
- # comment
- exit; } > /dev/null" -> (COMMAND (function (STRING quit) (CURRENT_SHELL (LIST (COMMAND (STRING exit))))) (REDIR > (STRING / dev / null)))
-"function help { echo hi; } 2> /dev/null" -> (COMMAND (function (STRING help) (CURRENT_SHELL (LIST (COMMAND (STRING echo) (STRING hi))))) (REDIR 2 > (STRING / dev / null)))
-"function help { echo 3; } 2> /dev/null > output" OK
diff --git a/libbash-0.1/bashast/gunit/list.gunit b/libbash-0.1/bashast/gunit/list.gunit
deleted file mode 100644
index 552788a..0000000
--- a/libbash-0.1/bashast/gunit/list.gunit
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-gunit java_libbash;
-
-start:
-"make" -> (LIST (COMMAND (STRING make)))
-"make && make modules_install;" -> (LIST (&& (COMMAND (STRING make)) (COMMAND (STRING make) (STRING modules_install))))
-"make && make modules_install &" -> (LIST (&& (COMMAND (STRING make)) (COMMAND (STRING make) (STRING modules_install))))
-"cd /usr/bin; ls -al |grep more&& cp ./less ./more" -> (LIST (COMMAND (STRING cd) (STRING / usr / bin)) (&& (| (COMMAND (STRING ls) (STRING - al)) (COMMAND (STRING grep) (STRING more))) (COMMAND (STRING cp) (STRING . / less) (STRING . / more))))
-"mkdir test
-cd test
-cp ../asdf.tar.gz .
-tar xpf asdf.tar.gz" -> (LIST (COMMAND (STRING mkdir) (STRING test)) (COMMAND (STRING cd) (STRING test)) (COMMAND (STRING cp) (STRING .. / asdf . tar . gz) (STRING .)) (COMMAND (STRING tar) (STRING xpf) (STRING asdf . tar . gz)))
-"mkdir build && cd build
-./configure && make" -> (LIST (&& (COMMAND (STRING mkdir) (STRING build)) (COMMAND (STRING cd) (STRING build))) (&& (COMMAND (STRING . / configure)) (COMMAND (STRING make))))
-"make;make modules_install
-
-
-cp arch/x86_64/boot/bzImage /boot/kernel" -> (LIST (COMMAND (STRING make)) (COMMAND (STRING make) (STRING modules_install)) (COMMAND (STRING cp) (STRING arch / x86_64 / boot / bzImage) (STRING / boot / kernel)))
-
-"a=asdf
-b=three
-echo \"a b\"" -> (LIST (COMMAND (VARIABLE_DEFINITIONS (= a (STRING asdf)))) (COMMAND (VARIABLE_DEFINITIONS (= b (STRING three)))) (COMMAND (STRING echo) (STRING (DOUBLE_QUOTED_STRING a b))))
-"echo one && (echo two || echo three)" -> (LIST (&& (COMMAND (STRING echo) (STRING one)) (COMMAND (SUBSHELL (LIST (|| (COMMAND (STRING echo) (STRING two)) (COMMAND (STRING echo) (STRING three))))))))
-"FOO='bar' ;" -> (LIST (COMMAND (VARIABLE_DEFINITIONS (= FOO (STRING (SINGLE_QUOTED_STRING 'bar'))))))
-"true;
-true" -> (LIST (COMMAND (STRING true)) (COMMAND (STRING true)))
-"(echo hi > /dev/null) >> 1" -> (LIST (COMMAND (SUBSHELL (LIST (COMMAND (STRING echo) (STRING hi) (REDIR > (STRING / dev / null))))) (REDIR >> (FILE_DESCRIPTOR 1))))
-"{ echo hi > /dev/null; } >> 1" -> (LIST (COMMAND (CURRENT_SHELL (LIST (COMMAND (STRING echo) (STRING hi) (REDIR > (STRING / dev / null))))) (REDIR >> (FILE_DESCRIPTOR 1))))
-"test 1 -gt 0 || return 0" -> (LIST (|| (COMMAND (COMPOUND_COND (BUILTIN_TEST (gt (STRING 1) (STRING 0))))) (COMMAND (STRING return) (STRING 0))))
diff --git a/libbash-0.1/bashast/gunit/param_main.gunit b/libbash-0.1/bashast/gunit/param_main.gunit
deleted file mode 100644
index 9dfcd9e..0000000
--- a/libbash-0.1/bashast/gunit/param_main.gunit
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-gunit java_libbash;
-
-var_ref:
-"$asdf" -> (VAR_REF asdf)
-"${asdf}" -> (VAR_REF asdf)
-"${asdf:-foo}" -> (VAR_REF (USE_DEFAULT_WHEN_UNSET_OR_NULL asdf (STRING foo)))
-"${asdf:-public_html}" -> (VAR_REF (USE_DEFAULT_WHEN_UNSET_OR_NULL asdf (STRING public_html)))
-"${asdf='foo'}" -> (VAR_REF (ASSIGN_DEFAULT_WHEN_UNSET asdf (STRING (SINGLE_QUOTED_STRING 'foo'))))
-"${asdf:=}" -> (VAR_REF (ASSIGN_DEFAULT_WHEN_UNSET_OR_NULL asdf STRING))
-"${bar:7}" -> (VAR_REF (OFFSET bar 7))
-"${bar: -10}" -> (VAR_REF (OFFSET bar (MINUS_SIGN 10)))
-"${bar:(-10 + 5)}" -> (VAR_REF (OFFSET bar (+ (MINUS_SIGN 10) 5)))
-"${foo:5:2}" -> (VAR_REF (OFFSET foo 5 2))
-"${foo:$((5)):$((2))}" -> (VAR_REF (OFFSET foo 5 2))
-"${!asdf*}" -> (VAR_REF (! asdf *))
-"${!asdf@}" -> (VAR_REF (! asdf @))
-"${!asdf[*]}" -> (VAR_REF (LIST_EXPAND asdf *))
-"${!asdf[@]}" -> (VAR_REF (LIST_EXPAND asdf @))
-"${#foo}" -> (VAR_REF (# foo))
-"${foo#bar}" -> (VAR_REF (LAZY_REMOVE_AT_START foo (STRING bar)))
-"${fo*o#bar}" FAIL
-"${fo@o#bar}" FAIL
-"${foo##bar}" -> (VAR_REF (REPLACE_AT_START foo (STRING bar)))
-"${foo%bar}" -> (VAR_REF (LAZY_REMOVE_AT_END foo (STRING bar)))
-"${foo%%bar}" -> (VAR_REF (REPLACE_AT_END foo (STRING bar)))
-"${foo%; *}" -> (VAR_REF (LAZY_REMOVE_AT_END foo (STRING ; MATCH_ALL)))
-"${foo%/}" -> (VAR_REF (LAZY_REMOVE_AT_END foo (STRING /)))
-"${this/is/pattern}"->(VAR_REF (REPLACE_FIRST this (STRING is) (STRING pattern)))
-//Test positional/special parameters
-"$1" -> (VAR_REF 1)
-"$@" -> (VAR_REF @)
-"$*" -> (VAR_REF *)
-"${@}" -> (VAR_REF @)
-"${#}" -> (VAR_REF #)
-"${!foo}" -> (VAR_REF (VAR_REF foo))
-"${!#}" -> (VAR_REF (VAR_REF #))
-"${3}" -> (VAR_REF 3)
-"$?" -> (VAR_REF ?)
-"$_" -> (VAR_REF _)
-"${_}" -> (VAR_REF _)
-"$$" -> (VAR_REF $)
-"${$}" -> (VAR_REF $)
-"${PV//./_}" -> (VAR_REF (REPLACE_ALL PV (STRING .) (STRING _)))
-"${PV// }" -> (VAR_REF (REPLACE_ALL PV (STRING )))
-"${PV//[-._]/}" -> (VAR_REF (REPLACE_ALL PV (STRING (MATCH_ANY - . _)) STRING))
-"${PV/${pattern}/${replace}}" -> (VAR_REF (REPLACE_FIRST PV (STRING (VAR_REF pattern)) (STRING (VAR_REF replace))))
-"${PV/#foo/bar}" -> (VAR_REF (REPLACE_AT_START PV (STRING foo) (STRING bar)))
-"${PV/%foo/bar}" -> (VAR_REF (REPLACE_AT_END PV (STRING foo) (STRING bar)))
-"${PN/%spaces /more }" -> (VAR_REF (REPLACE_AT_END PN (STRING spaces ) (STRING more )))
-"${PN/wrong#/#correct}" -> (VAR_REF (REPLACE_FIRST PN (STRING wrong #) (STRING # correct)))
-
-var_def:
-"MY_PN=${PN/asterisk-}" -> (= MY_PN (STRING (VAR_REF (REPLACE_FIRST PN (STRING asterisk -)))))
-"MY_PN=1abc" -> (= MY_PN (STRING 1 abc))
diff --git a/libbash-0.1/bashast/gunit/pipeline.gunit b/libbash-0.1/bashast/gunit/pipeline.gunit
deleted file mode 100644
index ec6deda..0000000
--- a/libbash-0.1/bashast/gunit/pipeline.gunit
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-gunit java_libbash;
-
-pipeline:
-"cat asdf" -> (COMMAND (STRING cat) (STRING asdf))
-"export VAR=bar LAA=laa foo" -> (COMMAND (VARIABLE_DEFINITIONS (= VAR (STRING bar)) (= LAA (STRING laa))))
-"LOCAL1=a LOCAL2=b export GLOBAL1=2 GLOBAL2 GLOBAL3" -> (COMMAND (STRING export) (STRING GLOBAL1 = 2) (STRING GLOBAL2) (STRING GLOBAL3) (= LOCAL1 (STRING a)) (= LOCAL2 (STRING b)))
-"time -p cat file" -> (COMMAND (STRING cat) (STRING file) (time p))
-"time cat file | grep search" -> (| (COMMAND (STRING cat) (STRING file) time) (COMMAND (STRING grep) (STRING search)))
-"time -p cat | grep asdf | a.out" -> (| (| (COMMAND (STRING cat) (time p)) (COMMAND (STRING grep) (STRING asdf))) (COMMAND (STRING a . out)))
-"time -p cat file |grep search >> log" -> (| (COMMAND (STRING cat) (STRING file) (time p)) (COMMAND (STRING grep) (STRING search) (REDIR >> (STRING log))))
-"if time cat; then
-echo \"three\"
-fi" -> (COMMAND (IF_STATEMENT (if (LIST (COMMAND (STRING cat) time)) (LIST (COMMAND (STRING echo) (STRING (DOUBLE_QUOTED_STRING three)))))))
-"i=1 j=2" -> (COMMAND (VARIABLE_DEFINITIONS (= i (STRING 1)) (= j (STRING 2))))
diff --git a/libbash-0.1/bashast/gunit/process_substitution.gunit b/libbash-0.1/bashast/gunit/process_substitution.gunit
deleted file mode 100644
index b0d2754..0000000
--- a/libbash-0.1/bashast/gunit/process_substitution.gunit
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-gunit java_libbash;
-
-process_substitution:
-"<( true )" -> (PROCESS_SUBSTITUTION < (LIST (COMMAND (STRING true))))
-">(false)" -> (PROCESS_SUBSTITUTION > (LIST (COMMAND (STRING false))))
diff --git a/libbash-0.1/bashast/gunit/redir.gunit b/libbash-0.1/bashast/gunit/redir.gunit
deleted file mode 100644
index bb1c24a..0000000
--- a/libbash-0.1/bashast/gunit/redir.gunit
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-gunit java_libbash;
-
-redirect:
-">output_file" -> (REDIR > (STRING output_file))
-"1>output.file" -> (REDIR 1 > (STRING output . file))
-"2>&1" -> (REDIR 2 >& (FILE_DESCRIPTOR 1))
-"2>&1-" -> (REDIR 2 >& (FILE_DESCRIPTOR_MOVE 1))
-">> /this/is/append" -> (REDIR >> (STRING / this / is / append))
-"&> allout" -> (REDIR &> (STRING allout))
-"< this.is.1input" -> (REDIR < (STRING this . is . 1 input))
-"3< \"input from file\"" -> (REDIR 3 < (STRING (DOUBLE_QUOTED_STRING input from file)))
-"2<&0" -> (REDIR 2 <& (FILE_DESCRIPTOR 0))
-"<< asdf
-asdf
-" -> (<< (STRING asdf))
-"<<< herestring" -> (<<< (STRING herestring))
-"<< blue
-red
-green
-" -> (<< (STRING red green))
diff --git a/libbash-0.1/bashast/gunit/runtests.sh b/libbash-0.1/bashast/gunit/runtests.sh
deleted file mode 100755
index ee8fe99..0000000
--- a/libbash-0.1/bashast/gunit/runtests.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash
-#############################################
-#Please use git log for copyright holder and year information
-#
-#This file is part of libbash.
-#
-#libbash 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.
-#
-#libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-##############################################
-
-exec java -cp "${1}" org.antlr.gunit.Interp $2
diff --git a/libbash-0.1/bashast/gunit/simp_command.gunit b/libbash-0.1/bashast/gunit/simp_command.gunit
deleted file mode 100644
index db26ab4..0000000
--- a/libbash-0.1/bashast/gunit/simp_command.gunit
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-gunit java_libbash;
-
-simple_command:
-"./command" -> (STRING . / command)
-"asdf=5 cat" -> (STRING cat) (= asdf (STRING 5))
-"i=3 g=4 h=18 grep asdf" -> (STRING grep) (STRING asdf) (= i (STRING 3)) (= g (STRING 4)) (= h (STRING 18))
-"./configure --prefix=/usr/local" -> (STRING . / configure) (STRING - - prefix = / usr / local)
-"[[while" -> (STRING [ [ while)
-"./foobär" -> (STRING . / foob ä r)
-"cat ~/Documents/todo.txt" -> (STRING cat) (STRING ~ / Documents / todo . txt)
-"dodir ${foo}/${bar}" -> (STRING dodir) (STRING (VAR_REF foo) / (VAR_REF bar))
-"local a=123 b=(1 2 3) c" -> (VARIABLE_DEFINITIONS local (= a (STRING 123)) (= b (ARRAY (STRING 1) (STRING 2) (STRING 3))) (EQUALS c))
-"echo {}{}}{{{}}{{}" -> (STRING echo) (STRING { } { } } { { { } } { { })
-"echo \"ab#af ###\" #abc" -> (STRING echo) (STRING (DOUBLE_QUOTED_STRING ab # af ## #))
-
-command:
-"asdf=5 cat out.log > result" -> (COMMAND (STRING cat) (STRING out . log) (= asdf (STRING 5)) (REDIR > (STRING result)))
-"cat results.log > asdf 2> /dev/null" -> (COMMAND (STRING cat) (STRING results . log) (REDIR > (STRING asdf)) (REDIR 2 > (STRING / dev / null)))
diff --git a/libbash-0.1/bashast/gunit/simp_prog.gunit b/libbash-0.1/bashast/gunit/simp_prog.gunit
deleted file mode 100644
index 64aa001..0000000
--- a/libbash-0.1/bashast/gunit/simp_prog.gunit
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-gunit java_libbash;
-
-start:
-"echo \"finding file\"
-for each in `ls | grep output`; do
-echo \"I found a file\"
-done
-
-echo \"finding complete\"
-"-> (LIST (COMMAND (STRING echo) (STRING (DOUBLE_QUOTED_STRING finding file))) (COMMAND (for each (STRING (COMMAND_SUB (LIST (| (COMMAND (STRING ls)) (COMMAND (STRING grep) (STRING output)))))) (LIST (COMMAND (STRING echo) (STRING (DOUBLE_QUOTED_STRING I found a file)))))) (COMMAND (STRING echo) (STRING (DOUBLE_QUOTED_STRING finding complete))))
-
-"function quit {
- exit
-}
-hello () {
- echo Hello!
-}
-hello
-quit
-echo foo" -> (LIST (COMMAND (function (STRING quit) (CURRENT_SHELL (LIST (COMMAND (STRING exit)))))) (COMMAND (function (STRING hello) (CURRENT_SHELL (LIST (COMMAND (STRING echo) (STRING Hello !)))))) (COMMAND (STRING hello)) (COMMAND (STRING quit)) (COMMAND (STRING echo) (STRING foo)))
diff --git a/libbash-0.1/bashast/libbashWalker.g b/libbash-0.1/bashast/libbashWalker.g
deleted file mode 100644
index f379183..0000000
--- a/libbash-0.1/bashast/libbashWalker.g
+++ /dev/null
@@ -1,1153 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-tree grammar libbashWalker;
-
-options
-{
- language = C;
- tokenVocab = libbash;
- ASTLabelType = pANTLR3_BASE_TREE;
-}
-
-@includes{
-
- #include <memory>
- #include <string>
- #include <vector>
-
- #include <boost/xpressive/xpressive.hpp>
-
- class interpreter;
- void set_interpreter(interpreter* w);
-
-}
-
-@postinclude{
-
- #include <fstream>
- #include <iostream>
- #include <sstream>
-
- #include <boost/format.hpp>
- #include <boost/algorithm/string/join.hpp>
-
- #include "builtins/builtin_exceptions.h"
- #include "core/bash_condition.h"
- #include "core/interpreter.h"
- #include "cppbash_builtin.h"
-
-}
-
-@members{
-
- static interpreter* walker = 0;
-
- void set_interpreter(interpreter* w)
- {
- walker = w;
- }
-
- namespace
- {
- void set_index(const std::string& name, unsigned& index, int value)
- {
- if(value < 0)
- throw libbash::illegal_argument_exception((boost::format("Array index is less than 0: \%s[\%d]") \% name \% value).str());
- index = value;
- }
-
- // skip to next tree
- void seek_to_next_tree(plibbashWalker ctx)
- {
- // Current depth of the tree we are traversing
- int depth = 1;
-
- // The beginning should always be ROOT DOWN ANY_TOKEN
- // So we start from LA(4)
- int index = 4;
- for(; depth != 0; ++index)
- {
- // Go one level done if we encounter DOWN
- if(LA(index) == DOWN)
- ++depth;
- // Go one level up if we encounter UP. When depth==0, we finishe one node
- else if(LA(index) == UP)
- --depth;
- }
-
- // Seek to the correct offset and consume.
- SEEK(INDEX() + index - 2);
- CONSUME();
- }
-
- void skip_next_token_or_tree(plibbashWalker ctx)
- {
- if(LA(2) != DOWN)
- SEEK(INDEX() + 1);
- else
- seek_to_next_tree(ctx);
- }
-
- // The method is used to append a pattern with another one. Because it's not allowed to append an empty pattern,
- // we need the argument 'do_append' to indicate whether the pattern is empty. 'do_append' will be set to true after
- // the first assignment.
- void append(boost::xpressive::sregex& pattern, const boost::xpressive::sregex& new_pattern, bool& do_append)
- {
- using namespace boost::xpressive;
- if(do_append)
- {
- pattern = sregex(pattern >> new_pattern);
- }
- else
- {
- pattern = new_pattern;
- do_append = true;
- }
- }
-
- bool match(const std::string& target,
- const boost::xpressive::sregex& pattern)
- {
- return boost::xpressive::regex_match(target, pattern);
- }
-
- /// \brief parse the text value of a tree to long
- /// \param the target tree
- /// \return the parsed value
- long parse_integer(ANTLR3_BASE_TREE* tree)
- {
- return tree->getText(tree)->toInt32(tree->getText(tree));
- }
-
- /// \brief a helper function that get the string value
- /// of the given pANTLR3_BASE_TREE node.
- /// \param the target tree node
- /// \return the value of node->text
- std::string get_string(pANTLR3_BASE_TREE node)
- {
- pANTLR3_COMMON_TOKEN token = node->getToken(node);
- // The tree walker may send null pointer here, so return an empty
- // string if that's the case.
- if(!token->start)
- return "";
- // Use reinterpret_cast here because we have to cast C code.
- // The real type here is int64_t which is used as a pointer.
- // token->stop - token->start + 1 should be bigger than 0.
- return std::string(reinterpret_cast<const char *>(token->start),
- boost::numeric_cast<unsigned>(token->stop - token->start + 1));
- }
-
- char get_char(pANTLR3_BASE_TREE node)
- {
- return *reinterpret_cast<const char *>(node->getToken(node)->start);
- }
- }
-}
-
-start: list EOF;
-
-list: ^(LIST (logic_command_list)+);
-
-variable_definitions
-@declarations {
- bool local = false;
-}
- :^(VARIABLE_DEFINITIONS (LOCAL { local = true; })? var_def[local]*);
-
-name_base returns[std::string libbash_value]
- :NAME { $libbash_value = get_string($NAME); }
- |LETTER { $libbash_value = get_string($LETTER); }
- |'_' { $libbash_value="_"; };
-
-name returns[std::string libbash_value, unsigned index]
-@init {
- $index = 0;
-}
- :^(libbash_name=name_base value=arithmetics) {
- set_index(libbash_name, $index, value);
- $libbash_value = libbash_name;
- }
- |libbash_name=name_base {
- $libbash_value = libbash_name;
- };
-
-num returns[std::string libbash_value]
-options{ k=1; }
- :DIGIT { $libbash_value = get_string($DIGIT); }
- |NUMBER { $libbash_value = get_string($NUMBER); };
-
-var_def[bool local]
-@declarations {
- std::map<unsigned, std::string> values;
- unsigned index = 0;
-}
- :^(EQUALS name string_expr?) {
- if(local)
- walker->define_local($name.libbash_value, $string_expr.libbash_value, false, $name.index);
- else
- walker->set_value($name.libbash_value, $string_expr.libbash_value, $name.index);
- }
- |^(EQUALS libbash_name=name_base ^(ARRAY (
- (expr=string_expr
- |^(EQUALS value=arithmetics {
- set_index(libbash_name, index, value);
- } expr=string_expr))
- { values[index++] = expr.libbash_value; })*
- )){
- if(local)
- walker->define_local(libbash_name, values);
- else
- walker->define(libbash_name, values);
- };
-
-string_expr returns[std::string libbash_value, bool quoted]
-@init {
- $quoted = true;
- bool is_raw_string = true;
- std::vector<std::string> brace_expansion_base{""};
- std::vector<std::string> brace_expansion_elements;
-}
-@after {
- if(!is_raw_string && brace_expansion_base.size() > 1)
- throw libbash::unsupported_exception("We only support brace expansion in raw string for now");
- $libbash_value = boost::algorithm::join(brace_expansion_base, " ");
-}
- :^(STRING (
- string_part {
- for(auto iter = brace_expansion_base.begin(); iter != brace_expansion_base.end(); ++iter)
- *iter += $string_part.libbash_value;
- $quoted = $string_part.quoted;
- if(is_raw_string)
- is_raw_string = $string_part.is_raw_string;
- }
- |(BRACE_EXP) => ^(BRACE_EXP brace_expansion[brace_expansion_elements]) {
- auto group_number = brace_expansion_elements.size();
- auto group_size = brace_expansion_base.size();
- std::vector<std::string> expanded_values;
-
- expanded_values.reserve(group_number * group_size);
- for(auto iter = brace_expansion_base.begin(); iter != brace_expansion_base.end(); ++iter)
- for(std::vector<std::string>::size_type i = 0u; i != group_number; ++i)
- expanded_values.push_back(*iter + brace_expansion_elements[i \% group_number]);
-
- brace_expansion_base.swap(expanded_values);
- brace_expansion_elements.clear();
- }
- )*);
-
-brace_expansion[std::vector<std::string>& elements]
- :(string_expr{
- $elements.push_back($string_expr.libbash_value);
- })+;
-
-string_part returns[std::string libbash_value, bool quoted, bool is_raw_string]
-@init {
- $quoted = false;
- $is_raw_string = true;
-}
- :(DOUBLE_QUOTED_STRING) =>
- ^(DOUBLE_QUOTED_STRING (libbash_string=double_quoted_string {
- $libbash_value += libbash_string;
- $quoted = true;
- })*)
- |(SINGLE_QUOTED_STRING) => ^(SINGLE_QUOTED_STRING node=SINGLE_QUOTED_STRING_TOKEN) {
- pANTLR3_COMMON_TOKEN token = node->getToken(node);
- $libbash_value = std::string(reinterpret_cast<const char *>(token->start + 1),
- boost::numeric_cast<unsigned>(token->stop - token->start - 1));
- }
- |(ARITHMETIC_EXPRESSION) =>
- ^(ARITHMETIC_EXPRESSION value=arithmetics {
- $libbash_value = boost::lexical_cast<std::string>(value);
- $is_raw_string = false;
- })
- |(var_ref[false]) => libbash_string=var_ref[false] {
- $libbash_value = libbash_string;
- $is_raw_string = false;
- }
- |libbash_string=command_substitution {
- $libbash_value = libbash_string;
- $is_raw_string = false;
- }
- |(libbash_string=any_string {
- $libbash_value = libbash_string;
- });
-
-bash_pattern[boost::xpressive::sregex& pattern, bool greedy]
-@declarations {
- using namespace boost::xpressive;
- bool do_append = false;
- sregex pattern_list;
- auto check_extglob = [&]() {
- if(!walker->get_additional_option("extglob"))
- throw libbash::unsupported_exception("Entered extended pattern matching with extglob disabled");
- };
-}
- :^(STRING (
- (EXTENDED_MATCH_AT_MOST_ONE) => ^(EXTENDED_MATCH_AT_MOST_ONE composite_pattern[pattern_list, $greedy]) {
- check_extglob();
- if($greedy)
- append($pattern, !sregex(pattern_list), do_append);
- else
- append($pattern, -!sregex(pattern_list), do_append);
- }
- |(EXTENDED_MATCH_ANY) => ^(EXTENDED_MATCH_ANY composite_pattern[pattern_list, $greedy]) {
- check_extglob();
- if($greedy)
- append($pattern, *sregex(pattern_list), do_append);
- else
- append($pattern, -*sregex(pattern_list), do_append);
- }
- |(EXTENDED_MATCH_AT_LEAST_ONE) => ^(EXTENDED_MATCH_AT_LEAST_ONE composite_pattern[pattern_list, $greedy]) {
- check_extglob();
- if($greedy)
- append($pattern, +sregex(pattern_list), do_append);
- else
- append($pattern, -+sregex(pattern_list), do_append);
- }
- // We don't have to do anything for the following rule
- |(EXTENDED_MATCH_EXACTLY_ONE) => ^(EXTENDED_MATCH_EXACTLY_ONE composite_pattern[pattern_list, $greedy]) {
- check_extglob();
- append($pattern, pattern_list, do_append);
- }
- |(EXTENDED_MATCH_NONE) => ^(EXTENDED_MATCH_NONE composite_pattern[pattern_list, $greedy]) {
- check_extglob();
- throw libbash::unsupported_exception("!(blah) is not supported for now");
- }
- |basic_pattern[$pattern, $greedy, do_append])+);
-
-composite_pattern[boost::xpressive::sregex& pattern_list, bool greedy]
-@declarations {
- using namespace boost::xpressive;
- bool do_append = false;
- bool do_sub_append = false;
- sregex sub_pattern;
-}
- :(^(STRING
- (basic_pattern[sub_pattern, $greedy, do_sub_append]{
- if(do_append)
- {
- $pattern_list = sregex($pattern_list | sub_pattern);
- }
- else
- {
- $pattern_list = sub_pattern;
- do_append = true;
- }
- do_sub_append = false;
- })+
- ))+;
-
-basic_pattern[boost::xpressive::sregex& pattern, bool greedy, bool& do_append]
-@declarations {
- using namespace boost::xpressive;
- bool negation;
- std::string pattern_str;
-}
- :(MATCH_ALL) => MATCH_ALL {
- if($greedy)
- append($pattern, *_, do_append);
- else
- append($pattern, -*_, do_append);
- }
- |(MATCH_ONE) => MATCH_ONE {
- append($pattern, _, do_append);
- }
- |(MATCH_ANY_EXCEPT|MATCH_ANY) =>
- ^((MATCH_ANY_EXCEPT { negation = true; } | MATCH_ANY { negation = false; })
- ((CHARACTER_CLASS) => ^(CHARACTER_CLASS n=NAME) {
- std::string class_name = get_string(n);
- if(class_name == "word")
- pattern_str += "A-Za-z0-9_";
- else if(class_name == "ascii")
- pattern_str += "\\x00-\\x7F";
- else
- pattern_str += "[:" + class_name + ":]";
- }
- |s=string_part { pattern_str += s.libbash_value; })+) {
-
- if(negation)
- pattern_str = "[^" + pattern_str + "]";
- else
- pattern_str = "[" + pattern_str + "]";
-
- append($pattern, sregex::compile(pattern_str), do_append);
- }
- |string_part {
- append($pattern, as_xpr($string_part.libbash_value), do_append);
- };
-
-//double quoted string rule, allows expansions
-double_quoted_string returns[std::string libbash_value]
- :(var_ref[true]) => libbash_string=var_ref[true] { $libbash_value = libbash_string; }
- |(ARITHMETIC_EXPRESSION) => ^(ARITHMETIC_EXPRESSION value=arithmetics) {
- $libbash_value = boost::lexical_cast<std::string>(value);
- }
- |libbash_string=command_substitution {
- $libbash_value = libbash_string;
- }
- |libbash_string=any_string { $libbash_value = libbash_string; };
-
-any_string returns[std::string libbash_value]
-@declarations {
- pANTLR3_BASE_TREE any_token;
-}
- :any_token=. { $libbash_value = get_string(any_token); };
-
-//Allowable variable names in the variable expansion
-var_name returns[std::string libbash_value, unsigned index]
-@init {
- $var_name.index = 0;
-}
- :libbash_string=num {
- $index = boost::lexical_cast<unsigned>(libbash_string);
- $libbash_value = ($index != 0 ? "*" : "0");
- }
- |name {
- $libbash_value = $name.libbash_value;
- $index = $name.index;
- }
- |MINUS {
- $libbash_value = "-";
- };
-
-array_name returns[std::string libbash_value]
- :^(ARRAY name (AT|TIMES)) { $libbash_value = $name.libbash_value; }
- // We do not care the difference between TIMES and AT for now
- |TIMES { $libbash_value = "*"; }
- |AT { $libbash_value = "*"; };
-
-var_expansion returns[std::string libbash_value]
-@declarations {
- using namespace boost::xpressive;
- sregex replace_pattern;
- bool greedy;
-}
- :^(USE_DEFAULT_WHEN_UNSET_OR_NULL var_name libbash_word=word) {
- libbash_value = walker->do_default_expansion($var_name.libbash_value, libbash_word, $var_name.index);
- }
- |^(ASSIGN_DEFAULT_WHEN_UNSET_OR_NULL var_name libbash_word=word) {
- libbash_value = walker->do_assign_expansion($var_name.libbash_value, libbash_word, $var_name.index);
- }
- |^(USE_ALTERNATE_WHEN_UNSET_OR_NULL var_name libbash_word=word) {
- libbash_value = walker->do_alternate_expansion($var_name.libbash_value, libbash_word, $var_name.index);
- }
- |(^(OFFSET array_name arithmetics arithmetics)) => ^(OFFSET libbash_name=array_name offset=arithmetics length=arithmetics) {
- libbash_value = walker->do_subarray_expansion(libbash_name, offset, length);
- }
- |(^(OFFSET array_name offset=arithmetics)) => ^(OFFSET libbash_name=array_name offset=arithmetics) {
- libbash_value = walker->do_subarray_expansion(libbash_name, offset);
- }
- |(^(OFFSET var_name arithmetics arithmetics)) => ^(OFFSET var_name offset=arithmetics length=arithmetics) {
- libbash_value = walker->do_substring_expansion($var_name.libbash_value, offset, length, $var_name.index);
- }
- |^(OFFSET var_name offset=arithmetics) {
- libbash_value = walker->do_substring_expansion($var_name.libbash_value, offset, $var_name.index);
- }
- |^(POUND(
- var_name {
- libbash_value = boost::lexical_cast<std::string>(walker->get_length($var_name.libbash_value, $var_name.index));
- }
- |^(libbash_name=name_base ARRAY_SIZE) {
- libbash_value = boost::lexical_cast<std::string>(walker->get_array_length(libbash_name));
- }
- ))
- |^(REPLACE_ALL var_name bash_pattern[replace_pattern, true] (replacement=string_expr)?) {
- libbash_value = walker->do_replace_expansion($var_name.libbash_value,
- std::bind(&interpreter::replace_all,
- std::placeholders::_1,
- replace_pattern,
- replacement.libbash_value),
- $var_name.index);
- }
- |^(REPLACE_AT_END var_name bash_pattern[replace_pattern, true] (replacement=string_expr)?) {
- replace_pattern = sregex(replace_pattern >> eos);
- libbash_value = walker->do_replace_expansion($var_name.libbash_value,
- std::bind(&interpreter::replace_all,
- std::placeholders::_1,
- replace_pattern,
- replacement.libbash_value),
- $var_name.index);
- }
- |^(LAZY_REMOVE_AT_END var_name bash_pattern[replace_pattern, false] (replacement=string_expr)?) {
- replace_pattern = sregex(bos >> (s1=*_) >> replace_pattern >> eos);
- libbash_value = walker->do_replace_expansion($var_name.libbash_value,
- std::bind(&interpreter::lazy_remove_at_end,
- std::placeholders::_1,
- replace_pattern),
- $var_name.index);
- }
- |^((REPLACE_AT_START { greedy = true; }|LAZY_REMOVE_AT_START { greedy = false; })
- var_name bash_pattern[replace_pattern, greedy] (replacement=string_expr)?) {
- replace_pattern = sregex(bos >> replace_pattern);
- libbash_value = walker->do_replace_expansion($var_name.libbash_value,
- std::bind(&interpreter::replace_all,
- std::placeholders::_1,
- replace_pattern,
- replacement.libbash_value),
- $var_name.index);
- }
- |^(REPLACE_FIRST var_name bash_pattern[replace_pattern, true] (replacement=string_expr)?) {
- libbash_value = walker->do_replace_expansion($var_name.libbash_value,
- std::bind(&interpreter::replace_first,
- std::placeholders::_1,
- replace_pattern,
- replacement.libbash_value),
- $var_name.index);
- };
-
-word returns[std::string libbash_value]
- :(num) => libbash_string=num { $libbash_value = libbash_string; }
- |string_expr { $libbash_value = $string_expr.libbash_value; }
- |(VAR_REF) => libbash_string=var_ref[false] { $libbash_value = libbash_string; }
- |value=arithmetics { $libbash_value = boost::lexical_cast<std::string>(value); };
-
-//variable reference
-var_ref [bool double_quoted] returns[std::string libbash_value]
- :^(VAR_REF var_name) {
- $libbash_value = walker->resolve<std::string>($var_name.libbash_value, $var_name.index);
- }
- |^(VAR_REF libbash_string=array_name) { walker->get_all_elements_IFS_joined(libbash_string, $libbash_value); }
- |^(VAR_REF POUND) { $libbash_value = boost::lexical_cast<std::string>(walker->get_array_length("*")); }
- |^(VAR_REF QMARK) { $libbash_value = boost::lexical_cast<std::string>(walker->get_status()); }
- |^(VAR_REF BANG) { std::cerr << "$! has not been implemented yet" << std::endl; }
- |^(VAR_REF libbash_string=var_expansion) { $libbash_value = libbash_string; };
-
-command
- :^(COMMAND command_atom);
-
-command_atom
- :variable_definitions
- |function_definition
- |simple_command
- |compound_command;
-
-simple_command
-@declarations {
- std::vector<std::string> libbash_args;
-}
- :string_expr (argument[libbash_args])* execute_command[$string_expr.libbash_value, libbash_args];
-
-execute_command[const std::string& name, std::vector<std::string>& libbash_args]
-@declarations {
- interpreter::local_scope current_scope(*walker);
- std::unique_ptr<std::ostream> out;
- std::unique_ptr<std::ostream> err;
- std::unique_ptr<std::istream> in;
- bool redirection = false;
-}
- :var_def[true]* (redirect[out, err, in]{ redirection = true; })* {
- if(walker->has_function(name))
- {
- if(redirection)
- std::cerr << "We do not support redirection for function calls." << std::endl;
- ANTLR3_MARKER command_index = INDEX();
- try
- {
- ANTLR3_MARKER current_index = INDEX();
- // Calling functions may change current index
- walker->call(name, libbash_args);
- SEEK(current_index);
- }
- catch(return_exception& e)
- {
- SEEK(command_index);
- }
- }
- else if(cppbash_builtin::is_builtin(name))
- {
- walker->set_status(walker->execute_builtin(name, libbash_args, out.get(), err.get(), in.get()));
- }
- else if(name == "export")
- {
- std::cerr << "We do not support command env before the export builtin." << std::endl;
- walker->set_status(1);
- }
- else
- {
- walker->set_status(1);
- throw libbash::unsupported_exception(name + " is not supported yet");
- }
- }
- (BANG { walker->set_status(!walker->get_status()); })?;
-
-redirect[std::unique_ptr<std::ostream>& out, std::unique_ptr<std::ostream>& err, std::unique_ptr<std::istream>& in]
- :^(REDIR LESS_THAN redirect_destination_input[in]) {
- std::cerr << "Redirection is not supported yet" << std::endl;
- }
- |^(REDIR GREATER_THAN redirect_destination_output[out])
- |^(REDIR DIGIT LESS_THAN redirect_destination_input[in]) {
- std::cerr << "Redirection is not supported yet" << std::endl;
- }
- |^(REDIR DIGIT GREATER_THAN redirect_destination_output[out]) {
- std::cerr << "Redirection is not supported yet" << std::endl;
- };
-
-redirect_operator
- :LESS_THAN
- |GREATER_THAN
- |FILE_DESCRIPTOR DIGIT redirect_operator;
-
-redirect_destination_output[std::unique_ptr<std::ostream>& out]
- :string_expr {
- out.reset(new std::ofstream($string_expr.libbash_value, std::ofstream::trunc));
- }
- |FILE_DESCRIPTOR DIGIT {
- std::cerr << "FILE_DESCRIPTOR redirection is not supported yet" << std::endl;
- }
- |FILE_DESCRIPTOR_MOVE DIGIT {
- std::cerr << "FILE_DESCRIPTOR_MOVE redirection is not supported yet" << std::endl;
- };
-
-redirect_destination_input[std::unique_ptr<std::istream>& in]
- :string_expr {
- std::cerr << "Input redirection for file is not supported yet" << std::endl;
- }
- |FILE_DESCRIPTOR DIGIT {
- std::cerr << "FILE_DESCRIPTOR redirection is not supported yet" << std::endl;
- }
- |FILE_DESCRIPTOR_MOVE DIGIT {
- std::cerr << "FILE_DESCRIPTOR_MOVE redirection is not supported yet" << std::endl;
- };
-
-argument[std::vector<std::string>& args]
- : string_expr {
- if($string_expr.quoted)
- args.push_back($string_expr.libbash_value);
- else
- walker->split_word($string_expr.libbash_value, args);
- };
-
-logic_command_list
-@declarations {
- bool logic_and;
-}
- :command
- |^((LOGICAND { logic_and = true; } | LOGICOR { logic_and = false; }) command {
- if(logic_and ? !walker->get_status() : walker->get_status())
- command(ctx);
- else
- seek_to_next_tree(ctx);
- });
-
-command_list: ^(LIST logic_command_list+);
-
-compound_command
- : ^(CURRENT_SHELL command_list)
- | ^(COMPOUND_COND cond_expr)
- | ^(ARITHMETIC_EXPRESSION arithmetics)
- | for_expr
- | while_expr
- | if_expr
- | case_expr;
-
-cond_expr
- :^(BUILTIN_TEST status=builtin_condition) { walker->set_status(!status); }
- |^(KEYWORD_TEST status=keyword_condition) { walker->set_status(!status); };
-
-common_condition returns[bool status]
-@declarations {
- boost::xpressive::sregex pattern;
-}
- // -eq, -ne, -lt, -le, -gt, or -ge for arithmetic. -nt -ot -ef for files
- :^(NAME left_str=string_expr right_str=string_expr) {
- $status = internal::test_binary(get_string($NAME), left_str.libbash_value, right_str.libbash_value, *walker);
- }
- // -o for shell option, -z -n for string, -abcdefghkprstuwxOGLSN for files
- |^(op=LETTER string_expr) {
- $status = internal::test_unary(get_char(op),
- $string_expr.libbash_value);
- }
- |^(EQUALS left_str=string_expr right_str=string_expr) {
- $status = left_str.libbash_value == right_str.libbash_value;
- }
- // Greedy is meaningless as we need to match the whole string
- |^(MATCH_PATTERN left_str=string_expr bash_pattern[pattern, false]) {
- $status = match(left_str.libbash_value, pattern);
- }
- |^(NOT_EQUALS left_str=string_expr right_str=string_expr) {
- $status = left_str.libbash_value != right_str.libbash_value;
- }
- // Greedy is meaningless as we need to match the whole string
- |^(NOT_MATCH_PATTERN left_str=string_expr bash_pattern[pattern, false]) {
- $status = !match(left_str.libbash_value, pattern);
- }
- |^(LESS_THAN left_str=string_expr right_str=string_expr) {
- $status = left_str.libbash_value < right_str.libbash_value;
- }
- |^(GREATER_THAN left_str=string_expr right_str=string_expr) {
- $status = left_str.libbash_value > right_str.libbash_value;
- }
- |string_expr { $status = (!$string_expr.libbash_value.empty()); };
-
-keyword_condition returns[bool status]
- :^(LOGICOR l=keyword_condition r=keyword_condition) { $status= l || r; }
- |^(LOGICAND l=keyword_condition r=keyword_condition) { $status= l && r; }
- |^(NEGATION l=keyword_condition) { $status = !l; }
- |^(MATCH_REGULAR_EXPRESSION left_str=string_expr right_str=string_expr) {
- boost::xpressive::sregex re = boost::xpressive::sregex::compile(right_str.libbash_value);
- $status = boost::xpressive::regex_match(left_str.libbash_value, re);
- }
- |s=common_condition { $status = s; };
-
-builtin_condition returns[bool status]
- :^(NEGATION l=builtin_condition) { $status = !l; }
- |^(BUILTIN_LOGIC o=LETTER l=builtin_condition r=builtin_condition) {
- char op = get_char(o);
- if(op == 'a')
- $status = l && r;
- else if(op == 'o')
- $status = l || r;
- else
- throw libbash::parse_exception(std::string("unrecognized operator in built-in test: ") + op);
- }
- |s=builtin_condition_primary { $status = s; };
-
-builtin_condition_primary returns[bool status]
- :^(ESC_LT l=string_expr r=string_expr) { $status = (l.libbash_value < r.libbash_value); }
- |^(ESC_GT l=string_expr r=string_expr) { $status = (l.libbash_value > r.libbash_value); }
- |s=common_condition { $status = s; };
-
-for_expr
-@declarations {
- ANTLR3_MARKER commands_index;
- std::vector<std::string> splitted_values;
-
- ANTLR3_MARKER condition_index;
-}
- :^(FOR libbash_string=name_base
- // Empty value as $@ is not supported currently
- (string_expr
- {
- // Word splitting happens here
- if($string_expr.quoted)
- splitted_values.push_back($string_expr.libbash_value);
- else
- walker->split_word($string_expr.libbash_value, splitted_values);
- }
- )+
- {
- if(splitted_values.empty())
- {
- //skip the body
- seek_to_next_tree(ctx);
- walker->set_status(0);
- }
- else
- {
- commands_index = INDEX();
- for(auto iter = splitted_values.begin(); iter != splitted_values.end(); ++iter)
- {
- walker->set_value(libbash_string, *iter);
- try
- {
- command_list(ctx);
- }
- catch(continue_exception& e)
- {
- e.rethrow_unless_correct_frame();
- }
- catch(break_exception& e)
- {
- e.rethrow_unless_correct_frame();
- SEEK(commands_index);
- break;
- }
- SEEK(commands_index);
- }
- seek_to_next_tree(ctx);
- }
- })
- |^(CFOR {
- // omit the first DOWN token for for_INIT
- SEEK(INDEX() + 1);
-
- if(LA(1) == FOR_INIT)
- for_initilization(ctx);
-
- condition_index = INDEX();
- bool has_condition = (LA(1) == FOR_COND);
-
- if(has_condition)
- seek_to_next_tree(ctx);
- // before the body
- seek_to_next_tree(ctx);
- bool has_modification = (LA(1) == FOR_MOD);
- ANTLR3_MARKER modification_index = INDEX();
-
- SEEK(condition_index);
-
- ANTLR3_MARKER command_index;
- while(!has_condition || for_condition(ctx))
- {
- command_index = INDEX();
- try
- {
- command_list(ctx);
- }
- catch(continue_exception& e)
- {
- e.rethrow_unless_correct_frame();
-
- if(has_modification)
- {
- SEEK(modification_index);
- for_modification(ctx);
- }
- SEEK(condition_index);
- continue;
- }
- catch(break_exception& e)
- {
- e.rethrow_unless_correct_frame();
- SEEK(command_index);
- break;
- }
- if(has_modification)
- for_modification(ctx);
- SEEK(condition_index);
- }
-
- // Get out of the loop
- // We are standing right after for_condition, we need to skip the command_list and optional for_modification
- seek_to_next_tree(ctx);
- if(LA(1) == FOR_MOD)
- seek_to_next_tree(ctx);
-
- // omit the last UP token
- SEEK(INDEX() + 1);
- });
-
-for_initilization
- :^(FOR_INIT arithmetics);
-
-for_condition returns[long libbash_value]
- :^(FOR_COND condition=arithmetics) { libbash_value = condition; };
-
-for_modification
- :^(FOR_MOD arithmetics);
-
-while_expr
-@declarations {
- ANTLR3_MARKER condition_index;
- ANTLR3_MARKER command_index;
- bool negate;
-}
- :^((WHILE { negate = false; } | UNTIL { negate = true; }) {
- // omit the first DOWN token
- SEEK(INDEX() + 1);
-
- condition_index = INDEX();
- while(true)
- {
- command_list(ctx);
- if(walker->get_status() == (negate? 0 : 1))
- break;
-
- command_index = INDEX();
- try
- {
- command_list(ctx);
- }
- catch(continue_exception& e)
- {
- e.rethrow_unless_correct_frame();
- SEEK(condition_index);
- continue;
- }
- catch(break_exception& e)
- {
- e.rethrow_unless_correct_frame();
- SEEK(command_index);
- break;
- }
- SEEK(condition_index);
- }
- // Skip the body and get out
- seek_to_next_tree(ctx);
-
- // omit the last UP token
- SEEK(INDEX() + 1);
- });
-
-if_expr
-@declarations {
- bool matched = false;
-}
- :^(IF_STATEMENT {
- // omit the first DOWN token
- SEEK(INDEX() + 1);
-
- while(LA(1) == IF)
- {
- if(matched)
- seek_to_next_tree(ctx);
- else
- matched = elif_expr(ctx);
- }
-
- if(LA(1) == ELSE)
- {
- if(matched == false)
- {
- // omit the ELSE DOWN tokens
- SEEK(INDEX() + 2);
-
- command_list(ctx);
-
- // omit the last UP token
- SEEK(INDEX() + 1);
- }
- else
- {
- seek_to_next_tree(ctx);
- }
- }
-
- // omit the last UP token
- SEEK(INDEX() + 1);
- });
-
-elif_expr returns[bool matched]
- :^(IF {
- // omit the first DOWN token
- SEEK(INDEX() + 1);
-
- command_list(ctx);
- if(walker->get_status() == 0)
- {
- $matched=true;
- command_list(ctx);
- }
- else
- {
- $matched=false;
- seek_to_next_tree(ctx);
- }
-
- // omit the last UP token
- SEEK(INDEX() + 1);
- });
-
-case_expr
- :^(CASE libbash_string=word (matched=case_clause[libbash_string]{
- if(matched)
- {
- while(LA(1) == CASE_PATTERN)
- seek_to_next_tree(ctx);
- }
- })*);
-
-case_clause[const std::string& target] returns[bool matched]
-@declarations {
- std::vector<boost::xpressive::sregex> patterns;
-}
- :^(CASE_PATTERN ( { patterns.push_back(boost::xpressive::sregex()); } bash_pattern[patterns.back(), true])+ {
- $matched = false;
-
- for(auto iter = patterns.begin(); iter != patterns.end(); ++iter)
- {
- if(match(target, *iter))
- {
- if(LA(1) == CASE_COMMAND)
- {
- // omit CASE_COMMAND
- SEEK(INDEX() + 1);
- command_list(ctx);
- }
- $matched = true;
- break;
- }
- }
- if(!$matched)
- seek_to_next_tree(ctx);
- });
-
-command_substitution returns[std::string libbash_value]
-@declarations {
- std::stringstream out;
-}
- :^(COMMAND_SUB{ walker->set_output_stream(&out); } command_list) {
- walker->restore_output_stream();
- $libbash_value = out.str();
- walker->trim_trailing_eols($libbash_value);
- };
-
-function_definition returns[int placeholder]
-@declarations {
- std::string function_name;
-}
- // We've already validated the function name in parser grammar so here we just use any_string to match the name.
- :^(FUNCTION ^(STRING (libbash_string=any_string { function_name += libbash_string; })+) {
- // Define the function with current index
- walker->define_function(function_name, INDEX());
- // Skip the AST for function body
- seek_to_next_tree(ctx);
- });
-
-// Only used in arithmetic expansion
-primary returns[std::string libbash_value, unsigned index]
- :(^(VAR_REF name)) => ^(VAR_REF name) {
- $libbash_value = $name.libbash_value;
- $index = $name.index;
- }
- |name {
- $libbash_value = $name.libbash_value;
- $index = $name.index;
- }
- // array[@] and array[*] is meaningless to arithmetic expansion so true/false are both ok.
- |^(VAR_REF libbash_string=var_ref[false]) {
- $libbash_value = libbash_string;
- $index = 0;
- };
-
-// shell arithmetic
-// http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_04
-arithmetics returns[long value]
- :^(LOGICOR l=arithmetics {
- if(l)
- {
- skip_next_token_or_tree(ctx);
- $value = 1;
- }
- else
- {
- $value = (arithmetics(ctx) != 0);
- }
- })
- |^(LOGICAND l=arithmetics {
- if(!l)
- {
- skip_next_token_or_tree(ctx);
- $value = 0;
- }
- else
- {
- $value = (arithmetics(ctx) != 0);
- }
- })
- |^(PIPE l=arithmetics r=arithmetics) { $value = l | r; }
- |^(CARET l=arithmetics r=arithmetics) { $value = l ^ r; }
- |^(AMP l=arithmetics r=arithmetics) { $value = l & r; }
- |^(LEQ l=arithmetics r=arithmetics) { $value = l <= r; }
- |^(GEQ l=arithmetics r=arithmetics) { $value = l >= r; }
- |^(LESS_THAN l=arithmetics r=arithmetics) { $value = l < r; }
- |^(GREATER_THAN l=arithmetics r=arithmetics) { $value = l > r; }
- |^(NOT_EQUALS l=arithmetics r=arithmetics) { $value = l != r; }
- |^(LSHIFT l=arithmetics r=arithmetics) { $value = l << r; }
- |^(RSHIFT l=arithmetics r=arithmetics) { $value = l >> r; }
- |^(PLUS l=arithmetics r=arithmetics) { $value = l + r; }
- |^(PLUS_SIGN l=arithmetics) { $value = l; }
- |^(MINUS l=arithmetics r=arithmetics) { $value = l - r; }
- |^(MINUS_SIGN l=arithmetics) { $value = -l; }
- |^(TIMES l=arithmetics r=arithmetics) { $value = l * r; }
- |^(SLASH l=arithmetics r=arithmetics) { $value = l / r; }
- |^(PCT l=arithmetics r=arithmetics) { $value = l \% r; }
- |^(EXP l=arithmetics r=arithmetics) {
- $value = 1;
- while(r--)
- $value *= l;
- }
- |^(BANG l=arithmetics) { $value = !l; }
- |^(TILDE l=arithmetics) { $value = ~l; }
- |^(ARITHMETIC_CONDITION cnd=arithmetics l=arithmetics r=arithmetics) {
- $value = (cnd ? l : r);
- }
- |primary {
- std::string primary_value(walker->resolve<std::string>($primary.libbash_value, $primary.index));
- $value = (primary_value.empty() ? 0 : walker->eval_arithmetic(primary_value));
- }
- |^(PRE_INCR primary) {
- $value = walker->set_value($primary.libbash_value,
- walker->resolve<long>($primary.libbash_value, $primary.index) + 1,
- $primary.index);
- }
- |^(PRE_DECR primary) {
- $value = walker->set_value($primary.libbash_value,
- walker->resolve<long>($primary.libbash_value, $primary.index) - 1,
- $primary.index);
- }
- |^(POST_INCR primary) {
- $value = walker->set_value($primary.libbash_value,
- walker->resolve<long>($primary.libbash_value, $primary.index) + 1,
- $primary.index);
- --$value;
- }
- |^(POST_DECR primary) {
- $value = walker->set_value($primary.libbash_value,
- walker->resolve<long>($primary.libbash_value, $primary.index) - 1,
- $primary.index);
- ++$value;
- }
- |^(EQUALS primary l=arithmetics) {
- $value = walker->set_value($primary.libbash_value, l, $primary.index);
- }
- |^(MUL_ASSIGN primary l=arithmetics) {
- $value = walker->set_value($primary.libbash_value,
- walker->resolve<long>($primary.libbash_value, $primary.index) * l,
- $primary.index);
- }
- |^(DIVIDE_ASSIGN primary l=arithmetics) {
- $value = walker->set_value($primary.libbash_value,
- walker->resolve<long>($primary.libbash_value, $primary.index) / l,
- $primary.index);
- }
- |^(MOD_ASSIGN primary l=arithmetics) {
- $value = walker->set_value($primary.libbash_value,
- walker->resolve<long>($primary.libbash_value, $primary.index) \% l,
- $primary.index);
- }
- |^(PLUS_ASSIGN primary l=arithmetics) {
- $value = walker->set_value($primary.libbash_value,
- walker->resolve<long>($primary.libbash_value, $primary.index) + l,
- $primary.index);
- }
- |^(MINUS_ASSIGN primary l=arithmetics) {
- $value = walker->set_value($primary.libbash_value,
- walker->resolve<long>($primary.libbash_value, $primary.index) - l,
- $primary.index);
- }
- |^(LSHIFT_ASSIGN primary l=arithmetics) {
- $value = walker->set_value($primary.libbash_value,
- walker->resolve<long>($primary.libbash_value, $primary.index) << l,
- $primary.index);
- }
- |^(RSHIFT_ASSIGN primary l=arithmetics) {
- $value = walker->set_value($primary.libbash_value,
- walker->resolve<long>($primary.libbash_value, $primary.index) >> l,
- $primary.index);
- }
- |^(AND_ASSIGN primary l=arithmetics) {
- $value = walker->set_value($primary.libbash_value,
- walker->resolve<long>($primary.libbash_value, $primary.index) & l,
- $primary.index);
- }
- |^(XOR_ASSIGN primary l=arithmetics) {
- $value = walker->set_value($primary.libbash_value,
- walker->resolve<long>($primary.libbash_value, $primary.index) ^ l,
- $primary.index);
- }
- |^(OR_ASSIGN primary l=arithmetics) {
- $value = walker->set_value($primary.libbash_value,
- walker->resolve<long>($primary.libbash_value, $primary.index) | l,
- $primary.index);
- }
- | NUMBER { $value = parse_integer($NUMBER);}
- | DIGIT { $value = parse_integer($DIGIT);}
- | ^(VAR_REF libbash_string = var_expansion) { $value = boost::lexical_cast<long>(libbash_string); }
- ;
diff --git a/libbash-0.1/configure.ac b/libbash-0.1/configure.ac
deleted file mode 100644
index 3563013..0000000
--- a/libbash-0.1/configure.ac
+++ /dev/null
@@ -1,73 +0,0 @@
-dnl ############################################
-dnl Please use git log for copyright holder and year information
-dnl
-dnl This file is part of libbash.
-dnl
-dnl libbash is free software: you can redistribute it and/or modify
-dnl it under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation, either version 2 of the License, or
-dnl (at your option) any later version.
-dnl
-dnl libbash is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-dnl GNU General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl along with libbash. If not, see <http://www.gnu.org/licenses/>.
-dnl #############################################
-
-AC_PREREQ(2.65)
-AC_CONFIG_MACRO_DIR([m4])
-AC_INIT([libbash],[0.1],[https://bugs.gentoo.org/enter_bug.cgi?component=libbash&product=Gentoo%20Hosted%20Projects])
-AM_INIT_AUTOMAKE([foreign parallel-tests color-tests subdir-objects 1.11])
-AM_SILENT_RULES([yes])
-AC_PROG_CXX
-LT_INIT
-
-AC_ARG_ENABLE([developer],
- [AS_HELP_STRING([--enable-developer],[enables various QA checks])])
-AM_CONDITIONAL([DEVELOPER_MODE],[test "x$enable_developer" = xyes])
-
-PKG_CHECK_MODULES([PALUDIS], [paludis])
-
-AS_IF([test "x$enable_developer" = xyes],[boost_version="1.46.1"],[boost_version="1.43.0"])
-AX_BOOST_BASE([$boost_version],[:],
- [AC_MSG_ERROR([Needed boost not found])])
-AX_BOOST_SYSTEM
-AX_BOOST_FILESYSTEM
-AX_BOOST_PROGRAM_OPTIONS
-AC_PATH_PROG([JAVA],[java],"no")
-if test "$JAVA" = "no"; then
- AC_MSG_ERROR([No java executable found])
-fi
-GTEST_LIB_CHECK(,[:],[:])
-
-AC_ARG_WITH(antlr, [],with_antlr=$withval,with_antlr=jc)
-AS_IF([test "$with_antlr" = "jc"], [
- AC_PATH_PROG(JAVA_CONFIG, java-config, "no")
- if test "$JAVA_CONFIG" = "no"; then
- AC_MSG_ERROR([java-config tool not found. Please give the location of an antlr3 jar using --with-antlr])
- fi
- AC_SUBST(antlr_cp,["$($JAVA_CONFIG -dp antlr-3)"])
- ],
- [test -f "$with_antlr"], [AC_SUBST(antlr_cp,["$with_antlr"])],
- [AC_MSG_ERROR([Antlr jar $with_antlr not found])])
-
-AC_PATH_PROG([PDFLATEX],[pdflatex],"no")
-if test "$PDFLATEX" = "no"; then
- AC_MSG_RESULT([pdflatex not found on your system. You will be unable to generate the coding standard])
-fi
-
-AC_CHECK_LIB([antlr3c],[antlr3AsciiFileStreamNew],[],[AC_MSG_ERROR(libasntlr3c not found. Have you installed the C antlr runtime?)])
-AC_CONFIG_FILES([Makefile])
-DX_HTML_FEATURE(ON)
-DX_MAN_FEATURE(OFF)
-DX_CHM_FEATURE(OFF)
-DX_CHI_FEATURE(OFF)
-DX_RTF_FEATURE(OFF)
-DX_XML_FEATURE(OFF)
-DX_PDF_FEATURE(OFF)
-DX_PS_FEATURE(OFF)
-DX_INIT_DOXYGEN([$PACKAGE_NAME], [Doxyfile])
-AC_OUTPUT
diff --git a/libbash-0.1/doxygen.am b/libbash-0.1/doxygen.am
deleted file mode 100644
index 420049e..0000000
--- a/libbash-0.1/doxygen.am
+++ /dev/null
@@ -1,186 +0,0 @@
-# Copyright (C) 2004 Oren Ben-Kiki
-# This file is distributed under the same terms as the Automake macro files.
-
-# Generate automatic documentation using Doxygen. Goals and variables values
-# are controlled by the various DX_COND_??? conditionals set by autoconf.
-#
-# The provided goals are:
-# doxygen-doc: Generate all doxygen documentation.
-# doxygen-run: Run doxygen, which will generate some of the documentation
-# (HTML, CHM, CHI, MAN, RTF, XML) but will not do the post
-# processing required for the rest of it (PS, PDF, and some MAN).
-# doxygen-man: Rename some doxygen generated man pages.
-# doxygen-ps: Generate doxygen PostScript documentation.
-# doxygen-pdf: Generate doxygen PDF documentation.
-#
-# Note that by default these are not integrated into the automake goals. If
-# doxygen is used to generate man pages, you can achieve this integration by
-# setting man3_MANS to the list of man pages generated and then adding the
-# dependency:
-#
-# $(man3_MANS): doxygen-doc
-#
-# This will cause make to run doxygen and generate all the documentation.
-#
-# The following variable is intended for use in Makefile.am:
-#
-# DX_CLEANFILES = everything to clean.
-#
-# This is usually added to MOSTLYCLEANFILES.
-
-## --------------------------------- ##
-## Format-independent Doxygen rules. ##
-## --------------------------------- ##
-
-if DX_COND_doc
-
-## ------------------------------- ##
-## Rules specific for HTML output. ##
-## ------------------------------- ##
-
-if DX_COND_html
-
-DX_CLEAN_HTML = @DX_DOCDIR@/html
-
-endif DX_COND_html
-
-## ------------------------------ ##
-## Rules specific for CHM output. ##
-## ------------------------------ ##
-
-if DX_COND_chm
-
-DX_CLEAN_CHM = @DX_DOCDIR@/chm
-
-if DX_COND_chi
-
-DX_CLEAN_CHI = @DX_DOCDIR@/@PACKAGE@.chi
-
-endif DX_COND_chi
-
-endif DX_COND_chm
-
-## ------------------------------ ##
-## Rules specific for MAN output. ##
-## ------------------------------ ##
-
-if DX_COND_man
-
-DX_CLEAN_MAN = @DX_DOCDIR@/man
-
-endif DX_COND_man
-
-## ------------------------------ ##
-## Rules specific for RTF output. ##
-## ------------------------------ ##
-
-if DX_COND_rtf
-
-DX_CLEAN_RTF = @DX_DOCDIR@/rtf
-
-endif DX_COND_rtf
-
-## ------------------------------ ##
-## Rules specific for XML output. ##
-## ------------------------------ ##
-
-if DX_COND_xml
-
-DX_CLEAN_XML = @DX_DOCDIR@/xml
-
-endif DX_COND_xml
-
-## ----------------------------- ##
-## Rules specific for PS output. ##
-## ----------------------------- ##
-
-if DX_COND_ps
-
-DX_CLEAN_PS = @DX_DOCDIR@/@PACKAGE@.ps
-
-DX_PS_GOAL = doxygen-ps
-
-doxygen-ps: @DX_DOCDIR@/@PACKAGE@.ps
-
-@DX_DOCDIR@/@PACKAGE@.ps: @DX_DOCDIR@/@PACKAGE@.tag
- cd @DX_DOCDIR@/latex; \
- rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \
- $(DX_LATEX) refman.tex; \
- $(MAKEINDEX_PATH) refman.idx; \
- $(DX_LATEX) refman.tex; \
- countdown=5; \
- while $(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \
- refman.log > /dev/null 2>&1 \
- && test $$countdown -gt 0; do \
- $(DX_LATEX) refman.tex; \
- countdown=`expr $$countdown - 1`; \
- done; \
- $(DX_DVIPS) -o ../@PACKAGE@.ps refman.dvi
-
-endif DX_COND_ps
-
-## ------------------------------ ##
-## Rules specific for PDF output. ##
-## ------------------------------ ##
-
-if DX_COND_pdf
-
-DX_CLEAN_PDF = @DX_DOCDIR@/@PACKAGE@.pdf
-
-DX_PDF_GOAL = doxygen-pdf
-
-doxygen-pdf: @DX_DOCDIR@/@PACKAGE@.pdf
-
-@DX_DOCDIR@/@PACKAGE@.pdf: @DX_DOCDIR@/@PACKAGE@.tag
- cd @DX_DOCDIR@/latex; \
- rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \
- $(DX_PDFLATEX) refman.tex; \
- $(DX_MAKEINDEX) refman.idx; \
- $(DX_PDFLATEX) refman.tex; \
- countdown=5; \
- while $(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \
- refman.log > /dev/null 2>&1 \
- && test $$countdown -gt 0; do \
- $(DX_PDFLATEX) refman.tex; \
- countdown=`expr $$countdown - 1`; \
- done; \
- mv refman.pdf ../@PACKAGE@.pdf
-
-endif DX_COND_pdf
-
-## ------------------------------------------------- ##
-## Rules specific for LaTeX (shared for PS and PDF). ##
-## ------------------------------------------------- ##
-
-if DX_COND_latex
-
-DX_CLEAN_LATEX = @DX_DOCDIR@/latex
-
-endif DX_COND_latex
-
-.PHONY: doxygen-run doxygen-doc $(DX_PS_GOAL) $(DX_PDF_GOAL)
-
-.INTERMEDIATE: doxygen-run $(DX_PS_GOAL) $(DX_PDF_GOAL)
-
-doxygen-run: @DX_DOCDIR@/@PACKAGE@.tag
-
-doxygen-doc: doxygen-run $(DX_PS_GOAL) $(DX_PDF_GOAL)
-
-@DX_DOCDIR@/@PACKAGE@.tag: $(DX_CONFIG) $(pkginclude_HEADERS)
- rm -rf @DX_DOCDIR@
- $(DX_ENV) $(DX_DOXYGEN) $(srcdir)/$(DX_CONFIG)
-
-DX_CLEANFILES = \
- @DX_DOCDIR@/@PACKAGE@.tag \
- -r \
- $(DX_CLEAN_HTML) \
- $(DX_CLEAN_CHM) \
- $(DX_CLEAN_CHI) \
- $(DX_CLEAN_MAN) \
- $(DX_CLEAN_RTF) \
- $(DX_CLEAN_XML) \
- $(DX_CLEAN_PS) \
- $(DX_CLEAN_PDF) \
- $(DX_CLEAN_LATEX)
-
-endif DX_COND_doc
diff --git a/libbash-0.1/m4/ax_boost_base.m4 b/libbash-0.1/m4/ax_boost_base.m4
deleted file mode 100644
index 8f935f6..0000000
--- a/libbash-0.1/m4/ax_boost_base.m4
+++ /dev/null
@@ -1,252 +0,0 @@
-# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_boost_base.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_BOOST_BASE([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
-#
-# DESCRIPTION
-#
-# Test for the Boost C++ libraries of a particular version (or newer)
-#
-# If no path to the installed boost library is given the macro searchs
-# under /usr, /usr/local, /opt and /opt/local and evaluates the
-# $BOOST_ROOT environment variable. Further documentation is available at
-# <http://randspringer.de/boost/index.html>.
-#
-# This macro calls:
-#
-# AC_SUBST(BOOST_CPPFLAGS) / AC_SUBST(BOOST_LDFLAGS)
-#
-# And sets:
-#
-# HAVE_BOOST
-#
-# LICENSE
-#
-# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
-# Copyright (c) 2009 Peter Adolphs
-#
-# Copying and distribution of this file, with or without modification, are
-# permitted in any medium without royalty provided the copyright notice
-# and this notice are preserved. This file is offered as-is, without any
-# warranty.
-
-#serial 17
-
-AC_DEFUN([AX_BOOST_BASE],
-[
-AC_ARG_WITH([boost],
- [AS_HELP_STRING([--with-boost@<:@=ARG@:>@],
- [use Boost library from a standard location (ARG=yes),
- from the specified location (ARG=<path>),
- or disable it (ARG=no)
- @<:@ARG=yes@:>@ ])],
- [
- if test "$withval" = "no"; then
- want_boost="no"
- elif test "$withval" = "yes"; then
- want_boost="yes"
- ac_boost_path=""
- else
- want_boost="yes"
- ac_boost_path="$withval"
- fi
- ],
- [want_boost="yes"])
-
-
-AC_ARG_WITH([boost-libdir],
- AS_HELP_STRING([--with-boost-libdir=LIB_DIR],
- [Force given directory for boost libraries. Note that this will overwrite library path detection, so use this parameter only if default library detection fails and you know exactly where your boost libraries are located.]),
- [
- if test -d "$withval"
- then
- ac_boost_lib_path="$withval"
- else
- AC_MSG_ERROR(--with-boost-libdir expected directory name)
- fi
- ],
- [ac_boost_lib_path=""]
-)
-
-if test "x$want_boost" = "xyes"; then
- boost_lib_version_req=ifelse([$1], ,1.20.0,$1)
- boost_lib_version_req_shorten=`expr $boost_lib_version_req : '\([[0-9]]*\.[[0-9]]*\)'`
- boost_lib_version_req_major=`expr $boost_lib_version_req : '\([[0-9]]*\)'`
- boost_lib_version_req_minor=`expr $boost_lib_version_req : '[[0-9]]*\.\([[0-9]]*\)'`
- boost_lib_version_req_sub_minor=`expr $boost_lib_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
- if test "x$boost_lib_version_req_sub_minor" = "x" ; then
- boost_lib_version_req_sub_minor="0"
- fi
- WANT_BOOST_VERSION=`expr $boost_lib_version_req_major \* 100000 \+ $boost_lib_version_req_minor \* 100 \+ $boost_lib_version_req_sub_minor`
- AC_MSG_CHECKING(for boostlib >= $boost_lib_version_req)
- succeeded=no
-
- dnl On x86_64 systems check for system libraries in both lib64 and lib.
- dnl The former is specified by FHS, but e.g. Debian does not adhere to
- dnl this (as it rises problems for generic multi-arch support).
- dnl The last entry in the list is chosen by default when no libraries
- dnl are found, e.g. when only header-only libraries are installed!
- libsubdirs="lib"
- if test `uname -m` = x86_64; then
- libsubdirs="lib64 lib lib64"
- fi
-
- dnl first we check the system location for boost libraries
- dnl this location ist chosen if boost libraries are installed with the --layout=system option
- dnl or if you install boost with RPM
- if test "$ac_boost_path" != ""; then
- BOOST_LDFLAGS="-L$ac_boost_path/$libsubdir"
- BOOST_CPPFLAGS="-I$ac_boost_path/include"
- elif test "$cross_compiling" != yes; then
- for ac_boost_path_tmp in /usr /usr/local /opt /opt/local ; do
- if test -d "$ac_boost_path_tmp/include/boost" && test -r "$ac_boost_path_tmp/include/boost"; then
- for libsubdir in $libsubdirs ; do
- if ls "$ac_boost_path_tmp/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
- done
- BOOST_LDFLAGS="-L$ac_boost_path_tmp/$libsubdir"
- BOOST_CPPFLAGS="-I$ac_boost_path_tmp/include"
- break;
- fi
- done
- fi
-
- dnl overwrite ld flags if we have required special directory with
- dnl --with-boost-libdir parameter
- if test "$ac_boost_lib_path" != ""; then
- BOOST_LDFLAGS="-L$ac_boost_lib_path"
- fi
-
- CPPFLAGS_SAVED="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
- export CPPFLAGS
-
- LDFLAGS_SAVED="$LDFLAGS"
- LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
- export LDFLAGS
-
- AC_REQUIRE([AC_PROG_CXX])
- AC_LANG_PUSH(C++)
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
- @%:@include <boost/version.hpp>
- ]], [[
- #if BOOST_VERSION >= $WANT_BOOST_VERSION
- // Everything is okay
- #else
- # error Boost version is too old
- #endif
- ]])],[
- AC_MSG_RESULT(yes)
- succeeded=yes
- found_system=yes
- ],[
- ])
- AC_LANG_POP([C++])
-
-
-
- dnl if we found no boost with system layout we search for boost libraries
- dnl built and installed without the --layout=system option or for a staged(not installed) version
- if test "x$succeeded" != "xyes"; then
- _version=0
- if test "$ac_boost_path" != ""; then
- if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
- for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
- _version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
- V_CHECK=`expr $_version_tmp \> $_version`
- if test "$V_CHECK" = "1" ; then
- _version=$_version_tmp
- fi
- VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
- BOOST_CPPFLAGS="-I$ac_boost_path/include/boost-$VERSION_UNDERSCORE"
- done
- fi
- else
- if test "$cross_compiling" != yes; then
- for ac_boost_path in /usr /usr/local /opt /opt/local ; do
- if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
- for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
- _version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
- V_CHECK=`expr $_version_tmp \> $_version`
- if test "$V_CHECK" = "1" ; then
- _version=$_version_tmp
- best_path=$ac_boost_path
- fi
- done
- fi
- done
-
- VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
- BOOST_CPPFLAGS="-I$best_path/include/boost-$VERSION_UNDERSCORE"
- if test "$ac_boost_lib_path" = ""; then
- for libsubdir in $libsubdirs ; do
- if ls "$best_path/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
- done
- BOOST_LDFLAGS="-L$best_path/$libsubdir"
- fi
- fi
-
- if test "x$BOOST_ROOT" != "x"; then
- for libsubdir in $libsubdirs ; do
- if ls "$BOOST_ROOT/stage/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
- done
- if test -d "$BOOST_ROOT" && test -r "$BOOST_ROOT" && test -d "$BOOST_ROOT/stage/$libsubdir" && test -r "$BOOST_ROOT/stage/$libsubdir"; then
- version_dir=`expr //$BOOST_ROOT : '.*/\(.*\)'`
- stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'`
- stage_version_shorten=`expr $stage_version : '\([[0-9]]*\.[[0-9]]*\)'`
- V_CHECK=`expr $stage_version_shorten \>\= $_version`
- if test "$V_CHECK" = "1" -a "$ac_boost_lib_path" = "" ; then
- AC_MSG_NOTICE(We will use a staged boost library from $BOOST_ROOT)
- BOOST_CPPFLAGS="-I$BOOST_ROOT"
- BOOST_LDFLAGS="-L$BOOST_ROOT/stage/$libsubdir"
- fi
- fi
- fi
- fi
-
- CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
- export CPPFLAGS
- LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
- export LDFLAGS
-
- AC_LANG_PUSH(C++)
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
- @%:@include <boost/version.hpp>
- ]], [[
- #if BOOST_VERSION >= $WANT_BOOST_VERSION
- // Everything is okay
- #else
- # error Boost version is too old
- #endif
- ]])],[
- AC_MSG_RESULT(yes)
- succeeded=yes
- found_system=yes
- ],[
- ])
- AC_LANG_POP([C++])
- fi
-
- if test "$succeeded" != "yes" ; then
- if test "$_version" = "0" ; then
- AC_MSG_NOTICE([[We could not detect the boost libraries (version $boost_lib_version_req_shorten or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation.]])
- else
- AC_MSG_NOTICE([Your boost libraries seems to old (version $_version).])
- fi
- # execute ACTION-IF-NOT-FOUND (if present):
- ifelse([$3], , :, [$3])
- else
- AC_SUBST(BOOST_CPPFLAGS)
- AC_SUBST(BOOST_LDFLAGS)
- AC_DEFINE(HAVE_BOOST,,[define if the Boost library is available])
- # execute ACTION-IF-FOUND (if present):
- ifelse([$2], , :, [$2])
- fi
-
- CPPFLAGS="$CPPFLAGS_SAVED"
- LDFLAGS="$LDFLAGS_SAVED"
-fi
-
-])
diff --git a/libbash-0.1/m4/ax_boost_filesystem.m4 b/libbash-0.1/m4/ax_boost_filesystem.m4
deleted file mode 100644
index 2a62da8..0000000
--- a/libbash-0.1/m4/ax_boost_filesystem.m4
+++ /dev/null
@@ -1,118 +0,0 @@
-# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_boost_filesystem.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_BOOST_FILESYSTEM
-#
-# DESCRIPTION
-#
-# Test for Filesystem library from the Boost C++ libraries. The macro
-# requires a preceding call to AX_BOOST_BASE. Further documentation is
-# available at <http://randspringer.de/boost/index.html>.
-#
-# This macro calls:
-#
-# AC_SUBST(BOOST_FILESYSTEM_LIB)
-#
-# And sets:
-#
-# HAVE_BOOST_FILESYSTEM
-#
-# LICENSE
-#
-# Copyright (c) 2009 Thomas Porschberg <thomas@randspringer.de>
-# Copyright (c) 2009 Michael Tindal
-# Copyright (c) 2009 Roman Rybalko <libtorrent@romanr.info>
-#
-# Copying and distribution of this file, with or without modification, are
-# permitted in any medium without royalty provided the copyright notice
-# and this notice are preserved. This file is offered as-is, without any
-# warranty.
-
-#serial 21
-
-AC_DEFUN([AX_BOOST_FILESYSTEM],
-[
- AC_ARG_WITH([boost-filesystem],
- AS_HELP_STRING([--with-boost-filesystem@<:@=special-lib@:>@],
- [use the Filesystem library from boost - it is possible to specify a certain library for the linker
- e.g. --with-boost-filesystem=boost_filesystem-gcc-mt ]),
- [
- if test "$withval" = "no"; then
- want_boost="no"
- elif test "$withval" = "yes"; then
- want_boost="yes"
- ax_boost_user_filesystem_lib=""
- else
- want_boost="yes"
- ax_boost_user_filesystem_lib="$withval"
- fi
- ],
- [want_boost="yes"]
- )
-
- if test "x$want_boost" = "xyes"; then
- AC_REQUIRE([AC_PROG_CC])
- CPPFLAGS_SAVED="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
- export CPPFLAGS
-
- LDFLAGS_SAVED="$LDFLAGS"
- LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
- export LDFLAGS
-
- LIBS_SAVED=$LIBS
- LIBS="$LIBS $BOOST_SYSTEM_LIB"
- export LIBS
-
- AC_CACHE_CHECK(whether the Boost::Filesystem library is available,
- ax_cv_boost_filesystem,
- [AC_LANG_PUSH([C++])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/filesystem/path.hpp>]],
- [[using namespace boost::filesystem;
- path my_path( "foo/bar/data.txt" );
- return 0;]])],
- ax_cv_boost_filesystem=yes, ax_cv_boost_filesystem=no)
- AC_LANG_POP([C++])
- ])
- if test "x$ax_cv_boost_filesystem" = "xyes"; then
- AC_DEFINE(HAVE_BOOST_FILESYSTEM,,[define if the Boost::Filesystem library is available])
- BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
- if test "x$ax_boost_user_filesystem_lib" = "x"; then
- for libextension in `ls $BOOSTLIBDIR/libboost_filesystem*.so* $BOOSTLIBDIR/libboost_filesystem*.dylib* $BOOSTLIBDIR/libboost_filesystem*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_filesystem.*\)\.so.*$;\1;' -e 's;^lib\(boost_filesystem.*\)\.a*$;\1;' -e 's;^lib\(boost_filesystem.*\)\.dylib$;\1;'` ; do
- ax_lib=${libextension}
- AC_CHECK_LIB($ax_lib, exit,
- [BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break],
- [link_filesystem="no"])
- done
- if test "x$link_program_options" != "xyes"; then
- for libextension in `ls $BOOSTLIBDIR/boost_filesystem*.{dll,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_filesystem.*\)\.dll.*$;\1;' -e 's;^\(boost_filesystem.*\)\.a*$;\1;'` ; do
- ax_lib=${libextension}
- AC_CHECK_LIB($ax_lib, exit,
- [BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break],
- [link_filesystem="no"])
- done
- fi
- else
- for ax_lib in $ax_boost_user_filesystem_lib boost_filesystem-$ax_boost_user_filesystem_lib; do
- AC_CHECK_LIB($ax_lib, exit,
- [BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break],
- [link_filesystem="no"])
- done
-
- fi
- if test "x$ax_lib" = "x"; then
- AC_MSG_ERROR(Could not find a version of the library!)
- fi
- if test "x$link_filesystem" != "xyes"; then
- AC_MSG_ERROR(Could not link against $ax_lib !)
- fi
- fi
-
- CPPFLAGS="$CPPFLAGS_SAVED"
- LDFLAGS="$LDFLAGS_SAVED"
- LIBS="$LIBS_SAVED"
- fi
-])
diff --git a/libbash-0.1/m4/ax_boost_program_options.m4 b/libbash-0.1/m4/ax_boost_program_options.m4
deleted file mode 100644
index d612f91..0000000
--- a/libbash-0.1/m4/ax_boost_program_options.m4
+++ /dev/null
@@ -1,108 +0,0 @@
-# ============================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_boost_program_options.html
-# ============================================================================
-#
-# SYNOPSIS
-#
-# AX_BOOST_PROGRAM_OPTIONS
-#
-# DESCRIPTION
-#
-# Test for program options library from the Boost C++ libraries. The macro
-# requires a preceding call to AX_BOOST_BASE. Further documentation is
-# available at <http://randspringer.de/boost/index.html>.
-#
-# This macro calls:
-#
-# AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB)
-#
-# And sets:
-#
-# HAVE_BOOST_PROGRAM_OPTIONS
-#
-# LICENSE
-#
-# Copyright (c) 2009 Thomas Porschberg <thomas@randspringer.de>
-#
-# Copying and distribution of this file, with or without modification, are
-# permitted in any medium without royalty provided the copyright notice
-# and this notice are preserved. This file is offered as-is, without any
-# warranty.
-
-#serial 20
-
-AC_DEFUN([AX_BOOST_PROGRAM_OPTIONS],
-[
- AC_ARG_WITH([boost-program-options],
- AS_HELP_STRING([--with-boost-program-options@<:@=special-lib@:>@],
- [use the program options library from boost - it is possible to specify a certain library for the linker
- e.g. --with-boost-program-options=boost_program_options-gcc-mt-1_33_1 ]),
- [
- if test "$withval" = "no"; then
- want_boost="no"
- elif test "$withval" = "yes"; then
- want_boost="yes"
- ax_boost_user_program_options_lib=""
- else
- want_boost="yes"
- ax_boost_user_program_options_lib="$withval"
- fi
- ],
- [want_boost="yes"]
- )
-
- if test "x$want_boost" = "xyes"; then
- AC_REQUIRE([AC_PROG_CC])
- export want_boost
- CPPFLAGS_SAVED="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
- export CPPFLAGS
- LDFLAGS_SAVED="$LDFLAGS"
- LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
- export LDFLAGS
- AC_CACHE_CHECK([whether the Boost::Program_Options library is available],
- ax_cv_boost_program_options,
- [AC_LANG_PUSH(C++)
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/program_options.hpp>
- ]],
- [[boost::program_options::options_description generic("Generic options");
- return 0;]])],
- ax_cv_boost_program_options=yes, ax_cv_boost_program_options=no)
- AC_LANG_POP([C++])
- ])
- if test "$ax_cv_boost_program_options" = yes; then
- AC_DEFINE(HAVE_BOOST_PROGRAM_OPTIONS,,[define if the Boost::PROGRAM_OPTIONS library is available])
- BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
- if test "x$ax_boost_user_program_options_lib" = "x"; then
- for libextension in `ls $BOOSTLIBDIR/libboost_program_options*.so* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_program_options.*\)\.so.*$;\1;'` `ls $BOOSTLIBDIR/libboost_program_options*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_program_options.*\)\.a*$;\1;'` ; do
- ax_lib=${libextension}
- AC_CHECK_LIB($ax_lib, exit,
- [BOOST_PROGRAM_OPTIONS_LIB="-l$ax_lib"; AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB) link_program_options="yes"; break],
- [link_program_options="no"])
- done
- if test "x$link_program_options" != "xyes"; then
- for libextension in `ls $BOOSTLIBDIR/boost_program_options*.dll* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_program_options.*\)\.dll.*$;\1;'` `ls $BOOSTLIBDIR/boost_program_options*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_program_options.*\)\.a*$;\1;'` ; do
- ax_lib=${libextension}
- AC_CHECK_LIB($ax_lib, exit,
- [BOOST_PROGRAM_OPTIONS_LIB="-l$ax_lib"; AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB) link_program_options="yes"; break],
- [link_program_options="no"])
- done
- fi
- else
- for ax_lib in $ax_boost_user_program_options_lib boost_program_options-$ax_boost_user_program_options_lib; do
- AC_CHECK_LIB($ax_lib, main,
- [BOOST_PROGRAM_OPTIONS_LIB="-l$ax_lib"; AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB) link_program_options="yes"; break],
- [link_program_options="no"])
- done
- fi
- if test "x$ax_lib" = "x"; then
- AC_MSG_ERROR(Could not find a version of the library!)
- fi
- if test "x$link_program_options" != "xyes"; then
- AC_MSG_ERROR([Could not link against [$ax_lib] !])
- fi
- fi
- CPPFLAGS="$CPPFLAGS_SAVED"
- LDFLAGS="$LDFLAGS_SAVED"
- fi
-])
diff --git a/libbash-0.1/m4/ax_boost_system.m4 b/libbash-0.1/m4/ax_boost_system.m4
deleted file mode 100644
index 7fbf6d3..0000000
--- a/libbash-0.1/m4/ax_boost_system.m4
+++ /dev/null
@@ -1,120 +0,0 @@
-# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_boost_system.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_BOOST_SYSTEM
-#
-# DESCRIPTION
-#
-# Test for System library from the Boost C++ libraries. The macro requires
-# a preceding call to AX_BOOST_BASE. Further documentation is available at
-# <http://randspringer.de/boost/index.html>.
-#
-# This macro calls:
-#
-# AC_SUBST(BOOST_SYSTEM_LIB)
-#
-# And sets:
-#
-# HAVE_BOOST_SYSTEM
-#
-# LICENSE
-#
-# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
-# Copyright (c) 2008 Michael Tindal
-# Copyright (c) 2008 Daniel Casimiro <dan.casimiro@gmail.com>
-#
-# Copying and distribution of this file, with or without modification, are
-# permitted in any medium without royalty provided the copyright notice
-# and this notice are preserved. This file is offered as-is, without any
-# warranty.
-
-#serial 14
-
-AC_DEFUN([AX_BOOST_SYSTEM],
-[
- AC_ARG_WITH([boost-system],
- AS_HELP_STRING([--with-boost-system@<:@=special-lib@:>@],
- [use the System library from boost - it is possible to specify a certain library for the linker
- e.g. --with-boost-system=boost_system-gcc-mt ]),
- [
- if test "$withval" = "no"; then
- want_boost="no"
- elif test "$withval" = "yes"; then
- want_boost="yes"
- ax_boost_user_system_lib=""
- else
- want_boost="yes"
- ax_boost_user_system_lib="$withval"
- fi
- ],
- [want_boost="yes"]
- )
-
- if test "x$want_boost" = "xyes"; then
- AC_REQUIRE([AC_PROG_CC])
- AC_REQUIRE([AC_CANONICAL_BUILD])
- CPPFLAGS_SAVED="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
- export CPPFLAGS
-
- LDFLAGS_SAVED="$LDFLAGS"
- LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
- export LDFLAGS
-
- AC_CACHE_CHECK(whether the Boost::System library is available,
- ax_cv_boost_system,
- [AC_LANG_PUSH([C++])
- CXXFLAGS_SAVE=$CXXFLAGS
-
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/system/error_code.hpp>]],
- [[boost::system::system_category]])],
- ax_cv_boost_system=yes, ax_cv_boost_system=no)
- CXXFLAGS=$CXXFLAGS_SAVE
- AC_LANG_POP([C++])
- ])
- if test "x$ax_cv_boost_system" = "xyes"; then
- AC_SUBST(BOOST_CPPFLAGS)
-
- AC_DEFINE(HAVE_BOOST_SYSTEM,,[define if the Boost::System library is available])
- BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
-
- LDFLAGS_SAVE=$LDFLAGS
- if test "x$ax_boost_user_system_lib" = "x"; then
- for libextension in `ls $BOOSTLIBDIR/libboost_system*.so* $BOOSTLIBDIR/libboost_system*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_system.*\)\.so.*$;\1;' -e 's;^lib\(boost_system.*\)\.a*$;\1;'` ; do
- ax_lib=${libextension}
- AC_CHECK_LIB($ax_lib, exit,
- [BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break],
- [link_system="no"])
- done
- if test "x$link_system" != "xyes"; then
- for libextension in `ls $BOOSTLIBDIR/boost_system*.{dll,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_system.*\)\.dll.*$;\1;' -e 's;^\(boost_system.*\)\.a*$;\1;'` ; do
- ax_lib=${libextension}
- AC_CHECK_LIB($ax_lib, exit,
- [BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break],
- [link_system="no"])
- done
- fi
-
- else
- for ax_lib in $ax_boost_user_system_lib boost_system-$ax_boost_user_system_lib; do
- AC_CHECK_LIB($ax_lib, exit,
- [BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break],
- [link_system="no"])
- done
-
- fi
- if test "x$ax_lib" = "x"; then
- AC_MSG_ERROR(Could not find a version of the library!)
- fi
- if test "x$link_system" = "xno"; then
- AC_MSG_ERROR(Could not link against $ax_lib !)
- fi
- fi
-
- CPPFLAGS="$CPPFLAGS_SAVED"
- LDFLAGS="$LDFLAGS_SAVED"
- fi
-])
diff --git a/libbash-0.1/m4/doxample.m4 b/libbash-0.1/m4/doxample.m4
deleted file mode 100644
index d9a951c..0000000
--- a/libbash-0.1/m4/doxample.m4
+++ /dev/null
@@ -1,321 +0,0 @@
-# This file is part of Autoconf. -*- Autoconf -*-
-
-# Copyright (C) 2004 Oren Ben-Kiki
-# This file is distributed under the same terms as the Autoconf macro files.
-
-########## CHANGELOG ##################
-# 2009-01-14 Martin Mann
-# * DX_ARG_ABLE : new variable 'DX_FLAG_DX_CURRENT_FEATURE'
-# * DX_CLEAR_DEPEND : use of explicit variable 'DX_FLAG_DX_CURRENT_FEATURE'
-# in AC_SUBST instead of 'DX_FLAG[]DX_CURRENT_FEATURE' which is rejected by
-# newer autotools
-
-# Generate automatic documentation using Doxygen. Works in concert with the
-# aminclude.m4 file and a compatible doxygen configuration file. Defines the
-# following public macros:
-#
-# DX_???_FEATURE(ON|OFF) - control the default setting fo a Doxygen feature.
-# Supported features are 'DOXYGEN' itself, 'DOT' for generating graphics,
-# 'HTML' for plain HTML, 'CHM' for compressed HTML help (for MS users), 'CHI'
-# for generating a seperate .chi file by the .chm file, and 'MAN', 'RTF',
-# 'XML', 'PDF' and 'PS' for the appropriate output formats. The environment
-# variable DOXYGEN_PAPER_SIZE may be specified to override the default 'a4wide'
-# paper size.
-#
-# By default, HTML, PDF and PS documentation is generated as this seems to be
-# the most popular and portable combination. MAN pages created by Doxygen are
-# usually problematic, though by picking an appropriate subset and doing some
-# massaging they might be better than nothing. CHM and RTF are specific for MS
-# (note that you can't generate both HTML and CHM at the same time). The XML is
-# rather useless unless you apply specialized post-processing to it.
-#
-# The macro mainly controls the default state of the feature. The use can
-# override the default by specifying --enable or --disable. The macros ensure
-# that contradictory flags are not given (e.g., --enable-doxygen-html and
-# --enable-doxygen-chm, --enable-doxygen-anything with --disable-doxygen, etc.)
-# Finally, each feature will be automatically disabled (with a warning) if the
-# required programs are missing.
-#
-# Once all the feature defaults have been specified, call DX_INIT_DOXYGEN with
-# the following parameters: a one-word name for the project for use as a
-# filename base etc., an optional configuration file name (the default is
-# 'Doxyfile', the same as Doxygen's default), and an optional output directory
-# name (the default is 'doxygen-doc').
-
-## ----------##
-## Defaults. ##
-## ----------##
-
-DX_ENV=""
-AC_DEFUN([DX_FEATURE_doc], ON)
-AC_DEFUN([DX_FEATURE_dot], ON)
-AC_DEFUN([DX_FEATURE_man], OFF)
-AC_DEFUN([DX_FEATURE_html], ON)
-AC_DEFUN([DX_FEATURE_chm], OFF)
-AC_DEFUN([DX_FEATURE_chi], OFF)
-AC_DEFUN([DX_FEATURE_rtf], OFF)
-AC_DEFUN([DX_FEATURE_xml], OFF)
-AC_DEFUN([DX_FEATURE_pdf], ON)
-AC_DEFUN([DX_FEATURE_ps], ON)
-
-## --------------- ##
-## Private macros. ##
-## --------------- ##
-
-# DX_ENV_APPEND(VARIABLE, VALUE)
-# ------------------------------
-# Append VARIABLE="VALUE" to DX_ENV for invoking doxygen.
-AC_DEFUN([DX_ENV_APPEND], [AC_SUBST([DX_ENV], ["$DX_ENV $1='$2'"])])
-
-# DX_DIRNAME_EXPR
-# ---------------
-# Expand into a shell expression prints the directory part of a path.
-AC_DEFUN([DX_DIRNAME_EXPR],
- [[expr ".$1" : '\(\.\)[^/]*$' \| "x$1" : 'x\(.*\)/[^/]*$']])
-
-# DX_IF_FEATURE(FEATURE, IF-ON, IF-OFF)
-# -------------------------------------
-# Expands according to the M4 (static) status of the feature.
-AC_DEFUN([DX_IF_FEATURE], [ifelse(DX_FEATURE_$1, ON, [$2], [$3])])
-
-# DX_REQUIRE_PROG(VARIABLE, PROGRAM)
-# ----------------------------------
-# Require the specified program to be found for the DX_CURRENT_FEATURE to work.
-AC_DEFUN([DX_REQUIRE_PROG], [
-AC_PATH_TOOL([$1], [$2])
-if test "$DX_FLAG_DX_CURRENT_FEATURE$$1" = 1; then
- AC_MSG_WARN([$2 not found - will not DX_CURRENT_DESCRIPTION])
- AC_SUBST([DX_FLAG_DX_CURRENT_FEATURE], 0)
-fi
-])
-
-# DX_TEST_FEATURE(FEATURE)
-# ------------------------
-# Expand to a shell expression testing whether the feature is active.
-AC_DEFUN([DX_TEST_FEATURE], [test "$DX_FLAG_$1" = 1])
-
-# DX_CHECK_DEPEND(REQUIRED_FEATURE, REQUIRED_STATE)
-# -------------------------------------------------
-# Verify that a required features has the right state before trying to turn on
-# the DX_CURRENT_FEATURE.
-AC_DEFUN([DX_CHECK_DEPEND], [
-test "$DX_FLAG_$1" = "$2" \
-|| AC_MSG_ERROR([doxygen-DX_CURRENT_FEATURE ifelse([$2], 1,
- requires, contradicts) doxygen-DX_CURRENT_FEATURE])
-])
-
-# DX_CLEAR_DEPEND(FEATURE, REQUIRED_FEATURE, REQUIRED_STATE)
-# ----------------------------------------------------------
-# Turn off the DX_CURRENT_FEATURE if the required feature is off.
-AC_DEFUN([DX_CLEAR_DEPEND], [
-test "$DX_FLAG_$1" = "$2" || AC_SUBST([DX_FLAG_DX_CURRENT_FEATURE], 0)
-])
-
-
-# DX_FEATURE_ARG(FEATURE, DESCRIPTION,
-# CHECK_DEPEND, CLEAR_DEPEND,
-# REQUIRE, DO-IF-ON, DO-IF-OFF)
-# --------------------------------------------
-# Parse the command-line option controlling a feature. CHECK_DEPEND is called
-# if the user explicitly turns the feature on (and invokes DX_CHECK_DEPEND),
-# otherwise CLEAR_DEPEND is called to turn off the default state if a required
-# feature is disabled (using DX_CLEAR_DEPEND). REQUIRE performs additional
-# requirement tests (DX_REQUIRE_PROG). Finally, an automake flag is set and
-# DO-IF-ON or DO-IF-OFF are called according to the final state of the feature.
-AC_DEFUN([DX_ARG_ABLE], [
- AC_DEFUN([DX_CURRENT_FEATURE], [$1])
- AC_DEFUN([DX_FLAG_DX_CURRENT_FEATURE], [DX_FLAG_$1])
- AC_DEFUN([DX_CURRENT_DESCRIPTION], [$2])
- AC_ARG_ENABLE(doxygen-$1,
- [AS_HELP_STRING(DX_IF_FEATURE([$1], [--disable-doxygen-$1],
- [--enable-doxygen-$1]),
- DX_IF_FEATURE([$1], [don't $2], [$2]))],
- [
-case "$enableval" in
-#(
-y|Y|yes|Yes|YES)
- AC_SUBST([DX_FLAG_$1], 1)
- $3
-;; #(
-n|N|no|No|NO)
- AC_SUBST([DX_FLAG_$1], 0)
-;; #(
-*)
- AC_MSG_ERROR([invalid value '$enableval' given to doxygen-$1])
-;;
-esac
-], [
-AC_SUBST([DX_FLAG_$1], [DX_IF_FEATURE([$1], 1, 0)])
-$4
-])
-if DX_TEST_FEATURE([$1]); then
- $5
- :
-fi
-if DX_TEST_FEATURE([$1]); then
- AM_CONDITIONAL(DX_COND_$1, :)
- $6
- :
-else
- AM_CONDITIONAL(DX_COND_$1, false)
- $7
- :
-fi
-])
-
-## -------------- ##
-## Public macros. ##
-## -------------- ##
-
-# DX_XXX_FEATURE(DEFAULT_STATE)
-# -----------------------------
-AC_DEFUN([DX_DOXYGEN_FEATURE], [AC_DEFUN([DX_FEATURE_doc], [$1])])
-AC_DEFUN([DX_MAN_FEATURE], [AC_DEFUN([DX_FEATURE_man], [$1])])
-AC_DEFUN([DX_HTML_FEATURE], [AC_DEFUN([DX_FEATURE_html], [$1])])
-AC_DEFUN([DX_CHM_FEATURE], [AC_DEFUN([DX_FEATURE_chm], [$1])])
-AC_DEFUN([DX_CHI_FEATURE], [AC_DEFUN([DX_FEATURE_chi], [$1])])
-AC_DEFUN([DX_RTF_FEATURE], [AC_DEFUN([DX_FEATURE_rtf], [$1])])
-AC_DEFUN([DX_XML_FEATURE], [AC_DEFUN([DX_FEATURE_xml], [$1])])
-AC_DEFUN([DX_XML_FEATURE], [AC_DEFUN([DX_FEATURE_xml], [$1])])
-AC_DEFUN([DX_PDF_FEATURE], [AC_DEFUN([DX_FEATURE_pdf], [$1])])
-AC_DEFUN([DX_PS_FEATURE], [AC_DEFUN([DX_FEATURE_ps], [$1])])
-
-# DX_INIT_DOXYGEN(PROJECT, [CONFIG-FILE], [OUTPUT-DOC-DIR])
-# ---------------------------------------------------------
-# PROJECT also serves as the base name for the documentation files.
-# The default CONFIG-FILE is "Doxyfile" and OUTPUT-DOC-DIR is "doxygen-doc".
-AC_DEFUN([DX_INIT_DOXYGEN], [
-
-# Files:
-AC_SUBST([DX_PROJECT], [$1])
-AC_SUBST([DX_CONFIG], [ifelse([$2], [], Doxyfile, [$2])])
-AC_SUBST([DX_DOCDIR], [ifelse([$3], [], doxygen-doc, [$3])])
-
-# Environment variables used inside doxygen.cfg:
-DX_ENV_APPEND(SRCDIR, $srcdir)
-DX_ENV_APPEND(PROJECT, $DX_PROJECT)
-DX_ENV_APPEND(DOCDIR, $DX_DOCDIR)
-DX_ENV_APPEND(VERSION, $PACKAGE_VERSION)
-
-# Doxygen itself:
-DX_ARG_ABLE(doc, [generate any doxygen documentation],
- [],
- [],
- [DX_REQUIRE_PROG([DX_DOXYGEN], doxygen)
- DX_REQUIRE_PROG([DX_PERL], perl)],
- [DX_ENV_APPEND(PERL_PATH, $DX_PERL)])
-
-# Dot for graphics:
-DX_ARG_ABLE(dot, [generate graphics for doxygen documentation],
- [DX_CHECK_DEPEND(doc, 1)],
- [DX_CLEAR_DEPEND(doc, 1)],
- [DX_REQUIRE_PROG([DX_DOT], dot)],
- [DX_ENV_APPEND(HAVE_DOT, YES)
- DX_ENV_APPEND(DOT_PATH, [`DX_DIRNAME_EXPR($DX_DOT)`])],
- [DX_ENV_APPEND(HAVE_DOT, NO)])
-
-# Man pages generation:
-DX_ARG_ABLE(man, [generate doxygen manual pages],
- [DX_CHECK_DEPEND(doc, 1)],
- [DX_CLEAR_DEPEND(doc, 1)],
- [],
- [DX_ENV_APPEND(GENERATE_MAN, YES)],
- [DX_ENV_APPEND(GENERATE_MAN, NO)])
-
-# RTF file generation:
-DX_ARG_ABLE(rtf, [generate doxygen RTF documentation],
- [DX_CHECK_DEPEND(doc, 1)],
- [DX_CLEAR_DEPEND(doc, 1)],
- [],
- [DX_ENV_APPEND(GENERATE_RTF, YES)],
- [DX_ENV_APPEND(GENERATE_RTF, NO)])
-
-# XML file generation:
-DX_ARG_ABLE(xml, [generate doxygen XML documentation],
- [DX_CHECK_DEPEND(doc, 1)],
- [DX_CLEAR_DEPEND(doc, 1)],
- [],
- [DX_ENV_APPEND(GENERATE_XML, YES)],
- [DX_ENV_APPEND(GENERATE_XML, NO)])
-
-# (Compressed) HTML help generation:
-DX_ARG_ABLE(chm, [generate doxygen compressed HTML help documentation],
- [DX_CHECK_DEPEND(doc, 1)],
- [DX_CLEAR_DEPEND(doc, 1)],
- [DX_REQUIRE_PROG([DX_HHC], hhc)],
- [DX_ENV_APPEND(HHC_PATH, $DX_HHC)
- DX_ENV_APPEND(GENERATE_HTML, YES)
- DX_ENV_APPEND(GENERATE_HTMLHELP, YES)],
- [DX_ENV_APPEND(GENERATE_HTMLHELP, NO)])
-
-# Seperate CHI file generation.
-DX_ARG_ABLE(chi, [generate doxygen seperate compressed HTML help index file],
- [DX_CHECK_DEPEND(chm, 1)],
- [DX_CLEAR_DEPEND(chm, 1)],
- [],
- [DX_ENV_APPEND(GENERATE_CHI, YES)],
- [DX_ENV_APPEND(GENERATE_CHI, NO)])
-
-# Plain HTML pages generation:
-DX_ARG_ABLE(html, [generate doxygen plain HTML documentation],
- [DX_CHECK_DEPEND(doc, 1) DX_CHECK_DEPEND(chm, 0)],
- [DX_CLEAR_DEPEND(doc, 1) DX_CLEAR_DEPEND(chm, 0)],
- [],
- [DX_ENV_APPEND(GENERATE_HTML, YES)],
- [DX_TEST_FEATURE(chm) || DX_ENV_APPEND(GENERATE_HTML, NO)])
-
-# PostScript file generation:
-DX_ARG_ABLE(ps, [generate doxygen PostScript documentation],
- [DX_CHECK_DEPEND(doc, 1)],
- [DX_CLEAR_DEPEND(doc, 1)],
- [DX_REQUIRE_PROG([DX_LATEX], latex)
- DX_REQUIRE_PROG([DX_MAKEINDEX], makeindex)
- DX_REQUIRE_PROG([DX_DVIPS], dvips)
- DX_REQUIRE_PROG([DX_EGREP], egrep)])
-
-# PDF file generation:
-DX_ARG_ABLE(pdf, [generate doxygen PDF documentation],
- [DX_CHECK_DEPEND(doc, 1)],
- [DX_CLEAR_DEPEND(doc, 1)],
- [DX_REQUIRE_PROG([DX_PDFLATEX], pdflatex)
- DX_REQUIRE_PROG([DX_MAKEINDEX], makeindex)
- DX_REQUIRE_PROG([DX_EGREP], egrep)])
-
-# LaTeX generation for PS and/or PDF:
-if DX_TEST_FEATURE(ps) || DX_TEST_FEATURE(pdf); then
- AM_CONDITIONAL(DX_COND_latex, :)
- DX_ENV_APPEND(GENERATE_LATEX, YES)
-else
- AM_CONDITIONAL(DX_COND_latex, false)
- DX_ENV_APPEND(GENERATE_LATEX, NO)
-fi
-
-# Paper size for PS and/or PDF:
-AC_ARG_VAR(DOXYGEN_PAPER_SIZE,
- [a4wide (default), a4, letter, legal or executive])
-case "$DOXYGEN_PAPER_SIZE" in
-#(
-"")
- AC_SUBST(DOXYGEN_PAPER_SIZE, "")
-;; #(
-a4wide|a4|letter|legal|executive)
- DX_ENV_APPEND(PAPER_SIZE, $DOXYGEN_PAPER_SIZE)
-;; #(
-*)
- AC_MSG_ERROR([unknown DOXYGEN_PAPER_SIZE='$DOXYGEN_PAPER_SIZE'])
-;;
-esac
-
-#For debugging:
-#echo DX_FLAG_doc=$DX_FLAG_doc
-#echo DX_FLAG_dot=$DX_FLAG_dot
-#echo DX_FLAG_man=$DX_FLAG_man
-#echo DX_FLAG_html=$DX_FLAG_html
-#echo DX_FLAG_chm=$DX_FLAG_chm
-#echo DX_FLAG_chi=$DX_FLAG_chi
-#echo DX_FLAG_rtf=$DX_FLAG_rtf
-#echo DX_FLAG_xml=$DX_FLAG_xml
-#echo DX_FLAG_pdf=$DX_FLAG_pdf
-#echo DX_FLAG_ps=$DX_FLAG_ps
-#echo DX_ENV=$DX_ENV
-])
diff --git a/libbash-0.1/m4/gtest.m4 b/libbash-0.1/m4/gtest.m4
deleted file mode 100644
index e96650b..0000000
--- a/libbash-0.1/m4/gtest.m4
+++ /dev/null
@@ -1,74 +0,0 @@
-dnl GTEST_LIB_CHECK([minimum version [,
-dnl action if found [,action if not found]]])
-dnl
-dnl Check for the presence of the Google Test library, optionally at a minimum
-dnl version, and indicate a viable version with the HAVE_GTEST flag. It defines
-dnl standard variables for substitution including GTEST_CPPFLAGS,
-dnl GTEST_CXXFLAGS, GTEST_LDFLAGS, and GTEST_LIBS. It also defines
-dnl GTEST_VERSION as the version of Google Test found. Finally, it provides
-dnl optional custom action slots in the event GTEST is found or not.
-AC_DEFUN([GTEST_LIB_CHECK],
-[
-dnl Provide a flag to enable or disable Google Test usage.
-AC_ARG_ENABLE([gtest],
- [AS_HELP_STRING([--enable-gtest],
- [Enable tests using the Google C++ Testing Framework.
- (Default is enabled.)])],
- [],
- [enable_gtest=yes])
-AC_ARG_VAR([GTEST_CONFIG],
- [The exact path of Google Test's 'gtest-config' script.])
-AC_ARG_VAR([GTEST_CPPFLAGS],
- [C-like preprocessor flags for Google Test.])
-AC_ARG_VAR([GTEST_CXXFLAGS],
- [C++ compile flags for Google Test.])
-AC_ARG_VAR([GTEST_LDFLAGS],
- [Linker path and option flags for Google Test.])
-AC_ARG_VAR([GTEST_LIBS],
- [Library linking flags for Google Test.])
-AC_ARG_VAR([GTEST_VERSION],
- [The version of Google Test available.])
-HAVE_GTEST="no"
-AS_IF([test "x${enable_gtest}" != "xno"],
- [AC_MSG_CHECKING([for 'gtest-config'])
- AS_IF([test "x${enable_gtest}" != "xyes"],
- [AS_IF([test -x "${enable_gtest}/scripts/gtest-config"],
- [GTEST_CONFIG="${enable_gtest}/scripts/gtest-config"],
- [GTEST_CONFIG="${enable_gtest}/bin/gtest-config"])
- AS_IF([test -x "${GTEST_CONFIG}"], [],
- [AC_MSG_RESULT([no])
- AC_MSG_ERROR([dnl
-Unable to locate either a built or installed Google Test.
-The specific location '${enable_gtest}' was provided for a built or installed
-Google Test, but no 'gtest-config' script could be found at this location.])
- ])],
- [AC_PATH_PROG([GTEST_CONFIG], [gtest-config])])
- AS_IF([test -x "${GTEST_CONFIG}"],
- [AC_MSG_RESULT([${GTEST_CONFIG}])
- m4_ifval([$1],
- [_gtest_min_version="--min-version=$1"
- AC_MSG_CHECKING([for Google Test at least version >= $1])],
- [_gtest_min_version="--min-version=0"
- AC_MSG_CHECKING([for Google Test])])
- AS_IF([${GTEST_CONFIG} ${_gtest_min_version}],
- [AC_MSG_RESULT([yes])
- HAVE_GTEST='yes'],
- [AC_MSG_RESULT([no])])],
- [AC_MSG_RESULT([no])])
- AS_IF([test "x${HAVE_GTEST}" = "xyes"],
- [GTEST_CPPFLAGS=`${GTEST_CONFIG} --cppflags`
- GTEST_CXXFLAGS=`${GTEST_CONFIG} --cxxflags`
- GTEST_LDFLAGS=`${GTEST_CONFIG} --ldflags`
- GTEST_LIBS=`${GTEST_CONFIG} --libs`
- GTEST_VERSION=`${GTEST_CONFIG} --version`
- AC_DEFINE([HAVE_GTEST],[1],[Defined when Google Test is available.])],
- [AS_IF([test "x${enable_gtest}" = "xyes"],
- [AC_MSG_ERROR([dnl
-Google Test was enabled, but no viable version could be found.])
- ])])])
-AC_SUBST([HAVE_GTEST])
-AM_CONDITIONAL([HAVE_GTEST],[test "x$HAVE_GTEST" = "xyes"])
-AS_IF([test "x$HAVE_GTEST" = "xyes"],
- [m4_ifval([$2], [$2])],
- [m4_ifval([$3], [$3])])
-])
diff --git a/libbash-0.1/m4/libtool.m4 b/libbash-0.1/m4/libtool.m4
deleted file mode 100644
index 2f1f49e..0000000
--- a/libbash-0.1/m4/libtool.m4
+++ /dev/null
@@ -1,7450 +0,0 @@
-# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
-#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
-# Inc.
-# Written by Gordon Matzigkeit, 1996
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-m4_define([_LT_COPYING], [dnl
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
-# Inc.
-# Written by Gordon Matzigkeit, 1996
-#
-# This file is part of GNU Libtool.
-#
-# GNU Libtool is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# As a special exception to the GNU General Public License,
-# if you distribute this file as part of a program or library that
-# is built using GNU Libtool, you may include this file under the
-# same distribution terms that you use for the rest of that program.
-#
-# GNU Libtool is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU Libtool; see the file COPYING. If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
-# obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-])
-
-# serial 57 LT_INIT
-
-
-# LT_PREREQ(VERSION)
-# ------------------
-# Complain and exit if this libtool version is less that VERSION.
-m4_defun([LT_PREREQ],
-[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
- [m4_default([$3],
- [m4_fatal([Libtool version $1 or higher is required],
- 63)])],
- [$2])])
-
-
-# _LT_CHECK_BUILDDIR
-# ------------------
-# Complain if the absolute build directory name contains unusual characters
-m4_defun([_LT_CHECK_BUILDDIR],
-[case `pwd` in
- *\ * | *\ *)
- AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
-esac
-])
-
-
-# LT_INIT([OPTIONS])
-# ------------------
-AC_DEFUN([LT_INIT],
-[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
-AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
-AC_BEFORE([$0], [LT_LANG])dnl
-AC_BEFORE([$0], [LT_OUTPUT])dnl
-AC_BEFORE([$0], [LTDL_INIT])dnl
-m4_require([_LT_CHECK_BUILDDIR])dnl
-
-dnl Autoconf doesn't catch unexpanded LT_ macros by default:
-m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
-m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
-dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
-dnl unless we require an AC_DEFUNed macro:
-AC_REQUIRE([LTOPTIONS_VERSION])dnl
-AC_REQUIRE([LTSUGAR_VERSION])dnl
-AC_REQUIRE([LTVERSION_VERSION])dnl
-AC_REQUIRE([LTOBSOLETE_VERSION])dnl
-m4_require([_LT_PROG_LTMAIN])dnl
-
-_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
-
-dnl Parse OPTIONS
-_LT_SET_OPTIONS([$0], [$1])
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ltmain"
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-AC_SUBST(LIBTOOL)dnl
-
-_LT_SETUP
-
-# Only expand once:
-m4_define([LT_INIT])
-])# LT_INIT
-
-# Old names:
-AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
-AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
-dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
-
-
-# _LT_CC_BASENAME(CC)
-# -------------------
-# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
-m4_defun([_LT_CC_BASENAME],
-[for cc_temp in $1""; do
- case $cc_temp in
- compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
- distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
-])
-
-
-# _LT_FILEUTILS_DEFAULTS
-# ----------------------
-# It is okay to use these file commands and assume they have been set
-# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
-m4_defun([_LT_FILEUTILS_DEFAULTS],
-[: ${CP="cp -f"}
-: ${MV="mv -f"}
-: ${RM="rm -f"}
-])# _LT_FILEUTILS_DEFAULTS
-
-
-# _LT_SETUP
-# ---------
-m4_defun([_LT_SETUP],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
-AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
-
-_LT_DECL([], [host_alias], [0], [The host system])dnl
-_LT_DECL([], [host], [0])dnl
-_LT_DECL([], [host_os], [0])dnl
-dnl
-_LT_DECL([], [build_alias], [0], [The build system])dnl
-_LT_DECL([], [build], [0])dnl
-_LT_DECL([], [build_os], [0])dnl
-dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([LT_PATH_LD])dnl
-AC_REQUIRE([LT_PATH_NM])dnl
-dnl
-AC_REQUIRE([AC_PROG_LN_S])dnl
-test -z "$LN_S" && LN_S="ln -s"
-_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
-dnl
-AC_REQUIRE([LT_CMD_MAX_LEN])dnl
-_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
-_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
-dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_CHECK_SHELL_FEATURES])dnl
-m4_require([_LT_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
-
-case $host_os in
-aix3*)
- # AIX sometimes has problems with the GCC collect2 program. For some
- # reason, if we set the COLLECT_NAMES environment variable, the problems
- # vanish in a puff of smoke.
- if test "X${COLLECT_NAMES+set}" != Xset; then
- COLLECT_NAMES=
- export COLLECT_NAMES
- fi
- ;;
-esac
-
-# Global variables:
-ofile=libtool
-can_build_shared=yes
-
-# All known linkers require a `.a' archive for static linking (except MSVC,
-# which needs '.lib').
-libext=a
-
-with_gnu_ld="$lt_cv_prog_gnu_ld"
-
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
-
-# Set sane defaults for various variables
-test -z "$CC" && CC=cc
-test -z "$LTCC" && LTCC=$CC
-test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
-test -z "$LD" && LD=ld
-test -z "$ac_objext" && ac_objext=o
-
-_LT_CC_BASENAME([$compiler])
-
-# Only perform the check for file, if the check method requires it
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-case $deplibs_check_method in
-file_magic*)
- if test "$file_magic_cmd" = '$MAGIC_CMD'; then
- _LT_PATH_MAGIC
- fi
- ;;
-esac
-
-# Use C for the default configuration in the libtool script
-LT_SUPPORTED_TAG([CC])
-_LT_LANG_C_CONFIG
-_LT_LANG_DEFAULT_CONFIG
-_LT_CONFIG_COMMANDS
-])# _LT_SETUP
-
-
-# _LT_PREPARE_SED_QUOTE_VARS
-# --------------------------
-# Define a few sed substitution that help us do robust quoting.
-m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
-[# Backslashify metacharacters that are still active within
-# double-quoted strings.
-sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
-
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\([["`\\]]\)/\\\1/g'
-
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-
-# Sed substitution to delay expansion of an escaped single quote.
-delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
-
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
-])
-
-# _LT_PROG_LTMAIN
-# ---------------
-# Note that this code is called both from `configure', and `config.status'
-# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably,
-# `config.status' has no value for ac_aux_dir unless we are using Automake,
-# so we pass a copy along to make sure it has a sensible value anyway.
-m4_defun([_LT_PROG_LTMAIN],
-[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
-_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
-ltmain="$ac_aux_dir/ltmain.sh"
-])# _LT_PROG_LTMAIN
-
-
-## ------------------------------------- ##
-## Accumulate code for creating libtool. ##
-## ------------------------------------- ##
-
-# 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], [[!?.]$], [], [.])
-)])
-
-
-
-## ------------------------ ##
-## FIXME: Eliminate VARNAME ##
-## ------------------------ ##
-
-
-# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
-# -------------------------------------------------------------------
-# CONFIGNAME is the name given to the value in the libtool script.
-# VARNAME is the (base) name used in the configure script.
-# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
-# VARNAME. Any other value will be used directly.
-m4_define([_LT_DECL],
-[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
- [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
- [m4_ifval([$1], [$1], [$2])])
- lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
- m4_ifval([$4],
- [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
- lt_dict_add_subkey([lt_decl_dict], [$2],
- [tagged?], [m4_ifval([$5], [yes], [no])])])
-])
-
-
-# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
-# --------------------------------------------------------
-m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
-
-
-# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
-# ------------------------------------------------
-m4_define([lt_decl_tag_varnames],
-[_lt_decl_filter([tagged?], [yes], $@)])
-
-
-# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
-# ---------------------------------------------------------
-m4_define([_lt_decl_filter],
-[m4_case([$#],
- [0], [m4_fatal([$0: too few arguments: $#])],
- [1], [m4_fatal([$0: too few arguments: $#: $1])],
- [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
- [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
- [lt_dict_filter([lt_decl_dict], $@)])[]dnl
-])
-
-
-# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
-# --------------------------------------------------
-m4_define([lt_decl_quote_varnames],
-[_lt_decl_filter([value], [1], $@)])
-
-
-# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
-# ---------------------------------------------------
-m4_define([lt_decl_dquote_varnames],
-[_lt_decl_filter([value], [2], $@)])
-
-
-# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
-# ---------------------------------------------------
-m4_define([lt_decl_varnames_tagged],
-[m4_assert([$# <= 2])dnl
-_$0(m4_quote(m4_default([$1], [[, ]])),
- m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
- m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
-m4_define([_lt_decl_varnames_tagged],
-[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
-
-
-# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
-# ------------------------------------------------
-m4_define([lt_decl_all_varnames],
-[_$0(m4_quote(m4_default([$1], [[, ]])),
- m4_if([$2], [],
- m4_quote(lt_decl_varnames),
- m4_quote(m4_shift($@))))[]dnl
-])
-m4_define([_lt_decl_all_varnames],
-[lt_join($@, lt_decl_varnames_tagged([$1],
- lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
-])
-
-
-# _LT_CONFIG_STATUS_DECLARE([VARNAME])
-# ------------------------------------
-# Quote a variable value, and forward it to `config.status' so that its
-# declaration there will have the same value as in `configure'. VARNAME
-# must have a single quote delimited value for this to work.
-m4_define([_LT_CONFIG_STATUS_DECLARE],
-[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
-
-
-# _LT_CONFIG_STATUS_DECLARATIONS
-# ------------------------------
-# We delimit libtool config variables with single quotes, so when
-# we write them to config.status, we have to be sure to quote all
-# embedded single quotes properly. In configure, this macro expands
-# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
-#
-# <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
-m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
-[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
- [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
-
-
-# _LT_LIBTOOL_TAGS
-# ----------------
-# Output comment and list of tags supported by the script
-m4_defun([_LT_LIBTOOL_TAGS],
-[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
-available_tags="_LT_TAGS"dnl
-])
-
-
-# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
-# -----------------------------------
-# Extract the dictionary values for VARNAME (optionally with TAG) and
-# expand to a commented shell variable setting:
-#
-# # Some comment about what VAR is for.
-# visible_name=$lt_internal_name
-m4_define([_LT_LIBTOOL_DECLARE],
-[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
- [description])))[]dnl
-m4_pushdef([_libtool_name],
- m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
-m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
- [0], [_libtool_name=[$]$1],
- [1], [_libtool_name=$lt_[]$1],
- [2], [_libtool_name=$lt_[]$1],
- [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
-m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
-])
-
-
-# _LT_LIBTOOL_CONFIG_VARS
-# -----------------------
-# Produce commented declarations of non-tagged libtool config variables
-# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
-# script. Tagged libtool config variables (even for the LIBTOOL CONFIG
-# section) are produced by _LT_LIBTOOL_TAG_VARS.
-m4_defun([_LT_LIBTOOL_CONFIG_VARS],
-[m4_foreach([_lt_var],
- m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
- [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
-
-
-# _LT_LIBTOOL_TAG_VARS(TAG)
-# -------------------------
-m4_define([_LT_LIBTOOL_TAG_VARS],
-[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
- [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
-
-
-# _LT_TAGVAR(VARNAME, [TAGNAME])
-# ------------------------------
-m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
-
-
-# _LT_CONFIG_COMMANDS
-# -------------------
-# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of
-# variables for single and double quote escaping we saved from calls
-# to _LT_DECL, we can put quote escaped variables declarations
-# into `config.status', and then the shell code to quote escape them in
-# for loops in `config.status'. Finally, any additional code accumulated
-# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
-m4_defun([_LT_CONFIG_COMMANDS],
-[AC_PROVIDE_IFELSE([LT_OUTPUT],
- dnl If the libtool generation code has been placed in $CONFIG_LT,
- dnl instead of duplicating it all over again into config.status,
- dnl then we will have config.status run $CONFIG_LT later, so it
- dnl needs to know what name is stored there:
- [AC_CONFIG_COMMANDS([libtool],
- [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
- dnl If the libtool generation code is destined for config.status,
- dnl expand the accumulated commands and init code now:
- [AC_CONFIG_COMMANDS([libtool],
- [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
-])#_LT_CONFIG_COMMANDS
-
-
-# Initialize.
-m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
-[
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-sed_quote_subst='$sed_quote_subst'
-double_quote_subst='$double_quote_subst'
-delay_variable_subst='$delay_variable_subst'
-_LT_CONFIG_STATUS_DECLARATIONS
-LTCC='$LTCC'
-LTCFLAGS='$LTCFLAGS'
-compiler='$compiler_DEFAULT'
-
-# A function that is used when there is no print builtin or printf.
-func_fallback_echo ()
-{
- eval 'cat <<_LTECHO_EOF
-\$[]1
-_LTECHO_EOF'
-}
-
-# Quote evaled strings.
-for var in lt_decl_all_varnames([[ \
-]], lt_decl_quote_varnames); do
- case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
- *[[\\\\\\\`\\"\\\$]]*)
- eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
- ;;
- *)
- eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
- ;;
- esac
-done
-
-# Double-quote double-evaled strings.
-for var in lt_decl_all_varnames([[ \
-]], lt_decl_dquote_varnames); do
- case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
- *[[\\\\\\\`\\"\\\$]]*)
- eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
- ;;
- *)
- eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
- ;;
- esac
-done
-
-_LT_OUTPUT_LIBTOOL_INIT
-])
-
-# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
-# ------------------------------------
-# Generate a child script FILE with all initialization necessary to
-# reuse the environment learned by the parent script, and make the
-# file executable. If COMMENT is supplied, it is inserted after the
-# `#!' sequence but before initialization text begins. After this
-# macro, additional text can be appended to FILE to form the body of
-# the child script. The macro ends with non-zero status if the
-# file could not be fully written (such as if the disk is full).
-m4_ifdef([AS_INIT_GENERATED],
-[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
-[m4_defun([_LT_GENERATED_FILE_INIT],
-[m4_require([AS_PREPARE])]dnl
-[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
-[lt_write_fail=0
-cat >$1 <<_ASEOF || lt_write_fail=1
-#! $SHELL
-# Generated by $as_me.
-$2
-SHELL=\${CONFIG_SHELL-$SHELL}
-export SHELL
-_ASEOF
-cat >>$1 <<\_ASEOF || lt_write_fail=1
-AS_SHELL_SANITIZE
-_AS_PREPARE
-exec AS_MESSAGE_FD>&1
-_ASEOF
-test $lt_write_fail = 0 && chmod +x $1[]dnl
-m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
-
-# LT_OUTPUT
-# ---------
-# This macro allows early generation of the libtool script (before
-# AC_OUTPUT is called), incase it is used in configure for compilation
-# tests.
-AC_DEFUN([LT_OUTPUT],
-[: ${CONFIG_LT=./config.lt}
-AC_MSG_NOTICE([creating $CONFIG_LT])
-_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
-[# Run this file to recreate a libtool stub with the current configuration.])
-
-cat >>"$CONFIG_LT" <<\_LTEOF
-lt_cl_silent=false
-exec AS_MESSAGE_LOG_FD>>config.log
-{
- echo
- AS_BOX([Running $as_me.])
-} >&AS_MESSAGE_LOG_FD
-
-lt_cl_help="\
-\`$as_me' creates a local libtool stub from the current configuration,
-for use in further configure time tests before the real libtool is
-generated.
-
-Usage: $[0] [[OPTIONS]]
-
- -h, --help print this help, then exit
- -V, --version print version number, then exit
- -q, --quiet do not print progress messages
- -d, --debug don't remove temporary files
-
-Report bugs to <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) 2010 Free Software Foundation, Inc.
-This config.lt script is free software; the Free Software Foundation
-gives unlimited permision to copy, distribute and modify it."
-
-while test $[#] != 0
-do
- case $[1] in
- --version | --v* | -V )
- echo "$lt_cl_version"; exit 0 ;;
- --help | --h* | -h )
- echo "$lt_cl_help"; exit 0 ;;
- --debug | --d* | -d )
- debug=: ;;
- --quiet | --q* | --silent | --s* | -q )
- lt_cl_silent=: ;;
-
- -*) AC_MSG_ERROR([unrecognized option: $[1]
-Try \`$[0] --help' for more information.]) ;;
-
- *) AC_MSG_ERROR([unrecognized argument: $[1]
-Try \`$[0] --help' for more information.]) ;;
- esac
- shift
-done
-
-if $lt_cl_silent; then
- exec AS_MESSAGE_FD>/dev/null
-fi
-_LTEOF
-
-cat >>"$CONFIG_LT" <<_LTEOF
-_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
-_LTEOF
-
-cat >>"$CONFIG_LT" <<\_LTEOF
-AC_MSG_NOTICE([creating $ofile])
-_LT_OUTPUT_LIBTOOL_COMMANDS
-AS_EXIT(0)
-_LTEOF
-chmod +x "$CONFIG_LT"
-
-# configure is writing to config.log, but config.lt does its own redirection,
-# appending to config.log, which fails on DOS, as config.log is still kept
-# open by configure. Here we exec the FD to /dev/null, effectively closing
-# config.log, so it can be properly (re)opened and appended to by config.lt.
-lt_cl_success=:
-test "$silent" = yes &&
- lt_config_lt_args="$lt_config_lt_args --quiet"
-exec AS_MESSAGE_LOG_FD>/dev/null
-$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
-exec AS_MESSAGE_LOG_FD>>config.log
-$lt_cl_success || AS_EXIT(1)
-])# LT_OUTPUT
-
-
-# _LT_CONFIG(TAG)
-# ---------------
-# If TAG is the built-in tag, create an initial libtool script with a
-# default configuration from the untagged config vars. Otherwise add code
-# to config.status for appending the configuration named by TAG from the
-# matching tagged config vars.
-m4_defun([_LT_CONFIG],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-_LT_CONFIG_SAVE_COMMANDS([
- m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
- m4_if(_LT_TAG, [C], [
- # See if we are running on zsh, and set the options which allow our
- # commands through without removal of \ escapes.
- if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
- fi
-
- cfgfile="${ofile}T"
- trap "$RM \"$cfgfile\"; exit 1" 1 2 15
- $RM "$cfgfile"
-
- cat <<_LT_EOF >> "$cfgfile"
-#! $SHELL
-
-# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-_LT_COPYING
-_LT_LIBTOOL_TAGS
-
-# ### BEGIN LIBTOOL CONFIG
-_LT_LIBTOOL_CONFIG_VARS
-_LT_LIBTOOL_TAG_VARS
-# ### END LIBTOOL CONFIG
-
-_LT_EOF
-
- case $host_os in
- aix3*)
- cat <<\_LT_EOF >> "$cfgfile"
-# AIX sometimes has problems with the GCC collect2 program. For some
-# reason, if we set the COLLECT_NAMES environment variable, the problems
-# vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
- COLLECT_NAMES=
- export COLLECT_NAMES
-fi
-_LT_EOF
- ;;
- esac
-
- _LT_PROG_LTMAIN
-
- # We use sed instead of cat because bash on DJGPP gets confused if
- # if finds mixed CR/LF and LF-only lines. Since sed operates in
- # text mode, it properly converts lines to CR/LF. This bash problem
- # is reportedly fixed, but why not run on old versions too?
- sed '/^# 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)])
-AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
-dnl AC_DEFUN([AC_LIBTOOL_F77], [])
-dnl AC_DEFUN([AC_LIBTOOL_FC], [])
-dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
-dnl AC_DEFUN([AC_LIBTOOL_RC], [])
-
-
-# _LT_TAG_COMPILER
-# ----------------
-m4_defun([_LT_TAG_COMPILER],
-[AC_REQUIRE([AC_PROG_CC])dnl
-
-_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
-_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
-_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
-_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-])# _LT_TAG_COMPILER
-
-
-# _LT_COMPILER_BOILERPLATE
-# ------------------------
-# Check for compiler boilerplate output or warnings with
-# the simple compiler test code.
-m4_defun([_LT_COMPILER_BOILERPLATE],
-[m4_require([_LT_DECL_SED])dnl
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$RM conftest*
-])# _LT_COMPILER_BOILERPLATE
-
-
-# _LT_LINKER_BOILERPLATE
-# ----------------------
-# Check for linker boilerplate output or warnings with
-# the simple link test code.
-m4_defun([_LT_LINKER_BOILERPLATE],
-[m4_require([_LT_DECL_SED])dnl
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$RM -r conftest*
-])# _LT_LINKER_BOILERPLATE
-
-# _LT_REQUIRED_DARWIN_CHECKS
-# -------------------------
-m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
- case $host_os in
- rhapsody* | darwin*)
- AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
- AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
- AC_CHECK_TOOL([LIPO], [lipo], [:])
- AC_CHECK_TOOL([OTOOL], [otool], [:])
- AC_CHECK_TOOL([OTOOL64], [otool64], [:])
- _LT_DECL([], [DSYMUTIL], [1],
- [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
- _LT_DECL([], [NMEDIT], [1],
- [Tool to change global to local symbols on Mac OS X])
- _LT_DECL([], [LIPO], [1],
- [Tool to manipulate fat objects and archives on Mac OS X])
- _LT_DECL([], [OTOOL], [1],
- [ldd/readelf like tool for Mach-O binaries on Mac OS X])
- _LT_DECL([], [OTOOL64], [1],
- [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
-
- AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
- [lt_cv_apple_cc_single_mod=no
- if test -z "${LT_MULTI_MODULE}"; then
- # By default we will add the -single_module flag. You can override
- # by either setting the environment variable LT_MULTI_MODULE
- # non-empty at configure time, or by adding -multi_module to the
- # link flags.
- rm -rf libconftest.dylib*
- echo "int foo(void){return 1;}" > conftest.c
- echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
--dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
- $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
- -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
- _lt_result=$?
- if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
- lt_cv_apple_cc_single_mod=yes
- else
- cat conftest.err >&AS_MESSAGE_LOG_FD
- fi
- rm -rf libconftest.dylib*
- rm -f conftest.*
- fi])
- AC_CACHE_CHECK([for -exported_symbols_list linker flag],
- [lt_cv_ld_exported_symbols_list],
- [lt_cv_ld_exported_symbols_list=no
- save_LDFLAGS=$LDFLAGS
- echo "_main" > conftest.sym
- LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
- [lt_cv_ld_exported_symbols_list=yes],
- [lt_cv_ld_exported_symbols_list=no])
- LDFLAGS="$save_LDFLAGS"
- ])
- AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
- [lt_cv_ld_force_load=no
- cat > conftest.c << _LT_EOF
-int forced_loaded() { return 2;}
-_LT_EOF
- echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
- $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
- echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
- $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
- echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
- $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
- cat > conftest.c << _LT_EOF
-int main() { return 0;}
-_LT_EOF
- echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
- $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
- _lt_result=$?
- if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
- lt_cv_ld_force_load=yes
- else
- cat conftest.err >&AS_MESSAGE_LOG_FD
- fi
- rm -f conftest.err libconftest.a conftest conftest.c
- rm -rf conftest.dSYM
- ])
- case $host_os in
- rhapsody* | darwin1.[[012]])
- _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
- darwin1.*)
- _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
- darwin*) # darwin 5.x on
- # if running on 10.5 or later, the deployment target defaults
- # to the OS version, if on x86, and 10.4, the deployment
- # target defaults to 10.4. Don't you love it?
- case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
- 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
- _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
- 10.[[012]]*)
- _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
- 10.*)
- _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
- esac
- ;;
- esac
- if test "$lt_cv_apple_cc_single_mod" = "yes"; then
- _lt_dar_single_mod='$single_module'
- fi
- if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
- _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
- else
- _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
- fi
- if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
- _lt_dsymutil='~$DSYMUTIL $lib || :'
- else
- _lt_dsymutil=
- fi
- ;;
- esac
-])
-
-
-# _LT_DARWIN_LINKER_FEATURES
-# --------------------------
-# Checks for linker and compiler features on darwin
-m4_defun([_LT_DARWIN_LINKER_FEATURES],
-[
- m4_require([_LT_REQUIRED_DARWIN_CHECKS])
- _LT_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_TAGVAR(hardcode_direct, $1)=no
- _LT_TAGVAR(hardcode_automatic, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
- if test "$lt_cv_ld_force_load" = "yes"; then
- _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
- else
- _LT_TAGVAR(whole_archive_flag_spec, $1)=''
- fi
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
- case $cc_basename in
- ifort*) _lt_dar_can_shared=yes ;;
- *) _lt_dar_can_shared=$GCC ;;
- esac
- if test "$_lt_dar_can_shared" = "yes"; then
- output_verbose_link_cmd=func_echo_all
- _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
- _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
- _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
- _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
- m4_if([$1], [CXX],
-[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
- _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
- _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
- fi
-],[])
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
-])
-
-# _LT_SYS_MODULE_PATH_AIX
-# -----------------------
-# 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],
-[m4_divert_text([M4SH-INIT], [$1
-])])# _LT_SHELL_INIT
-
-
-
-# _LT_PROG_ECHO_BACKSLASH
-# -----------------------
-# Find how we can fake an echo command that does not interpret backslash.
-# In particular, with Autoconf 2.60 or later we add some code to the start
-# of the generated configure script which will find a shell with a builtin
-# printf (which we can use as an echo command).
-m4_defun([_LT_PROG_ECHO_BACKSLASH],
-[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
-ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
-
-AC_MSG_CHECKING([how to print strings])
-# Test print first, because it will be a builtin if present.
-if test "X`print -r -- -n 2>/dev/null`" = X-n && \
- test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
- ECHO='print -r --'
-elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
- ECHO='printf %s\n'
-else
- # Use this function as a fallback that always works.
- func_fallback_echo ()
- {
- eval 'cat <<_LTECHO_EOF
-$[]1
-_LTECHO_EOF'
- }
- ECHO='func_fallback_echo'
-fi
-
-# func_echo_all arg...
-# Invoke $ECHO with all args, space-separated.
-func_echo_all ()
-{
- $ECHO "$*"
-}
-
-case "$ECHO" in
- printf*) AC_MSG_RESULT([printf]) ;;
- print*) AC_MSG_RESULT([print -r]) ;;
- *) AC_MSG_RESULT([cat]) ;;
-esac
-
-m4_ifdef([_AS_DETECT_SUGGESTED],
-[_AS_DETECT_SUGGESTED([
- test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
- ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
- ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
- ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
- PATH=/empty FPATH=/empty; export PATH FPATH
- test "X`printf %s $ECHO`" = "X$ECHO" \
- || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
-
-_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
-_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
-])# _LT_PROG_ECHO_BACKSLASH
-
-
-# _LT_ENABLE_LOCK
-# ---------------
-m4_defun([_LT_ENABLE_LOCK],
-[AC_ARG_ENABLE([libtool-lock],
- [AS_HELP_STRING([--disable-libtool-lock],
- [avoid locking (might break parallel builds)])])
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
-
-# Some flags need to be propagated to the compiler or linker for good
-# libtool support.
-case $host in
-ia64-*-hpux*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- case `/usr/bin/file conftest.$ac_objext` in
- *ELF-32*)
- HPUX_IA64_MODE="32"
- ;;
- *ELF-64*)
- HPUX_IA64_MODE="64"
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-*-*-irix6*)
- # Find out which ABI we are using.
- echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- if test "$lt_cv_prog_gnu_ld" = yes; then
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- LD="${LD-ld} -melf32bsmip"
- ;;
- *N32*)
- LD="${LD-ld} -melf32bmipn32"
- ;;
- *64-bit*)
- LD="${LD-ld} -melf64bmip"
- ;;
- esac
- else
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- LD="${LD-ld} -32"
- ;;
- *N32*)
- LD="${LD-ld} -n32"
- ;;
- *64-bit*)
- LD="${LD-ld} -64"
- ;;
- esac
- fi
- fi
- rm -rf conftest*
- ;;
-
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
-s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- case `/usr/bin/file conftest.o` in
- *32-bit*)
- case $host in
- x86_64-*kfreebsd*-gnu)
- LD="${LD-ld} -m elf_i386_fbsd"
- ;;
- x86_64-*linux*)
- LD="${LD-ld} -m elf_i386"
- ;;
- ppc64-*linux*|powerpc64-*linux*)
- LD="${LD-ld} -m elf32ppclinux"
- ;;
- s390x-*linux*)
- LD="${LD-ld} -m elf_s390"
- ;;
- sparc64-*linux*)
- LD="${LD-ld} -m elf32_sparc"
- ;;
- esac
- ;;
- *64-bit*)
- case $host in
- x86_64-*kfreebsd*-gnu)
- LD="${LD-ld} -m elf_x86_64_fbsd"
- ;;
- x86_64-*linux*)
- LD="${LD-ld} -m elf_x86_64"
- ;;
- ppc*-*linux*|powerpc*-*linux*)
- LD="${LD-ld} -m elf64ppc"
- ;;
- s390*-*linux*|s390*-*tpf*)
- LD="${LD-ld} -m elf64_s390"
- ;;
- sparc*-*linux*)
- LD="${LD-ld} -m elf64_sparc"
- ;;
- esac
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-
-*-*-sco3.2v5*)
- # On SCO OpenServer 5, we need -belf to get full-featured binaries.
- SAVE_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -belf"
- AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
- [AC_LANG_PUSH(C)
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
- AC_LANG_POP])
- if test x"$lt_cv_cc_needs_belf" != x"yes"; then
- # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
- CFLAGS="$SAVE_CFLAGS"
- fi
- ;;
-sparc*-*solaris*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- case `/usr/bin/file conftest.o` in
- *64-bit*)
- case $lt_cv_prog_gnu_ld in
- yes*) LD="${LD-ld} -m elf64_sparc" ;;
- *)
- if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
- LD="${LD-ld} -64"
- fi
- ;;
- esac
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-esac
-
-need_locks="$enable_libtool_lock"
-])# _LT_ENABLE_LOCK
-
-
-# _LT_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
-
-case $host_os in
- darwin*)
- lock_old_archive_extraction=yes ;;
- *)
- lock_old_archive_extraction=no ;;
-esac
-_LT_DECL([], [old_postinstall_cmds], [2])
-_LT_DECL([], [old_postuninstall_cmds], [2])
-_LT_TAGDECL([], [old_archive_cmds], [2],
- [Commands used to build an old-style archive])
-_LT_DECL([], [lock_old_archive_extraction], [0],
- [Whether to use a lock for old archive extraction])
-])# _LT_CMD_OLD_ARCHIVE
-
-
-# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
-# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
-# ----------------------------------------------------------------
-# Check whether the given compiler option works
-AC_DEFUN([_LT_COMPILER_OPTION],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_SED])dnl
-AC_CACHE_CHECK([$1], [$2],
- [$2=no
- m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="$3"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&AS_MESSAGE_LOG_FD
- echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- $2=yes
- fi
- fi
- $RM conftest*
-])
-
-if test x"[$]$2" = xyes; then
- m4_if([$5], , :, [$5])
-else
- m4_if([$6], , :, [$6])
-fi
-])# _LT_COMPILER_OPTION
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
-
-
-# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
-# [ACTION-SUCCESS], [ACTION-FAILURE])
-# ----------------------------------------------------
-# Check whether the given linker option works
-AC_DEFUN([_LT_LINKER_OPTION],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_SED])dnl
-AC_CACHE_CHECK([$1], [$2],
- [$2=no
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $3"
- echo "$lt_simple_link_test_code" > conftest.$ac_ext
- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
- # The linker can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s conftest.err; then
- # Append any errors to the config.log.
- cat conftest.err 1>&AS_MESSAGE_LOG_FD
- $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if diff conftest.exp conftest.er2 >/dev/null; then
- $2=yes
- fi
- else
- $2=yes
- fi
- fi
- $RM -r conftest*
- LDFLAGS="$save_LDFLAGS"
-])
-
-if test x"[$]$2" = xyes; then
- m4_if([$4], , :, [$4])
-else
- m4_if([$5], , :, [$5])
-fi
-])# _LT_LINKER_OPTION
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
-
-
-# LT_CMD_MAX_LEN
-#---------------
-AC_DEFUN([LT_CMD_MAX_LEN],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-# find the maximum length of command line arguments
-AC_MSG_CHECKING([the maximum length of command line arguments])
-AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
- i=0
- teststring="ABCD"
-
- case $build_os in
- msdosdjgpp*)
- # On DJGPP, this test can blow up pretty badly due to problems in libc
- # (any single argument exceeding 2000 bytes causes a buffer overrun
- # during glob expansion). Even if it were fixed, the result of this
- # check would be larger than it should be.
- lt_cv_sys_max_cmd_len=12288; # 12K is about right
- ;;
-
- gnu*)
- # Under GNU Hurd, this test is not required because there is
- # no limit to the length of command line arguments.
- # Libtool will interpret -1 as no limit whatsoever
- lt_cv_sys_max_cmd_len=-1;
- ;;
-
- cygwin* | mingw* | cegcc*)
- # On Win9x/ME, this test blows up -- it succeeds, but takes
- # about 5 minutes as the teststring grows exponentially.
- # Worse, since 9x/ME are not pre-emptively multitasking,
- # you end up with a "frozen" computer, even though with patience
- # the test eventually succeeds (with a max line length of 256k).
- # Instead, let's just punt: use the minimum linelength reported by
- # all of the supported platforms: 8192 (on NT/2K/XP).
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- mint*)
- # On MiNT this can take a long time and run out of memory.
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- amigaos*)
- # On AmigaOS with pdksh, this test takes hours, literally.
- # So we just punt and use a minimum line length of 8192.
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
- # This has been around since 386BSD, at least. Likely further.
- if test -x /sbin/sysctl; then
- lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
- elif test -x /usr/sbin/sysctl; then
- lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
- else
- lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
- fi
- # And add a safety zone
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
- ;;
-
- interix*)
- # We know the value 262144 and hardcode it with a safety zone (like BSD)
- lt_cv_sys_max_cmd_len=196608
- ;;
-
- osf*)
- # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
- # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
- # nice to cause kernel panics so lets avoid the loop below.
- # First set a reasonable default.
- lt_cv_sys_max_cmd_len=16384
- #
- if test -x /sbin/sysconfig; then
- case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
- *1*) lt_cv_sys_max_cmd_len=-1 ;;
- esac
- fi
- ;;
- sco3.2v5*)
- lt_cv_sys_max_cmd_len=102400
- ;;
- sysv5* | sco5v6* | sysv4.2uw2*)
- kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
- if test -n "$kargmax"; then
- lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
- else
- lt_cv_sys_max_cmd_len=32768
- fi
- ;;
- *)
- lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
- if test -n "$lt_cv_sys_max_cmd_len"; then
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
- else
- # Make teststring a little bigger before we do anything with it.
- # a 1K string should be a reasonable start.
- for i in 1 2 3 4 5 6 7 8 ; do
- teststring=$teststring$teststring
- done
- SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
- # If test is not a shell built-in, we'll probably end up computing a
- # maximum length that is only half of the actual maximum length, but
- # we can't tell.
- while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
- = "X$teststring$teststring"; } >/dev/null 2>&1 &&
- test $i != 17 # 1/2 MB should be enough
- do
- i=`expr $i + 1`
- teststring=$teststring$teststring
- done
- # Only check the string length outside the loop.
- lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
- teststring=
- # Add a significant safety factor because C++ compilers can tack on
- # massive amounts of additional arguments before passing them to the
- # linker. It appears as though 1/2 is a usable value.
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
- fi
- ;;
- esac
-])
-if test -n $lt_cv_sys_max_cmd_len ; then
- AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
-else
- AC_MSG_RESULT(none)
-fi
-max_cmd_len=$lt_cv_sys_max_cmd_len
-_LT_DECL([], [max_cmd_len], [0],
- [What is the maximum length of a command?])
-])# LT_CMD_MAX_LEN
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
-
-
-# _LT_HEADER_DLFCN
-# ----------------
-m4_defun([_LT_HEADER_DLFCN],
-[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
-])# _LT_HEADER_DLFCN
-
-
-# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
-# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
-# ----------------------------------------------------------------
-m4_defun([_LT_TRY_DLOPEN_SELF],
-[m4_require([_LT_HEADER_DLFCN])dnl
-if test "$cross_compiling" = yes; then :
- [$4]
-else
- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
- lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<_LT_EOF
-[#line $LINENO "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-# define LT_DLGLOBAL RTLD_GLOBAL
-#else
-# ifdef DL_GLOBAL
-# define LT_DLGLOBAL DL_GLOBAL
-# else
-# define LT_DLGLOBAL 0
-# endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
- find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-# ifdef RTLD_LAZY
-# define LT_DLLAZY_OR_NOW RTLD_LAZY
-# else
-# ifdef DL_LAZY
-# define LT_DLLAZY_OR_NOW DL_LAZY
-# else
-# ifdef RTLD_NOW
-# define LT_DLLAZY_OR_NOW RTLD_NOW
-# else
-# ifdef DL_NOW
-# define LT_DLLAZY_OR_NOW DL_NOW
-# else
-# define LT_DLLAZY_OR_NOW 0
-# endif
-# endif
-# endif
-# endif
-#endif
-
-/* When -fvisbility=hidden is used, assume the code has been annotated
- correspondingly for the symbols needed. */
-#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
-void fnord () __attribute__((visibility("default")));
-#endif
-
-void fnord () { int i=42; }
-int main ()
-{
- void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
- int status = $lt_dlunknown;
-
- if (self)
- {
- if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
- else
- {
- if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
- else puts (dlerror ());
- }
- /* dlclose (self); */
- }
- else
- puts (dlerror ());
-
- return status;
-}]
-_LT_EOF
- if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
- (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
- lt_status=$?
- case x$lt_status in
- x$lt_dlno_uscore) $1 ;;
- x$lt_dlneed_uscore) $2 ;;
- x$lt_dlunknown|x*) $3 ;;
- esac
- else :
- # compilation failed
- $3
- fi
-fi
-rm -fr conftest*
-])# _LT_TRY_DLOPEN_SELF
-
-
-# LT_SYS_DLOPEN_SELF
-# ------------------
-AC_DEFUN([LT_SYS_DLOPEN_SELF],
-[m4_require([_LT_HEADER_DLFCN])dnl
-if test "x$enable_dlopen" != xyes; then
- enable_dlopen=unknown
- enable_dlopen_self=unknown
- enable_dlopen_self_static=unknown
-else
- lt_cv_dlopen=no
- lt_cv_dlopen_libs=
-
- case $host_os in
- beos*)
- lt_cv_dlopen="load_add_on"
- lt_cv_dlopen_libs=
- lt_cv_dlopen_self=yes
- ;;
-
- mingw* | pw32* | cegcc*)
- lt_cv_dlopen="LoadLibrary"
- lt_cv_dlopen_libs=
- ;;
-
- cygwin*)
- lt_cv_dlopen="dlopen"
- lt_cv_dlopen_libs=
- ;;
-
- darwin*)
- # if libdl is installed we need to link against it
- AC_CHECK_LIB([dl], [dlopen],
- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
- lt_cv_dlopen="dyld"
- lt_cv_dlopen_libs=
- lt_cv_dlopen_self=yes
- ])
- ;;
-
- *)
- AC_CHECK_FUNC([shl_load],
- [lt_cv_dlopen="shl_load"],
- [AC_CHECK_LIB([dld], [shl_load],
- [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
- [AC_CHECK_FUNC([dlopen],
- [lt_cv_dlopen="dlopen"],
- [AC_CHECK_LIB([dl], [dlopen],
- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
- [AC_CHECK_LIB([svld], [dlopen],
- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
- [AC_CHECK_LIB([dld], [dld_link],
- [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
- ])
- ])
- ])
- ])
- ])
- ;;
- esac
-
- if test "x$lt_cv_dlopen" != xno; then
- enable_dlopen=yes
- else
- enable_dlopen=no
- fi
-
- case $lt_cv_dlopen in
- dlopen)
- save_CPPFLAGS="$CPPFLAGS"
- test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
-
- save_LDFLAGS="$LDFLAGS"
- wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
-
- save_LIBS="$LIBS"
- LIBS="$lt_cv_dlopen_libs $LIBS"
-
- AC_CACHE_CHECK([whether a program can dlopen itself],
- lt_cv_dlopen_self, [dnl
- _LT_TRY_DLOPEN_SELF(
- lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
- lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
- ])
-
- if test "x$lt_cv_dlopen_self" = xyes; then
- wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
- AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
- lt_cv_dlopen_self_static, [dnl
- _LT_TRY_DLOPEN_SELF(
- lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
- lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
- ])
- fi
-
- CPPFLAGS="$save_CPPFLAGS"
- LDFLAGS="$save_LDFLAGS"
- LIBS="$save_LIBS"
- ;;
- esac
-
- case $lt_cv_dlopen_self in
- yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
- *) enable_dlopen_self=unknown ;;
- esac
-
- case $lt_cv_dlopen_self_static in
- yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
- *) enable_dlopen_self_static=unknown ;;
- esac
-fi
-_LT_DECL([dlopen_support], [enable_dlopen], [0],
- [Whether dlopen is supported])
-_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
- [Whether dlopen of programs is supported])
-_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
- [Whether dlopen of statically linked programs is supported])
-])# LT_SYS_DLOPEN_SELF
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
-
-
-# _LT_COMPILER_C_O([TAGNAME])
-# ---------------------------
-# Check to see if options -c and -o are simultaneously supported by compiler.
-# This macro does not hard code the compiler like AC_PROG_CC_C_O.
-m4_defun([_LT_COMPILER_C_O],
-[m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_TAG_COMPILER])dnl
-AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
- [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
- [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
- $RM -r conftest 2>/dev/null
- mkdir conftest
- cd conftest
- mkdir out
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- lt_compiler_flag="-o out/conftest2.$ac_objext"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&AS_MESSAGE_LOG_FD
- echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
- if (exit $ac_status) && test -s out/conftest2.$ac_objext
- then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
- $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
- _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
- fi
- fi
- chmod u+w . 2>&AS_MESSAGE_LOG_FD
- $RM conftest*
- # SGI C++ compiler will create directory out/ii_files/ for
- # template instantiation
- test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
- $RM out/* && rmdir out
- cd ..
- $RM -r conftest
- $RM conftest*
-])
-_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
- [Does compiler simultaneously support -c and -o options?])
-])# _LT_COMPILER_C_O
-
-
-# _LT_COMPILER_FILE_LOCKS([TAGNAME])
-# ----------------------------------
-# Check to see if we can do hard links to lock some files if needed
-m4_defun([_LT_COMPILER_FILE_LOCKS],
-[m4_require([_LT_ENABLE_LOCK])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-_LT_COMPILER_C_O([$1])
-
-hard_links="nottested"
-if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
- # do not overwrite the value of need_locks provided by the user
- AC_MSG_CHECKING([if we can lock with hard links])
- hard_links=yes
- $RM conftest*
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- touch conftest.a
- ln conftest.a conftest.b 2>&5 || hard_links=no
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- AC_MSG_RESULT([$hard_links])
- if test "$hard_links" = no; then
- AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
- need_locks=warn
- fi
-else
- need_locks=no
-fi
-_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
-])# _LT_COMPILER_FILE_LOCKS
-
-
-# _LT_CHECK_OBJDIR
-# ----------------
-m4_defun([_LT_CHECK_OBJDIR],
-[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
-[rm -f .libs 2>/dev/null
-mkdir .libs 2>/dev/null
-if test -d .libs; then
- lt_cv_objdir=.libs
-else
- # MS-DOS does not allow filenames that begin with a dot.
- lt_cv_objdir=_libs
-fi
-rmdir .libs 2>/dev/null])
-objdir=$lt_cv_objdir
-_LT_DECL([], [objdir], [0],
- [The name of the directory that contains temporary libtool files])dnl
-m4_pattern_allow([LT_OBJDIR])dnl
-AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
- [Define to the sub-directory in which libtool stores uninstalled libraries.])
-])# _LT_CHECK_OBJDIR
-
-
-# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
-# --------------------------------------
-# Check hardcoding attributes.
-m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
-[AC_MSG_CHECKING([how to hardcode library paths into programs])
-_LT_TAGVAR(hardcode_action, $1)=
-if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
- test -n "$_LT_TAGVAR(runpath_var, $1)" ||
- test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
-
- # We can hardcode non-existent directories.
- if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
- # If the only mechanism to avoid hardcoding is shlibpath_var, we
- # have to relink, otherwise we might link with an installed library
- # when we should be linking with a yet-to-be-installed one
- ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
- test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
- # Linking always hardcodes the temporary library directory.
- _LT_TAGVAR(hardcode_action, $1)=relink
- else
- # We can link without hardcoding, and we can hardcode nonexisting dirs.
- _LT_TAGVAR(hardcode_action, $1)=immediate
- fi
-else
- # We cannot hardcode anything, or else we can only hardcode existing
- # directories.
- _LT_TAGVAR(hardcode_action, $1)=unsupported
-fi
-AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
-
-if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
- test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
- # Fast installation is not supported
- enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
- test "$enable_shared" = no; then
- # Fast installation is not necessary
- enable_fast_install=needless
-fi
-_LT_TAGDECL([], [hardcode_action], [0],
- [How to hardcode a shared library path into an executable])
-])# _LT_LINKER_HARDCODE_LIBPATH
-
-
-# _LT_CMD_STRIPLIB
-# ----------------
-m4_defun([_LT_CMD_STRIPLIB],
-[m4_require([_LT_DECL_EGREP])
-striplib=
-old_striplib=
-AC_MSG_CHECKING([whether stripping libraries is possible])
-if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
- test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
- test -z "$striplib" && striplib="$STRIP --strip-unneeded"
- AC_MSG_RESULT([yes])
-else
-# FIXME - insert some real tests, host_os isn't really good enough
- case $host_os in
- darwin*)
- if test -n "$STRIP" ; then
- striplib="$STRIP -x"
- old_striplib="$STRIP -S"
- AC_MSG_RESULT([yes])
- else
- AC_MSG_RESULT([no])
- fi
- ;;
- *)
- AC_MSG_RESULT([no])
- ;;
- esac
-fi
-_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
-_LT_DECL([], [striplib], [1])
-])# _LT_CMD_STRIPLIB
-
-
-# _LT_SYS_DYNAMIC_LINKER([TAG])
-# -----------------------------
-# PORTME Fill in your ld.so characteristics
-m4_defun([_LT_SYS_DYNAMIC_LINKER],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_OBJDUMP])dnl
-m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_CHECK_SHELL_FEATURES])dnl
-AC_MSG_CHECKING([dynamic linker characteristics])
-m4_if([$1],
- [], [
-if test "$GCC" = yes; then
- case $host_os in
- darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
- *) lt_awk_arg="/^libraries:/" ;;
- esac
- case $host_os in
- mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
- *) lt_sed_strip_eq="s,=/,/,g" ;;
- esac
- lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
- case $lt_search_path_spec in
- *\;*)
- # if the path contains ";" then we assume it to be the separator
- # otherwise default to the standard path separator (i.e. ":") - it is
- # assumed that no part of a normal pathname contains ";" but that should
- # okay in the real world where ";" in dirpaths is itself problematic.
- lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
- ;;
- *)
- lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
- ;;
- esac
- # Ok, now we have the path, separated by spaces, we can step through it
- # and add multilib dir if necessary.
- lt_tmp_lt_search_path_spec=
- lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
- for lt_sys_path in $lt_search_path_spec; do
- if test -d "$lt_sys_path/$lt_multi_os_dir"; then
- lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
- else
- test -d "$lt_sys_path" && \
- lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
- fi
- done
- lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
-BEGIN {RS=" "; FS="/|\n";} {
- lt_foo="";
- lt_count=0;
- for (lt_i = NF; lt_i > 0; lt_i--) {
- if ($lt_i != "" && $lt_i != ".") {
- if ($lt_i == "..") {
- lt_count++;
- } else {
- if (lt_count == 0) {
- lt_foo="/" $lt_i lt_foo;
- } else {
- lt_count--;
- }
- }
- }
- }
- if (lt_foo != "") { lt_freq[[lt_foo]]++; }
- if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
-}'`
- # AWK program above erroneously prepends '/' to C:/dos/paths
- # for these hosts.
- case $host_os in
- mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
- $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
- esac
- sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
-else
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi])
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
- shlibpath_var=LIBPATH
-
- # AIX 3 has no versioning support, so we append a major version to the name.
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
-
-aix[[4-9]]*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- hardcode_into_libs=yes
- if test "$host_cpu" = ia64; then
- # AIX 5 supports IA64
- library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- else
- # With GCC up to 2.95.x, collect2 would create an import file
- # for dependence libraries. The import file would start with
- # the line `#! .'. This would cause the generated library to
- # depend on `.', always an invalid library. This was fixed in
- # development snapshots of GCC prior to 3.0.
- case $host_os in
- aix4 | aix4.[[01]] | aix4.[[01]].*)
- if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
- echo ' yes '
- echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
- :
- else
- can_build_shared=no
- fi
- ;;
- esac
- # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
- # soname into executable. Probably we can add versioning support to
- # collect2, so additional links can be useful in future.
- if test "$aix_use_runtimelinking" = yes; then
- # If using run time linking (on AIX 4.2 or later) use lib<name>.so
- # instead of lib<name>.a to let people know that these are not
- # typical AIX shared libraries.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- else
- # We preserve .a as extension for shared libraries through AIX4.2
- # and later when we are not doing run time linking.
- library_names_spec='${libname}${release}.a $libname.a'
- soname_spec='${libname}${release}${shared_ext}$major'
- fi
- shlibpath_var=LIBPATH
- fi
- ;;
-
-amigaos*)
- case $host_cpu in
- powerpc)
- # Since July 2007 AmigaOS4 officially supports .so libraries.
- # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- ;;
- m68k)
- library_names_spec='$libname.ixlibrary $libname.a'
- # Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
- ;;
- esac
- ;;
-
-beos*)
- library_names_spec='${libname}${shared_ext}'
- dynamic_linker="$host_os ld.so"
- shlibpath_var=LIBRARY_PATH
- ;;
-
-bsdi[[45]]*)
- version_type=linux
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
- sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
- # the default ld.so.conf also contains /usr/contrib/lib and
- # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
- # libtool to hard-code these into programs
- ;;
-
-cygwin* | mingw* | pw32* | cegcc*)
- version_type=windows
- shrext_cmds=".dll"
- need_version=no
- need_lib_prefix=no
-
- case $GCC,$host_os in
- yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
- library_names_spec='$libname.dll.a'
- # DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname~
- if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
- eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
- fi'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $RM \$dlpath'
- shlibpath_overrides_runpath=yes
-
- case $host_os in
- cygwin*)
- # Cygwin DLLs use 'cyg' prefix rather than 'lib'
- soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-m4_if([$1], [],[
- sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
- ;;
- mingw* | cegcc*)
- # MinGW DLLs use traditional 'lib' prefix
- soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
- ;;
- pw32*)
- # pw32 DLLs use 'pw' prefix rather than 'lib'
- library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
- ;;
- esac
- ;;
-
- *)
- library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
- ;;
- esac
- dynamic_linker='Win32 ld.exe'
- # FIXME: first we should search . and the directory the executable is in
- shlibpath_var=PATH
- ;;
-
-darwin* | rhapsody*)
- dynamic_linker="$host_os dyld"
- version_type=darwin
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
- soname_spec='${libname}${release}${major}$shared_ext'
- shlibpath_overrides_runpath=yes
- shlibpath_var=DYLD_LIBRARY_PATH
- shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-m4_if([$1], [],[
- sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
- ;;
-
-dgux*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-freebsd1*)
- dynamic_linker=no
- ;;
-
-freebsd* | dragonfly*)
- # DragonFly does not have aout. When/if they implement a new
- # versioning mechanism, adjust this.
- if test -x /usr/bin/objformat; then
- objformat=`/usr/bin/objformat`
- else
- case $host_os in
- freebsd[[123]]*) objformat=aout ;;
- *) objformat=elf ;;
- esac
- fi
- # Handle Gentoo/FreeBSD as it was Linux
- case $host_vendor in
- gentoo)
- version_type=linux ;;
- *)
- version_type=freebsd-$objformat ;;
- esac
-
- case $version_type in
- freebsd-elf*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- need_version=no
- need_lib_prefix=no
- ;;
- freebsd-*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
- need_version=yes
- ;;
- linux)
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- need_lib_prefix=no
- need_version=no
- ;;
- esac
- shlibpath_var=LD_LIBRARY_PATH
- case $host_os in
- freebsd2*)
- shlibpath_overrides_runpath=yes
- ;;
- freebsd3.[[01]]* | freebsdelf3.[[01]]*)
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
- freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
- *) # from 4.6 on, and DragonFly
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- esac
- ;;
-
-gnu*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- ;;
-
-haiku*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- dynamic_linker="$host_os runtime_loader"
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
- hardcode_into_libs=yes
- ;;
-
-hpux9* | hpux10* | hpux11*)
- # Give a soname corresponding to the major version so that dld.sl refuses to
- # link against other versions.
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- case $host_cpu in
- ia64*)
- shrext_cmds='.so'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.so"
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- if test "X$HPUX_IA64_MODE" = X32; then
- sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
- else
- sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
- fi
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- hppa*64*)
- shrext_cmds='.sl'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- *)
- shrext_cmds='.sl'
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=SHLIB_PATH
- shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
- esac
- # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
- postinstall_cmds='chmod 555 $lib'
- # or fails outright, so override atomically:
- install_override_mode=555
- ;;
-
-interix[[3-9]]*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $host_os in
- nonstopux*) version_type=nonstopux ;;
- *)
- if test "$lt_cv_prog_gnu_ld" = yes; then
- version_type=linux
- else
- version_type=irix
- fi ;;
- esac
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
- case $host_os in
- irix5* | nonstopux*)
- libsuff= shlibsuff=
- ;;
- *)
- case $LD in # libtool.m4 will add one of these switches to LD
- *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
- libsuff= shlibsuff= libmagic=32-bit;;
- *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
- libsuff=32 shlibsuff=N32 libmagic=N32;;
- *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
- libsuff=64 shlibsuff=64 libmagic=64-bit;;
- *) libsuff= shlibsuff= libmagic=never-match;;
- esac
- ;;
- esac
- shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
- hardcode_into_libs=yes
- ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
- dynamic_linker=no
- ;;
-
-# This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
-
- # Some binutils ld are patched to set DT_RUNPATH
- AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
- [lt_cv_shlibpath_overrides_runpath=no
- save_LDFLAGS=$LDFLAGS
- save_libdir=$libdir
- eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
- LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
- AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
- [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
- [lt_cv_shlibpath_overrides_runpath=yes])])
- LDFLAGS=$save_LDFLAGS
- libdir=$save_libdir
- ])
- shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
-
- # This implies no fast_install, which is unacceptable.
- # Some rework will be needed to allow for fast_install
- # before this can be enabled.
- hardcode_into_libs=yes
-
- # Append ld.so.conf contents to the search path
- if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
- fi
-
- # We used to test for /lib/ld.so.1 and disable shared libraries on
- # powerpc, because MkLinux only supported shared libraries with the
- # GNU dynamic linker. Since this was broken with cross compilers,
- # most powerpc-linux boxes support dynamic linking these days and
- # people can always --disable-shared, the test was removed, and we
- # assume the GNU/Linux dynamic linker is in use.
- dynamic_linker='GNU/Linux ld.so'
- ;;
-
-netbsd*)
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- dynamic_linker='NetBSD (a.out) ld.so'
- else
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='NetBSD ld.elf_so'
- fi
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
-
-newsos6)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-*nto* | *qnx*)
- version_type=qnx
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='ldqnx.so'
- ;;
-
-openbsd*)
- version_type=sunos
- sys_lib_dlsearch_path_spec="/usr/lib"
- need_lib_prefix=no
- # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
- case $host_os in
- openbsd3.3 | openbsd3.3.*) need_version=yes ;;
- *) need_version=no ;;
- esac
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- case $host_os in
- openbsd2.[[89]] | openbsd2.[[89]].*)
- shlibpath_overrides_runpath=no
- ;;
- *)
- shlibpath_overrides_runpath=yes
- ;;
- esac
- else
- shlibpath_overrides_runpath=yes
- fi
- ;;
-
-os2*)
- libname_spec='$name'
- shrext_cmds=".dll"
- need_lib_prefix=no
- library_names_spec='$libname${shared_ext} $libname.a'
- dynamic_linker='OS/2 ld.exe'
- shlibpath_var=LIBPATH
- ;;
-
-osf3* | osf4* | osf5*)
- version_type=osf
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
- sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
- ;;
-
-rdos*)
- dynamic_linker=no
- ;;
-
-solaris*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- # ldd complains unless libraries are executable
- postinstall_cmds='chmod +x $lib'
- ;;
-
-sunos4*)
- version_type=sunos
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- if test "$with_gnu_ld" = yes; then
- need_lib_prefix=no
- fi
- need_version=yes
- ;;
-
-sysv4 | sysv4.3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- case $host_vendor in
- sni)
- shlibpath_overrides_runpath=no
- need_lib_prefix=no
- runpath_var=LD_RUN_PATH
- ;;
- siemens)
- need_lib_prefix=no
- ;;
- motorola)
- need_lib_prefix=no
- need_version=no
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
- ;;
- esac
- ;;
-
-sysv4*MP*)
- if test -d /usr/nec ;then
- version_type=linux
- library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
- soname_spec='$libname${shared_ext}.$major'
- shlibpath_var=LD_LIBRARY_PATH
- fi
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- version_type=freebsd-elf
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- if test "$with_gnu_ld" = yes; then
- sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
- else
- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- case $host_os in
- sco3.2v5*)
- sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
- ;;
- esac
- fi
- sys_lib_dlsearch_path_spec='/usr/lib'
- ;;
-
-tpf*)
- # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
-uts4*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-*)
- dynamic_linker=no
- ;;
-esac
-AC_MSG_RESULT([$dynamic_linker])
-test "$dynamic_linker" = no && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
- sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
-fi
-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
- sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
-fi
-
-_LT_DECL([], [variables_saved_for_relink], [1],
- [Variables whose values should be saved in libtool wrapper scripts and
- restored at link time])
-_LT_DECL([], [need_lib_prefix], [0],
- [Do we need the "lib" prefix for modules?])
-_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
-_LT_DECL([], [version_type], [0], [Library versioning type])
-_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable])
-_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
-_LT_DECL([], [shlibpath_overrides_runpath], [0],
- [Is shlibpath searched before the hard-coded library search path?])
-_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
-_LT_DECL([], [library_names_spec], [1],
- [[List of archive names. First name is the real one, the rest are links.
- The last name is the one that the linker finds with -lNAME]])
-_LT_DECL([], [soname_spec], [1],
- [[The coded name of the library, if different from the real name]])
-_LT_DECL([], [install_override_mode], [1],
- [Permission mode override for installation of shared libraries])
-_LT_DECL([], [postinstall_cmds], [2],
- [Command to use after installation of a shared archive])
-_LT_DECL([], [postuninstall_cmds], [2],
- [Command to use after uninstallation of a shared archive])
-_LT_DECL([], [finish_cmds], [2],
- [Commands used to finish a libtool library installation in a directory])
-_LT_DECL([], [finish_eval], [1],
- [[As "finish_cmds", except a single script fragment to be evaled but
- not shown]])
-_LT_DECL([], [hardcode_into_libs], [0],
- [Whether we should hardcode library paths into libraries])
-_LT_DECL([], [sys_lib_search_path_spec], [2],
- [Compile-time system search path for libraries])
-_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
- [Run-time system search path for libraries])
-])# _LT_SYS_DYNAMIC_LINKER
-
-
-# _LT_PATH_TOOL_PREFIX(TOOL)
-# --------------------------
-# find a file program which can recognize shared library
-AC_DEFUN([_LT_PATH_TOOL_PREFIX],
-[m4_require([_LT_DECL_EGREP])dnl
-AC_MSG_CHECKING([for $1])
-AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
-[case $MAGIC_CMD in
-[[\\/*] | ?:[\\/]*])
- lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
- ;;
-*)
- lt_save_MAGIC_CMD="$MAGIC_CMD"
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-dnl $ac_dummy forces splitting on constant user-supplied paths.
-dnl POSIX.2 word splitting is done only on the output of word expansions,
-dnl not every word. This closes a longstanding sh security hole.
- ac_dummy="m4_if([$2], , $PATH, [$2])"
- for ac_dir in $ac_dummy; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$1; then
- lt_cv_path_MAGIC_CMD="$ac_dir/$1"
- if test -n "$file_magic_test_file"; then
- case $deplibs_check_method in
- "file_magic "*)
- file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
- MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
- if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
- $EGREP "$file_magic_regex" > /dev/null; then
- :
- else
- cat <<_LT_EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such. This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem. Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool@gnu.org
-
-_LT_EOF
- fi ;;
- esac
- fi
- break
- fi
- done
- IFS="$lt_save_ifs"
- MAGIC_CMD="$lt_save_MAGIC_CMD"
- ;;
-esac])
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
- AC_MSG_RESULT($MAGIC_CMD)
-else
- AC_MSG_RESULT(no)
-fi
-_LT_DECL([], [MAGIC_CMD], [0],
- [Used to examine libraries when file_magic_cmd begins with "file"])dnl
-])# _LT_PATH_TOOL_PREFIX
-
-# Old name:
-AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
-
-
-# _LT_PATH_MAGIC
-# --------------
-# find a file program which can recognize a shared library
-m4_defun([_LT_PATH_MAGIC],
-[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
-if test -z "$lt_cv_path_MAGIC_CMD"; then
- if test -n "$ac_tool_prefix"; then
- _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
- else
- MAGIC_CMD=:
- fi
-fi
-])# _LT_PATH_MAGIC
-
-
-# LT_PATH_LD
-# ----------
-# find the pathname to the GNU or non-GNU linker
-AC_DEFUN([LT_PATH_LD],
-[AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
-
-AC_ARG_WITH([gnu-ld],
- [AS_HELP_STRING([--with-gnu-ld],
- [assume the C compiler uses GNU ld @<:@default=no@:>@])],
- [test "$withval" = no || with_gnu_ld=yes],
- [with_gnu_ld=no])dnl
-
-ac_prog=ld
-if test "$GCC" = yes; then
- # Check if gcc -print-prog-name=ld gives a path.
- AC_MSG_CHECKING([for ld used by $CC])
- case $host in
- *-*-mingw*)
- # gcc leaves a trailing carriage return which upsets mingw
- ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
- *)
- ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
- esac
- case $ac_prog in
- # Accept absolute paths.
- [[\\/]]* | ?:[[\\/]]*)
- re_direlt='/[[^/]][[^/]]*/\.\./'
- # Canonicalize the pathname of ld
- ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
- while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
- ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
- done
- test -z "$LD" && LD="$ac_prog"
- ;;
- "")
- # If it fails, then pretend we aren't using GCC.
- ac_prog=ld
- ;;
- *)
- # If it is relative, then search for the first ld in PATH.
- with_gnu_ld=unknown
- ;;
- esac
-elif test "$with_gnu_ld" = yes; then
- AC_MSG_CHECKING([for GNU ld])
-else
- AC_MSG_CHECKING([for non-GNU ld])
-fi
-AC_CACHE_VAL(lt_cv_path_LD,
-[if test -z "$LD"; then
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
- lt_cv_path_LD="$ac_dir/$ac_prog"
- # Check to see if the program is GNU ld. I'd rather use --version,
- # but apparently some variants of GNU ld only accept -v.
- # Break only if it was the GNU/non-GNU ld that we prefer.
- case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
- *GNU* | *'with BFD'*)
- test "$with_gnu_ld" != no && break
- ;;
- *)
- test "$with_gnu_ld" != yes && break
- ;;
- esac
- fi
- done
- IFS="$lt_save_ifs"
-else
- lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi])
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
- AC_MSG_RESULT($LD)
-else
- AC_MSG_RESULT(no)
-fi
-test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
-_LT_PATH_LD_GNU
-AC_SUBST([LD])
-
-_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
-])# LT_PATH_LD
-
-# Old names:
-AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
-AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_PROG_LD], [])
-dnl AC_DEFUN([AC_PROG_LD], [])
-
-
-# _LT_PATH_LD_GNU
-#- --------------
-m4_defun([_LT_PATH_LD_GNU],
-[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
-[# I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
- lt_cv_prog_gnu_ld=yes
- ;;
-*)
- lt_cv_prog_gnu_ld=no
- ;;
-esac])
-with_gnu_ld=$lt_cv_prog_gnu_ld
-])# _LT_PATH_LD_GNU
-
-
-# _LT_CMD_RELOAD
-# --------------
-# find reload flag for linker
-# -- PORTME Some linkers may need a different reload flag.
-m4_defun([_LT_CMD_RELOAD],
-[AC_CACHE_CHECK([for $LD option to reload object files],
- lt_cv_ld_reload_flag,
- [lt_cv_ld_reload_flag='-r'])
-reload_flag=$lt_cv_ld_reload_flag
-case $reload_flag in
-"" | " "*) ;;
-*) reload_flag=" $reload_flag" ;;
-esac
-reload_cmds='$LD$reload_flag -o $output$reload_objs'
-case $host_os in
- darwin*)
- if test "$GCC" = yes; then
- reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
- else
- reload_cmds='$LD$reload_flag -o $output$reload_objs'
- fi
- ;;
-esac
-_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
-_LT_TAGDECL([], [reload_cmds], [2])dnl
-])# _LT_CMD_RELOAD
-
-
-# _LT_CHECK_MAGIC_METHOD
-# ----------------------
-# how to check for library dependencies
-# -- PORTME fill in with the dynamic library characteristics
-m4_defun([_LT_CHECK_MAGIC_METHOD],
-[m4_require([_LT_DECL_EGREP])
-m4_require([_LT_DECL_OBJDUMP])
-AC_CACHE_CHECK([how to recognize dependent libraries],
-lt_cv_deplibs_check_method,
-[lt_cv_file_magic_cmd='$MAGIC_CMD'
-lt_cv_file_magic_test_file=
-lt_cv_deplibs_check_method='unknown'
-# Need to set the preceding variable on all platforms that support
-# interlibrary dependencies.
-# 'none' -- dependencies not supported.
-# `unknown' -- same as none, but documents that we really don't know.
-# 'pass_all' -- all dependencies passed with no checks.
-# 'test_compile' -- check by making test program.
-# 'file_magic [[regex]]' -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given extended regex.
-# If you have `file' or equivalent on your system and you're not sure
-# whether `pass_all' will *always* work, you probably want this one.
-
-case $host_os in
-aix[[4-9]]*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-beos*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-bsdi[[45]]*)
- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
- lt_cv_file_magic_cmd='/usr/bin/file -L'
- lt_cv_file_magic_test_file=/shlib/libc.so
- ;;
-
-cygwin*)
- # func_win32_libid is a shell function defined in ltmain.sh
- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
- lt_cv_file_magic_cmd='func_win32_libid'
- ;;
-
-mingw* | pw32*)
- # Base MSYS/MinGW do not provide the 'file' command needed by
- # func_win32_libid shell function, so use a weaker test based on 'objdump',
- # unless we find 'file', for example because we are cross-compiling.
- # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
- if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
- lt_cv_file_magic_cmd='func_win32_libid'
- else
- # Keep this pattern in sync with the one in func_win32_libid.
- lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
- lt_cv_file_magic_cmd='$OBJDUMP -f'
- fi
- ;;
-
-cegcc*)
- # use the weaker test based on 'objdump'. See mingw*.
- lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
- lt_cv_file_magic_cmd='$OBJDUMP -f'
- ;;
-
-darwin* | rhapsody*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-freebsd* | dragonfly*)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
- case $host_cpu in
- i*86 )
- # Not sure whether the presence of OpenBSD here was a mistake.
- # Let's accept both of them until this is cleared up.
- lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
- lt_cv_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
- ;;
- esac
- else
- lt_cv_deplibs_check_method=pass_all
- fi
- ;;
-
-gnu*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-haiku*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-hpux10.20* | hpux11*)
- lt_cv_file_magic_cmd=/usr/bin/file
- case $host_cpu in
- ia64*)
- lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
- lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
- ;;
- hppa*64*)
- [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
- lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
- ;;
- *)
- lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
- lt_cv_file_magic_test_file=/usr/lib/libc.sl
- ;;
- esac
- ;;
-
-interix[[3-9]]*)
- # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $LD in
- *-32|*"-32 ") libmagic=32-bit;;
- *-n32|*"-n32 ") libmagic=N32;;
- *-64|*"-64 ") libmagic=64-bit;;
- *) libmagic=never-match;;
- esac
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-# This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-netbsd*)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
- else
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
- fi
- ;;
-
-newos6*)
- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
- lt_cv_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=/usr/lib/libnls.so
- ;;
-
-*nto* | *qnx*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-openbsd*)
- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
- else
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
- fi
- ;;
-
-osf3* | osf4* | osf5*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-rdos*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-solaris*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-sysv4 | sysv4.3*)
- case $host_vendor in
- motorola)
- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
- ;;
- ncr)
- lt_cv_deplibs_check_method=pass_all
- ;;
- sequent)
- lt_cv_file_magic_cmd='/bin/file'
- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
- ;;
- sni)
- lt_cv_file_magic_cmd='/bin/file'
- lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
- lt_cv_file_magic_test_file=/lib/libc.so
- ;;
- siemens)
- lt_cv_deplibs_check_method=pass_all
- ;;
- pc)
- lt_cv_deplibs_check_method=pass_all
- ;;
- esac
- ;;
-
-tpf*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-esac
-])
-file_magic_cmd=$lt_cv_file_magic_cmd
-deplibs_check_method=$lt_cv_deplibs_check_method
-test -z "$deplibs_check_method" && deplibs_check_method=unknown
-
-_LT_DECL([], [deplibs_check_method], [1],
- [Method to check whether dependent libraries are shared objects])
-_LT_DECL([], [file_magic_cmd], [1],
- [Command to use when deplibs_check_method == "file_magic"])
-])# _LT_CHECK_MAGIC_METHOD
-
-
-# LT_PATH_NM
-# ----------
-# find the pathname to a BSD- or MS-compatible name lister
-AC_DEFUN([LT_PATH_NM],
-[AC_REQUIRE([AC_PROG_CC])dnl
-AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
-[if test -n "$NM"; then
- # Let the user override the test.
- lt_cv_path_NM="$NM"
-else
- lt_nm_to_check="${ac_tool_prefix}nm"
- if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
- lt_nm_to_check="$lt_nm_to_check nm"
- fi
- for lt_tmp_nm in $lt_nm_to_check; do
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- tmp_nm="$ac_dir/$lt_tmp_nm"
- if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
- # Check to see if the nm accepts a BSD-compat flag.
- # Adding the `sed 1q' prevents false positives on HP-UX, which says:
- # nm: unknown option "B" ignored
- # Tru64's nm complains that /dev/null is an invalid object file
- case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
- */dev/null* | *'Invalid file or object type'*)
- lt_cv_path_NM="$tmp_nm -B"
- break
- ;;
- *)
- case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
- */dev/null*)
- lt_cv_path_NM="$tmp_nm -p"
- break
- ;;
- *)
- lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
- continue # so that we can try to find one that supports BSD flags
- ;;
- esac
- ;;
- esac
- fi
- done
- IFS="$lt_save_ifs"
- done
- : ${lt_cv_path_NM=no}
-fi])
-if test "$lt_cv_path_NM" != "no"; then
- NM="$lt_cv_path_NM"
-else
- # Didn't find any BSD compatible name lister, look for dumpbin.
- if test -n "$DUMPBIN"; then :
- # Let the user override the test.
- else
- AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
- case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
- *COFF*)
- DUMPBIN="$DUMPBIN -symbols"
- ;;
- *)
- DUMPBIN=:
- ;;
- esac
- fi
- AC_SUBST([DUMPBIN])
- if test "$DUMPBIN" != ":"; then
- NM="$DUMPBIN"
- fi
-fi
-test -z "$NM" && NM=nm
-AC_SUBST([NM])
-_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
-
-AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
- [lt_cv_nm_interface="BSD nm"
- echo "int some_variable = 0;" > conftest.$ac_ext
- (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
- (eval "$ac_compile" 2>conftest.err)
- cat conftest.err >&AS_MESSAGE_LOG_FD
- (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
- (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
- cat conftest.err >&AS_MESSAGE_LOG_FD
- (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
- cat conftest.out >&AS_MESSAGE_LOG_FD
- if $GREP 'External.*some_variable' conftest.out > /dev/null; then
- lt_cv_nm_interface="MS dumpbin"
- fi
- rm -f conftest*])
-])# LT_PATH_NM
-
-# Old names:
-AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
-AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_PROG_NM], [])
-dnl AC_DEFUN([AC_PROG_NM], [])
-
-
-# LT_LIB_M
-# --------
-# check for math library
-AC_DEFUN([LT_LIB_M],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-LIBM=
-case $host in
-*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
- # These system don't have libm, or don't need it
- ;;
-*-ncr-sysv4.3*)
- AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
- AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
- ;;
-*)
- AC_CHECK_LIB(m, cos, LIBM="-lm")
- ;;
-esac
-AC_SUBST([LIBM])
-])# LT_LIB_M
-
-# Old name:
-AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_CHECK_LIBM], [])
-
-
-# _LT_COMPILER_NO_RTTI([TAGNAME])
-# -------------------------------
-m4_defun([_LT_COMPILER_NO_RTTI],
-[m4_require([_LT_TAG_COMPILER])dnl
-
-_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
-
-if test "$GCC" = yes; then
- case $cc_basename in
- nvcc*)
- _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
- esac
-
- _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
- lt_cv_prog_compiler_rtti_exceptions,
- [-fno-rtti -fno-exceptions], [],
- [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
-fi
-_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
- [Compiler flag to turn off builtin functions])
-])# _LT_COMPILER_NO_RTTI
-
-
-# _LT_CMD_GLOBAL_SYMBOLS
-# ----------------------
-m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_PROG_AWK])dnl
-AC_REQUIRE([LT_PATH_NM])dnl
-AC_REQUIRE([LT_PATH_LD])dnl
-m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_TAG_COMPILER])dnl
-
-# Check for command to grab the raw symbol name followed by C symbol from nm.
-AC_MSG_CHECKING([command to parse $NM output from $compiler object])
-AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
-[
-# These are sane defaults that work on at least a few old systems.
-# [They come from Ultrix. What could be older than Ultrix?!! ;)]
-
-# Character class describing NM global symbol codes.
-symcode='[[BCDEGRST]]'
-
-# Regexp to match symbols that can be accessed directly from C.
-sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
-
-# Define system-specific variables.
-case $host_os in
-aix*)
- symcode='[[BCDT]]'
- ;;
-cygwin* | mingw* | pw32* | cegcc*)
- symcode='[[ABCDGISTW]]'
- ;;
-hpux*)
- if test "$host_cpu" = ia64; then
- symcode='[[ABCDEGRST]]'
- fi
- ;;
-irix* | nonstopux*)
- symcode='[[BCDEGRST]]'
- ;;
-osf*)
- symcode='[[BCDEGQRST]]'
- ;;
-solaris*)
- symcode='[[BDRT]]'
- ;;
-sco3.2v5*)
- symcode='[[DT]]'
- ;;
-sysv4.2uw2*)
- symcode='[[DT]]'
- ;;
-sysv5* | sco5v6* | unixware* | OpenUNIX*)
- symcode='[[ABDT]]'
- ;;
-sysv4)
- symcode='[[DFNSTU]]'
- ;;
-esac
-
-# If we're using GNU nm, then use its standard symbol codes.
-case `$NM -V 2>&1` in
-*GNU* | *'with BFD'*)
- symcode='[[ABCDGIRSTW]]' ;;
-esac
-
-# Transform an extracted symbol line into a proper C declaration.
-# Some systems (esp. on ia64) link data and code symbols differently,
-# so use this general approach.
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
-
-# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'"
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
-
-# Handle CRLF in mingw tool chain
-opt_cr=
-case $build_os in
-mingw*)
- opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
- ;;
-esac
-
-# Try without a prefix underscore, then with it.
-for ac_symprfx in "" "_"; do
-
- # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
- symxfrm="\\1 $ac_symprfx\\2 \\2"
-
- # Write the raw and C identifiers.
- if test "$lt_cv_nm_interface" = "MS dumpbin"; then
- # Fake it for dumpbin and say T for any non-static function
- # and D for any global variable.
- # Also find C++ and __fastcall symbols from MSVC++,
- # which start with @ or ?.
- lt_cv_sys_global_symbol_pipe="$AWK ['"\
-" {last_section=section; section=\$ 3};"\
-" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
-" \$ 0!~/External *\|/{next};"\
-" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
-" {if(hide[section]) next};"\
-" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
-" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
-" s[1]~/^[@?]/{print s[1], s[1]; next};"\
-" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
-" ' prfx=^$ac_symprfx]"
- else
- lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
- fi
-
- # Check to see that the pipe works correctly.
- pipe_works=no
-
- rm -f conftest*
- cat > conftest.$ac_ext <<_LT_EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(void);
-void nm_test_func(void){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
-_LT_EOF
-
- if AC_TRY_EVAL(ac_compile); then
- # Now try to grab the symbols.
- nlist=conftest.nm
- if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
- # Try sorting and uniquifying the output.
- if sort "$nlist" | uniq > "$nlist"T; then
- mv -f "$nlist"T "$nlist"
- else
- rm -f "$nlist"T
- fi
-
- # Make sure that we snagged all the symbols we need.
- if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
- if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
- cat <<_LT_EOF > conftest.$ac_ext
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-_LT_EOF
- # Now generate the symbol file.
- eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
-
- cat <<_LT_EOF >> conftest.$ac_ext
-
-/* The mapping between symbol names and symbols. */
-const struct {
- const char *name;
- void *address;
-}
-lt__PROGRAM__LTX_preloaded_symbols[[]] =
-{
- { "@PROGRAM@", (void *) 0 },
-_LT_EOF
- $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
- cat <<\_LT_EOF >> conftest.$ac_ext
- {0, (void *) 0}
-};
-
-/* This works around a problem in FreeBSD linker */
-#ifdef FREEBSD_WORKAROUND
-static const void *lt_preloaded_setup() {
- return lt__PROGRAM__LTX_preloaded_symbols;
-}
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-_LT_EOF
- # Now try linking the two files.
- mv conftest.$ac_objext conftstm.$ac_objext
- lt_save_LIBS="$LIBS"
- lt_save_CFLAGS="$CFLAGS"
- LIBS="conftstm.$ac_objext"
- CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
- if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
- pipe_works=yes
- fi
- LIBS="$lt_save_LIBS"
- CFLAGS="$lt_save_CFLAGS"
- else
- echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
- fi
- else
- echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
- fi
- else
- echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
- fi
- else
- echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
- cat conftest.$ac_ext >&5
- fi
- rm -rf conftest* conftst*
-
- # Do not use the global_symbol_pipe unless it works.
- if test "$pipe_works" = yes; then
- break
- else
- lt_cv_sys_global_symbol_pipe=
- fi
-done
-])
-if test -z "$lt_cv_sys_global_symbol_pipe"; then
- lt_cv_sys_global_symbol_to_cdecl=
-fi
-if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
- AC_MSG_RESULT(failed)
-else
- AC_MSG_RESULT(ok)
-fi
-
-_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
- [Take the output of nm and produce a listing of raw symbols and C names])
-_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
- [Transform the output of nm in a proper C declaration])
-_LT_DECL([global_symbol_to_c_name_address],
- [lt_cv_sys_global_symbol_to_c_name_address], [1],
- [Transform the output of nm in a C name address pair])
-_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
- [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
- [Transform the output of nm in a C name address pair when lib prefix is needed])
-]) # _LT_CMD_GLOBAL_SYMBOLS
-
-
-# _LT_COMPILER_PIC([TAGNAME])
-# ---------------------------
-m4_defun([_LT_COMPILER_PIC],
-[m4_require([_LT_TAG_COMPILER])dnl
-_LT_TAGVAR(lt_prog_compiler_wl, $1)=
-_LT_TAGVAR(lt_prog_compiler_pic, $1)=
-_LT_TAGVAR(lt_prog_compiler_static, $1)=
-
-AC_MSG_CHECKING([for $compiler option to produce PIC])
-m4_if([$1], [CXX], [
- # C++ specific cases for pic, static, wl, etc.
- if test "$GXX" = yes; then
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- fi
- ;;
-
- amigaos*)
- case $host_cpu in
- powerpc)
- # see comment about AmigaOS4 .so support
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- m68k)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
- ;;
- esac
- ;;
-
- beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
- mingw* | cygwin* | os2* | pw32* | cegcc*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- # Although the cygwin gcc ignores -fPIC, still need this for old-style
- # (--disable-auto-import) libraries
- m4_if([$1], [GCJ], [],
- [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
- ;;
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
- ;;
- *djgpp*)
- # DJGPP does not support shared libraries at all
- _LT_TAGVAR(lt_prog_compiler_pic, $1)=
- ;;
- haiku*)
- # PIC is the default for Haiku.
- # The "-static" flag exists, but is broken.
- _LT_TAGVAR(lt_prog_compiler_static, $1)=
- ;;
- interix[[3-9]]*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
- ;;
- sysv4*MP*)
- if test -d /usr/nec; then
- _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
- fi
- ;;
- hpux*)
- # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
- # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
- # sets the default TLS model and affects inlining.
- case $host_cpu in
- hppa*64*)
- ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- esac
- ;;
- *qnx* | *nto*)
- # QNX uses GNU C++, but need to define -shared option too, otherwise
- # it will coredump.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
- ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- esac
- else
- case $host_os in
- aix[[4-9]]*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- else
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
- chorus*)
- case $cc_basename in
- cxch68*)
- # Green Hills C++ Compiler
- # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
- ;;
- esac
- ;;
- dgux*)
- case $cc_basename in
- ec++*)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- ;;
- ghcx*)
- # Green Hills C++ Compiler
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- ;;
- *)
- ;;
- esac
- ;;
- freebsd* | dragonfly*)
- # FreeBSD uses GNU C++
- ;;
- hpux9* | hpux10* | hpux11*)
- case $cc_basename in
- CC*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
- if test "$host_cpu" != ia64; then
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
- fi
- ;;
- aCC*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
- ;;
- esac
- ;;
- *)
- ;;
- esac
- ;;
- interix*)
- # This is c89, which is MS Visual C++ (no shared libs)
- # Anyone wants to do a port?
- ;;
- irix5* | irix6* | nonstopux*)
- case $cc_basename in
- CC*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- # CC pic flag -KPIC is the default.
- ;;
- *)
- ;;
- esac
- ;;
- linux* | k*bsd*-gnu | kopensolaris*-gnu)
- case $cc_basename in
- KCC*)
- # KAI C++ Compiler
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- ecpc* )
- # old Intel C++ for x86_64 which still supported -KPIC.
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
- ;;
- icpc* )
- # Intel C++, used to be incompatible with GCC.
- # ICC 10 doesn't accept -KPIC any more.
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
- ;;
- pgCC* | pgcpp*)
- # Portland Group C++ compiler
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- cxx*)
- # Compaq C++
- # Make sure the PIC flag is empty. It appears that all Alpha
- # Linux and Compaq Tru64 Unix objects are PIC.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)=
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
- xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
- # IBM XL 8.0, 9.0 on PPC and BlueGene
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C++ 5.9
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
- ;;
- esac
- ;;
- esac
- ;;
- lynxos*)
- ;;
- m88k*)
- ;;
- mvs*)
- case $cc_basename in
- cxx*)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
- ;;
- *)
- ;;
- esac
- ;;
- netbsd*)
- ;;
- *qnx* | *nto*)
- # QNX uses GNU C++, but need to define -shared option too, otherwise
- # it will coredump.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
- ;;
- osf3* | osf4* | osf5*)
- case $cc_basename in
- KCC*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
- ;;
- RCC*)
- # Rational C++ 2.4.1
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- ;;
- cxx*)
- # Digital/Compaq C++
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # Make sure the PIC flag is empty. It appears that all Alpha
- # Linux and Compaq Tru64 Unix objects are PIC.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)=
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
- *)
- ;;
- esac
- ;;
- psos*)
- ;;
- solaris*)
- case $cc_basename in
- CC* | sunCC*)
- # Sun C++ 4.2, 5.x and Centerline C++
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
- ;;
- gcx*)
- # Green Hills C++ Compiler
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
- ;;
- *)
- ;;
- esac
- ;;
- sunos4*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.x
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- lcc*)
- # Lucid
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- ;;
- *)
- ;;
- esac
- ;;
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- case $cc_basename in
- CC*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- esac
- ;;
- tandem*)
- case $cc_basename in
- NCC*)
- # NonStop-UX NCC 3.20
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- ;;
- *)
- ;;
- esac
- ;;
- vxworks*)
- ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
- ;;
- esac
- fi
-],
-[
- if test "$GCC" = yes; then
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- fi
- ;;
-
- amigaos*)
- case $host_cpu in
- powerpc)
- # see comment about AmigaOS4 .so support
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- m68k)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
- ;;
- esac
- ;;
-
- beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
-
- mingw* | cygwin* | pw32* | os2* | cegcc*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- # Although the cygwin gcc ignores -fPIC, still need this for old-style
- # (--disable-auto-import) libraries
- m4_if([$1], [GCJ], [],
- [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
- ;;
-
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
- ;;
-
- haiku*)
- # PIC is the default for Haiku.
- # The "-static" flag exists, but is broken.
- _LT_TAGVAR(lt_prog_compiler_static, $1)=
- ;;
-
- hpux*)
- # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
- # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
- # sets the default TLS model and affects inlining.
- case $host_cpu in
- hppa*64*)
- # +Z the default
- ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- esac
- ;;
-
- interix[[3-9]]*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
- ;;
-
- msdosdjgpp*)
- # Just because we use GCC doesn't mean we suddenly get shared libraries
- # on systems that don't support them.
- _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
- enable_shared=no
- ;;
-
- *nto* | *qnx*)
- # QNX uses GNU C++, but need to define -shared option too, otherwise
- # it will coredump.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
- fi
- ;;
-
- *)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- esac
-
- case $cc_basename in
- nvcc*) # Cuda Compiler Driver 2.2
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC'
- ;;
- esac
- else
- # PORTME Check for flag to pass linker flags through the system compiler.
- case $host_os in
- aix*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- else
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
-
- mingw* | cygwin* | pw32* | os2* | cegcc*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- m4_if([$1], [GCJ], [],
- [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
- ;;
-
- hpux9* | hpux10* | hpux11*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
- ;;
- esac
- # Is there a better lt_prog_compiler_static that works with the bundled CC?
- _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
- ;;
-
- irix5* | irix6* | nonstopux*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # PIC (with -KPIC) is the default.
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
-
- linux* | k*bsd*-gnu | kopensolaris*-gnu)
- case $cc_basename in
- # old Intel for x86_64 which still supported -KPIC.
- ecc*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
- ;;
- # icc used to be incompatible with GCC.
- # ICC 10 doesn't accept -KPIC any more.
- icc* | ifort*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
- ;;
- # Lahey Fortran 8.1.
- lf95*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
- ;;
- pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
- # Portland Group compilers (*not* the Pentium gcc compiler,
- # which looks to be a dead project)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- ccc*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # All Alpha code is PIC.
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
- xl* | bgxl* | bgf* | mpixl*)
- # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ F* | *Sun*Fortran*)
- # Sun Fortran 8.3 passes all unrecognized flags to the linker
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
- ;;
- *Sun\ C*)
- # Sun C 5.9
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- ;;
- esac
- ;;
- esac
- ;;
-
- newsos6)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- *nto* | *qnx*)
- # QNX uses GNU C++, but need to define -shared option too, otherwise
- # it will coredump.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
- ;;
-
- osf3* | osf4* | osf5*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # All OSF/1 code is PIC.
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
-
- rdos*)
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
-
- solaris*)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- case $cc_basename in
- f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
- *)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
- esac
- ;;
-
- sunos4*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- sysv4 | sysv4.2uw2* | sysv4.3*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec ;then
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- fi
- ;;
-
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- unicos*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
- ;;
-
- uts4*)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- *)
- _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
- ;;
- esac
- fi
-])
-case $host_os in
- # For platforms which do not support PIC, -DPIC is meaningless:
- *djgpp*)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)=
- ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
- ;;
-esac
-AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
-_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
- [How to pass a linker flag through the compiler])
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
- _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
- [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
- [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
- [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
- "" | " "*) ;;
- *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
- esac],
- [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
- _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
-fi
-_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
- [Additional compiler flags for building library objects])
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
-_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
- _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
- $lt_tmp_static_flag,
- [],
- [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
-_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
- [Compiler flag to prevent dynamic linking])
-])# _LT_COMPILER_PIC
-
-
-# _LT_LINKER_SHLIBS([TAGNAME])
-# ----------------------------
-# See if the linker supports building shared libraries.
-m4_defun([_LT_LINKER_SHLIBS],
-[AC_REQUIRE([LT_PATH_LD])dnl
-AC_REQUIRE([LT_PATH_NM])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
-m4_require([_LT_TAG_COMPILER])dnl
-AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
-m4_if([$1], [CXX], [
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- case $host_os in
- aix[[4-9]]*)
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- # Also, AIX nm treats weak defined symbols like other global defined
- # symbols, whereas GNU nm marks them as "W".
- if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
- else
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
- fi
- ;;
- pw32*)
- _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
- ;;
- cygwin* | mingw* | cegcc*)
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
- ;;
- *)
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- ;;
- esac
- _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
-], [
- runpath_var=
- _LT_TAGVAR(allow_undefined_flag, $1)=
- _LT_TAGVAR(always_export_symbols, $1)=no
- _LT_TAGVAR(archive_cmds, $1)=
- _LT_TAGVAR(archive_expsym_cmds, $1)=
- _LT_TAGVAR(compiler_needs_object, $1)=no
- _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
- _LT_TAGVAR(export_dynamic_flag_spec, $1)=
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- _LT_TAGVAR(hardcode_automatic, $1)=no
- _LT_TAGVAR(hardcode_direct, $1)=no
- _LT_TAGVAR(hardcode_direct_absolute, $1)=no
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
- _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
- _LT_TAGVAR(hardcode_libdir_separator, $1)=
- _LT_TAGVAR(hardcode_minus_L, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
- _LT_TAGVAR(inherit_rpath, $1)=no
- _LT_TAGVAR(link_all_deplibs, $1)=unknown
- _LT_TAGVAR(module_cmds, $1)=
- _LT_TAGVAR(module_expsym_cmds, $1)=
- _LT_TAGVAR(old_archive_from_new_cmds, $1)=
- _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
- _LT_TAGVAR(thread_safe_flag_spec, $1)=
- _LT_TAGVAR(whole_archive_flag_spec, $1)=
- # include_expsyms should be a list of space-separated symbols to be *always*
- # included in the symbol list
- _LT_TAGVAR(include_expsyms, $1)=
- # exclude_expsyms can be an extended regexp of symbols to exclude
- # it will be wrapped by ` (' and `)$', so one must not match beginning or
- # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
- # as well as any symbol that contains `d'.
- _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
- # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
- # platforms (ab)use it in PIC code, but their linkers get confused if
- # the symbol is explicitly referenced. Since portable code cannot
- # rely on this symbol name, it's probably fine to never include it in
- # preloaded symbol tables.
- # Exclude shared library initialization/finalization symbols.
-dnl Note also adjust exclude_expsyms for C++ above.
- extract_expsyms_cmds=
-
- case $host_os in
- cygwin* | mingw* | pw32* | cegcc*)
- # FIXME: the MSVC++ port hasn't been tested in a loooong time
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- if test "$GCC" != yes; then
- with_gnu_ld=no
- fi
- ;;
- interix*)
- # we just hope/assume this is gcc and not c89 (= MSVC++)
- with_gnu_ld=yes
- ;;
- openbsd*)
- with_gnu_ld=no
- ;;
- esac
-
- _LT_TAGVAR(ld_shlibs, $1)=yes
-
- # On some targets, GNU ld is compatible enough with the native linker
- # that we're better off using the native interface for both.
- lt_use_gnu_ld_interface=no
- if test "$with_gnu_ld" = yes; then
- case $host_os in
- aix*)
- # The AIX port of GNU ld has always aspired to compatibility
- # with the native linker. However, as the warning in the GNU ld
- # block says, versions before 2.19.5* couldn't really create working
- # shared libraries, regardless of the interface used.
- case `$LD -v 2>&1` in
- *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
- *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
- *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
- *)
- lt_use_gnu_ld_interface=yes
- ;;
- esac
- ;;
- *)
- lt_use_gnu_ld_interface=yes
- ;;
- esac
- fi
-
- if test "$lt_use_gnu_ld_interface" = yes; then
- # If archive_cmds runs LD, not CC, wlarc should be empty
- wlarc='${wl}'
-
- # Set some defaults for GNU ld with shared library support. These
- # are reset later if shared libraries are not supported. Putting them
- # here allows them to be overridden if necessary.
- runpath_var=LD_RUN_PATH
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
- # ancient GNU ld didn't support --whole-archive et. al.
- if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
- _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- _LT_TAGVAR(whole_archive_flag_spec, $1)=
- fi
- supports_anon_versioning=no
- case `$LD -v 2>&1` in
- *GNU\ gold*) supports_anon_versioning=yes ;;
- *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
- *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
- *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
- *\ 2.11.*) ;; # other 2.11 versions
- *) supports_anon_versioning=yes ;;
- esac
-
- # See if GNU ld supports shared libraries.
- case $host_os in
- aix[[3-9]]*)
- # On AIX/PPC, the GNU linker is very broken
- if test "$host_cpu" != ia64; then
- _LT_TAGVAR(ld_shlibs, $1)=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.19, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support. If you
-*** really care for shared libraries, you may want to install binutils
-*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
-*** You will then need to restart the configuration process.
-
-_LT_EOF
- fi
- ;;
-
- amigaos*)
- case $host_cpu in
- powerpc)
- # see comment about AmigaOS4 .so support
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)=''
- ;;
- m68k)
- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- ;;
- esac
- ;;
-
- beos*)
- if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- cygwin* | mingw* | pw32* | cegcc*)
- # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
- # as there is no search path for DLLs.
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_TAGVAR(always_export_symbols, $1)=no
- _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
-
- if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- haiku*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- ;;
-
- interix[[3-9]]*)
- _LT_TAGVAR(hardcode_direct, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
-
- gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
- tmp_diet=no
- if test "$host_os" = linux-dietlibc; then
- case $cc_basename in
- diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
- esac
- fi
- if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
- && test "$tmp_diet" = no
- then
- tmp_addflag=
- tmp_sharedflag='-shared'
- case $cc_basename,$host_cpu in
- pgcc*) # Portland Group C compiler
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag'
- ;;
- pgf77* | pgf90* | pgf95* | pgfortran*)
- # Portland Group f77 and f90 compilers
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag -Mnomain' ;;
- ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
- tmp_addflag=' -i_dynamic' ;;
- efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
- tmp_addflag=' -i_dynamic -nofor_main' ;;
- ifc* | ifort*) # Intel Fortran compiler
- tmp_addflag=' -nofor_main' ;;
- lf95*) # Lahey Fortran 8.1
- _LT_TAGVAR(whole_archive_flag_spec, $1)=
- tmp_sharedflag='--shared' ;;
- xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
- tmp_sharedflag='-qmkshrobj'
- tmp_addflag= ;;
- nvcc*) # Cuda Compiler Driver 2.2
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
- _LT_TAGVAR(compiler_needs_object, $1)=yes
- ;;
- esac
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*) # Sun C 5.9
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
- _LT_TAGVAR(compiler_needs_object, $1)=yes
- tmp_sharedflag='-G' ;;
- *Sun\ F*) # Sun Fortran 8.3
- tmp_sharedflag='-G' ;;
- esac
- _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
- if test "x$supports_anon_versioning" = xyes; then
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
- fi
-
- case $cc_basename in
- xlf* | bgf* | bgxlf* | mpixlf*)
- # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
- _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
- _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
- _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
- if test "x$supports_anon_versioning" = xyes; then
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- echo "local: *; };" >> $output_objdir/$libname.ver~
- $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
- fi
- ;;
- esac
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- netbsd*)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
- wlarc=
- else
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- fi
- ;;
-
- solaris*)
- if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
- _LT_TAGVAR(ld_shlibs, $1)=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
- elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
- case `$LD -v 2>&1` in
- *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
- _LT_TAGVAR(ld_shlibs, $1)=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
-*** reliably create shared libraries on SCO systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
- ;;
- *)
- # For security reasons, it is highly recommended that you always
- # use absolute paths for naming shared libraries, and exclude the
- # DT_RUNPATH tag from executables and libraries. But doing so
- # requires that you compile everything twice, which is a pain.
- if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
-
- sunos4*)
- _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- wlarc=
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- *)
- if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
-
- if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
- runpath_var=
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
- _LT_TAGVAR(export_dynamic_flag_spec, $1)=
- _LT_TAGVAR(whole_archive_flag_spec, $1)=
- fi
- else
- # PORTME fill in a description of your system's linker (not GNU ld)
- case $host_os in
- aix3*)
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_TAGVAR(always_export_symbols, $1)=yes
- _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
- # Note: this linker hardcodes the directories in LIBPATH if there
- # are no directories specified by -L.
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
- # Neither direct hardcoding nor static linking is supported with a
- # broken collect2.
- _LT_TAGVAR(hardcode_direct, $1)=unsupported
- fi
- ;;
-
- aix[[4-9]]*)
- if test "$host_cpu" = ia64; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=""
- else
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- # Also, AIX nm treats weak defined symbols like other global
- # defined symbols, whereas GNU nm marks them as "W".
- if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
- else
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
- fi
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
- for ld_flag in $LDFLAGS; do
- if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
- aix_use_runtimelinking=yes
- break
- fi
- done
- ;;
- esac
-
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
- _LT_TAGVAR(archive_cmds, $1)=''
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
-
- if test "$GCC" = yes; then
- case $host_os in aix4.[[012]]|aix4.[[012]].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" &&
- strings "$collect2name" | $GREP resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- :
- else
- # We have old collect2
- _LT_TAGVAR(hardcode_direct, $1)=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=
- fi
- ;;
- esac
- shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
- fi
- else
- # not using gcc
- if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
- else
- shared_flag='${wl}-bM:SRE'
- fi
- fi
- fi
-
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to export.
- _LT_TAGVAR(always_export_symbols, $1)=yes
- if test "$aix_use_runtimelinking" = yes; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
- # Determine the default libpath from the value encoded in an
- # empty executable.
- _LT_SYS_MODULE_PATH_AIX
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; then
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
- _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
- _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an
- # empty executable.
- _LT_SYS_MODULE_PATH_AIX
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
- if test "$with_gnu_ld" = yes; then
- # We only use this code for GNU lds that support --whole-archive.
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
- else
- # Exported symbols can be pulled into shared objects from archives
- _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
- fi
- _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
- fi
- ;;
-
- amigaos*)
- case $host_cpu in
- powerpc)
- # see comment about AmigaOS4 .so support
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)=''
- ;;
- m68k)
- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- ;;
- esac
- ;;
-
- bsdi[[45]]*)
- _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
- ;;
-
- cygwin* | mingw* | pw32* | cegcc*)
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- # hardcode_libdir_flag_spec is actually meaningless, as there is
- # no search path for DLLs.
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=".dll"
- # FIXME: Setting linknames here is a bad hack.
- _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
- # The linker will automatically build a .lib file if we build a DLL.
- _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
- # FIXME: Should let the user specify the lib program.
- _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
- _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
- _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
- ;;
-
- darwin* | rhapsody*)
- _LT_DARWIN_LINKER_FEATURES($1)
- ;;
-
- dgux*)
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- freebsd1*)
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
- # support. Future versions do this automatically, but an explicit c++rt0.o
- # does not break anything, and helps significantly (at the cost of a little
- # extra space).
- freebsd2.2*)
- _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- # Unfortunately, older versions of FreeBSD 2 do not have this feature.
- freebsd2*)
- _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | dragonfly*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- hpux9*)
- if test "$GCC" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- else
- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- fi
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_TAGVAR(hardcode_direct, $1)=yes
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- ;;
-
- hpux10*)
- if test "$GCC" = yes && test "$with_gnu_ld" = no; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- else
- _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
- fi
- if test "$with_gnu_ld" = no; then
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- fi
- ;;
-
- hpux11*)
- if test "$GCC" = yes && test "$with_gnu_ld" = no; then
- case $host_cpu in
- hppa*64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- else
- case $host_cpu in
- hppa*64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- m4_if($1, [], [
- # Older versions of the 11.00 compiler do not understand -b yet
- # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
- _LT_LINKER_OPTION([if $CC understands -b],
- _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
- [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
- [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
- [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
- ;;
- esac
- fi
- if test "$with_gnu_ld" = no; then
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
- case $host_cpu in
- hppa*64*|ia64*)
- _LT_TAGVAR(hardcode_direct, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
- *)
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- ;;
- esac
- fi
- ;;
-
- irix5* | irix6* | nonstopux*)
- if test "$GCC" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- # Try to use the -exported_symbol ld option, if it does not
- # work, assume that -exports_file does not work either and
- # implicitly export all symbols.
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
- AC_LINK_IFELSE(int foo(void) {},
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
- )
- LDFLAGS="$save_LDFLAGS"
- else
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
- fi
- _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_TAGVAR(inherit_rpath, $1)=yes
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- ;;
-
- netbsd*)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
- else
- _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
- fi
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- newsos6)
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- *nto* | *qnx*)
- ;;
-
- openbsd*)
- if test -f /usr/libexec/ld.so; then
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- else
- case $host_os in
- openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
- _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- ;;
- *)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- ;;
- esac
- fi
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- os2*)
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
- _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
- ;;
-
- osf3*)
- if test "$GCC" = yes; then
- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
- fi
- _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- ;;
-
- osf4* | osf5*) # as osf3* with the addition of -msym flag
- if test "$GCC" = yes; then
- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- else
- _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
- $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
-
- # Both c and cxx compiler support -rpath directly
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
- fi
- _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- ;;
-
- solaris*)
- _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
- if test "$GCC" = yes; then
- wlarc='${wl}'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
- else
- case `$CC -V 2>&1` in
- *"Compilers 5.0"*)
- wlarc=''
- _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
- ;;
- *)
- wlarc='${wl}'
- _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
- ;;
- esac
- fi
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- case $host_os in
- solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
- *)
- # The compiler driver will combine and reorder linker options,
- # but understands `-z linker_flag'. GCC discards it without `$wl',
- # but is careful enough not to reorder.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- if test "$GCC" = yes; then
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
- else
- _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
- fi
- ;;
- esac
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- ;;
-
- sunos4*)
- if test "x$host_vendor" = xsequent; then
- # Use $CC to link under sequent, because it throws in some extra .o
- # files that make .init and .fini sections work.
- _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
- fi
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- sysv4)
- case $host_vendor in
- sni)
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
- ;;
- siemens)
- ## LD is ld it makes a PLAMLIB
- ## CC just makes a GrossModule.
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
- _LT_TAGVAR(hardcode_direct, $1)=no
- ;;
- motorola)
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
- ;;
- esac
- runpath_var='LD_RUN_PATH'
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- sysv4.3*)
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- runpath_var=LD_RUN_PATH
- hardcode_runpath_var=yes
- _LT_TAGVAR(ld_shlibs, $1)=yes
- fi
- ;;
-
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
- _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
- _LT_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We can NOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
- _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
- _LT_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- uts4*)
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- *)
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
-
- if test x$host_vendor = xsni; then
- case $host in
- sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
- ;;
- esac
- fi
- fi
-])
-AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
-test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
-
-_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
-
-_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
-_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
-_LT_DECL([], [extract_expsyms_cmds], [2],
- [The commands to extract the exported symbol list from a shared archive])
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
-x|xyes)
- # Assume -lc should be added
- _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
-
- if test "$enable_shared" = yes && test "$GCC" = yes; then
- case $_LT_TAGVAR(archive_cmds, $1) in
- *'~'*)
- # FIXME: we may have to deal with multi-command sequences.
- ;;
- '$CC '*)
- # Test whether the compiler implicitly links with -lc since on some
- # systems, -lgcc has to come before -lc. If gcc already passes -lc
- # to ld, don't add -lc before -lgcc.
- AC_CACHE_CHECK([whether -lc should be explicitly linked in],
- [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
- [$RM conftest*
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
- soname=conftest
- lib=conftest
- libobjs=conftest.$ac_objext
- deplibs=
- wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
- pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
- compiler_flags=-v
- linker_flags=-v
- verstring=
- output_objdir=.
- libname=conftest
- lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
- _LT_TAGVAR(allow_undefined_flag, $1)=
- if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
- then
- lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
- else
- lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
- fi
- _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
- else
- cat conftest.err 1>&5
- fi
- $RM conftest*
- ])
- _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
- ;;
- esac
- fi
- ;;
-esac
-
-_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
- [Whether or not to add -lc for building shared libraries])
-_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
- [enable_shared_with_static_runtimes], [0],
- [Whether or not to disallow shared libs when runtime libs are static])
-_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
- [Compiler flag to allow reflexive dlopens])
-_LT_TAGDECL([], [whole_archive_flag_spec], [1],
- [Compiler flag to generate shared objects directly from archives])
-_LT_TAGDECL([], [compiler_needs_object], [1],
- [Whether the compiler copes with passing no objects directly])
-_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
- [Create an old-style archive from a shared archive])
-_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
- [Create a temporary old-style archive to link instead of a shared archive])
-_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
-_LT_TAGDECL([], [archive_expsym_cmds], [2])
-_LT_TAGDECL([], [module_cmds], [2],
- [Commands used to build a loadable module if different from building
- a shared archive.])
-_LT_TAGDECL([], [module_expsym_cmds], [2])
-_LT_TAGDECL([], [with_gnu_ld], [1],
- [Whether we are building with GNU ld or not])
-_LT_TAGDECL([], [allow_undefined_flag], [1],
- [Flag that allows shared libraries with undefined symbols to be built])
-_LT_TAGDECL([], [no_undefined_flag], [1],
- [Flag that enforces no undefined symbols])
-_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
- [Flag to hardcode $libdir into a binary during linking.
- This must work even if $libdir does not exist])
-_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
- [[If ld is used when linking, flag to hardcode $libdir into a binary
- during linking. This must work even if $libdir does not exist]])
-_LT_TAGDECL([], [hardcode_libdir_separator], [1],
- [Whether we need a single "-rpath" flag with a separated argument])
-_LT_TAGDECL([], [hardcode_direct], [0],
- [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
- DIR into the resulting binary])
-_LT_TAGDECL([], [hardcode_direct_absolute], [0],
- [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
- DIR into the resulting binary and the resulting library dependency is
- "absolute", i.e impossible to change by setting ${shlibpath_var} if the
- library is relocated])
-_LT_TAGDECL([], [hardcode_minus_L], [0],
- [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
- into the resulting binary])
-_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
- [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
- into the resulting binary])
-_LT_TAGDECL([], [hardcode_automatic], [0],
- [Set to "yes" if building a shared library automatically hardcodes DIR
- into the library and all subsequent libraries and executables linked
- against it])
-_LT_TAGDECL([], [inherit_rpath], [0],
- [Set to yes if linker adds runtime paths of dependent libraries
- to runtime path list])
-_LT_TAGDECL([], [link_all_deplibs], [0],
- [Whether libtool must link a program against all its dependency libraries])
-_LT_TAGDECL([], [fix_srcfile_path], [1],
- [Fix the shell variable $srcfile for the compiler])
-_LT_TAGDECL([], [always_export_symbols], [0],
- [Set to "yes" if exported symbols are required])
-_LT_TAGDECL([], [export_symbols_cmds], [2],
- [The commands to list exported symbols])
-_LT_TAGDECL([], [exclude_expsyms], [1],
- [Symbols that should not be listed in the preloaded symbols])
-_LT_TAGDECL([], [include_expsyms], [1],
- [Symbols that must always be exported])
-_LT_TAGDECL([], [prelink_cmds], [2],
- [Commands necessary for linking programs (against libraries) with templates])
-_LT_TAGDECL([], [file_list_spec], [1],
- [Specify filename containing input files])
-dnl FIXME: Not yet implemented
-dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
-dnl [Compiler flag to generate thread safe objects])
-])# _LT_LINKER_SHLIBS
-
-
-# _LT_LANG_C_CONFIG([TAG])
-# ------------------------
-# Ensure that the configuration variables for a C compiler are suitably
-# defined. These variables are subsequently used by _LT_CONFIG to write
-# the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_C_CONFIG],
-[m4_require([_LT_DECL_EGREP])dnl
-lt_save_CC="$CC"
-AC_LANG_PUSH(C)
-
-# Source file extension for C test sources.
-ac_ext=c
-
-# Object file extension for compiled C test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}'
-
-_LT_TAG_COMPILER
-# Save the default compiler, since it gets overwritten when the other
-# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
-compiler_DEFAULT=$CC
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-## CAVEAT EMPTOR:
-## There is no encapsulation within the following macros, do not change
-## the running order or otherwise move them around unless you know exactly
-## what you are doing...
-if test -n "$compiler"; then
- _LT_COMPILER_NO_RTTI($1)
- _LT_COMPILER_PIC($1)
- _LT_COMPILER_C_O($1)
- _LT_COMPILER_FILE_LOCKS($1)
- _LT_LINKER_SHLIBS($1)
- _LT_SYS_DYNAMIC_LINKER($1)
- _LT_LINKER_HARDCODE_LIBPATH($1)
- LT_SYS_DLOPEN_SELF
- _LT_CMD_STRIPLIB
-
- # Report which library types will actually be built
- AC_MSG_CHECKING([if libtool supports shared libraries])
- AC_MSG_RESULT([$can_build_shared])
-
- AC_MSG_CHECKING([whether to build shared libraries])
- test "$can_build_shared" = "no" && enable_shared=no
-
- # On AIX, shared libraries and static libraries use the same namespace, and
- # are all built from PIC.
- case $host_os in
- aix3*)
- test "$enable_shared" = yes && enable_static=no
- if test -n "$RANLIB"; then
- archive_cmds="$archive_cmds~\$RANLIB \$lib"
- postinstall_cmds='$RANLIB $lib'
- fi
- ;;
-
- aix[[4-9]]*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
- fi
- ;;
- esac
- AC_MSG_RESULT([$enable_shared])
-
- AC_MSG_CHECKING([whether to build static libraries])
- # Make sure either enable_shared or enable_static is yes.
- test "$enable_shared" = yes || enable_static=yes
- AC_MSG_RESULT([$enable_static])
-
- _LT_CONFIG($1)
-fi
-AC_LANG_POP
-CC="$lt_save_CC"
-])# _LT_LANG_C_CONFIG
-
-
-# _LT_LANG_CXX_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for a C++ compiler are suitably
-# defined. These variables are subsequently used by _LT_CONFIG to write
-# the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_CXX_CONFIG],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_EGREP])dnl
-if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
- ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
- (test "X$CXX" != "Xg++"))) ; then
- AC_PROG_CXXCPP
-else
- _lt_caught_CXX_error=yes
-fi
-
-AC_LANG_PUSH(C++)
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_TAGVAR(allow_undefined_flag, $1)=
-_LT_TAGVAR(always_export_symbols, $1)=no
-_LT_TAGVAR(archive_expsym_cmds, $1)=
-_LT_TAGVAR(compiler_needs_object, $1)=no
-_LT_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_TAGVAR(hardcode_direct, $1)=no
-_LT_TAGVAR(hardcode_direct_absolute, $1)=no
-_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
-_LT_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_TAGVAR(hardcode_minus_L, $1)=no
-_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-_LT_TAGVAR(hardcode_automatic, $1)=no
-_LT_TAGVAR(inherit_rpath, $1)=no
-_LT_TAGVAR(module_cmds, $1)=
-_LT_TAGVAR(module_expsym_cmds, $1)=
-_LT_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
-_LT_TAGVAR(no_undefined_flag, $1)=
-_LT_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Source file extension for C++ test sources.
-ac_ext=cpp
-
-# Object file extension for compiled C++ test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# No sense in running all these tests if we already determined that
-# the CXX compiler isn't working. Some variables (like enable_shared)
-# are currently assumed to apply to all compilers on this platform,
-# and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_caught_CXX_error" != yes; then
- # Code to be used in simple compile tests
- lt_simple_compile_test_code="int some_variable = 0;"
-
- # Code to be used in simple link tests
- lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
-
- # ltmain only uses $CC for tagged configurations so make sure $CC is set.
- _LT_TAG_COMPILER
-
- # save warnings/boilerplate of simple test code
- _LT_COMPILER_BOILERPLATE
- _LT_LINKER_BOILERPLATE
-
- # Allow CC to be a program name with arguments.
- lt_save_CC=$CC
- lt_save_LD=$LD
- lt_save_GCC=$GCC
- GCC=$GXX
- lt_save_with_gnu_ld=$with_gnu_ld
- lt_save_path_LD=$lt_cv_path_LD
- if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
- lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
- else
- $as_unset lt_cv_prog_gnu_ld
- fi
- if test -n "${lt_cv_path_LDCXX+set}"; then
- lt_cv_path_LD=$lt_cv_path_LDCXX
- else
- $as_unset lt_cv_path_LD
- fi
- test -z "${LDCXX+set}" || LD=$LDCXX
- CC=${CXX-"c++"}
- compiler=$CC
- _LT_TAGVAR(compiler, $1)=$CC
- _LT_CC_BASENAME([$compiler])
-
- if test -n "$compiler"; then
- # We don't want -fno-exception when compiling C++ code, so set the
- # no_builtin_flag separately
- if test "$GXX" = yes; then
- _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
- else
- _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
- fi
-
- if test "$GXX" = yes; then
- # Set up default GNU C++ configuration
-
- LT_PATH_LD
-
- # Check if GNU C++ uses GNU ld as the underlying linker, since the
- # archiving commands below assume that GNU ld is being used.
- if test "$with_gnu_ld" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-
- # If archive_cmds runs LD, not CC, wlarc should be empty
- # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
- # investigate it a little bit more. (MM)
- wlarc='${wl}'
-
- # ancient GNU ld didn't support --whole-archive et. al.
- if eval "`$CC -print-prog-name=ld` --help 2>&1" |
- $GREP 'no-whole-archive' > /dev/null; then
- _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- _LT_TAGVAR(whole_archive_flag_spec, $1)=
- fi
- else
- with_gnu_ld=no
- wlarc=
-
- # A generic and very simple default shared library creation
- # command for GNU C++ for the case where it uses the native
- # linker, instead of GNU ld. If possible, this setting should
- # overridden to take advantage of the native linker features on
- # the platform it is being used on.
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
- fi
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
-
- else
- GXX=no
- with_gnu_ld=no
- wlarc=
- fi
-
- # PORTME: fill in a description of your system's C++ link characteristics
- AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
- _LT_TAGVAR(ld_shlibs, $1)=yes
- case $host_os in
- aix3*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- aix[[4-9]]*)
- if test "$host_cpu" = ia64; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=""
- else
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
- for ld_flag in $LDFLAGS; do
- case $ld_flag in
- *-brtl*)
- aix_use_runtimelinking=yes
- break
- ;;
- esac
- done
- ;;
- esac
-
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
- _LT_TAGVAR(archive_cmds, $1)=''
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
-
- if test "$GXX" = yes; then
- case $host_os in aix4.[[012]]|aix4.[[012]].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" &&
- strings "$collect2name" | $GREP resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- :
- else
- # We have old collect2
- _LT_TAGVAR(hardcode_direct, $1)=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=
- fi
- esac
- shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
- fi
- else
- # not using gcc
- if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
- else
- shared_flag='${wl}-bM:SRE'
- fi
- fi
- fi
-
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to
- # export.
- _LT_TAGVAR(always_export_symbols, $1)=yes
- if test "$aix_use_runtimelinking" = yes; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
- # Determine the default libpath from the value encoded in an empty
- # executable.
- _LT_SYS_MODULE_PATH_AIX
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; then
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
- _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
- _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an
- # empty executable.
- _LT_SYS_MODULE_PATH_AIX
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
- if test "$with_gnu_ld" = yes; then
- # We only use this code for GNU lds that support --whole-archive.
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
- else
- # Exported symbols can be pulled into shared objects from archives
- _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
- fi
- _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
- # This is similar to how AIX traditionally builds its shared
- # libraries.
- _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
- fi
- ;;
-
- beos*)
- if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- chorus*)
- case $cc_basename in
- *)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
-
- cygwin* | mingw* | pw32* | cegcc*)
- # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
- # as there is no search path for DLLs.
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_TAGVAR(always_export_symbols, $1)=no
- _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-
- if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- darwin* | rhapsody*)
- _LT_DARWIN_LINKER_FEATURES($1)
- ;;
-
- dgux*)
- case $cc_basename in
- ec++*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- ghcx*)
- # Green Hills C++ Compiler
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
-
- freebsd[[12]]*)
- # C++ shared libraries reported to be fairly broken before
- # switch to ELF
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- freebsd-elf*)
- _LT_TAGVAR(archive_cmds_need_lc, $1)=no
- ;;
-
- freebsd* | dragonfly*)
- # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
- # conventions
- _LT_TAGVAR(ld_shlibs, $1)=yes
- ;;
-
- gnu*)
- ;;
-
- haiku*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- ;;
-
- hpux9*)
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
- # but as the default
- # location of the library.
-
- case $cc_basename in
- CC*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- aCC*)
- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
- ;;
- *)
- if test "$GXX" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- else
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
-
- hpux10*|hpux11*)
- if test $with_gnu_ld = no; then
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
- case $host_cpu in
- hppa*64*|ia64*)
- ;;
- *)
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- ;;
- esac
- fi
- case $host_cpu in
- hppa*64*|ia64*)
- _LT_TAGVAR(hardcode_direct, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
- *)
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
- # but as the default
- # location of the library.
- ;;
- esac
-
- case $cc_basename in
- CC*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- aCC*)
- case $host_cpu in
- hppa*64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- ia64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- *)
- _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- esac
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
- ;;
- *)
- if test "$GXX" = yes; then
- if test $with_gnu_ld = no; then
- case $host_cpu in
- hppa*64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- ia64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- *)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- esac
- fi
- else
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
-
- interix[[3-9]]*)
- _LT_TAGVAR(hardcode_direct, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
- irix5* | irix6*)
- case $cc_basename in
- CC*)
- # SGI C++
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-
- # Archives containing C++ object files must be created using
- # "CC -ar", where "CC" is the IRIX C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
- ;;
- *)
- if test "$GXX" = yes; then
- if test "$with_gnu_ld" = no; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
- fi
- fi
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- ;;
- esac
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_TAGVAR(inherit_rpath, $1)=yes
- ;;
-
- linux* | k*bsd*-gnu | kopensolaris*-gnu)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
-
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-
- # Archives containing C++ object files must be created using
- # "CC -Bstatic", where "CC" is the KAI C++ compiler.
- _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
- ;;
- icpc* | ecpc* )
- # Intel C++
- with_gnu_ld=yes
- # version 8.0 and above of icpc choke on multiply defined symbols
- # if we add $predep_objects and $postdep_objects, however 7.1 and
- # earlier do not add the objects themselves.
- case `$CC -V 2>&1` in
- *"Version 7."*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- ;;
- *) # Version 8.0 or newer
- tmp_idyn=
- case $host_cpu in
- ia64*) tmp_idyn=' -i_dynamic';;
- esac
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- ;;
- esac
- _LT_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
- ;;
- pgCC* | pgcpp*)
- # Portland Group C++ compiler
- case `$CC -V` in
- *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
- _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
- rm -rf $tpldir~
- $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
- compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
- _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
- rm -rf $tpldir~
- $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
- $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
- $RANLIB $oldlib'
- _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
- rm -rf $tpldir~
- $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
- $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
- rm -rf $tpldir~
- $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
- $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
- ;;
- *) # Version 6 and above use weak symbols
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
- ;;
- esac
-
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
- ;;
- cxx*)
- # Compaq C++
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
-
- runpath_var=LD_RUN_PATH
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
- ;;
- xl* | mpixl* | bgxl*)
- # IBM XL 8.0 on PPC, with GNU ld
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
- _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- if test "x$supports_anon_versioning" = xyes; then
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
- fi
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C++ 5.9
- _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
- _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
- _LT_TAGVAR(compiler_needs_object, $1)=yes
-
- # Not sure whether something based on
- # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
- # would be better.
- output_verbose_link_cmd='func_echo_all'
-
- # Archives containing C++ object files must be created using
- # "CC -xar", where "CC" is the Sun C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
- ;;
- esac
- ;;
- esac
- ;;
-
- lynxos*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- m88k*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- mvs*)
- case $cc_basename in
- cxx*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
-
- netbsd*)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
- wlarc=
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- fi
- # Workaround some broken pre-1.5 toolchains
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
- ;;
-
- *nto* | *qnx*)
- _LT_TAGVAR(ld_shlibs, $1)=yes
- ;;
-
- openbsd2*)
- # C++ shared libraries are fairly broken
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- openbsd*)
- if test -f /usr/libexec/ld.so; then
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- fi
- output_verbose_link_cmd=func_echo_all
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- osf3* | osf4* | osf5*)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Archives containing C++ object files must be created using
- # the KAI C++ compiler.
- case $host in
- osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
- *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
- esac
- ;;
- RCC*)
- # Rational C++ 2.4.1
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- cxx*)
- case $host in
- osf3*)
- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- ;;
- *)
- _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
- echo "-hidden">> $lib.exp~
- $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
- $RM $lib.exp'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
- ;;
- esac
-
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
- ;;
- *)
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- case $host in
- osf3*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- ;;
- *)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- ;;
- esac
-
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
-
- else
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
-
- psos*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- sunos4*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.x
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- lcc*)
- # Lucid
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
-
- solaris*)
- case $cc_basename in
- CC* | sunCC*)
- # Sun C++ 4.2, 5.x and Centerline C++
- _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
- _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
- _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- case $host_os in
- solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
- *)
- # The compiler driver will combine and reorder linker options,
- # but understands `-z linker_flag'.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
- ;;
- esac
- _LT_TAGVAR(link_all_deplibs, $1)=yes
-
- output_verbose_link_cmd='func_echo_all'
-
- # Archives containing C++ object files must be created using
- # "CC -xar", where "CC" is the Sun C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
- ;;
- gcx*)
- # Green Hills C++ Compiler
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-
- # The C++ compiler must be used to create the archive.
- _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
- ;;
- *)
- # GNU C++ compiler with Solaris linker
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
- if $CC --version | $GREP -v '^2\.7' > /dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
- else
- # g++ 2.7 appears to require `-G' NOT `-shared' on this
- # platform.
- _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
- fi
-
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
- case $host_os in
- solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
- *)
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
- ;;
- esac
- fi
- ;;
- esac
- ;;
-
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
- _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
- _LT_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- runpath_var='LD_RUN_PATH'
-
- case $cc_basename in
- CC*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- ;;
-
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We can NOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
- _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
- _LT_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
- runpath_var='LD_RUN_PATH'
-
- case $cc_basename in
- CC*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
- '"$_LT_TAGVAR(old_archive_cmds, $1)"
- _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
- '"$_LT_TAGVAR(reload_cmds, $1)"
- ;;
- *)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- ;;
-
- tandem*)
- case $cc_basename in
- NCC*)
- # NonStop-UX NCC 3.20
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
-
- vxworks*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- *)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
-
- AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
- test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
-
- _LT_TAGVAR(GCC, $1)="$GXX"
- _LT_TAGVAR(LD, $1)="$LD"
-
- ## CAVEAT EMPTOR:
- ## There is no encapsulation within the following macros, do not change
- ## the running order or otherwise move them around unless you know exactly
- ## what you are doing...
- _LT_SYS_HIDDEN_LIBDEPS($1)
- _LT_COMPILER_PIC($1)
- _LT_COMPILER_C_O($1)
- _LT_COMPILER_FILE_LOCKS($1)
- _LT_LINKER_SHLIBS($1)
- _LT_SYS_DYNAMIC_LINKER($1)
- _LT_LINKER_HARDCODE_LIBPATH($1)
-
- _LT_CONFIG($1)
- fi # test -n "$compiler"
-
- CC=$lt_save_CC
- LDCXX=$LD
- LD=$lt_save_LD
- GCC=$lt_save_GCC
- with_gnu_ld=$lt_save_with_gnu_ld
- lt_cv_path_LDCXX=$lt_cv_path_LD
- lt_cv_path_LD=$lt_save_path_LD
- lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
- lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
-fi # test "$_lt_caught_CXX_error" != yes
-
-AC_LANG_POP
-])# _LT_LANG_CXX_CONFIG
-
-
-# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
-# ---------------------------------
-# Figure out "hidden" library dependencies from verbose
-# compiler output when linking a shared library.
-# Parse the compiler output and extract the necessary
-# objects, libraries and library flags.
-m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-# Dependencies to place before and after the object being linked:
-_LT_TAGVAR(predep_objects, $1)=
-_LT_TAGVAR(postdep_objects, $1)=
-_LT_TAGVAR(predeps, $1)=
-_LT_TAGVAR(postdeps, $1)=
-_LT_TAGVAR(compiler_lib_search_path, $1)=
-
-dnl we can't use the lt_simple_compile_test_code here,
-dnl because it contains code intended for an executable,
-dnl not a library. It's possible we should let each
-dnl tag define a new lt_????_link_test_code variable,
-dnl but it's only used here...
-m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
-int a;
-void foo (void) { a = 0; }
-_LT_EOF
-], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
-class Foo
-{
-public:
- Foo (void) { a = 0; }
-private:
- int a;
-};
-_LT_EOF
-], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
- subroutine foo
- implicit none
- integer*4 a
- a=0
- return
- end
-_LT_EOF
-], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
- subroutine foo
- implicit none
- integer a
- a=0
- return
- end
-_LT_EOF
-], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
-public class foo {
- private int a;
- public void bar (void) {
- a = 0;
- }
-};
-_LT_EOF
-])
-dnl Parse the compiler output and extract the necessary
-dnl objects, libraries and library flags.
-if AC_TRY_EVAL(ac_compile); then
- # Parse the compiler output and extract the necessary
- # objects, libraries and library flags.
-
- # Sentinel used to keep track of whether or not we are before
- # the conftest object file.
- pre_test_object_deps_done=no
-
- for p in `eval "$output_verbose_link_cmd"`; do
- case $p in
-
- -L* | -R* | -l*)
- # Some compilers place space between "-{L,R}" and the path.
- # Remove the space.
- if test $p = "-L" ||
- test $p = "-R"; then
- prev=$p
- continue
- else
- prev=
- fi
-
- if test "$pre_test_object_deps_done" = no; then
- case $p in
- -L* | -R*)
- # Internal compiler library paths should come after those
- # provided the user. The postdeps already come after the
- # user supplied libs so there is no need to process them.
- if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
- _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
- else
- _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
- fi
- ;;
- # The "-l" case would never come before the object being
- # linked, so don't bother handling this case.
- esac
- else
- if test -z "$_LT_TAGVAR(postdeps, $1)"; then
- _LT_TAGVAR(postdeps, $1)="${prev}${p}"
- else
- _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
- fi
- fi
- ;;
-
- *.$objext)
- # This assumes that the test object file only shows up
- # once in the compiler output.
- if test "$p" = "conftest.$objext"; then
- pre_test_object_deps_done=yes
- continue
- fi
-
- if test "$pre_test_object_deps_done" = no; then
- if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
- _LT_TAGVAR(predep_objects, $1)="$p"
- else
- _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
- fi
- else
- if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
- _LT_TAGVAR(postdep_objects, $1)="$p"
- else
- _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
- fi
- fi
- ;;
-
- *) ;; # Ignore the rest.
-
- esac
- done
-
- # Clean up.
- rm -f a.out a.exe
-else
- echo "libtool.m4: error: problem compiling $1 test program"
-fi
-
-$RM -f confest.$objext
-
-# PORTME: override above test on systems where it is broken
-m4_if([$1], [CXX],
-[case $host_os in
-interix[[3-9]]*)
- # Interix 3.5 installs completely hosed .la files for C++, so rather than
- # hack all around it, let's just trust "g++" to DTRT.
- _LT_TAGVAR(predep_objects,$1)=
- _LT_TAGVAR(postdep_objects,$1)=
- _LT_TAGVAR(postdeps,$1)=
- ;;
-
-linux*)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C++ 5.9
-
- # The more standards-conforming stlport4 library is
- # incompatible with the Cstd library. Avoid specifying
- # it if it's in CXXFLAGS. Ignore libCrun as
- # -library=stlport4 depends on it.
- case " $CXX $CXXFLAGS " in
- *" -library=stlport4 "*)
- solaris_use_stlport4=yes
- ;;
- esac
-
- if test "$solaris_use_stlport4" != yes; then
- _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
- fi
- ;;
- esac
- ;;
-
-solaris*)
- case $cc_basename in
- CC* | sunCC*)
- # The more standards-conforming stlport4 library is
- # incompatible with the Cstd library. Avoid specifying
- # it if it's in CXXFLAGS. Ignore libCrun as
- # -library=stlport4 depends on it.
- case " $CXX $CXXFLAGS " in
- *" -library=stlport4 "*)
- solaris_use_stlport4=yes
- ;;
- esac
-
- # Adding this requires a known-good setup of shared libraries for
- # Sun compiler versions before 5.6, else PIC objects from an old
- # archive will be linked into the output, leading to subtle bugs.
- if test "$solaris_use_stlport4" != yes; then
- _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
- fi
- ;;
- esac
- ;;
-esac
-])
-
-case " $_LT_TAGVAR(postdeps, $1) " in
-*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
-esac
- _LT_TAGVAR(compiler_lib_search_dirs, $1)=
-if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
- _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
-fi
-_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
- [The directories searched by this compiler when creating a shared library])
-_LT_TAGDECL([], [predep_objects], [1],
- [Dependencies to place before and after the objects being linked to
- create a shared library])
-_LT_TAGDECL([], [postdep_objects], [1])
-_LT_TAGDECL([], [predeps], [1])
-_LT_TAGDECL([], [postdeps], [1])
-_LT_TAGDECL([], [compiler_lib_search_path], [1],
- [The library search path used internally by the compiler when linking
- a shared library])
-])# _LT_SYS_HIDDEN_LIBDEPS
-
-
-# _LT_LANG_F77_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for a Fortran 77 compiler are
-# suitably defined. These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_F77_CONFIG],
-[AC_LANG_PUSH(Fortran 77)
-if test -z "$F77" || test "X$F77" = "Xno"; then
- _lt_disable_F77=yes
-fi
-
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_TAGVAR(allow_undefined_flag, $1)=
-_LT_TAGVAR(always_export_symbols, $1)=no
-_LT_TAGVAR(archive_expsym_cmds, $1)=
-_LT_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_TAGVAR(hardcode_direct, $1)=no
-_LT_TAGVAR(hardcode_direct_absolute, $1)=no
-_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
-_LT_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_TAGVAR(hardcode_minus_L, $1)=no
-_LT_TAGVAR(hardcode_automatic, $1)=no
-_LT_TAGVAR(inherit_rpath, $1)=no
-_LT_TAGVAR(module_cmds, $1)=
-_LT_TAGVAR(module_expsym_cmds, $1)=
-_LT_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
-_LT_TAGVAR(no_undefined_flag, $1)=
-_LT_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Source file extension for f77 test sources.
-ac_ext=f
-
-# Object file extension for compiled f77 test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# No sense in running all these tests if we already determined that
-# the F77 compiler isn't working. Some variables (like enable_shared)
-# are currently assumed to apply to all compilers on this platform,
-# and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_disable_F77" != yes; then
- # Code to be used in simple compile tests
- lt_simple_compile_test_code="\
- subroutine t
- return
- end
-"
-
- # Code to be used in simple link tests
- lt_simple_link_test_code="\
- program t
- end
-"
-
- # ltmain only uses $CC for tagged configurations so make sure $CC is set.
- _LT_TAG_COMPILER
-
- # save warnings/boilerplate of simple test code
- _LT_COMPILER_BOILERPLATE
- _LT_LINKER_BOILERPLATE
-
- # Allow CC to be a program name with arguments.
- lt_save_CC="$CC"
- lt_save_GCC=$GCC
- CC=${F77-"f77"}
- compiler=$CC
- _LT_TAGVAR(compiler, $1)=$CC
- _LT_CC_BASENAME([$compiler])
- GCC=$G77
- if test -n "$compiler"; then
- AC_MSG_CHECKING([if libtool supports shared libraries])
- AC_MSG_RESULT([$can_build_shared])
-
- AC_MSG_CHECKING([whether to build shared libraries])
- test "$can_build_shared" = "no" && enable_shared=no
-
- # On AIX, shared libraries and static libraries use the same namespace, and
- # are all built from PIC.
- case $host_os in
- aix3*)
- test "$enable_shared" = yes && enable_static=no
- if test -n "$RANLIB"; then
- archive_cmds="$archive_cmds~\$RANLIB \$lib"
- postinstall_cmds='$RANLIB $lib'
- fi
- ;;
- aix[[4-9]]*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
- fi
- ;;
- esac
- AC_MSG_RESULT([$enable_shared])
-
- AC_MSG_CHECKING([whether to build static libraries])
- # Make sure either enable_shared or enable_static is yes.
- test "$enable_shared" = yes || enable_static=yes
- AC_MSG_RESULT([$enable_static])
-
- _LT_TAGVAR(GCC, $1)="$G77"
- _LT_TAGVAR(LD, $1)="$LD"
-
- ## CAVEAT EMPTOR:
- ## There is no encapsulation within the following macros, do not change
- ## the running order or otherwise move them around unless you know exactly
- ## what you are doing...
- _LT_COMPILER_PIC($1)
- _LT_COMPILER_C_O($1)
- _LT_COMPILER_FILE_LOCKS($1)
- _LT_LINKER_SHLIBS($1)
- _LT_SYS_DYNAMIC_LINKER($1)
- _LT_LINKER_HARDCODE_LIBPATH($1)
-
- _LT_CONFIG($1)
- fi # test -n "$compiler"
-
- GCC=$lt_save_GCC
- CC="$lt_save_CC"
-fi # test "$_lt_disable_F77" != yes
-
-AC_LANG_POP
-])# _LT_LANG_F77_CONFIG
-
-
-# _LT_LANG_FC_CONFIG([TAG])
-# -------------------------
-# Ensure that the configuration variables for a Fortran compiler are
-# suitably defined. These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_FC_CONFIG],
-[AC_LANG_PUSH(Fortran)
-
-if test -z "$FC" || test "X$FC" = "Xno"; then
- _lt_disable_FC=yes
-fi
-
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_TAGVAR(allow_undefined_flag, $1)=
-_LT_TAGVAR(always_export_symbols, $1)=no
-_LT_TAGVAR(archive_expsym_cmds, $1)=
-_LT_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_TAGVAR(hardcode_direct, $1)=no
-_LT_TAGVAR(hardcode_direct_absolute, $1)=no
-_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
-_LT_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_TAGVAR(hardcode_minus_L, $1)=no
-_LT_TAGVAR(hardcode_automatic, $1)=no
-_LT_TAGVAR(inherit_rpath, $1)=no
-_LT_TAGVAR(module_cmds, $1)=
-_LT_TAGVAR(module_expsym_cmds, $1)=
-_LT_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
-_LT_TAGVAR(no_undefined_flag, $1)=
-_LT_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Source file extension for fc test sources.
-ac_ext=${ac_fc_srcext-f}
-
-# Object file extension for compiled fc test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# No sense in running all these tests if we already determined that
-# the FC compiler isn't working. Some variables (like enable_shared)
-# are currently assumed to apply to all compilers on this platform,
-# and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_disable_FC" != yes; then
- # Code to be used in simple compile tests
- lt_simple_compile_test_code="\
- subroutine t
- return
- end
-"
-
- # Code to be used in simple link tests
- lt_simple_link_test_code="\
- program t
- end
-"
-
- # ltmain only uses $CC for tagged configurations so make sure $CC is set.
- _LT_TAG_COMPILER
-
- # save warnings/boilerplate of simple test code
- _LT_COMPILER_BOILERPLATE
- _LT_LINKER_BOILERPLATE
-
- # Allow CC to be a program name with arguments.
- lt_save_CC="$CC"
- lt_save_GCC=$GCC
- CC=${FC-"f95"}
- compiler=$CC
- GCC=$ac_cv_fc_compiler_gnu
-
- _LT_TAGVAR(compiler, $1)=$CC
- _LT_CC_BASENAME([$compiler])
-
- if test -n "$compiler"; then
- AC_MSG_CHECKING([if libtool supports shared libraries])
- AC_MSG_RESULT([$can_build_shared])
-
- AC_MSG_CHECKING([whether to build shared libraries])
- test "$can_build_shared" = "no" && enable_shared=no
-
- # On AIX, shared libraries and static libraries use the same namespace, and
- # are all built from PIC.
- case $host_os in
- aix3*)
- test "$enable_shared" = yes && enable_static=no
- if test -n "$RANLIB"; then
- archive_cmds="$archive_cmds~\$RANLIB \$lib"
- postinstall_cmds='$RANLIB $lib'
- fi
- ;;
- aix[[4-9]]*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
- fi
- ;;
- esac
- AC_MSG_RESULT([$enable_shared])
-
- AC_MSG_CHECKING([whether to build static libraries])
- # Make sure either enable_shared or enable_static is yes.
- test "$enable_shared" = yes || enable_static=yes
- AC_MSG_RESULT([$enable_static])
-
- _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
- _LT_TAGVAR(LD, $1)="$LD"
-
- ## CAVEAT EMPTOR:
- ## There is no encapsulation within the following macros, do not change
- ## the running order or otherwise move them around unless you know exactly
- ## what you are doing...
- _LT_SYS_HIDDEN_LIBDEPS($1)
- _LT_COMPILER_PIC($1)
- _LT_COMPILER_C_O($1)
- _LT_COMPILER_FILE_LOCKS($1)
- _LT_LINKER_SHLIBS($1)
- _LT_SYS_DYNAMIC_LINKER($1)
- _LT_LINKER_HARDCODE_LIBPATH($1)
-
- _LT_CONFIG($1)
- fi # test -n "$compiler"
-
- GCC=$lt_save_GCC
- CC="$lt_save_CC"
-fi # test "$_lt_disable_FC" != yes
-
-AC_LANG_POP
-])# _LT_LANG_FC_CONFIG
-
-
-# _LT_LANG_GCJ_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for the GNU Java Compiler compiler
-# are suitably defined. These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_GCJ_CONFIG],
-[AC_REQUIRE([LT_PROG_GCJ])dnl
-AC_LANG_SAVE
-
-# Source file extension for Java test sources.
-ac_ext=java
-
-# Object file extension for compiled Java test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_TAG_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-lt_save_GCC=$GCC
-GCC=yes
-CC=${GCJ-"gcj"}
-compiler=$CC
-_LT_TAGVAR(compiler, $1)=$CC
-_LT_TAGVAR(LD, $1)="$LD"
-_LT_CC_BASENAME([$compiler])
-
-# GCJ did not exist at the time GCC didn't implicitly link libc in.
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
-
-## CAVEAT EMPTOR:
-## There is no encapsulation within the following macros, do not change
-## the running order or otherwise move them around unless you know exactly
-## what you are doing...
-if test -n "$compiler"; then
- _LT_COMPILER_NO_RTTI($1)
- _LT_COMPILER_PIC($1)
- _LT_COMPILER_C_O($1)
- _LT_COMPILER_FILE_LOCKS($1)
- _LT_LINKER_SHLIBS($1)
- _LT_LINKER_HARDCODE_LIBPATH($1)
-
- _LT_CONFIG($1)
-fi
-
-AC_LANG_RESTORE
-
-GCC=$lt_save_GCC
-CC="$lt_save_CC"
-])# _LT_LANG_GCJ_CONFIG
-
-
-# _LT_LANG_RC_CONFIG([TAG])
-# -------------------------
-# Ensure that the configuration variables for the Windows resource compiler
-# are suitably defined. These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_RC_CONFIG],
-[AC_REQUIRE([LT_PROG_RC])dnl
-AC_LANG_SAVE
-
-# Source file extension for RC test sources.
-ac_ext=rc
-
-# Object file extension for compiled RC test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
-
-# Code to be used in simple link tests
-lt_simple_link_test_code="$lt_simple_compile_test_code"
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_TAG_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-lt_save_GCC=$GCC
-GCC=
-CC=${RC-"windres"}
-compiler=$CC
-_LT_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
-
-if test -n "$compiler"; then
- :
- _LT_CONFIG($1)
-fi
-
-GCC=$lt_save_GCC
-AC_LANG_RESTORE
-CC="$lt_save_CC"
-])# _LT_LANG_RC_CONFIG
-
-
-# LT_PROG_GCJ
-# -----------
-AC_DEFUN([LT_PROG_GCJ],
-[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
- [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
- [AC_CHECK_TOOL(GCJ, gcj,)
- test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
- AC_SUBST(GCJFLAGS)])])[]dnl
-])
-
-# Old name:
-AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
-
-
-# LT_PROG_RC
-# ----------
-AC_DEFUN([LT_PROG_RC],
-[AC_CHECK_TOOL(RC, windres,)
-])
-
-# Old name:
-AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([LT_AC_PROG_RC], [])
-
-
-# _LT_DECL_EGREP
-# --------------
-# If we don't have a new enough Autoconf to choose the best grep
-# available, choose the one first in the user's PATH.
-m4_defun([_LT_DECL_EGREP],
-[AC_REQUIRE([AC_PROG_EGREP])dnl
-AC_REQUIRE([AC_PROG_FGREP])dnl
-test -z "$GREP" && GREP=grep
-_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
-_LT_DECL([], [EGREP], [1], [An ERE matcher])
-_LT_DECL([], [FGREP], [1], [A literal string matcher])
-dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
-AC_SUBST([GREP])
-])
-
-
-# _LT_DECL_OBJDUMP
-# --------------
-# If we don't have a new enough Autoconf to choose the best objdump
-# available, choose the one first in the user's PATH.
-m4_defun([_LT_DECL_OBJDUMP],
-[AC_CHECK_TOOL(OBJDUMP, objdump, false)
-test -z "$OBJDUMP" && OBJDUMP=objdump
-_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
-AC_SUBST([OBJDUMP])
-])
-
-
-# _LT_DECL_SED
-# ------------
-# Check for a fully-functional sed program, that truncates
-# as few characters as possible. Prefer GNU sed if found.
-m4_defun([_LT_DECL_SED],
-[AC_PROG_SED
-test -z "$SED" && SED=sed
-Xsed="$SED -e 1s/^X//"
-_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
-_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
- [Sed that helps us avoid accidentally triggering echo(1) options like -n])
-])# _LT_DECL_SED
-
-m4_ifndef([AC_PROG_SED], [
-############################################################
-# NOTE: This macro has been submitted for inclusion into #
-# GNU Autoconf as AC_PROG_SED. When it is available in #
-# a released version of Autoconf we should remove this #
-# macro and use it instead. #
-############################################################
-
-m4_defun([AC_PROG_SED],
-[AC_MSG_CHECKING([for a sed that does not truncate output])
-AC_CACHE_VAL(lt_cv_path_SED,
-[# Loop through the user's path and test for sed and gsed.
-# Then use that list of sed's as ones to test for truncation.
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for lt_ac_prog in sed gsed; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
- lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
- fi
- done
- done
-done
-IFS=$as_save_IFS
-lt_ac_max=0
-lt_ac_count=0
-# Add /usr/xpg4/bin/sed as it is typically found on Solaris
-# along with /bin/sed that truncates output.
-for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
- test ! -f $lt_ac_sed && continue
- cat /dev/null > conftest.in
- lt_ac_count=0
- echo $ECHO_N "0123456789$ECHO_C" >conftest.in
- # Check for GNU sed and select it if it is found.
- if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
- lt_cv_path_SED=$lt_ac_sed
- break
- fi
- while true; do
- cat conftest.in conftest.in >conftest.tmp
- mv conftest.tmp conftest.in
- cp conftest.in conftest.nl
- echo >>conftest.nl
- $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
- cmp -s conftest.out conftest.nl || break
- # 10000 chars as input seems more than enough
- test $lt_ac_count -gt 10 && break
- lt_ac_count=`expr $lt_ac_count + 1`
- if test $lt_ac_count -gt $lt_ac_max; then
- lt_ac_max=$lt_ac_count
- lt_cv_path_SED=$lt_ac_sed
- fi
- done
-done
-])
-SED=$lt_cv_path_SED
-AC_SUBST([SED])
-AC_MSG_RESULT([$SED])
-])#AC_PROG_SED
-])#m4_ifndef
-
-# Old name:
-AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([LT_AC_PROG_SED], [])
-
-
-# _LT_CHECK_SHELL_FEATURES
-# ------------------------
-# Find out whether the shell is Bourne or XSI compatible,
-# or has some other useful features.
-m4_defun([_LT_CHECK_SHELL_FEATURES],
-[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
-# Try some XSI features
-xsi_shell=no
-( _lt_dummy="a/b/c"
- test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
- = c,a/b,, \
- && eval 'test $(( 1 + 1 )) -eq 2 \
- && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
- && xsi_shell=yes
-AC_MSG_RESULT([$xsi_shell])
-_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
-
-AC_MSG_CHECKING([whether the shell understands "+="])
-lt_shell_append=no
-( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
- >/dev/null 2>&1 \
- && lt_shell_append=yes
-AC_MSG_RESULT([$lt_shell_append])
-_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
-
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- lt_unset=unset
-else
- lt_unset=false
-fi
-_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
-
-# test EBCDIC or ASCII
-case `echo X|tr X '\101'` in
- A) # ASCII based system
- # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
- lt_SP2NL='tr \040 \012'
- lt_NL2SP='tr \015\012 \040\040'
- ;;
- *) # EBCDIC based system
- lt_SP2NL='tr \100 \n'
- lt_NL2SP='tr \r\n \100\100'
- ;;
-esac
-_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
-_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
-])# _LT_CHECK_SHELL_FEATURES
-
-
-# _LT_PROG_XSI_SHELLFNS
-# ---------------------
-# Bourne and XSI compatible variants of some useful shell functions.
-m4_defun([_LT_PROG_XSI_SHELLFNS],
-[case $xsi_shell in
- yes)
- cat << \_LT_EOF >> "$cfgfile"
-
-# func_dirname file append nondir_replacement
-# Compute the dirname of FILE. If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-func_dirname ()
-{
- case ${1} in
- */*) func_dirname_result="${1%/*}${2}" ;;
- * ) func_dirname_result="${3}" ;;
- esac
-}
-
-# func_basename file
-func_basename ()
-{
- func_basename_result="${1##*/}"
-}
-
-# func_dirname_and_basename file append nondir_replacement
-# perform func_basename and func_dirname in a single function
-# call:
-# dirname: Compute the dirname of FILE. If nonempty,
-# add APPEND to the result, otherwise set result
-# to NONDIR_REPLACEMENT.
-# value returned in "$func_dirname_result"
-# basename: Compute filename of FILE.
-# value retuned in "$func_basename_result"
-# Implementation must be kept synchronized with func_dirname
-# and func_basename. For efficiency, we do not delegate to
-# those functions but instead duplicate the functionality here.
-func_dirname_and_basename ()
-{
- case ${1} in
- */*) func_dirname_result="${1%/*}${2}" ;;
- * ) func_dirname_result="${3}" ;;
- esac
- func_basename_result="${1##*/}"
-}
-
-# func_stripname prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-func_stripname ()
-{
- # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
- # positional parameters, so assign one to ordinary parameter first.
- func_stripname_result=${3}
- func_stripname_result=${func_stripname_result#"${1}"}
- func_stripname_result=${func_stripname_result%"${2}"}
-}
-
-# func_opt_split
-func_opt_split ()
-{
- func_opt_split_opt=${1%%=*}
- func_opt_split_arg=${1#*=}
-}
-
-# func_lo2o object
-func_lo2o ()
-{
- case ${1} in
- *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
- *) func_lo2o_result=${1} ;;
- esac
-}
-
-# func_xform libobj-or-source
-func_xform ()
-{
- func_xform_result=${1%.*}.lo
-}
-
-# func_arith arithmetic-term...
-func_arith ()
-{
- func_arith_result=$(( $[*] ))
-}
-
-# func_len string
-# STRING may not start with a hyphen.
-func_len ()
-{
- func_len_result=${#1}
-}
-
-_LT_EOF
- ;;
- *) # Bourne compatible functions.
- cat << \_LT_EOF >> "$cfgfile"
-
-# func_dirname file append nondir_replacement
-# Compute the dirname of FILE. If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-func_dirname ()
-{
- # Extract subdirectory from the argument.
- func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
- if test "X$func_dirname_result" = "X${1}"; then
- func_dirname_result="${3}"
- else
- func_dirname_result="$func_dirname_result${2}"
- fi
-}
-
-# func_basename file
-func_basename ()
-{
- func_basename_result=`$ECHO "${1}" | $SED "$basename"`
-}
-
-dnl func_dirname_and_basename
-dnl A portable version of this function is already defined in general.m4sh
-dnl so there is no need for it here.
-
-# func_stripname prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-# func_strip_suffix prefix name
-func_stripname ()
-{
- case ${2} in
- .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
- *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
- esac
-}
-
-# sed scripts:
-my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
-my_sed_long_arg='1s/^-[[^=]]*=//'
-
-# func_opt_split
-func_opt_split ()
-{
- func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
- func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
-}
-
-# func_lo2o object
-func_lo2o ()
-{
- func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
-}
-
-# func_xform libobj-or-source
-func_xform ()
-{
- func_xform_result=`$ECHO "${1}" | $SED 's/\.[[^.]]*$/.lo/'`
-}
-
-# func_arith arithmetic-term...
-func_arith ()
-{
- func_arith_result=`expr "$[@]"`
-}
-
-# func_len string
-# STRING may not start with a hyphen.
-func_len ()
-{
- func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`
-}
-
-_LT_EOF
-esac
-
-case $lt_shell_append in
- yes)
- cat << \_LT_EOF >> "$cfgfile"
-
-# func_append var value
-# Append VALUE to the end of shell variable VAR.
-func_append ()
-{
- eval "$[1]+=\$[2]"
-}
-_LT_EOF
- ;;
- *)
- cat << \_LT_EOF >> "$cfgfile"
-
-# func_append var value
-# Append VALUE to the end of shell variable VAR.
-func_append ()
-{
- eval "$[1]=\$$[1]\$[2]"
-}
-
-_LT_EOF
- ;;
- esac
-])
diff --git a/libbash-0.1/m4/ltoptions.m4 b/libbash-0.1/m4/ltoptions.m4
deleted file mode 100644
index 17cfd51..0000000
--- a/libbash-0.1/m4/ltoptions.m4
+++ /dev/null
@@ -1,369 +0,0 @@
-# Helper functions for option handling. -*- Autoconf -*-
-#
-# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
-# Inc.
-# Written by Gary V. Vaughan, 2004
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-# serial 7 ltoptions.m4
-
-# This is to help aclocal find these macros, as it can't see m4_define.
-AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
-
-
-# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
-# ------------------------------------------
-m4_define([_LT_MANGLE_OPTION],
-[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
-
-
-# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
-# ---------------------------------------
-# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
-# matching handler defined, dispatch to it. Other OPTION-NAMEs are
-# saved as a flag.
-m4_define([_LT_SET_OPTION],
-[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
-m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
- _LT_MANGLE_DEFUN([$1], [$2]),
- [m4_warning([Unknown $1 option `$2'])])[]dnl
-])
-
-
-# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
-# ------------------------------------------------------------
-# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
-m4_define([_LT_IF_OPTION],
-[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
-
-
-# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
-# -------------------------------------------------------
-# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
-# are set.
-m4_define([_LT_UNLESS_OPTIONS],
-[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
- [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
- [m4_define([$0_found])])])[]dnl
-m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
-])[]dnl
-])
-
-
-# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
-# ----------------------------------------
-# OPTION-LIST is a space-separated list of Libtool options associated
-# with MACRO-NAME. If any OPTION has a matching handler declared with
-# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
-# the unknown option and exit.
-m4_defun([_LT_SET_OPTIONS],
-[# Set options
-m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
- [_LT_SET_OPTION([$1], _LT_Option)])
-
-m4_if([$1],[LT_INIT],[
- dnl
- dnl Simply set some default values (i.e off) if boolean options were not
- dnl specified:
- _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
- ])
- _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
- ])
- dnl
- dnl If no reference was made to various pairs of opposing options, then
- dnl we run the default mode handler for the pair. For example, if neither
- dnl `shared' nor `disable-shared' was passed, we enable building of shared
- dnl archives by default:
- _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
- _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
- _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
- _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
- [_LT_ENABLE_FAST_INSTALL])
- ])
-])# _LT_SET_OPTIONS
-
-
-## --------------------------------- ##
-## Macros to handle LT_INIT options. ##
-## --------------------------------- ##
-
-# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
-# -----------------------------------------
-m4_define([_LT_MANGLE_DEFUN],
-[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
-
-
-# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
-# -----------------------------------------------
-m4_define([LT_OPTION_DEFINE],
-[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
-])# LT_OPTION_DEFINE
-
-
-# dlopen
-# ------
-LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
-])
-
-AU_DEFUN([AC_LIBTOOL_DLOPEN],
-[_LT_SET_OPTION([LT_INIT], [dlopen])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `dlopen' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
-
-
-# win32-dll
-# ---------
-# Declare package support for building win32 dll's.
-LT_OPTION_DEFINE([LT_INIT], [win32-dll],
-[enable_win32_dll=yes
-
-case $host in
-*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
- AC_CHECK_TOOL(AS, as, false)
- AC_CHECK_TOOL(DLLTOOL, dlltool, false)
- AC_CHECK_TOOL(OBJDUMP, objdump, false)
- ;;
-esac
-
-test -z "$AS" && AS=as
-_LT_DECL([], [AS], [1], [Assembler program])dnl
-
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
-
-test -z "$OBJDUMP" && OBJDUMP=objdump
-_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
-])# win32-dll
-
-AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-_LT_SET_OPTION([LT_INIT], [win32-dll])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `win32-dll' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
-
-
-# _LT_ENABLE_SHARED([DEFAULT])
-# ----------------------------
-# implement the --enable-shared flag, and supports the `shared' and
-# `disable-shared' LT_INIT options.
-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
-m4_define([_LT_ENABLE_SHARED],
-[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
-AC_ARG_ENABLE([shared],
- [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
- [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
- [p=${PACKAGE-default}
- case $enableval in
- yes) enable_shared=yes ;;
- no) enable_shared=no ;;
- *)
- enable_shared=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_shared=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac],
- [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
-
- _LT_DECL([build_libtool_libs], [enable_shared], [0],
- [Whether or not to build shared libraries])
-])# _LT_ENABLE_SHARED
-
-LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
-LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
-
-# Old names:
-AC_DEFUN([AC_ENABLE_SHARED],
-[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
-])
-
-AC_DEFUN([AC_DISABLE_SHARED],
-[_LT_SET_OPTION([LT_INIT], [disable-shared])
-])
-
-AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
-AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_ENABLE_SHARED], [])
-dnl AC_DEFUN([AM_DISABLE_SHARED], [])
-
-
-
-# _LT_ENABLE_STATIC([DEFAULT])
-# ----------------------------
-# implement the --enable-static flag, and support the `static' and
-# `disable-static' LT_INIT options.
-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
-m4_define([_LT_ENABLE_STATIC],
-[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
-AC_ARG_ENABLE([static],
- [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
- [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
- [p=${PACKAGE-default}
- case $enableval in
- yes) enable_static=yes ;;
- no) enable_static=no ;;
- *)
- enable_static=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_static=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac],
- [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
-
- _LT_DECL([build_old_libs], [enable_static], [0],
- [Whether or not to build static libraries])
-])# _LT_ENABLE_STATIC
-
-LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
-LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
-
-# Old names:
-AC_DEFUN([AC_ENABLE_STATIC],
-[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
-])
-
-AC_DEFUN([AC_DISABLE_STATIC],
-[_LT_SET_OPTION([LT_INIT], [disable-static])
-])
-
-AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
-AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_ENABLE_STATIC], [])
-dnl AC_DEFUN([AM_DISABLE_STATIC], [])
-
-
-
-# _LT_ENABLE_FAST_INSTALL([DEFAULT])
-# ----------------------------------
-# implement the --enable-fast-install flag, and support the `fast-install'
-# and `disable-fast-install' LT_INIT options.
-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
-m4_define([_LT_ENABLE_FAST_INSTALL],
-[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
-AC_ARG_ENABLE([fast-install],
- [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
- [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
- [p=${PACKAGE-default}
- case $enableval in
- yes) enable_fast_install=yes ;;
- no) enable_fast_install=no ;;
- *)
- enable_fast_install=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_fast_install=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac],
- [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
-
-_LT_DECL([fast_install], [enable_fast_install], [0],
- [Whether or not to optimize for fast installation])dnl
-])# _LT_ENABLE_FAST_INSTALL
-
-LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
-LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
-
-# Old names:
-AU_DEFUN([AC_ENABLE_FAST_INSTALL],
-[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you put
-the `fast-install' option into LT_INIT's first parameter.])
-])
-
-AU_DEFUN([AC_DISABLE_FAST_INSTALL],
-[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you put
-the `disable-fast-install' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
-dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
-
-
-# _LT_WITH_PIC([MODE])
-# --------------------
-# implement the --with-pic flag, and support the `pic-only' and `no-pic'
-# LT_INIT options.
-# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
-m4_define([_LT_WITH_PIC],
-[AC_ARG_WITH([pic],
- [AS_HELP_STRING([--with-pic],
- [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
- [pic_mode="$withval"],
- [pic_mode=default])
-
-test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
-
-_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
-])# _LT_WITH_PIC
-
-LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
-LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
-
-# Old name:
-AU_DEFUN([AC_LIBTOOL_PICMODE],
-[_LT_SET_OPTION([LT_INIT], [pic-only])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `pic-only' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
-
-## ----------------- ##
-## LTDL_INIT Options ##
-## ----------------- ##
-
-m4_define([_LTDL_MODE], [])
-LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
- [m4_define([_LTDL_MODE], [nonrecursive])])
-LT_OPTION_DEFINE([LTDL_INIT], [recursive],
- [m4_define([_LTDL_MODE], [recursive])])
-LT_OPTION_DEFINE([LTDL_INIT], [subproject],
- [m4_define([_LTDL_MODE], [subproject])])
-
-m4_define([_LTDL_TYPE], [])
-LT_OPTION_DEFINE([LTDL_INIT], [installable],
- [m4_define([_LTDL_TYPE], [installable])])
-LT_OPTION_DEFINE([LTDL_INIT], [convenience],
- [m4_define([_LTDL_TYPE], [convenience])])
diff --git a/libbash-0.1/m4/ltsugar.m4 b/libbash-0.1/m4/ltsugar.m4
deleted file mode 100644
index 9000a05..0000000
--- a/libbash-0.1/m4/ltsugar.m4
+++ /dev/null
@@ -1,123 +0,0 @@
-# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
-#
-# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
-# Written by Gary V. Vaughan, 2004
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-# serial 6 ltsugar.m4
-
-# This is to help aclocal find these macros, as it can't see m4_define.
-AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
-
-
-# lt_join(SEP, ARG1, [ARG2...])
-# -----------------------------
-# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
-# associated separator.
-# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
-# versions in m4sugar had bugs.
-m4_define([lt_join],
-[m4_if([$#], [1], [],
- [$#], [2], [[$2]],
- [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
-m4_define([_lt_join],
-[m4_if([$#$2], [2], [],
- [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
-
-
-# lt_car(LIST)
-# lt_cdr(LIST)
-# ------------
-# Manipulate m4 lists.
-# These macros are necessary as long as will still need to support
-# Autoconf-2.59 which quotes differently.
-m4_define([lt_car], [[$1]])
-m4_define([lt_cdr],
-[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
- [$#], 1, [],
- [m4_dquote(m4_shift($@))])])
-m4_define([lt_unquote], $1)
-
-
-# lt_append(MACRO-NAME, STRING, [SEPARATOR])
-# ------------------------------------------
-# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
-# Note that neither SEPARATOR nor STRING are expanded; they are appended
-# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
-# No SEPARATOR is output if MACRO-NAME was previously undefined (different
-# than defined and empty).
-#
-# This macro is needed until we can rely on Autoconf 2.62, since earlier
-# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
-m4_define([lt_append],
-[m4_define([$1],
- m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
-
-
-
-# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
-# ----------------------------------------------------------
-# Produce a SEP delimited list of all paired combinations of elements of
-# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
-# has the form PREFIXmINFIXSUFFIXn.
-# Needed until we can rely on m4_combine added in Autoconf 2.62.
-m4_define([lt_combine],
-[m4_if(m4_eval([$# > 3]), [1],
- [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
-[[m4_foreach([_Lt_prefix], [$2],
- [m4_foreach([_Lt_suffix],
- ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
- [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
-
-
-# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
-# -----------------------------------------------------------------------
-# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
-# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
-m4_define([lt_if_append_uniq],
-[m4_ifdef([$1],
- [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
- [lt_append([$1], [$2], [$3])$4],
- [$5])],
- [lt_append([$1], [$2], [$3])$4])])
-
-
-# lt_dict_add(DICT, KEY, VALUE)
-# -----------------------------
-m4_define([lt_dict_add],
-[m4_define([$1($2)], [$3])])
-
-
-# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
-# --------------------------------------------
-m4_define([lt_dict_add_subkey],
-[m4_define([$1($2:$3)], [$4])])
-
-
-# lt_dict_fetch(DICT, KEY, [SUBKEY])
-# ----------------------------------
-m4_define([lt_dict_fetch],
-[m4_ifval([$3],
- m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
- m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
-
-
-# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
-# -----------------------------------------------------------------
-m4_define([lt_if_dict_fetch],
-[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
- [$5],
- [$6])])
-
-
-# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
-# --------------------------------------------------------------
-m4_define([lt_dict_filter],
-[m4_if([$5], [], [],
- [lt_join(m4_quote(m4_default([$4], [[, ]])),
- lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
- [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
-])
diff --git a/libbash-0.1/m4/ltversion.m4 b/libbash-0.1/m4/ltversion.m4
deleted file mode 100644
index 93fc771..0000000
--- a/libbash-0.1/m4/ltversion.m4
+++ /dev/null
@@ -1,23 +0,0 @@
-# ltversion.m4 -- version numbers -*- Autoconf -*-
-#
-# Copyright (C) 2004 Free Software Foundation, Inc.
-# Written by Scott James Remnant, 2004
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-# Generated from ltversion.in.
-
-# serial 3175 ltversion.m4
-# This file is part of GNU Libtool
-
-m4_define([LT_PACKAGE_VERSION], [2.2.10])
-m4_define([LT_PACKAGE_REVISION], [1.3175])
-
-AC_DEFUN([LTVERSION_VERSION],
-[macro_version='2.2.10'
-macro_revision='1.3175'
-_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
-_LT_DECL(, macro_revision, 0)
-])
diff --git a/libbash-0.1/m4/lt~obsolete.m4 b/libbash-0.1/m4/lt~obsolete.m4
deleted file mode 100644
index c573da9..0000000
--- a/libbash-0.1/m4/lt~obsolete.m4
+++ /dev/null
@@ -1,98 +0,0 @@
-# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
-#
-# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
-# Written by Scott James Remnant, 2004.
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-# serial 5 lt~obsolete.m4
-
-# These exist entirely to fool aclocal when bootstrapping libtool.
-#
-# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
-# which have later been changed to m4_define as they aren't part of the
-# exported API, or moved to Autoconf or Automake where they belong.
-#
-# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
-# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
-# using a macro with the same name in our local m4/libtool.m4 it'll
-# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
-# and doesn't know about Autoconf macros at all.)
-#
-# So we provide this file, which has a silly filename so it's always
-# included after everything else. This provides aclocal with the
-# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
-# because those macros already exist, or will be overwritten later.
-# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
-#
-# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
-# Yes, that means every name once taken will need to remain here until
-# we give up compatibility with versions before 1.7, at which point
-# we need to keep only those names which we still refer to.
-
-# This is to help aclocal find these macros, as it can't see m4_define.
-AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
-
-m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
-m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
-m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
-m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
-m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
-m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
-m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
-m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
-m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
-m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
-m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
-m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
-m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
-m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
-m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
-m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
-m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
-m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
-m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
-m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
-m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
-m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
-m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
-m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
-m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
-m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
-m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
-m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
-m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
-m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
-m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
-m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
-m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
-m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
-m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
-m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
-m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
-m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
-m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
-m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
-m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
-m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
-m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
-m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
-m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
-m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
-m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
-m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
-m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
-m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
-m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
-m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
-m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
-m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
-m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
-m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
-m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
diff --git a/libbash-0.1/scripts/arithmetic_assignment.bash b/libbash-0.1/scripts/arithmetic_assignment.bash
deleted file mode 100644
index d8b1fe4..0000000
--- a/libbash-0.1/scripts/arithmetic_assignment.bash
+++ /dev/null
@@ -1,24 +0,0 @@
-value="$((100))"
-FOO001="$((value*=10))"
-FOO002="$((value/=10))"
-FOO003="$((value%=9))"
-FOO004="$((value+=10))"
-FOO005="$((value-=10))"
-FOO006="$((value<<=2))"
-FOO007="$((value>>=2))"
-FOO008="$((value&=10))"
-FOO009="$((value^=5))"
-FOO010="$((value|=10))"
-FOO011=("CREATED" 2)
-FOO012="$((${FOO011[0]}=10))"
-FOO013="$((3!=5))"
-value=100
-let "value=${value}"
-a=c
-b=d
-c=1
-d=2
-e="1+2"
-echo $(($a + $b))
-echo $(($a + $e))
-
diff --git a/libbash-0.1/scripts/arithmetic_assignment.bash.result b/libbash-0.1/scripts/arithmetic_assignment.bash.result
deleted file mode 100644
index dd8a219..0000000
--- a/libbash-0.1/scripts/arithmetic_assignment.bash.result
+++ /dev/null
@@ -1,22 +0,0 @@
-3
-4
-CREATED=10
-FOO001=1000
-FOO002=100
-FOO003=1
-FOO004=11
-FOO005=1
-FOO006=4
-FOO007=1
-FOO008=0
-FOO009=5
-FOO010=15
-FOO011=CREATED 2
-FOO012=10
-FOO013=1
-a=c
-b=d
-c=1
-d=2
-e=1+2
-value=100
diff --git a/libbash-0.1/scripts/bar.eclass b/libbash-0.1/scripts/bar.eclass
deleted file mode 100644
index 1e46230..0000000
--- a/libbash-0.1/scripts/bar.eclass
+++ /dev/null
@@ -1,5 +0,0 @@
-IUSE="abc def"
-REQUIRED_USE="abc"
-DEPEND="dev-util/pkgconfig"
-RDEPEND="foo/bar"
-PDEPEND="foo/bar"
diff --git a/libbash-0.1/scripts/binary_arithmetic.bash b/libbash-0.1/scripts/binary_arithmetic.bash
deleted file mode 100644
index 577ddbc..0000000
--- a/libbash-0.1/scripts/binary_arithmetic.bash
+++ /dev/null
@@ -1,67 +0,0 @@
-ARRAY=(1 2 3 4 5)
-FOO001="$((0 || -2))"
-FOO002="$((0 || 0))"
-FOO003="$((-1 && 10))"
-FOO004="$((-1 && 0))"
-FOO005="$((1 | 2))"
-FOO006="$((4 & 2))"
-FOO007="$((5 ^ 10))"
-FOO008="$((5 <= 5))"
-FOO009="$((5 <= -10))"
-FOO010="$((5 >= 5))"
-FOO011="$((-5 >= 5))"
-FOO012="$((5 < 6))"
-FOO013="$((-5 < -5))"
-FOO014="$((5 > 4))"
-FOO015="$((-5 > -5))"
-FOO016="$((-5 << 2))"
-FOO017="$((-5 >> 2))"
-FOO018="$((1 + 1))"
-FOO019="$((10 - 5))"
-FOO020="$((10 * 5))"
-FOO021="$((10 / 4))"
-FOO022="$((10 % 4))"
-FOO023="$((10 ** 4))"
-FOO024="$((!10))"
-FOO025="$((~ 10))"
-FOO026="$((1?10:5))"
-FOO027="$((0?10:5))"
-value="$((100))"
-FOO028="$((++value))"
-FOO029="$((--value))"
-FOO030="$((value++))"
-FOO031="$((value--))"
-value="$((100))"
-FOO032="$((value+++value++))"
-FOO033="$((++value+value++))"
-FOO034="$((10*(2+5)<<3%2**5))"
-FOO035="$((10*value<<3%2**5))"
-FOO036="$(( (20&5|3||1*100-20&5*10)+~(2*5) ))"
-FOO037="$((ARRAY[0]++))"
-FOO038="$((++ARRAY[0]))"
-FOO039="$((ARRAY[0]--))"
-FOO040="$((--ARRAY[0]))"
-FOO041="$((ARRAY[8]=9))"
-FOO042="$((ARRAY[8]*=10))"
-FOO043="$((ARRAY[8]/=10))"
-FOO044="$((ARRAY[8]%=2))"
-FOO045="$((ARRAY[8]+=8))"
-FOO046="$((ARRAY[8]-=0))"
-FOO047="$((ARRAY[8]<<=1))"
-FOO048="$((ARRAY[8]>>=1))"
-FOO049="$((ARRAY[8]&=5))"
-FOO050="$((ARRAY[8]|=10))"
-FOO051="$((ARRAY[8]^=3))"
-PARTIAL[8]=5
-FOO052="$((PARTIAL[8]*=1))"
-FOO053="$((${#ARRAY[@]}))"
-FOO054="$((${ARRAY[5]:-10}))"
-FOO055="$((${ARRAY:0}))"
-value=100
-FOO056="value"
-FOO057="$((${FOO056}++))"
-FOO058="$((${FOO056}+=10))"
-ARRAY=(1 2 3 4 5)
-FOO059="$((100**0))"
-FOO060="$((FOO059||FOO059++))"
-FOO061="$((0&&FOO059++))"
diff --git a/libbash-0.1/scripts/binary_arithmetic.bash.result b/libbash-0.1/scripts/binary_arithmetic.bash.result
deleted file mode 100644
index 926b23a..0000000
--- a/libbash-0.1/scripts/binary_arithmetic.bash.result
+++ /dev/null
@@ -1,64 +0,0 @@
-ARRAY=1 2 3 4 5
-FOO001=1
-FOO002=0
-FOO003=1
-FOO004=0
-FOO005=3
-FOO006=0
-FOO007=15
-FOO008=1
-FOO009=0
-FOO010=1
-FOO011=0
-FOO012=1
-FOO013=0
-FOO014=1
-FOO015=0
-FOO016=-20
-FOO017=-2
-FOO018=2
-FOO019=5
-FOO020=50
-FOO021=2
-FOO022=2
-FOO023=10000
-FOO024=0
-FOO025=-11
-FOO026=10
-FOO027=5
-FOO028=101
-FOO029=100
-FOO030=100
-FOO031=101
-FOO032=201
-FOO033=206
-FOO034=560
-FOO035=8320
-FOO036=-10
-FOO037=1
-FOO038=3
-FOO039=3
-FOO040=1
-FOO041=9
-FOO042=90
-FOO043=9
-FOO044=1
-FOO045=9
-FOO046=9
-FOO047=18
-FOO048=9
-FOO049=1
-FOO050=11
-FOO051=8
-FOO052=5
-FOO053=6
-FOO054=10
-FOO055=1
-FOO056=value
-FOO057=100
-FOO058=111
-FOO059=1
-FOO060=1
-FOO061=0
-PARTIAL=5
-value=111
diff --git a/libbash-0.1/scripts/command_execution.bash b/libbash-0.1/scripts/command_execution.bash
deleted file mode 100644
index 76e9c4c..0000000
--- a/libbash-0.1/scripts/command_execution.bash
+++ /dev/null
@@ -1,59 +0,0 @@
-function hi()
-{
- echo "Hello World"
-}
-hi
-echo hello world
-true
-false
-FOO001=$(echo hello)
-FOO002=$(hi)
-true &&
- echo "right"
-false && echo "wrong"
-! true && echo "wrong"
-false || echo "right"
-true ||
- echo "wrong"
-echo "end"
-: ${DEFAULTED:="yes"}
-FOO="abc" echo "command environment"
-export FOO003=1 FOO004=abc FOO005=(1 2 3) FOO002
-export foo
-abc=1 export foo
-echo "hi" > /dev/null
-
-function unset_inner()
-{
- local FOO006=3
- unset FOO006 FOO007
-}
-function unset_outer()
-{
- local FOO006=1 FOO007=2
- unset_inner
- echo "FOO006=$FOO006 in unset_outer"
- echo "FOO007=$FOO007 in unset_outer"
- unset FOO006
- echo "FOO006=$FOO006 in unset_outer"
-}
-unset_outer
-echo "FOO006=$FOO006 in global"
-FOO006=0
-echo "FOO006=$FOO006 in global"
-unset FOO006
-echo "FOO006=$FOO006 in global"
-declare -F unset_outer
-unset -f unset_outer
-declare -F unset_outer
-echo '$FOO006 "abc" $(( 1 + 2 )) $(echo hi) ...'
-echo "abc $(echo def) ghi"
-FOO008="abc $(echo def) ghi"
-eval "FOO009=10"
-eval "echo abc" "def" "xyz"
-shopt -s extglob
-shopt -p
-printf "%s %s\n" abc def
-printf "%s %s\n" $FOO001, def
-((FOO010=1))
-echo "abc #av### ##" # for comment
diff --git a/libbash-0.1/scripts/command_execution.bash.result b/libbash-0.1/scripts/command_execution.bash.result
deleted file mode 100644
index 5f9bede..0000000
--- a/libbash-0.1/scripts/command_execution.bash.result
+++ /dev/null
@@ -1,67 +0,0 @@
-Hello World
-hello world
-right
-right
-end
-command environment
-We do not support command env before the export builtin.
-FOO006=1 in unset_outer
-FOO007= in unset_outer
-FOO006= in unset_outer
-FOO006= in global
-FOO006=0 in global
-FOO006= in global
-unset_outer
-$FOO006 "abc" $(( 1 + 2 )) $(echo hi) ...
-abc def ghi
-abc def xyz
-shopt -u autocd
-shopt -u cdable_vars
-shopt -u cdspell
-shopt -u checkhash
-shopt -u checkjobs
-shopt -u checkwinsize
-shopt -u cmdhist
-shopt -u compat31
-shopt -u dirspell
-shopt -u dotglob
-shopt -u execfail
-shopt -u expand_aliases
-shopt -u extdebug
-shopt -s extglob
-shopt -u extquote
-shopt -u failglob
-shopt -u force_fignore
-shopt -u globstar
-shopt -u gnu_errfmt
-shopt -u histappend
-shopt -u histreedit
-shopt -u histverify
-shopt -u hostcomplete
-shopt -u huponexit
-shopt -u interactive
-shopt -u lithist
-shopt -u login_shell
-shopt -u mailwarn
-shopt -u no_empty_cmd_completion
-shopt -u nocaseglob
-shopt -u nocasematch
-shopt -u nullglob
-shopt -u progcomp
-shopt -u promptvars
-shopt -u restricted
-shopt -u shift_verbose
-shopt -u sourcepath
-shopt -u xpg_echo
-abc def
-hello, def
-abc #av### ##
-DEFAULTED=yes
-FOO001=hello
-FOO002=Hello World
-FOO003=1
-FOO004=abc
-FOO005=1 2 3
-FOO008=abc def ghi
-FOO009=10
-FOO010=1
diff --git a/libbash-0.1/scripts/compound_command.bash b/libbash-0.1/scripts/compound_command.bash
deleted file mode 100644
index ece5504..0000000
--- a/libbash-0.1/scripts/compound_command.bash
+++ /dev/null
@@ -1,353 +0,0 @@
-for file in " foo bar "
-do
- echo $file
-done
-
-for foo in abc def ghi
-do
- echo $foo
-done
-
-bar=
-# We behave differently from bash with "for foo in ''"
-for foo in $bar
-do
- echo "Shouldn't print this"
-done
-
-for (( i=1; i<4; ++i ))
-do
- echo $i
-done
-
-for ((;i<10;))
-do
- echo $((++i))
-done
-
-for ((;i<0;))
-do
- echo "Shouldn't print this"
-done
-
-for file in foo bar
-do
- if [[ $file == "foo" ]]; then
- continue
- fi
- echo $file
-done
-
-for file in foo bar
-do
- if [[ $file == "bar" ]]; then
- continue
- fi
- echo $file
-done
-
-for file in foo bar
-do
- if [[ $file == "foo" ]]; then
- break
- fi
- echo $file
-done
-
-for file in foo bar
-do
- if [[ $file == "bar" ]]; then
- break
- fi
- echo $file
-done
-
-for outer in 1 2 3
-do
- for file in foo bar
- do
- if [[ $file == "foo" && $outer == 1 ]]; then
- continue 2
- fi
- echo "$outer $file"
- done
-done
-
-for outer in 1 2 3
-do
- for file in foo bar
- do
- if [[ $file == "foo" && $outer == 1 ]]; then
- break 2
- fi
- echo "$outer $file"
- done
-done
-
-i=0;
-while [ $i != 4 ]
-do
- i=$(( i + 1 ))
- echo $i
-done
-
-while [ $i \< 0 ]
-do
- echo "Shouldn't print this"
-done
-
-i=0
-while [ $i != 4 ]
-do
- i=$(( i + 1 ))
- if [[ $i == 1 ]]; then
- continue
- fi
- echo $i
-done
-
-i=0
-while [ $i != 4 ]
-do
- i=$(( i + 1 ))
- if [[ $i == 1 ]]; then
- break
- fi
- echo $i
-done
-
-i=0
-j=1
-while [ $i != 4 ]
-do
- i=$(( i + 1 ))
-
- while [ $j == 1 ]
- do
- if [[ $i == 1 ]]; then
- continue 2
- fi
- echo $i
- let ++j
- done
-done
-
-i=0
-j=1
-while [ $i != 4 ]
-do
- i=$(( i + 1 ))
-
- while [ $j == 1 ]
- do
- if [[ $i == 1 ]]; then
- break 2
- fi
- echo $i
- let ++j
- done
-done
-
-i=0;
-until [ $i == 4 ]
-do
- i=$(( i + 1 ))
- echo $i
-done
-
-until [ $i \> 0 ]
-do
- echo "Shouldn't print this"
-done
-
-i=0
-until [ $i == 4 ]
-do
- i=$(( i + 1 ))
- if [[ $i == 1 ]]; then
- continue
- fi
- echo $i
-done
-
-i=0
-until [ $i == 4 ]
-do
- i=$(( i + 1 ))
- if [[ $i == 1 ]]; then
- break
- fi
- echo $i
-done
-
-i=0
-j=1
-until [ $i == 4 ]
-do
- i=$(( i + 1 ))
-
- while [ $j == 1 ]
- do
- if [[ $i == 1 ]]; then
- continue 2
- fi
- echo $i
- let ++j
- done
-done
-
-i=0
-j=1
-until [ $i == 4 ]
-do
- i=$(( i + 1 ))
-
- while [ $j == 1 ]
- do
- if [[ $i == 1 ]]; then
- break 2
- fi
- echo $i
- let ++j
- done
-done
-
-a=1
-b=2
-if [ $a == $b ]
-then
- echo "Shouldn't print this"
-fi
-if [ $a != $b ]
-then
- echo $a
-fi
-
-if [ $a == $b ]
-then
- echo "Shouldn't print this"
-elif [ $a != $b ]
-then
- echo $b
-fi
-
-if [ $a == $b ]
-then
- echo "Shouldn't print this"
-else
- echo $a
-fi
-
-if [ $a == $b ]
-then
- echo "Shouldn't print this"
-elif [ $a == $b ]
-then
- echo "Shouldn't print this"
-else
- echo $a
-fi
-
-target=123
-case $target in
- 1.3)
- echo "Shouldn't print this"
- ;;
- \d+)
- echo "Shouldn't print this"
- ;;
- 456|1?*|789)
- echo yep
- ;;
- 123)
- echo "Shouldn't print this"
- ;;
-esac
-target=xyz
-case $target in
- bcd)
- echo "Shouldn't print this"
- ;;
- abc)
- echo "Shouldn't print this"
- ;;
- *)
- echo "default"
- ;;
-esac
-case $target in
- abc|bcd|xyz)
- ;;
- *)
- echo "Shouldn't print this"
- ;;
-esac
-target=a
-case $target in
- [def])
- echo "Shouldn't print this"
- ;;
- [abc])
- echo yep
- ;;
-esac
-case $target in
- [def])
- echo "Shouldn't print this"
- ;;
- [a])
- echo yep
- ;;
-esac
-case $target in
- [!abc])
- echo "Shouldn't print this"
- ;;
- [!def])
- echo yep
- ;;
-esac
-case $target in
- [d-z])
- echo "Shouldn't print this"
- ;;
- [a-c])
- echo yep
- ;;
-esac
-case $target in
- [!a-c])
- echo "Shouldn't print this"
- ;;
- [!d-z])
- echo yep
- ;;
-esac
-target=bar
-case $target in
- a[a-cx-z]r)
- echo "Shouldn't print this"
- ;;
- b[!d-fx-z]r)
- echo yep
- ;;
-esac
-target="a"
-case $target in
- [[:alnum:][:alpha:][:ascii:][:blank:][:cntrl:][:digit:][:graph:][:lower:][:print:][:punct:][:space:][:upper:][:word:][:xdigit:]])
- echo yep
- ;;
-esac
-target="a"
-case $target in
- [[:ascii:]])
- echo yep
- ;;
-esac
-target="_"
-case $target in
- [[:word:]])
- echo yep
- ;;
-esac
-echo "case end"
diff --git a/libbash-0.1/scripts/compound_command.bash.result b/libbash-0.1/scripts/compound_command.bash.result
deleted file mode 100644
index c083e6a..0000000
--- a/libbash-0.1/scripts/compound_command.bash.result
+++ /dev/null
@@ -1,61 +0,0 @@
-foo bar
-abc
-def
-ghi
-1
-2
-3
-5
-6
-7
-8
-9
-10
-bar
-foo
-foo
-2 foo
-2 bar
-3 foo
-3 bar
-1
-2
-3
-4
-2
-3
-4
-2
-1
-2
-3
-4
-2
-3
-4
-2
-1
-2
-1
-1
-yep
-default
-yep
-yep
-yep
-yep
-yep
-yep
-yep
-yep
-yep
-case end
-a=1
-b=2
-bar=
-file=foo
-foo=ghi
-i=1
-j=1
-outer=1
-target=_
diff --git a/libbash-0.1/scripts/foo.eclass b/libbash-0.1/scripts/foo.eclass
deleted file mode 100644
index 1e46230..0000000
--- a/libbash-0.1/scripts/foo.eclass
+++ /dev/null
@@ -1,5 +0,0 @@
-IUSE="abc def"
-REQUIRED_USE="abc"
-DEPEND="dev-util/pkgconfig"
-RDEPEND="foo/bar"
-PDEPEND="foo/bar"
diff --git a/libbash-0.1/scripts/function_def.bash b/libbash-0.1/scripts/function_def.bash
deleted file mode 100644
index 8b7bd50..0000000
--- a/libbash-0.1/scripts/function_def.bash
+++ /dev/null
@@ -1,89 +0,0 @@
-EAPI=3
-
-src_unpack() {
- EAPI=$((EAPI+1))
-}
-
-src_unpack
-src_unpack
-
-MY_PV=2.0.3-r1
-
-nested_func_with_args() {
- ARG6=$1
- ARG7=$3
-}
-
-func_with_args() {
- ARG1=$1
- ARG2=$2
- ARG3=$3
- ARG4=$4
- ARG5=$5
- nested_func_with_args $4
-}
-FOO001="4 5"
-ARRAY=(1 2 3)
-func_with_args ${ARRAY[@]} $FOO001
-func_with_args 100 $ARG2 $ARG3 $ARG4
-
-func-with-return()
-{
- return 1
- NOT_EXIST=1
-}
-func-with-return
-RETURN_STATUS=$?
-func_with-return2()
-{
- true
- return
- NOT_EXIST=1
-}
-func_with-return2
-RETURN_STATUS2=$?
-
-func_nested1() {
- echo $foo_nested ${bar_nested[0]} $localbar
-}
-func_nested2() {
- local foo_nested=hi bar_nested=(1 2
- 3) localbar
- localbar=1
- echo ${bar_nested[@]}
- echo ${not_exist[@]}
- echo ${#bar_nested[@]}
- echo ${#non_exist[@]}
- echo ${#foo_nested}
- echo ${#non_exist}
- echo ${foo_nested:-wrong}
- echo ${non_exist:-right}
- func_nested1
-}
-func_nested2
-echo $localbar
-
-let() {
- echo "overloaded let"
-}
-let "1 + 2"
-func_positional_args() {
- IFS="abc" echo "$*"
- IFS="abc" echo $*
- IFS=abc
- echo "$*"
- echo $*
-}
-func_positional_args 1 2 3
-
-if true; then
- function_in_compound_statement() {
- echo "function_in_compound_statement"
- }
-fi
-if false; then
- function_in_compound_statement() {
- echo "I should not get called"
- }
-fi
-function_in_compound_statement
diff --git a/libbash-0.1/scripts/function_def.bash.result b/libbash-0.1/scripts/function_def.bash.result
deleted file mode 100644
index a4af30a..0000000
--- a/libbash-0.1/scripts/function_def.bash.result
+++ /dev/null
@@ -1,29 +0,0 @@
-1 2 3
-
-3
-0
-2
-0
-hi
-right
-hi 1 1
-
-overloaded let
-1 2 3
-1 2 3
-1a2a3
-1 2 3
-function_in_compound_statement
-ARG1=100
-ARG2=2
-ARG3=3
-ARG4=4
-ARG5=
-ARG6=4
-ARG7=
-ARRAY=1 2 3
-EAPI=5
-FOO001=4 5
-MY_PV=2.0.3-r1
-RETURN_STATUS=1
-RETURN_STATUS2=0
diff --git a/libbash-0.1/scripts/illegal_script.sh b/libbash-0.1/scripts/illegal_script.sh
deleted file mode 100644
index 9a33383..0000000
--- a/libbash-0.1/scripts/illegal_script.sh
+++ /dev/null
@@ -1 +0,0 @@
-case
diff --git a/libbash-0.1/scripts/isolated_functions.bash b/libbash-0.1/scripts/isolated_functions.bash
deleted file mode 100644
index ffdc14d..0000000
--- a/libbash-0.1/scripts/isolated_functions.bash
+++ /dev/null
@@ -1,13 +0,0 @@
-die "something wrong"
-has 123 456 123 456 && echo true
-has 123 456 13 456 && echo false
-hasq 123 123 456
-EXPORT_FUNCTIONS
-echo hi
-use
-useq
-use_with
-use_enable
-eerror foo
-debug-print foo
-ewarn foo
diff --git a/libbash-0.1/scripts/isolated_functions.bash.result b/libbash-0.1/scripts/isolated_functions.bash.result
deleted file mode 100644
index a56974f..0000000
--- a/libbash-0.1/scripts/isolated_functions.bash.result
+++ /dev/null
@@ -1,12 +0,0 @@
-Die is called: something wrong
-true
-Die is called: EXPORT_FUNCTIONS without a defined ECLASS
-hi
-use shouldn't be called
-useq shouldn't be called
-use_with shouldn't be called
-use_enable shouldn't be called
-eerror: foo
-debug-print: foo
-ewarn: foo
-item=123
diff --git a/libbash-0.1/scripts/source_false.sh b/libbash-0.1/scripts/source_false.sh
deleted file mode 100644
index c508d53..0000000
--- a/libbash-0.1/scripts/source_false.sh
+++ /dev/null
@@ -1 +0,0 @@
-false
diff --git a/libbash-0.1/scripts/source_return.sh b/libbash-0.1/scripts/source_return.sh
deleted file mode 100644
index dab5ede..0000000
--- a/libbash-0.1/scripts/source_return.sh
+++ /dev/null
@@ -1,2 +0,0 @@
-return 10
-NOT_EXIST=1
diff --git a/libbash-0.1/scripts/source_true.sh b/libbash-0.1/scripts/source_true.sh
deleted file mode 100644
index a848f2e..0000000
--- a/libbash-0.1/scripts/source_true.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-FOO001=hello
-function foo()
-{
- echo hi
-}
-FOO002=$0
diff --git a/libbash-0.1/scripts/sunpinyin-2.0.3-r1.ebuild b/libbash-0.1/scripts/sunpinyin-2.0.3-r1.ebuild
deleted file mode 100644
index 4b00d5a..0000000
--- a/libbash-0.1/scripts/sunpinyin-2.0.3-r1.ebuild
+++ /dev/null
@@ -1,34 +0,0 @@
-EAPI="1"
-
-inherit foo bar
-
-DESCRIPTION="SunPinyin is a SLM (Statistical Language Model) based IME"
-HOMEPAGE="http://sunpinyin.googlecode.com"
-SRC_URI="${HOMEPAGE}/files/${P}.tar.gz
- http://open-gram.googlecode.com/files/dict.utf8.tar.bz2
- http://open-gram.googlecode.com/files/lm_sc.t3g.arpa.tar.bz2"
-
-LICENSE="LGPL-2.1 CDDL"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-IUSE=""
-
-RDEPEND="dev-db/sqlite:3"
-DEPEND="${RDEPEND}
- dev-util/pkgconfig"
-
-src_unpack() {
- :
-}
-
-src_compile() {
- :
-}
-
-src_install() {
- :
-}
-
-pkg_postinst() {
- :
-}
diff --git a/libbash-0.1/scripts/sunpinyin-2.0.3-r1.ebuild.result b/libbash-0.1/scripts/sunpinyin-2.0.3-r1.ebuild.result
deleted file mode 100644
index 9298df3..0000000
--- a/libbash-0.1/scripts/sunpinyin-2.0.3-r1.ebuild.result
+++ /dev/null
@@ -1,22 +0,0 @@
-dev-db/sqlite:3 dev-util/pkgconfig
-dev-db/sqlite:3 foo/bar
-0
-http://sunpinyin.googlecode.com/files/.tar.gz http://open-gram.googlecode.com/files/dict.utf8.tar.bz2 http://open-gram.googlecode.com/files/lm_sc.t3g.arpa.tar.bz2
-
-http://sunpinyin.googlecode.com
-LGPL-2.1 CDDL
-SunPinyin is a SLM (Statistical Language Model) based IME
-~amd64 ~x86
-bar foo
-abc def
-abc
-foo/bar
-
-1
-
-compile install postinst unpack
-
-
-
-
-
diff --git a/libbash-0.1/scripts/test_expr.bash b/libbash-0.1/scripts/test_expr.bash
deleted file mode 100644
index 04b5a62..0000000
--- a/libbash-0.1/scripts/test_expr.bash
+++ /dev/null
@@ -1,54 +0,0 @@
-[ a = b ]
-echo $? # 1
-test a = a
-echo $? # 0
-#[ ]
-#echo $? # 1
-[ abc ]
-echo $? # 0
-[ ! abc ]
-echo $? # 1
-#[ ! ]
-#echo $?
-#[ abc -a bcd ]
-#echo $?
-#[ abc -o bcd ]
-#echo $?
-test abc == abd
-echo $? # 1
-[ abc != bcd ]
-echo $? # 0
-[ abc != abc ]
-echo $? # 1
-[ abc \> bcd ]
-echo $? # 1
-[ abc \< bcd ]
-echo $? # 0
-[[ abc ]] && echo true1
-[[ abc < bcd ]] && echo true2
-[[ abc > bcd ]] || echo true3
-[[ abc != bcd ]] && echo true4
-[[ abc = bcd ]] || echo true5
-[[ abc == abc ]] && echo true6
-[[ ! abc = bcd ]] && echo true7
-[[ abc = bcd || abc == abc ]] && echo true8
-[[ abc = bcd && abc == abc ]] || echo true9
-# abc=bcd is treated as a simple string
-[[ abc=bcd && abc == abc ]] || echo wrong
-[[ -a "/" ]] && echo "true10"
-[[ . -ef . ]] && echo "true11"
-[[ 2 -ge 2 ]] && echo "true12"
-[[ "abc def xyz" == *"def"* ]] && echo "true13"
-[[ "abc def xyz" == *"defg"* ]] && echo "wrong"
-[[ "abc def xyz" != *"def"* ]] && echo "wrong"
-[[ "abc def xyz" != *"defg"* ]] && echo "true14"
-shopt -s extglob
-[[ "123" == *([[:digit:]]) ]] && echo "true15"
-i=2
-[[ i++ -gt 2 ]] && echo wrong
-[[ i++ -gt 2 ]] && echo true16
-unset i
-[[ "setup.py" =~ ^(setup\.py|nosetests|py\.test|trial(\ .*)?)$ ]] && echo true17
-[[ "setup.py" =~ ^(setup\.p|nosetests|py\.test|trial(\ .*)?)$ ]] && echo false
-[ abc = bcd -o abc = abc ] && echo true18
-[ abc = bcd -a abc = abc ] || echo true19
diff --git a/libbash-0.1/scripts/test_expr.bash.result b/libbash-0.1/scripts/test_expr.bash.result
deleted file mode 100644
index fb147eb..0000000
--- a/libbash-0.1/scripts/test_expr.bash.result
+++ /dev/null
@@ -1,28 +0,0 @@
-1
-0
-0
-1
-1
-0
-1
-1
-0
-true1
-true2
-true3
-true4
-true5
-true6
-true7
-true8
-true9
-true10
-true11
-true12
-true13
-true14
-true15
-true16
-true17
-true18
-true19
diff --git a/libbash-0.1/scripts/var_def.bash b/libbash-0.1/scripts/var_def.bash
deleted file mode 100644
index fa07952..0000000
--- a/libbash-0.1/scripts/var_def.bash
+++ /dev/null
@@ -1,42 +0,0 @@
-EAPI="1"
-DESCRIPTION="SunPinyin is a SLM (Statistical Language Model) based IME"
-HOMEPAGE="http://sunpinyin.googlecode.com"
-SRC_URI="http://open-gram.googlecode.com/files/dict.utf8.tar.bz2
- http://open-gram.googlecode.com/files/lm_sc.t3g.arpa.tar.bz2"
-LICENSE="LGPL-2.1 CDDL"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-IUSE=""
-RDEPEND="dev-db/sqlite:3"
-DEPEND="${RDEPEND}
- dev-util/pkgconfig"
-MY_PATCH=ldflags.patch
-PATCH=("1.patch" 2.patch)
-ARRAY01=(1 2 3 [5]=4 5)
-ARRAY02=(1 2 3)
-ARRAY02[2]=4
-ARRAY02[3]=5
-EMPTY=
-PARTIAL[5]=5
-ARRAY_LAST=${ARRAY01[6]}
-EMPTY_ARRAY=()
-ARRAY03=(1 2 3)
-ARRAY03[0]=
-ARRAY04=(1 2 3)
-# The following one is equivalent to ARRAY04[0]=
-ARRAY04=
-ARRAY05=(1 2 3 4 5)
-ARRAY06=${ARRAY05[@]}
-ARRAY07=${ARRAY05[*]}
-ARRAY08="${ARRAY05[@]}"
-ARRAY09="${ARRAY05[*]}"
-IFS=";,:"
-ARRAY10="${ARRAY05[*]}"
-FOO001="networkmanager"
-FOO002="0.8.2"
-FOO003=${FOO001}-${FOO002}
-FOO004=$?
-FOO004=$!
-FOO005=abc
-FOO005+=def
-echo $-
diff --git a/libbash-0.1/scripts/var_def.bash.result b/libbash-0.1/scripts/var_def.bash.result
deleted file mode 100644
index 667c3e0..0000000
--- a/libbash-0.1/scripts/var_def.bash.result
+++ /dev/null
@@ -1,35 +0,0 @@
-$! has not been implemented yet
-Bh
-ARRAY01=1 2 3 4 5
-ARRAY02=1 2 4 5
-ARRAY03= 2 3
-ARRAY04= 2 3
-ARRAY05=1 2 3 4 5
-ARRAY06=1 2 3 4 5
-ARRAY07=1 2 3 4 5
-ARRAY08=1 2 3 4 5
-ARRAY09=1 2 3 4 5
-ARRAY10=1;2;3;4;5
-ARRAY_LAST=5
-DEPEND=dev-db/sqlite:3
- dev-util/pkgconfig
-DESCRIPTION=SunPinyin is a SLM (Statistical Language Model) based IME
-EAPI=1
-EMPTY=
-EMPTY_ARRAY=
-FOO001=networkmanager
-FOO002=0.8.2
-FOO003=networkmanager-0.8.2
-FOO004=
-FOO005=abcdef
-HOMEPAGE=http://sunpinyin.googlecode.com
-IUSE=
-KEYWORDS=~amd64 ~x86
-LICENSE=LGPL-2.1 CDDL
-MY_PATCH=ldflags.patch
-PARTIAL=5
-PATCH=1.patch 2.patch
-RDEPEND=dev-db/sqlite:3
-SLOT=0
-SRC_URI=http://open-gram.googlecode.com/files/dict.utf8.tar.bz2
- http://open-gram.googlecode.com/files/lm_sc.t3g.arpa.tar.bz2
diff --git a/libbash-0.1/scripts/var_expansion.bash b/libbash-0.1/scripts/var_expansion.bash
deleted file mode 100644
index 16573a9..0000000
--- a/libbash-0.1/scripts/var_expansion.bash
+++ /dev/null
@@ -1,115 +0,0 @@
-shopt -s extglob
-ARRAY=(hi hello 1 2 3)
-EAPI="3"
-EAPI4="$((EAPI+1))"
-FOO001="${EAPI:-hello}"
-FOO002="${EAPI3:-hello}"
-FOO003=123
-FOO004=$EAPI
-FOO005=$(( 1+1 ))
-FOO006=${EAPI:=hello}
-FOO007=${FOO008:=hello world}
-FOO009=${EAPI:+hello}
-FOO010=${NOT_EXIST:+hello}
-FOO011=${FOO009:0}
-FOO012=${FOO009:2}
-FOO013=${FOO009: -2}
-FOO014=${FOO009:100}
-FOO015=${FOO009: -100}
-FOO016=${FOO009:(-5 + 5)}
-FOO017=${NOT_EXIST:0}
-FOO018=${FOO009:0:2}
-FOO019=${FOO009:2:2}
-FOO020=${FOO009: -2:2}
-FOO021=${FOO009:2:100}
-FOO022=${FOO009: -2:100}
-FOO023=${NOT_EXIST:0:2}
-FOO024=${#FOO009}
-FOO025=${#NOT_EXIST}
-FOO026="${ARRAY[0]:-hello}"
-FOO028="${ARRAY[5]:-hello}"
-FOO029="${ARRAY2[0]:=hello}"
-FOO030="${ARRAY2[0]:=hi}"
-FOO031="${ARRAY2[0]:+hi}"
-FOO032="${ARRAY2[1]:+hi}"
-FOO033="${ARRAY[1]:1}"
-FOO034="${ARRAY[1]:1:3}"
-FOO035="${#ARRAY[0]}"
-FOO036="${#ARRAY[@]}"
-FOO037="${#ARRAY[*]}"
-FOO038="${#ARRAY}"
-FOO039="Hello World"
-FOO040=${FOO039/nothing/nothing}
-FOO041=${FOO039/o W/ow}
-FOO042=${FOO039//o/e}
-FOO043=${FOO039/#He/he}
-FOO044=${FOO039/#he/he}
-FOO045=${FOO039/%rld/rlD}
-FOO046=${FOO039/%rlD/rlD}
-FOO047=${FOO039/o W}
-FOO048=${FOO039//o}
-FOO049=${FOO039/#He}
-FOO050=${FOO039/#he}
-FOO051=${FOO039/%rld}
-FOO052=${FOO039/%rlD}
-FOO053=${FOO039/aaaaaaaaaaaa}
-FOO054=${FOO039#hello}
-FOO055=${FOO039##hello}
-FOO056=${FOO039#Hello}
-FOO057=${FOO039##Hello}
-FOO058=${FOO039%world}
-FOO059=${FOO039%%world}
-FOO060=${FOO039%World}
-FOO061=${FOO039%%World}
-FOO062=${FOO039#Hel*}
-FOO063=${FOO039##Hel*}
-FOO064=${FOO039%*rld}
-FOO065=${FOO039%%*rld}
-FOO066=${FOO039/l/r}
-FOO067=${FOO039//l/r}
-FOO068=${FOO039/#He/he}
-FOO069=${FOO039/#ello/i}
-FOO070=${FOO039/%ld/d}
-FOO071=${FOO039/%rl/r}
-FOO072=${FOO039/+(l)/}
-FOO073=${FOO039/+(l|e)}
-FOO074=${FOO039/*(l)}
-FOO075=${FOO039//*(l)}
-FOO076=${FOO039//*(l|e)}
-FOO077=${FOO039/?(l)}
-FOO078=${FOO039//?(l)}
-FOO079=${FOO039//?(l|e|o)}
-FOO080=${FOO039/@([a-c]|[k-m])}
-FOO081=${FOO039//@([a-c]|[k-m])}
-target="abc123abc"
-FOO082="${target##+(ab[c])*([[:digit:]])}"
-function positional_parameter_test(){
- FOO083=$*
- FOO084=${*}
- FOO085=${*:1}
- FOO086=${*:1:2}
- FOO087=${*: -1}
- FOO088=${*: -2:5}
- FOO089=${*:0}
- FOO090=$@
- FOO091=${@}
- FOO092=${@:1}
- FOO093=${@:1:2}
- FOO094=${@: -1}
- FOO095=${@: -2:5}
- FOO096=${@:0}
- echo $#
-}
-positional_parameter_test 1 2 3 4 5
-target="abc*abc"
-echo ${target/*}
-echo ${target/'*'}
-echo ${target/"*"}
-: ${FOO089:=}
-ARRAY=(1 2 3 4 5)
-echo ${ARRAY[@]:1}
-echo ${ARRAY[@]:1:3}
-echo $#
-echo a{b,c}d
-echo a{a,bc}d{e,}f
-echo a{ab,cd}d{ef,gh}
diff --git a/libbash-0.1/scripts/var_expansion.bash.result b/libbash-0.1/scripts/var_expansion.bash.result
deleted file mode 100644
index 52c87c0..0000000
--- a/libbash-0.1/scripts/var_expansion.bash.result
+++ /dev/null
@@ -1,110 +0,0 @@
-5
-
-abcabc
-abcabc
-2 3 4 5
-2 3 4
-0
-abd acd
-aadef aadf abcdef abcdf
-aabdef aabdgh acddef acddgh
-ARRAY=1 2 3 4 5
-ARRAY2=hello
-EAPI=3
-EAPI4=4
-FOO001=3
-FOO002=hello
-FOO003=123
-FOO004=3
-FOO005=2
-FOO006=3
-FOO007=hello world
-FOO008=hello world
-FOO009=hello
-FOO010=
-FOO011=hello
-FOO012=llo
-FOO013=lo
-FOO014=
-FOO015=
-FOO016=hello
-FOO017=
-FOO018=he
-FOO019=ll
-FOO020=lo
-FOO021=llo
-FOO022=lo
-FOO023=
-FOO024=5
-FOO025=0
-FOO026=hi
-FOO028=hello
-FOO029=hello
-FOO030=hello
-FOO031=hi
-FOO032=
-FOO033=ello
-FOO034=ell
-FOO035=2
-FOO036=5
-FOO037=5
-FOO038=2
-FOO039=Hello World
-FOO040=Hello World
-FOO041=Helloworld
-FOO042=Helle Werld
-FOO043=hello World
-FOO044=Hello World
-FOO045=Hello WorlD
-FOO046=Hello World
-FOO047=Hellorld
-FOO048=Hell Wrld
-FOO049=llo World
-FOO050=Hello World
-FOO051=Hello Wo
-FOO052=Hello World
-FOO053=Hello World
-FOO054=Hello World
-FOO055=Hello World
-FOO056= World
-FOO057= World
-FOO058=Hello World
-FOO059=Hello World
-FOO060=Hello
-FOO061=Hello
-FOO062=lo World
-FOO063=
-FOO064=Hello Wo
-FOO065=
-FOO066=Herlo World
-FOO067=Herro Worrd
-FOO068=hello World
-FOO069=Hello World
-FOO070=Hello Word
-FOO071=Hello World
-FOO072=Heo World
-FOO073=Ho World
-FOO074=Hello World
-FOO075=Heo Word
-FOO076=Ho Word
-FOO077=Hello World
-FOO078=Heo Word
-FOO079=H Wrd
-FOO080=Helo World
-FOO081=Heo Word
-FOO082=abc
-FOO083=1 2 3 4 5
-FOO084=1 2 3 4 5
-FOO085=1 2 3 4 5
-FOO086=1 2
-FOO087=5
-FOO088=4 5
-FOO089=@srcdir@/scripts/var_expansion.bash 1 2 3 4 5
-FOO090=1 2 3 4 5
-FOO091=1 2 3 4 5
-FOO092=1 2 3 4 5
-FOO093=1 2
-FOO094=5
-FOO095=4 5
-FOO096=@srcdir@/scripts/var_expansion.bash 1 2 3 4 5
-target=abc*abc
diff --git a/libbash-0.1/src/builtins/boolean_builtins.h b/libbash-0.1/src/builtins/boolean_builtins.h
deleted file mode 100644
index fb7aca9..0000000
--- a/libbash-0.1/src/builtins/boolean_builtins.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file boolean_builtins.cpp
-/// \brief implementations for the true and false builtins
-///
-#ifndef LIBBASH_BUILTINS_BOOLEAN_BUILTINS_H_
-#define LIBBASH_BUILTINS_BOOLEAN_BUILTINS_H_
-
-#include "cppbash_builtin.h"
-
-struct true_builtin : public virtual cppbash_builtin
-{
- BUILTIN_CONSTRUCTOR(true)
- virtual int exec(const std::vector<std::string>& ) { return 0; }
-};
-
-struct false_builtin : public virtual cppbash_builtin
-{
- BUILTIN_CONSTRUCTOR(false)
- virtual int exec(const std::vector<std::string>& ) { return 1; }
-};
-
-#endif
diff --git a/libbash-0.1/src/builtins/break_builtin.cpp b/libbash-0.1/src/builtins/break_builtin.cpp
deleted file mode 100644
index 0ee20a7..0000000
--- a/libbash-0.1/src/builtins/break_builtin.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file break_builtin.h
-/// \brief implementation for the break builtin
-///
-#include "builtins/break_builtin.h"
-
-#include <boost/lexical_cast.hpp>
-
-#include "builtins/builtin_exceptions.h"
-#include "core/interpreter_exception.h"
-
-int break_builtin::exec(const std::vector<std::string>& bash_args)
-{
- int nth = 1;
-
- if(bash_args.size() > 1)
- {
- throw libbash::interpreter_exception("break: too many arguments");
- }
- else if(bash_args.size() == 1)
- {
- try
- {
- nth = boost::lexical_cast<int>(bash_args[0]);
- }
- catch(boost::bad_lexical_cast& e)
- {
- throw libbash::interpreter_exception("break: argument should be an integer");
- }
- }
-
- throw break_exception(nth);
-}
diff --git a/libbash-0.1/src/builtins/break_builtin.h b/libbash-0.1/src/builtins/break_builtin.h
deleted file mode 100644
index fec1bc7..0000000
--- a/libbash-0.1/src/builtins/break_builtin.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file break_builtin.h
-/// \brief implementation for the break builtin
-///
-#ifndef LIBBASH_BUILTINS_BREAK_BUILTIN_H_
-#define LIBBASH_BUILTINS_BREAK_BUILTIN_H_
-
-#include "cppbash_builtin.h"
-
-class break_builtin : public virtual cppbash_builtin
-{
-public:
- BUILTIN_CONSTRUCTOR(break)
- virtual int exec(const std::vector<std::string>& );
-};
-
-#endif
diff --git a/libbash-0.1/src/builtins/builtin_exceptions.h b/libbash-0.1/src/builtins/builtin_exceptions.h
deleted file mode 100644
index 7b45efc..0000000
--- a/libbash-0.1/src/builtins/builtin_exceptions.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file builtin_exceptions.h
-/// \brief implementations for builtin exceptions
-///
-
-#ifndef LIBBASH_BUILTINS_BUILTIN_EXCEPTIONS_H_
-#define LIBBASH_BUILTINS_BUILTIN_EXCEPTIONS_H_
-
-#include <stdexcept>
-
-#include "core/exceptions.h"
-
-///
-/// \class return_exception
-/// \brief thrown when executing the return builtin
-///
-class return_exception: public std::runtime_error
-{
-public:
- explicit return_exception():
- runtime_error("return exception"){}
-};
-
-class loop_control_exception
-{
- int count;
-
- virtual void rethrow() = 0;
-
-protected:
- virtual ~loop_control_exception() {}
-
-public:
- explicit loop_control_exception(int c): count(c) {}
-
- void rethrow_unless_correct_frame()
- {
- if(count != 1)
- {
- --count;
- rethrow();
- }
- }
-};
-
-class continue_exception: public loop_control_exception
-{
-protected:
- virtual void rethrow()
- {
- throw *this;
- }
-
-public:
- explicit continue_exception(int c): loop_control_exception(c) {
- if(c < 1)
- throw libbash::illegal_argument_exception("continue: argument should be greater than or equal to 1");
- }
-};
-
-class break_exception: public loop_control_exception
-{
-protected:
- virtual void rethrow()
- {
- throw *this;
- }
-
-public:
- explicit break_exception(int c): loop_control_exception(c) {
- if(c < 1)
- throw libbash::illegal_argument_exception("break: argument should be greater than or equal to 1");
- }
-};
-
-class suppress_output: public std::exception
-{
-};
-#endif
diff --git a/libbash-0.1/src/builtins/continue_builtin.cpp b/libbash-0.1/src/builtins/continue_builtin.cpp
deleted file mode 100644
index 9bb9469..0000000
--- a/libbash-0.1/src/builtins/continue_builtin.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file continue_builtin.h
-/// \brief implementation for the continue builtin
-///
-#include "builtins/continue_builtin.h"
-
-#include <boost/lexical_cast.hpp>
-
-#include "builtins/builtin_exceptions.h"
-#include "core/exceptions.h"
-
-int continue_builtin::exec(const std::vector<std::string>& bash_args)
-{
- int nth = 1;
-
- if(bash_args.size() > 1)
- {
- throw libbash::illegal_argument_exception("continue: too many arguments");
- }
- else if(bash_args.size() == 1)
- {
- try
- {
- nth = boost::lexical_cast<int>(bash_args[0]);
- }
- catch(boost::bad_lexical_cast& e)
- {
- throw libbash::illegal_argument_exception("continue: argument should be an integer");
- }
- }
-
- throw continue_exception(nth);
-}
diff --git a/libbash-0.1/src/builtins/continue_builtin.h b/libbash-0.1/src/builtins/continue_builtin.h
deleted file mode 100644
index cd5223b..0000000
--- a/libbash-0.1/src/builtins/continue_builtin.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file continue_builtin.h
-/// \brief implementation for the continue builtin
-///
-#ifndef LIBBASH_BUILTINS_CONTINUE_BUILTIN_H_
-#define LIBBASH_BUILTINS_CONTINUE_BUILTIN_H_
-
-#include "cppbash_builtin.h"
-
-class continue_builtin : public virtual cppbash_builtin
-{
-public:
- BUILTIN_CONSTRUCTOR(continue)
- virtual int exec(const std::vector<std::string>& );
-};
-
-#endif
diff --git a/libbash-0.1/src/builtins/declare_builtin.cpp b/libbash-0.1/src/builtins/declare_builtin.cpp
deleted file mode 100644
index 2644bb7..0000000
--- a/libbash-0.1/src/builtins/declare_builtin.cpp
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file declare_builtin.cpp
-/// \brief class that implements the declare builtin
-///
-#include "builtins/declare_builtin.h"
-
-#include <algorithm>
-#include <iostream>
-
-#include "core/exceptions.h"
-#include "core/interpreter.h"
-
-int declare_builtin::exec(const std::vector<std::string>& bash_args)
-{
- if(bash_args.empty())
- {
- throw libbash::illegal_argument_exception("Arguments required for declare");
- return 1;
- }
- else if(bash_args[0].size() != 2)
- {
- throw libbash::unsupported_exception("Multiple arguments are not supported");
- return 1;
- }
-
- if(bash_args[0][0] != '-' && bash_args[0][0] != '+')
- {
- throw libbash::illegal_argument_exception("Invalid option for declare builtin");
- return 1;
- }
-
- int result = 0;
- switch(bash_args[0][1])
- {
- case 'F':
- if(bash_args[0][0] == '+')
- return 0;
- if(bash_args.size() > 1)
- {
- for(auto iter = bash_args.begin() + 1; iter != bash_args.end(); ++iter)
- {
- if(_walker.has_function(*iter))
- *_out_stream << *iter << std::endl;
- else
- result = 1;
- }
- }
- else
- {
- std::vector<std::string> functions;
-
- _walker.get_all_function_names(functions);
- sort(functions.begin(), functions.end());
-
- for(auto iter = functions.begin(); iter != functions.end(); ++iter)
- *_out_stream << "declare -f " << *iter << std::endl;
- }
- return result;
- case 'p':
- if(bash_args.size() > 1)
- {
- for(auto iter = bash_args.begin() + 1; iter != bash_args.end(); ++iter)
- {
- // We do not print the type of the variable for now
- if(!_walker.is_unset(*iter))
- {
- *_out_stream << "declare -- " << *iter << "=\"" << _walker.resolve<std::string>(*iter) << "\"" << std::endl;
- }
- else
- {
- *_out_stream << "-bash: declare: " << *iter << ": not found" << std::endl;
- result = 1;
- }
- }
- }
- else
- {
- throw libbash::unsupported_exception("We do not support declare -p without arguments for now");
- }
- return result;
- case 'a':
- case 'A':
- case 'f':
- case 'i':
- case 'l':
- case 'r':
- case 't':
- case 'u':
- case 'x':
- throw libbash::unsupported_exception("declare " + bash_args[0] + " is not supported yet");
- return 1;
- default:
- throw libbash::illegal_argument_exception("Unrecognized option for declare: " + bash_args[0]);
- return 1;
- }
-}
diff --git a/libbash-0.1/src/builtins/declare_builtin.h b/libbash-0.1/src/builtins/declare_builtin.h
deleted file mode 100644
index 971933a..0000000
--- a/libbash-0.1/src/builtins/declare_builtin.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file declare_builtin.h
-/// \brief class that implements the declare builtin
-///
-
-#ifndef LIBBASH_BUILTINS_DECLARE_BUILTIN_H_
-#define LIBBASH_BUILTINS_DECLARE_BUILTIN_H_
-
-#include "cppbash_builtin.h"
-
-///
-/// \class declare_builtin
-/// \brief the declare builtin for bash
-///
-class declare_builtin: public virtual cppbash_builtin
-{
-public:
- BUILTIN_CONSTRUCTOR(declare)
-
- ///
- /// \brief runs the declare builtin on the supplied arguments
- /// \param bash_args the arguments to the declare builtin
- /// \return exit status of declare
- ///
- virtual int exec(const std::vector<std::string>& bash_args);
-};
-
-#endif
diff --git a/libbash-0.1/src/builtins/echo_builtin.cpp b/libbash-0.1/src/builtins/echo_builtin.cpp
deleted file mode 100644
index 8caecef..0000000
--- a/libbash-0.1/src/builtins/echo_builtin.cpp
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file echo_builtin.cpp
-/// \brief class that implements the echo builtin
-///
-
-#include "echo_builtin.h"
-#include <boost/spirit/include/karma.hpp>
-#include <boost/spirit/include/qi.hpp>
-#include <boost/spirit/include/phoenix.hpp>
-
-#include "builtins/builtin_exceptions.h"
-
-namespace qi = boost::spirit::qi;
-namespace karma = boost::spirit::karma;
-namespace phoenix = boost::phoenix;
-
-int echo_builtin::exec(const std::vector<std::string>& bash_args)
-{
- bool suppress_nl = false;
- bool enable_escapes = false;
- bool options_parsed = false;
-
- if(bash_args.empty())
- {
- this->out_buffer() << std::endl;
- return 0;
- }
-
- for(auto i = bash_args.begin(); i != bash_args.end(); i++)
- {
- const std::string& str = *i;
-
- if(!options_parsed)
- {
- options_parsed = determine_options(str, suppress_nl, enable_escapes);
- }
-
- if(options_parsed)
- {
- if(enable_escapes)
- {
- for(; i != bash_args.end(); i++)
- {
- try
- {
- transform_escapes(*i, out_buffer());
- }
- catch(suppress_output)
- {
- return 0;
- }
- }
- }
- else
- {
- this->out_buffer() << karma::format(karma::string % ' ', std::vector<std::string>(i, bash_args.end()));
- }
-
- if(!suppress_nl)
- this->out_buffer() << std::endl;
-
- return 0;
- }
- }
-
- return 0;
-}
-
-bool echo_builtin::determine_options(const std::string &string, bool &suppress_nl, bool &enable_escapes)
-{
- using phoenix::ref;
- using qi::char_;
-
- bool n_matched = false, e_matched = false, E_matched = false;
-
- auto options = '-' >
- +(
- char_('n')[ref(n_matched) = true] |
- char_('e')[ref(e_matched) = true, ref(E_matched) = false] |
- char_('E')[ref(E_matched) = true, ref(e_matched) = false]
- );
-
- auto first = string.begin();
- qi::parse(first, string.end(), options);
-
- if(first != string.end()) {
- return true;
- }
- else
- {
- if(n_matched)
- suppress_nl = true;
-
- if(e_matched)
- enable_escapes = true;
-
- if(E_matched)
- enable_escapes = false;
-
- return false;
- }
-}
diff --git a/libbash-0.1/src/builtins/echo_builtin.h b/libbash-0.1/src/builtins/echo_builtin.h
deleted file mode 100644
index 3f5da62..0000000
--- a/libbash-0.1/src/builtins/echo_builtin.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file echo_builtin.h
-/// \brief class that implements the echo builtin
-///
-
-#ifndef LIBBASH_BUILTINS_ECHO_BUILTIN_H_
-#define LIBBASH_BUILTINS_ECHO_BUILTIN_H_
-
-#include <cstdlib>
-#include <iterator>
-#include "../cppbash_builtin.h"
-
-///
-/// \class echo_builtin
-/// \brief the echo builtin for bash
-///
-class echo_builtin: public virtual cppbash_builtin
-{
- public:
- BUILTIN_CONSTRUCTOR(echo)
-
- ///
- /// \brief runs the echo plugin on the supplied arguments
- /// \param bash_args the arguments to the echo builtin
- /// \return exit status of echo
- ///
- virtual int exec(const std::vector<std::string>& bash_args);
- private:
- ///
- /// \brief determines the options passed as arguments
- /// \param string string to check for arguments
- /// \param suppress_nl returns back whether to suppress newlines
- /// \param enable_escapes returns back whether to enable escapes
- /// \return false if all options have been processed
- bool determine_options(const std::string &string, bool &suppress_nl, bool &enable_escapes);
-};
-
-#endif
diff --git a/libbash-0.1/src/builtins/eval_builtin.cpp b/libbash-0.1/src/builtins/eval_builtin.cpp
deleted file mode 100644
index cf5d8fd..0000000
--- a/libbash-0.1/src/builtins/eval_builtin.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file eval_builtin.h
-/// \brief class that implements the eval builtin
-///
-
-#include "builtins/eval_builtin.h"
-
-#include <sstream>
-
-#include <boost/algorithm/string/join.hpp>
-
-#include "core/bash_ast.h"
-#include "core/interpreter.h"
-
-int eval_builtin::exec(const std::vector<std::string>& bash_args)
-{
- std::stringstream script(boost::algorithm::join(bash_args, " "));
- bash_ast(script).interpret_with(_walker);
- return _walker.get_status();
-}
diff --git a/libbash-0.1/src/builtins/eval_builtin.h b/libbash-0.1/src/builtins/eval_builtin.h
deleted file mode 100644
index ea2222c..0000000
--- a/libbash-0.1/src/builtins/eval_builtin.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file eval_builtin.h
-/// \brief class that implements the eval builtin
-///
-
-#ifndef LIBBASH_BUILTINS_eval_BUILTIN_H_
-#define LIBBASH_BUILTINS_eval_BUILTIN_H_
-
-#include "cppbash_builtin.h"
-
-///
-/// \class eval_builtin
-/// \brief the eval builtin for bash
-///
-class eval_builtin: public virtual cppbash_builtin
-{
- public:
- BUILTIN_CONSTRUCTOR(eval)
-
- ///
- /// \brief runs the eval builtin on the supplied arguments
- /// \param bash_args the arguments to the eval builtin
- /// \return exit status of eval
- ///
- virtual int exec(const std::vector<std::string>& bash_args);
-};
-
-#endif
diff --git a/libbash-0.1/src/builtins/inherit_builtin.cpp b/libbash-0.1/src/builtins/inherit_builtin.cpp
deleted file mode 100644
index 1490e5b..0000000
--- a/libbash-0.1/src/builtins/inherit_builtin.cpp
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file inherit_builtin.cpp
-/// \brief class that implements the inherit builtin
-///
-
-#include "builtins/inherit_builtin.h"
-
-#include <cstdlib>
-
-#include <string>
-
-#include "core/interpreter.h"
-
-inline void inherit_builtin::append_global(const std::string& name)
-{
- if(!_walker.is_unset_or_null(name, 0))
- _walker.set_value("E_" + name, _walker.resolve<std::string>("E_" + name) + " " + _walker.resolve<std::string>(name));
-}
-
-inline void inherit_builtin::restore_global(const std::string& name, const std::string& value)
-{
- if(value != "")
- _walker.set_value(name, value);
- else
- _walker.unset(name);
-}
-
-inline void inherit_builtin::backup_global(const std::string& name, std::string& value)
-{
- value = _walker.resolve<std::string>(name);
- _walker.unset(name);
-}
-
-inline bool inherit_builtin::hasq(const std::string& value, const std::string& name)
-{
- const std::string& target = _walker.resolve<std::string>(name);
- return target.find(value) != std::string::npos;
-}
-
-// We do not support any QA warning
-int inherit_builtin::exec(const std::vector<std::string>& bash_args)
-{
- _walker.set_value("ECLASS_DEPTH", _walker.resolve<long>("ECLASS_DEPTH") + 1);
-
- // find eclass directory
- std::string eclassdir;
- if(getenv("ECLASSDIR"))
- eclassdir = getenv("ECLASSDIR") + std::string("/");
- else
- eclassdir = "/usr/portage/eclass/";
-
- std::string location;
- std::string export_funcs_var;
- // These variables must be restored before returning
- std::string PECLASS(_walker.resolve<std::string>("ECLASS"));
- std::string prev_export_funcs_var(_walker.resolve<std::string>("__export_funcs_var"));
-
- std::string B_IUSE;
- std::string B_REQUIRED_USE;
- std::string B_DEPEND;
- std::string B_RDEPEND;
- std::string B_PDEPEND;
-
- for(auto iter = bash_args.begin(); iter != bash_args.end(); ++iter)
- {
- location = eclassdir + *iter + ".eclass";
- _walker.set_value("ECLASS", *iter);
- export_funcs_var = "__export_functions_" + _walker.resolve<std::string>("ECLASS_DEPTH");
- _walker.unset(export_funcs_var);
-
- // Portage implementation performs actions for overlays here but we don't do it for now
-
- backup_global("IUSE", B_IUSE);
- backup_global("REQUIRED_USE", B_REQUIRED_USE);
- backup_global("DEPEND", B_DEPEND);
- backup_global("RDEPEND", B_RDEPEND);
- backup_global("PDEPEND", B_PDEPEND);
-
- _walker.execute_builtin("source", {location});
-
- append_global("IUSE");
- append_global("REQUIRED_USE");
- append_global("DEPEND");
- append_global("RDEPEND");
- append_global("PDEPEND");
-
- restore_global("IUSE", B_IUSE);
- restore_global("REQUIRED_USE", B_REQUIRED_USE);
- restore_global("DEPEND", B_DEPEND);
- restore_global("RDEPEND", B_RDEPEND);
- restore_global("PDEPEND", B_PDEPEND);
-
- // Portage implementation exports functions here but we don't do it for now
-
- if(!hasq(*iter, "INHERITED"))
- _walker.set_value("INHERITED", _walker.resolve<std::string>("INHERITED") + " " + *iter);
- }
-
- _walker.set_value("ECLASS_DEPTH", _walker.resolve<long>("ECLASS_DEPTH") - 1);
- if(_walker.resolve<long>("ECLASS_DEPTH") > 0)
- {
- _walker.set_value("ECLASS", PECLASS);
- }
- else
- {
- _walker.unset("ECLASS");
- _walker.unset("__export_funcs_var");
- }
-
- return 0;
-}
diff --git a/libbash-0.1/src/builtins/inherit_builtin.h b/libbash-0.1/src/builtins/inherit_builtin.h
deleted file mode 100644
index 0e7f6ef..0000000
--- a/libbash-0.1/src/builtins/inherit_builtin.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file inherit_builtin.h
-/// \brief class that implements the inherit function from Portage
-///
-
-#ifndef LIBBASH_BUILTINS_INHERIT_BUILTIN_H_
-#define LIBBASH_BUILTINS_INHERIT_BUILTIN_H_
-
-#include "cppbash_builtin.h"
-
-///
-/// \class inherit
-/// \brief the inherit builtin for bash
-///
-class inherit_builtin: public virtual cppbash_builtin
-{
- public:
- BUILTIN_CONSTRUCTOR(inherit)
-
- ///
- /// \brief runs the inherit builtin on the supplied arguments
- /// \param bash_args the arguments to the inherit builtin
- /// \return exit status of inherit
- ///
- virtual int exec(const std::vector<std::string>& bash_args);
- private:
- void append_global(const std::string& name);
-
- void backup_global(const std::string& name, std::string& value);
-
- void restore_global(const std::string& name, const std::string& value);
-
- bool hasq(const std::string& value, const std::string& name);
-};
-
-#endif
diff --git a/libbash-0.1/src/builtins/let_builtin.cpp b/libbash-0.1/src/builtins/let_builtin.cpp
deleted file mode 100644
index 2e731fe..0000000
--- a/libbash-0.1/src/builtins/let_builtin.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file let_builtin.h
-/// \brief implementation for the let builtin
-///
-#include "builtins/let_builtin.h"
-
-#include <sstream>
-
-#include <boost/algorithm/string/join.hpp>
-
-#include "core/interpreter.h"
-
-int let_builtin::exec(const std::vector<std::string>& bash_args)
-{
- std::string expression(boost::algorithm::join(bash_args, " "));
- _walker.eval_arithmetic(expression);
-
- return 0;
-}
diff --git a/libbash-0.1/src/builtins/let_builtin.h b/libbash-0.1/src/builtins/let_builtin.h
deleted file mode 100644
index 9dba7d6..0000000
--- a/libbash-0.1/src/builtins/let_builtin.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file let_builtin.h
-/// \brief implementation for the let builtin
-///
-#ifndef LIBBASH_BUILTINS_LET_BUILTIN_H_
-#define LIBBASH_BUILTINS_LET_BUILTIN_H_
-
-#include "cppbash_builtin.h"
-
-class let_builtin : public virtual cppbash_builtin
-{
-public:
- BUILTIN_CONSTRUCTOR(let)
- virtual int exec(const std::vector<std::string>& );
-};
-
-#endif
diff --git a/libbash-0.1/src/builtins/printf_builtin.cpp b/libbash-0.1/src/builtins/printf_builtin.cpp
deleted file mode 100644
index 9b5fd41..0000000
--- a/libbash-0.1/src/builtins/printf_builtin.cpp
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file printf_builtin.h
-/// \brief implementation for the printf builtin
-///
-
-#include "builtins/printf_builtin.h"
-
-#include <boost/format.hpp>
-
-#include "core/interpreter.h"
-#include "cppbash_builtin.h"
-
-int printf_builtin::exec(const std::vector<std::string>& bash_args)
-{
- std::vector<std::string>::const_iterator begin;
- if(!(bash_args[0] == "-v"))
- begin = bash_args.begin();
- else if(bash_args.size() < 3)
- throw libbash::illegal_argument_exception("printf: illegal number of arguments");
- else
- begin = bash_args.begin() + 2;
-
- std::stringstream format_string;
- transform_escapes(*begin, format_string);
- boost::format formatter(format_string.str());
- for(auto iter = begin + 1; iter != bash_args.end(); ++iter)
- formatter = formatter % *iter;
-
- if(!(bash_args[0][0] == '-'))
- {
- *_out_stream << formatter;
- }
- else if(bash_args[0] == "-v")
- {
- std::stringstream output;
- output << formatter;
- _walker.set_value(bash_args[1], output.str());
- }
- else
- {
- throw libbash::illegal_argument_exception("printf: invalid option: " + bash_args[0]);
- }
-
- return 0;
-}
diff --git a/libbash-0.1/src/builtins/printf_builtin.h b/libbash-0.1/src/builtins/printf_builtin.h
deleted file mode 100644
index 07d5ac7..0000000
--- a/libbash-0.1/src/builtins/printf_builtin.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file printf_builtin.h
-/// \brief implementation for the printf builtin
-///
-#ifndef LIBBASH_BUILTINS_printf_BUILTIN_H_
-#define LIBBASH_BUILTINS_printf_BUILTIN_H_
-
-#include "cppbash_builtin.h"
-
-class printf_builtin : public virtual cppbash_builtin
-{
-public:
- BUILTIN_CONSTRUCTOR(printf)
- virtual int exec(const std::vector<std::string>& );
-};
-
-#endif
diff --git a/libbash-0.1/src/builtins/return_builtin.cpp b/libbash-0.1/src/builtins/return_builtin.cpp
deleted file mode 100644
index 068467c..0000000
--- a/libbash-0.1/src/builtins/return_builtin.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file return_builtin.h
-/// \brief implementation for the return builtin
-///
-
-#include "builtins/return_builtin.h"
-
-#include "builtins/builtin_exceptions.h"
-#include "core/interpreter.h"
-#include "cppbash_builtin.h"
-
-int return_builtin::exec(const std::vector<std::string>& bash_args)
-{
- if(bash_args.size() > 1)
- throw libbash::illegal_argument_exception("return: too many arguments");
- else if(bash_args.size() == 1)
- _walker.set_status(boost::lexical_cast<int>(bash_args[0]));
-
- throw return_exception();
-}
diff --git a/libbash-0.1/src/builtins/return_builtin.h b/libbash-0.1/src/builtins/return_builtin.h
deleted file mode 100644
index 54663c2..0000000
--- a/libbash-0.1/src/builtins/return_builtin.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file return_builtin.h
-/// \brief implementation for the return builtin
-///
-#ifndef LIBBASH_BUILTINS_RETURN_BUILTIN_H_
-#define LIBBASH_BUILTINS_RETURN_BUILTIN_H_
-
-#include "cppbash_builtin.h"
-
-class return_builtin : public virtual cppbash_builtin
-{
-public:
- BUILTIN_CONSTRUCTOR(return)
- virtual int exec(const std::vector<std::string>& );
-};
-
-#endif
diff --git a/libbash-0.1/src/builtins/shopt_builtin.cpp b/libbash-0.1/src/builtins/shopt_builtin.cpp
deleted file mode 100644
index f55c49e..0000000
--- a/libbash-0.1/src/builtins/shopt_builtin.cpp
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file shopt_builtin.cpp
-/// \brief implementation for the shopt builtin
-///
-
-#include "builtins/shopt_builtin.h"
-
-#include "core/exceptions.h"
-#include "core/interpreter.h"
-#include "cppbash_builtin.h"
-
-void shopt_builtin::set_opt(const std::vector<std::string>& bash_args, bool value)
-{
- for(auto iter = bash_args.begin() + 1; iter != bash_args.end(); ++iter)
- _walker.set_additional_option(*iter, value);
-}
-
-void shopt_builtin::print_opts() const
-{
- for(auto iter = _walker.additional_options_begin(); iter != _walker.additional_options_end(); ++iter)
- *_out_stream << "shopt " << (iter->second ? "-s " : "-u ") << iter->first << std::endl;
-}
-
-int shopt_builtin::exec(const std::vector<std::string>& bash_args)
-{
- if(bash_args.empty())
- throw libbash::illegal_argument_exception("Arguments required for shopt");
- else if(bash_args[0].size() != 2)
- throw libbash::unsupported_exception("Multiple arguments are not supported");
-
- switch(bash_args[0][1])
- {
- case 'u':
- set_opt(bash_args, false);
- break;
- case 's':
- set_opt(bash_args, true);
- break;
- case 'p':
- print_opts();
- break;
- case 'q':
- case 'o':
- throw libbash::unsupported_exception("shopt " + bash_args[0] + " is not supported yet");
- default:
- throw libbash::illegal_argument_exception("Unrecognized option for shopt: " + bash_args[0]);
- }
-
- return 0;
-}
diff --git a/libbash-0.1/src/builtins/shopt_builtin.h b/libbash-0.1/src/builtins/shopt_builtin.h
deleted file mode 100644
index 2b1f766..0000000
--- a/libbash-0.1/src/builtins/shopt_builtin.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file shopt_builtin.h
-/// \brief implementation for the shopt builtin
-///
-#ifndef LIBBASH_BUILTINS_SHOPT_BUILTIN_H_
-#define LIBBASH_BUILTINS_SHOPT_BUILTIN_H_
-
-#include "cppbash_builtin.h"
-
-class shopt_builtin : public virtual cppbash_builtin
-{
- void set_opt(const std::vector<std::string>& bash_args, bool value);
- void print_opts() const;
-public:
- BUILTIN_CONSTRUCTOR(shopt)
- virtual int exec(const std::vector<std::string>& );
-};
-
-#endif
diff --git a/libbash-0.1/src/builtins/source_builtin.cpp b/libbash-0.1/src/builtins/source_builtin.cpp
deleted file mode 100644
index bec83ad..0000000
--- a/libbash-0.1/src/builtins/source_builtin.cpp
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file source_builtin.h
-/// \brief class that implements the source builtin
-///
-
-#include "builtins/source_builtin.h"
-
-#include <fstream>
-#include <iostream>
-#include <string>
-#include <unordered_map>
-
-#include "builtins/builtin_exceptions.h"
-#include "cppbash_builtin.h"
-#include "core/exceptions.h"
-#include "core/interpreter.h"
-#include "core/bash_ast.h"
-
-int source_builtin::exec(const std::vector<std::string>& bash_args)
-{
- static std::unordered_map<std::string, std::shared_ptr<bash_ast>> ast_cache;
-
- if(bash_args.size() == 0)
- throw libbash::illegal_argument_exception("should provide one argument for source builtin");
-
- // we need fix this to pass extra arguments as positional parameters
- const std::string& path = bash_args[0];
-
- auto stored_ast = ast_cache.find(path);
- if(stored_ast == ast_cache.end())
- {
- // ensure the path is cached
- auto iter = ast_cache.insert(make_pair(path, std::shared_ptr<bash_ast>()));
- // this may throw exception
- iter.first->second.reset(new bash_ast(path));
- stored_ast = iter.first;
- }
- else if(!(stored_ast->second))
- {
- throw libbash::parse_exception(path + " cannot be fully parsed");
- }
-
- const std::string& original_path = _walker.resolve<std::string>("0");
- try
- {
- _walker.define("0", path, true);
- stored_ast->second->interpret_with(_walker);
- }
- catch(return_exception& e) {}
-
- _walker.define("0", original_path, true);
-
- return _walker.get_status();
-}
diff --git a/libbash-0.1/src/builtins/source_builtin.h b/libbash-0.1/src/builtins/source_builtin.h
deleted file mode 100644
index d599824..0000000
--- a/libbash-0.1/src/builtins/source_builtin.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file source_builtin.h
-/// \brief class that implements the source builtin
-///
-
-#ifndef LIBBASH_BUILTINS_SOURCE_BUILTIN_H_
-#define LIBBASH_BUILTINS_SOURCE_BUILTIN_H_
-
-#include "cppbash_builtin.h"
-
-///
-/// \class source_builtin
-/// \brief the source builtin for bash
-///
-class source_builtin: public virtual cppbash_builtin
-{
- public:
- BUILTIN_CONSTRUCTOR(source)
-
- ///
- /// \brief runs the source builtin on the supplied arguments
- /// \param bash_args the arguments to the source builtin
- /// \return exit status of source
- ///
- virtual int exec(const std::vector<std::string>& bash_args);
-};
-
-#endif
diff --git a/libbash-0.1/src/builtins/tests/boolean_tests.cpp b/libbash-0.1/src/builtins/tests/boolean_tests.cpp
deleted file mode 100644
index 4c9616b..0000000
--- a/libbash-0.1/src/builtins/tests/boolean_tests.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file echo_tests.cpp
-/// \brief series of unit tests for echo built in
-///
-#include <iostream>
-
-#include <gtest/gtest.h>
-
-#include "core/interpreter.h"
-#include "cppbash_builtin.h"
-
-using namespace std;
-
-TEST(boolean_builtin_test, true)
-{
- interpreter walker;
- int result = cppbash_builtin::exec("true", {}, std::cout, std::cerr, std::cin, walker);
- ASSERT_EQ(0, result);
-}
-
-TEST(boolean_builtin_test, false)
-{
- interpreter walker;
- int result = cppbash_builtin::exec("false", {}, std::cout, std::cerr, std::cin, walker);
- ASSERT_EQ(1, result);
-}
diff --git a/libbash-0.1/src/builtins/tests/break_tests.cpp b/libbash-0.1/src/builtins/tests/break_tests.cpp
deleted file mode 100644
index eba422e..0000000
--- a/libbash-0.1/src/builtins/tests/break_tests.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file break_tests.cpp
-/// \brief series of unit tests for break builtin
-///
-#include <boost/lexical_cast.hpp>
-#include <gtest/gtest.h>
-
-#include "builtins/builtin_exceptions.h"
-#include "core/interpreter.h"
-#include "cppbash_builtin.h"
-
-TEST(break_builtin_test, bad_argument)
-{
- interpreter walker;
- EXPECT_THROW(cppbash_builtin::exec("break", {"abc"}, std::cout, std::cerr, std::cin, walker), libbash::interpreter_exception);
- EXPECT_THROW(cppbash_builtin::exec("break", {"1", "2"}, std::cout, std::cerr, std::cin, walker), libbash::interpreter_exception);
- EXPECT_THROW(cppbash_builtin::exec("break", {"0"}, std::cout, std::cerr, std::cin, walker), libbash::interpreter_exception);
- EXPECT_THROW(cppbash_builtin::exec("break", {"-1"}, std::cout, std::cerr, std::cin, walker), libbash::interpreter_exception);
-}
-
-TEST(break_builtin_test, throw_exception)
-{
- interpreter walker;
- try
- {
- cppbash_builtin::exec("break", {}, std::cout, std::cerr, std::cin, walker);
- FAIL();
- }
- catch(break_exception& e)
- {
- EXPECT_NO_THROW(e.rethrow_unless_correct_frame());
- }
-
- try
- {
- cppbash_builtin::exec("break", {"2"}, std::cout, std::cerr, std::cin, walker);
- FAIL();
- }
- catch(break_exception& e)
- {
- try
- {
- e.rethrow_unless_correct_frame();
- FAIL();
- }
- catch(break_exception& e)
- {
- EXPECT_NO_THROW(e.rethrow_unless_correct_frame());
- }
- }
-}
diff --git a/libbash-0.1/src/builtins/tests/continue_tests.cpp b/libbash-0.1/src/builtins/tests/continue_tests.cpp
deleted file mode 100644
index c753291..0000000
--- a/libbash-0.1/src/builtins/tests/continue_tests.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file continue_tests.cpp
-/// \brief series of unit tests for continue builtin
-///
-#include <boost/lexical_cast.hpp>
-#include <gtest/gtest.h>
-
-#include "builtins/builtin_exceptions.h"
-#include "core/interpreter.h"
-#include "cppbash_builtin.h"
-
-TEST(continue_builtin_test, bad_argument)
-{
- interpreter walker;
- EXPECT_THROW(cppbash_builtin::exec("continue", {"abc"}, std::cout, std::cerr, std::cin, walker), libbash::illegal_argument_exception);
- EXPECT_THROW(cppbash_builtin::exec("continue", {"1", "2"}, std::cout, std::cerr, std::cin, walker), libbash::illegal_argument_exception);
- EXPECT_THROW(cppbash_builtin::exec("continue", {"0"}, std::cout, std::cerr, std::cin, walker), libbash::illegal_argument_exception);
- EXPECT_THROW(cppbash_builtin::exec("continue", {"-1"}, std::cout, std::cerr, std::cin, walker), libbash::illegal_argument_exception);
-}
-
-TEST(continue_builtin_test, throw_exception)
-{
- interpreter walker;
- try
- {
- cppbash_builtin::exec("continue", {}, std::cout, std::cerr, std::cin, walker);
- FAIL();
- }
- catch(continue_exception& e)
- {
- EXPECT_NO_THROW(e.rethrow_unless_correct_frame());
- }
-
- try
- {
- cppbash_builtin::exec("continue", {"2"}, std::cout, std::cerr, std::cin, walker);
- FAIL();
- }
- catch(continue_exception& e)
- {
- try
- {
- e.rethrow_unless_correct_frame();
- FAIL();
- }
- catch(continue_exception& e)
- {
- EXPECT_NO_THROW(e.rethrow_unless_correct_frame());
- }
- }
-}
diff --git a/libbash-0.1/src/builtins/tests/declare_tests.cpp b/libbash-0.1/src/builtins/tests/declare_tests.cpp
deleted file mode 100644
index 95f4b61..0000000
--- a/libbash-0.1/src/builtins/tests/declare_tests.cpp
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file declare_tests.cpp
-/// \brief series of unit tests for declare built in
-///
-#include <iostream>
-#include <sstream>
-#include <vector>
-
-#include <gtest/gtest.h>
-
-#include "core/bash_ast.h"
-#include "core/exceptions.h"
-#include "core/interpreter.h"
-#include "cppbash_builtin.h"
-
-using namespace std;
-
-namespace
-{
- template <typename T>
- void test_declare(const string& expected, std::initializer_list<string> args)
- {
- stringstream test_output;
- interpreter walker;
- try
- {
- cppbash_builtin::exec("declare",args,cout,test_output,cin,walker);
- FAIL();
- }
- catch(T& e)
- {
- EXPECT_EQ(expected, e.what());
- }
- }
-}
-
-TEST(declare_builtin_test, invalid_arguments)
-{
- test_declare<libbash::illegal_argument_exception>("Arguments required for declare", {});
- test_declare<libbash::unsupported_exception>("Multiple arguments are not supported", {"-ap"});
- test_declare<libbash::illegal_argument_exception>("Invalid option for declare builtin", {"_a"});
- test_declare<libbash::illegal_argument_exception>("Unrecognized option for declare: -L", {"-L"});
-}
-
-TEST(declare_builtin_test, _F)
-{
- stringstream expression("function foo() { :; }; function bar() { :; }");
- interpreter walker;
- bash_ast ast(expression);
- ast.interpret_with(walker);
-
- stringstream test_output1;
- EXPECT_EQ(0, cppbash_builtin::exec("declare", {"-F", "foo"}, test_output1, cerr, cin, walker));
- EXPECT_EQ("foo\n", test_output1.str());
-
- stringstream test_output2;
- EXPECT_EQ(1, cppbash_builtin::exec("declare", {"-F", "foo", "bar", "test"}, test_output2, cerr, cin, walker));
- EXPECT_EQ("foo\nbar\n", test_output2.str());
-
- stringstream test_output3;
- EXPECT_EQ(0, cppbash_builtin::exec("declare", {"+F", "foo", "bar", "test"}, test_output3, cerr, cin, walker));
- EXPECT_EQ("", test_output3.str());
-
- stringstream test_output4;
- EXPECT_EQ(0, cppbash_builtin::exec("declare", {"-F"}, test_output3, cerr, cin, walker));
- EXPECT_EQ("declare -f bar\ndeclare -f foo\n", test_output3.str());
-}
-
-TEST(declare_built_test, _p)
-{
- interpreter walker;
- walker.define("foo", "bar");
-
- stringstream test_output1;
- EXPECT_EQ(0, cppbash_builtin::exec("declare", {"-p", "foo"}, test_output1, cerr, cin, walker));
- EXPECT_EQ("declare -- foo=\"bar\"\n", test_output1.str());
-
- stringstream test_output2;
- EXPECT_EQ(1, cppbash_builtin::exec("declare", {"-p", "bar", "test"}, test_output2, cerr, cin, walker));
- EXPECT_EQ("-bash: declare: bar: not found\n-bash: declare: test: not found\n", test_output2.str());
-}
-
-#define TEST_DECLARE(name, expected, ...) \
- TEST(declare_builtin_test, name) { test_declare<libbash::unsupported_exception>(expected, {__VA_ARGS__}); }
-
-TEST_DECLARE(_a, "declare -a is not supported yet", "-a", "world")
-TEST_DECLARE(_A, "declare -A is not supported yet", "-A", "world")
-TEST_DECLARE(_f, "declare -f is not supported yet", "-f", "world")
-TEST_DECLARE(_i, "declare -i is not supported yet", "-i", "world")
-TEST_DECLARE(_l, "declare -l is not supported yet", "-l", "world")
-TEST_DECLARE(_r, "declare -r is not supported yet", "-r", "world")
-TEST_DECLARE(_t, "declare -t is not supported yet", "-t", "world")
-TEST_DECLARE(_u, "declare -u is not supported yet", "-u", "world")
-TEST_DECLARE(_x, "declare -x is not supported yet", "-x", "world")
-TEST_DECLARE(pa, "declare +a is not supported yet", "+a", "world")
-TEST_DECLARE(pA, "declare +A is not supported yet", "+A", "world")
-TEST_DECLARE(pf, "declare +f is not supported yet", "+f", "world")
-TEST_DECLARE(pi, "declare +i is not supported yet", "+i", "world")
-TEST_DECLARE(pl, "declare +l is not supported yet", "+l", "world")
-TEST_DECLARE(pr, "declare +r is not supported yet", "+r", "world")
-TEST_DECLARE(pt, "declare +t is not supported yet", "+t", "world")
-TEST_DECLARE(pu, "declare +u is not supported yet", "+u", "world")
-TEST_DECLARE(px, "declare +x is not supported yet", "+x", "world")
diff --git a/libbash-0.1/src/builtins/tests/echo_tests.cpp b/libbash-0.1/src/builtins/tests/echo_tests.cpp
deleted file mode 100644
index 7b38422..0000000
--- a/libbash-0.1/src/builtins/tests/echo_tests.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file echo_tests.cpp
-/// \brief series of unit tests for echo built in
-///
-#include <iostream>
-#include <sstream>
-#include <vector>
-
-#include <gtest/gtest.h>
-
-#include "core/interpreter.h"
-#include "cppbash_builtin.h"
-
-using namespace std;
-
-static void test_echo(const string& expected, std::initializer_list<string> args)
-{
- stringstream test_output;
- interpreter walker;
- cppbash_builtin::exec("echo",args,test_output,cerr,cin,walker);
- ASSERT_EQ(expected, test_output.str());
-}
-
-#define TEST_ECHO(name, expected, ...) \
- TEST(echo_builtin_test, name) { test_echo(expected, {__VA_ARGS__}); }
-
-TEST_ECHO(simple_output, "hello world\n", "hello", "world")
-TEST_ECHO(suppress_newline, "foo", "-n", "foo")
-TEST_ECHO(enable_escape, "foo\t\n", "-e", "foo\\t")
-TEST_ECHO(no_escape, "foo\\t\n", "foo\\t")
-TEST_ECHO(only_options, "foo -e", "-n", "foo", "-e")
-TEST_ECHO(only_options2, "foo -n\n", "foo", "-n")
-TEST_ECHO(combined_options, "fo\to", "-ne", "fo\\to")
-TEST_ECHO(combined_options2, "fo\\to", "-enE", "fo\\to")
-TEST_ECHO(fake_options, "-nea fo\\to\n", "-nea", "fo\\to")
-TEST_ECHO(combined_options_alternating_e, "fo\to", "-enEeEe", "fo\\to")
-TEST_ECHO(conflicting_options, "fo\\to\n", "-e", "-E", "fo\\to")
-TEST_ECHO(conflicting_options2, "fo\to\n", "-e", "-E", "-e", "fo\\to")
-TEST_ECHO(oct_escape, "]\n", "-e", "\\0135")
-TEST_ECHO(hex_escape, "W\n", "-e", "\\x57")
-TEST_ECHO(suppress_escape, "foo", "-e", "foo\\cbar")
diff --git a/libbash-0.1/src/builtins/tests/printf_tests.cpp b/libbash-0.1/src/builtins/tests/printf_tests.cpp
deleted file mode 100644
index 9017b18..0000000
--- a/libbash-0.1/src/builtins/tests/printf_tests.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file printf_tests.cpp
-/// \brief series of unit tests for printf builtin
-///
-#include <boost/lexical_cast.hpp>
-#include <gtest/gtest.h>
-
-#include "builtins/builtin_exceptions.h"
-#include "core/interpreter.h"
-#include "cppbash_builtin.h"
-
-namespace
-{
- void verify_error(const std::vector<std::string>& arguments, const std::string& expected, interpreter& walker)
- {
- try
- {
- cppbash_builtin::exec("printf", arguments, std::cout, std::cerr, std::cin, walker);
- FAIL();
- }
- catch(libbash::illegal_argument_exception& e)
- {
- EXPECT_STREQ(expected.c_str(), e.what());
- }
- }
-
- void verify_output(const std::vector<std::string>& arguments, const std::string& expected, interpreter& walker)
- {
- std::stringstream output;
- EXPECT_EQ(0, cppbash_builtin::exec("printf", arguments, output, std::cerr, std::cin, walker));
- EXPECT_STREQ(expected.c_str(), output.str().c_str());
- }
-}
-
-TEST(printf_builtin_test, bad_argument)
-{
- interpreter walker;
- verify_error({"-v"}, "printf: illegal number of arguments", walker);
- verify_error({"-p"}, "printf: invalid option: -p", walker);
-}
-
-TEST(printf_builtin_test, normal)
-{
- interpreter walker;
- verify_output({"-v", "foo", "%s\n", "bar"}, "", walker);
- EXPECT_STREQ(walker.resolve<std::string>("foo").c_str(), "bar\n");
-
- verify_output({"%s %s\n", "foo", "bar"}, "foo bar\n", walker);
-}
diff --git a/libbash-0.1/src/builtins/tests/return_tests.cpp b/libbash-0.1/src/builtins/tests/return_tests.cpp
deleted file mode 100644
index a9829b0..0000000
--- a/libbash-0.1/src/builtins/tests/return_tests.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file return_tests.cpp
-/// \brief series of unit tests for return builtin
-///
-#include <iostream>
-
-#include <boost/lexical_cast.hpp>
-#include <gtest/gtest.h>
-
-#include "builtins/builtin_exceptions.h"
-#include "core/interpreter.h"
-#include "cppbash_builtin.h"
-
-TEST(return_builtin_test, bad_argument)
-{
- interpreter walker;
- EXPECT_THROW(cppbash_builtin::exec("return", {"abc"}, std::cout, std::cerr, std::cin, walker), boost::bad_lexical_cast);
- EXPECT_THROW(cppbash_builtin::exec("return", {"abc", "def"}, std::cout, std::cerr, std::cin, walker), libbash::illegal_argument_exception);
-}
-
-TEST(return_builtin_test, bad_location)
-{
- interpreter walker;
- EXPECT_THROW(cppbash_builtin::exec("return", {}, std::cout, std::cerr, std::cin, walker), return_exception);
-}
diff --git a/libbash-0.1/src/builtins/tests/shopt_tests.cpp b/libbash-0.1/src/builtins/tests/shopt_tests.cpp
deleted file mode 100644
index 9fe4949..0000000
--- a/libbash-0.1/src/builtins/tests/shopt_tests.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file shopt_tests.cpp
-/// \brief series of unit tests for shopt builtin
-///
-#include <gtest/gtest.h>
-
-#include "builtins/builtin_exceptions.h"
-#include "core/exceptions.h"
-#include "core/interpreter.h"
-#include "cppbash_builtin.h"
-
-namespace
-{
- template <typename T>
- void test_shopt_builtin(const std::string& expected, const std::vector<std::string>& args)
- {
- std::stringstream output;
- interpreter walker;
- try
- {
- cppbash_builtin::exec("shopt", args, std::cout, output, std::cin, walker);
- FAIL();
- }
- catch(T& e)
- {
- EXPECT_STREQ(expected.c_str(), e.what());
- }
- }
-}
-
-TEST(shopt_builtin_test, disable_extglob)
-{
- test_shopt_builtin<libbash::illegal_argument_exception>("not exist is not a valid bash option", {"-u", "not exist"});
-
- interpreter walker;
- walker.set_additional_option("autocd", true);
- EXPECT_EQ(0, cppbash_builtin::exec("shopt", {"-u", "autocd", "cdspell"}, std::cout, std::cerr, std::cin, walker));
- EXPECT_FALSE(walker.get_additional_option("autocd"));
- EXPECT_FALSE(walker.get_additional_option("cdspell"));
-}
-
-TEST(shopt_builtin_test, enable_extglob)
-{
- test_shopt_builtin<libbash::illegal_argument_exception>("not exist is not a valid bash option", {"-s", "not exist"});
-
- interpreter walker;
- EXPECT_EQ(0, cppbash_builtin::exec("shopt", {"-s", "autocd", "cdspell"}, std::cout, std::cerr, std::cin, walker));
- EXPECT_TRUE(walker.get_additional_option("autocd"));
- EXPECT_TRUE(walker.get_additional_option("cdspell"));
-}
-
-TEST(shopt_builtin_test, invalid_argument)
-{
- test_shopt_builtin<libbash::illegal_argument_exception>("Arguments required for shopt", {});
- test_shopt_builtin<libbash::unsupported_exception>("Multiple arguments are not supported", {"-so"});
- test_shopt_builtin<libbash::unsupported_exception>("shopt -q is not supported yet", {"-q"});
- test_shopt_builtin<libbash::illegal_argument_exception>("Unrecognized option for shopt: -d", {"-d"});
-}
diff --git a/libbash-0.1/src/builtins/tests/source_tests.cpp b/libbash-0.1/src/builtins/tests/source_tests.cpp
deleted file mode 100644
index bfcac19..0000000
--- a/libbash-0.1/src/builtins/tests/source_tests.cpp
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file source_tests.cpp
-/// \brief series of unit tests for source built in
-///
-
-#include <iostream>
-#include <string>
-
-#include <gtest/gtest.h>
-
-#include "builtins/builtin_exceptions.h"
-#include "core/interpreter.h"
-#include "cppbash_builtin.h"
-#include "test.h"
-
-TEST(source_builtin_test, source_true)
-{
- interpreter walker;
-
- int status = cppbash_builtin::exec("source",
- {get_src_dir() + "/scripts/source_true.sh"},
- std::cout,
- std::cerr,
- std::cin,
- walker);
- EXPECT_EQ(status, 0);
-
- EXPECT_TRUE(walker.has_function("foo"));
-
- // Call the function defined in source_true.sh
- std::stringstream output;
- walker.set_output_stream(&output);
- interpreter::local_scope current_scope(walker);
- walker.call("foo", {});
- EXPECT_STREQ("hi\n", output.str().c_str());
-
- EXPECT_STREQ("hello", walker.resolve<std::string>("FOO001").c_str());
- EXPECT_STREQ((get_src_dir() + "/scripts/source_true.sh").c_str(),
- walker.resolve<std::string>("FOO002").c_str());
- EXPECT_STREQ("", walker.resolve<std::string>("0").c_str());
-}
-
-TEST(source_builtin_test, source_false)
-{
- interpreter walker;
- int status = cppbash_builtin::exec("source",
- {get_src_dir() + "/scripts/source_false.sh"},
- std::cout,
- std::cerr,
- std::cin,
- walker);
- EXPECT_EQ(status, 1);
-}
-
-TEST(source_builtin_test, source_return)
-{
- interpreter walker;
- int status = cppbash_builtin::exec("source",
- {get_src_dir() + "/scripts/source_return.sh"},
- std::cout,
- std::cerr,
- std::cin,
- walker);
- EXPECT_EQ(status, 10);
- EXPECT_TRUE(walker.is_unset_or_null("NOT_EXIST", 0));
-}
-
-TEST(source_builtin_test, invalid)
-{
- interpreter walker;
- EXPECT_THROW(cppbash_builtin::exec("source",
- {},
- std::cout,
- std::cerr,
- std::cin,
- walker),
- libbash::illegal_argument_exception);
- EXPECT_THROW(cppbash_builtin::exec("source",
- {get_src_dir() + "/scripts/illegal_script.sh"},
- std::cout,
- std::cerr,
- std::cin,
- walker),
- libbash::parse_exception);
-}
diff --git a/libbash-0.1/src/builtins/unset_builtin.cpp b/libbash-0.1/src/builtins/unset_builtin.cpp
deleted file mode 100644
index d8178f9..0000000
--- a/libbash-0.1/src/builtins/unset_builtin.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file unset_builtin.h
-/// \brief implementation for the unset builtin
-///
-#include "builtins/unset_builtin.h"
-
-#include <functional>
-
-#include "core/interpreter.h"
-
-int unset_builtin::exec(const std::vector<std::string>& bash_args)
-{
- if(bash_args.empty())
- return 0;
-
- if(bash_args[0] == "-f")
- for_each(bash_args.begin() + 1,
- bash_args.end(),
- std::bind(&interpreter::unset_function, &_walker, std::placeholders::_1));
- else
- /* POSIX says if neither -f nor -v is specified, name refers to a variable;
- * if a variable by that name does not exist, it is unspecified whether a
- * function by that name, if any, shall be unset.
- *
- * >=bash-4.1: without options, unset first tries to unset a variable, and
- * if that fails, tries to unset a function.
- * (We haven't checked bash-4.0)
- *
- * bash-3.2: if no options are supplied, or the -v option is given, each
- * name refers to a shell variable.
- *
- * We addhere to bash-3.2
- * */
- for_each(bash_args.front() == "-v" ? bash_args.begin() + 1 : bash_args.begin(),
- bash_args.end(),
- [&](const std::string& name) { _walker.unset(name); });
-
- return 0;
-}
diff --git a/libbash-0.1/src/builtins/unset_builtin.h b/libbash-0.1/src/builtins/unset_builtin.h
deleted file mode 100644
index 202e78a..0000000
--- a/libbash-0.1/src/builtins/unset_builtin.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file unset_builtin.h
-/// \brief implementation for the unset builtin
-///
-#ifndef LIBBASH_BUILTINS_UNSET_BUILTIN_H_
-#define LIBBASH_BUILTINS_UNSET_BUILTIN_H_
-
-#include "cppbash_builtin.h"
-
-class unset_builtin : public virtual cppbash_builtin
-{
-public:
- BUILTIN_CONSTRUCTOR(unset)
- virtual int exec(const std::vector<std::string>& bash_args);
-};
-
-#endif
diff --git a/libbash-0.1/src/common.h b/libbash-0.1/src/common.h
deleted file mode 100644
index 537e8d8..0000000
--- a/libbash-0.1/src/common.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file common.h
-/// \brief common macros and includes
-///
-
-#ifndef LIBBASH_COMMON_H_
-#define LIBBASH_COMMON_H_
-
-#define LIBBASH_API __attribute__((visibility("default")))
-#define LIBBASH_LOCAL __attribute__((visibility("hidden")))
-
-#endif
diff --git a/libbash-0.1/src/core/bash_ast.cpp b/libbash-0.1/src/core/bash_ast.cpp
deleted file mode 100644
index c7b9180..0000000
--- a/libbash-0.1/src/core/bash_ast.cpp
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file bash_ast.cpp
-/// \brief a wrapper class that helps interpret from istream and string
-///
-#include "core/bash_ast.h"
-
-#include <fstream>
-
-#include <boost/numeric/conversion/cast.hpp>
-
-#include "core/exceptions.h"
-#include "core/interpreter.h"
-#include "libbashLexer.h"
-#include "libbashParser.h"
-#include "libbashWalker.h"
-
-bash_ast::bash_ast(const std::istream& source,
- std::function<pANTLR3_BASE_TREE(plibbashParser)> p): parse(p)
-{
- std::stringstream stream;
- stream << source.rdbuf();
- script = stream.str();
- init_parser(script, "unknown source");
-}
-
-bash_ast::bash_ast(const std::string& script_path,
- std::function<pANTLR3_BASE_TREE(plibbashParser)> p): parse(p)
-{
- std::stringstream stream;
- std::ifstream file_stream(script_path);
- if(!file_stream)
- throw libbash::parse_exception(script_path + " can't be read");
-
- stream << file_stream.rdbuf();
- script = stream.str();
- init_parser(script, script_path);
-}
-
-void bash_ast::init_parser(const std::string& script, const std::string& script_path)
-{
- input.reset(antlr3NewAsciiStringInPlaceStream(
- reinterpret_cast<pANTLR3_UINT8>(const_cast<char*>(script.c_str())),
- // We do not support strings longer than the max value of ANTLR3_UNIT32
- boost::numeric_cast<ANTLR3_UINT32>(script.size()),
- NULL));
-
- if(!input)
- throw libbash::parse_exception("Unable to open file " + script + " due to malloc() failure");
-
- input->fileName = input->strFactory->newStr(
- input->strFactory,
- reinterpret_cast<pANTLR3_UINT8>(const_cast<char*>(script_path.c_str())));
-
- lexer.reset(libbashLexerNew(input.get()));
- if(!lexer)
- throw libbash::parse_exception("Unable to create the lexer due to malloc() failure");
-
- token_stream.reset(antlr3CommonTokenStreamSourceNew(
- ANTLR3_SIZE_HINT, lexer->pLexer->rec->state->tokSource));
- if(!token_stream)
- throw libbash::parse_exception("Out of memory trying to allocate token stream");
-
- parser.reset(libbashParserNew(token_stream.get()));
- if(!parser)
- throw libbash::parse_exception("Out of memory trying to allocate parser");
-
- ast = parse(parser.get());
- if(parser->pParser->rec->getNumberOfSyntaxErrors(parser->pParser->rec))
- throw libbash::parse_exception("Something wrong happened while parsing");
- nodes.reset(antlr3CommonTreeNodeStreamNewTree(ast, ANTLR3_SIZE_HINT));
-}
-
-std::string bash_ast::get_dot_graph()
-{
- pANTLR3_STRING graph = nodes->adaptor->makeDot(nodes->adaptor, ast);
- return std::string(reinterpret_cast<char*>(graph->chars));
-}
-
-std::string bash_ast::get_string_tree()
-{
- return std::string(reinterpret_cast<char*>(ast->toStringTree(ast)->chars));
-}
-
-namespace
-{
- void print_line_counter(std::stringstream& result,
- pANTLR3_COMMON_TOKEN token,
- int& line_counter,
- int pos)
- {
- char* text = reinterpret_cast<char*>(token->getText(token)->chars);
- for(int i = pos; text[i] == '\n'; ++i)
- result << '\n' << line_counter++ << "\t";
- }
-}
-
-std::string bash_ast::get_parser_tokens(antlr_pointer<ANTLR3_COMMON_TOKEN_STREAM_struct>& token_stream,
- std::function<std::string(ANTLR3_UINT32)> token_map)
-{
- std::stringstream result;
- int line_counter = 1;
-
- // output line number for the first line
- result << line_counter++ << "\t";
-
- pANTLR3_VECTOR token_list = token_stream->getTokens(token_stream.get());
- unsigned token_size = token_list->size(token_list);
-
- for(unsigned i = 0u; i != token_size; ++i)
- {
- pANTLR3_COMMON_TOKEN token = reinterpret_cast<pANTLR3_COMMON_TOKEN>
- (token_list->get(token_list, i));
- std::string tokenName = token_map(token->getType(token));
-
- if(tokenName != "EOL" && tokenName != "COMMENT" && tokenName != "CONTINUE_LINE")
- {
- result << tokenName << " ";
- }
- // Output \n and line number before each COMMENT token for better readability
- else if(tokenName == "COMMENT")
- {
- print_line_counter(result, token, line_counter, 0);
- result << tokenName;
- }
- // Output \n and line number after each CONTINUE_LINE/EOL token for better readability
- // omit the last \n and line number
- else if(i + 1 != token_size)
- {
- result << tokenName;
- print_line_counter(result, token, line_counter, tokenName == "CONTINUE_LINE"? 1 : 0);
- }
- }
- return result.str();
-}
-
-std::string bash_ast::get_walker_tokens(std::function<std::string(ANTLR3_UINT32)> token_map)
-{
- std::stringstream result;
- pANTLR3_INT_STREAM istream = nodes->tnstream->istream;
- auto istream_size = istream->size(istream);
-
- for(ANTLR3_UINT32 i = 1; i <= istream_size; ++i)
- {
- ANTLR3_UINT32 token = istream->_LA(istream, boost::numeric_cast<ANTLR3_INT32>(i));
- if(token == 2)
- result << "DOWN ";
- else if(token == 3)
- result << "UP ";
- else
- result << token_map(istream->_LA(istream, boost::numeric_cast<ANTLR3_INT32>(i))) << " ";
- }
- result << std::endl;
-
- return result.str();
-}
-
-void bash_ast::walker_start(plibbashWalker tree_parser)
-{
- tree_parser->start(tree_parser);
-}
-
-long bash_ast::walker_arithmetics(plibbashWalker tree_parser)
-{
- return tree_parser->arithmetics(tree_parser);
-}
-
-pANTLR3_BASE_TREE bash_ast::parser_start(plibbashParser parser)
-{
- return parser->start(parser).tree;
-}
-
-pANTLR3_BASE_TREE bash_ast::parser_arithmetics(plibbashParser parser)
-{
- return parser->arithmetics(parser).tree;
-}
-
-void bash_ast::call_function(plibbashWalker ctx,
- ANTLR3_MARKER index)
-{
- auto INPUT = ctx->pTreeParser->ctnstream;
- // Push function index into INPUT
- // The actual type of ANTLR3_MARKER is ANTLR3_INT32
- INPUT->push(INPUT, boost::numeric_cast<ANTLR3_INT32>(index));
- // Execute function body
- ctx->compound_command(ctx);
-}
-
-bash_ast::walker_pointer bash_ast::create_walker(interpreter& walker)
-{
- set_interpreter(&walker);
- walker.push_current_ast(this);
-
- auto deleter = [&](plibbashWalker tree_parser)
- {
- tree_parser->free(tree_parser);
- walker.pop_current_ast();
- };
-
- return walker_pointer(libbashWalkerNew(nodes.get()), deleter);
-}
diff --git a/libbash-0.1/src/core/bash_ast.h b/libbash-0.1/src/core/bash_ast.h
deleted file mode 100644
index 22635a1..0000000
--- a/libbash-0.1/src/core/bash_ast.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file bash_ast.h
-/// \brief a class that helps interpret from istream and string
-///
-
-#ifndef LIBBASH_CORE_PARSER_BUILDER_H_
-#define LIBBASH_CORE_PARSER_BUILDER_H_
-
-#include <type_traits>
-#include <functional>
-#include <istream>
-#include <memory>
-#include <string>
-#include <vector>
-
-#include <antlr3.h>
-#include <boost/utility.hpp>
-
-struct libbashLexer_Ctx_struct;
-struct libbashParser_Ctx_struct;
-struct libbashWalker_Ctx_struct;
-typedef libbashWalker_Ctx_struct* plibbashWalker;
-class interpreter;
-
-template<typename T>
-class antlr_pointer: public std::unique_ptr<T, std::function<void(T*)>>
-{
- typedef std::unique_ptr<T, std::function<void(T*)>> parent;
-public:
- antlr_pointer(T* p = 0) : parent(p, [](T* to_delete) { to_delete->free(to_delete); }) {};
-};
-
-/// \class bash_ast
-/// \brief a wrapper class that helps interpret from istream and string
-class bash_ast: public boost::noncopyable
-{
- antlr_pointer<ANTLR3_INPUT_STREAM_struct> input;
- std::string script;
- antlr_pointer<libbashLexer_Ctx_struct> lexer;
- antlr_pointer<ANTLR3_COMMON_TOKEN_STREAM_struct> token_stream;
- antlr_pointer<libbashParser_Ctx_struct> parser;
- pANTLR3_BASE_TREE ast;
- antlr_pointer<ANTLR3_COMMON_TREE_NODE_STREAM_struct> nodes;
- std::function<pANTLR3_BASE_TREE(libbashParser_Ctx_struct*)> parse;
-
- typedef std::unique_ptr<libbashWalker_Ctx_struct, std::function<void(plibbashWalker)>> walker_pointer;
-
- void init_parser(const std::string& script, const std::string& script_path);
- walker_pointer create_walker(interpreter& walker);
-
-public:
- bash_ast(const std::istream& source,
- std::function<pANTLR3_BASE_TREE(libbashParser_Ctx_struct*)> p=parser_start);
-
- bash_ast(const std::string& script_path,
- std::function<pANTLR3_BASE_TREE(libbashParser_Ctx_struct*)> p=parser_start);
-
- static void walker_start(plibbashWalker tree_parser);
-
- static long walker_arithmetics(plibbashWalker tree_parser);
-
- static void call_function(plibbashWalker tree_parser,
- ANTLR3_MARKER index);
-
- static pANTLR3_BASE_TREE parser_start(libbashParser_Ctx_struct* parser);
-
- static pANTLR3_BASE_TREE parser_arithmetics(libbashParser_Ctx_struct* parser);
-
- ///
- /// \brief interpret the script with a given interpreter
- /// \param the interpreter object
- /// \return the interpreted result
- template<typename Functor>
- typename std::result_of<Functor(plibbashWalker)>::type
- interpret_with(interpreter& walker, Functor walk)
- {
- walker_pointer p_tree_parser = create_walker(walker);
- return walk(p_tree_parser.get());
- }
-
- void interpret_with(interpreter& walker)
- {
- interpret_with(walker, walker_start);
- }
-
- std::string get_dot_graph();
-
- std::string get_string_tree();
-
- static std::string get_parser_tokens(antlr_pointer<ANTLR3_COMMON_TOKEN_STREAM_struct>& token_stream,
- std::function<std::string(ANTLR3_UINT32)>);
-
- std::string get_walker_tokens(std::function<std::string(ANTLR3_UINT32)>);
-};
-
-#endif
diff --git a/libbash-0.1/src/core/bash_condition.cpp b/libbash-0.1/src/core/bash_condition.cpp
deleted file mode 100644
index af57b90..0000000
--- a/libbash-0.1/src/core/bash_condition.cpp
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
- */
-///
-/// \file bash_condition.cpp
-/// \brief implementation for Bash Conditional Expressions
-///
-#include "core/bash_condition.h"
-
-#include <ctime>
-
-#include <boost/lexical_cast.hpp>
-#include <sys/stat.h>
-#include <unistd.h>
-
-#include "core/bash_ast.h"
-#include "core/exceptions.h"
-#include "core/interpreter.h"
-
-namespace
-{
- bool test_file_stat(char op, const std::string& path)
- {
- struct stat info;
- int status = 0;
-
- // symbol link use lstat so we need to separate this.
- if(op == 'L' || op == 'h')
- return lstat(path.c_str(), &info) == 0 && S_ISLNK(info.st_mode);
-
- status = stat(path.c_str(), &info);
- if(status != 0 || access(path.c_str(), F_OK))
- return false;
-
- switch(op)
- {
- case 'a':
- case 'e':
- return true;
- case 'b':
- return S_ISBLK(info.st_mode);
- case 'c':
- return S_ISCHR(info.st_mode);
- case 'd':
- return S_ISDIR(info.st_mode);
- case 'f':
- return S_ISREG(info.st_mode);
- case 'g':
- return S_ISGID & info.st_mode;
- case 'k':
- return S_ISVTX & info.st_mode;
- case 'p':
- return S_ISFIFO(info.st_mode);
- case 'r':
- return access(path.c_str(), R_OK) == 0;
- case 's':
- return info.st_size > 0;
- case 'u':
- return S_ISUID & info.st_mode;
- case 'w':
- return access(path.c_str(), W_OK) == 0;
- case 'x':
- return access(path.c_str(), X_OK) == 0;
- case 'O':
- return geteuid() == info.st_uid;
- case 'G':
- return getegid() == info.st_gid;
- case 'S':
- return S_ISSOCK(info.st_mode);
- case 'N':
- return info.st_mtime >= info.st_atime;
- default:
- throw libbash::illegal_argument_exception(std::string("Unrecognized test operator -") + op);
- }
- }
-}
-
-bool internal::test_unary(char op, const std::string& target)
-{
- switch(op)
- {
- case 'z':
- return target.empty();
- case 'n':
- return !target.empty();
- case 'o':
- throw libbash::unsupported_exception("Shell option test is not supported");
- case 't':
- try
- {
- int fd = boost::lexical_cast<int>(target);
- return isatty(fd);
- }
- catch(boost::bad_lexical_cast& e)
- {
- return false;
- }
- default:
- return test_file_stat(op, target);
- }
-}
-
-namespace
-{
- bool file_comp(char op,
- const std::string& lhs,
- const std::string& rhs)
- {
- struct stat lst, rst;
- int lstatus, rstatus;
-
- lstatus = stat(lhs.c_str(), &lst);
- rstatus = stat(rhs.c_str(), &rst);
- if(op == 'e' && (lstatus < 0 || rstatus < 0))
- return false;
-
- switch(op)
- {
- case 'n':
- /* -nt */
- return ((lstatus > rstatus) || (lstatus == 0 && lst.st_mtime > rst.st_mtime));
- case 'o':
- /* -ot */
- return ((lstatus < rstatus) || (rstatus == 0 && lst.st_mtime < rst.st_mtime));
- case 'e':
- /* -ef */
- return (lst.st_dev == rst.st_dev && lst.st_ino == rst.st_ino);
- default:
- throw libbash::illegal_argument_exception(std::string("Unrecognized option for file test ") + op);
- }
- }
-}
-
-bool internal::test_binary(const std::string& op,
- const std::string& lhs,
- const std::string& rhs,
- interpreter& walker)
-{
- if(op.size() != 2)
- throw libbash::illegal_argument_exception("Unrecognized operator " + op);
-
- try
- {
- if(op == "nt")
- return file_comp('n', lhs, rhs);
- else if(op == "ot")
- return file_comp('o', lhs, rhs);
- else if(op == "ef")
- return file_comp('e', lhs, rhs);
- // We do not support arithmetic expressions inside keyword test for now.
- // So the operands can only be raw integers.
- else if(op == "eq")
- return walker.eval_arithmetic(lhs) == walker.eval_arithmetic(rhs);
- else if(op == "ne")
- return walker.eval_arithmetic(lhs) != walker.eval_arithmetic(rhs);
- else if(op == "lt")
- return walker.eval_arithmetic(lhs) < walker.eval_arithmetic(rhs);
- else if(op == "le")
- return walker.eval_arithmetic(lhs) <= walker.eval_arithmetic(rhs);
- else if(op == "gt")
- return walker.eval_arithmetic(lhs) > walker.eval_arithmetic(rhs);
- else if(op == "ge")
- return walker.eval_arithmetic(lhs) >= walker.eval_arithmetic(rhs);
- else
- throw libbash::illegal_argument_exception("Unrecognized operator " + op);
- }
- catch(boost::bad_lexical_cast& e)
- {
- return false;
- }
-}
diff --git a/libbash-0.1/src/core/bash_condition.h b/libbash-0.1/src/core/bash_condition.h
deleted file mode 100644
index e8e4096..0000000
--- a/libbash-0.1/src/core/bash_condition.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
- */
-///
-/// \file bash_condition.h
-/// \brief implementation for Bash Conditional Expressions
-///
-#ifndef LIBBASH_CORE_BASH_CONDITION_H_
-#define LIBBASH_CORE_BASH_CONDITION_H_
-
-#include <string>
-
-class interpreter;
-
-namespace internal
-{
- bool test_unary(char op, const std::string& target);
-
- bool test_binary(const std::string& op,
- const std::string& lhs,
- const std::string& rhs,
- interpreter& walker);
-}
-
-#endif
diff --git a/libbash-0.1/src/core/divide_by_zero_error.h b/libbash-0.1/src/core/divide_by_zero_error.h
deleted file mode 100644
index 10603cc..0000000
--- a/libbash-0.1/src/core/divide_by_zero_error.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file divide_by_zero_error.h
-/// \brief implementation for divide_by_zero_error
-///
-
-#ifndef LIBBASH_CORE_DIVIDE_BY_ZERO_ERROR_H_
-#define LIBBASH_CORE_DIVIDE_BY_ZERO_ERROR_H_
-
-#include <stdexcept>
-#include <string>
-
-#include "common.h"
-#include "interpreter_exception.h"
-
-namespace libbash
-{
- ///
- /// \class divide_by_zero_error
- /// \brief exception for dividing by zero error
- ///
- class LIBBASH_API divide_by_zero_error: public libbash::interpreter_exception
- {
- public:
- explicit divide_by_zero_error(const std::string& err_msg):
- libbash::interpreter_exception(err_msg){}
- };
-}
-
-#endif
diff --git a/libbash-0.1/src/core/exceptions.h b/libbash-0.1/src/core/exceptions.h
deleted file mode 100644
index 519d16a..0000000
--- a/libbash-0.1/src/core/exceptions.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
- */
-///
-/// \file exceptions.h
-/// \author Mu Qiao
-/// \brief headers for all exceptions
-///
-#ifndef LIBBASH_CORE_EXCEPTIOND_H_
-#define LIBBASH_CORE_EXCEPTIOND_H_
-
-#include "core/divide_by_zero_error.h"
-#include "core/illegal_argument_exception.h"
-#include "core/interpreter_exception.h"
-#include "core/parse_exception.h"
-#include "core/readonly_exception.h"
-#include "core/runtime_exception.h"
-#include "core/unsupported_exception.h"
-
-#endif
diff --git a/libbash-0.1/src/core/function.cpp b/libbash-0.1/src/core/function.cpp
deleted file mode 100644
index 5fda04b..0000000
--- a/libbash-0.1/src/core/function.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
- */
-///
-/// \file function.cpp
-/// \author Mu Qiao
-/// \brief implementation for function
-///
-
-#include "core/function.h"
-
-#include <functional>
-
-#include "core/bash_ast.h"
-#include "core/interpreter.h"
-
-void function::call(interpreter& walker)
-{
- ast.interpret_with(walker,
- std::bind(bash_ast::call_function,
- std::placeholders::_1,
- index));
-}
diff --git a/libbash-0.1/src/core/function.h b/libbash-0.1/src/core/function.h
deleted file mode 100644
index fcd0e91..0000000
--- a/libbash-0.1/src/core/function.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file function.hpp
-/// \brief implementation for function
-///
-
-#ifndef LIBBASH_CORE_FUNCTION_H_
-#define LIBBASH_CORE_FUNCTION_H_
-
-#include "core/exceptions.h"
-
-#include <antlr3.h>
-
-class bash_ast;
-class interpreter;
-
-class function
-{
- bash_ast& ast;
- ANTLR3_MARKER index;
-public:
- function(bash_ast& ast_, ANTLR3_MARKER i): ast(ast_), index(i){}
-
- void call(interpreter& walker);
-};
-
-#endif
diff --git a/libbash-0.1/src/core/illegal_argument_exception.h b/libbash-0.1/src/core/illegal_argument_exception.h
deleted file mode 100644
index f67a9f6..0000000
--- a/libbash-0.1/src/core/illegal_argument_exception.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file illegal_argument_exception.h
-/// \brief implementation for illegal_argument_exception
-///
-
-#ifndef LIBBASH_CORE_ILLEGAL_ARGUMENT_EXCEPTION_H_
-#define LIBBASH_CORE_ILLEGAL_ARGUMENT_EXCEPTION_H_
-
-#include <stdexcept>
-#include <string>
-
-#include "common.h"
-#include "interpreter_exception.h"
-
-namespace libbash
-{
- ///
- /// \class illegal_argument_exception
- /// \brief exception for parsing errors
- ///
- class LIBBASH_API illegal_argument_exception: public libbash::interpreter_exception
- {
- public:
- explicit illegal_argument_exception(const std::string& err_msg):
- libbash::interpreter_exception(err_msg){}
- };
-}
-
-#endif
diff --git a/libbash-0.1/src/core/interpreter.cpp b/libbash-0.1/src/core/interpreter.cpp
deleted file mode 100644
index ed9f626..0000000
--- a/libbash-0.1/src/core/interpreter.cpp
+++ /dev/null
@@ -1,437 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file interpreter.cpp
-/// \brief implementations for bash interpreter (visitor pattern).
-///
-#include "core/interpreter.h"
-
-#include <cctype>
-
-#include <functional>
-#include <limits>
-
-#include <boost/algorithm/string/classification.hpp>
-#include <boost/algorithm/string/join.hpp>
-#include <boost/algorithm/string/replace.hpp>
-#include <boost/algorithm/string/split.hpp>
-#include <boost/algorithm/string/trim.hpp>
-#include <boost/foreach.hpp>
-#include <boost/range/adaptor/filtered.hpp>
-#include <boost/range/adaptor/map.hpp>
-#include <boost/range/algorithm/copy.hpp>
-
-#include "core/bash_ast.h"
-
-namespace
-{
- std::string get_options(std::map<char, bool>& options)
- {
- std::string result;
- boost::copy(options | boost::adaptors::map_keys
- | boost::adaptors::filtered(
- [&](char option) -> bool {
- return options[option];
- }
- ),
- back_inserter(result));
- return result;
- }
-}
-
-interpreter::interpreter(): _out(&std::cout), _err(&std::cerr), _in(&std::cin), additional_options(
- {
- {"autocd", false},
- {"cdable_vars", false},
- {"cdspell", false},
- {"checkhash", false},
- {"checkjobs", false},
- {"checkwinsize", false},
- {"cmdhist", false},
- {"compat31", false},
- {"dirspell", false},
- {"dotglob", false},
- {"execfail", false},
- {"expand_aliases", false},
- {"extdebug", false},
- {"extglob", false},
- {"extquote", false},
- {"failglob", false},
- {"force_fignore", false},
- {"globstar", false},
- {"gnu_errfmt", false},
- {"histappend", false},
- {"histreedit", false},
- {"histverify", false},
- {"hostcomplete", false},
- {"huponexit", false},
- {"interactive", false},
- {"lithist", false},
- {"login_shell", false},
- {"mailwarn", false},
- {"no_empty_cmd_completion", false},
- {"nocaseglob", false},
- {"nocasematch", false},
- {"nullglob", false},
- {"progcomp", false},
- {"promptvars", false},
- {"restricted", false},
- {"shift_verbose", false},
- {"sourcepath", false},
- {"xpg_echo", false},
- }
- ), options(
- {
- {'a', false},
- {'b', false},
- {'e', false},
- {'f', false},
- {'h', true},
- {'k', false},
- {'m', false},
- {'n', false},
- {'p', false},
- {'t', false},
- {'u', false},
- {'v', false},
- {'x', false},
- {'B', true},
- {'C', false},
- {'E', false},
- {'H', false},
- {'P', false},
- {'T', false},
- }
- ), status(0)
-{
- define("IFS", " \t\n");
- // We do not support the options set by the shell itself (such as the -i option)
- define("-", get_options(options));
-}
-
-std::shared_ptr<variable> interpreter::resolve_variable(const std::string& name) const
-{
- if(name.empty())
- return std::shared_ptr<variable>();
-
- BOOST_REVERSE_FOREACH(auto& frame, local_members)
- {
- auto iter_local = frame.find(name);
- if(iter_local != frame.end())
- return iter_local->second;
- }
-
- auto iter_global = members.find(name);
- if(iter_global == members.end())
- return std::shared_ptr<variable>();
- return iter_global->second;
-}
-
-bool interpreter::is_unset_or_null(const std::string& name,
- const unsigned index) const
-{
- auto var = resolve_variable(name);
- if(!var)
- return true;
- return var->is_null(index);
-}
-
-std::string interpreter::get_substring(const std::string& name,
- long long offset,
- unsigned length,
- const unsigned index) const
-{
- std::string value = resolve<std::string>(name, index);
- if(!get_real_offset(offset, boost::numeric_cast<unsigned>(value.size())))
- return "";
- // After get_real_offset, we know offset can be cast to unsigned.
- return value.substr(boost::numeric_cast<std::string::size_type>(offset), length);
-}
-
-const std::string interpreter::do_substring_expansion(const std::string& name,
- long long offset,
- const unsigned index) const
-{
- return get_substring(name, offset, std::numeric_limits<unsigned>::max(), index);
-}
-
-const std::string interpreter::do_substring_expansion(const std::string& name,
- long long offset,
- int length,
- const unsigned index) const
-{
- if(length < 0)
- throw libbash::illegal_argument_exception("length of substring expression should be greater or equal to zero");
-
- return get_substring(name, offset, boost::numeric_cast<unsigned>(length), index);
-}
-
-std::string interpreter::get_subarray(const std::string& name,
- long long offset,
- unsigned length) const
-{
- std::vector<std::string> array;
- if(name == "*" || name == "@")
- {
- // ${*:1} has the same content as ${*}, ${*:0} contains current script name as the first element
- if(offset > 0)
- offset--;
- else if(offset == 0)
- array.push_back(resolve<std::string>("0"));
- }
- // We do not support arrays that have size bigger than numeric_limits<unsigned>::max()
- if(resolve_array(name, array) && get_real_offset(offset, boost::numeric_cast<unsigned>(array.size())))
- {
- // We do not support arrays that have size bigger than numeric_limits<unsigned>::max()
- // After get_real_offset, we know offset can be cast to unsigned.
- unsigned max_length = boost::numeric_cast<unsigned>(array.size()) - boost::numeric_cast<unsigned>(offset);
- if(length > max_length)
- length = max_length;
-
- auto start = array.begin() + boost::numeric_cast<std::vector<std::string>::difference_type>(offset);
- auto end = array.begin() + boost::numeric_cast<std::vector<std::string>::difference_type>(offset + length);
- return boost::algorithm::join(std::vector<std::string>(start, end), resolve<std::string>("IFS").substr(0, 1));
- }
- else
- {
- return "";
- }
-}
-
-const std::string interpreter::do_subarray_expansion(const std::string& name,
- long long offset) const
-{
- return get_subarray(name, offset, std::numeric_limits<unsigned>::max());
-}
-
-const std::string interpreter::do_subarray_expansion(const std::string& name,
- long long offset,
- int length) const
-{
- if(length < 0)
- throw libbash::illegal_argument_exception("length of substring expression should be greater or equal to zero");
-
- return get_subarray(name, offset, boost::numeric_cast<unsigned>(length));
-}
-
-std::string interpreter::do_replace_expansion(const std::string& name,
- std::function<void(std::string&)> replacer,
- const unsigned index) const
-{
- std::string value = resolve<std::string>(name, index);
- replacer(value);
- return value;
-}
-
-std::string::size_type interpreter::get_length(const std::string& name,
- const unsigned index) const
-{
- auto var = resolve_variable(name);
- if(!var)
- return 0;
- return var->get_length(index);
-}
-
-variable::size_type interpreter::get_array_length(const std::string& name) const
-{
- auto var = resolve_variable(name);
- if(!var)
- return 0;
- return var->get_array_length();
-}
-
-void interpreter::get_all_elements_joined(const std::string& name,
- const std::string& delim,
- std::string& result) const
-{
- std::vector<std::string> array;
-
- if(resolve_array(name, array))
- result = boost::algorithm::join(array, delim);
- else
- result = "";
-}
-
-void interpreter::get_all_elements(const std::string& name,
- std::string& result) const
-{
- get_all_elements_joined(name, " ", result);
-}
-
-void interpreter::get_all_elements_IFS_joined(const std::string& name,
- std::string& result) const
-{
- get_all_elements_joined(name,
- resolve<std::string>("IFS").substr(0, 1),
- result);
-}
-
-void interpreter::split_word(const std::string& word, std::vector<std::string>& output) const
-{
- const std::string& delimeter = resolve<std::string>("IFS");
- std::string trimmed(word);
- boost::trim_if(trimmed, boost::is_any_of(delimeter));
-
- if(trimmed == "")
- return;
-
- std::vector<std::string> splitted_values;
- boost::split(splitted_values, trimmed, boost::is_any_of(delimeter), boost::token_compress_on);
- output.insert(output.end(), splitted_values.begin(), splitted_values.end());
-}
-
-void interpreter::define_function_arguments(scope& current_stack,
- const std::vector<std::string>& arguments)
-{
- std::map<unsigned, std::string> positional_args;
-
- for(auto i = 1u; i <= arguments.size(); ++i)
- positional_args[i] = arguments[i - 1];
-
- current_stack["*"].reset(new variable("*", positional_args, true));
-}
-
-void interpreter::call(const std::string& name,
- const std::vector<std::string>& arguments)
-{
- // Prepare arguments
- define_function_arguments(local_members.back(), arguments);
-
- auto iter = functions.find(name);
- if(iter != functions.end())
- iter->second.call(*this);
- else
- throw libbash::runtime_exception(name + " is not defined.");
-}
-
-void interpreter::replace_all(std::string& value,
- const boost::xpressive::sregex& pattern,
- const std::string& replacement)
-{
- value = boost::xpressive::regex_replace(value,
- pattern,
- replacement,
- boost::xpressive::regex_constants::format_literal);
-}
-
-void interpreter::lazy_remove_at_end(std::string& value,
- const boost::xpressive::sregex& pattern)
-{
- boost::xpressive::smatch what;
- if(boost::xpressive::regex_match(value,
- what,
- pattern))
- value = what[1];
-}
-
-void interpreter::replace_first(std::string& value,
- const boost::xpressive::sregex& pattern,
- const std::string& replacement)
-{
- value = boost::xpressive::regex_replace(value,
- pattern,
- replacement,
- boost::xpressive::regex_constants::format_literal | boost::xpressive::regex_constants::format_first_only);
-}
-
-void interpreter::trim_trailing_eols(std::string& value)
-{
- boost::trim_right_if(value, boost::is_any_of("\n"));
-}
-
-void interpreter::get_all_function_names(std::vector<std::string>& function_names) const
-{
- boost::copy(functions | boost::adaptors::map_keys, back_inserter(function_names));
-}
-
-namespace
-{
- void check_unset_positional(const std::string& name)
- {
- // Unsetting positional parameters is not allowed
- if(isdigit(name[0]))
- throw libbash::runtime_exception("unset: not a valid identifier");
- }
-}
-
-void interpreter::unset(const std::string& name)
-{
- check_unset_positional(name);
-
- auto unsetter = [&](scope& frame) -> bool {
- auto iter_local = frame.find(name);
- if(iter_local != frame.end())
- {
- if(iter_local->second->is_readonly())
- throw libbash::readonly_exception("unset a readonly variable");
- frame.erase(iter_local);
- return true;
- }
- return false;
- };
-
- if(std::none_of(local_members.rbegin(), local_members.rend(), unsetter))
- unsetter(members);
-}
-
-// We need to return false when unsetting readonly functions in future
-void interpreter::unset_function(const std::string& name)
-{
- auto function = functions.find(name);
- if(function != functions.end())
- functions.erase(name);
-}
-
-void interpreter::unset(const std::string& name,
- const unsigned index)
-{
- check_unset_positional(name);
-
- auto var = resolve_variable(name);
- if(var)
- {
- if(var->is_readonly())
- throw libbash::readonly_exception("unset a readonly variable");
- var->unset_value(index);
- }
-}
-
-bool interpreter::get_additional_option(const std::string& name) const
-{
- auto iter = additional_options.find(name);
- if(iter == additional_options.end())
- throw libbash::illegal_argument_exception("Invalid bash option");
-
- return iter->second;
-}
-
-void interpreter::set_additional_option(const std::string& name, bool value)
-{
- auto iter = additional_options.find(name);
- if(iter == additional_options.end())
- throw libbash::illegal_argument_exception(name + " is not a valid bash option");
-
- iter->second = value;
-}
-
-long interpreter::eval_arithmetic(const std::string& expression)
-{
- bash_ast ast(std::stringstream(expression), &bash_ast::parser_arithmetics);
- return ast.interpret_with(*this, &bash_ast::walker_arithmetics);
-}
diff --git a/libbash-0.1/src/core/interpreter.h b/libbash-0.1/src/core/interpreter.h
deleted file mode 100644
index b0cfda5..0000000
--- a/libbash-0.1/src/core/interpreter.h
+++ /dev/null
@@ -1,517 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file interpreter.h
-/// \brief implementation for bash interpreter (visitor pattern)
-///
-
-#ifndef LIBBASH_CORE_INTERPRETER_H_
-#define LIBBASH_CORE_INTERPRETER_H_
-
-#include <functional>
-#include <memory>
-#include <string>
-
-#include <boost/utility.hpp>
-#include <boost/xpressive/xpressive.hpp>
-#include <boost/numeric/conversion/cast.hpp>
-
-#include "core/function.h"
-#include "core/symbols.hpp"
-#include "cppbash_builtin.h"
-
-typedef std::unordered_map<std::string, std::shared_ptr<variable>> scope;
-
-///
-/// \class interpreter
-/// \brief implementation for bash interpreter
-///
-class interpreter: public boost::noncopyable
-{
-
- /// \var private::members
- /// \brief global symbol table for variables
- scope members;
-
- /// \var private::function_definitions
- /// \brief global symbol table for functions
- std::unordered_map<std::string, function> functions;
-
- std::stack<bash_ast*> ast_stack;
-
- /// \var private::local_members
- /// \brief local scope for function arguments, execution environment and
- /// local variables
- std::vector<scope> local_members;
-
- std::ostream* _out;
-
- std::ostream* _err;
-
- std::istream* _in;
-
- // std::map is chosen for sorted output in shopt -p
- std::map<std::string, bool> additional_options;
-
- // std::map is chosen for sorted output in $-. The order may not be the same
- // as bash implementation.
- std::map<char, bool> options;
-
- /// \var private::status
- /// \brief the return status of the last command
- int status;
-
- /// \brief calculate the correct offset when offset < 0 and check whether
- /// the real offset is in legal range
- /// \param[in,out] a value/result argument referring to offset
- /// \param[in] the original string
- /// \return whether the real offset is in legal range
- bool get_real_offset(long long& offset, const unsigned size) const
- {
- offset = (offset >= 0? offset : size + offset);
- return !(offset < 0 || offset >= size);
- }
-
- void get_all_elements_joined(const std::string& name,
- const std::string& delim,
- std::string& result) const;
-
- std::shared_ptr<variable> resolve_variable(const std::string&) const;
-
- void define_function_arguments(scope& current_stack,
- const std::vector<std::string>& arguments);
-
- std::string get_substring(const std::string& name,
- long long offset,
- unsigned length,
- const unsigned index) const;
-
- std::string get_subarray(const std::string& name,
- long long offset,
- unsigned length) const;
-public:
-
- typedef std::map<std::string, bool>::const_iterator option_iterator;
-
- ///
- /// \class local_scope
- /// \brief RAII concept for local scope management
- ///
- class local_scope
- {
- interpreter& walker;
-
- public:
- local_scope(interpreter& w): walker(w)
- {
- walker.local_members.push_back(scope());
- }
-
- ~local_scope()
- {
- walker.local_members.pop_back();
- }
- };
-
- interpreter();
-
- ///
- /// \brief return the number of variables
- /// \return the number of variables
- scope::size_type size() const
- {
- return members.size();
- }
-
- ///
- /// \brief return an iterator referring to the first variable
- /// \return iterator referring to the first variable
- scope::iterator begin()
- {
- return members.begin();
- }
-
- ///
- /// \brief return a const iterator referring to the first variable
- /// \return const iterator referring to the first variable
- scope::const_iterator begin() const
- {
- return members.begin();
- }
-
- ///
- /// \brief return an iterator referring to the next element after the
- /// last variable
- /// \return iterator referring to he next element after the last variable
- scope::iterator end()
- {
- return members.end();
- }
-
- ///
- /// \brief return a const iterator referring to the next element after
- /// the last variable
- /// \return const iterator referring to he next element after the last
- /// variable
- scope::const_iterator end() const
- {
- return members.end();
- }
-
- void set_output_stream(std::ostream* stream)
- {
- _out = stream;
- }
-
- void restore_output_stream()
- {
- _out = &std::cout;
- }
-
- /// \brief resolve string/long variable, local scope will be
- /// checked first, then global scope
- /// \param variable name
- /// \param array index, use index=0 if it's not an array
- /// \return the value of the variable, call default constructor if
- /// it's undefined
- template <typename T>
- T resolve(const std::string& name, const unsigned index=0) const
- {
- auto var = resolve_variable(name);
- if(var)
- return var->get_value<T>(index);
- else
- return T{};
- }
-
- /// \brief resolve array variable
- /// \param variable name
- /// \param[out] vector that stores all array values
- template <typename T>
- bool resolve_array(const std::string& name, std::vector<T>& values) const
- {
- auto var = resolve_variable(name);
- if(!var)
- return false;
-
- var->get_all_values(values);
- return true;
- }
-
- /// \brief check whether the value of the variable is null, return true
- /// if the variable is undefined
- /// \param variable name
- /// \return whether the value of the variable is null
- bool is_unset_or_null(const std::string& name, const unsigned index) const;
-
- /// \brief check whether the value of the variable is unset
- /// \param variable name
- /// \return whether the value of the variable is unset
- bool is_unset(const std::string& name) const
- {
- return members.find(name) == members.end();
- }
-
- /// \brief update the variable value, raise libbash::interpreter_exception if
- /// it's readonly, will define the variable if it doesn't exist
- /// \param variable name
- /// \param new value
- /// \param array index, use index=0 if it's not an array
- /// \return the new value of the variable
- template <typename T>
- const T& set_value(const std::string& name,
- const T& new_value,
- const unsigned index=0)
- {
- auto var = resolve_variable(name);
- if(var)
- var->set_value(new_value, index);
- else
- define(name, new_value, false, index);
- return new_value;
- }
-
- /// \brief set the return status of the last command
- /// \param the value of the return status
- void set_status(int s)
- {
- status = s;
- }
-
- /// \brief get the return status of the last command
- /// \param the value of the return status
- int get_status(void) const
- {
- return status;
- }
-
- /// \brief unset a variable
- /// \param the name of the variable
- void unset(const std::string& name);
-
- /// \brief unset a function
- /// \param the name of the function
- void unset_function(const std::string& name);
-
- /// \brief unset a array member
- /// \param the name of the array
- /// \param the index of the member
- void unset(const std::string& name, const unsigned index);
-
- /// \brief define a new global variable
- /// \param the name of the variable
- /// \param the value of the variable
- /// \param whether it's readonly, default is false
- /// \param whether it's null, default is false
- template <typename T>
- void define(const std::string& name,
- const T& value,
- bool readonly=false,
- const unsigned index=0)
- {
- members[name].reset(new variable(name, value, readonly, index));
- }
-
- /// \brief define a new local variable
- /// \param the name of the variable
- /// \param the value of the variable
- /// \param whether it's readonly, default is false
- /// \param whether it's null, default is false
- template <typename T>
- void define_local(const std::string& name,
- const T& value,
- bool readonly=false,
- const unsigned index=0)
- {
- local_members.back()[name].reset(new variable(name, value, readonly, index));
- }
-
- /// \brief define a new function
- /// \param the name of the function
- /// \param the body index of the function
- void define_function(const std::string& name,
- ANTLR3_MARKER body_index)
- {
- functions.insert(make_pair(name, function(*ast_stack.top(), body_index)));
- }
-
- /// \brief push current AST, used for function definition
- /// \param current ast
- void push_current_ast(bash_ast* ast)
- {
- ast_stack.push(ast);
- }
-
- /// \brief pop current AST, used for function definition
- void pop_current_ast()
- {
- ast_stack.pop();
- }
-
- /// \brief make function call
- /// \param function name
- /// \param function arguments
- void call(const std::string& name,
- const std::vector<std::string>& arguments);
-
- /// \brief check if we have 'name' defined as a function
- /// \param function name
- /// \return whether 'name' is a function
- bool has_function(const std::string& name) const
- {
- return functions.find(name) != functions.end();
- }
-
- void get_all_function_names(std::vector<std::string>& function_names) const;
-
- /// \brief execute builtin
- /// \param builtin name
- /// \param builtin arguments
- /// \return the return value of the builtin
- int execute_builtin(const std::string& name,
- const std::vector<std::string>& args,
- std::ostream* output=0,
- std::ostream* error=0,
- std::istream* input=0)
- {
- return cppbash_builtin::exec(name,
- args,
- output == 0 ? *_out : *output,
- error == 0 ? *_err : *error,
- input == 0 ? *_in : *input,
- *this);
- }
-
- /// \brief perform ${parameter:−word} expansion
- /// \param the name of the parameter
- /// \param the value of the word
- /// \return the expansion result
- const std::string do_default_expansion(const std::string& name,
- const std::string& value,
- const unsigned index) const
- {
- return (is_unset_or_null(name, index)?
- value : resolve<std::string>(name, index));
- }
-
- /// \brief perform ${parameter:=word} expansion
- /// \param the name of the parameter
- /// \param the value of the word
- /// \return the expansion result
- const std::string do_assign_expansion(const std::string& name,
- const std::string& value,
- const unsigned index)
- {
- return (is_unset_or_null(name, index)?
- set_value(name, value, index) : resolve<std::string>(name, index));
- }
-
- /// \brief perform ${parameter:+word} expansion
- /// \param the name of the parameter
- /// \param the value of the word
- /// \return the expansion result
- const std::string do_alternate_expansion(const std::string& name,
- const std::string& value,
- const unsigned index) const
- {
- return (is_unset_or_null(name, index)? "" : value);
- }
-
- /// \brief perform substring expansion
- /// \param the offset of the substring
- /// \return the expansion result
- const std::string do_substring_expansion(const std::string& name,
- long long offset,
- const unsigned index) const;
-
- /// \brief perform substring expansion
- /// \param the offset of the substring
- /// \param the length of the substring
- /// \return the expansion result
- const std::string do_substring_expansion(const std::string& name,
- long long offset,
- int length,
- const unsigned index) const;
-
- /// \brief perform subarray expansion
- /// \param the offset of the subarray
- /// \return the expansion result
- const std::string do_subarray_expansion(const std::string& name,
- long long offset) const;
-
- /// \brief perform subarray expansion
- /// \param the offset of the subarray
- /// \param the length of the subarray
- /// \return the expansion result
- const std::string do_subarray_expansion(const std::string& name,
- long long offset,
- int length) const;
-
- /// \brief perform replacement expansion
- /// \param the name of the varaible that needs to be expanded
- /// \param the function object used to perform expansion
- /// \param array index, use index=0 if it's not an array
- /// \return the expanded value
- std::string do_replace_expansion(const std::string& name,
- std::function<void(std::string&)> replacer,
- const unsigned index) const;
-
- /// \brief get the length of a string variable
- /// \param the name of the variable
- /// \return the length
- std::string::size_type get_length(const std::string& name, const unsigned index=0) const;
-
- /// \brief get the length of an array
- /// \param the name of the array
- /// \return the length of the array
- variable::size_type get_array_length(const std::string& name) const;
-
- /// \brief get all array elements concatenated by space
- /// \param the name of the array
- /// \param[out] the concatenated string
- void get_all_elements(const std::string&, std::string&) const;
-
- /// \brief get all array elements concatenated by the first character of IFS
- /// \param the name of the array
- /// \param[out] the concatenated string
- void get_all_elements_IFS_joined(const std::string&, std::string&) const;
-
- /// \brief implementation of word splitting
- /// \param the value of the word
- //. \param[out] the splitted result will be appended to output
- void split_word(const std::string& word, std::vector<std::string>& output) const;
-
- /// \brief get the status of shell optional behavior
- /// \param the option name
- /// \return zero unless the name is not a valid shell option
- bool get_additional_option(const std::string& name) const;
-
- /// \brief set the status of shell optional behavior
- /// \param the option name
- /// \param[in] true if option is enabled, false otherwise
- /// \return zero unless the name is not a valid shell option
- void set_additional_option(const std::string& name, bool value);
-
- /// \brief return an iterator referring to the first variable
- /// \return iterator referring to the first variable
- option_iterator additional_options_begin() const
- {
- return additional_options.begin();
- }
-
- /// \brief return an iterator referring to the next element after the
- /// last variable
- /// \return iterator referring to he next element after the last variable
- option_iterator additional_options_end() const
- {
- return additional_options.end();
- }
-
- /// \brief evaluate arithmetic expression and return the result
- /// \param the arithmetic expression
- /// \return the evaluated result
- long eval_arithmetic(const std::string& expression);
-
- /// \brief perform expansion like ${var//foo/bar}
- /// \param the value to be expanded
- /// \param the pattern used to match the value
- /// \param the replacement string
- static void replace_all(std::string& value,
- const boost::xpressive::sregex& pattern,
- const std::string& replacement);
-
- /// \brief perform expansion like ${var%foo}
- /// \param the value to be expanded
- /// \param the pattern used to match the value
- static void lazy_remove_at_end(std::string& value,
- const boost::xpressive::sregex& pattern);
-
- /// \brief perform expansion like ${var/foo/bar}
- /// \param the value to be expanded
- /// \param the pattern used to match the value
- /// \param the replacement string
- static void replace_first(std::string& value,
- const boost::xpressive::sregex& pattern,
- const std::string& replacement);
-
- /// \brief remove trailing EOLs from the value
- /// \param[in, out] the target
- static void trim_trailing_eols(std::string& value);
-};
-#endif
diff --git a/libbash-0.1/src/core/interpreter_exception.h b/libbash-0.1/src/core/interpreter_exception.h
deleted file mode 100644
index ea5a9ef..0000000
--- a/libbash-0.1/src/core/interpreter_exception.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file interpreter_exception.h
-/// \brief implementation for interpreter_exception
-///
-
-#ifndef LIBBASH_CORE_INTERPRETER_EXCEPTION_H_
-#define LIBBASH_CORE_INTERPRETER_EXCEPTION_H_
-
-#include <stdexcept>
-#include <string>
-
-#include "common.h"
-
-namespace libbash
-{
- ///
- /// \class interpreter_exception
- /// \brief runtime exception occured during interpreting
- ///
- class LIBBASH_API interpreter_exception: public std::runtime_error
- {
- public:
- explicit interpreter_exception(const std::string& err_msg):
- runtime_error(err_msg){}
- };
-}
-
-#endif
diff --git a/libbash-0.1/src/core/parse_exception.h b/libbash-0.1/src/core/parse_exception.h
deleted file mode 100644
index 20860b4..0000000
--- a/libbash-0.1/src/core/parse_exception.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file parse_exception.h
-/// \brief implementation for parse_exception
-///
-
-#ifndef LIBBASH_CORE_PARSE_EXCEPTION_H_
-#define LIBBASH_CORE_PARSE_EXCEPTION_H_
-
-#include <stdexcept>
-#include <string>
-
-#include "common.h"
-#include "interpreter_exception.h"
-
-namespace libbash
-{
- ///
- /// \class parse_exception
- /// \brief exception for parsing errors
- ///
- class LIBBASH_API parse_exception: public libbash::interpreter_exception
- {
- public:
- explicit parse_exception(const std::string& err_msg):
- libbash::interpreter_exception(err_msg){}
- };
-}
-
-#endif
diff --git a/libbash-0.1/src/core/readonly_exception.h b/libbash-0.1/src/core/readonly_exception.h
deleted file mode 100644
index 97964de..0000000
--- a/libbash-0.1/src/core/readonly_exception.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file readonly_exception.h
-/// \brief implementation for readonly_exception
-///
-
-#ifndef LIBBASH_CORE_READONLY_EXCEPTION_H_
-#define LIBBASH_CORE_READONLY_EXCEPTION_H_
-
-#include <stdexcept>
-#include <string>
-
-#include "common.h"
-#include "interpreter_exception.h"
-
-namespace libbash
-{
- ///
- /// \class readonly_exception
- /// \brief exception for modifying readonly symbols
- ///
- class LIBBASH_API readonly_exception: public libbash::interpreter_exception
- {
- public:
- explicit readonly_exception(const std::string& err_msg):
- libbash::interpreter_exception(err_msg){}
- };
-}
-
-#endif
diff --git a/libbash-0.1/src/core/runtime_exception.h b/libbash-0.1/src/core/runtime_exception.h
deleted file mode 100644
index da6fffa..0000000
--- a/libbash-0.1/src/core/runtime_exception.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file runtime_exception.h
-/// \brief implementation for runtime_exception
-///
-
-#ifndef LIBBASH_CORE_RUNTIME_EXCEPTION_H_
-#define LIBBASH_CORE_RUNTIME_EXCEPTION_H_
-
-#include <stdexcept>
-#include <string>
-
-#include "common.h"
-#include "interpreter_exception.h"
-
-namespace libbash
-{
- ///
- /// \class runtime_exception
- /// \brief exception for runtime errors
- ///
- class LIBBASH_API runtime_exception: public libbash::interpreter_exception
- {
- public:
- explicit runtime_exception(const std::string& err_msg):
- libbash::interpreter_exception(err_msg){}
- };
-}
-
-#endif
diff --git a/libbash-0.1/src/core/symbols.hpp b/libbash-0.1/src/core/symbols.hpp
deleted file mode 100644
index 8c6dec7..0000000
--- a/libbash-0.1/src/core/symbols.hpp
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file symbols.hpp
-/// \brief template implementation for symbols and symbol table
-///
-
-#ifndef LIBBASH_CORE_SYMBOLS_HPP_
-#define LIBBASH_CORE_SYMBOLS_HPP_
-
-#include <map>
-#include <memory>
-#include <sstream>
-#include <string>
-#include <unordered_map>
-#include <vector>
-
-#include <boost/variant.hpp>
-#include <boost/lexical_cast.hpp>
-
-#include "core/exceptions.h"
-
-///
-/// \class converter
-/// \brief template class of converter
-///
-template<typename T>
-class converter: public boost::static_visitor<T>
-{};
-
-///
-/// \class converter
-/// \brief specialized converter for long
-///
-template<>
-class converter<long>: public boost::static_visitor<long>
-{
-public:
- /// \brief converter for long value
- /// \param the value to be converted
- /// \return the converted long
- long operator() (const long value) const
- {
- return value;
- }
-
- /// \brief converter for string value
- /// \param the value to be converted
- /// \return the converted long
- long operator() (const std::string& value) const
- {
- long result = 0;
- try
- {
- result = boost::lexical_cast<long>(value);
- }
- catch(boost::bad_lexical_cast& e)
- {
- std::cerr << "can't cast " << value << " to long" << std::endl;
- }
- return result;
- }
-};
-
-///
-/// \class converter
-/// \brief specialized converter for string
-///
-template<>
-class converter<std::string>:
- public boost::static_visitor<std::string>
-{
-public:
- /// \brief converter for long value
- /// \param the value to be converted
- /// \return the converted string
- std::string operator() (const long value) const
- {
- return boost::lexical_cast<std::string>(value);
- }
-
- /// \brief converter for string value
- /// \param the value to be converted
- /// \return the converted string
- std::string operator() (const std::string& value) const
- {
- return value;
- }
-};
-
-///
-/// \class variable
-/// \brief implementation for all variable types
-///
-class variable
-{
- /// \var private::name
- /// \brief variable name
- std::string name;
-
- /// \var private::value
- /// \brief actual value of the variable. We put string in front of long
- /// because we want "" as default string value; Otherwise we
- /// will get "0".
- std::map<unsigned, boost::variant<std::string, long>> value;
-
- /// \var private::readonly
- /// \brief whether the variable is readonly
- bool readonly;
-
-public:
- typedef std::map<unsigned, boost::variant<std::string, long>>::size_type size_type;
-
- /// \brief retrieve variable name
- /// \return const string value of variable name
- const std::string& get_name() const
- {
- return name;
- }
-
- template <typename T>
- variable(const std::string& name,
- const T& v,
- bool ro=false,
- const unsigned index=0)
- : name(name), readonly(ro)
- {
- value[index] = v;
- }
-
- /// \brief retrieve actual value of the variable, if index is out of bound,
- /// will return the default value of type T
- /// \return the value of the variable
- template<typename T>
- T get_value(const unsigned index=0) const
- {
- static converter<T> visitor;
-
- auto iter = value.find(index);
- if(iter == value.end())
- return T{};
-
- return boost::apply_visitor(visitor, iter->second);
- }
-
- /// \brief retrieve all values of the array
- /// \param[out] vector that stores all array values
- template<typename T>
- void get_all_values(std::vector<T>& all_values) const
- {
- static converter<T> visitor;
-
- for(auto iter = value.begin(); iter != value.end(); ++iter)
- all_values.push_back(
- boost::apply_visitor(visitor, iter->second));
- }
-
-
- /// \brief set the value of the variable, raise exception if it's readonly
- /// \param the new value to be set
- /// \param array index, use index=0 if it's not an array
- /// \param whether to set the variable to null value, default is false
- template <typename T>
- void set_value(const T& new_value,
- const unsigned index=0)
- {
- if(readonly)
- throw libbash::readonly_exception(get_name() + " is readonly variable");
-
- value[index] = new_value;
- }
-
- /// \brief unset the variable, only used for array variable
- /// \param the index to be unset
- void unset_value(const unsigned index)
- {
- if(readonly)
- throw libbash::readonly_exception(get_name() + " is readonly variable");
-
- value.erase(index);
- }
-
- /// \brief get the length of a variable
- /// \param the index of the variable, use 0 if it's not an array
- /// \return the length of the variable
- std::string::size_type get_length(const unsigned index=0) const
- {
- return get_value<std::string>(index).size();
- }
-
- /// \brief get the length of an array variable
- /// \return the length of the array
- size_type get_array_length() const
- {
- return value.size();
- }
-
- /// \brief check whether the value of the variable is null
- /// \return whether the value of the variable is null
- bool is_unset(const unsigned index=0) const
- {
- return value.find(index) == value.end();
- }
-
- /// \brief check whether the value of the variable is unset
- /// \return whether the value of the variable is unset
- bool is_null(const unsigned index=0) const
- {
- return get_value<std::string>(index) == "";
- }
-
- /// \brief check whether the value of the variable is readonly
- /// \return whether the value of the variable is readonly
- bool is_readonly() const
- {
- return readonly;
- }
-};
-
-// specialization for arrays
-template <>
-inline variable::variable<>(const std::string& name,
- const std::map<unsigned, std::string>& v,
- bool ro,
- unsigned)
- : name(name), value(v.begin(), v.end()), readonly(ro)
-{
-}
-
-#endif
diff --git a/libbash-0.1/src/core/tests/bash_ast_test.cpp b/libbash-0.1/src/core/tests/bash_ast_test.cpp
deleted file mode 100644
index b01393d..0000000
--- a/libbash-0.1/src/core/tests/bash_ast_test.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file bash_ast_test.cpp
-/// \brief series of unit tests for interpreter.
-///
-
-#include <fstream>
-#include <sstream>
-#include <string>
-
-#include <gtest/gtest.h>
-
-#include "core/bash_ast.h"
-#include "core/interpreter.h"
-#include "test.h"
-
-TEST(bash_ast, parse_illegal_script)
-{
- EXPECT_THROW(bash_ast ast(get_src_dir() + std::string("/scripts/illegal_script.sh")), libbash::parse_exception);
-}
-
-TEST(bash_ast, parse_legal_script)
-{
- bash_ast(get_src_dir() + std::string("/scripts/source_true.sh"));
- bash_ast(get_src_dir() + std::string("/scripts/source_false.sh"));
-}
-
-TEST(bash_ast, parse_arithmetics)
-{
- std::string expr("1 + 2");
- bash_ast ast(std::stringstream(expr), bash_ast::parser_arithmetics);
- interpreter walker;
- EXPECT_EQ(3, ast.interpret_with(walker, &bash_ast::walker_arithmetics));
-}
-
-TEST(bash_ast, illegal_path)
-{
- EXPECT_THROW(bash_ast("not_exist"), libbash::parse_exception);
-}
diff --git a/libbash-0.1/src/core/tests/bash_condition_test.cpp b/libbash-0.1/src/core/tests/bash_condition_test.cpp
deleted file mode 100644
index 09f441a..0000000
--- a/libbash-0.1/src/core/tests/bash_condition_test.cpp
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file bash_condition_test.cpp
-/// \brief series of unit tests for interpreter.
-///
-#include <fcntl.h>
-#include <stdlib.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <utime.h>
-
-#include <boost/lexical_cast.hpp>
-#include <gtest/gtest.h>
-
-#include "core/bash_condition.h"
-#include "core/exceptions.h"
-#include "core/interpreter.h"
-
-namespace
-{
- void set_time(const std::string& target, int ac, int mod)
- {
- struct utimbuf timebuf;
- timebuf.actime = ac;
- timebuf.modtime = mod;
- EXPECT_EQ(0, utime(target.c_str(), &timebuf));
- }
-
- class file_test: public testing::Test
- {
- protected:
- const std::string positive;
- const std::string negative;
- const std::string test_link;
- const std::string test_fifo;
-
- file_test(): positive("scripts/test.positive"),
- negative("scripts/test.negative"),
- test_link("scripts/test.link"),
- test_fifo("scripts/test.fifo") {}
-
- virtual void SetUp()
- {
- EXPECT_NE(-1, creat(positive.c_str(),
- S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)
- ) << "Can't create " << positive << " for test";
- set_time(positive, 0, 0);
- EXPECT_NE(-1, creat(negative.c_str(), 0)) << "Can't create " << negative << " for test";
- set_time(negative, 2, 1);
- EXPECT_EQ(0, symlink(positive.c_str(), test_link.c_str()));
- EXPECT_EQ(0, mkfifo(test_fifo.c_str(), 0));
- }
-
- virtual void TearDown()
- {
- EXPECT_EQ(0, unlink(test_fifo.c_str()));
- EXPECT_EQ(0, unlink(positive.c_str()));
- EXPECT_EQ(0, unlink(negative.c_str()));
- EXPECT_EQ(0, unlink(test_link.c_str()));
- }
- };
-}
-
-TEST_F(file_test, file_flags_positive)
-{
- EXPECT_TRUE(internal::test_unary('a', "/"));
- EXPECT_TRUE(internal::test_unary('b', "/dev/root")) << "You should have /dev/root, or unit test won't pass";
- EXPECT_TRUE(internal::test_unary('c', "/dev/random"));
- EXPECT_TRUE(internal::test_unary('d', "/"));
- EXPECT_TRUE(internal::test_unary('e', "/"));
- EXPECT_TRUE(internal::test_unary('f', positive));
- EXPECT_TRUE(internal::test_unary('g', positive));
- EXPECT_TRUE(internal::test_unary('h', test_link));
- EXPECT_TRUE(internal::test_unary('k', positive));
- EXPECT_TRUE(internal::test_unary('p', test_fifo));
- EXPECT_TRUE(internal::test_unary('r', positive));
- EXPECT_TRUE(internal::test_unary('s', "/etc/fstab"));
- EXPECT_TRUE(internal::test_unary('u', positive));
- EXPECT_TRUE(internal::test_unary('w', positive));
- EXPECT_TRUE(internal::test_unary('x', positive));
- EXPECT_TRUE(internal::test_unary('L', test_link));
- EXPECT_TRUE(internal::test_unary('O', positive));
- EXPECT_TRUE(internal::test_unary('G', positive));
- EXPECT_TRUE(internal::test_unary('S', "/dev/log")) << "You should have /dev/log, or unit test won't pass";
- EXPECT_TRUE(internal::test_unary('N', positive));
-}
-
-TEST_F(file_test, file_flags_negative)
-{
- EXPECT_FALSE(internal::test_unary('a', "not_exist"));
- EXPECT_FALSE(internal::test_unary('b', negative));
- EXPECT_FALSE(internal::test_unary('c', negative));
- EXPECT_FALSE(internal::test_unary('d', negative));
- EXPECT_FALSE(internal::test_unary('e', "not_exist"));
- EXPECT_FALSE(internal::test_unary('f', "/"));
- EXPECT_FALSE(internal::test_unary('g', negative));
- EXPECT_FALSE(internal::test_unary('h', negative));
- EXPECT_FALSE(internal::test_unary('k', negative));
- EXPECT_FALSE(internal::test_unary('p', negative));
- EXPECT_FALSE(internal::test_unary('r', negative));
- EXPECT_FALSE(internal::test_unary('s', negative));
- EXPECT_FALSE(internal::test_unary('t', "/dev/stdin"));
- EXPECT_FALSE(internal::test_unary('u', negative));
- EXPECT_FALSE(internal::test_unary('w', negative));
- EXPECT_FALSE(internal::test_unary('x', negative));
- EXPECT_FALSE(internal::test_unary('L', negative));
- EXPECT_FALSE(internal::test_unary('O', "/etc/fstab"));
- EXPECT_FALSE(internal::test_unary('G', "/etc/fstab"));
- EXPECT_FALSE(internal::test_unary('S', negative));
- EXPECT_FALSE(internal::test_unary('N', negative));
-}
-
-TEST(bash_condition, string_unary_operator)
-{
- EXPECT_TRUE(internal::test_unary('z', ""));
- EXPECT_FALSE(internal::test_unary('z', "hello"));
-
- EXPECT_FALSE(internal::test_unary('n', ""));
- EXPECT_TRUE(internal::test_unary('n', "hello"));
-
- EXPECT_THROW(internal::test_unary('o', "extglob"), libbash::unsupported_exception);
-}
-
-TEST_F(file_test, binary_operator)
-{
- interpreter walker;
- EXPECT_TRUE(internal::test_binary("nt", negative, positive, walker));
- EXPECT_FALSE(internal::test_binary("ot", negative, positive, walker));
-
- EXPECT_TRUE(internal::test_binary("ot", positive, negative, walker));
- EXPECT_FALSE(internal::test_binary("nt", positive, negative, walker));
-
- EXPECT_FALSE(internal::test_binary("ot", positive, positive, walker));
- EXPECT_FALSE(internal::test_binary("nt", positive, positive, walker));
-
- EXPECT_TRUE(internal::test_binary("ef", positive, positive, walker));
- EXPECT_FALSE(internal::test_binary("ef", positive, negative, walker));
- EXPECT_FALSE(internal::test_binary("ef", "not exist", negative, walker));
-
- EXPECT_THROW(internal::test_binary("efd", positive, negative, walker), libbash::illegal_argument_exception);
-}
-
-TEST(bash_condition, arithmetic_operator)
-{
- interpreter walker;
- walker.define("foo", 1);
-
- EXPECT_TRUE(internal::test_binary("eq", "1", "1", walker));
- EXPECT_FALSE(internal::test_binary("eq", "2", "1", walker));
-
- EXPECT_TRUE(internal::test_binary("ne", "2", "1", walker));
- EXPECT_FALSE(internal::test_binary("ne", "1", "1", walker));
-
- EXPECT_TRUE(internal::test_binary("lt", "0", "1", walker));
- EXPECT_FALSE(internal::test_binary("lt", "1", "1", walker));
- EXPECT_FALSE(internal::test_binary("lt", "2", "1", walker));
-
- EXPECT_TRUE(internal::test_binary("le", "0", "1", walker));
- EXPECT_TRUE(internal::test_binary("le", "1", "1", walker));
- EXPECT_FALSE(internal::test_binary("le", "2", "1", walker));
-
- EXPECT_TRUE(internal::test_binary("gt", "1", "0", walker));
- EXPECT_FALSE(internal::test_binary("gt", "1", "1", walker));
- EXPECT_FALSE(internal::test_binary("gt", "0", "1", walker));
-
- EXPECT_TRUE(internal::test_binary("ge", "1", "1", walker));
- EXPECT_TRUE(internal::test_binary("ge", "2", "1", walker));
- EXPECT_FALSE(internal::test_binary("ge", "0", "1", walker));
-
- EXPECT_FALSE(internal::test_binary("ge", "blah", "1", walker));
-
- EXPECT_FALSE(internal::test_binary("ge", "foo++", "2", walker));
- EXPECT_TRUE(internal::test_binary("ge", "foo++", "2", walker));
-}
diff --git a/libbash-0.1/src/core/tests/interpreter_test.cpp b/libbash-0.1/src/core/tests/interpreter_test.cpp
deleted file mode 100644
index d20697b..0000000
--- a/libbash-0.1/src/core/tests/interpreter_test.cpp
+++ /dev/null
@@ -1,263 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file interpreter_test.cpp
-/// \brief series of unit tests for interpreter.
-///
-
-#include <gtest/gtest.h>
-
-#include "core/interpreter.h"
-
-using namespace std;
-
-TEST(interpreter, define_resolve_int)
-{
- interpreter walker;
- walker.define("aint", 4);
- EXPECT_EQ(4, walker.resolve<long>("aint"));
- EXPECT_EQ(0, walker.resolve<long>("undefined"));
- EXPECT_EQ(0, walker.resolve<long>(""));
-}
-
-TEST(interpreter, define_resolve_string)
-{
- interpreter walker;
- walker.define("astring", "hello");
- EXPECT_STREQ("hello", walker.resolve<string>("astring").c_str());
- EXPECT_STREQ("", walker.resolve<string>("undefined").c_str());
- EXPECT_STREQ("", walker.resolve<string>("").c_str());
-}
-
-TEST(interpreter, define_resolve_array)
-{
- interpreter walker;
- std::map<unsigned, std::string> values = {{0, "1"}, {1, "2"}, {2, "3"}};
- walker.define("array", values);
- EXPECT_STREQ("1", walker.resolve<string>("array", 0).c_str());
- EXPECT_STREQ("2", walker.resolve<string>("array", 1).c_str());
- EXPECT_STREQ("3", walker.resolve<string>("array", 2).c_str());
- EXPECT_STREQ("", walker.resolve<string>("undefined",100).c_str());
-
- walker.define("partial", 10, false, 8);
- EXPECT_EQ(1, walker.get_array_length("partial"));
- EXPECT_EQ(10, walker.resolve<long>("partial", 8));
-
- EXPECT_EQ(0, walker.get_array_length("not exist"));
-}
-
-TEST(interpreter, is_unset_or_null)
-{
- interpreter walker;
- walker.define("foo", "hello");
- EXPECT_FALSE(walker.is_unset_or_null("foo", 0));
- walker.define("foo", "hello", false, true);
- EXPECT_TRUE(walker.is_unset_or_null("foo", 0));
-
- std::map<unsigned, std::string> values = {{0, "1"}, {1, "2"}, {2, "3"}};
- walker.define("bar", values);
- EXPECT_FALSE(walker.is_unset_or_null("bar", 0));
- EXPECT_FALSE(walker.is_unset_or_null("bar", 1));
- EXPECT_FALSE(walker.is_unset_or_null("bar", 2));
- EXPECT_TRUE(walker.is_unset_or_null("bar", 3));
-}
-
-TEST(interpreter, is_unset)
-{
- interpreter walker;
- walker.define("foo", "hello");
- EXPECT_FALSE(walker.is_unset("foo"));
- EXPECT_TRUE(walker.is_unset("bar"));
-}
-
-TEST(interpreter, set_int_value)
-{
- interpreter walker;
- walker.define("aint", 4);
- EXPECT_EQ(10, walker.set_value("aint", 10));
- EXPECT_EQ(10, walker.resolve<long>("aint"));
- EXPECT_EQ(10, walker.set_value("undefined", 10));
- EXPECT_EQ(10, walker.resolve<long>("undefined"));
-
- walker.define("aint_ro", 4, true);
- EXPECT_THROW(walker.set_value("aint_ro", 10),
- libbash::readonly_exception);
- EXPECT_EQ(4, walker.resolve<long>("aint_ro"));
-}
-
-TEST(interpreter, set_string_value)
-{
- interpreter walker;
- walker.define("astring", "hi");
- EXPECT_STREQ("hello", walker.set_value<string>("astring", "hello").c_str());
- EXPECT_STREQ("hello", walker.resolve<string>("astring").c_str());
- EXPECT_STREQ("hello", walker.set_value<string>("undefined", "hello").c_str());
- EXPECT_STREQ("hello", walker.resolve<string>("undefined").c_str());
-
- walker.define("astring_ro", "hi", true);
- EXPECT_THROW(walker.set_value<string>("astring_ro", "hello"),
- libbash::readonly_exception);
- EXPECT_STREQ("hi", walker.resolve<string>("astring_ro").c_str());
-}
-
-TEST(interpreter, set_array_value)
-{
- interpreter walker;
- std::map<unsigned, std::string> values = {{0, "1"}, {1, "2"}, {2, "3"}};
- walker.define("array", values);
- EXPECT_STREQ("2", walker.set_value<string>("array", "2", 0).c_str());
- EXPECT_STREQ("2", walker.resolve<string>("array", 0).c_str());
- EXPECT_STREQ("out_of_bound", walker.set_value<string>("array", "out_of_bound", 10).c_str());
- EXPECT_STREQ("out_of_bound", walker.resolve<string>("array",10).c_str());
-
- walker.define("ro_array", values, true);
- EXPECT_THROW(walker.set_value<string>("ro_array", "hello", 1),
- libbash::readonly_exception);
- EXPECT_STREQ("2", walker.resolve<string>("ro_array", 1).c_str());
-}
-
-TEST(interpreter, get_array_values)
-{
- interpreter walker;
- std::map<unsigned, std::string> values = {{0, "1"}, {1, "2"}, {2, "3"}};
- walker.define("array", values);
-
- std::vector<long> array_values;
- EXPECT_TRUE(walker.resolve_array("array", array_values));
- EXPECT_EQ(1, array_values[0]);
- EXPECT_EQ(2, array_values[1]);
- EXPECT_EQ(3, array_values[2]);
- EXPECT_FALSE(walker.resolve_array("undefined", array_values));
-}
-
-TEST(interpreter, unset_arrays)
-{
- interpreter walker;
- std::map<unsigned, std::string> values = {{0, "1"}, {1, "2"}, {2, "3"}};
- walker.define("array", values);
- walker.define("ro_array", values, true);
- interpreter::local_scope temp_scope(walker);
- values[0] = "local";
- walker.define_local("array", values);
- walker.define_local("ro_local_array", values, true);
-
- // unset arrays
- EXPECT_STREQ("local", walker.resolve<string>("array", 0).c_str());
- // unset local
- walker.unset("array", 0);
- EXPECT_STREQ("", walker.resolve<string>("array", 0).c_str());
- // unset local
- walker.unset("array");
- // resolve to global
- EXPECT_STREQ("1", walker.resolve<string>("array", 0).c_str());
- EXPECT_STREQ("2", walker.resolve<string>("array", 1).c_str());
- EXPECT_STREQ("3", walker.resolve<string>("array", 2).c_str());
- // unset global
- walker.unset("array");
- EXPECT_STREQ("", walker.resolve<string>("array", 0).c_str());
- EXPECT_STREQ("", walker.resolve<string>("array", 1).c_str());
- EXPECT_STREQ("", walker.resolve<string>("array", 2).c_str());
- walker.unset("array");
-
- EXPECT_THROW(walker.unset("ro_array", 1), libbash::readonly_exception);
- EXPECT_THROW(walker.unset("ro_local_array", 1), libbash::readonly_exception);
- EXPECT_THROW(walker.unset("ro_array"), libbash::readonly_exception);
- EXPECT_THROW(walker.unset("ro_local_array"), libbash::readonly_exception);
-
- EXPECT_THROW(walker.unset("1", 1), libbash::runtime_exception);
-}
-
-TEST(interpreter, unset_variables)
-{
- interpreter walker;
- walker.define("var", "123");
- walker.define("ro_var", "123", true);
- interpreter::local_scope temp_scope(walker);
- walker.define_local("var", 456);
- walker.define_local("ro_local_var", 456, true);
-
- EXPECT_STREQ("456", walker.resolve<string>("var").c_str());
- walker.unset("var");
- EXPECT_STREQ("123", walker.resolve<string>("var").c_str());
- walker.unset("var");
- EXPECT_STREQ("", walker.resolve<string>("var").c_str());
- walker.unset("var");
-
- EXPECT_THROW(walker.unset("ro_var"), libbash::readonly_exception);
- EXPECT_THROW(walker.unset("ro_local_var"), libbash::readonly_exception);
- EXPECT_THROW(walker.unset("1"), libbash::runtime_exception);
-}
-
-TEST(interpreter, unset_functions)
-{
- interpreter walker;
- walker.push_current_ast(0);
- walker.define_function("foo", 0);
- EXPECT_TRUE(walker.has_function("foo"));
- walker.unset_function("foo");
- EXPECT_FALSE(walker.has_function("foo"));
-}
-
-TEST(interperter, substring_expansion)
-{
- interpreter walker;
- EXPECT_STREQ("", walker.do_substring_expansion("@", 0, 1, 2).c_str());
- EXPECT_THROW(walker.do_substring_expansion("", 0, -1, 0), libbash::illegal_argument_exception);
-}
-
-TEST(interpreter, word_split)
-{
- interpreter walker;
- std::vector<std::string> splitted_values;
- walker.split_word(" \n\t", splitted_values);
- EXPECT_EQ(0, splitted_values.size());
-
- splitted_values.clear();
- walker.split_word(" \tfoo\n bar \n", splitted_values);
- EXPECT_EQ(2, splitted_values.size());
- EXPECT_STREQ("foo", splitted_values[0].c_str());
- EXPECT_STREQ("bar", splitted_values[1].c_str());
-}
-
-TEST(interpreter, bash_additional_option)
-{
- interpreter walker;
-
- EXPECT_THROW(walker.set_additional_option("not exist", false), libbash::illegal_argument_exception);
- EXPECT_THROW(walker.get_additional_option("not exist"), libbash::illegal_argument_exception);
-
- EXPECT_FALSE(walker.get_additional_option("extglob"));
- walker.set_additional_option("extglob", true);
- EXPECT_TRUE(walker.get_additional_option("extglob"));
-}
-
-TEST(interpreter, bash_option)
-{
- interpreter walker;
-
- EXPECT_STREQ("Bh", walker.resolve<std::string>("-").c_str());
-}
-
-TEST(interpreter, undefined_function)
-{
- interpreter walker;
- interpreter::local_scope temp_scope(walker);
-
- EXPECT_THROW(walker.call("undefined", {}), libbash::runtime_exception);
-}
diff --git a/libbash-0.1/src/core/tests/symbols_test.cpp b/libbash-0.1/src/core/tests/symbols_test.cpp
deleted file mode 100644
index e5b4649..0000000
--- a/libbash-0.1/src/core/tests/symbols_test.cpp
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file symbols_test.cpp
-/// \brief series of unit tests for symbols and symbol table.
-///
-
-#include <gtest/gtest.h>
-
-#include "core/symbols.hpp"
-
-using namespace std;
-
-TEST(symbol_test, int_variable)
-{
- // readonly integer
- variable ro_integer("integer", 10, true);
- EXPECT_STREQ("integer", ro_integer.get_name().c_str());
- EXPECT_EQ(10, ro_integer.get_value<long>());
- EXPECT_THROW(ro_integer.set_value(100), libbash::interpreter_exception);
- EXPECT_EQ(10, ro_integer.get_value<long>());
-
- // normal only integer
- variable normal_integer("integer", 10);
- normal_integer.set_value(100);
- EXPECT_EQ(100, normal_integer.get_value<long>());
-
- // get string value of an integer
- EXPECT_STREQ("100", normal_integer.get_value<string>().c_str());
-}
-
-TEST(symbol_test, string_variable)
-{
- // readonly string
- variable ro_string("string", "hello", true);
- EXPECT_STREQ("string", ro_string.get_name().c_str());
- EXPECT_STREQ("hello", ro_string.get_value<string>().c_str());
- EXPECT_THROW(ro_string.set_value("hello world"), libbash::interpreter_exception);
- EXPECT_STREQ("hello", ro_string.get_value<string>().c_str());
-
- // normal string
- variable normal_string("string", "hello");
- normal_string.set_value("hello world");
- EXPECT_STREQ("hello world", normal_string.get_value<string>().c_str());
-
- // string contains integer value
- variable int_string("string", "123");
- EXPECT_EQ(123, int_string.get_value<long>());
- int_string.set_value("abc");
- EXPECT_EQ(0, int_string.get_value<long>());
-}
-
-TEST(symbol_test, array_variable)
-{
- map<unsigned, string> values = {{0, "1"}, {1, "2"}, {2, "3"}};
-
- // readonly array
- variable ro_array("foo", values, true);
- EXPECT_STREQ("foo", ro_array.get_name().c_str());
- EXPECT_STREQ("1", ro_array.get_value<string>(0).c_str());
- EXPECT_STREQ("2", ro_array.get_value<string>(1).c_str());
- EXPECT_STREQ("3", ro_array.get_value<string>(2).c_str());
- EXPECT_THROW(ro_array.set_value("4", 0), libbash::interpreter_exception);
- EXPECT_STREQ("1", ro_array.get_value<string>(0).c_str());
-
- // out of bound
- EXPECT_STREQ("", ro_array.get_value<string>(100).c_str());
-
- // normal array
- variable normal_array("foo", values);
- normal_array.set_value("5", 4);
- EXPECT_STREQ("1", normal_array.get_value<string>(0).c_str());
- EXPECT_STREQ("2", normal_array.get_value<string>(1).c_str());
- EXPECT_STREQ("3", normal_array.get_value<string>(2).c_str());
- EXPECT_STREQ("", normal_array.get_value<string>(3).c_str());
- EXPECT_STREQ("5", normal_array.get_value<string>(4).c_str());
-
- // get integer value
- EXPECT_EQ(3, normal_array.get_value<long>(2));
-}
-
-TEST(symbol_test, get_all_values)
-{
- map<unsigned, string> values = {{0, "1"}, {1, "2"}, {2, "3"}};
- variable array("foo", values);
- vector<string> string_values;
- array.get_all_values(string_values);
-
- EXPECT_EQ(3, string_values.size());
- EXPECT_STREQ("1", string_values[0].c_str());
- EXPECT_STREQ("2", string_values[1].c_str());
- EXPECT_STREQ("3", string_values[2].c_str());
-
- variable a_string("foo", 10);
- // Won't clear the original vector
- a_string.get_all_values(string_values);
- EXPECT_EQ(4, string_values.size());
- EXPECT_STREQ("1", string_values[0].c_str());
-
- variable an_int("foo", 10);
- vector<long> int_values;
- an_int.get_all_values(int_values);
- EXPECT_EQ(1, int_values.size());
- EXPECT_EQ(10, int_values[0]);
-}
-
-TEST(symbol_test, is_null)
-{
- variable var("foo", 10);
- EXPECT_FALSE(var.is_null());
- var.set_value("");
- EXPECT_TRUE(var.is_null());
- EXPECT_TRUE(variable("foo", "").is_null());
-}
-
-TEST(symbol_test, is_unset)
-{
- map<unsigned, string> values = {{0, "1"}, {1, "2"}, {2, "3"}};
- variable array("foo", values);
- array.unset_value(1);
- EXPECT_TRUE(array.is_unset(1));
-}
-
-TEST(symbol_test, get_length)
-{
- variable an_int("foo", 10);
- EXPECT_EQ(2, an_int.get_length());
-
- variable an_string("bar", "hello world");
- EXPECT_EQ(11, an_string.get_length());
-
- map<unsigned, string> values = {{0, "1"}, {1, "2"}, {2, "hello"}};
- variable array("array", values);
- EXPECT_EQ(5, array.get_length(2));
- EXPECT_EQ(3, array.get_array_length());
-}
diff --git a/libbash-0.1/src/core/unsupported_exception.h b/libbash-0.1/src/core/unsupported_exception.h
deleted file mode 100644
index 338b087..0000000
--- a/libbash-0.1/src/core/unsupported_exception.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file unsupported_exception.h
-/// \brief implementation for unsupported_exception
-///
-
-#ifndef LIBBASH_CORE_UNSUPPORTED_EXCEPTION_H_
-#define LIBBASH_CORE_UNSUPPORTED_EXCEPTION_H_
-
-#include <stdexcept>
-#include <string>
-
-#include "common.h"
-#include "interpreter_exception.h"
-
-namespace libbash
-{
- ///
- /// \class unsupported_exception
- /// \brief exception for unsupported features
- ///
- class LIBBASH_API unsupported_exception: public libbash::interpreter_exception
- {
- public:
- explicit unsupported_exception(const std::string& err_msg):
- libbash::interpreter_exception(err_msg){}
- };
-}
-
-#endif
diff --git a/libbash-0.1/src/cppbash_builtin.cpp b/libbash-0.1/src/cppbash_builtin.cpp
deleted file mode 100644
index 52c5c9b..0000000
--- a/libbash-0.1/src/cppbash_builtin.cpp
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file cppbash_builtin.cpp
-/// \brief Implementation of class to inherit builtins from
-///
-
-#include "cppbash_builtin.h"
-
-#include <boost/spirit/include/karma.hpp>
-#include <boost/spirit/include/qi.hpp>
-#include <boost/spirit/include/phoenix.hpp>
-
-#include "builtins/boolean_builtins.h"
-#include "builtins/builtin_exceptions.h"
-#include "builtins/break_builtin.h"
-#include "builtins/continue_builtin.h"
-#include "builtins/declare_builtin.h"
-#include "builtins/echo_builtin.h"
-#include "builtins/eval_builtin.h"
-#include "builtins/inherit_builtin.h"
-#include "builtins/let_builtin.h"
-#include "builtins/return_builtin.h"
-#include "builtins/printf_builtin.h"
-#include "builtins/shopt_builtin.h"
-#include "builtins/source_builtin.h"
-#include "builtins/unset_builtin.h"
-
-namespace qi = boost::spirit::qi;
-namespace karma = boost::spirit::karma;
-namespace phoenix = boost::phoenix;
-
-cppbash_builtin::cppbash_builtin(BUILTIN_ARGS): _out_stream(&out), _err_stream(&err), _inp_stream(&in), _walker(walker)
-{
-}
-
-cppbash_builtin::builtins_type& cppbash_builtin::builtins() {
- static boost::scoped_ptr<builtins_type> p(new builtins_type {
- {"break", boost::factory<break_builtin*>()},
- {"continue", boost::factory<continue_builtin*>()},
- {"echo", boost::factory<echo_builtin*>()},
- {"eval", boost::factory<eval_builtin*>()},
- {"declare", boost::factory<declare_builtin*>()},
- {"source", boost::factory<source_builtin*>()},
- {"shopt", boost::factory<shopt_builtin*>()},
- {"inherit", boost::factory<inherit_builtin*>()},
- {":", boost::factory<true_builtin*>()},
- {"true", boost::factory<true_builtin*>()},
- {"false", boost::factory<false_builtin*>()},
- {"return", boost::factory<return_builtin*>()},
- {"printf", boost::factory<printf_builtin*>()},
- {"let", boost::factory<let_builtin*>()},
- {"unset", boost::factory<unset_builtin*>()},
- });
- return *p;
-}
-
-void cppbash_builtin::transform_escapes(const std::string &string,
- std::ostream& output) const
-{
- using phoenix::val;
- using qi::lit;
-
- auto escape_parser =
- +(
- lit('\\') >>
- (
- lit('a')[output << val("\a")] |
- lit('b')[output << val("\b")] |
- // \e is a GNU extension
- lit('e')[output << val("\033")] |
- lit('f')[output << val("\f")] |
- lit('n')[output << val("\n")] |
- lit('r')[output << val("\r")] |
- lit('t')[output << val("\t")] |
- lit('v')[output << val("\v")] |
- lit('c')[phoenix::throw_(suppress_output())] |
- lit('\\')[output << val('\\')] |
- lit("0") >> qi::uint_parser<unsigned, 8, 1, 3>()[ output << phoenix::static_cast_<char>(qi::_1)] |
- lit("x") >> qi::uint_parser<unsigned, 16, 1, 2>()[ output << phoenix::static_cast_<char>(qi::_1)]
-
- ) |
- qi::char_[output << qi::_1]
- );
-
- auto begin = string.begin();
- qi::parse(begin, string.end(), escape_parser);
-}
diff --git a/libbash-0.1/src/cppbash_builtin.h b/libbash-0.1/src/cppbash_builtin.h
deleted file mode 100644
index c42ee1a..0000000
--- a/libbash-0.1/src/cppbash_builtin.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file cppbash_builtin.h
-/// \brief Base class for builtin functions in bash
-///
-
-#ifndef LIBBASH_CPPBASH_BUILTIN_H_
-#define LIBBASH_CPPBASH_BUILTIN_H_
-
-#include <iostream>
-#include <map>
-#include <string>
-#include <vector>
-
-#include <boost/functional/factory.hpp>
-#include <boost/function.hpp>
-#include <boost/scoped_ptr.hpp>
-#include <boost/utility.hpp>
-
-#define BUILTIN_ARGS std::ostream &out, std::ostream &err, std::istream &in, interpreter &walker
-
-class interpreter;
-///
-/// \class cppbash_builtin
-/// \brief a virtual class to inherit builtin functions from
-///
-class cppbash_builtin: public boost::noncopyable
-{
- public:
- ///
- /// \brief Default constructor, sets default streams
- /// \param outstream where to send standard output. Default: cout
- /// \param errstream where to send standard error. Default: cerr
- /// \param instream where to get standard input from. Default: stdin
- ///
- explicit cppbash_builtin(BUILTIN_ARGS);
-
- virtual ~cppbash_builtin() {};
- ///
- /// \brief executes the code associated with the builtin
- /// \param bash_args arguments passed to the builtin
- /// \return return status of the command
- ///
- virtual int exec(const std::vector<std::string>& bash_args)=0;
- ///
- /// \brief accessor to the std output stream
- /// \return output buffer for the builtin
- ///
- std::ostream& out_buffer() {return *_out_stream;}
- ///
- /// \brief accessor to the std error stream
- /// \return error buffer for the builtin
- ///
- std::ostream& err_buffer() {return *_err_stream;}
- ///
- /// \brief accessor to the std input stream
- /// \return input buffer for the builtin
- ///
- std::istream& input_buffer() {return *_inp_stream;}
-
- static int exec(const std::string& builtin,
- const std::vector<std::string>& args,
- BUILTIN_ARGS)
- {
- boost::scoped_ptr<cppbash_builtin> p(builtins()[builtin](out,err,in,walker));
- return p->exec(args);
- }
-
- ///
- /// \brief check existence of the builtin
- /// \param builtin name
- /// \param whether it is a builtin
- ///
- static bool is_builtin(const std::string& builtin)
- {
- builtins_type& builtin_map = builtins();
- return builtin_map.find(builtin) != builtin_map.end();
- }
-
- protected:
- ///
- /// \var *_out_stream
- /// \brief current standard output stream
- ///
- std::ostream *_out_stream;
- ///
- /// \var *_err_stream
- /// \brief current standard error stream
- ///
- std::ostream *_err_stream;
- ///
- /// \var *_inp_stream
- /// \brief current standard input stream
- ///
- std::istream *_inp_stream;
-
- interpreter& _walker;
-
- ///
- /// \var builtins
- /// \brief holds factories for creating instances of child classes
- ///
- typedef std::map<std::string, boost::function< cppbash_builtin*(BUILTIN_ARGS) >> builtins_type;
- static builtins_type& builtins();
-
- /// \brief transforms escapes in echo input
- /// \param the target string
- /// \param the place to write
- void transform_escapes(const std::string &string, std::ostream& output) const;
-};
-
-#define BUILTIN_CONSTRUCTOR(name) \
- name ## _builtin(BUILTIN_ARGS) : cppbash_builtin(out, err, in, walker) {}
-
-#endif
diff --git a/libbash-0.1/src/libbash.cpp b/libbash-0.1/src/libbash.cpp
deleted file mode 100644
index 98f20b6..0000000
--- a/libbash-0.1/src/libbash.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file libbash.cpp
-/// \brief implementation for libbash interface
-///
-
-#include "libbash.h"
-
-#include <fstream>
-
-#include <boost/numeric/conversion/cast.hpp>
-
-#include "core/interpreter.h"
-#include "core/bash_ast.h"
-
-namespace internal
-{
- int interpret(interpreter& walker,
- const std::string& path,
- std::unordered_map<std::string, std::vector<std::string>>& variables,
- std::vector<std::string>& functions)
- {
- // Initialize bash environment
- for(auto iter = variables.begin(); iter != variables.end(); ++iter)
- walker.define(iter->first, (iter->second)[0]);
- walker.define("0", path, true);
- variables.clear();
-
- bash_ast ast(path);
- ast.interpret_with(walker);
-
- for(auto iter = walker.begin(); iter != walker.end(); ++iter)
- iter->second->get_all_values<std::string>(variables[iter->first]);
- walker.get_all_function_names(functions);
-
- return walker.get_status();
- }
-}
-
-namespace libbash
-{
- int interpret(const std::string& target_path,
- std::unordered_map<std::string, std::vector<std::string>>& variables,
- std::vector<std::string>& functions)
- {
- interpreter walker;
- return internal::interpret(walker, target_path, variables, functions);
- }
-
- int interpret(const std::string& target_path,
- const std::string& preload_path,
- std::unordered_map<std::string, std::vector<std::string>>& variables,
- std::vector<std::string>& functions)
- {
- interpreter walker;
-
- // Preloading
- bash_ast preload_ast(preload_path);
- preload_ast.interpret_with(walker);
-
- return internal::interpret(walker, target_path, variables, functions);
- }
-}
diff --git a/libbash-0.1/src/libbash.h b/libbash-0.1/src/libbash.h
deleted file mode 100644
index f42d278..0000000
--- a/libbash-0.1/src/libbash.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file libbash.h
-/// \brief public interface for libbash
-///
-
-#ifndef LIBBASH_LIBBASH_H_
-#define LIBBASH_LIBBASH_H_
-
-#include <memory>
-#include <string>
-#include <unordered_map>
-#include <vector>
-
-#include "common.h"
-#include "core/exceptions.h"
-
-namespace libbash
-{
- ///
- /// \brief interpret a script specifid by path, return a map filled with
- /// variables defined in the script
- /// \param the path of target script
- /// \param[in, out] we use the map to initialize bash environment and store the result
- /// \param[out] store the names of the functions defined in the script
- /// \return the return status of the script
- int LIBBASH_API interpret(const std::string& target_path,
- std::unordered_map<std::string, std::vector<std::string>>& variables,
- std::vector<std::string>& functions);
-
- ///
- /// \brief interpret a script specifid by path, return a map filled with
- /// variables defined in the script
- /// \param the path of target script
- /// \param the path of a script that you want to source before interpreting
- /// \param[in, out] we use the map to initialize bash environment and store the result. The environment will be initialized after preloading.
- /// \param[out] store the names of the functions defined in the script
- /// \return the return status of the script
- int LIBBASH_API interpret(const std::string& target_path,
- const std::string& preload_path,
- std::unordered_map<std::string, std::vector<std::string>>& variables,
- std::vector<std::string>& functions);
-}
-
-#endif
diff --git a/libbash-0.1/test/api_test.cpp b/libbash-0.1/test/api_test.cpp
deleted file mode 100644
index 917b7e9..0000000
--- a/libbash-0.1/test/api_test.cpp
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file api_test.cpp
-/// \brief series of unit tests for the public interface
-///
-
-#include <gtest/gtest.h>
-
-#include "libbash.h"
-#include "test.h"
-
-TEST(libbashapi, bad_path)
-{
- std::unordered_map<std::string, std::vector<std::string>> variables;
- std::vector<std::string> functions;
- EXPECT_THROW(libbash::interpret("not exist", variables, functions),
- libbash::parse_exception);
- EXPECT_THROW(libbash::interpret("/scripts/source_true.sh", "not exist", variables, functions),
- libbash::parse_exception);
-}
-
-TEST(libbashapi, illegal_script)
-{
- std::unordered_map<std::string, std::vector<std::string>> variables;
- std::vector<std::string> functions;
- EXPECT_THROW(libbash::interpret(get_src_dir() + "/scripts/illegal_script.sh", variables, functions),
- libbash::parse_exception);
-}
-
-TEST(libbashapi, legal_script)
-{
- std::unordered_map<std::string, std::vector<std::string>> variables;
- std::vector<std::string> functions;
- int result = libbash::interpret(get_src_dir() + std::string("/scripts/source_true.sh"),
- variables,
- functions);
- EXPECT_EQ(0, result);
-
- result = libbash::interpret(get_src_dir() + std::string("/scripts/source_false.sh"),
- variables,
- functions);
- EXPECT_NE(0, result);
-
- EXPECT_STREQ((get_src_dir() + std::string("/scripts/source_false.sh")).c_str(),
- variables["0"][0].c_str());
-}
-
-TEST(libbashapi, preload)
-{
- std::unordered_map<std::string, std::vector<std::string>> variables;
- std::vector<std::string> functions;
- int result = libbash::interpret(get_src_dir() + std::string("/scripts/source_true.sh"),
- get_src_dir() + std::string("/scripts/source_true.sh"),
- variables,
- functions);
- EXPECT_EQ(0, result);
- result = libbash::interpret(get_src_dir() + std::string("/scripts/source_true.sh"),
- get_src_dir() + std::string("/scripts/source_false.sh"),
- variables,
- functions);
- EXPECT_NE(0, result);
-
- EXPECT_THROW(libbash::interpret(get_src_dir() + std::string("/scripts/source_true.sh"),
- get_src_dir() + std::string("/scripts/illegal_script.sh"),
- variables,
- functions),
- libbash::parse_exception);
-}
diff --git a/libbash-0.1/test/ast_printer_test.sh b/libbash-0.1/test/ast_printer_test.sh
deleted file mode 100755
index 8b0d724..0000000
--- a/libbash-0.1/test/ast_printer_test.sh
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/sh
-
-declare -i error=0
-
-./ast_printer -f $srcdir/bashast/features_script/features.sh\
- | diff -u $srcdir/bashast/features_script/features.sh.ast -
-error+=$?
-
-./ast_printer -t libbash.tokens -f $srcdir/bashast/features_script/features.sh\
- | diff -u $srcdir/bashast/features_script/features.sh.tokens -
-error+=$?
-
-./ast_printer -w libbashWalker.tokens -f $srcdir/bashast/features_script/features.sh\
- | diff -u $srcdir/bashast/features_script/features.sh.walker.tokens -
-error+=$?
-
-./ast_printer -t libbash.tokens -f $srcdir/scripts/illegal_script.sh\
- | diff -u $srcdir/scripts/illegal_script.sh.tokens -
-error+=$?
-
-./ast_printer -f $srcdir/bashast/features_script/illegal_script.sh 2 > /dev/null
-if [[ $? == 0 ]]
-then
- error+=1
-fi
-
-./ast_printer -e "case" 2 > /dev/null
-if [[ $? == 0 ]]
-then
- error+=1
-fi
-
-exit $error
diff --git a/libbash-0.1/test/ebuild_compiler.sh b/libbash-0.1/test/ebuild_compiler.sh
deleted file mode 100755
index 7828476..0000000
--- a/libbash-0.1/test/ebuild_compiler.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-declare -i error=0
-
-for ebuild in $@
-do
- ECLASSDIR=$srcdir/scripts ./metadata_generator $ebuild | diff -u $ebuild.result -
- error+=$?
-done
-
-exit $error
diff --git a/libbash-0.1/test/post_check.cpp b/libbash-0.1/test/post_check.cpp
deleted file mode 100644
index 715ccf5..0000000
--- a/libbash-0.1/test/post_check.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file post_check.cpp
-/// \brief series of unit tests for generated source files.
-///
-
-#include <boost/filesystem.hpp>
-#include <gtest/gtest.h>
-
-using namespace std;
-
-static void check_file_size(const char *path, uintmax_t size_max)
-{
- uintmax_t file_size = boost::filesystem::file_size(path);
- EXPECT_GT(file_size, 0);
- EXPECT_LT(file_size, size_max);
-}
-
-TEST(post_check, lexer_size)
-{
- check_file_size("libbashLexer.cpp", 1024 * 1024);
-}
-
-TEST(post_check, parser_size)
-{
- check_file_size("libbashParser.cpp", 3*1024*1024);
-}
-
-TEST(post_check, walker_size)
-{
- check_file_size("libbashWalker.cpp", 4096 * 1024);
-}
diff --git a/libbash-0.1/test/run_tests.cpp b/libbash-0.1/test/run_tests.cpp
deleted file mode 100644
index 6606a90..0000000
--- a/libbash-0.1/test/run_tests.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file run_tests.cpp
-/// \brief runs unit tests for post_check
-///
-
-#include <cstdio>
-
-#include<gtest/gtest.h>
-
-///
-/// \brief runs all the unit tests linked to this file
-///
-int main(int argc, char* argv[])
-{
- if(!freopen("/dev/null", "w", stderr))
- return EXIT_FAILURE;
- ::testing::InitGoogleTest(&argc, argv);
- return RUN_ALL_TESTS();
-}
diff --git a/libbash-0.1/test/script_compiler.sh b/libbash-0.1/test/script_compiler.sh
deleted file mode 100755
index 6ff5672..0000000
--- a/libbash-0.1/test/script_compiler.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/sh
-
-declare -i error=0
-result=$(mktemp)
-
-for script in $@
-do
- sed "s/@srcdir@/$srcdir/" $script.result > $result
- ./variable_printer $script 2>&1 | diff -u $result -
- error+=$?
-done
-
-rm -rf $result
-exit $error
diff --git a/libbash-0.1/test/test.cpp b/libbash-0.1/test/test.cpp
deleted file mode 100644
index e460fc1..0000000
--- a/libbash-0.1/test/test.cpp
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
- */
-///
-/// \file test.cpp
-/// \brief helper functions for tests
-///
-#include <cstdlib>
-
-#include "test.h"
-
-std::string get_src_dir()
-{
- std::string srcdir(".");
- if(getenv("srcdir"))
- srcdir = getenv("srcdir");
-
- return srcdir;
-}
diff --git a/libbash-0.1/test/test.h b/libbash-0.1/test/test.h
deleted file mode 100644
index ba5cd1f..0000000
--- a/libbash-0.1/test/test.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
- */
-///
-/// \file test.h
-/// \brief helper functions for tests
-///
-#ifndef LIBBASH_TEST_H_
-#define LIBBASH_TEST_H_
-
-#include <string>
-
-std::string get_src_dir();
-
-#endif
diff --git a/libbash-0.1/test/verify_bashs_test.sh b/libbash-0.1/test/verify_bashs_test.sh
deleted file mode 100755
index 8b70030..0000000
--- a/libbash-0.1/test/verify_bashs_test.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-
-num_of_ebuild_files=$(grep 'scripts/.*.bash' $srcdir/Makefile.am | wc -l)
-[[ $num_of_ebuild_files == $(ls $srcdir/scripts/*.bash* | wc -l) ]]
-exit $?
diff --git a/libbash-0.1/test/verify_error_output_test.sh b/libbash-0.1/test/verify_error_output_test.sh
deleted file mode 100755
index 4bb0465..0000000
--- a/libbash-0.1/test/verify_error_output_test.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-illegal="${srcdir}/scripts/illegal_script.sh"
-output=$(./variable_printer "$illegal" 2>&1)
-[[ $output == "${illegal}(1) : error 3 : "???":1: command_atom : ( compound_command | function | simple_command );, at offset 3"* ]]
diff --git a/libbash-0.1/test/walker_test.cpp b/libbash-0.1/test/walker_test.cpp
deleted file mode 100644
index 4f87c26..0000000
--- a/libbash-0.1/test/walker_test.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file lib_test.cpp
-/// \brief series of unit tests for generated walker.
-///
-
-#include <sstream>
-
-#include <gtest/gtest.h>
-
-#include "core/interpreter.h"
-#include "core/bash_ast.h"
-
-static void check_string_assignment(const char* script,
- const std::string& name,
- const char* exp_value)
-{
- interpreter walker;
- std::istringstream input(script);
- bash_ast ast(input);
- ast.interpret_with(walker);
- EXPECT_STREQ(exp_value, walker.resolve<std::string>(name).c_str());
-}
-
-#define TEST_STRING_ASSIGNMENT(name, script, var_name, exp_value)\
- TEST(string_assignment, name) \
- { check_string_assignment(script, var_name, exp_value); }
-
-TEST_STRING_ASSIGNMENT(str_assignment, "str=\"abc\"", "str", "abc")
-TEST_STRING_ASSIGNMENT(str_assignment2, "str=\"abc_def\"", "str", "abc_def")
-TEST_STRING_ASSIGNMENT(str_assignment3, "str=\"abc def\"", "str", "abc def")
-TEST_STRING_ASSIGNMENT(str_assignment4,
- "str=\"case esac do done elif else fi if for function in select then until while time\"",
- "str",
- "case esac do done elif else fi if for function in select then until while time")
-TEST_STRING_ASSIGNMENT(str_assignment5,
- "str=\"123 abc = % %% - . .. : -a -aa test _ ~ ++ -- *= /= %= += -= <<= >>= &= ^= |= \\a ^ aä\"",
- "str",
- "123 abc = % %% - . .. : -a -aa test _ ~ ++ -- *= /= %= += -= <<= >>= &= ^= |= \\a ^ aä")
-TEST_STRING_ASSIGNMENT(str_assignment6,
- "str=\"/ \n \r\n & && ||| || > < ' : ; , ( (( ) )) ;; { } >= <=\"",
- "str",
- "/ \n \r\n & && ||| || > < ' : ; , ( (( ) )) ;; { } >= <=")
-
-TEST(array_index, out_of_bound)
-{
- interpreter walker;
-
- std::string script = "a[-1]=\"1\"";
- std::istringstream input(script);
- bash_ast ast(input);
- EXPECT_THROW(ast.interpret_with(walker), libbash::illegal_argument_exception);
-
- std::string script2 = "a=(1 2 [-5]=1)";
- std::istringstream input2(script2);
- bash_ast ast2(input2);
- EXPECT_THROW(ast2.interpret_with(walker), libbash::illegal_argument_exception);
-}
-
-TEST(extglob, used_when_disabled)
-{
- interpreter walker;
-
- std::string script = "echo ${abc/?([a-z])}";
- std::istringstream input(script);
- bash_ast ast(input);
- try
- {
- ast.interpret_with(walker);
- }
- catch(libbash::unsupported_exception& e)
- {
- EXPECT_STREQ(e.what(), "Entered extended pattern matching with extglob disabled");
- }
-}
-
-TEST(brace_expansion, not_in_raw_string)
-{
- interpreter walker;
-
- std::string script = "echo $ab{c,d}e";
- std::istringstream input(script);
- bash_ast ast(input);
- EXPECT_THROW(ast.interpret_with(walker), libbash::unsupported_exception);
-}
diff --git a/libbash-0.1/test_coverage.sh b/libbash-0.1/test_coverage.sh
deleted file mode 100755
index 20f70d9..0000000
--- a/libbash-0.1/test_coverage.sh
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/sh
-
-which lcov 1>/dev/null 2>&1
-if [ $? != 0 ]
-then
- echo "You need to have lcov installed in order to generate the test coverage report"
- exit 1
-fi
-
-if [ ! $DIST_ARCHIVES ]
-then
- echo "You need to provide the archive name by running DIST_ARCHIVES=\"ARCHIVE_NAME\" $0"
- exit 1
-fi
-
-tar zxf $DIST_ARCHIVES
-srcdir=${DIST_ARCHIVES/.tar.gz}
-cd $srcdir
-
-# Reconfigure with gcov support
-CXXFLAGS="-g -O0 --coverage" CFLAGS="-g -O0 --coverage" ./autogen.sh --disable-shared
-
-# Generate gcov output
-${MAKE}
-
-# Generate html report
-lcov --base-directory . --directory . --zerocounters -q
-${MAKE} check
-lcov --base-directory . --directory . -c -o libbash_test.info
-lcov --remove libbash_test.info "/usr*" -o libbash_test.info # remove output for external libraries
-rm -rf ../test_coverage
-genhtml -o ../test_coverage -t "libbash test coverage" --num-spaces 4 libbash_test.info
-
-# Clean work space
-cd .. && rm -rf $srcdir
diff --git a/libbash-0.1/utils/ast_printer.cpp b/libbash-0.1/utils/ast_printer.cpp
deleted file mode 100644
index d2dabc9..0000000
--- a/libbash-0.1/utils/ast_printer.cpp
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file ast_printer.cpp
-/// \brief helper program to visualize AST
-///
-
-#include <fstream>
-#include <functional>
-#include <iostream>
-#include <sstream>
-#include <string>
-#include <unordered_map>
-#include <vector>
-
-#include <antlr3.h>
-#include <boost/numeric/conversion/cast.hpp>
-#include <boost/program_options.hpp>
-#include <boost/spirit/include/qi.hpp>
-#include <boost/fusion/include/adapt_struct.hpp>
-
-#include "core/bash_ast.h"
-#include "core/exceptions.h"
-#include "libbashLexer.h"
-#include "libbashParser.h"
-
-namespace po = boost::program_options;
-namespace qi = boost::spirit::qi;
-
-struct reversed_pair : std::pair<ANTLR3_INT32, std::string>
-{};
-
-BOOST_FUSION_ADAPT_STRUCT(
- reversed_pair
- , (std::string, second)
- (ANTLR3_INT32, first)
-)
-
-static void print_ast(std::istream& input, bool silent, bool dot)
-{
- bash_ast ast(input);
-
- if(silent)
- return;
-
- if(dot)
- std::cout << ast.get_dot_graph() << std::endl;
- else
- std::cout << ast.get_string_tree() << std::endl;
-}
-
-static inline std::string token_mapper(std::unordered_map<ANTLR3_INT32, std::string> token_map,
- ANTLR3_INT32 token)
-{
- return token_map[token];
-}
-
-static bool build_token_map(std::unordered_map<ANTLR3_INT32, std::string>& token_map,
- const std::string& path)
-{
- std::ifstream token_file(path);
- token_file.unsetf(std::ios::skipws);
-
- typedef boost::spirit::istream_iterator iterator;
-
- iterator first(token_file);
- iterator last;
-
- qi::rule<iterator, reversed_pair()> line = +~qi::char_('=') >> '=' >> qi::int_parser<ANTLR3_INT32>();
-
- return qi::parse(first, last, line % qi::eol >> qi::eol, token_map) && first == last;
-}
-
-static void print_parser_token(std::istream& input,
- const std::string& token_path,
- bool silent)
-{
- if(silent)
- return;
-
- std::stringstream script_stream;
- script_stream << input.rdbuf();
- std::string script(script_stream.str());
- antlr_pointer<ANTLR3_INPUT_STREAM_struct> input_stream(antlr3NewAsciiStringInPlaceStream(
- reinterpret_cast<pANTLR3_UINT8>(const_cast<char*>(script.c_str())),
- boost::numeric_cast<ANTLR3_UINT32>(script.size()),
- NULL));
- if(!input)
- throw libbash::interpreter_exception("Unable to open the file due to malloc() failure");
-
- antlr_pointer<libbashLexer_Ctx_struct> lexer(libbashLexerNew(input_stream.get()));
- if(!lexer)
- throw libbash::interpreter_exception("Unable to create the lexer due to malloc() failure");
-
- antlr_pointer<ANTLR3_COMMON_TOKEN_STREAM_struct> token_stream(
- antlr3CommonTokenStreamSourceNew(ANTLR3_SIZE_HINT, lexer->pLexer->rec->state->tokSource));
- if(!token_stream)
- throw libbash::interpreter_exception("Out of memory trying to allocate token stream");
-
- std::unordered_map<ANTLR3_INT32, std::string> token_map;
-
- if(build_token_map(token_map, token_path))
- std::cout << bash_ast::get_parser_tokens(token_stream,
- std::bind(&token_mapper,
- token_map,
- std::placeholders::_1))
- << std::endl;
- else
- std::cerr << "Building token map failed" << std::endl;
-}
-
-static void print_walker_token(std::istream& input,
- const std::string& token_path,
- bool silent)
-{
- if(silent)
- return;
-
- bash_ast ast(input);
- std::unordered_map<ANTLR3_INT32, std::string> token_map;
-
- if(build_token_map(token_map, token_path))
- std::cout << ast.get_walker_tokens(std::bind(&token_mapper,
- token_map,
- std::placeholders::_1))
- << std::endl;
- else
- std::cerr << "Building token map failed" << std::endl;
-}
-
-static void print_files(const std::vector<std::string>& files,
- bool print_name,
- std::function<void(std::istream&)> printer)
-{
- for(auto iter = files.begin(); iter != files.end(); ++iter)
- {
- if(print_name)
- std::cout << "Interpreting " << *iter << std::endl;
-
- std::ifstream input(iter->c_str());
- printer(input);
- }
-}
-
-static inline void print_expression(const std::string& expr,
- std::function<void(std::istream&)> printer)
-{
- std::istringstream input(expr);
- printer(input);
-}
-
-static inline void print_cin(std::function<void(std::istream&)> printer)
-{
- printer(std::cin);
-}
-
-int main(int argc, char** argv)
-{
- std::vector<std::string> files;
- std::string expr;
-
- po::options_description desc("Allowed options");
- desc.add_options()
- ("help,h", "produce help message")
- ("files,f", po::value<std::vector<std::string>>()->multitoken(),
- "input scripts. If this option and -e are not specified, "
- "will use standard input")
- ("expr,e", po::value<std::string>(), "one line of script")
- ("dot,d", "print graphviz doc file instead of tree string if -s is not specified")
- ("token,t", po::value<std::string>(), "Print all tokens instead of AST. "
- "The argument is the path to libbash.tokens")
- ("walker-token,w", po::value<std::string>(), "Print all tokens received by the walker. "
- "The argument is the path to libbashWalker.tokens")
- ("name,n", "When using files as input scripts, print out file names")
- ("silent,s", "do not print any AST")
- ;
-
- po::variables_map vm;
- po::store(po::parse_command_line(argc, argv, desc), vm);
- po::notify(vm);
-
- if(vm.count("help"))
- {
- std::cout << desc << std::endl;
- return EXIT_FAILURE;
- }
-
- std::function<void(std::istream&)> printer;
- if(vm.count("token"))
- printer = std::bind(&print_parser_token,
- std::placeholders::_1,
- vm["token"].as<std::string>(),
- vm.count("silent"));
- else if(vm.count("walker-token"))
- printer = std::bind(&print_walker_token,
- std::placeholders::_1,
- vm["walker-token"].as<std::string>(),
- vm.count("silent"));
- else
- printer = std::bind(&print_ast,
- std::placeholders::_1,
- vm.count("silent"),
- vm.count("dot"));
-
- try
- {
- if(vm.count("files"))
- print_files(vm["files"].as<std::vector<std::string>>(),
- vm.count("name"),
- printer);
- else if(vm.count("expr"))
- print_expression(vm["expr"].as<std::string>(), printer);
- else
- print_cin(printer);
- }
- catch(libbash::interpreter_exception& e)
- {
- if(!vm.count("silent"))
- std::cerr << e.what() << std::endl;
- return EXIT_FAILURE;
- }
-
- return EXIT_SUCCESS;
-}
diff --git a/libbash-0.1/utils/command_line.cpp b/libbash-0.1/utils/command_line.cpp
deleted file mode 100644
index 8d238b4..0000000
--- a/libbash-0.1/utils/command_line.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-/* This file was copied from Paludis src/clients/instruo/command_line.cc that is licensed as follows: */
-
-/*
- * Copyright (c) 2007, 2008, 2009, 2010 Ciaran McCreesh
- *
- * This file is part of the Paludis package manager. Paludis is free software;
- * you can redistribute it and/or modify it under the terms of the GNU General
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include "command_line.h"
-#include <paludis/util/singleton-impl.hh>
-
-using namespace paludis;
-
-template class paludis::Singleton<CommandLine>;
-
-CommandLine::CommandLine() :
- ArgsHandler(),
-
- action_args(main_options_section(), "Actions",
- "Selects which basic action to perform. Exactly one action should "
- "be specified."),
- a_generate_cache(&action_args, "generate-cache", 'g', "Generate cache", false),
- a_version(&action_args, "version", 'V', "Display program version", false),
- a_help(&action_args, "help", 'h', "Display program help", false),
-
- general_args(main_options_section(), "General options",
- "Options which are relevant for most or all actions."),
- a_log_level(&general_args, "log-level", '\0'),
- a_no_colour(&general_args, "no-colour", '\0', "Do not use colour", false),
- a_no_color(&a_no_colour, "no-color"),
- a_force_colour(&general_args, "force-colour", '\0', "Force the use of colour", false),
- a_force_color(&a_force_colour, "force-color"),
- a_repository_directory(&general_args, "repository-dir", 'D',
- "Where to find the repository (default: current directory)"),
- a_output_directory(&general_args, "output-dir", 'o',
- "Where to place generated metadata (default: current directory)"),
- a_master_repository_name(&general_args, "master-repository-name", '\0',
- "Use the specified name for the master repository. Specify the location using --extra-repository-dir. "
- "Only for repositories with no metadata/layout.conf."),
- a_extra_repository_dir(&general_args, "extra-repository-dir", '\0',
- "Also include the repository at this location. May be specified multiple times, in creation order."),
- a_report_file(&general_args, "report-file", 'r',
- "Write report to the specified file, rather than stdout")
-{
- add_usage_line("--generate-cache [ at least one of --repository-dir /dir or --output-dir /dir ]");
-
- add_description_line("instruo is configured purely from the command line. It does not use any user "
- "configuration files.");
-
- add_environment_variable("INSTRUO_OPTIONS", "Default command-line options.");
- add_environment_variable("INSTRUO_THREADS", "Number of threads to use. Default: 5");
-}
-
-std::string
-CommandLine::app_name() const
-{
- return "instruo";
-}
-
-std::string
-CommandLine::app_synopsis() const
-{
- return "Metadata generation client for Paludis";
-}
-
-std::string
-CommandLine::app_description() const
-{
- return
- "instruo is a metadata generation client for Paludis. It generates metadata cache for every ID in a "
- "given repository and produces a report of any failures.";
-}
-
-CommandLine::~CommandLine()
-{
-}
-
diff --git a/libbash-0.1/utils/command_line.h b/libbash-0.1/utils/command_line.h
deleted file mode 100644
index 2fdb10b..0000000
--- a/libbash-0.1/utils/command_line.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* This file was copied from Paludis src/clients/instruo/command_line.hh that is licensed as follows: */
-
-/*
- * Copyright (c) 2007, 2008, 2010 Ciaran McCreesh
- *
- * This file is part of the Paludis package manager. Paludis is free software;
- * you can redistribute it and/or modify it under the terms of the GNU General
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef PALUDIS_GUARD_SRC_CLIENTS_INSTRUO_COMMAND_LINE_HH
-#define PALUDIS_GUARD_SRC_CLIENTS_INSTRUO_COMMAND_LINE_HH 1
-
-#include <paludis/args/args.hh>
-#include <paludis/util/singleton.hh>
-#include <paludis/args/log_level_arg.hh>
-
-class CommandLine :
- public paludis::args::ArgsHandler,
- public paludis::Singleton<CommandLine>
-{
- friend class paludis::Singleton<CommandLine>;
-
- private:
- CommandLine();
- ~CommandLine();
-
- public:
- virtual std::string app_name() const;
- virtual std::string app_synopsis() const;
- virtual std::string app_description() const;
-
- paludis::args::ArgsGroup action_args;
-
- paludis::args::SwitchArg a_generate_cache;
- paludis::args::SwitchArg a_version;
- paludis::args::SwitchArg a_help;
-
- paludis::args::ArgsGroup general_args;
-
- paludis::args::LogLevelArg a_log_level;
- paludis::args::SwitchArg a_no_colour;
- paludis::args::AliasArg a_no_color;
- paludis::args::SwitchArg a_force_colour;
- paludis::args::AliasArg a_force_color;
- paludis::args::StringArg a_repository_directory;
- paludis::args::StringArg a_output_directory;
- paludis::args::StringArg a_master_repository_name;
- paludis::args::StringSequenceArg a_extra_repository_dir;
- paludis::args::StringArg a_report_file;
-};
-
-#endif
diff --git a/libbash-0.1/utils/instruo.cpp b/libbash-0.1/utils/instruo.cpp
deleted file mode 100644
index dcd3924..0000000
--- a/libbash-0.1/utils/instruo.cpp
+++ /dev/null
@@ -1,263 +0,0 @@
-/* This file was partly copied from Paludis src/clients/instruo/instruo.cc.
- * The metadata generation logic is reimplemented with libbash. This file is
- * licensed as follows: */
-
-/*
- * Copyright (c) 2007, 2008, 2009, 2010 Ciaran McCreesh
- *
- * This file is part of the Paludis package manager. Paludis is free software;
- * you can redistribute it and/or modify it under the terms of the GNU General
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include <algorithm>
-#include <fstream>
-#include <functional>
-#include <iostream>
-#include <map>
-
-#include <paludis/args/do_help.hh>
-#include <paludis/about.hh>
-#include <paludis/action.hh>
-#include <paludis/package_id.hh>
-#include <paludis/generator.hh>
-#include <paludis/filter.hh>
-#include <paludis/filtered_generator.hh>
-#include <paludis/selection.hh>
-#include <paludis/util/system.hh>
-#include <paludis/util/join.hh>
-#include <paludis/util/log.hh>
-#include <paludis/util/sequence.hh>
-#include <paludis/util/map.hh>
-#include <paludis/util/visitor_cast.hh>
-#include <paludis/util/set.hh>
-#include <paludis/util/make_named_values.hh>
-#include <paludis/util/mutex.hh>
-#include <paludis/util/thread_pool.hh>
-#include <paludis/util/destringify.hh>
-#include <paludis/util/safe_ofstream.hh>
-#include <paludis/util/pretty_print.hh>
-#include <paludis/util/indirect_iterator-impl.hh>
-#include <paludis/util/timestamp.hh>
-#include <paludis/util/accept_visitor.hh>
-#include <paludis/environments/no_config/no_config_environment.hh>
-#include <paludis/package_database.hh>
-#include <paludis/metadata_key.hh>
-
-#include "builtins/builtin_exceptions.h"
-#include "command_line.h"
-#include "libbash.h"
-#include "utils/metadata.h"
-
-using namespace paludis;
-using std::cout;
-using std::cerr;
-using std::endl;
-
-void worker(const std::shared_ptr<PackageIDSequence> &ids)
-{
- std::unordered_map<std::string, std::vector<std::string>> variables;
-
- std::shared_ptr<const PackageID> id;
- unsigned total(0);
- CategoryNamePart old_cat("OLDCAT");
- while(!ids->empty())
- {
- id = *ids->begin();
- ids->pop_front();
- if (id->name().category() != old_cat)
- {
- std::cout << "Processing " << stringify(id->name().category()) << "..." << std::endl;
- old_cat = id->name().category();
- FSPath(CommandLine::get_instance()->a_output_directory.argument() + "/" +
- stringify(id->name().category())).mkdir(0755, {fspmkdo_ok_if_exists});
- ++total;
- }
-
- Context i_context("When generating metadata for ID '" + stringify(*id) + "':");
-
- variables.clear();
- variables["PN"].push_back(stringify(id->name().package()));
- variables["PV"].push_back(stringify(id->version().remove_revision()));
- variables["P"].push_back(stringify(id->name().package()) + "-" +
- stringify(id->version().remove_revision()));
- variables["PR"].push_back(id->version().revision_only());
- variables["PVR"].push_back(stringify(id->version()));
- variables["PF"].push_back(stringify(id->name().package()) + "-" + stringify(id->version()));
- variables["CATEGORY"].push_back(stringify(id->name().category()));
- std::vector<std::string> functions;
-
- std::string ebuild_path(CommandLine::get_instance()->a_repository_directory.argument() +
- variables["CATEGORY"][0] + "/" +
- variables["PN"][0] + "/" +
- variables["PN"][0] + "-" +
- variables["PVR"][0] + ".ebuild");
- try
- {
- libbash::interpret(ebuild_path, "utils/isolated-functions.sh", variables, functions);
- }
- catch(const libbash::interpreter_exception& e)
- {
- cerr << "Exception occurred while interpreting " << ebuild_path << ". The error message is:\n"
- << e.what() << endl;
- continue;
- }
- catch(const return_exception& e)
- {
- cerr << "Unhandled return exception in " << ebuild_path << ". The error message is:\n"
- << e.what() << endl;
- continue;
- }
- catch (...)
- {
- cerr << "Unhandled exception in " << ebuild_path << endl;
- continue;
- }
-
- std::string output_path(CommandLine::get_instance()->a_output_directory.argument() + "/" +
- variables["CATEGORY"][0] + "/" +
- variables["PN"][0] + "-" +
- variables["PVR"][0]);
- FSPath(output_path).dirname().mkdir(0755, {fspmkdo_ok_if_exists});
- std::ofstream output(output_path, std::ofstream::out | std::ofstream::trunc);
- write_metadata(output, variables, functions);
- }
-}
-
-int main(int argc, char** argv)
-{
- try
- {
- std::string options(paludis::getenv_with_default("INSTRUO_OPTIONS", ""));
- if (! options.empty())
- options = "(" + options + ") ";
- options += join(argv + 1, argv + argc, " ");
-
- Context context(std::string("In program ") + argv[0] + " " + options + ":");
-
- CommandLine::get_instance()->run(argc, argv, "instruo", "INSTRUO_OPTIONS", "INSTRUO_CMDLINE");
-
- if (CommandLine::get_instance()->a_help.specified())
- throw args::DoHelp();
-
- if (CommandLine::get_instance()->a_log_level.specified())
- Log::get_instance()->set_log_level(CommandLine::get_instance()->a_log_level.option());
- else
- Log::get_instance()->set_log_level(ll_qa);
-
- if (1 < (
- CommandLine::get_instance()->a_generate_cache.specified() +
- CommandLine::get_instance()->a_version.specified()
- ))
- throw args::DoHelp("you should specify exactly one action");
-
- if (! CommandLine::get_instance()->a_repository_directory.specified())
- CommandLine::get_instance()->a_repository_directory.set_argument(stringify(FSPath::cwd()));
-
- if (CommandLine::get_instance()->a_version.specified())
- {
- cout << "instruo, part of " << PALUDIS_PACKAGE << " " << PALUDIS_VERSION_MAJOR << "."
- << PALUDIS_VERSION_MINOR << "." << PALUDIS_VERSION_MICRO << PALUDIS_VERSION_SUFFIX;
- if (! std::string(PALUDIS_GIT_HEAD).empty())
- cout << " git " << PALUDIS_GIT_HEAD;
- cout << endl << endl;
- cout << "Paludis comes with ABSOLUTELY NO WARRANTY. Paludis is free software, and you" << endl;
- cout << "are welcome to redistribute it under the terms of the GNU General Public" << endl;
- cout << "License, version 2." << endl;
-
- return EXIT_SUCCESS;
- }
-
- if ((
- CommandLine::get_instance()->a_repository_directory.specified() +
- CommandLine::get_instance()->a_output_directory.specified()
- ) < 1)
- throw args::DoHelp("at least one of '--" + CommandLine::get_instance()->a_repository_directory.long_name() + "' or '--"
- + CommandLine::get_instance()->a_output_directory.long_name() + "' must be specified");
-
- if (! CommandLine::get_instance()->a_output_directory.specified())
- CommandLine::get_instance()->a_output_directory.set_argument(stringify(FSPath::cwd()));
-
- std::shared_ptr<FSPathSequence> extra_repository_dirs(std::make_shared<FSPathSequence>());
- for (args::StringSequenceArg::ConstIterator d(CommandLine::get_instance()->a_extra_repository_dir.begin_args()),
- d_end(CommandLine::get_instance()->a_extra_repository_dir.end_args()) ;
- d != d_end ; ++d)
- extra_repository_dirs->push_back(FSPath(*d));
-
- std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
- keys->insert("append_repository_name_to_write_cache", "false");
- NoConfigEnvironment env(make_named_values<no_config_environment::Params>(
- n::accept_unstable() = true,
- n::disable_metadata_cache() = true,
- n::extra_accept_keywords() = "",
- n::extra_params() = keys,
- n::extra_repository_dirs() = extra_repository_dirs,
- n::master_repository_name() = CommandLine::get_instance()->a_master_repository_name.argument(),
- n::profiles_if_not_auto() = "",
- n::repository_dir() = CommandLine::get_instance()->a_repository_directory.argument(),
- n::repository_type() = no_config_environment::ncer_ebuild,
- n::write_cache() = CommandLine::get_instance()->a_output_directory.argument()
- ));
-
- FSPath(CommandLine::get_instance()->a_output_directory.argument()).mkdir(0755, {fspmkdo_ok_if_exists});
-
- std::shared_ptr<PackageIDSequence> ids(env[selection::AllVersionsSorted(
- generator::InRepository(env.main_repository()->name()))]);
- worker(ids);
- }
- catch (const paludis::args::ArgsError & e)
- {
- cerr << "Usage error: " << e.message() << endl;
- cerr << "Try " << argv[0] << " --help" << endl;
- return EXIT_FAILURE;
- }
- catch (const args::DoHelp & h)
- {
- if (h.message.empty())
- {
- cout << "Usage: " << argv[0] << " [options]" << endl;
- cout << endl;
- cout << *CommandLine::get_instance();
- return EXIT_SUCCESS;
- }
- else
- {
- cerr << "Usage error: " << h.message << endl;
- cerr << "Try " << argv[0] << " --help" << endl;
- return EXIT_FAILURE;
- }
- }
- catch (const Exception & e)
- {
- cout << endl;
- cerr << "Unhandled exception:" << endl
- << " * " << e.backtrace("\n * ")
- << e.message() << " (" << e.what() << ")" << endl;
- return EXIT_FAILURE;
- }
- catch (const std::exception & e)
- {
- cout << endl;
- cerr << "Unhandled exception:" << endl
- << " * " << e.what() << endl;
- return EXIT_FAILURE;
- }
- catch (...)
- {
- cout << endl;
- cerr << "Unhandled exception:" << endl
- << " * Unknown exception type. Ouch..." << endl;
- return EXIT_FAILURE;
- }
-
- return EXIT_SUCCESS;
-}
diff --git a/libbash-0.1/utils/isolated-functions.sh b/libbash-0.1/utils/isolated-functions.sh
deleted file mode 100755
index 9d189ed..0000000
--- a/libbash-0.1/utils/isolated-functions.sh
+++ /dev/null
@@ -1,55 +0,0 @@
-die(){
- echo "Die is called: $*"
-}
-
-has() {
- hasq $*
-}
-
-hasq() {
- for item in ${*:2}
- do
- [[ $item == $1 ]] && return 0
- done
- return 1
-}
-
-EXPORT_FUNCTIONS() {
- if [ -z "$ECLASS" ]; then
- die "EXPORT_FUNCTIONS without a defined ECLASS"
- return 1
- fi
- __export_funcs_var="$__export_funcs_var $*"
-}
-
-use() {
- echo "use shouldn't be called"
- return 1
-}
-
-useq() {
- echo "useq shouldn't be called"
- return 1
-}
-
-use_with() {
- echo "use_with shouldn't be called"
- return 1
-}
-
-use_enable() {
- echo "use_enable shouldn't be called"
- return 1
-}
-
-eerror() {
- echo "eerror: $*"
-}
-
-debug-print() {
- echo "debug-print: $*"
-}
-
-ewarn() {
- echo "ewarn: $*"
-}
diff --git a/libbash-0.1/utils/metadata.cpp b/libbash-0.1/utils/metadata.cpp
deleted file mode 100644
index ed07092..0000000
--- a/libbash-0.1/utils/metadata.cpp
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
- */
-///
-/// \file metadata.cpp
-/// \brief a helper for printing metadata content
-///
-#include "utils/metadata.h"
-
-#include <set>
-
-#include <boost/spirit/include/karma.hpp>
-#include <boost/algorithm/string/classification.hpp>
-#include <boost/algorithm/string/split.hpp>
-#include <boost/algorithm/string/trim.hpp>
-
-static const std::vector<std::string> metadata_names = {"DEPEND", "RDEPEND", "SLOT", "SRC_URI",
- "RESTRICT", "HOMEPAGE", "LICENSE", "DESCRIPTION",
- "KEYWORDS", "INHERITED", "IUSE", "REQUIRED_USE",
- "PDEPEND", "PROVIDE", "EAPI", "PROPERTIES"};
-
-static const std::unordered_map<std::string, std::string> phases = {
- {"pkg_pretend", "ppretend"},
- {"pkg_setup", "setup"},
- {"src_unpack", "unpack"},
- {"src_prepare", "prepare"},
- {"src_configure", "configure"},
- {"src_compile", "compile"},
- {"src_test", "test"},
- {"src_install", "install"},
- {"pkg_preinst", "preinst"},
- {"pkg_postinst", "postinst"},
- {"pkg_prerm", "prerm"},
- {"pkg_postrm", "postrm"},
- {"pkg_config", "config"},
- {"pkg_info", "info"},
- {"pkg_nofetch", "nofetch"}
-};
-
-void write_metadata(std::ostream& output,
- std::unordered_map<std::string, std::vector<std::string>>& variables,
- std::vector<std::string>& functions)
-{
- for(auto iter_name = metadata_names.begin(); iter_name != metadata_names.end(); ++iter_name)
- {
- auto iter_value = variables.find(*iter_name);
- std::string value;
-
- if(iter_value != variables.end())
- value = iter_value->second[0];
-
- // Check if global is defined
- auto iter_global = variables.find("E_" + *iter_name);
- if(iter_global != variables.end())
- {
- boost::trim_if(iter_global->second[0], boost::is_any_of(" \t\n"));
- std::vector<std::string> splitted_global;
- boost::split(splitted_global,
- iter_global->second[0],
- boost::is_any_of(" \t\n"),
- boost::token_compress_on);
-
- // Append the global value to 'value' if it doesn't cause duplication
- for(auto iter_splitted_global = splitted_global.begin();
- iter_splitted_global != splitted_global.end();
- ++iter_splitted_global)
- {
- if(value.find(*iter_splitted_global) == std::string::npos)
- value += " " + *iter_splitted_global;
- }
- }
-
- boost::trim_if(value, boost::is_any_of(" \t\n"));
-
- std::vector<std::string> splitted_value;
- boost::split(splitted_value,
- value,
- boost::is_any_of(" \t\n"),
- boost::token_compress_on);
-
- // INHERITED eclasses should be sorted
- if(*iter_name == "INHERITED")
- sort(splitted_value.begin(), splitted_value.end());
-
- using namespace boost::spirit::karma;
- output << format(string % ' ', splitted_value) << std::endl;
- }
-
- // Print defined phases
- std::set<std::string> sorted_phases;
- for(auto iter = functions.begin(); iter != functions.end(); ++iter)
- {
- auto iter_phase = phases.find(*iter);
- if(iter_phase != phases.end())
- sorted_phases.insert(iter_phase->second);
- }
- using namespace boost::spirit::karma;
- output << format(string % ' ', sorted_phases) << std::endl;
-
- // Print empty lines
- output << std::endl << std::endl << std::endl << std::endl << std::endl;
-}
diff --git a/libbash-0.1/utils/metadata.h b/libbash-0.1/utils/metadata.h
deleted file mode 100644
index 7071ce0..0000000
--- a/libbash-0.1/utils/metadata.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
- */
-///
-/// \file metadata.h
-/// \brief a helper for printing metadata content
-///
-#include <iostream>
-#include <string>
-#include <unordered_map>
-#include <vector>
-
-void write_metadata(std::ostream& output,
- std::unordered_map<std::string, std::vector<std::string>>& variables,
- std::vector<std::string>& functions);
diff --git a/libbash-0.1/utils/metadata_diff.sh b/libbash-0.1/utils/metadata_diff.sh
deleted file mode 100755
index 7a21855..0000000
--- a/libbash-0.1/utils/metadata_diff.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/bin/bash
-
-source /etc/make.conf
-
-outputdir=${1:-$(mktemp -d)}
-
-if [[ ! (-d $outputdir && -w $outputdir) ]]
-then
- echo "$outputdir is not writable"
-fi
-
-echo "Generating metadata at $outputdir"
-
-time ./instruo -D ${PORTDIR:-/usr/portage/} -o $outputdir 2>$outputdir/error_output
-
-echo "Running diff..."
-
-declare -i error_count=0 total_num=0
-
-for category_dir in ${PORTDIR:-/usr/portage}/*
-do
- category=${category_dir##*\/}
- cache_dir=${PORTDIR:-/usr/portage}/metadata/cache/${category}
- if [[ -d $cache_dir ]]
- then
- for path in $cache_dir/*
- do
- filename=${path##*\/}
- diff -u $cache_dir/$file $outputdir/$category/$filename > $outputdir/$category/$filename.diff 2>>$outputdir/error_output
- error_count+=$(($? != 0))
- total_num+=1
- done
- fi
-done
-
-echo "$((total_num - error_count)) out of $total_num metadata files are correct. See file.diff for more details."
diff --git a/libbash-0.1/utils/metadata_generator.cpp b/libbash-0.1/utils/metadata_generator.cpp
deleted file mode 100644
index 8951044..0000000
--- a/libbash-0.1/utils/metadata_generator.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
- */
-///
-/// \file metadata_generator.cpp
-/// \brief a simple utility for generating metadata
-///
-#include <iostream>
-#include <string>
-#include <vector>
-
-#include "libbash.h"
-#include "utils/metadata.h"
-
-int main(int argc, char** argv)
-{
- if(argc != 2)
- {
- std::cerr<<"Please provide your script as an argument"<<std::endl;
- exit(EXIT_FAILURE);
- }
-
- std::unordered_map<std::string, std::vector<std::string>> variables;
- std::vector<std::string> functions;
- libbash::interpret(argv[1], variables, functions);
-
- write_metadata(std::cout, variables, functions);
-
- return EXIT_SUCCESS;
-}
diff --git a/libbash-0.1/utils/variable_printer.cpp b/libbash-0.1/utils/variable_printer.cpp
deleted file mode 100644
index d44dc35..0000000
--- a/libbash-0.1/utils/variable_printer.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- Please use git log for copyright holder and year information
-
- This file is part of libbash.
-
- libbash 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.
-
- libbash 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 libbash. If not, see <http://www.gnu.org/licenses/>.
-*/
-///
-/// \file variable_printer.cpp
-/// \brief a program to write variables in a script into standard output
-///
-
-#include <algorithm>
-#include <iostream>
-#include <map>
-
-#include <gtest/gtest.h>
-#include <boost/spirit/include/karma.hpp>
-#include <boost/fusion/include/std_pair.hpp>
-
-#include "libbash.h"
-
-static const std::vector<std::string> special_variables
-{
- "IFS", "*", "0", "-"
-};
-
-static std::string get_src_dir()
-{
- std::string srcdir(".");
- if(getenv("srcdir"))
- srcdir = getenv("srcdir");
-
- return srcdir;
-}
-
-int main(int argc, char** argv)
-{
- if(argc != 2)
- {
- std::cerr<<"Please provide your script as an argument"<<std::endl;
- exit(EXIT_FAILURE);
- }
-
- std::unordered_map<std::string, std::vector<std::string>> variables;
- std::vector<std::string> functions;
- try
- {
- libbash::interpret(argv[1], get_src_dir() + "/utils/isolated-functions.sh", variables, functions);
- }
- catch(libbash::interpreter_exception& e)
- {
- std::cerr << e.what() << std::endl;
- return EXIT_FAILURE;
- }
-
- std::map<std::string, std::vector<std::string>> sorted(variables.begin(), variables.end());
- // Currently we don't need internal variables
- for(auto iter = special_variables.begin(); iter != special_variables.end(); ++iter)
- sorted.erase(*iter);
-
- using namespace boost::spirit::karma;
- std::cout << format((string << '=' << -(string % ' ')) % eol, sorted) << std::endl;
-
- return 0;
-}