Gentoo Archives: gentoo-commits

From: "Petteri Räty" <betelgeuse@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/libbash:master commit in: libbash-0.1/src/builtins/, /, libbash-0.1/bashast/gunit/, libbash-0.1/bashast/, ...
Date: Sun, 03 Jul 2011 20:22:28
Message-Id: 23776966a6f54657349622ffce6ae0bc89da48e3.betelgeuse@gentoo
1 commit: 23776966a6f54657349622ffce6ae0bc89da48e3
2 Author: Mu Qiao <qiaomuf <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jun 28 12:35:12 2011 +0000
4 Commit: Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
5 CommitDate: Sun Jul 3 19:50:09 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=23776966
7
8 Build: remove auto generated files
9
10 .gitignore is updated to avoid such cases in future.
11
12 ---
13 .gitignore | 1 +
14 libbash-0.1/AUTHORS | 3 -
15 libbash-0.1/COPYING | 339 -
16 libbash-0.1/Makefile.am | 377 -
17 libbash-0.1/README | 44 -
18 libbash-0.1/autogen.sh | 2 -
19 libbash-0.1/bashast/bashast.g | 773 --
20 libbash-0.1/bashast/features_script/features.sh | 121 -
21 .../bashast/features_script/features.sh.ast | 1 -
22 libbash-0.1/bashast/gunit/arith_main.gunit | 139 -
23 libbash-0.1/bashast/gunit/array.gunit | 53 -
24 libbash-0.1/bashast/gunit/assoc_array.gunit | 28 -
25 libbash-0.1/bashast/gunit/brace.gunit | 34 -
26 libbash-0.1/bashast/gunit/command_sub.gunit | 26 -
27 libbash-0.1/bashast/gunit/comment.gunit | 33 -
28 libbash-0.1/bashast/gunit/compound.gunit | 197 -
29 libbash-0.1/bashast/gunit/cond_main.gunit | 35 -
30 libbash-0.1/bashast/gunit/continued_lines.gunit | 30 -
31 libbash-0.1/bashast/gunit/expansions.gunit | 30 -
32 libbash-0.1/bashast/gunit/fname.gunit | 73 -
33 libbash-0.1/bashast/gunit/function.gunit | 53 -
34 libbash-0.1/bashast/gunit/list.gunit | 46 -
35 libbash-0.1/bashast/gunit/param_main.gunit | 72 -
36 libbash-0.1/bashast/gunit/pipeline.gunit | 32 -
37 .../bashast/gunit/process_substitution.gunit | 23 -
38 libbash-0.1/bashast/gunit/redir.gunit | 38 -
39 libbash-0.1/bashast/gunit/runtests.sh | 21 -
40 libbash-0.1/bashast/gunit/simp_command.gunit | 36 -
41 libbash-0.1/bashast/gunit/simp_prog.gunit | 38 -
42 libbash-0.1/bashast/libbashWalker.g | 1153 ---
43 libbash-0.1/configure.ac | 73 -
44 libbash-0.1/doxygen.am | 186 -
45 libbash-0.1/m4/ax_boost_base.m4 | 252 -
46 libbash-0.1/m4/ax_boost_filesystem.m4 | 118 -
47 libbash-0.1/m4/ax_boost_program_options.m4 | 108 -
48 libbash-0.1/m4/ax_boost_system.m4 | 120 -
49 libbash-0.1/m4/doxample.m4 | 321 -
50 libbash-0.1/m4/gtest.m4 | 74 -
51 libbash-0.1/m4/libtool.m4 | 7450 --------------------
52 libbash-0.1/m4/ltoptions.m4 | 369 -
53 libbash-0.1/m4/ltsugar.m4 | 123 -
54 libbash-0.1/m4/ltversion.m4 | 23 -
55 libbash-0.1/m4/lt~obsolete.m4 | 98 -
56 libbash-0.1/scripts/arithmetic_assignment.bash | 24 -
57 .../scripts/arithmetic_assignment.bash.result | 22 -
58 libbash-0.1/scripts/bar.eclass | 5 -
59 libbash-0.1/scripts/binary_arithmetic.bash | 67 -
60 libbash-0.1/scripts/binary_arithmetic.bash.result | 64 -
61 libbash-0.1/scripts/command_execution.bash | 59 -
62 libbash-0.1/scripts/command_execution.bash.result | 67 -
63 libbash-0.1/scripts/compound_command.bash | 353 -
64 libbash-0.1/scripts/compound_command.bash.result | 61 -
65 libbash-0.1/scripts/foo.eclass | 5 -
66 libbash-0.1/scripts/function_def.bash | 89 -
67 libbash-0.1/scripts/function_def.bash.result | 29 -
68 libbash-0.1/scripts/illegal_script.sh | 1 -
69 libbash-0.1/scripts/isolated_functions.bash | 13 -
70 libbash-0.1/scripts/isolated_functions.bash.result | 12 -
71 libbash-0.1/scripts/source_false.sh | 1 -
72 libbash-0.1/scripts/source_return.sh | 2 -
73 libbash-0.1/scripts/source_true.sh | 6 -
74 libbash-0.1/scripts/sunpinyin-2.0.3-r1.ebuild | 34 -
75 .../scripts/sunpinyin-2.0.3-r1.ebuild.result | 22 -
76 libbash-0.1/scripts/test_expr.bash | 54 -
77 libbash-0.1/scripts/test_expr.bash.result | 28 -
78 libbash-0.1/scripts/var_def.bash | 42 -
79 libbash-0.1/scripts/var_def.bash.result | 35 -
80 libbash-0.1/scripts/var_expansion.bash | 115 -
81 libbash-0.1/scripts/var_expansion.bash.result | 110 -
82 libbash-0.1/src/builtins/boolean_builtins.h | 40 -
83 libbash-0.1/src/builtins/break_builtin.cpp | 51 -
84 libbash-0.1/src/builtins/break_builtin.h | 35 -
85 libbash-0.1/src/builtins/builtin_exceptions.h | 97 -
86 libbash-0.1/src/builtins/continue_builtin.cpp | 51 -
87 libbash-0.1/src/builtins/continue_builtin.h | 35 -
88 libbash-0.1/src/builtins/declare_builtin.cpp | 114 -
89 libbash-0.1/src/builtins/declare_builtin.h | 46 -
90 libbash-0.1/src/builtins/echo_builtin.cpp | 120 -
91 libbash-0.1/src/builtins/echo_builtin.h | 56 -
92 libbash-0.1/src/builtins/eval_builtin.cpp | 38 -
93 libbash-0.1/src/builtins/eval_builtin.h | 46 -
94 libbash-0.1/src/builtins/inherit_builtin.cpp | 129 -
95 libbash-0.1/src/builtins/inherit_builtin.h | 54 -
96 libbash-0.1/src/builtins/let_builtin.cpp | 37 -
97 libbash-0.1/src/builtins/let_builtin.h | 35 -
98 libbash-0.1/src/builtins/printf_builtin.cpp | 63 -
99 libbash-0.1/src/builtins/printf_builtin.h | 35 -
100 libbash-0.1/src/builtins/return_builtin.cpp | 38 -
101 libbash-0.1/src/builtins/return_builtin.h | 35 -
102 libbash-0.1/src/builtins/shopt_builtin.cpp | 68 -
103 libbash-0.1/src/builtins/shopt_builtin.h | 37 -
104 libbash-0.1/src/builtins/source_builtin.cpp | 72 -
105 libbash-0.1/src/builtins/source_builtin.h | 46 -
106 libbash-0.1/src/builtins/tests/boolean_tests.cpp | 44 -
107 libbash-0.1/src/builtins/tests/break_tests.cpp | 69 -
108 libbash-0.1/src/builtins/tests/continue_tests.cpp | 69 -
109 libbash-0.1/src/builtins/tests/declare_tests.cpp | 121 -
110 libbash-0.1/src/builtins/tests/echo_tests.cpp | 59 -
111 libbash-0.1/src/builtins/tests/printf_tests.cpp | 67 -
112 libbash-0.1/src/builtins/tests/return_tests.cpp | 43 -
113 libbash-0.1/src/builtins/tests/shopt_tests.cpp | 76 -
114 libbash-0.1/src/builtins/tests/source_tests.cpp | 103 -
115 libbash-0.1/src/builtins/unset_builtin.cpp | 57 -
116 libbash-0.1/src/builtins/unset_builtin.h | 35 -
117 libbash-0.1/src/common.h | 30 -
118 libbash-0.1/src/core/bash_ast.cpp | 218 -
119 libbash-0.1/src/core/bash_ast.h | 114 -
120 libbash-0.1/src/core/bash_condition.cpp | 186 -
121 libbash-0.1/src/core/bash_condition.h | 40 -
122 libbash-0.1/src/core/divide_by_zero_error.h | 47 -
123 libbash-0.1/src/core/exceptions.h | 35 -
124 libbash-0.1/src/core/function.cpp | 38 -
125 libbash-0.1/src/core/function.h | 44 -
126 libbash-0.1/src/core/illegal_argument_exception.h | 47 -
127 libbash-0.1/src/core/interpreter.cpp | 437 --
128 libbash-0.1/src/core/interpreter.h | 517 --
129 libbash-0.1/src/core/interpreter_exception.h | 46 -
130 libbash-0.1/src/core/parse_exception.h | 47 -
131 libbash-0.1/src/core/readonly_exception.h | 47 -
132 libbash-0.1/src/core/runtime_exception.h | 47 -
133 libbash-0.1/src/core/symbols.hpp | 246 -
134 libbash-0.1/src/core/tests/bash_ast_test.cpp | 56 -
135 libbash-0.1/src/core/tests/bash_condition_test.cpp | 191 -
136 libbash-0.1/src/core/tests/interpreter_test.cpp | 263 -
137 libbash-0.1/src/core/tests/symbols_test.cpp | 152 -
138 libbash-0.1/src/core/unsupported_exception.h | 47 -
139 libbash-0.1/src/cppbash_builtin.cpp | 104 -
140 libbash-0.1/src/cppbash_builtin.h | 132 -
141 libbash-0.1/src/libbash.cpp | 80 -
142 libbash-0.1/src/libbash.h | 62 -
143 libbash-0.1/test/api_test.cpp | 85 -
144 libbash-0.1/test/ast_printer_test.sh | 33 -
145 libbash-0.1/test/ebuild_compiler.sh | 11 -
146 libbash-0.1/test/post_check.cpp | 49 -
147 libbash-0.1/test/run_tests.cpp | 37 -
148 libbash-0.1/test/script_compiler.sh | 14 -
149 libbash-0.1/test/test.cpp | 34 -
150 libbash-0.1/test/test.h | 30 -
151 libbash-0.1/test/verify_bashs_test.sh | 5 -
152 libbash-0.1/test/verify_error_output_test.sh | 5 -
153 libbash-0.1/test/walker_test.cpp | 102 -
154 libbash-0.1/test_coverage.sh | 35 -
155 libbash-0.1/utils/ast_printer.cpp | 240 -
156 libbash-0.1/utils/command_line.cpp | 88 -
157 libbash-0.1/utils/command_line.h | 62 -
158 libbash-0.1/utils/instruo.cpp | 263 -
159 libbash-0.1/utils/isolated-functions.sh | 55 -
160 libbash-0.1/utils/metadata.cpp | 117 -
161 libbash-0.1/utils/metadata.h | 30 -
162 libbash-0.1/utils/metadata_diff.sh | 36 -
163 libbash-0.1/utils/metadata_generator.cpp | 45 -
164 libbash-0.1/utils/variable_printer.cpp | 77 -
165 152 files changed, 1 insertions(+), 21332 deletions(-)
166
167 diff --git a/.gitignore b/.gitignore
168 index df9d332..93c80f9 100644
169 --- a/.gitignore
170 +++ b/.gitignore
171 @@ -9,6 +9,7 @@
172 *.class
173 *.java
174 *.tokens
175 +libbash-*
176 .deps
177 .libs
178 .dirstamp
179
180 diff --git a/libbash-0.1/AUTHORS b/libbash-0.1/AUTHORS
181 deleted file mode 100644
182 index 55ec4a1..0000000
183 --- a/libbash-0.1/AUTHORS
184 +++ /dev/null
185 @@ -1,3 +0,0 @@
186 -Nathan Eloe <powerofazure@×××××.com>
187 -Petteri Räty <betelgeuse@g.o>
188 -Mu Qiao <qiaomuf@g.o>
189
190 diff --git a/libbash-0.1/COPYING b/libbash-0.1/COPYING
191 deleted file mode 100644
192 index d159169..0000000
193 --- a/libbash-0.1/COPYING
194 +++ /dev/null
195 @@ -1,339 +0,0 @@
196 - GNU GENERAL PUBLIC LICENSE
197 - Version 2, June 1991
198 -
199 - Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
200 - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
201 - Everyone is permitted to copy and distribute verbatim copies
202 - of this license document, but changing it is not allowed.
203 -
204 - Preamble
205 -
206 - The licenses for most software are designed to take away your
207 -freedom to share and change it. By contrast, the GNU General Public
208 -License is intended to guarantee your freedom to share and change free
209 -software--to make sure the software is free for all its users. This
210 -General Public License applies to most of the Free Software
211 -Foundation's software and to any other program whose authors commit to
212 -using it. (Some other Free Software Foundation software is covered by
213 -the GNU Lesser General Public License instead.) You can apply it to
214 -your programs, too.
215 -
216 - When we speak of free software, we are referring to freedom, not
217 -price. Our General Public Licenses are designed to make sure that you
218 -have the freedom to distribute copies of free software (and charge for
219 -this service if you wish), that you receive source code or can get it
220 -if you want it, that you can change the software or use pieces of it
221 -in new free programs; and that you know you can do these things.
222 -
223 - To protect your rights, we need to make restrictions that forbid
224 -anyone to deny you these rights or to ask you to surrender the rights.
225 -These restrictions translate to certain responsibilities for you if you
226 -distribute copies of the software, or if you modify it.
227 -
228 - For example, if you distribute copies of such a program, whether
229 -gratis or for a fee, you must give the recipients all the rights that
230 -you have. You must make sure that they, too, receive or can get the
231 -source code. And you must show them these terms so they know their
232 -rights.
233 -
234 - We protect your rights with two steps: (1) copyright the software, and
235 -(2) offer you this license which gives you legal permission to copy,
236 -distribute and/or modify the software.
237 -
238 - Also, for each author's protection and ours, we want to make certain
239 -that everyone understands that there is no warranty for this free
240 -software. If the software is modified by someone else and passed on, we
241 -want its recipients to know that what they have is not the original, so
242 -that any problems introduced by others will not reflect on the original
243 -authors' reputations.
244 -
245 - Finally, any free program is threatened constantly by software
246 -patents. We wish to avoid the danger that redistributors of a free
247 -program will individually obtain patent licenses, in effect making the
248 -program proprietary. To prevent this, we have made it clear that any
249 -patent must be licensed for everyone's free use or not licensed at all.
250 -
251 - The precise terms and conditions for copying, distribution and
252 -modification follow.
253 -
254 - GNU GENERAL PUBLIC LICENSE
255 - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
256 -
257 - 0. This License applies to any program or other work which contains
258 -a notice placed by the copyright holder saying it may be distributed
259 -under the terms of this General Public License. The "Program", below,
260 -refers to any such program or work, and a "work based on the Program"
261 -means either the Program or any derivative work under copyright law:
262 -that is to say, a work containing the Program or a portion of it,
263 -either verbatim or with modifications and/or translated into another
264 -language. (Hereinafter, translation is included without limitation in
265 -the term "modification".) Each licensee is addressed as "you".
266 -
267 -Activities other than copying, distribution and modification are not
268 -covered by this License; they are outside its scope. The act of
269 -running the Program is not restricted, and the output from the Program
270 -is covered only if its contents constitute a work based on the
271 -Program (independent of having been made by running the Program).
272 -Whether that is true depends on what the Program does.
273 -
274 - 1. You may copy and distribute verbatim copies of the Program's
275 -source code as you receive it, in any medium, provided that you
276 -conspicuously and appropriately publish on each copy an appropriate
277 -copyright notice and disclaimer of warranty; keep intact all the
278 -notices that refer to this License and to the absence of any warranty;
279 -and give any other recipients of the Program a copy of this License
280 -along with the Program.
281 -
282 -You may charge a fee for the physical act of transferring a copy, and
283 -you may at your option offer warranty protection in exchange for a fee.
284 -
285 - 2. You may modify your copy or copies of the Program or any portion
286 -of it, thus forming a work based on the Program, and copy and
287 -distribute such modifications or work under the terms of Section 1
288 -above, provided that you also meet all of these conditions:
289 -
290 - a) You must cause the modified files to carry prominent notices
291 - stating that you changed the files and the date of any change.
292 -
293 - b) You must cause any work that you distribute or publish, that in
294 - whole or in part contains or is derived from the Program or any
295 - part thereof, to be licensed as a whole at no charge to all third
296 - parties under the terms of this License.
297 -
298 - c) If the modified program normally reads commands interactively
299 - when run, you must cause it, when started running for such
300 - interactive use in the most ordinary way, to print or display an
301 - announcement including an appropriate copyright notice and a
302 - notice that there is no warranty (or else, saying that you provide
303 - a warranty) and that users may redistribute the program under
304 - these conditions, and telling the user how to view a copy of this
305 - License. (Exception: if the Program itself is interactive but
306 - does not normally print such an announcement, your work based on
307 - the Program is not required to print an announcement.)
308 -
309 -These requirements apply to the modified work as a whole. If
310 -identifiable sections of that work are not derived from the Program,
311 -and can be reasonably considered independent and separate works in
312 -themselves, then this License, and its terms, do not apply to those
313 -sections when you distribute them as separate works. But when you
314 -distribute the same sections as part of a whole which is a work based
315 -on the Program, the distribution of the whole must be on the terms of
316 -this License, whose permissions for other licensees extend to the
317 -entire whole, and thus to each and every part regardless of who wrote it.
318 -
319 -Thus, it is not the intent of this section to claim rights or contest
320 -your rights to work written entirely by you; rather, the intent is to
321 -exercise the right to control the distribution of derivative or
322 -collective works based on the Program.
323 -
324 -In addition, mere aggregation of another work not based on the Program
325 -with the Program (or with a work based on the Program) on a volume of
326 -a storage or distribution medium does not bring the other work under
327 -the scope of this License.
328 -
329 - 3. You may copy and distribute the Program (or a work based on it,
330 -under Section 2) in object code or executable form under the terms of
331 -Sections 1 and 2 above provided that you also do one of the following:
332 -
333 - a) Accompany it with the complete corresponding machine-readable
334 - source code, which must be distributed under the terms of Sections
335 - 1 and 2 above on a medium customarily used for software interchange; or,
336 -
337 - b) Accompany it with a written offer, valid for at least three
338 - years, to give any third party, for a charge no more than your
339 - cost of physically performing source distribution, a complete
340 - machine-readable copy of the corresponding source code, to be
341 - distributed under the terms of Sections 1 and 2 above on a medium
342 - customarily used for software interchange; or,
343 -
344 - c) Accompany it with the information you received as to the offer
345 - to distribute corresponding source code. (This alternative is
346 - allowed only for noncommercial distribution and only if you
347 - received the program in object code or executable form with such
348 - an offer, in accord with Subsection b above.)
349 -
350 -The source code for a work means the preferred form of the work for
351 -making modifications to it. For an executable work, complete source
352 -code means all the source code for all modules it contains, plus any
353 -associated interface definition files, plus the scripts used to
354 -control compilation and installation of the executable. However, as a
355 -special exception, the source code distributed need not include
356 -anything that is normally distributed (in either source or binary
357 -form) with the major components (compiler, kernel, and so on) of the
358 -operating system on which the executable runs, unless that component
359 -itself accompanies the executable.
360 -
361 -If distribution of executable or object code is made by offering
362 -access to copy from a designated place, then offering equivalent
363 -access to copy the source code from the same place counts as
364 -distribution of the source code, even though third parties are not
365 -compelled to copy the source along with the object code.
366 -
367 - 4. You may not copy, modify, sublicense, or distribute the Program
368 -except as expressly provided under this License. Any attempt
369 -otherwise to copy, modify, sublicense or distribute the Program is
370 -void, and will automatically terminate your rights under this License.
371 -However, parties who have received copies, or rights, from you under
372 -this License will not have their licenses terminated so long as such
373 -parties remain in full compliance.
374 -
375 - 5. You are not required to accept this License, since you have not
376 -signed it. However, nothing else grants you permission to modify or
377 -distribute the Program or its derivative works. These actions are
378 -prohibited by law if you do not accept this License. Therefore, by
379 -modifying or distributing the Program (or any work based on the
380 -Program), you indicate your acceptance of this License to do so, and
381 -all its terms and conditions for copying, distributing or modifying
382 -the Program or works based on it.
383 -
384 - 6. Each time you redistribute the Program (or any work based on the
385 -Program), the recipient automatically receives a license from the
386 -original licensor to copy, distribute or modify the Program subject to
387 -these terms and conditions. You may not impose any further
388 -restrictions on the recipients' exercise of the rights granted herein.
389 -You are not responsible for enforcing compliance by third parties to
390 -this License.
391 -
392 - 7. If, as a consequence of a court judgment or allegation of patent
393 -infringement or for any other reason (not limited to patent issues),
394 -conditions are imposed on you (whether by court order, agreement or
395 -otherwise) that contradict the conditions of this License, they do not
396 -excuse you from the conditions of this License. If you cannot
397 -distribute so as to satisfy simultaneously your obligations under this
398 -License and any other pertinent obligations, then as a consequence you
399 -may not distribute the Program at all. For example, if a patent
400 -license would not permit royalty-free redistribution of the Program by
401 -all those who receive copies directly or indirectly through you, then
402 -the only way you could satisfy both it and this License would be to
403 -refrain entirely from distribution of the Program.
404 -
405 -If any portion of this section is held invalid or unenforceable under
406 -any particular circumstance, the balance of the section is intended to
407 -apply and the section as a whole is intended to apply in other
408 -circumstances.
409 -
410 -It is not the purpose of this section to induce you to infringe any
411 -patents or other property right claims or to contest validity of any
412 -such claims; this section has the sole purpose of protecting the
413 -integrity of the free software distribution system, which is
414 -implemented by public license practices. Many people have made
415 -generous contributions to the wide range of software distributed
416 -through that system in reliance on consistent application of that
417 -system; it is up to the author/donor to decide if he or she is willing
418 -to distribute software through any other system and a licensee cannot
419 -impose that choice.
420 -
421 -This section is intended to make thoroughly clear what is believed to
422 -be a consequence of the rest of this License.
423 -
424 - 8. If the distribution and/or use of the Program is restricted in
425 -certain countries either by patents or by copyrighted interfaces, the
426 -original copyright holder who places the Program under this License
427 -may add an explicit geographical distribution limitation excluding
428 -those countries, so that distribution is permitted only in or among
429 -countries not thus excluded. In such case, this License incorporates
430 -the limitation as if written in the body of this License.
431 -
432 - 9. The Free Software Foundation may publish revised and/or new versions
433 -of the General Public License from time to time. Such new versions will
434 -be similar in spirit to the present version, but may differ in detail to
435 -address new problems or concerns.
436 -
437 -Each version is given a distinguishing version number. If the Program
438 -specifies a version number of this License which applies to it and "any
439 -later version", you have the option of following the terms and conditions
440 -either of that version or of any later version published by the Free
441 -Software Foundation. If the Program does not specify a version number of
442 -this License, you may choose any version ever published by the Free Software
443 -Foundation.
444 -
445 - 10. If you wish to incorporate parts of the Program into other free
446 -programs whose distribution conditions are different, write to the author
447 -to ask for permission. For software which is copyrighted by the Free
448 -Software Foundation, write to the Free Software Foundation; we sometimes
449 -make exceptions for this. Our decision will be guided by the two goals
450 -of preserving the free status of all derivatives of our free software and
451 -of promoting the sharing and reuse of software generally.
452 -
453 - NO WARRANTY
454 -
455 - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
456 -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
457 -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
458 -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
459 -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
460 -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
461 -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
462 -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
463 -REPAIR OR CORRECTION.
464 -
465 - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
466 -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
467 -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
468 -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
469 -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
470 -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
471 -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
472 -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
473 -POSSIBILITY OF SUCH DAMAGES.
474 -
475 - END OF TERMS AND CONDITIONS
476 -
477 - How to Apply These Terms to Your New Programs
478 -
479 - If you develop a new program, and you want it to be of the greatest
480 -possible use to the public, the best way to achieve this is to make it
481 -free software which everyone can redistribute and change under these terms.
482 -
483 - To do so, attach the following notices to the program. It is safest
484 -to attach them to the start of each source file to most effectively
485 -convey the exclusion of warranty; and each file should have at least
486 -the "copyright" line and a pointer to where the full notice is found.
487 -
488 - <one line to give the program's name and a brief idea of what it does.>
489 - Copyright (C) <year> <name of author>
490 -
491 - This program is free software; you can redistribute it and/or modify
492 - it under the terms of the GNU General Public License as published by
493 - the Free Software Foundation; either version 2 of the License, or
494 - (at your option) any later version.
495 -
496 - This program is distributed in the hope that it will be useful,
497 - but WITHOUT ANY WARRANTY; without even the implied warranty of
498 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
499 - GNU General Public License for more details.
500 -
501 - You should have received a copy of the GNU General Public License along
502 - with this program; if not, write to the Free Software Foundation, Inc.,
503 - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
504 -
505 -Also add information on how to contact you by electronic and paper mail.
506 -
507 -If the program is interactive, make it output a short notice like this
508 -when it starts in an interactive mode:
509 -
510 - Gnomovision version 69, Copyright (C) year name of author
511 - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
512 - This is free software, and you are welcome to redistribute it
513 - under certain conditions; type `show c' for details.
514 -
515 -The hypothetical commands `show w' and `show c' should show the appropriate
516 -parts of the General Public License. Of course, the commands you use may
517 -be called something other than `show w' and `show c'; they could even be
518 -mouse-clicks or menu items--whatever suits your program.
519 -
520 -You should also get your employer (if you work as a programmer) or your
521 -school, if any, to sign a "copyright disclaimer" for the program, if
522 -necessary. Here is a sample; alter the names:
523 -
524 - Yoyodyne, Inc., hereby disclaims all copyright interest in the program
525 - `Gnomovision' (which makes passes at compilers) written by James Hacker.
526 -
527 - <signature of Ty Coon>, 1 April 1989
528 - Ty Coon, President of Vice
529 -
530 -This General Public License does not permit incorporating your program into
531 -proprietary programs. If your program is a subroutine library, you may
532 -consider it more useful to permit linking proprietary applications with the
533 -library. If this is what you want to do, use the GNU Lesser General
534 -Public License instead of this License.
535
536 diff --git a/libbash-0.1/Makefile.am b/libbash-0.1/Makefile.am
537 deleted file mode 100644
538 index fb36438..0000000
539 --- a/libbash-0.1/Makefile.am
540 +++ /dev/null
541 @@ -1,377 +0,0 @@
542 -###############################################
543 -#Please use git log for copyright holder and year information
544 -#
545 -#This file is part of libbash.
546 -#
547 -#libbash is free software: you can redistribute it and/or modify
548 -#it under the terms of the GNU General Public License as published by
549 -#the Free Software Foundation, either version 2 of the License, or
550 -#(at your option) any later version.
551 -#
552 -#libbash is distributed in the hope that it will be useful,
553 -#but WITHOUT ANY WARRANTY; without even the implied warranty of
554 -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
555 -#GNU General Public License for more details.
556 -#
557 -#You should have received a copy of the GNU General Public License
558 -#along with libbash. If not, see <http://www.gnu.org/licenses/>.
559 -###############################################
560 -# Makefile.am for libbash
561 -# Author: Nathan Eloe
562 -###############################################
563 -include doxygen.am
564 -
565 -ACLOCAL_AMFLAGS = -I m4
566 -
567 -TEST_EXTENSIONS= .gunit .bash .ebuild
568 -GUNIT_LOG_COMPILER = $(srcdir)/bashast/gunit/runtests.sh
569 -AM_GUNIT_LOG_FLAGS = @antlr_cp@:.
570 -GUNIT_TESTS = bashast/gunit/arith_main.gunit \
571 - bashast/gunit/array.gunit \
572 - bashast/gunit/assoc_array.gunit \
573 - bashast/gunit/brace.gunit \
574 - bashast/gunit/command_sub.gunit \
575 - bashast/gunit/comment.gunit \
576 - bashast/gunit/compound.gunit \
577 - bashast/gunit/cond_main.gunit \
578 - bashast/gunit/continued_lines.gunit \
579 - bashast/gunit/expansions.gunit \
580 - bashast/gunit/fname.gunit \
581 - bashast/gunit/function.gunit \
582 - bashast/gunit/list.gunit \
583 - bashast/gunit/param_main.gunit \
584 - bashast/gunit/pipeline.gunit \
585 - bashast/gunit/process_substitution.gunit \
586 - bashast/gunit/redir.gunit \
587 - bashast/gunit/simp_command.gunit \
588 - bashast/gunit/simp_prog.gunit
589 -
590 -BASH_LOG_COMPILER = $(srcdir)/test/script_compiler.sh
591 -BASH_TESTS = scripts/var_def.bash \
592 - scripts/var_expansion.bash \
593 - scripts/command_execution.bash \
594 - scripts/function_def.bash \
595 - scripts/arithmetic_assignment.bash \
596 - scripts/isolated_functions.bash \
597 - scripts/compound_command.bash \
598 - scripts/test_expr.bash \
599 - scripts/binary_arithmetic.bash
600 -BASH_RESULT = scripts/var_def.bash.result \
601 - scripts/var_expansion.bash.result \
602 - scripts/command_execution.bash.result \
603 - scripts/function_def.bash.result \
604 - scripts/arithmetic_assignment.bash.result \
605 - scripts/isolated_functions.bash.result \
606 - scripts/compound_command.bash.result \
607 - scripts/test_expr.bash.result \
608 - scripts/binary_arithmetic.bash.result
609 -
610 -EBUILD_LOG_COMPILER = $(srcdir)/test/ebuild_compiler.sh
611 -EBUILD_TESTS = scripts/sunpinyin-2.0.3-r1.ebuild
612 -EBUILD_RESULT = scripts/sunpinyin-2.0.3-r1.ebuild.result
613 -
614 -TESTS = $(GUNIT_TESTS) $(BASH_TESTS) $(EBUILD_TESTS)
615 -# these get cleaned so only add autogenerated stuff or modify CLEANFILES
616 -check_JAVA = bashast/java_libbashLexer.java bashast/java_libbashParser.java
617 -AM_JAVACFLAGS = -source 1.4 -classpath @antlr_cp@
618 -
619 -AM_CXXFLAGS = -std=c++0x
620 -AM_CPPFLAGS = -I$(top_srcdir)/src
621 -
622 -if DEVELOPER_MODE
623 -# -Weffc++ seems to be giving false positives on protected non
624 -# virtual destructors in base classes
625 -AM_CXXFLAGS += -Wall \
626 - -Wextra \
627 - -Wold-style-cast \
628 - -Woverloaded-virtual \
629 - -Wsign-promo \
630 - -pedantic-errors \
631 - -Werror
632 -AM_CPPFLAGS += -D_GLIBCXX_DEBUG
633 -endif
634 -
635 -if HAVE_GTEST
636 -TESTS += cppunittests \
637 - test/ast_printer_test.sh \
638 - test/verify_bashs_test.sh \
639 - test/verify_error_output_test.sh
640 -check_PROGRAMS = cppunittests
641 -
642 -cppunittests_SOURCES = test/run_tests.cpp \
643 - src/core/tests/symbols_test.cpp \
644 - src/core/tests/interpreter_test.cpp \
645 - src/core/tests/bash_ast_test.cpp \
646 - src/core/tests/bash_condition_test.cpp \
647 - src/builtins/tests/continue_tests.cpp \
648 - src/builtins/tests/break_tests.cpp \
649 - src/builtins/tests/echo_tests.cpp \
650 - src/builtins/tests/declare_tests.cpp \
651 - src/builtins/tests/boolean_tests.cpp \
652 - src/builtins/tests/source_tests.cpp \
653 - src/builtins/tests/shopt_tests.cpp \
654 - src/builtins/tests/return_tests.cpp \
655 - src/builtins/tests/printf_tests.cpp \
656 - test/test.h \
657 - test/test.cpp \
658 - test/post_check.cpp \
659 - test/api_test.cpp \
660 - test/walker_test.cpp
661 -cppunittests_LDADD = libcppbash.la \
662 - $(GTEST_LIBS) \
663 - $(BOOST_SYSTEM_LIB) \
664 - $(BOOST_FILESYSTEM_LIB)
665 -cppunittests_LDFLAGS = -static
666 -cppunittests_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/test/
667 -
668 -endif
669 -
670 -noinst_LIBRARIES = libmetadata.a
671 -
672 -libmetadata_a_SOURCES = utils/metadata.h utils/metadata.cpp
673 -libmetadata_a_CPPFLAGS = $(AM_CPPFLAGS) -Iutils
674 -
675 -noinst_PROGRAMS = variable_printer metadata_generator ast_printer instruo
676 -
677 -variable_printer_SOURCES = utils/variable_printer.cpp
678 -variable_printer_LDADD = libcppbash.la
679 -
680 -metadata_generator_SOURCES = utils/metadata_generator.cpp
681 -metadata_generator_LDADD = libcppbash.la libmetadata.a
682 -metadata_generator_CPPFLAGS = $(AM_CPPFLAGS) -Iutils
683 -
684 -instruo_SOURCES = utils/instruo.cpp utils/command_line.cpp utils/command_line.h
685 -instruo_LDADD = libcppbash.la @PALUDIS_LIBS@ libmetadata.a
686 -instruo_CPPFLAGS = $(AM_CPPFLAGS) @PALUDIS_CFLAGS@ -Iutils
687 -instruo_CXXFLAGS = $(AM_CXXFLAGS) -Wno-extra
688 -
689 -ast_printer_SOURCES = utils/ast_printer.cpp
690 -ast_printer_LDADD = libcppbash.la $(BOOST_PROGRAM_OPTIONS_LIB)
691 -ast_printer_LDFLAGS = -static
692 -# boost is probably compiled without debug STL so if that is used
693 -# linking will fail
694 -ast_printer_CPPFLAGS = $(AM_CPPFLAGS) -U_GLIBCXX_DEBUG $(BOOST_CPPFLAGS)
695 -
696 -GENERATED_LEXER_CPP = libbashLexer.cpp
697 -GENERATED_LEXER_H = libbashLexer.h
698 -GENERATED_PARSER_CPP = libbashParser.cpp
699 -GENERATED_PARSER_H = libbashParser.h
700 -GENERATED_WALKER_CPP = libbashWalker.cpp
701 -GENERATED_WALKER_H = libbashWalker.h
702 -BUILT_SOURCES = $(GENERATED_PARSER_CPP) \
703 - $(GENERATED_PARSER_H) \
704 - $(GENERATED_LEXER_CPP) \
705 - $(GENERATED_LEXER_H) \
706 - $(GENERATED_WALKER_CPP) \
707 - $(GENERATED_WALKER_H) \
708 - $(check_JAVA)
709 -CLEANFILES = $(GENERATED_PARSER_CPP) \
710 - $(GENERATED_PARSER_H) \
711 - $(GENERATED_LEXER_CPP) \
712 - $(GENERATED_LEXER_H) \
713 - $(GENERATED_WALKER_CPP) \
714 - $(GENERATED_WALKER_H) \
715 - $(check_JAVA) \
716 - libbash.g \
717 - java_libbash.g \
718 - libbash.tokens \
719 - libbash.tokens.md5 \
720 - libbashWalker.h.md5 \
721 - bashast/java_libbash.tokens \
722 - libbashWalker.tokens \
723 - javagrammar.run \
724 - cgrammar.run \
725 - walker.run \
726 - massif.out \
727 - callgrind.out
728 -
729 -lib_LTLIBRARIES = libcppbash.la
730 -libcppbash_la_SOURCES = src/common.h \
731 - src/libbash.h \
732 - src/libbash.cpp \
733 - src/cppbash_builtin.cpp \
734 - src/cppbash_builtin.h \
735 - src/builtins/continue_builtin.cpp \
736 - src/builtins/continue_builtin.h \
737 - src/builtins/break_builtin.cpp \
738 - src/builtins/break_builtin.h \
739 - src/builtins/echo_builtin.cpp \
740 - src/builtins/echo_builtin.h \
741 - src/builtins/eval_builtin.cpp \
742 - src/builtins/eval_builtin.h \
743 - src/builtins/declare_builtin.cpp \
744 - src/builtins/declare_builtin.h \
745 - src/builtins/boolean_builtins.h \
746 - src/builtins/source_builtin.h \
747 - src/builtins/source_builtin.cpp \
748 - src/builtins/shopt_builtin.h \
749 - src/builtins/shopt_builtin.cpp \
750 - src/builtins/return_builtin.h \
751 - src/builtins/return_builtin.cpp \
752 - src/builtins/printf_builtin.h \
753 - src/builtins/printf_builtin.cpp \
754 - src/builtins/let_builtin.h \
755 - src/builtins/let_builtin.cpp \
756 - src/builtins/inherit_builtin.h \
757 - src/builtins/inherit_builtin.cpp \
758 - src/builtins/unset_builtin.h \
759 - src/builtins/unset_builtin.cpp \
760 - src/builtins/builtin_exceptions.h \
761 - $(GENERATED_PARSER_C) \
762 - $(GENERATED_PARSER_H) \
763 - src/core/divide_by_zero_error.h \
764 - src/core/exceptions.h \
765 - src/core/illegal_argument_exception.h \
766 - src/core/interpreter_exception.h \
767 - src/core/parse_exception.h \
768 - src/core/readonly_exception.h \
769 - src/core/runtime_exception.h \
770 - src/core/unsupported_exception.h \
771 - src/core/interpreter.cpp \
772 - src/core/interpreter.h \
773 - src/core/symbols.hpp \
774 - src/core/function.h \
775 - src/core/function.cpp \
776 - src/core/bash_condition.h \
777 - src/core/bash_condition.cpp \
778 - src/core/bash_ast.cpp \
779 - src/core/bash_ast.h
780 -
781 -# separate library because we need per file CXXFLAGS
782 -# as antlr generated code does not pass our strict developer
783 -# warning settings
784 -noinst_LTLIBRARIES = libparser.la libwalker.la
785 -libparser_la_SOURCES = $(GENERATED_PARSER_CPP) \
786 - $(GENERATED_PARSER_H) \
787 - $(GENERATED_LEXER_CPP) \
788 - $(GENERATED_LEXER_H)
789 -
790 -libparser_la_CXXFLAGS = -std=c++0x \
791 - -fvisibility=hidden \
792 - -fvisibility-inlines-hidden
793 -
794 -libwalker_la_SOURCES = $(GENERATED_WALKER_CPP) \
795 - $(GENERATED_WALKER_H)
796 -
797 -libwalker_la_CXXFLAGS = -std=c++0x \
798 - -fvisibility=hidden \
799 - -fvisibility-inlines-hidden
800 -
801 -libcppbash_la_CXXFLAGS = $(AM_CXXFLAGS) \
802 - -fvisibility=hidden \
803 - -fvisibility-inlines-hidden
804 -if DEVELOPER_MODE
805 -# Paludis cannot get compiled with these flags.
806 -# So we only turn them on for our library.
807 -libcppbash_la_CXXFLAGS += -Wconversion -Wsign-conversion
808 -endif
809 -libcppbash_la_CFLAGS = $(AM_CFLAGS) -fvisibility=hidden
810 -libcppbash_la_LIBADD = libparser.la libwalker.la
811 -
812 -EXTRA_DIST = bashast/bashast.g \
813 - bashast/libbashWalker.g \
814 - bashast/features_script/features.sh \
815 - bashast/features_script/features.sh.ast \
816 - bashast/features_script/features.sh.tokens \
817 - bashast/features_script/features.sh.walker.tokens \
818 - test/ast_printer_test.sh \
819 - test/verify_bashs_test.sh \
820 - test/verify_error_output_test.sh \
821 - scripts/source_false.sh \
822 - scripts/source_true.sh \
823 - scripts/source_return.sh \
824 - scripts/illegal_script.sh \
825 - scripts/illegal_script.sh.tokens \
826 - scripts/foo.eclass \
827 - scripts/bar.eclass \
828 - utils/metadata_diff.sh \
829 - utils/isolated-functions.sh \
830 - test_coverage.sh \
831 - autogen.sh \
832 - $(BASH_TESTS) \
833 - $(BASH_RESULT) \
834 - $(EBUILD_TESTS) \
835 - $(EBUILD_RESULT) \
836 - $(GUNIT_TESTS) \
837 - $(GUNIT_LOG_COMPILER) \
838 - $(BASH_LOG_COMPILER) \
839 - $(EBUILD_LOG_COMPILER)
840 -
841 -coding_standard.pdf: coding_standard/coding_standard.tex
842 - $(AM_V_GEN)@PDFLATEX@ coding_standard/coding_standard.tex 2&>1 > /dev/null
843 -
844 -ANTLR = @JAVA@ -classpath @antlr_cp@ org.antlr.Tool -Xconversiontimeout 5000
845 -
846 -cgrammar.run: libbash.g
847 - $(AM_V_at)touch $@.tmp
848 - $(AM_V_GEN)$(ANTLR) -fo . $<
849 - $(AM_V_at)mv libbashParser.{c,cpp}
850 - $(AM_V_at)mv libbashLexer.{c,cpp}
851 - $(AM_V_at)mv $@.tmp $@
852 -
853 -libbash.g: bashast/bashast.g
854 - $(AM_V_at)$(CC) -E -x c++ -D OUTPUT_C $< > $@
855 - $(AM_V_at)sed -i '/^#.*/d' $@
856 - $(AM_V_at)sed -i 's/C_INCLUDE \(.*\)/\1/' $@
857 -
858 -# http://www.kolpackov.net/pipermail/notes/2004-September.txt
859 -libbash.tokens.md5: libbash.tokens
860 - $(AM_V_at)md5sum $< | cmp -s $@ -; if test $$? -ne 0; then md5sum $< > $@; fi
861 -
862 -# Avoid initializing C++ type to NULL by sed, variables whose name
863 -# starts with libbash_ will be stripped
864 -# The date information is removed from libbashWalker.h in order to make the md5 trick working
865 -walker.run: bashast/libbashWalker.g libbash.tokens.md5
866 - $(AM_V_at)touch $@.tmp
867 - $(AM_V_at)if test -a libbashWalker.h; then mv libbashWalker.h libbashWalker.h.bak; fi
868 - $(AM_V_GEN)$(ANTLR) -fo . $<
869 - $(AM_V_at)sed -i '/ * - On/d' libbashWalker.h
870 - $(AM_V_at)md5sum libbashWalker.h | cmp -s libbashWalker.h.md5 -; \
871 - if test $$? -ne 0; then \
872 - md5sum libbashWalker.h > libbashWalker.h.md5; \
873 - elif test -a libbashWalker.h.bak; then \
874 - mv libbashWalker.h.bak libbashWalker.h; \
875 - fi
876 - $(AM_V_at)sed -i -e 's/\(libbash_.*\) = NULL/\1/' libbashWalker.c
877 - $(AM_V_at)mv libbashWalker.{c,cpp}
878 - $(AM_V_at)mv $@.tmp $@
879 -
880 -$(GENERATED_PARSER_CPP): cgrammar.run
881 -$(GENERATED_PARSER_H): cgrammar.run
882 -$(GENERATED_LEXER_CPP): cgrammar.run
883 -$(GENERATED_LEXER_H): cgrammar.run
884 -libbash.tokens: cgrammar.run
885 -
886 -$(GENERATED_WALKER_CPP): walker.run
887 -$(GENERATED_WALKER_H): walker.run
888 -
889 -java_libbash.g: bashast/bashast.g
890 - $(AM_V_at)$(CC) -E -x c++ -D OUTPUT_JAVA $< > $@
891 - $(AM_V_at)sed -i '/^#.*/d' $@
892 -
893 -javagrammar.run: java_libbash.g
894 - $(AM_V_at)touch $@.tmp
895 - $(AM_V_GEN)$(ANTLR) -fo bashast $<
896 - $(AM_V_at)mv $@.tmp $@
897 -
898 -$(check_JAVA): javagrammar.run
899 -
900 -massif.out: ast_printer
901 - libtool --mode=execute valgrind \
902 - --tool=massif --massif-out-file=massif.out \
903 - ./ast_printer -nsf /usr/portage/eclass/versionator.eclass
904 -
905 -massif: massif.out
906 - ms_print --threshold=10 $<
907 -
908 -callgrind.out: ast_printer
909 - libtool --mode=execute valgrind \
910 - --tool=callgrind --callgrind-out-file=callgrind.out \
911 - ./ast_printer -s -f /usr/portage/eclass/versionator.eclass
912 -
913 -benchmark_parser: callgrind.out
914 - callgrind_annotate callgrind.out
915 -
916 -test_coverage: dist
917 - MAKE=$(MAKE) DIST_ARCHIVES=$(DIST_ARCHIVES) ./test_coverage.sh
918 - rm $(DIST_ARCHIVES)
919
920 diff --git a/libbash-0.1/README b/libbash-0.1/README
921 deleted file mode 100644
922 index 8e00feb..0000000
923 --- a/libbash-0.1/README
924 +++ /dev/null
925 @@ -1,44 +0,0 @@
926 -#############################################
927 -#Please use git log for copyright holder and year information
928 -#
929 -#This file is part of libbash.
930 -#
931 -#libbash is free software: you can redistribute it and/or modify
932 -#it under the terms of the GNU General Public License as published by
933 -#the Free Software Foundation, either version 2 of the License, or
934 -#(at your option) any later version.
935 -#
936 -#libbash is distributed in the hope that it will be useful,
937 -#but WITHOUT ANY WARRANTY; without even the implied warranty of
938 -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
939 -#GNU General Public License for more details.
940 -#
941 -#You should have received a copy of the GNU General Public License
942 -#along with libbash. If not, see <http://www.gnu.org/licenses/>.
943 -###############################################
944 -
945 -This is the README file for libbash
946 -
947 -Directory information:
948 -bashast/: Grammar file
949 -bashast/gunit: Grammar gunit tests
950 -src/: source directory for libbash library
951 -src/builtins: source directory for built in bash functionality classes
952 -src/builtins/tests: Unit tests for builtins
953 -coding_standard/: LaTeX coding standard for the project
954 -docs/: output folder for Doxygen generated documentation
955 -
956 -Build Instructions:
957 -
958 -./autogen.sh
959 -
960 -This will run ./configure for you so you are ready to build the thing.
961 -Now you can run make check to build the library and run tests. Other
962 -available targets:
963 -
964 -To build ANTLR C runtime libraries from grammar:
965 - make grammar.run
966 -To generate the coding standard from the latex file (with pdflatex):
967 - make coding_standard.pdf
968 -To generate the doxygen documentation:
969 - make doxygen-doc
970
971 diff --git a/libbash-0.1/_build/cgrammar.run.tmp b/libbash-0.1/_build/cgrammar.run.tmp
972 deleted file mode 100644
973 index e69de29..0000000
974
975 diff --git a/libbash-0.1/_build/javagrammar.run.tmp b/libbash-0.1/_build/javagrammar.run.tmp
976 deleted file mode 100644
977 index e69de29..0000000
978
979 diff --git a/libbash-0.1/autogen.sh b/libbash-0.1/autogen.sh
980 deleted file mode 100755
981 index d845062..0000000
982 --- a/libbash-0.1/autogen.sh
983 +++ /dev/null
984 @@ -1,2 +0,0 @@
985 -#!/bin/sh
986 -autoreconf -W all -i && ./configure --enable-gtest --enable-developer "$@"
987
988 diff --git a/libbash-0.1/bashast/bashast.g b/libbash-0.1/bashast/bashast.g
989 deleted file mode 100644
990 index 8903c02..0000000
991 --- a/libbash-0.1/bashast/bashast.g
992 +++ /dev/null
993 @@ -1,773 +0,0 @@
994 -/*
995 - Please use git log for copyright holder and year information
996 -
997 - This file is part of libbash.
998 -
999 - libbash is free software: you can redistribute it and/or modify
1000 - it under the terms of the GNU General Public License as published by
1001 - the Free Software Foundation, either version 2 of the License, or
1002 - (at your option) any later version.
1003 -
1004 - libbash is distributed in the hope that it will be useful,
1005 - but WITHOUT ANY WARRANTY; without even the implied warranty of
1006 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1007 - GNU General Public License for more details.
1008 -
1009 - You should have received a copy of the GNU General Public License
1010 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
1011 -*/
1012 -#ifdef OUTPUT_C
1013 -grammar libbash;
1014 -#else
1015 -grammar java_libbash;
1016 -#endif
1017 -options
1018 -{
1019 - backtrack = true;
1020 - output = AST;
1021 - memoize = true;
1022 -#ifdef OUTPUT_C
1023 - language = C;
1024 - ASTLabelType = pANTLR3_BASE_TREE;
1025 -#else
1026 - language = Java;
1027 - ASTLabelType = CommonTree;
1028 -#endif
1029 -}
1030 -tokens{
1031 - ARG;
1032 - ARRAY;
1033 - ARRAY_SIZE;
1034 - BRACE_EXP;
1035 - COMMAND_SUB;
1036 - CASE_PATTERN;
1037 - CASE_COMMAND;
1038 - SUBSHELL;
1039 - CURRENT_SHELL;
1040 - COMPOUND_COND;
1041 - CFOR;
1042 - FOR_INIT;
1043 - FOR_COND;
1044 - FOR_MOD;
1045 - IF_STATEMENT;
1046 - FNAME;
1047 - OP;
1048 - PRE_INCR;
1049 - PRE_DECR;
1050 - POST_INCR;
1051 - POST_DECR;
1052 - PROCESS_SUBSTITUTION;
1053 - VAR_REF;
1054 - NEGATION;
1055 - LIST;
1056 - STRING;
1057 - COMMAND;
1058 - FILE_DESCRIPTOR;
1059 - FILE_DESCRIPTOR_MOVE;
1060 - REDIR;
1061 - ARITHMETIC_CONDITION;
1062 - ARITHMETIC_EXPRESSION;
1063 - KEYWORD_TEST;
1064 - BUILTIN_TEST;
1065 - MATCH_ANY_EXCEPT;
1066 - EXTENDED_MATCH_EXACTLY_ONE;
1067 - EXTENDED_MATCH_AT_MOST_ONE;
1068 - EXTENDED_MATCH_NONE;
1069 - EXTENDED_MATCH_ANY;
1070 - EXTENDED_MATCH_AT_LEAST_ONE;
1071 - MATCH_PATTERN;
1072 - MATCH_REGULAR_EXPRESSION;
1073 - NOT_MATCH_PATTERN;
1074 - MATCH_ANY;
1075 - MATCH_ANY_EXCEPT;
1076 - MATCH_ALL;
1077 - MATCH_ONE;
1078 - CHARACTER_CLASS;
1079 - EQUIVALENCE_CLASS;
1080 - COLLATING_SYMBOL;
1081 - DOUBLE_QUOTED_STRING;
1082 - SINGLE_QUOTED_STRING;
1083 - VARIABLE_DEFINITIONS;
1084 - // parameter expansion operators
1085 - USE_DEFAULT_WHEN_UNSET;
1086 - USE_ALTERNATE_WHEN_UNSET;
1087 - DISPLAY_ERROR_WHEN_UNSET;
1088 - ASSIGN_DEFAULT_WHEN_UNSET;
1089 - USE_DEFAULT_WHEN_UNSET_OR_NULL;
1090 - USE_ALTERNATE_WHEN_UNSET_OR_NULL;
1091 - DISPLAY_ERROR_WHEN_UNSET_OR_NULL;
1092 - ASSIGN_DEFAULT_WHEN_UNSET_OR_NULL;
1093 - OFFSET;
1094 - LIST_EXPAND;
1095 - REPLACE_FIRST;
1096 - REPLACE_ALL;
1097 - REPLACE_AT_START;
1098 - REPLACE_AT_END;
1099 - LAZY_REMOVE_AT_START;
1100 - LAZY_REMOVE_AT_END;
1101 - // Avoid ambiguity (being a sign or an operator)
1102 - PLUS_SIGN;
1103 - MINUS_SIGN;
1104 - // Operators
1105 - NOT_EQUALS;
1106 - BUILTIN_LOGIC;
1107 -}
1108 -
1109 -@lexer::members
1110 -{
1111 -#ifdef OUTPUT_C
1112 - bool double_quoted = false;
1113 -#else
1114 - boolean double_quoted = false;
1115 -#endif
1116 -}
1117 -
1118 -#ifdef OUTPUT_C
1119 -@includes {
1120 - C_INCLUDE #include <iostream>
1121 - C_INCLUDE #include <string>
1122 -
1123 - C_INCLUDE #include <boost/numeric/conversion/cast.hpp>
1124 -}
1125 -@members
1126 -{
1127 - static std::string get_string(pANTLR3_COMMON_TOKEN token)
1128 - {
1129 - if(!token || !token->start)
1130 - return "";
1131 - // Use reinterpret_cast here because we have to cast C code.
1132 - // The real type here is int64_t which is used as a pointer.
1133 - // token->stop - token->start + 1 should be bigger than 0.
1134 - return std::string(reinterpret_cast<const char *>(token->start),
1135 - boost::numeric_cast<unsigned>(token->stop - token->start + 1));
1136 - }
1137 -
1138 - static bool is_here_end(plibbashParser ctx, const std::string& here_doc_word, int number_of_tokens_in_word)
1139 - {
1140 - std::string word;
1141 - for(int i = 1; i <= number_of_tokens_in_word; ++i)
1142 - word += get_string(LT(i));
1143 - return (word == here_doc_word);
1144 - }
1145 -
1146 - static void free_redirect_atom(plibbashParser_redirect_atom_SCOPE scope)
1147 - {
1148 - (&(scope->here_doc_word))->std::string::~string();
1149 - }
1150 -}
1151 -#endif
1152 -
1153 -start : (flcomment)? EOL* clist BLANK* (SEMIC|AMP|EOL)? EOF -> clist;
1154 -//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
1155 -flcomment
1156 - : POUND ~(EOL)* EOL;
1157 -clist
1158 - : list_level_2 -> ^(LIST list_level_2);
1159 -list_level_1
1160 - : pipeline (BLANK!*(LOGICAND^|LOGICOR^)(BLANK!|EOL!)* pipeline)*;
1161 -// ';' '&' and EOL have lower operator precedence than '&&' and '||' so we need level2 here
1162 -list_level_2
1163 - : list_level_1 (BLANK!? command_separator (BLANK!? EOL!)* BLANK!? list_level_1)*;
1164 -command_separator
1165 - : SEMIC!
1166 - | AMP^
1167 - | EOL!;
1168 -pipeline
1169 - : BLANK!* time? ((BANG) => (BANG BLANK!+))? command^ (BLANK!* PIPE^ BLANK!* command)*;
1170 -time : TIME^ BLANK!+ ((time_posix) => time_posix)?;
1171 -time_posix
1172 - : MINUS! LETTER BLANK!+;
1173 -//The structure of a command in bash
1174 -command
1175 - : command_atom redirect? -> ^(COMMAND command_atom redirect?);
1176 -command_atom
1177 - : compound_command
1178 - | function
1179 - | simple_command;
1180 -//Simple bash commands
1181 -simple_command
1182 - : variable_definitions BLANK+ bash_command -> bash_command variable_definitions
1183 - | variable_definitions -> ^(VARIABLE_DEFINITIONS variable_definitions)
1184 - | bash_command;
1185 -variable_definitions
1186 - : var_def (BLANK!+ var_def)*
1187 - | LOCAL BLANK!+ local_item (BLANK!+ local_item)*
1188 - | EXPORT! (BLANK!+ export_item)+;
1189 -local_item
1190 - :var_def
1191 - |name -> ^(EQUALS name);
1192 -export_item
1193 - :var_def
1194 - |name ->;
1195 -bash_command
1196 - : fname_no_res_word (BLANK!+ bash_command_arguments)*;
1197 -bash_command_arguments
1198 - : bash_command_arguments_atom+ -> ^(STRING bash_command_arguments_atom+);
1199 -bash_command_arguments_atom
1200 - : brace_expansion|LBRACE|RBRACE|fname_part;
1201 -redirect: (BLANK!* redirect_atom)*;
1202 -redirect_atom
1203 -#ifdef OUTPUT_C
1204 -scope {
1205 - std::string here_doc_word;
1206 - int number_of_tokens_in_word;
1207 -}
1208 -@init {
1209 - // http://antlr.1301665.n2.nabble.com/C-target-initialization-of-return-scope-structures-td5078478.html
1210 - new (&($redirect_atom::here_doc_word)) std::string;
1211 - $redirect_atom::number_of_tokens_in_word = 0;
1212 - ctx->plibbashParser_redirect_atomTop->free = &free_redirect_atom;
1213 -}
1214 -#endif
1215 - : HERE_STRING_OP^ BLANK!* fname
1216 -#ifdef OUTPUT_C
1217 - | here_doc_op BLANK* here_doc_begin redirect?
1218 -#else
1219 - | here_doc_op BLANK* n=NAME redirect?
1220 -#endif
1221 - EOL heredoc -> ^(here_doc_op ^(STRING heredoc) redirect?)
1222 - | redir_op BLANK* redir_dest -> ^(REDIR redir_op redir_dest)
1223 - | process_substitution;
1224 -#ifdef OUTPUT_C
1225 -here_doc_begin
1226 - :( {
1227 - if(LA(1) != BLANK && LA(1) != EOL)
1228 - {
1229 - $redirect_atom::here_doc_word += get_string(LT(1));
1230 - ++$redirect_atom::number_of_tokens_in_word;
1231 - }
1232 - } (~(EOL|BLANK)))+;
1233 -here_doc_end
1234 - : ({ ($redirect_atom::number_of_tokens_in_word) != 0 }? => .{ ($redirect_atom::number_of_tokens_in_word)--; })+;
1235 -heredoc : ({ !is_here_end(ctx, $redirect_atom::here_doc_word, $redirect_atom::number_of_tokens_in_word) }? => .)+ here_doc_end!;
1236 -#else
1237 -heredoc : (fname_part EOL!)*;
1238 -#endif
1239 -redir_dest
1240 - : file_desc_as_file //handles file descriptors
1241 - | fname; //path to a file
1242 -file_desc_as_file
1243 - : DIGIT -> ^(FILE_DESCRIPTOR DIGIT)
1244 - | DIGIT MINUS -> ^(FILE_DESCRIPTOR_MOVE DIGIT);
1245 -here_doc_op
1246 - : LSHIFT MINUS -> OP["<<-"]
1247 - | LSHIFT -> OP["<<"];
1248 -redir_op: AMP LESS_THAN -> OP["&<"]
1249 - | GREATER_THAN AMP -> OP[">&"]
1250 - | LESS_THAN AMP -> OP["<&"]
1251 - | LESS_THAN GREATER_THAN -> OP["<>"]
1252 - | RSHIFT -> OP[">>"]
1253 - | AMP GREATER_THAN -> OP["&>"]
1254 - | AMP RSHIFT -> OP ["&>>"]
1255 - | LESS_THAN
1256 - | GREATER_THAN
1257 - | DIGIT redir_op;
1258 -brace_expansion
1259 - : LBRACE BLANK* brace_expansion_inside BLANK* RBRACE -> ^(BRACE_EXP brace_expansion_inside);
1260 -brace_expansion_inside
1261 - : commasep|range;
1262 -range : DIGIT DOTDOT^ DIGIT
1263 - | LETTER DOTDOT^ LETTER;
1264 -brace_expansion_part
1265 - : (((~COMMA) => fname_part)+ -> ^(STRING fname_part+))+
1266 - | -> ^(STRING);
1267 -commasep: brace_expansion_part(COMMA! brace_expansion_part)+;
1268 -command_sub
1269 - : DOLLAR LPAREN clist BLANK? RPAREN -> ^(COMMAND_SUB clist)
1270 - | TICK clist BLANK? TICK -> ^(COMMAND_SUB clist) ;
1271 -//compound commands
1272 -compound_command
1273 - : for_expr
1274 - | sel_expr
1275 - | if_expr
1276 - | while_expr
1277 - | until_expr
1278 - | case_expr
1279 - | subshell
1280 - | current_shell
1281 - | arithmetic_expression
1282 - | cond_comparison;
1283 -//Expressions allowed inside a compound command
1284 -for_expr: FOR BLANK+ name (wspace IN (BLANK+ fname)+)? semiel DO wspace* clist semiel DONE -> ^(FOR name (fname+)? clist)
1285 - | 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
1286 - -> ^(CFOR ^(FOR_INIT $init)? ^(FOR_COND $fcond)? clist ^(FOR_MOD $mod)?)
1287 - ;
1288 -sel_expr: SELECT BLANK+ name (wspace IN BLANK+ fname)? semiel DO wspace* clist semiel DONE -> ^(SELECT name fname? clist)
1289 - ;
1290 -if_expr : IF wspace+ ag=clist semiel THEN wspace+ iflist=clist semiel wspace* (elif_expr)* (ELSE wspace+ else_list=clist semiel EOL*)? FI
1291 - -> ^(IF_STATEMENT ^(IF $ag $iflist) (elif_expr)* ^(ELSE $else_list)?)
1292 - ;
1293 -elif_expr
1294 - : ELIF BLANK+ ag=clist semiel THEN wspace+ iflist=clist semiel -> ^(IF["if"] $ag $iflist);
1295 -while_expr
1296 - : WHILE wspace? istrue=clist semiel DO wspace dothis=clist semiel DONE -> ^(WHILE $istrue $dothis)
1297 - ;
1298 -until_expr
1299 - : UNTIL wspace? istrue=clist semiel DO wspace dothis=clist semiel DONE -> ^(UNTIL $istrue $dothis)
1300 - ;
1301 -// double semicolon is optional for the last alternative
1302 -case_expr
1303 - : CASE BLANK+ fname wspace IN wspace case_body? ESAC -> ^(CASE fname case_body?);
1304 -case_body
1305 - : case_stmt (wspace* DOUBLE_SEMIC case_stmt)* wspace* DOUBLE_SEMIC? wspace* -> case_stmt*;
1306 -case_stmt
1307 - : wspace* (LPAREN BLANK*)? fname (BLANK* PIPE BLANK? fname)* BLANK* RPAREN (wspace* clist)?
1308 - -> ^(CASE_PATTERN fname+ (CASE_COMMAND clist)?);
1309 -//A grouping of commands executed in a subshell
1310 -subshell: LPAREN wspace? clist (BLANK* SEMIC)? (BLANK* EOL)* BLANK* RPAREN -> ^(SUBSHELL clist );
1311 -//A grouping of commands executed in the current shell
1312 -current_shell
1313 - : LBRACE wspace clist semiel wspace* RBRACE -> ^(CURRENT_SHELL clist);
1314 -//Bash arithmetic expression (( expression ))
1315 -arithmetic_expression
1316 - : LLPAREN wspace? arithmetic wspace? RPAREN RPAREN -> ^(ARITHMETIC_EXPRESSION arithmetic);
1317 -cond_comparison
1318 - : cond_expr -> ^(COMPOUND_COND cond_expr);
1319 -//Variables
1320 -//Defining a variable
1321 -//It's not legal to do FOO[1]=(a b c)
1322 -var_def
1323 - : name LSQUARE BLANK? explicit_arithmetic BLANK* RSQUARE EQUALS fname? -> ^(EQUALS ^(name explicit_arithmetic) fname?)
1324 - | name EQUALS^ value?
1325 - | name PLUS_ASSIGN array_value -> ^(PLUS_ASSIGN name array_value)
1326 - | name PLUS_ASSIGN fname_part? -> ^(EQUALS name ^(STRING ^(VAR_REF name) fname_part?));
1327 -//Possible values of a variable
1328 -value : fname
1329 - | array_value;
1330 -//allow the parser to create array variables
1331 -array_value
1332 - : LPAREN wspace* (array_atom wspace*)* RPAREN -> ^(ARRAY array_atom*);
1333 -array_atom
1334 - : (LSQUARE) => LSQUARE! BLANK!* explicit_arithmetic BLANK!? RSQUARE! EQUALS^ fname
1335 - | fname;
1336 -//Referencing a variable (different possible ways/special parameters)
1337 -var_ref
1338 - : DOLLAR LBRACE BLANK* var_exp BLANK* RBRACE -> ^(VAR_REF var_exp)
1339 - | DOLLAR name -> ^(VAR_REF name)
1340 - | DOLLAR num -> ^(VAR_REF num)
1341 - | DOLLAR TIMES -> ^(VAR_REF TIMES)
1342 - | DOLLAR AT -> ^(VAR_REF AT)
1343 - | DOLLAR POUND -> ^(VAR_REF POUND)
1344 - | DOLLAR QMARK -> ^(VAR_REF QMARK)
1345 - | DOLLAR MINUS -> ^(VAR_REF MINUS)
1346 - | DOLLAR DOLLAR -> ^(VAR_REF DOLLAR)
1347 - | DOLLAR BANG -> ^(VAR_REF BANG);
1348 -//Variable expansions
1349 -var_exp : var_name (
1350 - parameter_value_operator parameter_expansion_value
1351 - -> ^(parameter_value_operator var_name parameter_expansion_value)
1352 - | COLON wspace* os=explicit_arithmetic (COLON len=explicit_arithmetic)?
1353 - -> ^(OFFSET var_name $os ^($len)?)
1354 - | parameter_delete_operator parameter_expansion_value
1355 - -> ^(parameter_delete_operator var_name parameter_expansion_value)
1356 - | parameter_replace_operator parameter_replace_pattern (SLASH parameter_expansion_value?)?
1357 - -> ^(parameter_replace_operator var_name parameter_replace_pattern parameter_expansion_value?)
1358 - | -> var_name
1359 - )
1360 - | BANG var_name_for_bang (
1361 - TIMES -> ^(BANG var_name_for_bang TIMES)
1362 - | AT -> ^(BANG var_name_for_bang AT)
1363 - | LSQUARE (op=TIMES|op=AT) RSQUARE -> ^(LIST_EXPAND var_name_for_bang $op)
1364 - | -> ^(VAR_REF var_name_for_bang)
1365 - )
1366 - | var_size_ref;
1367 -parameter_delete_operator
1368 - : POUND -> LAZY_REMOVE_AT_START
1369 - | POUNDPOUND -> REPLACE_AT_START
1370 - | PCT -> LAZY_REMOVE_AT_END
1371 - | PCTPCT -> REPLACE_AT_END;
1372 -parameter_value_operator
1373 - : COLON MINUS -> USE_DEFAULT_WHEN_UNSET_OR_NULL
1374 - | COLON EQUALS -> ASSIGN_DEFAULT_WHEN_UNSET_OR_NULL
1375 - | COLON QMARK -> DISPLAY_ERROR_WHEN_UNSET_OR_NULL
1376 - | COLON PLUS -> USE_ALTERNATE_WHEN_UNSET_OR_NULL
1377 - | MINUS -> USE_DEFAULT_WHEN_UNSET
1378 - | EQUALS -> ASSIGN_DEFAULT_WHEN_UNSET
1379 - | QMARK -> DISPLAY_ERROR_WHEN_UNSET
1380 - | PLUS -> USE_ALTERNATE_WHEN_UNSET;
1381 -parameter_replace_pattern
1382 - : ((~SLASH) => parameter_pattern_part)+ -> ^(STRING parameter_pattern_part+);
1383 -parameter_pattern_part
1384 - : fname_part|BLANK|SEMIC;
1385 -parameter_expansion_value
1386 - : parameter_pattern_part+ -> ^(STRING parameter_pattern_part+)
1387 - | -> ^(STRING);
1388 -parameter_replace_operator
1389 - : SLASH SLASH -> REPLACE_ALL
1390 - | SLASH PCT -> REPLACE_AT_END
1391 - | SLASH POUND -> REPLACE_AT_START
1392 - | SLASH -> REPLACE_FIRST;
1393 -//Allowable refences to values
1394 -//either directly or through array
1395 -var_name
1396 - : num
1397 - | name LSQUARE AT RSQUARE -> ^(ARRAY name AT)
1398 - | name LSQUARE TIMES RSQUARE -> ^(ARRAY name TIMES)
1399 - | var_name_no_digit
1400 - | DOLLAR
1401 - | TIMES
1402 - | AT
1403 - | POUND;
1404 -//Inside arithmetic we can't allow digits
1405 -var_name_no_digit
1406 - : name^ LSQUARE! (explicit_arithmetic) RSQUARE!
1407 - | name;
1408 -//with bang the array syntax is used for array indexes
1409 -var_name_for_bang
1410 - : num|name|POUND;
1411 -var_size_ref
1412 - : POUND name LSQUARE array_size_index RSQUARE -> ^(POUND ^(name array_size_index))
1413 - | POUND^ name;
1414 -array_size_index
1415 - : DIGIT+
1416 - | (AT|TIMES) -> ARRAY_SIZE;
1417 -//Conditional Expressions
1418 -cond_expr
1419 - : LSQUARE LSQUARE wspace keyword_cond wspace RSQUARE RSQUARE -> ^(KEYWORD_TEST keyword_cond)
1420 - | LSQUARE wspace builtin_cond wspace RSQUARE -> ^(BUILTIN_TEST builtin_cond)
1421 - | TEST_EXPR wspace builtin_cond-> ^(BUILTIN_TEST builtin_cond);
1422 -cond_primary
1423 - : LPAREN! BLANK!* keyword_cond BLANK!* RPAREN!
1424 - | keyword_cond_binary
1425 - | keyword_cond_unary
1426 - | fname;
1427 -keyword_cond_binary
1428 - : cond_part BLANK* EQUALS TILDE BLANK? bash_pattern_part -> ^(MATCH_REGULAR_EXPRESSION cond_part ^(STRING bash_pattern_part))
1429 - | cond_part BLANK!* binary_str_op_keyword^ BLANK!? cond_part;
1430 -bash_pattern_part
1431 - :( ESC BLANK |ESC RSQUARE | (~(BLANK|RSQUARE)))+;
1432 -keyword_cond_unary
1433 - : uop^ BLANK!+ cond_part;
1434 -builtin_cond_primary
1435 - : LPAREN! BLANK!* builtin_cond BLANK!* RPAREN!
1436 - | builtin_cond_binary
1437 - | builtin_cond_unary
1438 - | fname;
1439 -builtin_cond_binary
1440 - : cond_part BLANK!* binary_string_op_builtin^ BLANK!* cond_part;
1441 -builtin_cond_unary
1442 - : uop^ BLANK!+ cond_part;
1443 -keyword_cond
1444 - : (negate_primary|cond_primary) (BLANK!* (LOGICOR^|LOGICAND^) BLANK!* keyword_cond)?;
1445 -builtin_cond
1446 - : (negate_builtin_primary|builtin_cond_primary) (BLANK!* builtin_logic_operator^ BLANK!* builtin_cond)?;
1447 -negate_primary
1448 - : BANG BLANK+ cond_primary -> ^(NEGATION cond_primary);
1449 -negate_builtin_primary
1450 - : BANG BLANK+ builtin_cond_primary -> ^(NEGATION builtin_cond_primary);
1451 -binary_str_op_keyword
1452 - : bop
1453 - | EQUALS EQUALS -> MATCH_PATTERN
1454 - | EQUALS
1455 - | BANG EQUALS -> NOT_MATCH_PATTERN
1456 - | LESS_THAN
1457 - | GREATER_THAN;
1458 -binary_string_op_builtin
1459 - : bop
1460 - | EQUALS EQUALS -> EQUALS
1461 - | EQUALS
1462 - | BANG EQUALS -> NOT_EQUALS
1463 - | ESC_LT
1464 - | ESC_GT;
1465 -bop : MINUS! NAME^;
1466 -unary_cond
1467 - : uop^ BLANK! cond_part;
1468 -uop : MINUS! LETTER;
1469 -builtin_logic_operator : uop -> ^(BUILTIN_LOGIC uop);
1470 -//Allowable parts of conditions
1471 -cond_part: brace_expansion
1472 - | fname;
1473 -//Rules for whitespace/line endings
1474 -wspace : BLANK+|EOL+;
1475 -semiel : BLANK* (SEMIC EOL?|EOL) BLANK*;
1476 -
1477 -num
1478 -options{k=1;backtrack=false;}
1479 - : DIGIT|NUMBER;
1480 -//A rule for filenames/strings
1481 -res_word_str
1482 - : CASE|DO|DONE|ELIF|ELSE|ESAC|FI|FOR|FUNCTION|IF|IN|SELECT|THEN|UNTIL|WHILE|TIME;
1483 -//Any allowable part of a string, including slashes, no pounds
1484 -str_part
1485 - : ns_str_part
1486 - | SLASH;
1487 -//Parts of strings, no slashes, no reserved words
1488 -//Using negation leads to code that doesn't compile with the C backend
1489 -//Should be investigated and filed upstream
1490 -//Problematic: ~(CASE|DO|DONE|ELIF|ELSE|ESAC|FI|FOR|FUNCTION|IF|IN|SELECT|THEN|UNTIL|WHILE|TIME)
1491 -ns_str_part
1492 - : num
1493 - | name
1494 - | esc_char
1495 - |OTHER|EQUALS|PCT|PCTPCT|MINUS|DOT|DOTDOT|COLON|TEST_EXPR
1496 - |TILDE|MUL_ASSIGN|DIVIDE_ASSIGN|MOD_ASSIGN|PLUS_ASSIGN|MINUS_ASSIGN
1497 - |LSHIFT_ASSIGN|RSHIFT_ASSIGN|AND_ASSIGN|XOR_ASSIGN
1498 - |OR_ASSIGN|CARET|POUND|POUNDPOUND|COMMA|EXPORT|LOCAL;
1499 -
1500 -//Generic strings/filenames.
1501 -fname : (~POUND) => fname_part fname_part* -> ^(STRING fname_part+);
1502 -//A string that is NOT a bash reserved word
1503 -fname_no_res_word
1504 - : (~POUND) => nqstr_part+ fname_part* -> ^(STRING nqstr_part+ fname_part*);
1505 -fname_part
1506 - : nqstr_part
1507 - | res_word_str;
1508 -//non-quoted string part rule, allows expansions
1509 -nqstr_part
1510 - : extended_pattern_match
1511 - | bracket_pattern_match
1512 - | var_ref
1513 - | command_sub
1514 - | arithmetic_expansion
1515 - | brace_expansion
1516 - | dqstr
1517 - | SINGLE_QUOTED_STRING_TOKEN -> ^(SINGLE_QUOTED_STRING SINGLE_QUOTED_STRING_TOKEN)
1518 - | str_part
1519 - | pattern_match_trigger
1520 - | BANG;
1521 -//double quoted string rule, allows expansions
1522 -dqstr : DQUOTE dqstr_part* DQUOTE -> ^(DOUBLE_QUOTED_STRING dqstr_part*);
1523 -dqstr_part
1524 - : var_ref
1525 - | command_sub
1526 - | arithmetic_expansion
1527 - | ESC DQUOTE -> DQUOTE
1528 - | ESC TICK -> TICK
1529 - | ESC DOLLAR -> DOLLAR
1530 - | ~(DOLLAR|TICK|DQUOTE);
1531 -//certain tokens that trigger pattern matching
1532 -pattern_match_trigger
1533 - : LSQUARE
1534 - | RSQUARE
1535 - | QMARK
1536 - | PLUS
1537 - | TIMES
1538 - | AT;
1539 -//Pattern matching using brackets
1540 -bracket_pattern_match
1541 - : LSQUARE! bracket_pattern_match_operator^ pattern_match RSQUARE!
1542 - | TIMES -> MATCH_ALL
1543 - | QMARK -> MATCH_ONE;
1544 -bracket_pattern_match_operator
1545 - : (BANG) => BANG -> MATCH_ANY_EXCEPT
1546 - | (CARET) => CARET -> MATCH_ANY_EXCEPT
1547 - | -> MATCH_ANY;
1548 -//allowable patterns with bracket pattern matching
1549 -pattern_match
1550 - : (pattern_class_match|fname_part) (pattern_class_match| (~RSQUARE) => fname_part)*;
1551 -
1552 -//special class patterns to match: [:alpha:] etc
1553 -pattern_class_match
1554 - : LSQUARE COLON NAME COLON RSQUARE -> ^(CHARACTER_CLASS NAME)
1555 - | LSQUARE EQUALS pattern_char EQUALS RSQUARE -> ^(EQUIVALENCE_CLASS pattern_char)
1556 - | LSQUARE DOT NAME DOT RSQUARE -> ^(COLLATING_SYMBOL NAME);
1557 -//Characters allowed in matching equivalence classes
1558 -pattern_char
1559 - : 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;
1560 -//extended pattern matching
1561 -extended_pattern_match
1562 - : QMARK LPAREN fname (PIPE fname)* RPAREN -> ^(EXTENDED_MATCH_AT_MOST_ONE fname+)
1563 - | TIMES LPAREN fname (PIPE fname)* RPAREN -> ^(EXTENDED_MATCH_ANY fname+)
1564 - | PLUS LPAREN fname (PIPE fname)* RPAREN -> ^(EXTENDED_MATCH_AT_LEAST_ONE fname+)
1565 - | AT LPAREN fname (PIPE fname)* RPAREN -> ^(EXTENDED_MATCH_EXACTLY_ONE fname+)
1566 - | BANG LPAREN fname (PIPE fname)* RPAREN -> ^(EXTENDED_MATCH_NONE fname+);
1567 -//The base of the arithmetic operator. Used for order of operations
1568 -arithmetic_var_ref:
1569 - var_ref -> ^(VAR_REF var_ref);
1570 -primary : num
1571 - | var_ref
1572 - | command_sub
1573 - | var_name_no_digit -> ^(VAR_REF var_name_no_digit)
1574 - | LPAREN! (arithmetics) RPAREN!;
1575 -pre_post_primary: arithmetic_var_ref | primary;
1576 -post_inc_dec
1577 - : pre_post_primary BLANK? PLUS PLUS -> ^(POST_INCR pre_post_primary)
1578 - | pre_post_primary BLANK? MINUS MINUS -> ^(POST_DECR pre_post_primary);
1579 -pre_inc_dec
1580 - : PLUS PLUS BLANK? pre_post_primary -> ^(PRE_INCR pre_post_primary)
1581 - | MINUS MINUS BLANK? pre_post_primary -> ^(PRE_DECR pre_post_primary);
1582 -unary : post_inc_dec
1583 - | pre_inc_dec
1584 - | primary BLANK!*
1585 - | PLUS BLANK* unary -> ^(PLUS_SIGN unary)
1586 - | MINUS BLANK* unary -> ^(MINUS_SIGN unary)
1587 - | (TILDE|BANG)^ BLANK!* unary;
1588 -exponential
1589 - : unary (EXP^ BLANK!* unary)* ;
1590 -times_division_modulus
1591 - : exponential ((TIMES^|SLASH^|PCT^) BLANK!* exponential)*;
1592 -addsub : times_division_modulus ((PLUS^|MINUS^) BLANK!* times_division_modulus)*;
1593 -shifts : addsub ((LSHIFT^|RSHIFT^) BLANK!* addsub)*;
1594 -compare : shifts (compare_operator^ BLANK!* shifts)?;
1595 -compare_operator
1596 - : LEQ
1597 - | GEQ
1598 - | LESS_THAN
1599 - | GREATER_THAN
1600 - | BANG EQUALS -> NOT_EQUALS;
1601 -bitwiseand
1602 - : compare (AMP^ BLANK!* compare)*;
1603 -bitwisexor
1604 - : bitwiseand (CARET^ BLANK!* bitwiseand)*;
1605 -bitwiseor
1606 - : bitwisexor (PIPE^ BLANK!* bitwisexor)*;
1607 -logicand: bitwiseor (LOGICAND^ BLANK!* bitwiseor)*;
1608 -logicor : logicand (LOGICOR^ BLANK!* logicand)*;
1609 -
1610 -arithmetic_condition
1611 - : cnd=logicor QMARK t=logicor COLON f=logicor -> ^(ARITHMETIC_CONDITION $cnd $t $f);
1612 -
1613 -arithmetic_assignment_operator
1614 - : EQUALS|MUL_ASSIGN|DIVIDE_ASSIGN|MOD_ASSIGN|PLUS_ASSIGN|MINUS_ASSIGN|LSHIFT_ASSIGN|RSHIFT_ASSIGN|AND_ASSIGN|XOR_ASSIGN|OR_ASSIGN;
1615 -
1616 -arithmetic_assignment
1617 - : ((var_name_no_digit|arithmetic_var_ref) BLANK!* arithmetic_assignment_operator^ BLANK!*)? logicor;
1618 -arithmetic
1619 - : arithmetic_condition
1620 - | arithmetic_assignment;
1621 -//The comma operator for arithmetic expansions
1622 -arithmetics
1623 - : arithmetic (COMMA! BLANK!* arithmetic)*;
1624 -//explicit arithmetic in places like array indexes
1625 -explicit_arithmetic
1626 - : (DOLLAR LLPAREN BLANK*)? arithmetics (RPAREN RPAREN)? -> arithmetics
1627 - | (DOLLAR LSQUARE BLANK*)? arithmetics RSQUARE? -> arithmetics;
1628 -//Arithmetic expansion
1629 -//the square bracket from is deprecated
1630 -//http://permalink.gmane.org/gmane.comp.shells.bash.bugs/14479
1631 -arithmetic_expansion
1632 - : DOLLAR LLPAREN BLANK* arithmetics BLANK* RPAREN RPAREN -> ^(ARITHMETIC_EXPRESSION arithmetics)
1633 - | DOLLAR LSQUARE BLANK* arithmetics BLANK* RSQUARE -> ^(ARITHMETIC_EXPRESSION arithmetics);
1634 -
1635 -process_substitution
1636 - : (dir=LESS_THAN|dir=GREATER_THAN)LPAREN clist BLANK* RPAREN -> ^(PROCESS_SUBSTITUTION $dir clist);
1637 -//the biggie: functions
1638 -function: FUNCTION BLANK+ function_name ((BLANK* parens wspace*)|wspace) compound_command -> ^(FUNCTION ^(STRING function_name) compound_command)
1639 - | function_name BLANK* parens wspace* compound_command -> ^(FUNCTION["function"] ^(STRING function_name) compound_command);
1640 -//http://article.gmane.org/gmane.comp.shells.bash.bugs/16424
1641 -//the rules from bash 3.2 general.c:
1642 -//Make sure that WORD is a valid shell identifier, i.e.
1643 -//does not contain a dollar sign, nor is quoted in any way. Nor
1644 -//does it consist of all digits.
1645 -function_name
1646 - : (NUMBER|DIGIT)? ~(DOLLAR|SQUOTE|DQUOTE|LPAREN|RPAREN|BLANK|EOL|NUMBER|DIGIT|SINGLE_QUOTED_STRING_TOKEN) ~(DOLLAR|SQUOTE|DQUOTE|LPAREN|RPAREN|BLANK|EOL)*;
1647 -parens : LPAREN BLANK* RPAREN;
1648 -name : NAME
1649 - | LETTER
1650 - | UNDERSCORE;
1651 -esc_char: ESC (DIGIT DIGIT? DIGIT?|LETTER ALPHANUM ALPHANUM?|.);
1652 -
1653 -//****************
1654 -// TOKENS/LEXER RULES
1655 -//****************
1656 -
1657 -COMMENT
1658 - : { !double_quoted }?=> (BLANK|EOL) '#' ~('\n'|'\r')* {$channel=HIDDEN;}
1659 - ;
1660 -//Bash "reserved words"
1661 -BANG : '!';
1662 -CASE : 'case';
1663 -DO : 'do';
1664 -DONE : 'done';
1665 -ELIF : 'elif';
1666 -ELSE : 'else';
1667 -ESAC : 'esac';
1668 -FI : 'fi';
1669 -FOR : 'for';
1670 -FUNCTION: 'function';
1671 -IF : 'if';
1672 -IN : 'in';
1673 -SELECT : 'select';
1674 -THEN : 'then';
1675 -UNTIL : 'until';
1676 -WHILE : 'while';
1677 -LBRACE : '{';
1678 -RBRACE : '}';
1679 -TIME : 'time';
1680 -
1681 -//Other special useful symbols
1682 -RPAREN : ')';
1683 -LPAREN : '(';
1684 -LLPAREN : '((';
1685 -LSQUARE : '[';
1686 -RSQUARE : ']';
1687 -TICK : '`';
1688 -DOLLAR : '$';
1689 -AT : '@';
1690 -DOT : '.';
1691 -DOTDOT : '..';
1692 -//Arith ops
1693 -TIMES : '*';
1694 -EQUALS : '=';
1695 -MINUS : '-';
1696 -PLUS : '+';
1697 -EXP : '**';
1698 -AMP : '&';
1699 -LEQ : '<=';
1700 -GEQ : '>=';
1701 -CARET : '^';
1702 -LESS_THAN : '<';
1703 -GREATER_THAN : '>';
1704 -LSHIFT : '<<';
1705 -RSHIFT : '>>';
1706 -MUL_ASSIGN : '*=';
1707 -DIVIDE_ASSIGN : '/=';
1708 -MOD_ASSIGN : '%=';
1709 -PLUS_ASSIGN : '+=';
1710 -MINUS_ASSIGN : '-=';
1711 -LSHIFT_ASSIGN : '<<=';
1712 -RSHIFT_ASSIGN : '>>=';
1713 -AND_ASSIGN : '&=';
1714 -XOR_ASSIGN : '^=';
1715 -OR_ASSIGN : '|=';
1716 -//some separators
1717 -SEMIC : ';';
1718 -DOUBLE_SEMIC
1719 - : ';;';
1720 -PIPE : '|';
1721 -DQUOTE : '"' { double_quoted = !double_quoted; };
1722 -SQUOTE : { double_quoted }? => '\'';
1723 -SINGLE_QUOTED_STRING_TOKEN : { !double_quoted }? => '\'' .* '\'';
1724 -COMMA : ',';
1725 -//Because bash isn't exactly whitespace dependent... need to explicitly handle blanks
1726 -BLANK : (' '|'\t')+;
1727 -EOL : ('\r'?'\n')+ ;
1728 -//some fragments for creating words...
1729 -DIGIT : '0'..'9';
1730 -NUMBER : DIGIT DIGIT+;
1731 -LETTER : ('a'..'z'|'A'..'Z');
1732 -fragment
1733 -ALPHANUM: (DIGIT|LETTER);
1734 -//Some special redirect operators
1735 -TILDE : '~';
1736 -HERE_STRING_OP
1737 - : '<<<';
1738 -//Tokens for parameter expansion
1739 -POUND : '#';
1740 -POUNDPOUND
1741 - : '##';
1742 -PCT : '%';
1743 -PCTPCT : '%%';
1744 -SLASH : '/';
1745 -COLON : ':';
1746 -QMARK : '?';
1747 -//Operators for conditional statements
1748 -TEST_EXPR : 'test';
1749 -LOCAL : 'local';
1750 -EXPORT : 'export';
1751 -LOGICAND : '&&';
1752 -LOGICOR : '||';
1753 -//Tokens for strings
1754 -CONTINUE_LINE
1755 - : (ESC EOL)+{$channel=HIDDEN;};
1756 -ESC_RPAREN
1757 - : ESC RPAREN;
1758 -ESC_LPAREN
1759 - : ESC LPAREN;
1760 -ESC_LT : ESC'<';
1761 -ESC_GT : ESC'>';
1762 -//Handle ANSI C escaped characters: escaped octal, escaped hex, escaped ctrl+ chars, then all others
1763 -ESC : '\\';
1764 -UNDERSCORE : '_';
1765 -NAME : (LETTER|UNDERSCORE)(ALPHANUM|UNDERSCORE)+;
1766 -OTHER : .;
1767
1768 diff --git a/libbash-0.1/bashast/features_script/features.sh b/libbash-0.1/bashast/features_script/features.sh
1769 deleted file mode 100644
1770 index 7efa24c..0000000
1771 --- a/libbash-0.1/bashast/features_script/features.sh
1772 +++ /dev/null
1773 @@ -1,121 +0,0 @@
1774 -#!/bin/bash
1775 -# A "featureful" script that demonstrates all the functionality of the parser
1776 -
1777 -#############################################
1778 -#Please use git log for copyright holder and year information
1779 -#
1780 -#This file is part of libbash.
1781 -#
1782 -#libbash is free software: you can redistribute it and/or modify
1783 -#it under the terms of the GNU General Public License as published by
1784 -#the Free Software Foundation, either version 2 of the License, or
1785 -#(at your option) any later version.
1786 -#
1787 -#libbash is distributed in the hope that it will be useful,
1788 -#but WITHOUT ANY WARRANTY; without even the implied warranty of
1789 -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1790 -#GNU General Public License for more details.
1791 -#
1792 -#You should have received a copy of the GNU General Public License
1793 -#along with libbash. If not, see <http://www.gnu.org/licenses/>.
1794 -##############################################
1795 -
1796 -#comment
1797 -#demonstrates expansions in strings both double- and non-quoted
1798 -function lots_o_echo() {
1799 - echo "The number of tests that have failed: $failedtests"
1800 - echo '$failedtests'
1801 - echo $failedtests
1802 -}
1803 -
1804 -do_some_arith() {
1805 - (( 5*4 ))
1806 - (( 5**4 ))
1807 - (( $failedtests+5/4 ))
1808 - (( $z+-3 ))
1809 -}
1810 -
1811 -function arrays() (
1812 - asdf=(a b c d)
1813 - echo ${asdf[3]}
1814 - foo=(`echo 6` b c d)
1815 - arr[foo]=3
1816 - bar=(a b [5]=c);
1817 -)
1818 -
1819 -echo {a,b}
1820 -echo {a..d}
1821 -echo {{a,b},c,d}
1822 -echo a{b,c}
1823 -
1824 -$(echo foobar)
1825 -ls |grep gunit >> filelist
1826 -
1827 -case `echo asdf` in
1828 -gz)
1829 -echo yay
1830 -;;
1831 -bzip)
1832 -echo three
1833 -;;
1834 -*) echo woo
1835 -;;
1836 -esac
1837 -
1838 -for each in `ls |grep log`; do
1839 - echo $each
1840 - cat each
1841 -done
1842 -
1843 -for ((5+3;6+2;3+1)); do echo yay; done
1844 -
1845 -select each in `ls |grep output`; do
1846 - echo asdf 2> /dev/null
1847 -done
1848 -
1849 -if echo yay2; then
1850 - echo yay
1851 -fi
1852 -
1853 -until [[ -a this/is.afile ]]; do
1854 - touch this/is.afile
1855 -done
1856 -
1857 -while [ -n foobar ]; do
1858 - echo "file found"
1859 -done
1860 -
1861 -if test 5 -eq 6; then
1862 - echo "something's wrong"
1863 -fi
1864 -
1865 -echo this command has multiple arguments
1866 -
1867 -wc <(cat /usr/share/dict/linux.words)
1868 -
1869 -cd build && ./configure && make && make_install || echo fail
1870 -
1871 -cd /usr/bin; ls -al|grep more
1872 -
1873 -asdf=parameters
1874 -${asdf:-foo}
1875 -${asdf:8}
1876 -${!asdf*}
1877 -${!asdf@}
1878 -${#foo}
1879 -${replaice/with/pattern}
1880 -${asdf#bar}
1881 -${asdf##bar}
1882 -${asdf%bar}
1883 -${asdf%bar}
1884 -$1 $@ $*
1885 -$?
1886 -${PV//./_}
1887 -${PV/#foo/bar}
1888 -${PV/%foo/bar}
1889 -
1890 -MY_PN=${PN/asterisk-}
1891 -
1892 -cat asdf |grep three 2>&1 > /dev/null
1893 -echo asdf >> APPEND
1894 -echo cat <<<word
1895
1896 diff --git a/libbash-0.1/bashast/features_script/features.sh.ast b/libbash-0.1/bashast/features_script/features.sh.ast
1897 deleted file mode 100644
1898 index ad37b9c..0000000
1899 --- a/libbash-0.1/bashast/features_script/features.sh.ast
1900 +++ /dev/null
1901 @@ -1 +0,0 @@
1902 -(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 (
1903 = (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
1904 (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 (BU
1905 ILTIN_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_
1906 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 (
1907 STRING echo) (STRING cat) (<<< (STRING word))))
1908
1909 diff --git a/libbash-0.1/bashast/gunit/arith_main.gunit b/libbash-0.1/bashast/gunit/arith_main.gunit
1910 deleted file mode 100644
1911 index 38c8e2e..0000000
1912 --- a/libbash-0.1/bashast/gunit/arith_main.gunit
1913 +++ /dev/null
1914 @@ -1,139 +0,0 @@
1915 -/*
1916 - Please use git log for copyright holder and year information
1917 -
1918 - This file is part of libbash.
1919 -
1920 - libbash is free software: you can redistribute it and/or modify
1921 - it under the terms of the GNU General Public License as published by
1922 - the Free Software Foundation, either version 2 of the License, or
1923 - (at your option) any later version.
1924 -
1925 - libbash is distributed in the hope that it will be useful,
1926 - but WITHOUT ANY WARRANTY; without even the implied warranty of
1927 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1928 - GNU General Public License for more details.
1929 -
1930 - You should have received a copy of the GNU General Public License
1931 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
1932 -*/
1933 -gunit java_libbash;
1934 -
1935 -//for this set of unittests, we'll start from the
1936 -//top of the order of ops
1937 -
1938 -primary:
1939 -"3" -> "3"
1940 -"foo" -> (VAR_REF foo)
1941 -"foo[1]" -> (VAR_REF (foo 1))
1942 -
1943 -post_inc_dec:
1944 -"b--" -> (POST_DECR (VAR_REF b))
1945 -"i++" -> (POST_INCR (VAR_REF i))
1946 -
1947 -pre_inc_dec:
1948 -"++i" -> (PRE_INCR (VAR_REF i))
1949 -"--b" -> (PRE_DECR (VAR_REF b))
1950 -
1951 -unary:
1952 -"6" -> "6"
1953 -"+9" -> (PLUS_SIGN 9)
1954 -"-15" -> (MINUS_SIGN 15)
1955 -"++ z" -> (PRE_INCR (VAR_REF z))
1956 -"f--" -> (POST_DECR (VAR_REF f))
1957 -"~8" -> (~ 8)
1958 -"!8" -> (! 8)
1959 -"!!8" -> (! (! 8))
1960 -"--8" -> (PRE_DECR 8)
1961 -"+++${a}" -> (PLUS_SIGN (PRE_INCR (VAR_REF (VAR_REF a))))
1962 -"++++${a}" -> (PLUS_SIGN (PLUS_SIGN (PRE_INCR (VAR_REF (VAR_REF a)))))
1963 -"+-++${a}" -> (PLUS_SIGN (MINUS_SIGN (PRE_INCR (VAR_REF (VAR_REF a)))))
1964 -
1965 -exponential:
1966 -"8" -> "8"
1967 -"6**2" -> (** 6 2)
1968 -"-5**+4" -> (** (MINUS_SIGN 5) (PLUS_SIGN 4))
1969 -
1970 -times_division_modulus:
1971 -"9" -> "9"
1972 -"7 * 9" -> (* 7 9)
1973 -"7 / 9" -> (/ 7 9)
1974 -"7 % 9" -> (% 7 9)
1975 -"6*4*3" -> (* (* 6 4) 3)
1976 -"6*4/3" -> (/ (* 6 4) 3)
1977 -"6%4*3" -> (* (% 6 4) 3)
1978 -"7/3**6" -> (/ 7 (** 3 6))
1979 -"7/-3**6" -> (/ 7 (** (MINUS_SIGN 3) 6))
1980 -
1981 -addsub:
1982 -"10" -> "10"
1983 -"9+27" -> (+ 9 27)
1984 -"9-27" -> (- 9 27)
1985 -"9-27+8" -> (+ (- 9 27) 8)
1986 -"9-35*-2" -> (- 9 (* 35 (MINUS_SIGN 2)))
1987 -"9*5+2" -> (+ (* 9 5) 2)
1988 -
1989 -shifts:
1990 -"16" -> "16"
1991 -"16+2>>3" -> (>> (+ 16 2) 3)
1992 -"16+2<<3" -> (<< (+ 16 2) 3)
1993 -
1994 -compare:
1995 -"17" ->"17"
1996 -"19<20" -> (< 19 20)
1997 -"19!=20" -> (NOT_EQUALS 19 20)
1998 -
1999 -bitwiseand:
2000 -"17" -> "17"
2001 -"17 & 15" -> (& 17 15)
2002 -
2003 -bitwisexor:
2004 -"17" -> "17"
2005 -"17 ^ 15" -> (^ 17 15)
2006 -
2007 -bitwiseor:
2008 -"17" -> "17"
2009 -"17 | 15" -> (| 17 15)
2010 -
2011 -logicand:
2012 -"17" -> "17"
2013 -"17 && 15" -> (&& 17 15)
2014 -
2015 -logicor:
2016 -"17" -> "17"
2017 -"17 || 15" -> (|| 17 15)
2018 -
2019 -arithmetic_assignment:
2020 -"13"->"13"
2021 -"foo=5+3" -> (= foo (+ 5 3))
2022 -"foo[5]=5+3" -> (= (foo 5) (+ 5 3))
2023 -"${foo[5]}=3" -> (= (VAR_REF (VAR_REF (foo 5))) 3)
2024 -"${foo[5]}*=3" -> (*= (VAR_REF (VAR_REF (foo 5))) 3)
2025 -"${foo[5]}^=3" -> (^= (VAR_REF (VAR_REF (foo 5))) 3)
2026 -"var *= 5" -> (*= var 5)
2027 -"var /= 5" -> (/= var 5)
2028 -"var %= 5" -> (%= var 5)
2029 -"asdf += 5" -> (+= asdf 5)
2030 -"var -= 5" -> (-= var 5)
2031 -"var <<= 5" -> (<<= var 5)
2032 -"var >>= 5" -> (>>= var 5)
2033 -"var &= 5" -> (&= var 5)
2034 -"var ^= 5" -> (^= var 5)
2035 -"var |= 5" -> (|= var 5)
2036 -"3=7" FAIL
2037 -
2038 -arithmetic_condition:
2039 -"5?7:2"->(ARITHMETIC_CONDITION 5 7 2)
2040 -"(4-3)?0:1"->(ARITHMETIC_CONDITION (- 4 3) 0 1)
2041 -
2042 -arithmetics:
2043 -"~ 10" -> (~ 10)
2044 -
2045 -arithmetic_expansion:
2046 -"$((5+4, 3+2, a*b))" -> (ARITHMETIC_EXPRESSION (+ 5 4) (+ 3 2) (* (VAR_REF a) (VAR_REF b)))
2047 -"$[1]" -> (ARITHMETIC_EXPRESSION 1)
2048 -
2049 -start:
2050 -"echo $(( 3 + 2 ))" -> (LIST (COMMAND (STRING echo) (STRING (ARITHMETIC_EXPRESSION (+ 3 2)))))
2051 -"echo $((++i))" -> (LIST (COMMAND (STRING echo) (STRING (ARITHMETIC_EXPRESSION (PRE_INCR (VAR_REF i))))))
2052 -"echo $(( ++i ))" -> (LIST (COMMAND (STRING echo) (STRING (ARITHMETIC_EXPRESSION (PRE_INCR (VAR_REF i))))))
2053 -"echo \"The solution is: $(( 3+2 ))\""-> (LIST (COMMAND (STRING echo) (STRING (DOUBLE_QUOTED_STRING The solution is : (ARITHMETIC_EXPRESSION (+ 3 2))))))
2054
2055 diff --git a/libbash-0.1/bashast/gunit/array.gunit b/libbash-0.1/bashast/gunit/array.gunit
2056 deleted file mode 100644
2057 index ce0b344..0000000
2058 --- a/libbash-0.1/bashast/gunit/array.gunit
2059 +++ /dev/null
2060 @@ -1,53 +0,0 @@
2061 -/*
2062 - Please use git log for copyright holder and year information
2063 -
2064 - This file is part of libbash.
2065 -
2066 - libbash is free software: you can redistribute it and/or modify
2067 - it under the terms of the GNU General Public License as published by
2068 - the Free Software Foundation, either version 2 of the License, or
2069 - (at your option) any later version.
2070 -
2071 - libbash is distributed in the hope that it will be useful,
2072 - but WITHOUT ANY WARRANTY; without even the implied warranty of
2073 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2074 - GNU General Public License for more details.
2075 -
2076 - You should have received a copy of the GNU General Public License
2077 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
2078 -*/
2079 -gunit java_libbash;
2080 -
2081 -var_def:
2082 -"asdf=(a b c d)"->(= asdf (ARRAY (STRING a) (STRING b) (STRING c) (STRING d)))
2083 -"asdf=(`echo 6` b c d)"-> (= asdf (ARRAY (STRING (COMMAND_SUB (LIST (COMMAND (STRING echo) (STRING 6))))) (STRING b) (STRING c) (STRING d)))
2084 -"asdf=(${P} b c d)"->(= asdf (ARRAY (STRING (VAR_REF P)) (STRING b) (STRING c) (STRING d)))
2085 -"asdf=($(echo a))" -> (= asdf (ARRAY (STRING (COMMAND_SUB (LIST (COMMAND (STRING echo) (STRING a)))))))
2086 -"asdf=(
2087 - --disable-dependency-tracking
2088 - ${VAR}
2089 -)" -> (= asdf (ARRAY (STRING - - disable - dependency - tracking) (STRING (VAR_REF VAR))))
2090 -"asdf=()" -> (= asdf ARRAY)
2091 -"asdf+=()" -> (+= asdf ARRAY)
2092 -"asdf+=(a)" -> (+= asdf (ARRAY (STRING a)))
2093 -
2094 -var_ref:
2095 -"$asdf" -> (VAR_REF asdf)
2096 -"${asdf[0]:-default}" -> (VAR_REF (USE_DEFAULT_WHEN_UNSET_OR_NULL (asdf 0) (STRING default)))
2097 -"${asdf[3]}" -> (VAR_REF (asdf 3))
2098 -"${asdf[4] }" -> (VAR_REF (asdf 4))
2099 -"${asdf[i*2]}" -> (VAR_REF (asdf (* (VAR_REF i) 2))))
2100 -"${asdf[1]:2:2}" -> (VAR_REF (OFFSET (asdf 1) 2 2))
2101 -"${asdf[2]##word}" -> (VAR_REF (REPLACE_AT_START (asdf 2) (STRING word)))
2102 -"${asdf[3]%%word}" -> (VAR_REF (REPLACE_AT_END (asdf 3) (STRING word)))
2103 -"${asdf[4]//pattern}" -> (VAR_REF (REPLACE_ALL (asdf 4) (STRING pattern)))
2104 -"${asdf}" -> (VAR_REF asdf)
2105 -"${#asdf[0]}" -> (VAR_REF (# (asdf 0)))
2106 -"${asdf[@]}" -> (VAR_REF (ARRAY asdf @))
2107 -"${asdf[*]}" -> (VAR_REF (ARRAY asdf *))
2108 -"${#asdf[@]}" -> (VAR_REF (# (asdf ARRAY_SIZE)))
2109 -"${#asdf[*]}" -> (VAR_REF (# (asdf ARRAY_SIZE)))
2110 -"${asdf[@]:0:1}" -> (VAR_REF (OFFSET (ARRAY asdf @) 0 1))
2111 -"${asdf[*]#path}" -> (VAR_REF (LAZY_REMOVE_AT_START (ARRAY asdf *) (STRING path)))
2112 -"${asdf[@]%word}" -> (VAR_REF (LAZY_REMOVE_AT_END (ARRAY asdf @) (STRING word)))
2113 -"${asdf[*]/pattern/string}" -> (VAR_REF (REPLACE_FIRST (ARRAY asdf *) (STRING pattern) (STRING string)))
2114
2115 diff --git a/libbash-0.1/bashast/gunit/assoc_array.gunit b/libbash-0.1/bashast/gunit/assoc_array.gunit
2116 deleted file mode 100644
2117 index 3bdca9a..0000000
2118 --- a/libbash-0.1/bashast/gunit/assoc_array.gunit
2119 +++ /dev/null
2120 @@ -1,28 +0,0 @@
2121 -/*
2122 - Please use git log for copyright holder and year information
2123 -
2124 - This file is part of libbash.
2125 -
2126 - libbash is free software: you can redistribute it and/or modify
2127 - it under the terms of the GNU General Public License as published by
2128 - the Free Software Foundation, either version 2 of the License, or
2129 - (at your option) any later version.
2130 -
2131 - libbash is distributed in the hope that it will be useful,
2132 - but WITHOUT ANY WARRANTY; without even the implied warranty of
2133 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2134 - GNU General Public License for more details.
2135 -
2136 - You should have received a copy of the GNU General Public License
2137 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
2138 -*/
2139 -gunit java_libbash;
2140 -
2141 -var_def:
2142 -"arr[foo]=\"asdf\"" -> (= (arr (VAR_REF foo)) (STRING (DOUBLE_QUOTED_STRING asdf)))
2143 -"arr=(a b [4]=c)" -> (= arr (ARRAY (STRING a) (STRING b) (= 4 (STRING c))))
2144 -"asdf[idx]=${var}" -> (= (asdf (VAR_REF idx)) (STRING (VAR_REF var)))
2145 -"asdf[++i]=${var}" -> (= (asdf (PRE_INCR (VAR_REF i))) (STRING (VAR_REF var)))
2146 -"asdf[++i,j]=${var}" -> (= (asdf (PRE_INCR (VAR_REF i)) (VAR_REF j)) (STRING (VAR_REF var)))
2147 -"asdf[$((i))]=${var}" -> (= (asdf (VAR_REF i)) (STRING (VAR_REF var)))
2148 -"asdf[1]=(a b c)" FAIL
2149
2150 diff --git a/libbash-0.1/bashast/gunit/brace.gunit b/libbash-0.1/bashast/gunit/brace.gunit
2151 deleted file mode 100644
2152 index 5d33d83..0000000
2153 --- a/libbash-0.1/bashast/gunit/brace.gunit
2154 +++ /dev/null
2155 @@ -1,34 +0,0 @@
2156 -/*
2157 - Please use git log for copyright holder and year information
2158 -
2159 - This file is part of libbash.
2160 -
2161 - libbash is free software: you can redistribute it and/or modify
2162 - it under the terms of the GNU General Public License as published by
2163 - the Free Software Foundation, either version 2 of the License, or
2164 - (at your option) any later version.
2165 -
2166 - libbash is distributed in the hope that it will be useful,
2167 - but WITHOUT ANY WARRANTY; without even the implied warranty of
2168 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2169 - GNU General Public License for more details.
2170 -
2171 - You should have received a copy of the GNU General Public License
2172 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
2173 -*/
2174 -gunit java_libbash;
2175 -
2176 -brace_expansion:
2177 -"{a,b}"-> (BRACE_EXP (STRING a) (STRING b))
2178 -"{$a/$b,b}"-> (BRACE_EXP (STRING (VAR_REF a) / (VAR_REF b)) (STRING b))
2179 -"{a,b,c}" -> (BRACE_EXP (STRING a) (STRING b) (STRING c))
2180 -"{a..d}" -> (BRACE_EXP (.. a d))
2181 -"{{a,b},c,d}" -> (BRACE_EXP (STRING (BRACE_EXP (STRING a) (STRING b))) (STRING c) (STRING d))
2182 -"{.txt,,}" -> (BRACE_EXP (STRING . txt) STRING STRING)
2183 -"{GNUmakefile,{M,m}akefile}" -> (BRACE_EXP (STRING GNUmakefile) (STRING (BRACE_EXP (STRING M) (STRING m)) akefile))
2184 -
2185 -fname:
2186 -"a{b,c}" -> (STRING a (BRACE_EXP (STRING b) (STRING c)))
2187 -"{c..d}f" -> (STRING (BRACE_EXP (.. c d)) f)
2188 -"a{a,b}b{c,d}" -> (STRING a (BRACE_EXP (STRING a) (STRING b)) b (BRACE_EXP (STRING c) (STRING d)))
2189 -"[{a,b}-c]*" -> (STRING (MATCH_ANY (BRACE_EXP (STRING a) (STRING b)) - c) MATCH_ALL)
2190
2191 diff --git a/libbash-0.1/bashast/gunit/command_sub.gunit b/libbash-0.1/bashast/gunit/command_sub.gunit
2192 deleted file mode 100644
2193 index e2d0021..0000000
2194 --- a/libbash-0.1/bashast/gunit/command_sub.gunit
2195 +++ /dev/null
2196 @@ -1,26 +0,0 @@
2197 -/*
2198 - Please use git log for copyright holder and year information
2199 -
2200 - This file is part of libbash.
2201 -
2202 - libbash is free software: you can redistribute it and/or modify
2203 - it under the terms of the GNU General Public License as published by
2204 - the Free Software Foundation, either version 2 of the License, or
2205 - (at your option) any later version.
2206 -
2207 - libbash is distributed in the hope that it will be useful,
2208 - but WITHOUT ANY WARRANTY; without even the implied warranty of
2209 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2210 - GNU General Public License for more details.
2211 -
2212 - You should have received a copy of the GNU General Public License
2213 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
2214 -*/
2215 -gunit java_libbash;
2216 -
2217 -command_sub:
2218 -"$(echo \"foo\")" -> (COMMAND_SUB (LIST (COMMAND (STRING echo) (STRING (DOUBLE_QUOTED_STRING foo)))))
2219 -"$(ls |grep file)" -> (COMMAND_SUB (LIST (| (COMMAND (STRING ls)) (COMMAND (STRING grep) (STRING file)))))
2220 -"$(CONTROL= command arg )" -> (COMMAND_SUB (LIST (COMMAND (STRING command) (STRING arg) (= CONTROL))))
2221 -"`cat output.log |grep error|cut`" -> (COMMAND_SUB (LIST (| (| (COMMAND (STRING cat) (STRING output . log)) (COMMAND (STRING grep) (STRING error))) (COMMAND (STRING cut)))))
2222 -"$(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))))
2223
2224 diff --git a/libbash-0.1/bashast/gunit/comment.gunit b/libbash-0.1/bashast/gunit/comment.gunit
2225 deleted file mode 100644
2226 index 5245b93..0000000
2227 --- a/libbash-0.1/bashast/gunit/comment.gunit
2228 +++ /dev/null
2229 @@ -1,33 +0,0 @@
2230 -/*
2231 - Please use git log for copyright holder and year information
2232 -
2233 - This file is part of libbash.
2234 -
2235 - libbash is free software: you can redistribute it and/or modify
2236 - it under the terms of the GNU General Public License as published by
2237 - the Free Software Foundation, either version 2 of the License, or
2238 - (at your option) any later version.
2239 -
2240 - libbash is distributed in the hope that it will be useful,
2241 - but WITHOUT ANY WARRANTY; without even the implied warranty of
2242 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2243 - GNU General Public License for more details.
2244 -
2245 - You should have received a copy of the GNU General Public License
2246 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
2247 -*/
2248 -gunit java_libbash;
2249 -
2250 -start:
2251 -"./hello #comment" -> (LIST (COMMAND (STRING . / hello)))
2252 -"
2253 -#comment
2254 -./hello" -> (LIST (COMMAND (STRING . / hello)))
2255 -"#!/bin/bash
2256 -#author: Nathan Eloe
2257 -./hello" -> (LIST (COMMAND (STRING . / hello)))
2258 -"#!/bin/bash
2259 -#lots of comments!
2260 -#comment
2261 -./command #comment
2262 -#comment" -> (LIST (COMMAND (STRING . / command)))
2263
2264 diff --git a/libbash-0.1/bashast/gunit/compound.gunit b/libbash-0.1/bashast/gunit/compound.gunit
2265 deleted file mode 100644
2266 index 5e2a098..0000000
2267 --- a/libbash-0.1/bashast/gunit/compound.gunit
2268 +++ /dev/null
2269 @@ -1,197 +0,0 @@
2270 -/*
2271 - Please use git log for copyright holder and year information
2272 -
2273 - This file is part of libbash.
2274 -
2275 - libbash is free software: you can redistribute it and/or modify
2276 - it under the terms of the GNU General Public License as published by
2277 - the Free Software Foundation, either version 2 of the License, or
2278 - (at your option) any later version.
2279 -
2280 - libbash is distributed in the hope that it will be useful,
2281 - but WITHOUT ANY WARRANTY; without even the implied warranty of
2282 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2283 - GNU General Public License for more details.
2284 -
2285 - You should have received a copy of the GNU General Public License
2286 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
2287 -*/
2288 -gunit java_libbash;
2289 -
2290 -cond_comparison:
2291 -"[[ -a this/is.afile ]]" -> (COMPOUND_COND (KEYWORD_TEST (a (STRING this / is . afile))))
2292 -"[[ -a this/is.afile]]" FAIL
2293 -"[[-a this/is.afile ]]" FAIL
2294 -"[[
2295 --a this/is.afile ]]" -> (COMPOUND_COND (KEYWORD_TEST (a (STRING this / is . afile))))
2296 -"test ! -a this/is.afile" -> (COMPOUND_COND (BUILTIN_TEST (NEGATION (a (STRING this / is . afile)))))
2297 -"[[ asdf > qwert ]]" -> (COMPOUND_COND (KEYWORD_TEST (> (STRING asdf) (STRING qwert))))
2298 -"[ asdf \> qwert ]" -> (COMPOUND_COND (BUILTIN_TEST (\> (STRING asdf) (STRING qwert))))
2299 -
2300 -arithmetic_expression:
2301 -"((5+3))" -> (ARITHMETIC_EXPRESSION (+ 5 3))
2302 -"(( 5+3 ))" -> (ARITHMETIC_EXPRESSION (+ 5 3))
2303 -
2304 -current_shell:
2305 -"{ time cat; }" -> (CURRENT_SHELL (LIST (COMMAND (STRING cat) time)))
2306 -"{ time cat
2307 -}" -> (CURRENT_SHELL (LIST (COMMAND (STRING cat) time)))
2308 -// there's a tab on the empty line
2309 -"{
2310 - echo
2311 -
2312 -}" -> (CURRENT_SHELL (LIST (COMMAND (STRING echo))))
2313 -"{time cat}" FAIL
2314 -"{ time cat }" FAIL
2315 -
2316 -subshell:
2317 -"(time cat)" -> (SUBSHELL (LIST (COMMAND (STRING cat) time)))
2318 -"(time cat )" ->(SUBSHELL (LIST (COMMAND (STRING cat) time)))
2319 -"( time cat)" -> (SUBSHELL (LIST (COMMAND (STRING cat) time)))
2320 -"( time cat;
2321 -)" -> (SUBSHELL (LIST (COMMAND (STRING cat) time)))
2322 -
2323 -case_expr:
2324 -"case a in esac" -> (case (STRING a))
2325 -"case `echo asdf` in
2326 -esac" -> (case (STRING (COMMAND_SUB (LIST (COMMAND (STRING echo) (STRING asdf))))))
2327 -
2328 -"case `echo asdf` in
2329 -gz)
2330 -echo yay
2331 -;;
2332 -bzip)
2333 -echo three
2334 -;;
2335 -*) echo woo
2336 -;;
2337 -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)))))
2338 -
2339 -"case asdf in
2340 - gz)
2341 - echo yay
2342 - ;;
2343 - bzip)
2344 - echo three
2345 - ;;
2346 - *) echo woo
2347 -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)))))
2348 -
2349 -"case `echo asdf` in gz|asdf) echo yay ;; bzip) echo three ;; *) echo woo esac" FAIL
2350 -"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)))))
2351 -
2352 -for_expr:
2353 -"for each in `ls |grep log`; do
2354 - echo \"file found\"
2355 -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)))))
2356 -"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)))))
2357 -"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)))))
2358 -"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)))))
2359 -"for each in `ls |grep log`; do echo file done" FAIL
2360 -
2361 -"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)))
2362 -"for ((5+3; ;5+3)); do echo yay; done" -> (CFOR (FOR_INIT (+ 5 3)) (LIST (COMMAND (STRING echo) (STRING yay))) (FOR_MOD (+ 5 3)))
2363 -"for ((;5+3 ;5+3)); do echo yay; done" -> (CFOR (FOR_COND (+ 5 3)) (LIST (COMMAND (STRING echo) (STRING yay))) (FOR_MOD (+ 5 3)))
2364 -"for ((5+3;;5+3)); do echo yay; done" -> (CFOR (FOR_INIT (+ 5 3)) (LIST (COMMAND (STRING echo) (STRING yay))) (FOR_MOD (+ 5 3)))
2365 -
2366 -sel_expr:
2367 -"select each in `ls |grep log`; do
2368 - echo \"file found\"
2369 - 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)))))
2370 -"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)))))
2371 -"select each in `ls |grep log`; do echo file done" FAIL
2372 -
2373 -if_expr:
2374 -"if echo yay2; then
2375 -echo yay
2376 -fi" -> (IF_STATEMENT (if (LIST (COMMAND (STRING echo) (STRING yay2))) (LIST (COMMAND (STRING echo) (STRING yay)))))
2377 -"if echo yay2; then echo yay ;fi" -> (IF_STATEMENT (if (LIST (COMMAND (STRING echo) (STRING yay2))) (LIST (COMMAND (STRING echo) (STRING yay)))))
2378 -"if echo yay2 then echo yay; fi" FAIL
2379 -
2380 -"if echo yay2;
2381 -then
2382 -echo yay
2383 -elif echo yay3; then
2384 -echo boo
2385 -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)))))
2386 -
2387 -"if echo yay2; then
2388 -echo yay
2389 -elif echo yay3; then
2390 -echo boo
2391 -elif echo yay4; then echo hurrah
2392 -else echo darn
2393 -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)))))
2394 -
2395 -"if true; then
2396 - echo true
2397 - # comment
2398 - elif false; then
2399 - echo false
2400 - 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)))))
2401 -
2402 -while_expr:
2403 -"while echo true; do
2404 -echo \"file found\"
2405 -done" -> (while (LIST (COMMAND (STRING echo) (STRING true))) (LIST (COMMAND (STRING echo) (STRING (DOUBLE_QUOTED_STRING file found)))))
2406 -"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)))))
2407 -"while(( 1>0 )); do echo ok; done" -> (while (LIST (COMMAND (ARITHMETIC_EXPRESSION (> 1 0)))) (LIST (COMMAND (STRING echo) (STRING ok))))
2408 -"while echo true`; do echo file done" FAIL
2409 -"while [[ -n \"$ver_str\" ]] ; do
2410 - echo true
2411 - done" -> (while (LIST (COMMAND (COMPOUND_COND (KEYWORD_TEST (n (STRING (DOUBLE_QUOTED_STRING (VAR_REF ver_str)))))))) (LIST (COMMAND (STRING echo) (STRING true))))
2412 -
2413 -until_expr:
2414 -"until echo true; do
2415 -echo \"file found\"
2416 -done" -> (until (LIST (COMMAND (STRING echo) (STRING true))) (LIST (COMMAND (STRING echo) (STRING (DOUBLE_QUOTED_STRING file found)))))
2417 -"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)))))
2418 -"until echo true`; do echo file done" FAIL
2419 -
2420 -case_expr:
2421 -"case \"$1\" in
2422 -*)
2423 -echo \"Usage: $0 start|stop\" >&2
2424 -exit 3
2425 -;;
2426 -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)))))
2427 -
2428 -"case $asdf in
2429 -a)
2430 -echo \"yay\"
2431 -;;
2432 -esac" -> (case (STRING (VAR_REF asdf)) (CASE_PATTERN (STRING a) CASE_COMMAND (LIST (COMMAND (STRING echo) (STRING (DOUBLE_QUOTED_STRING yay))))))
2433 -"case asdf in
2434 -asdf)
2435 -echo \"yay\"
2436 -;;
2437 -esac" -> (case (STRING asdf) (CASE_PATTERN (STRING asdf) CASE_COMMAND (LIST (COMMAND (STRING echo) (STRING (DOUBLE_QUOTED_STRING yay))))))
2438 -"case 1 in 1) echo yay ;; esac" -> (case (STRING 1) (CASE_PATTERN (STRING 1) CASE_COMMAND (LIST (COMMAND (STRING echo) (STRING yay)))))
2439 -"case /usr/bin in 1) echo yay ;; esac" -> (case (STRING / usr / bin) (CASE_PATTERN (STRING 1) CASE_COMMAND (LIST (COMMAND (STRING echo) (STRING yay)))))
2440 -"case \"$1\" in
2441 -stop)
2442 -;;
2443 -*)
2444 -echo \"Usage: $0 start|stop\" >&2
2445 -exit 3
2446 -;;
2447 -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)))))
2448 -
2449 -command:
2450 -"[[ asdf > qwert ]] > /dev/null" -> (COMMAND (COMPOUND_COND (KEYWORD_TEST (> (STRING asdf) (STRING qwert)))) (REDIR > (STRING / dev / null)))
2451 -"(( 5+3 )) > /dev/null" -> (COMMAND (ARITHMETIC_EXPRESSION (+ 5 3)) (REDIR > (STRING / dev / null)))
2452 -"{ time cat; } > /dev/null" -> (COMMAND (CURRENT_SHELL (LIST (COMMAND (STRING cat) time))) (REDIR > (STRING / dev / null)))
2453 -"(time cat) > /dev/null" -> (COMMAND (SUBSHELL (LIST (COMMAND (STRING cat) time))) (REDIR > (STRING / dev / null)))
2454 -"case a in esac >/dev/null" -> (COMMAND (case (STRING a)) (REDIR > (STRING / dev / null)))
2455 -"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)))
2456 -"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)))
2457 -"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)))
2458 -
2459 -"if echo yay2;
2460 -then
2461 -echo yay
2462 -elif echo yay3; then
2463 -echo boo
2464 -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)))
2465 -"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)))
2466 -"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)))
2467
2468 diff --git a/libbash-0.1/bashast/gunit/cond_main.gunit b/libbash-0.1/bashast/gunit/cond_main.gunit
2469 deleted file mode 100644
2470 index 943fd9d..0000000
2471 --- a/libbash-0.1/bashast/gunit/cond_main.gunit
2472 +++ /dev/null
2473 @@ -1,35 +0,0 @@
2474 -/*
2475 - Please use git log for copyright holder and year information
2476 -
2477 - This file is part of libbash.
2478 -
2479 - libbash is free software: you can redistribute it and/or modify
2480 - it under the terms of the GNU General Public License as published by
2481 - the Free Software Foundation, either version 2 of the License, or
2482 - (at your option) any later version.
2483 -
2484 - libbash is distributed in the hope that it will be useful,
2485 - but WITHOUT ANY WARRANTY; without even the implied warranty of
2486 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2487 - GNU General Public License for more details.
2488 -
2489 - You should have received a copy of the GNU General Public License
2490 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
2491 -*/
2492 -gunit java_libbash;
2493 -
2494 -cond_expr:
2495 -"[[ -a this/is.afile ]]" -> (KEYWORD_TEST (a (STRING this / is . afile)))
2496 -"[ -n \"yar53\" ]" -> (BUILTIN_TEST (n (STRING (DOUBLE_QUOTED_STRING yar53))))
2497 -"test 5 -eq 6" -> (BUILTIN_TEST (eq (STRING 5) (STRING 6)))
2498 -"[[ \"asdf\" != \"boo\" && -a filename ]]" -> (KEYWORD_TEST (&& (NOT_MATCH_PATTERN (STRING (DOUBLE_QUOTED_STRING asdf)) (STRING (DOUBLE_QUOTED_STRING boo))) (a (STRING filename))))
2499 -"[[ a = b ]]" -> (KEYWORD_TEST (= (STRING a) (STRING b)))
2500 -"[[ a == b ]]" -> (KEYWORD_TEST (MATCH_PATTERN (STRING a) (STRING b)))
2501 -"[[ true ]]" -> (KEYWORD_TEST (STRING true))
2502 -"[[ true && (false || three) ]]" -> (KEYWORD_TEST (&& (STRING true) (|| (STRING false) (STRING three))))
2503 -"[ a = b ]" -> (BUILTIN_TEST (= (STRING a) (STRING b)))
2504 -"[ a == b ]" -> (BUILTIN_TEST (= (STRING a) (STRING b)))
2505 -"[ a != b ]" -> (BUILTIN_TEST (NOT_EQUALS (STRING a) (STRING b)))
2506 -"[[ \"${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 ( \ . * ) ? ) $)))
2507 -"[ -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))))))
2508 -"[ -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))))))
2509
2510 diff --git a/libbash-0.1/bashast/gunit/continued_lines.gunit b/libbash-0.1/bashast/gunit/continued_lines.gunit
2511 deleted file mode 100644
2512 index 4be7059..0000000
2513 --- a/libbash-0.1/bashast/gunit/continued_lines.gunit
2514 +++ /dev/null
2515 @@ -1,30 +0,0 @@
2516 -/*
2517 - Please use git log for copyright holder and year information
2518 -
2519 - This file is part of libbash.
2520 -
2521 - libbash is free software: you can redistribute it and/or modify
2522 - it under the terms of the GNU General Public License as published by
2523 - the Free Software Foundation, either version 2 of the License, or
2524 - (at your option) any later version.
2525 -
2526 - libbash is distributed in the hope that it will be useful,
2527 - but WITHOUT ANY WARRANTY; without even the implied warranty of
2528 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2529 - GNU General Public License for more details.
2530 -
2531 - You should have received a copy of the GNU General Public License
2532 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
2533 -*/
2534 -gunit java_libbash;
2535 -
2536 -start:
2537 -
2538 -"ech\
2539 -o Hello\
2540 - world" -> (LIST (COMMAND (STRING ech o) (STRING Hello) (STRING world)))
2541 -
2542 -"sed -i \
2543 - -e 's/three/\
2544 - four/'" -> (LIST (COMMAND (STRING sed) (STRING - i) (STRING - e) (STRING (SINGLE_QUOTED_STRING 's/three/\
2545 - four/'))))
2546
2547 diff --git a/libbash-0.1/bashast/gunit/expansions.gunit b/libbash-0.1/bashast/gunit/expansions.gunit
2548 deleted file mode 100644
2549 index a36d4da..0000000
2550 --- a/libbash-0.1/bashast/gunit/expansions.gunit
2551 +++ /dev/null
2552 @@ -1,30 +0,0 @@
2553 -/*
2554 - Please use git log for copyright holder and year information
2555 -
2556 - This file is part of libbash.
2557 -
2558 - libbash is free software: you can redistribute it and/or modify
2559 - it under the terms of the GNU General Public License as published by
2560 - the Free Software Foundation, either version 2 of the License, or
2561 - (at your option) any later version.
2562 -
2563 - libbash is distributed in the hope that it will be useful,
2564 - but WITHOUT ANY WARRANTY; without even the implied warranty of
2565 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2566 - GNU General Public License for more details.
2567 -
2568 - You should have received a copy of the GNU General Public License
2569 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
2570 -*/
2571 -gunit java_libbash;
2572 -
2573 -clist:
2574 -"echo a{b,c,d}" -> (LIST (COMMAND (STRING echo) (STRING a (BRACE_EXP (STRING b) (STRING c) (STRING d)))))
2575 -"((5+5))" -> (LIST (COMMAND (ARITHMETIC_EXPRESSION (+ 5 5))))
2576 -"(( 4 + asdf ))" -> (LIST (COMMAND (ARITHMETIC_EXPRESSION (+ 4 (VAR_REF asdf)))))
2577 -"[[ while=while ]] && echo true" -> (LIST (&& (COMMAND (COMPOUND_COND (KEYWORD_TEST (STRING while = while)))) (COMMAND (STRING echo) (STRING true))))
2578 -"[[ while = while ]] && echo true" -> (LIST (&& (COMMAND (COMPOUND_COND (KEYWORD_TEST (= (STRING while) (STRING while))))) (COMMAND (STRING echo) (STRING true))))
2579 -"for each in `ls |grep output`; do
2580 -echo $each
2581 -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)))))))
2582 -"wc <(cat /usr/share/dict/linux.words)" -> (LIST (COMMAND (STRING wc) (PROCESS_SUBSTITUTION < (LIST (COMMAND (STRING cat) (STRING / usr / share / dict / linux . words))))))
2583
2584 diff --git a/libbash-0.1/bashast/gunit/fname.gunit b/libbash-0.1/bashast/gunit/fname.gunit
2585 deleted file mode 100644
2586 index fce198f..0000000
2587 --- a/libbash-0.1/bashast/gunit/fname.gunit
2588 +++ /dev/null
2589 @@ -1,73 +0,0 @@
2590 -/*
2591 - Please use git log for copyright holder and year information
2592 -
2593 - This file is part of libbash.
2594 -
2595 - libbash is free software: you can redistribute it and/or modify
2596 - it under the terms of the GNU General Public License as published by
2597 - the Free Software Foundation, either version 2 of the License, or
2598 - (at your option) any later version.
2599 -
2600 - libbash is distributed in the hope that it will be useful,
2601 - but WITHOUT ANY WARRANTY; without even the implied warranty of
2602 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2603 - GNU General Public License for more details.
2604 -
2605 - You should have received a copy of the GNU General Public License
2606 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
2607 -*/
2608 -gunit java_libbash;
2609 -
2610 -fname:
2611 -"+%Y%m%d" -> (STRING + % Y % m % d)
2612 -"\"http://www.gnu.org/software/autoconf/autoconf.html\"" -> (STRING (DOUBLE_QUOTED_STRING http : / / www . gnu . org / software / autoconf / autoconf . html))
2613 -"\"http://dev.gentoo.org/~mpagano/genpatches\"" -> (STRING (DOUBLE_QUOTED_STRING http : / / dev . gentoo . org / ~ mpagano / genpatches))
2614 -"\"\"" -> (STRING DOUBLE_QUOTED_STRING)
2615 -"\"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 :))
2616 -"\"asdf;!\"" -> (STRING (DOUBLE_QUOTED_STRING asdf ; !))
2617 -"\"$(whoami)\"" -> (STRING (DOUBLE_QUOTED_STRING (COMMAND_SUB (LIST (COMMAND (STRING whoami))))))
2618 -"\"`whoami`\"" -> (STRING (DOUBLE_QUOTED_STRING (COMMAND_SUB (LIST (COMMAND (STRING whoami))))))
2619 -"'`whoami`'" -> (STRING (SINGLE_QUOTED_STRING '`whoami`'))
2620 -"'$(whoami)'" -> (STRING (SINGLE_QUOTED_STRING '$(whoami)'))
2621 -"\"${P}\"" -> (STRING (DOUBLE_QUOTED_STRING (VAR_REF P)))
2622 -"'${P}'" -> (STRING (SINGLE_QUOTED_STRING '${P}'))
2623 -"asdf#" -> (STRING asdf #)
2624 -"'asdf'" -> (STRING (SINGLE_QUOTED_STRING 'asdf'))
2625 -"'asdf\"asdf'" -> (STRING (SINGLE_QUOTED_STRING 'asdf"asdf'))
2626 -"\"asdf'asdf\"" -> (STRING (DOUBLE_QUOTED_STRING asdf ' asdf))
2627 -"!/bin/bash" -> (STRING ! / bin / bash)
2628 -"ab?(g|h)"-> (STRING ab (EXTENDED_MATCH_AT_MOST_ONE (STRING g) (STRING h)))
2629 -"ab*(gh|i)" -> (STRING ab (EXTENDED_MATCH_ANY (STRING gh) (STRING i)))
2630 -"ab+(gh|i)" -> (STRING ab (EXTENDED_MATCH_AT_LEAST_ONE (STRING gh) (STRING i)))
2631 -"ab@(gh|i)" -> (STRING ab (EXTENDED_MATCH_EXACTLY_ONE (STRING gh) (STRING i)))
2632 -"ab!(gh|i)" -> (STRING ab (EXTENDED_MATCH_NONE (STRING gh) (STRING i)))
2633 -"\"abc\"\'\"\'\"def\"" -> (STRING (DOUBLE_QUOTED_STRING abc) (SINGLE_QUOTED_STRING '"') (DOUBLE_QUOTED_STRING def))
2634 -"my\ name\ is" -> (STRING my \ name \ is)
2635 -"octal\007" -> (STRING octal \ 007)
2636 -"hex\xaF" -> (STRING hex \ xaF)
2637 -"ctrlx\cx" -> (STRING ctrlx \ cx)
2638 -"tab\\ttab" -> "(STRING tab \\ \t tab)"
2639 -"abc[def]" -> (STRING abc (MATCH_ANY def))
2640 -"abc[d${more}]" -> (STRING abc (MATCH_ANY d (VAR_REF more)))
2641 -"abc[#d]" -> (STRING abc (MATCH_ANY # d))
2642 -"abc[d#]" -> (STRING abc (MATCH_ANY d #))
2643 -"a[]" -> (STRING a [ ])
2644 -"ab[d-h]" -> (STRING ab (MATCH_ANY d - h))
2645 -"ab[!d-h]" -> (STRING ab (MATCH_ANY_EXCEPT d - h))
2646 -"ab[^d-h]" -> (STRING ab (MATCH_ANY_EXCEPT d - h))
2647 -"ab[]c]" -> (STRING ab (MATCH_ANY ] c))
2648 -"ab[]!]" -> (STRING ab (MATCH_ANY ] !))
2649 -"ab[:alpha:]" -> (STRING ab (MATCH_ANY : alpha :))
2650 -"ab[=c=]" -> (STRING ab (MATCH_ANY = c =))
2651 -"ab[.c.]" -> (STRING ab (MATCH_ANY . c .))
2652 -"ab[[:alpha:]]" -> (STRING ab (MATCH_ANY (CHARACTER_CLASS alpha)))
2653 -"ab[[:alpha:][:digit:]]" -> (STRING ab (MATCH_ANY (CHARACTER_CLASS alpha) (CHARACTER_CLASS digit)))
2654 -"ab[^[:alpha:]]" -> (STRING ab (MATCH_ANY_EXCEPT (CHARACTER_CLASS alpha)))
2655 -"ab[[=c=]]" -> (STRING ab (MATCH_ANY (EQUIVALENCE_CLASS c)))
2656 -"ab[[.backslash.]]" -> (STRING ab (MATCH_ANY (COLLATING_SYMBOL backslash)))
2657 -"ab[12[:alpha:]]" -> (STRING ab (MATCH_ANY 12 (CHARACTER_CLASS alpha)))
2658 -"\"'foo'\"" -> (STRING (DOUBLE_QUOTED_STRING ' foo '))
2659 -"--preserve=timestamps,mode" -> (STRING - - preserve = timestamps , mode)
2660 -
2661 -dqstr:
2662 -"\"\\\\\"\$\`\"" -> (DOUBLE_QUOTED_STRING \ " $ `)
2663
2664 diff --git a/libbash-0.1/bashast/gunit/function.gunit b/libbash-0.1/bashast/gunit/function.gunit
2665 deleted file mode 100644
2666 index a046bd1..0000000
2667 --- a/libbash-0.1/bashast/gunit/function.gunit
2668 +++ /dev/null
2669 @@ -1,53 +0,0 @@
2670 -/*
2671 - Please use git log for copyright holder and year information
2672 -
2673 - This file is part of libbash.
2674 -
2675 - libbash is free software: you can redistribute it and/or modify
2676 - it under the terms of the GNU General Public License as published by
2677 - the Free Software Foundation, either version 2 of the License, or
2678 - (at your option) any later version.
2679 -
2680 - libbash is distributed in the hope that it will be useful,
2681 - but WITHOUT ANY WARRANTY; without even the implied warranty of
2682 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2683 - GNU General Public License for more details.
2684 -
2685 - You should have received a copy of the GNU General Public License
2686 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
2687 -*/
2688 -gunit java_libbash;
2689 -
2690 -function:
2691 -"function quit {
2692 - exit
2693 -}" -> (function (STRING quit) (CURRENT_SHELL (LIST (COMMAND (STRING exit)))))
2694 -
2695 -"function quit{ exit; }" FAIL
2696 -"function quit { exit }" FAIL
2697 -"function 'foo' { exit; }" FAIL
2698 -"function quit { exit; }" -> (function (STRING quit) (CURRENT_SHELL (LIST (COMMAND (STRING exit)))))
2699 -"function foo() { :; }" -> (function (STRING foo) (CURRENT_SHELL (LIST (COMMAND (STRING :)))))
2700 -"function foo(){ :; }" -> (function (STRING foo) (CURRENT_SHELL (LIST (COMMAND (STRING :)))))
2701 -"foo() { :; }" -> (function (STRING foo) (CURRENT_SHELL (LIST (COMMAND (STRING :)))))
2702 -"foo(){ :; }" -> (function (STRING foo) (CURRENT_SHELL (LIST (COMMAND (STRING :)))))
2703 -
2704 -"xorg-2_reconf_source() { :; }" -> (function (STRING xorg - 2 _reconf_source) (CURRENT_SHELL (LIST (COMMAND (STRING :)))))
2705 -
2706 -"function out() { function inner() { :; }; }" -> (function (STRING out) (CURRENT_SHELL (LIST (COMMAND (function (STRING inner) (CURRENT_SHELL (LIST (COMMAND (STRING :)))))))))
2707 -
2708 -function_name:
2709 -"xemacs-packages_src_unpack" OK
2710 -"while" OK
2711 -"aa'bb" FAIL
2712 -"a\"" FAIL
2713 -"333" FAIL
2714 -"aa$aa" FAIL
2715 -
2716 -command:
2717 -"function quit { exit; } > /dev/null" -> (COMMAND (function (STRING quit) (CURRENT_SHELL (LIST (COMMAND (STRING exit))))) (REDIR > (STRING / dev / null)))
2718 -"function quit {
2719 - # comment
2720 - exit; } > /dev/null" -> (COMMAND (function (STRING quit) (CURRENT_SHELL (LIST (COMMAND (STRING exit))))) (REDIR > (STRING / dev / null)))
2721 -"function help { echo hi; } 2> /dev/null" -> (COMMAND (function (STRING help) (CURRENT_SHELL (LIST (COMMAND (STRING echo) (STRING hi))))) (REDIR 2 > (STRING / dev / null)))
2722 -"function help { echo 3; } 2> /dev/null > output" OK
2723
2724 diff --git a/libbash-0.1/bashast/gunit/list.gunit b/libbash-0.1/bashast/gunit/list.gunit
2725 deleted file mode 100644
2726 index 552788a..0000000
2727 --- a/libbash-0.1/bashast/gunit/list.gunit
2728 +++ /dev/null
2729 @@ -1,46 +0,0 @@
2730 -/*
2731 - Please use git log for copyright holder and year information
2732 -
2733 - This file is part of libbash.
2734 -
2735 - libbash is free software: you can redistribute it and/or modify
2736 - it under the terms of the GNU General Public License as published by
2737 - the Free Software Foundation, either version 2 of the License, or
2738 - (at your option) any later version.
2739 -
2740 - libbash is distributed in the hope that it will be useful,
2741 - but WITHOUT ANY WARRANTY; without even the implied warranty of
2742 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2743 - GNU General Public License for more details.
2744 -
2745 - You should have received a copy of the GNU General Public License
2746 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
2747 -*/
2748 -gunit java_libbash;
2749 -
2750 -start:
2751 -"make" -> (LIST (COMMAND (STRING make)))
2752 -"make && make modules_install;" -> (LIST (&& (COMMAND (STRING make)) (COMMAND (STRING make) (STRING modules_install))))
2753 -"make && make modules_install &" -> (LIST (&& (COMMAND (STRING make)) (COMMAND (STRING make) (STRING modules_install))))
2754 -"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))))
2755 -"mkdir test
2756 -cd test
2757 -cp ../asdf.tar.gz .
2758 -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)))
2759 -"mkdir build && cd build
2760 -./configure && make" -> (LIST (&& (COMMAND (STRING mkdir) (STRING build)) (COMMAND (STRING cd) (STRING build))) (&& (COMMAND (STRING . / configure)) (COMMAND (STRING make))))
2761 -"make;make modules_install
2762 -
2763 -
2764 -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)))
2765 -
2766 -"a=asdf
2767 -b=three
2768 -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))))
2769 -"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))))))))
2770 -"FOO='bar' ;" -> (LIST (COMMAND (VARIABLE_DEFINITIONS (= FOO (STRING (SINGLE_QUOTED_STRING 'bar'))))))
2771 -"true;
2772 -true" -> (LIST (COMMAND (STRING true)) (COMMAND (STRING true)))
2773 -"(echo hi > /dev/null) >> 1" -> (LIST (COMMAND (SUBSHELL (LIST (COMMAND (STRING echo) (STRING hi) (REDIR > (STRING / dev / null))))) (REDIR >> (FILE_DESCRIPTOR 1))))
2774 -"{ echo hi > /dev/null; } >> 1" -> (LIST (COMMAND (CURRENT_SHELL (LIST (COMMAND (STRING echo) (STRING hi) (REDIR > (STRING / dev / null))))) (REDIR >> (FILE_DESCRIPTOR 1))))
2775 -"test 1 -gt 0 || return 0" -> (LIST (|| (COMMAND (COMPOUND_COND (BUILTIN_TEST (gt (STRING 1) (STRING 0))))) (COMMAND (STRING return) (STRING 0))))
2776
2777 diff --git a/libbash-0.1/bashast/gunit/param_main.gunit b/libbash-0.1/bashast/gunit/param_main.gunit
2778 deleted file mode 100644
2779 index 9dfcd9e..0000000
2780 --- a/libbash-0.1/bashast/gunit/param_main.gunit
2781 +++ /dev/null
2782 @@ -1,72 +0,0 @@
2783 -/*
2784 - Please use git log for copyright holder and year information
2785 -
2786 - This file is part of libbash.
2787 -
2788 - libbash is free software: you can redistribute it and/or modify
2789 - it under the terms of the GNU General Public License as published by
2790 - the Free Software Foundation, either version 2 of the License, or
2791 - (at your option) any later version.
2792 -
2793 - libbash is distributed in the hope that it will be useful,
2794 - but WITHOUT ANY WARRANTY; without even the implied warranty of
2795 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2796 - GNU General Public License for more details.
2797 -
2798 - You should have received a copy of the GNU General Public License
2799 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
2800 -*/
2801 -gunit java_libbash;
2802 -
2803 -var_ref:
2804 -"$asdf" -> (VAR_REF asdf)
2805 -"${asdf}" -> (VAR_REF asdf)
2806 -"${asdf:-foo}" -> (VAR_REF (USE_DEFAULT_WHEN_UNSET_OR_NULL asdf (STRING foo)))
2807 -"${asdf:-public_html}" -> (VAR_REF (USE_DEFAULT_WHEN_UNSET_OR_NULL asdf (STRING public_html)))
2808 -"${asdf='foo'}" -> (VAR_REF (ASSIGN_DEFAULT_WHEN_UNSET asdf (STRING (SINGLE_QUOTED_STRING 'foo'))))
2809 -"${asdf:=}" -> (VAR_REF (ASSIGN_DEFAULT_WHEN_UNSET_OR_NULL asdf STRING))
2810 -"${bar:7}" -> (VAR_REF (OFFSET bar 7))
2811 -"${bar: -10}" -> (VAR_REF (OFFSET bar (MINUS_SIGN 10)))
2812 -"${bar:(-10 + 5)}" -> (VAR_REF (OFFSET bar (+ (MINUS_SIGN 10) 5)))
2813 -"${foo:5:2}" -> (VAR_REF (OFFSET foo 5 2))
2814 -"${foo:$((5)):$((2))}" -> (VAR_REF (OFFSET foo 5 2))
2815 -"${!asdf*}" -> (VAR_REF (! asdf *))
2816 -"${!asdf@}" -> (VAR_REF (! asdf @))
2817 -"${!asdf[*]}" -> (VAR_REF (LIST_EXPAND asdf *))
2818 -"${!asdf[@]}" -> (VAR_REF (LIST_EXPAND asdf @))
2819 -"${#foo}" -> (VAR_REF (# foo))
2820 -"${foo#bar}" -> (VAR_REF (LAZY_REMOVE_AT_START foo (STRING bar)))
2821 -"${fo*o#bar}" FAIL
2822 -"${fo@o#bar}" FAIL
2823 -"${foo##bar}" -> (VAR_REF (REPLACE_AT_START foo (STRING bar)))
2824 -"${foo%bar}" -> (VAR_REF (LAZY_REMOVE_AT_END foo (STRING bar)))
2825 -"${foo%%bar}" -> (VAR_REF (REPLACE_AT_END foo (STRING bar)))
2826 -"${foo%; *}" -> (VAR_REF (LAZY_REMOVE_AT_END foo (STRING ; MATCH_ALL)))
2827 -"${foo%/}" -> (VAR_REF (LAZY_REMOVE_AT_END foo (STRING /)))
2828 -"${this/is/pattern}"->(VAR_REF (REPLACE_FIRST this (STRING is) (STRING pattern)))
2829 -//Test positional/special parameters
2830 -"$1" -> (VAR_REF 1)
2831 -"$@" -> (VAR_REF @)
2832 -"$*" -> (VAR_REF *)
2833 -"${@}" -> (VAR_REF @)
2834 -"${#}" -> (VAR_REF #)
2835 -"${!foo}" -> (VAR_REF (VAR_REF foo))
2836 -"${!#}" -> (VAR_REF (VAR_REF #))
2837 -"${3}" -> (VAR_REF 3)
2838 -"$?" -> (VAR_REF ?)
2839 -"$_" -> (VAR_REF _)
2840 -"${_}" -> (VAR_REF _)
2841 -"$$" -> (VAR_REF $)
2842 -"${$}" -> (VAR_REF $)
2843 -"${PV//./_}" -> (VAR_REF (REPLACE_ALL PV (STRING .) (STRING _)))
2844 -"${PV// }" -> (VAR_REF (REPLACE_ALL PV (STRING )))
2845 -"${PV//[-._]/}" -> (VAR_REF (REPLACE_ALL PV (STRING (MATCH_ANY - . _)) STRING))
2846 -"${PV/${pattern}/${replace}}" -> (VAR_REF (REPLACE_FIRST PV (STRING (VAR_REF pattern)) (STRING (VAR_REF replace))))
2847 -"${PV/#foo/bar}" -> (VAR_REF (REPLACE_AT_START PV (STRING foo) (STRING bar)))
2848 -"${PV/%foo/bar}" -> (VAR_REF (REPLACE_AT_END PV (STRING foo) (STRING bar)))
2849 -"${PN/%spaces /more }" -> (VAR_REF (REPLACE_AT_END PN (STRING spaces ) (STRING more )))
2850 -"${PN/wrong#/#correct}" -> (VAR_REF (REPLACE_FIRST PN (STRING wrong #) (STRING # correct)))
2851 -
2852 -var_def:
2853 -"MY_PN=${PN/asterisk-}" -> (= MY_PN (STRING (VAR_REF (REPLACE_FIRST PN (STRING asterisk -)))))
2854 -"MY_PN=1abc" -> (= MY_PN (STRING 1 abc))
2855
2856 diff --git a/libbash-0.1/bashast/gunit/pipeline.gunit b/libbash-0.1/bashast/gunit/pipeline.gunit
2857 deleted file mode 100644
2858 index ec6deda..0000000
2859 --- a/libbash-0.1/bashast/gunit/pipeline.gunit
2860 +++ /dev/null
2861 @@ -1,32 +0,0 @@
2862 -/*
2863 - Please use git log for copyright holder and year information
2864 -
2865 - This file is part of libbash.
2866 -
2867 - libbash is free software: you can redistribute it and/or modify
2868 - it under the terms of the GNU General Public License as published by
2869 - the Free Software Foundation, either version 2 of the License, or
2870 - (at your option) any later version.
2871 -
2872 - libbash is distributed in the hope that it will be useful,
2873 - but WITHOUT ANY WARRANTY; without even the implied warranty of
2874 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2875 - GNU General Public License for more details.
2876 -
2877 - You should have received a copy of the GNU General Public License
2878 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
2879 -*/
2880 -gunit java_libbash;
2881 -
2882 -pipeline:
2883 -"cat asdf" -> (COMMAND (STRING cat) (STRING asdf))
2884 -"export VAR=bar LAA=laa foo" -> (COMMAND (VARIABLE_DEFINITIONS (= VAR (STRING bar)) (= LAA (STRING laa))))
2885 -"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)))
2886 -"time -p cat file" -> (COMMAND (STRING cat) (STRING file) (time p))
2887 -"time cat file | grep search" -> (| (COMMAND (STRING cat) (STRING file) time) (COMMAND (STRING grep) (STRING search)))
2888 -"time -p cat | grep asdf | a.out" -> (| (| (COMMAND (STRING cat) (time p)) (COMMAND (STRING grep) (STRING asdf))) (COMMAND (STRING a . out)))
2889 -"time -p cat file |grep search >> log" -> (| (COMMAND (STRING cat) (STRING file) (time p)) (COMMAND (STRING grep) (STRING search) (REDIR >> (STRING log))))
2890 -"if time cat; then
2891 -echo \"three\"
2892 -fi" -> (COMMAND (IF_STATEMENT (if (LIST (COMMAND (STRING cat) time)) (LIST (COMMAND (STRING echo) (STRING (DOUBLE_QUOTED_STRING three)))))))
2893 -"i=1 j=2" -> (COMMAND (VARIABLE_DEFINITIONS (= i (STRING 1)) (= j (STRING 2))))
2894
2895 diff --git a/libbash-0.1/bashast/gunit/process_substitution.gunit b/libbash-0.1/bashast/gunit/process_substitution.gunit
2896 deleted file mode 100644
2897 index b0d2754..0000000
2898 --- a/libbash-0.1/bashast/gunit/process_substitution.gunit
2899 +++ /dev/null
2900 @@ -1,23 +0,0 @@
2901 -/*
2902 - Please use git log for copyright holder and year information
2903 -
2904 - This file is part of libbash.
2905 -
2906 - libbash is free software: you can redistribute it and/or modify
2907 - it under the terms of the GNU General Public License as published by
2908 - the Free Software Foundation, either version 2 of the License, or
2909 - (at your option) any later version.
2910 -
2911 - libbash is distributed in the hope that it will be useful,
2912 - but WITHOUT ANY WARRANTY; without even the implied warranty of
2913 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2914 - GNU General Public License for more details.
2915 -
2916 - You should have received a copy of the GNU General Public License
2917 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
2918 -*/
2919 -gunit java_libbash;
2920 -
2921 -process_substitution:
2922 -"<( true )" -> (PROCESS_SUBSTITUTION < (LIST (COMMAND (STRING true))))
2923 -">(false)" -> (PROCESS_SUBSTITUTION > (LIST (COMMAND (STRING false))))
2924
2925 diff --git a/libbash-0.1/bashast/gunit/redir.gunit b/libbash-0.1/bashast/gunit/redir.gunit
2926 deleted file mode 100644
2927 index bb1c24a..0000000
2928 --- a/libbash-0.1/bashast/gunit/redir.gunit
2929 +++ /dev/null
2930 @@ -1,38 +0,0 @@
2931 -/*
2932 - Please use git log for copyright holder and year information
2933 -
2934 - This file is part of libbash.
2935 -
2936 - libbash is free software: you can redistribute it and/or modify
2937 - it under the terms of the GNU General Public License as published by
2938 - the Free Software Foundation, either version 2 of the License, or
2939 - (at your option) any later version.
2940 -
2941 - libbash is distributed in the hope that it will be useful,
2942 - but WITHOUT ANY WARRANTY; without even the implied warranty of
2943 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2944 - GNU General Public License for more details.
2945 -
2946 - You should have received a copy of the GNU General Public License
2947 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
2948 -*/
2949 -gunit java_libbash;
2950 -
2951 -redirect:
2952 -">output_file" -> (REDIR > (STRING output_file))
2953 -"1>output.file" -> (REDIR 1 > (STRING output . file))
2954 -"2>&1" -> (REDIR 2 >& (FILE_DESCRIPTOR 1))
2955 -"2>&1-" -> (REDIR 2 >& (FILE_DESCRIPTOR_MOVE 1))
2956 -">> /this/is/append" -> (REDIR >> (STRING / this / is / append))
2957 -"&> allout" -> (REDIR &> (STRING allout))
2958 -"< this.is.1input" -> (REDIR < (STRING this . is . 1 input))
2959 -"3< \"input from file\"" -> (REDIR 3 < (STRING (DOUBLE_QUOTED_STRING input from file)))
2960 -"2<&0" -> (REDIR 2 <& (FILE_DESCRIPTOR 0))
2961 -"<< asdf
2962 -asdf
2963 -" -> (<< (STRING asdf))
2964 -"<<< herestring" -> (<<< (STRING herestring))
2965 -"<< blue
2966 -red
2967 -green
2968 -" -> (<< (STRING red green))
2969
2970 diff --git a/libbash-0.1/bashast/gunit/runtests.sh b/libbash-0.1/bashast/gunit/runtests.sh
2971 deleted file mode 100755
2972 index ee8fe99..0000000
2973 --- a/libbash-0.1/bashast/gunit/runtests.sh
2974 +++ /dev/null
2975 @@ -1,21 +0,0 @@
2976 -#!/bin/bash
2977 -#############################################
2978 -#Please use git log for copyright holder and year information
2979 -#
2980 -#This file is part of libbash.
2981 -#
2982 -#libbash is free software: you can redistribute it and/or modify
2983 -#it under the terms of the GNU General Public License as published by
2984 -#the Free Software Foundation, either version 2 of the License, or
2985 -#(at your option) any later version.
2986 -#
2987 -#libbash is distributed in the hope that it will be useful,
2988 -#but WITHOUT ANY WARRANTY; without even the implied warranty of
2989 -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2990 -#GNU General Public License for more details.
2991 -#
2992 -#You should have received a copy of the GNU General Public License
2993 -#along with libbash. If not, see <http://www.gnu.org/licenses/>.
2994 -##############################################
2995 -
2996 -exec java -cp "${1}" org.antlr.gunit.Interp $2
2997
2998 diff --git a/libbash-0.1/bashast/gunit/simp_command.gunit b/libbash-0.1/bashast/gunit/simp_command.gunit
2999 deleted file mode 100644
3000 index db26ab4..0000000
3001 --- a/libbash-0.1/bashast/gunit/simp_command.gunit
3002 +++ /dev/null
3003 @@ -1,36 +0,0 @@
3004 -/*
3005 - Please use git log for copyright holder and year information
3006 -
3007 - This file is part of libbash.
3008 -
3009 - libbash is free software: you can redistribute it and/or modify
3010 - it under the terms of the GNU General Public License as published by
3011 - the Free Software Foundation, either version 2 of the License, or
3012 - (at your option) any later version.
3013 -
3014 - libbash is distributed in the hope that it will be useful,
3015 - but WITHOUT ANY WARRANTY; without even the implied warranty of
3016 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3017 - GNU General Public License for more details.
3018 -
3019 - You should have received a copy of the GNU General Public License
3020 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
3021 -*/
3022 -gunit java_libbash;
3023 -
3024 -simple_command:
3025 -"./command" -> (STRING . / command)
3026 -"asdf=5 cat" -> (STRING cat) (= asdf (STRING 5))
3027 -"i=3 g=4 h=18 grep asdf" -> (STRING grep) (STRING asdf) (= i (STRING 3)) (= g (STRING 4)) (= h (STRING 18))
3028 -"./configure --prefix=/usr/local" -> (STRING . / configure) (STRING - - prefix = / usr / local)
3029 -"[[while" -> (STRING [ [ while)
3030 -"./foobär" -> (STRING . / foob ä r)
3031 -"cat ~/Documents/todo.txt" -> (STRING cat) (STRING ~ / Documents / todo . txt)
3032 -"dodir ${foo}/${bar}" -> (STRING dodir) (STRING (VAR_REF foo) / (VAR_REF bar))
3033 -"local a=123 b=(1 2 3) c" -> (VARIABLE_DEFINITIONS local (= a (STRING 123)) (= b (ARRAY (STRING 1) (STRING 2) (STRING 3))) (EQUALS c))
3034 -"echo {}{}}{{{}}{{}" -> (STRING echo) (STRING { } { } } { { { } } { { })
3035 -"echo \"ab#af ###\" #abc" -> (STRING echo) (STRING (DOUBLE_QUOTED_STRING ab # af ## #))
3036 -
3037 -command:
3038 -"asdf=5 cat out.log > result" -> (COMMAND (STRING cat) (STRING out . log) (= asdf (STRING 5)) (REDIR > (STRING result)))
3039 -"cat results.log > asdf 2> /dev/null" -> (COMMAND (STRING cat) (STRING results . log) (REDIR > (STRING asdf)) (REDIR 2 > (STRING / dev / null)))
3040
3041 diff --git a/libbash-0.1/bashast/gunit/simp_prog.gunit b/libbash-0.1/bashast/gunit/simp_prog.gunit
3042 deleted file mode 100644
3043 index 64aa001..0000000
3044 --- a/libbash-0.1/bashast/gunit/simp_prog.gunit
3045 +++ /dev/null
3046 @@ -1,38 +0,0 @@
3047 -/*
3048 - Please use git log for copyright holder and year information
3049 -
3050 - This file is part of libbash.
3051 -
3052 - libbash is free software: you can redistribute it and/or modify
3053 - it under the terms of the GNU General Public License as published by
3054 - the Free Software Foundation, either version 2 of the License, or
3055 - (at your option) any later version.
3056 -
3057 - libbash is distributed in the hope that it will be useful,
3058 - but WITHOUT ANY WARRANTY; without even the implied warranty of
3059 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3060 - GNU General Public License for more details.
3061 -
3062 - You should have received a copy of the GNU General Public License
3063 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
3064 -*/
3065 -gunit java_libbash;
3066 -
3067 -start:
3068 -"echo \"finding file\"
3069 -for each in `ls | grep output`; do
3070 -echo \"I found a file\"
3071 -done
3072 -
3073 -echo \"finding complete\"
3074 -"-> (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))))
3075 -
3076 -"function quit {
3077 - exit
3078 -}
3079 -hello () {
3080 - echo Hello!
3081 -}
3082 -hello
3083 -quit
3084 -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)))
3085
3086 diff --git a/libbash-0.1/bashast/libbashWalker.g b/libbash-0.1/bashast/libbashWalker.g
3087 deleted file mode 100644
3088 index f379183..0000000
3089 --- a/libbash-0.1/bashast/libbashWalker.g
3090 +++ /dev/null
3091 @@ -1,1153 +0,0 @@
3092 -/*
3093 - Please use git log for copyright holder and year information
3094 -
3095 - This file is part of libbash.
3096 -
3097 - libbash is free software: you can redistribute it and/or modify
3098 - it under the terms of the GNU General Public License as published by
3099 - the Free Software Foundation, either version 2 of the License, or
3100 - (at your option) any later version.
3101 -
3102 - libbash is distributed in the hope that it will be useful,
3103 - but WITHOUT ANY WARRANTY; without even the implied warranty of
3104 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3105 - GNU General Public License for more details.
3106 -
3107 - You should have received a copy of the GNU General Public License
3108 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
3109 -*/
3110 -tree grammar libbashWalker;
3111 -
3112 -options
3113 -{
3114 - language = C;
3115 - tokenVocab = libbash;
3116 - ASTLabelType = pANTLR3_BASE_TREE;
3117 -}
3118 -
3119 -@includes{
3120 -
3121 - #include <memory>
3122 - #include <string>
3123 - #include <vector>
3124 -
3125 - #include <boost/xpressive/xpressive.hpp>
3126 -
3127 - class interpreter;
3128 - void set_interpreter(interpreter* w);
3129 -
3130 -}
3131 -
3132 -@postinclude{
3133 -
3134 - #include <fstream>
3135 - #include <iostream>
3136 - #include <sstream>
3137 -
3138 - #include <boost/format.hpp>
3139 - #include <boost/algorithm/string/join.hpp>
3140 -
3141 - #include "builtins/builtin_exceptions.h"
3142 - #include "core/bash_condition.h"
3143 - #include "core/interpreter.h"
3144 - #include "cppbash_builtin.h"
3145 -
3146 -}
3147 -
3148 -@members{
3149 -
3150 - static interpreter* walker = 0;
3151 -
3152 - void set_interpreter(interpreter* w)
3153 - {
3154 - walker = w;
3155 - }
3156 -
3157 - namespace
3158 - {
3159 - void set_index(const std::string& name, unsigned& index, int value)
3160 - {
3161 - if(value < 0)
3162 - throw libbash::illegal_argument_exception((boost::format("Array index is less than 0: \%s[\%d]") \% name \% value).str());
3163 - index = value;
3164 - }
3165 -
3166 - // skip to next tree
3167 - void seek_to_next_tree(plibbashWalker ctx)
3168 - {
3169 - // Current depth of the tree we are traversing
3170 - int depth = 1;
3171 -
3172 - // The beginning should always be ROOT DOWN ANY_TOKEN
3173 - // So we start from LA(4)
3174 - int index = 4;
3175 - for(; depth != 0; ++index)
3176 - {
3177 - // Go one level done if we encounter DOWN
3178 - if(LA(index) == DOWN)
3179 - ++depth;
3180 - // Go one level up if we encounter UP. When depth==0, we finishe one node
3181 - else if(LA(index) == UP)
3182 - --depth;
3183 - }
3184 -
3185 - // Seek to the correct offset and consume.
3186 - SEEK(INDEX() + index - 2);
3187 - CONSUME();
3188 - }
3189 -
3190 - void skip_next_token_or_tree(plibbashWalker ctx)
3191 - {
3192 - if(LA(2) != DOWN)
3193 - SEEK(INDEX() + 1);
3194 - else
3195 - seek_to_next_tree(ctx);
3196 - }
3197 -
3198 - // The method is used to append a pattern with another one. Because it's not allowed to append an empty pattern,
3199 - // we need the argument 'do_append' to indicate whether the pattern is empty. 'do_append' will be set to true after
3200 - // the first assignment.
3201 - void append(boost::xpressive::sregex& pattern, const boost::xpressive::sregex& new_pattern, bool& do_append)
3202 - {
3203 - using namespace boost::xpressive;
3204 - if(do_append)
3205 - {
3206 - pattern = sregex(pattern >> new_pattern);
3207 - }
3208 - else
3209 - {
3210 - pattern = new_pattern;
3211 - do_append = true;
3212 - }
3213 - }
3214 -
3215 - bool match(const std::string& target,
3216 - const boost::xpressive::sregex& pattern)
3217 - {
3218 - return boost::xpressive::regex_match(target, pattern);
3219 - }
3220 -
3221 - /// \brief parse the text value of a tree to long
3222 - /// \param the target tree
3223 - /// \return the parsed value
3224 - long parse_integer(ANTLR3_BASE_TREE* tree)
3225 - {
3226 - return tree->getText(tree)->toInt32(tree->getText(tree));
3227 - }
3228 -
3229 - /// \brief a helper function that get the string value
3230 - /// of the given pANTLR3_BASE_TREE node.
3231 - /// \param the target tree node
3232 - /// \return the value of node->text
3233 - std::string get_string(pANTLR3_BASE_TREE node)
3234 - {
3235 - pANTLR3_COMMON_TOKEN token = node->getToken(node);
3236 - // The tree walker may send null pointer here, so return an empty
3237 - // string if that's the case.
3238 - if(!token->start)
3239 - return "";
3240 - // Use reinterpret_cast here because we have to cast C code.
3241 - // The real type here is int64_t which is used as a pointer.
3242 - // token->stop - token->start + 1 should be bigger than 0.
3243 - return std::string(reinterpret_cast<const char *>(token->start),
3244 - boost::numeric_cast<unsigned>(token->stop - token->start + 1));
3245 - }
3246 -
3247 - char get_char(pANTLR3_BASE_TREE node)
3248 - {
3249 - return *reinterpret_cast<const char *>(node->getToken(node)->start);
3250 - }
3251 - }
3252 -}
3253 -
3254 -start: list EOF;
3255 -
3256 -list: ^(LIST (logic_command_list)+);
3257 -
3258 -variable_definitions
3259 -@declarations {
3260 - bool local = false;
3261 -}
3262 - :^(VARIABLE_DEFINITIONS (LOCAL { local = true; })? var_def[local]*);
3263 -
3264 -name_base returns[std::string libbash_value]
3265 - :NAME { $libbash_value = get_string($NAME); }
3266 - |LETTER { $libbash_value = get_string($LETTER); }
3267 - |'_' { $libbash_value="_"; };
3268 -
3269 -name returns[std::string libbash_value, unsigned index]
3270 -@init {
3271 - $index = 0;
3272 -}
3273 - :^(libbash_name=name_base value=arithmetics) {
3274 - set_index(libbash_name, $index, value);
3275 - $libbash_value = libbash_name;
3276 - }
3277 - |libbash_name=name_base {
3278 - $libbash_value = libbash_name;
3279 - };
3280 -
3281 -num returns[std::string libbash_value]
3282 -options{ k=1; }
3283 - :DIGIT { $libbash_value = get_string($DIGIT); }
3284 - |NUMBER { $libbash_value = get_string($NUMBER); };
3285 -
3286 -var_def[bool local]
3287 -@declarations {
3288 - std::map<unsigned, std::string> values;
3289 - unsigned index = 0;
3290 -}
3291 - :^(EQUALS name string_expr?) {
3292 - if(local)
3293 - walker->define_local($name.libbash_value, $string_expr.libbash_value, false, $name.index);
3294 - else
3295 - walker->set_value($name.libbash_value, $string_expr.libbash_value, $name.index);
3296 - }
3297 - |^(EQUALS libbash_name=name_base ^(ARRAY (
3298 - (expr=string_expr
3299 - |^(EQUALS value=arithmetics {
3300 - set_index(libbash_name, index, value);
3301 - } expr=string_expr))
3302 - { values[index++] = expr.libbash_value; })*
3303 - )){
3304 - if(local)
3305 - walker->define_local(libbash_name, values);
3306 - else
3307 - walker->define(libbash_name, values);
3308 - };
3309 -
3310 -string_expr returns[std::string libbash_value, bool quoted]
3311 -@init {
3312 - $quoted = true;
3313 - bool is_raw_string = true;
3314 - std::vector<std::string> brace_expansion_base{""};
3315 - std::vector<std::string> brace_expansion_elements;
3316 -}
3317 -@after {
3318 - if(!is_raw_string && brace_expansion_base.size() > 1)
3319 - throw libbash::unsupported_exception("We only support brace expansion in raw string for now");
3320 - $libbash_value = boost::algorithm::join(brace_expansion_base, " ");
3321 -}
3322 - :^(STRING (
3323 - string_part {
3324 - for(auto iter = brace_expansion_base.begin(); iter != brace_expansion_base.end(); ++iter)
3325 - *iter += $string_part.libbash_value;
3326 - $quoted = $string_part.quoted;
3327 - if(is_raw_string)
3328 - is_raw_string = $string_part.is_raw_string;
3329 - }
3330 - |(BRACE_EXP) => ^(BRACE_EXP brace_expansion[brace_expansion_elements]) {
3331 - auto group_number = brace_expansion_elements.size();
3332 - auto group_size = brace_expansion_base.size();
3333 - std::vector<std::string> expanded_values;
3334 -
3335 - expanded_values.reserve(group_number * group_size);
3336 - for(auto iter = brace_expansion_base.begin(); iter != brace_expansion_base.end(); ++iter)
3337 - for(std::vector<std::string>::size_type i = 0u; i != group_number; ++i)
3338 - expanded_values.push_back(*iter + brace_expansion_elements[i \% group_number]);
3339 -
3340 - brace_expansion_base.swap(expanded_values);
3341 - brace_expansion_elements.clear();
3342 - }
3343 - )*);
3344 -
3345 -brace_expansion[std::vector<std::string>& elements]
3346 - :(string_expr{
3347 - $elements.push_back($string_expr.libbash_value);
3348 - })+;
3349 -
3350 -string_part returns[std::string libbash_value, bool quoted, bool is_raw_string]
3351 -@init {
3352 - $quoted = false;
3353 - $is_raw_string = true;
3354 -}
3355 - :(DOUBLE_QUOTED_STRING) =>
3356 - ^(DOUBLE_QUOTED_STRING (libbash_string=double_quoted_string {
3357 - $libbash_value += libbash_string;
3358 - $quoted = true;
3359 - })*)
3360 - |(SINGLE_QUOTED_STRING) => ^(SINGLE_QUOTED_STRING node=SINGLE_QUOTED_STRING_TOKEN) {
3361 - pANTLR3_COMMON_TOKEN token = node->getToken(node);
3362 - $libbash_value = std::string(reinterpret_cast<const char *>(token->start + 1),
3363 - boost::numeric_cast<unsigned>(token->stop - token->start - 1));
3364 - }
3365 - |(ARITHMETIC_EXPRESSION) =>
3366 - ^(ARITHMETIC_EXPRESSION value=arithmetics {
3367 - $libbash_value = boost::lexical_cast<std::string>(value);
3368 - $is_raw_string = false;
3369 - })
3370 - |(var_ref[false]) => libbash_string=var_ref[false] {
3371 - $libbash_value = libbash_string;
3372 - $is_raw_string = false;
3373 - }
3374 - |libbash_string=command_substitution {
3375 - $libbash_value = libbash_string;
3376 - $is_raw_string = false;
3377 - }
3378 - |(libbash_string=any_string {
3379 - $libbash_value = libbash_string;
3380 - });
3381 -
3382 -bash_pattern[boost::xpressive::sregex& pattern, bool greedy]
3383 -@declarations {
3384 - using namespace boost::xpressive;
3385 - bool do_append = false;
3386 - sregex pattern_list;
3387 - auto check_extglob = [&]() {
3388 - if(!walker->get_additional_option("extglob"))
3389 - throw libbash::unsupported_exception("Entered extended pattern matching with extglob disabled");
3390 - };
3391 -}
3392 - :^(STRING (
3393 - (EXTENDED_MATCH_AT_MOST_ONE) => ^(EXTENDED_MATCH_AT_MOST_ONE composite_pattern[pattern_list, $greedy]) {
3394 - check_extglob();
3395 - if($greedy)
3396 - append($pattern, !sregex(pattern_list), do_append);
3397 - else
3398 - append($pattern, -!sregex(pattern_list), do_append);
3399 - }
3400 - |(EXTENDED_MATCH_ANY) => ^(EXTENDED_MATCH_ANY composite_pattern[pattern_list, $greedy]) {
3401 - check_extglob();
3402 - if($greedy)
3403 - append($pattern, *sregex(pattern_list), do_append);
3404 - else
3405 - append($pattern, -*sregex(pattern_list), do_append);
3406 - }
3407 - |(EXTENDED_MATCH_AT_LEAST_ONE) => ^(EXTENDED_MATCH_AT_LEAST_ONE composite_pattern[pattern_list, $greedy]) {
3408 - check_extglob();
3409 - if($greedy)
3410 - append($pattern, +sregex(pattern_list), do_append);
3411 - else
3412 - append($pattern, -+sregex(pattern_list), do_append);
3413 - }
3414 - // We don't have to do anything for the following rule
3415 - |(EXTENDED_MATCH_EXACTLY_ONE) => ^(EXTENDED_MATCH_EXACTLY_ONE composite_pattern[pattern_list, $greedy]) {
3416 - check_extglob();
3417 - append($pattern, pattern_list, do_append);
3418 - }
3419 - |(EXTENDED_MATCH_NONE) => ^(EXTENDED_MATCH_NONE composite_pattern[pattern_list, $greedy]) {
3420 - check_extglob();
3421 - throw libbash::unsupported_exception("!(blah) is not supported for now");
3422 - }
3423 - |basic_pattern[$pattern, $greedy, do_append])+);
3424 -
3425 -composite_pattern[boost::xpressive::sregex& pattern_list, bool greedy]
3426 -@declarations {
3427 - using namespace boost::xpressive;
3428 - bool do_append = false;
3429 - bool do_sub_append = false;
3430 - sregex sub_pattern;
3431 -}
3432 - :(^(STRING
3433 - (basic_pattern[sub_pattern, $greedy, do_sub_append]{
3434 - if(do_append)
3435 - {
3436 - $pattern_list = sregex($pattern_list | sub_pattern);
3437 - }
3438 - else
3439 - {
3440 - $pattern_list = sub_pattern;
3441 - do_append = true;
3442 - }
3443 - do_sub_append = false;
3444 - })+
3445 - ))+;
3446 -
3447 -basic_pattern[boost::xpressive::sregex& pattern, bool greedy, bool& do_append]
3448 -@declarations {
3449 - using namespace boost::xpressive;
3450 - bool negation;
3451 - std::string pattern_str;
3452 -}
3453 - :(MATCH_ALL) => MATCH_ALL {
3454 - if($greedy)
3455 - append($pattern, *_, do_append);
3456 - else
3457 - append($pattern, -*_, do_append);
3458 - }
3459 - |(MATCH_ONE) => MATCH_ONE {
3460 - append($pattern, _, do_append);
3461 - }
3462 - |(MATCH_ANY_EXCEPT|MATCH_ANY) =>
3463 - ^((MATCH_ANY_EXCEPT { negation = true; } | MATCH_ANY { negation = false; })
3464 - ((CHARACTER_CLASS) => ^(CHARACTER_CLASS n=NAME) {
3465 - std::string class_name = get_string(n);
3466 - if(class_name == "word")
3467 - pattern_str += "A-Za-z0-9_";
3468 - else if(class_name == "ascii")
3469 - pattern_str += "\\x00-\\x7F";
3470 - else
3471 - pattern_str += "[:" + class_name + ":]";
3472 - }
3473 - |s=string_part { pattern_str += s.libbash_value; })+) {
3474 -
3475 - if(negation)
3476 - pattern_str = "[^" + pattern_str + "]";
3477 - else
3478 - pattern_str = "[" + pattern_str + "]";
3479 -
3480 - append($pattern, sregex::compile(pattern_str), do_append);
3481 - }
3482 - |string_part {
3483 - append($pattern, as_xpr($string_part.libbash_value), do_append);
3484 - };
3485 -
3486 -//double quoted string rule, allows expansions
3487 -double_quoted_string returns[std::string libbash_value]
3488 - :(var_ref[true]) => libbash_string=var_ref[true] { $libbash_value = libbash_string; }
3489 - |(ARITHMETIC_EXPRESSION) => ^(ARITHMETIC_EXPRESSION value=arithmetics) {
3490 - $libbash_value = boost::lexical_cast<std::string>(value);
3491 - }
3492 - |libbash_string=command_substitution {
3493 - $libbash_value = libbash_string;
3494 - }
3495 - |libbash_string=any_string { $libbash_value = libbash_string; };
3496 -
3497 -any_string returns[std::string libbash_value]
3498 -@declarations {
3499 - pANTLR3_BASE_TREE any_token;
3500 -}
3501 - :any_token=. { $libbash_value = get_string(any_token); };
3502 -
3503 -//Allowable variable names in the variable expansion
3504 -var_name returns[std::string libbash_value, unsigned index]
3505 -@init {
3506 - $var_name.index = 0;
3507 -}
3508 - :libbash_string=num {
3509 - $index = boost::lexical_cast<unsigned>(libbash_string);
3510 - $libbash_value = ($index != 0 ? "*" : "0");
3511 - }
3512 - |name {
3513 - $libbash_value = $name.libbash_value;
3514 - $index = $name.index;
3515 - }
3516 - |MINUS {
3517 - $libbash_value = "-";
3518 - };
3519 -
3520 -array_name returns[std::string libbash_value]
3521 - :^(ARRAY name (AT|TIMES)) { $libbash_value = $name.libbash_value; }
3522 - // We do not care the difference between TIMES and AT for now
3523 - |TIMES { $libbash_value = "*"; }
3524 - |AT { $libbash_value = "*"; };
3525 -
3526 -var_expansion returns[std::string libbash_value]
3527 -@declarations {
3528 - using namespace boost::xpressive;
3529 - sregex replace_pattern;
3530 - bool greedy;
3531 -}
3532 - :^(USE_DEFAULT_WHEN_UNSET_OR_NULL var_name libbash_word=word) {
3533 - libbash_value = walker->do_default_expansion($var_name.libbash_value, libbash_word, $var_name.index);
3534 - }
3535 - |^(ASSIGN_DEFAULT_WHEN_UNSET_OR_NULL var_name libbash_word=word) {
3536 - libbash_value = walker->do_assign_expansion($var_name.libbash_value, libbash_word, $var_name.index);
3537 - }
3538 - |^(USE_ALTERNATE_WHEN_UNSET_OR_NULL var_name libbash_word=word) {
3539 - libbash_value = walker->do_alternate_expansion($var_name.libbash_value, libbash_word, $var_name.index);
3540 - }
3541 - |(^(OFFSET array_name arithmetics arithmetics)) => ^(OFFSET libbash_name=array_name offset=arithmetics length=arithmetics) {
3542 - libbash_value = walker->do_subarray_expansion(libbash_name, offset, length);
3543 - }
3544 - |(^(OFFSET array_name offset=arithmetics)) => ^(OFFSET libbash_name=array_name offset=arithmetics) {
3545 - libbash_value = walker->do_subarray_expansion(libbash_name, offset);
3546 - }
3547 - |(^(OFFSET var_name arithmetics arithmetics)) => ^(OFFSET var_name offset=arithmetics length=arithmetics) {
3548 - libbash_value = walker->do_substring_expansion($var_name.libbash_value, offset, length, $var_name.index);
3549 - }
3550 - |^(OFFSET var_name offset=arithmetics) {
3551 - libbash_value = walker->do_substring_expansion($var_name.libbash_value, offset, $var_name.index);
3552 - }
3553 - |^(POUND(
3554 - var_name {
3555 - libbash_value = boost::lexical_cast<std::string>(walker->get_length($var_name.libbash_value, $var_name.index));
3556 - }
3557 - |^(libbash_name=name_base ARRAY_SIZE) {
3558 - libbash_value = boost::lexical_cast<std::string>(walker->get_array_length(libbash_name));
3559 - }
3560 - ))
3561 - |^(REPLACE_ALL var_name bash_pattern[replace_pattern, true] (replacement=string_expr)?) {
3562 - libbash_value = walker->do_replace_expansion($var_name.libbash_value,
3563 - std::bind(&interpreter::replace_all,
3564 - std::placeholders::_1,
3565 - replace_pattern,
3566 - replacement.libbash_value),
3567 - $var_name.index);
3568 - }
3569 - |^(REPLACE_AT_END var_name bash_pattern[replace_pattern, true] (replacement=string_expr)?) {
3570 - replace_pattern = sregex(replace_pattern >> eos);
3571 - libbash_value = walker->do_replace_expansion($var_name.libbash_value,
3572 - std::bind(&interpreter::replace_all,
3573 - std::placeholders::_1,
3574 - replace_pattern,
3575 - replacement.libbash_value),
3576 - $var_name.index);
3577 - }
3578 - |^(LAZY_REMOVE_AT_END var_name bash_pattern[replace_pattern, false] (replacement=string_expr)?) {
3579 - replace_pattern = sregex(bos >> (s1=*_) >> replace_pattern >> eos);
3580 - libbash_value = walker->do_replace_expansion($var_name.libbash_value,
3581 - std::bind(&interpreter::lazy_remove_at_end,
3582 - std::placeholders::_1,
3583 - replace_pattern),
3584 - $var_name.index);
3585 - }
3586 - |^((REPLACE_AT_START { greedy = true; }|LAZY_REMOVE_AT_START { greedy = false; })
3587 - var_name bash_pattern[replace_pattern, greedy] (replacement=string_expr)?) {
3588 - replace_pattern = sregex(bos >> replace_pattern);
3589 - libbash_value = walker->do_replace_expansion($var_name.libbash_value,
3590 - std::bind(&interpreter::replace_all,
3591 - std::placeholders::_1,
3592 - replace_pattern,
3593 - replacement.libbash_value),
3594 - $var_name.index);
3595 - }
3596 - |^(REPLACE_FIRST var_name bash_pattern[replace_pattern, true] (replacement=string_expr)?) {
3597 - libbash_value = walker->do_replace_expansion($var_name.libbash_value,
3598 - std::bind(&interpreter::replace_first,
3599 - std::placeholders::_1,
3600 - replace_pattern,
3601 - replacement.libbash_value),
3602 - $var_name.index);
3603 - };
3604 -
3605 -word returns[std::string libbash_value]
3606 - :(num) => libbash_string=num { $libbash_value = libbash_string; }
3607 - |string_expr { $libbash_value = $string_expr.libbash_value; }
3608 - |(VAR_REF) => libbash_string=var_ref[false] { $libbash_value = libbash_string; }
3609 - |value=arithmetics { $libbash_value = boost::lexical_cast<std::string>(value); };
3610 -
3611 -//variable reference
3612 -var_ref [bool double_quoted] returns[std::string libbash_value]
3613 - :^(VAR_REF var_name) {
3614 - $libbash_value = walker->resolve<std::string>($var_name.libbash_value, $var_name.index);
3615 - }
3616 - |^(VAR_REF libbash_string=array_name) { walker->get_all_elements_IFS_joined(libbash_string, $libbash_value); }
3617 - |^(VAR_REF POUND) { $libbash_value = boost::lexical_cast<std::string>(walker->get_array_length("*")); }
3618 - |^(VAR_REF QMARK) { $libbash_value = boost::lexical_cast<std::string>(walker->get_status()); }
3619 - |^(VAR_REF BANG) { std::cerr << "$! has not been implemented yet" << std::endl; }
3620 - |^(VAR_REF libbash_string=var_expansion) { $libbash_value = libbash_string; };
3621 -
3622 -command
3623 - :^(COMMAND command_atom);
3624 -
3625 -command_atom
3626 - :variable_definitions
3627 - |function_definition
3628 - |simple_command
3629 - |compound_command;
3630 -
3631 -simple_command
3632 -@declarations {
3633 - std::vector<std::string> libbash_args;
3634 -}
3635 - :string_expr (argument[libbash_args])* execute_command[$string_expr.libbash_value, libbash_args];
3636 -
3637 -execute_command[const std::string& name, std::vector<std::string>& libbash_args]
3638 -@declarations {
3639 - interpreter::local_scope current_scope(*walker);
3640 - std::unique_ptr<std::ostream> out;
3641 - std::unique_ptr<std::ostream> err;
3642 - std::unique_ptr<std::istream> in;
3643 - bool redirection = false;
3644 -}
3645 - :var_def[true]* (redirect[out, err, in]{ redirection = true; })* {
3646 - if(walker->has_function(name))
3647 - {
3648 - if(redirection)
3649 - std::cerr << "We do not support redirection for function calls." << std::endl;
3650 - ANTLR3_MARKER command_index = INDEX();
3651 - try
3652 - {
3653 - ANTLR3_MARKER current_index = INDEX();
3654 - // Calling functions may change current index
3655 - walker->call(name, libbash_args);
3656 - SEEK(current_index);
3657 - }
3658 - catch(return_exception& e)
3659 - {
3660 - SEEK(command_index);
3661 - }
3662 - }
3663 - else if(cppbash_builtin::is_builtin(name))
3664 - {
3665 - walker->set_status(walker->execute_builtin(name, libbash_args, out.get(), err.get(), in.get()));
3666 - }
3667 - else if(name == "export")
3668 - {
3669 - std::cerr << "We do not support command env before the export builtin." << std::endl;
3670 - walker->set_status(1);
3671 - }
3672 - else
3673 - {
3674 - walker->set_status(1);
3675 - throw libbash::unsupported_exception(name + " is not supported yet");
3676 - }
3677 - }
3678 - (BANG { walker->set_status(!walker->get_status()); })?;
3679 -
3680 -redirect[std::unique_ptr<std::ostream>& out, std::unique_ptr<std::ostream>& err, std::unique_ptr<std::istream>& in]
3681 - :^(REDIR LESS_THAN redirect_destination_input[in]) {
3682 - std::cerr << "Redirection is not supported yet" << std::endl;
3683 - }
3684 - |^(REDIR GREATER_THAN redirect_destination_output[out])
3685 - |^(REDIR DIGIT LESS_THAN redirect_destination_input[in]) {
3686 - std::cerr << "Redirection is not supported yet" << std::endl;
3687 - }
3688 - |^(REDIR DIGIT GREATER_THAN redirect_destination_output[out]) {
3689 - std::cerr << "Redirection is not supported yet" << std::endl;
3690 - };
3691 -
3692 -redirect_operator
3693 - :LESS_THAN
3694 - |GREATER_THAN
3695 - |FILE_DESCRIPTOR DIGIT redirect_operator;
3696 -
3697 -redirect_destination_output[std::unique_ptr<std::ostream>& out]
3698 - :string_expr {
3699 - out.reset(new std::ofstream($string_expr.libbash_value, std::ofstream::trunc));
3700 - }
3701 - |FILE_DESCRIPTOR DIGIT {
3702 - std::cerr << "FILE_DESCRIPTOR redirection is not supported yet" << std::endl;
3703 - }
3704 - |FILE_DESCRIPTOR_MOVE DIGIT {
3705 - std::cerr << "FILE_DESCRIPTOR_MOVE redirection is not supported yet" << std::endl;
3706 - };
3707 -
3708 -redirect_destination_input[std::unique_ptr<std::istream>& in]
3709 - :string_expr {
3710 - std::cerr << "Input redirection for file is not supported yet" << std::endl;
3711 - }
3712 - |FILE_DESCRIPTOR DIGIT {
3713 - std::cerr << "FILE_DESCRIPTOR redirection is not supported yet" << std::endl;
3714 - }
3715 - |FILE_DESCRIPTOR_MOVE DIGIT {
3716 - std::cerr << "FILE_DESCRIPTOR_MOVE redirection is not supported yet" << std::endl;
3717 - };
3718 -
3719 -argument[std::vector<std::string>& args]
3720 - : string_expr {
3721 - if($string_expr.quoted)
3722 - args.push_back($string_expr.libbash_value);
3723 - else
3724 - walker->split_word($string_expr.libbash_value, args);
3725 - };
3726 -
3727 -logic_command_list
3728 -@declarations {
3729 - bool logic_and;
3730 -}
3731 - :command
3732 - |^((LOGICAND { logic_and = true; } | LOGICOR { logic_and = false; }) command {
3733 - if(logic_and ? !walker->get_status() : walker->get_status())
3734 - command(ctx);
3735 - else
3736 - seek_to_next_tree(ctx);
3737 - });
3738 -
3739 -command_list: ^(LIST logic_command_list+);
3740 -
3741 -compound_command
3742 - : ^(CURRENT_SHELL command_list)
3743 - | ^(COMPOUND_COND cond_expr)
3744 - | ^(ARITHMETIC_EXPRESSION arithmetics)
3745 - | for_expr
3746 - | while_expr
3747 - | if_expr
3748 - | case_expr;
3749 -
3750 -cond_expr
3751 - :^(BUILTIN_TEST status=builtin_condition) { walker->set_status(!status); }
3752 - |^(KEYWORD_TEST status=keyword_condition) { walker->set_status(!status); };
3753 -
3754 -common_condition returns[bool status]
3755 -@declarations {
3756 - boost::xpressive::sregex pattern;
3757 -}
3758 - // -eq, -ne, -lt, -le, -gt, or -ge for arithmetic. -nt -ot -ef for files
3759 - :^(NAME left_str=string_expr right_str=string_expr) {
3760 - $status = internal::test_binary(get_string($NAME), left_str.libbash_value, right_str.libbash_value, *walker);
3761 - }
3762 - // -o for shell option, -z -n for string, -abcdefghkprstuwxOGLSN for files
3763 - |^(op=LETTER string_expr) {
3764 - $status = internal::test_unary(get_char(op),
3765 - $string_expr.libbash_value);
3766 - }
3767 - |^(EQUALS left_str=string_expr right_str=string_expr) {
3768 - $status = left_str.libbash_value == right_str.libbash_value;
3769 - }
3770 - // Greedy is meaningless as we need to match the whole string
3771 - |^(MATCH_PATTERN left_str=string_expr bash_pattern[pattern, false]) {
3772 - $status = match(left_str.libbash_value, pattern);
3773 - }
3774 - |^(NOT_EQUALS left_str=string_expr right_str=string_expr) {
3775 - $status = left_str.libbash_value != right_str.libbash_value;
3776 - }
3777 - // Greedy is meaningless as we need to match the whole string
3778 - |^(NOT_MATCH_PATTERN left_str=string_expr bash_pattern[pattern, false]) {
3779 - $status = !match(left_str.libbash_value, pattern);
3780 - }
3781 - |^(LESS_THAN left_str=string_expr right_str=string_expr) {
3782 - $status = left_str.libbash_value < right_str.libbash_value;
3783 - }
3784 - |^(GREATER_THAN left_str=string_expr right_str=string_expr) {
3785 - $status = left_str.libbash_value > right_str.libbash_value;
3786 - }
3787 - |string_expr { $status = (!$string_expr.libbash_value.empty()); };
3788 -
3789 -keyword_condition returns[bool status]
3790 - :^(LOGICOR l=keyword_condition r=keyword_condition) { $status= l || r; }
3791 - |^(LOGICAND l=keyword_condition r=keyword_condition) { $status= l && r; }
3792 - |^(NEGATION l=keyword_condition) { $status = !l; }
3793 - |^(MATCH_REGULAR_EXPRESSION left_str=string_expr right_str=string_expr) {
3794 - boost::xpressive::sregex re = boost::xpressive::sregex::compile(right_str.libbash_value);
3795 - $status = boost::xpressive::regex_match(left_str.libbash_value, re);
3796 - }
3797 - |s=common_condition { $status = s; };
3798 -
3799 -builtin_condition returns[bool status]
3800 - :^(NEGATION l=builtin_condition) { $status = !l; }
3801 - |^(BUILTIN_LOGIC o=LETTER l=builtin_condition r=builtin_condition) {
3802 - char op = get_char(o);
3803 - if(op == 'a')
3804 - $status = l && r;
3805 - else if(op == 'o')
3806 - $status = l || r;
3807 - else
3808 - throw libbash::parse_exception(std::string("unrecognized operator in built-in test: ") + op);
3809 - }
3810 - |s=builtin_condition_primary { $status = s; };
3811 -
3812 -builtin_condition_primary returns[bool status]
3813 - :^(ESC_LT l=string_expr r=string_expr) { $status = (l.libbash_value < r.libbash_value); }
3814 - |^(ESC_GT l=string_expr r=string_expr) { $status = (l.libbash_value > r.libbash_value); }
3815 - |s=common_condition { $status = s; };
3816 -
3817 -for_expr
3818 -@declarations {
3819 - ANTLR3_MARKER commands_index;
3820 - std::vector<std::string> splitted_values;
3821 -
3822 - ANTLR3_MARKER condition_index;
3823 -}
3824 - :^(FOR libbash_string=name_base
3825 - // Empty value as $@ is not supported currently
3826 - (string_expr
3827 - {
3828 - // Word splitting happens here
3829 - if($string_expr.quoted)
3830 - splitted_values.push_back($string_expr.libbash_value);
3831 - else
3832 - walker->split_word($string_expr.libbash_value, splitted_values);
3833 - }
3834 - )+
3835 - {
3836 - if(splitted_values.empty())
3837 - {
3838 - //skip the body
3839 - seek_to_next_tree(ctx);
3840 - walker->set_status(0);
3841 - }
3842 - else
3843 - {
3844 - commands_index = INDEX();
3845 - for(auto iter = splitted_values.begin(); iter != splitted_values.end(); ++iter)
3846 - {
3847 - walker->set_value(libbash_string, *iter);
3848 - try
3849 - {
3850 - command_list(ctx);
3851 - }
3852 - catch(continue_exception& e)
3853 - {
3854 - e.rethrow_unless_correct_frame();
3855 - }
3856 - catch(break_exception& e)
3857 - {
3858 - e.rethrow_unless_correct_frame();
3859 - SEEK(commands_index);
3860 - break;
3861 - }
3862 - SEEK(commands_index);
3863 - }
3864 - seek_to_next_tree(ctx);
3865 - }
3866 - })
3867 - |^(CFOR {
3868 - // omit the first DOWN token for for_INIT
3869 - SEEK(INDEX() + 1);
3870 -
3871 - if(LA(1) == FOR_INIT)
3872 - for_initilization(ctx);
3873 -
3874 - condition_index = INDEX();
3875 - bool has_condition = (LA(1) == FOR_COND);
3876 -
3877 - if(has_condition)
3878 - seek_to_next_tree(ctx);
3879 - // before the body
3880 - seek_to_next_tree(ctx);
3881 - bool has_modification = (LA(1) == FOR_MOD);
3882 - ANTLR3_MARKER modification_index = INDEX();
3883 -
3884 - SEEK(condition_index);
3885 -
3886 - ANTLR3_MARKER command_index;
3887 - while(!has_condition || for_condition(ctx))
3888 - {
3889 - command_index = INDEX();
3890 - try
3891 - {
3892 - command_list(ctx);
3893 - }
3894 - catch(continue_exception& e)
3895 - {
3896 - e.rethrow_unless_correct_frame();
3897 -
3898 - if(has_modification)
3899 - {
3900 - SEEK(modification_index);
3901 - for_modification(ctx);
3902 - }
3903 - SEEK(condition_index);
3904 - continue;
3905 - }
3906 - catch(break_exception& e)
3907 - {
3908 - e.rethrow_unless_correct_frame();
3909 - SEEK(command_index);
3910 - break;
3911 - }
3912 - if(has_modification)
3913 - for_modification(ctx);
3914 - SEEK(condition_index);
3915 - }
3916 -
3917 - // Get out of the loop
3918 - // We are standing right after for_condition, we need to skip the command_list and optional for_modification
3919 - seek_to_next_tree(ctx);
3920 - if(LA(1) == FOR_MOD)
3921 - seek_to_next_tree(ctx);
3922 -
3923 - // omit the last UP token
3924 - SEEK(INDEX() + 1);
3925 - });
3926 -
3927 -for_initilization
3928 - :^(FOR_INIT arithmetics);
3929 -
3930 -for_condition returns[long libbash_value]
3931 - :^(FOR_COND condition=arithmetics) { libbash_value = condition; };
3932 -
3933 -for_modification
3934 - :^(FOR_MOD arithmetics);
3935 -
3936 -while_expr
3937 -@declarations {
3938 - ANTLR3_MARKER condition_index;
3939 - ANTLR3_MARKER command_index;
3940 - bool negate;
3941 -}
3942 - :^((WHILE { negate = false; } | UNTIL { negate = true; }) {
3943 - // omit the first DOWN token
3944 - SEEK(INDEX() + 1);
3945 -
3946 - condition_index = INDEX();
3947 - while(true)
3948 - {
3949 - command_list(ctx);
3950 - if(walker->get_status() == (negate? 0 : 1))
3951 - break;
3952 -
3953 - command_index = INDEX();
3954 - try
3955 - {
3956 - command_list(ctx);
3957 - }
3958 - catch(continue_exception& e)
3959 - {
3960 - e.rethrow_unless_correct_frame();
3961 - SEEK(condition_index);
3962 - continue;
3963 - }
3964 - catch(break_exception& e)
3965 - {
3966 - e.rethrow_unless_correct_frame();
3967 - SEEK(command_index);
3968 - break;
3969 - }
3970 - SEEK(condition_index);
3971 - }
3972 - // Skip the body and get out
3973 - seek_to_next_tree(ctx);
3974 -
3975 - // omit the last UP token
3976 - SEEK(INDEX() + 1);
3977 - });
3978 -
3979 -if_expr
3980 -@declarations {
3981 - bool matched = false;
3982 -}
3983 - :^(IF_STATEMENT {
3984 - // omit the first DOWN token
3985 - SEEK(INDEX() + 1);
3986 -
3987 - while(LA(1) == IF)
3988 - {
3989 - if(matched)
3990 - seek_to_next_tree(ctx);
3991 - else
3992 - matched = elif_expr(ctx);
3993 - }
3994 -
3995 - if(LA(1) == ELSE)
3996 - {
3997 - if(matched == false)
3998 - {
3999 - // omit the ELSE DOWN tokens
4000 - SEEK(INDEX() + 2);
4001 -
4002 - command_list(ctx);
4003 -
4004 - // omit the last UP token
4005 - SEEK(INDEX() + 1);
4006 - }
4007 - else
4008 - {
4009 - seek_to_next_tree(ctx);
4010 - }
4011 - }
4012 -
4013 - // omit the last UP token
4014 - SEEK(INDEX() + 1);
4015 - });
4016 -
4017 -elif_expr returns[bool matched]
4018 - :^(IF {
4019 - // omit the first DOWN token
4020 - SEEK(INDEX() + 1);
4021 -
4022 - command_list(ctx);
4023 - if(walker->get_status() == 0)
4024 - {
4025 - $matched=true;
4026 - command_list(ctx);
4027 - }
4028 - else
4029 - {
4030 - $matched=false;
4031 - seek_to_next_tree(ctx);
4032 - }
4033 -
4034 - // omit the last UP token
4035 - SEEK(INDEX() + 1);
4036 - });
4037 -
4038 -case_expr
4039 - :^(CASE libbash_string=word (matched=case_clause[libbash_string]{
4040 - if(matched)
4041 - {
4042 - while(LA(1) == CASE_PATTERN)
4043 - seek_to_next_tree(ctx);
4044 - }
4045 - })*);
4046 -
4047 -case_clause[const std::string& target] returns[bool matched]
4048 -@declarations {
4049 - std::vector<boost::xpressive::sregex> patterns;
4050 -}
4051 - :^(CASE_PATTERN ( { patterns.push_back(boost::xpressive::sregex()); } bash_pattern[patterns.back(), true])+ {
4052 - $matched = false;
4053 -
4054 - for(auto iter = patterns.begin(); iter != patterns.end(); ++iter)
4055 - {
4056 - if(match(target, *iter))
4057 - {
4058 - if(LA(1) == CASE_COMMAND)
4059 - {
4060 - // omit CASE_COMMAND
4061 - SEEK(INDEX() + 1);
4062 - command_list(ctx);
4063 - }
4064 - $matched = true;
4065 - break;
4066 - }
4067 - }
4068 - if(!$matched)
4069 - seek_to_next_tree(ctx);
4070 - });
4071 -
4072 -command_substitution returns[std::string libbash_value]
4073 -@declarations {
4074 - std::stringstream out;
4075 -}
4076 - :^(COMMAND_SUB{ walker->set_output_stream(&out); } command_list) {
4077 - walker->restore_output_stream();
4078 - $libbash_value = out.str();
4079 - walker->trim_trailing_eols($libbash_value);
4080 - };
4081 -
4082 -function_definition returns[int placeholder]
4083 -@declarations {
4084 - std::string function_name;
4085 -}
4086 - // We've already validated the function name in parser grammar so here we just use any_string to match the name.
4087 - :^(FUNCTION ^(STRING (libbash_string=any_string { function_name += libbash_string; })+) {
4088 - // Define the function with current index
4089 - walker->define_function(function_name, INDEX());
4090 - // Skip the AST for function body
4091 - seek_to_next_tree(ctx);
4092 - });
4093 -
4094 -// Only used in arithmetic expansion
4095 -primary returns[std::string libbash_value, unsigned index]
4096 - :(^(VAR_REF name)) => ^(VAR_REF name) {
4097 - $libbash_value = $name.libbash_value;
4098 - $index = $name.index;
4099 - }
4100 - |name {
4101 - $libbash_value = $name.libbash_value;
4102 - $index = $name.index;
4103 - }
4104 - // array[@] and array[*] is meaningless to arithmetic expansion so true/false are both ok.
4105 - |^(VAR_REF libbash_string=var_ref[false]) {
4106 - $libbash_value = libbash_string;
4107 - $index = 0;
4108 - };
4109 -
4110 -// shell arithmetic
4111 -// http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_04
4112 -arithmetics returns[long value]
4113 - :^(LOGICOR l=arithmetics {
4114 - if(l)
4115 - {
4116 - skip_next_token_or_tree(ctx);
4117 - $value = 1;
4118 - }
4119 - else
4120 - {
4121 - $value = (arithmetics(ctx) != 0);
4122 - }
4123 - })
4124 - |^(LOGICAND l=arithmetics {
4125 - if(!l)
4126 - {
4127 - skip_next_token_or_tree(ctx);
4128 - $value = 0;
4129 - }
4130 - else
4131 - {
4132 - $value = (arithmetics(ctx) != 0);
4133 - }
4134 - })
4135 - |^(PIPE l=arithmetics r=arithmetics) { $value = l | r; }
4136 - |^(CARET l=arithmetics r=arithmetics) { $value = l ^ r; }
4137 - |^(AMP l=arithmetics r=arithmetics) { $value = l & r; }
4138 - |^(LEQ l=arithmetics r=arithmetics) { $value = l <= r; }
4139 - |^(GEQ l=arithmetics r=arithmetics) { $value = l >= r; }
4140 - |^(LESS_THAN l=arithmetics r=arithmetics) { $value = l < r; }
4141 - |^(GREATER_THAN l=arithmetics r=arithmetics) { $value = l > r; }
4142 - |^(NOT_EQUALS l=arithmetics r=arithmetics) { $value = l != r; }
4143 - |^(LSHIFT l=arithmetics r=arithmetics) { $value = l << r; }
4144 - |^(RSHIFT l=arithmetics r=arithmetics) { $value = l >> r; }
4145 - |^(PLUS l=arithmetics r=arithmetics) { $value = l + r; }
4146 - |^(PLUS_SIGN l=arithmetics) { $value = l; }
4147 - |^(MINUS l=arithmetics r=arithmetics) { $value = l - r; }
4148 - |^(MINUS_SIGN l=arithmetics) { $value = -l; }
4149 - |^(TIMES l=arithmetics r=arithmetics) { $value = l * r; }
4150 - |^(SLASH l=arithmetics r=arithmetics) { $value = l / r; }
4151 - |^(PCT l=arithmetics r=arithmetics) { $value = l \% r; }
4152 - |^(EXP l=arithmetics r=arithmetics) {
4153 - $value = 1;
4154 - while(r--)
4155 - $value *= l;
4156 - }
4157 - |^(BANG l=arithmetics) { $value = !l; }
4158 - |^(TILDE l=arithmetics) { $value = ~l; }
4159 - |^(ARITHMETIC_CONDITION cnd=arithmetics l=arithmetics r=arithmetics) {
4160 - $value = (cnd ? l : r);
4161 - }
4162 - |primary {
4163 - std::string primary_value(walker->resolve<std::string>($primary.libbash_value, $primary.index));
4164 - $value = (primary_value.empty() ? 0 : walker->eval_arithmetic(primary_value));
4165 - }
4166 - |^(PRE_INCR primary) {
4167 - $value = walker->set_value($primary.libbash_value,
4168 - walker->resolve<long>($primary.libbash_value, $primary.index) + 1,
4169 - $primary.index);
4170 - }
4171 - |^(PRE_DECR primary) {
4172 - $value = walker->set_value($primary.libbash_value,
4173 - walker->resolve<long>($primary.libbash_value, $primary.index) - 1,
4174 - $primary.index);
4175 - }
4176 - |^(POST_INCR primary) {
4177 - $value = walker->set_value($primary.libbash_value,
4178 - walker->resolve<long>($primary.libbash_value, $primary.index) + 1,
4179 - $primary.index);
4180 - --$value;
4181 - }
4182 - |^(POST_DECR primary) {
4183 - $value = walker->set_value($primary.libbash_value,
4184 - walker->resolve<long>($primary.libbash_value, $primary.index) - 1,
4185 - $primary.index);
4186 - ++$value;
4187 - }
4188 - |^(EQUALS primary l=arithmetics) {
4189 - $value = walker->set_value($primary.libbash_value, l, $primary.index);
4190 - }
4191 - |^(MUL_ASSIGN primary l=arithmetics) {
4192 - $value = walker->set_value($primary.libbash_value,
4193 - walker->resolve<long>($primary.libbash_value, $primary.index) * l,
4194 - $primary.index);
4195 - }
4196 - |^(DIVIDE_ASSIGN primary l=arithmetics) {
4197 - $value = walker->set_value($primary.libbash_value,
4198 - walker->resolve<long>($primary.libbash_value, $primary.index) / l,
4199 - $primary.index);
4200 - }
4201 - |^(MOD_ASSIGN primary l=arithmetics) {
4202 - $value = walker->set_value($primary.libbash_value,
4203 - walker->resolve<long>($primary.libbash_value, $primary.index) \% l,
4204 - $primary.index);
4205 - }
4206 - |^(PLUS_ASSIGN primary l=arithmetics) {
4207 - $value = walker->set_value($primary.libbash_value,
4208 - walker->resolve<long>($primary.libbash_value, $primary.index) + l,
4209 - $primary.index);
4210 - }
4211 - |^(MINUS_ASSIGN primary l=arithmetics) {
4212 - $value = walker->set_value($primary.libbash_value,
4213 - walker->resolve<long>($primary.libbash_value, $primary.index) - l,
4214 - $primary.index);
4215 - }
4216 - |^(LSHIFT_ASSIGN primary l=arithmetics) {
4217 - $value = walker->set_value($primary.libbash_value,
4218 - walker->resolve<long>($primary.libbash_value, $primary.index) << l,
4219 - $primary.index);
4220 - }
4221 - |^(RSHIFT_ASSIGN primary l=arithmetics) {
4222 - $value = walker->set_value($primary.libbash_value,
4223 - walker->resolve<long>($primary.libbash_value, $primary.index) >> l,
4224 - $primary.index);
4225 - }
4226 - |^(AND_ASSIGN primary l=arithmetics) {
4227 - $value = walker->set_value($primary.libbash_value,
4228 - walker->resolve<long>($primary.libbash_value, $primary.index) & l,
4229 - $primary.index);
4230 - }
4231 - |^(XOR_ASSIGN primary l=arithmetics) {
4232 - $value = walker->set_value($primary.libbash_value,
4233 - walker->resolve<long>($primary.libbash_value, $primary.index) ^ l,
4234 - $primary.index);
4235 - }
4236 - |^(OR_ASSIGN primary l=arithmetics) {
4237 - $value = walker->set_value($primary.libbash_value,
4238 - walker->resolve<long>($primary.libbash_value, $primary.index) | l,
4239 - $primary.index);
4240 - }
4241 - | NUMBER { $value = parse_integer($NUMBER);}
4242 - | DIGIT { $value = parse_integer($DIGIT);}
4243 - | ^(VAR_REF libbash_string = var_expansion) { $value = boost::lexical_cast<long>(libbash_string); }
4244 - ;
4245
4246 diff --git a/libbash-0.1/configure.ac b/libbash-0.1/configure.ac
4247 deleted file mode 100644
4248 index 3563013..0000000
4249 --- a/libbash-0.1/configure.ac
4250 +++ /dev/null
4251 @@ -1,73 +0,0 @@
4252 -dnl ############################################
4253 -dnl Please use git log for copyright holder and year information
4254 -dnl
4255 -dnl This file is part of libbash.
4256 -dnl
4257 -dnl libbash is free software: you can redistribute it and/or modify
4258 -dnl it under the terms of the GNU General Public License as published by
4259 -dnl the Free Software Foundation, either version 2 of the License, or
4260 -dnl (at your option) any later version.
4261 -dnl
4262 -dnl libbash is distributed in the hope that it will be useful,
4263 -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
4264 -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4265 -dnl GNU General Public License for more details.
4266 -dnl
4267 -dnl You should have received a copy of the GNU General Public License
4268 -dnl along with libbash. If not, see <http://www.gnu.org/licenses/>.
4269 -dnl #############################################
4270 -
4271 -AC_PREREQ(2.65)
4272 -AC_CONFIG_MACRO_DIR([m4])
4273 -AC_INIT([libbash],[0.1],[https://bugs.gentoo.org/enter_bug.cgi?component=libbash&product=Gentoo%20Hosted%20Projects])
4274 -AM_INIT_AUTOMAKE([foreign parallel-tests color-tests subdir-objects 1.11])
4275 -AM_SILENT_RULES([yes])
4276 -AC_PROG_CXX
4277 -LT_INIT
4278 -
4279 -AC_ARG_ENABLE([developer],
4280 - [AS_HELP_STRING([--enable-developer],[enables various QA checks])])
4281 -AM_CONDITIONAL([DEVELOPER_MODE],[test "x$enable_developer" = xyes])
4282 -
4283 -PKG_CHECK_MODULES([PALUDIS], [paludis])
4284 -
4285 -AS_IF([test "x$enable_developer" = xyes],[boost_version="1.46.1"],[boost_version="1.43.0"])
4286 -AX_BOOST_BASE([$boost_version],[:],
4287 - [AC_MSG_ERROR([Needed boost not found])])
4288 -AX_BOOST_SYSTEM
4289 -AX_BOOST_FILESYSTEM
4290 -AX_BOOST_PROGRAM_OPTIONS
4291 -AC_PATH_PROG([JAVA],[java],"no")
4292 -if test "$JAVA" = "no"; then
4293 - AC_MSG_ERROR([No java executable found])
4294 -fi
4295 -GTEST_LIB_CHECK(,[:],[:])
4296 -
4297 -AC_ARG_WITH(antlr, [],with_antlr=$withval,with_antlr=jc)
4298 -AS_IF([test "$with_antlr" = "jc"], [
4299 - AC_PATH_PROG(JAVA_CONFIG, java-config, "no")
4300 - if test "$JAVA_CONFIG" = "no"; then
4301 - AC_MSG_ERROR([java-config tool not found. Please give the location of an antlr3 jar using --with-antlr])
4302 - fi
4303 - AC_SUBST(antlr_cp,["$($JAVA_CONFIG -dp antlr-3)"])
4304 - ],
4305 - [test -f "$with_antlr"], [AC_SUBST(antlr_cp,["$with_antlr"])],
4306 - [AC_MSG_ERROR([Antlr jar $with_antlr not found])])
4307 -
4308 -AC_PATH_PROG([PDFLATEX],[pdflatex],"no")
4309 -if test "$PDFLATEX" = "no"; then
4310 - AC_MSG_RESULT([pdflatex not found on your system. You will be unable to generate the coding standard])
4311 -fi
4312 -
4313 -AC_CHECK_LIB([antlr3c],[antlr3AsciiFileStreamNew],[],[AC_MSG_ERROR(libasntlr3c not found. Have you installed the C antlr runtime?)])
4314 -AC_CONFIG_FILES([Makefile])
4315 -DX_HTML_FEATURE(ON)
4316 -DX_MAN_FEATURE(OFF)
4317 -DX_CHM_FEATURE(OFF)
4318 -DX_CHI_FEATURE(OFF)
4319 -DX_RTF_FEATURE(OFF)
4320 -DX_XML_FEATURE(OFF)
4321 -DX_PDF_FEATURE(OFF)
4322 -DX_PS_FEATURE(OFF)
4323 -DX_INIT_DOXYGEN([$PACKAGE_NAME], [Doxyfile])
4324 -AC_OUTPUT
4325
4326 diff --git a/libbash-0.1/doxygen.am b/libbash-0.1/doxygen.am
4327 deleted file mode 100644
4328 index 420049e..0000000
4329 --- a/libbash-0.1/doxygen.am
4330 +++ /dev/null
4331 @@ -1,186 +0,0 @@
4332 -# Copyright (C) 2004 Oren Ben-Kiki
4333 -# This file is distributed under the same terms as the Automake macro files.
4334 -
4335 -# Generate automatic documentation using Doxygen. Goals and variables values
4336 -# are controlled by the various DX_COND_??? conditionals set by autoconf.
4337 -#
4338 -# The provided goals are:
4339 -# doxygen-doc: Generate all doxygen documentation.
4340 -# doxygen-run: Run doxygen, which will generate some of the documentation
4341 -# (HTML, CHM, CHI, MAN, RTF, XML) but will not do the post
4342 -# processing required for the rest of it (PS, PDF, and some MAN).
4343 -# doxygen-man: Rename some doxygen generated man pages.
4344 -# doxygen-ps: Generate doxygen PostScript documentation.
4345 -# doxygen-pdf: Generate doxygen PDF documentation.
4346 -#
4347 -# Note that by default these are not integrated into the automake goals. If
4348 -# doxygen is used to generate man pages, you can achieve this integration by
4349 -# setting man3_MANS to the list of man pages generated and then adding the
4350 -# dependency:
4351 -#
4352 -# $(man3_MANS): doxygen-doc
4353 -#
4354 -# This will cause make to run doxygen and generate all the documentation.
4355 -#
4356 -# The following variable is intended for use in Makefile.am:
4357 -#
4358 -# DX_CLEANFILES = everything to clean.
4359 -#
4360 -# This is usually added to MOSTLYCLEANFILES.
4361 -
4362 -## --------------------------------- ##
4363 -## Format-independent Doxygen rules. ##
4364 -## --------------------------------- ##
4365 -
4366 -if DX_COND_doc
4367 -
4368 -## ------------------------------- ##
4369 -## Rules specific for HTML output. ##
4370 -## ------------------------------- ##
4371 -
4372 -if DX_COND_html
4373 -
4374 -DX_CLEAN_HTML = @DX_DOCDIR@/html
4375 -
4376 -endif DX_COND_html
4377 -
4378 -## ------------------------------ ##
4379 -## Rules specific for CHM output. ##
4380 -## ------------------------------ ##
4381 -
4382 -if DX_COND_chm
4383 -
4384 -DX_CLEAN_CHM = @DX_DOCDIR@/chm
4385 -
4386 -if DX_COND_chi
4387 -
4388 -DX_CLEAN_CHI = @DX_DOCDIR@/@PACKAGE@.chi
4389 -
4390 -endif DX_COND_chi
4391 -
4392 -endif DX_COND_chm
4393 -
4394 -## ------------------------------ ##
4395 -## Rules specific for MAN output. ##
4396 -## ------------------------------ ##
4397 -
4398 -if DX_COND_man
4399 -
4400 -DX_CLEAN_MAN = @DX_DOCDIR@/man
4401 -
4402 -endif DX_COND_man
4403 -
4404 -## ------------------------------ ##
4405 -## Rules specific for RTF output. ##
4406 -## ------------------------------ ##
4407 -
4408 -if DX_COND_rtf
4409 -
4410 -DX_CLEAN_RTF = @DX_DOCDIR@/rtf
4411 -
4412 -endif DX_COND_rtf
4413 -
4414 -## ------------------------------ ##
4415 -## Rules specific for XML output. ##
4416 -## ------------------------------ ##
4417 -
4418 -if DX_COND_xml
4419 -
4420 -DX_CLEAN_XML = @DX_DOCDIR@/xml
4421 -
4422 -endif DX_COND_xml
4423 -
4424 -## ----------------------------- ##
4425 -## Rules specific for PS output. ##
4426 -## ----------------------------- ##
4427 -
4428 -if DX_COND_ps
4429 -
4430 -DX_CLEAN_PS = @DX_DOCDIR@/@PACKAGE@.ps
4431 -
4432 -DX_PS_GOAL = doxygen-ps
4433 -
4434 -doxygen-ps: @DX_DOCDIR@/@PACKAGE@.ps
4435 -
4436 -@DX_DOCDIR@/@PACKAGE@.ps: @DX_DOCDIR@/@PACKAGE@.tag
4437 - cd @DX_DOCDIR@/latex; \
4438 - rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \
4439 - $(DX_LATEX) refman.tex; \
4440 - $(MAKEINDEX_PATH) refman.idx; \
4441 - $(DX_LATEX) refman.tex; \
4442 - countdown=5; \
4443 - while $(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \
4444 - refman.log > /dev/null 2>&1 \
4445 - && test $$countdown -gt 0; do \
4446 - $(DX_LATEX) refman.tex; \
4447 - countdown=`expr $$countdown - 1`; \
4448 - done; \
4449 - $(DX_DVIPS) -o ../@PACKAGE@.ps refman.dvi
4450 -
4451 -endif DX_COND_ps
4452 -
4453 -## ------------------------------ ##
4454 -## Rules specific for PDF output. ##
4455 -## ------------------------------ ##
4456 -
4457 -if DX_COND_pdf
4458 -
4459 -DX_CLEAN_PDF = @DX_DOCDIR@/@PACKAGE@.pdf
4460 -
4461 -DX_PDF_GOAL = doxygen-pdf
4462 -
4463 -doxygen-pdf: @DX_DOCDIR@/@PACKAGE@.pdf
4464 -
4465 -@DX_DOCDIR@/@PACKAGE@.pdf: @DX_DOCDIR@/@PACKAGE@.tag
4466 - cd @DX_DOCDIR@/latex; \
4467 - rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \
4468 - $(DX_PDFLATEX) refman.tex; \
4469 - $(DX_MAKEINDEX) refman.idx; \
4470 - $(DX_PDFLATEX) refman.tex; \
4471 - countdown=5; \
4472 - while $(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \
4473 - refman.log > /dev/null 2>&1 \
4474 - && test $$countdown -gt 0; do \
4475 - $(DX_PDFLATEX) refman.tex; \
4476 - countdown=`expr $$countdown - 1`; \
4477 - done; \
4478 - mv refman.pdf ../@PACKAGE@.pdf
4479 -
4480 -endif DX_COND_pdf
4481 -
4482 -## ------------------------------------------------- ##
4483 -## Rules specific for LaTeX (shared for PS and PDF). ##
4484 -## ------------------------------------------------- ##
4485 -
4486 -if DX_COND_latex
4487 -
4488 -DX_CLEAN_LATEX = @DX_DOCDIR@/latex
4489 -
4490 -endif DX_COND_latex
4491 -
4492 -.PHONY: doxygen-run doxygen-doc $(DX_PS_GOAL) $(DX_PDF_GOAL)
4493 -
4494 -.INTERMEDIATE: doxygen-run $(DX_PS_GOAL) $(DX_PDF_GOAL)
4495 -
4496 -doxygen-run: @DX_DOCDIR@/@PACKAGE@.tag
4497 -
4498 -doxygen-doc: doxygen-run $(DX_PS_GOAL) $(DX_PDF_GOAL)
4499 -
4500 -@DX_DOCDIR@/@PACKAGE@.tag: $(DX_CONFIG) $(pkginclude_HEADERS)
4501 - rm -rf @DX_DOCDIR@
4502 - $(DX_ENV) $(DX_DOXYGEN) $(srcdir)/$(DX_CONFIG)
4503 -
4504 -DX_CLEANFILES = \
4505 - @DX_DOCDIR@/@PACKAGE@.tag \
4506 - -r \
4507 - $(DX_CLEAN_HTML) \
4508 - $(DX_CLEAN_CHM) \
4509 - $(DX_CLEAN_CHI) \
4510 - $(DX_CLEAN_MAN) \
4511 - $(DX_CLEAN_RTF) \
4512 - $(DX_CLEAN_XML) \
4513 - $(DX_CLEAN_PS) \
4514 - $(DX_CLEAN_PDF) \
4515 - $(DX_CLEAN_LATEX)
4516 -
4517 -endif DX_COND_doc
4518
4519 diff --git a/libbash-0.1/m4/ax_boost_base.m4 b/libbash-0.1/m4/ax_boost_base.m4
4520 deleted file mode 100644
4521 index 8f935f6..0000000
4522 --- a/libbash-0.1/m4/ax_boost_base.m4
4523 +++ /dev/null
4524 @@ -1,252 +0,0 @@
4525 -# ===========================================================================
4526 -# http://www.gnu.org/software/autoconf-archive/ax_boost_base.html
4527 -# ===========================================================================
4528 -#
4529 -# SYNOPSIS
4530 -#
4531 -# AX_BOOST_BASE([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
4532 -#
4533 -# DESCRIPTION
4534 -#
4535 -# Test for the Boost C++ libraries of a particular version (or newer)
4536 -#
4537 -# If no path to the installed boost library is given the macro searchs
4538 -# under /usr, /usr/local, /opt and /opt/local and evaluates the
4539 -# $BOOST_ROOT environment variable. Further documentation is available at
4540 -# <http://randspringer.de/boost/index.html>.
4541 -#
4542 -# This macro calls:
4543 -#
4544 -# AC_SUBST(BOOST_CPPFLAGS) / AC_SUBST(BOOST_LDFLAGS)
4545 -#
4546 -# And sets:
4547 -#
4548 -# HAVE_BOOST
4549 -#
4550 -# LICENSE
4551 -#
4552 -# Copyright (c) 2008 Thomas Porschberg <thomas@××××××××××××.de>
4553 -# Copyright (c) 2009 Peter Adolphs
4554 -#
4555 -# Copying and distribution of this file, with or without modification, are
4556 -# permitted in any medium without royalty provided the copyright notice
4557 -# and this notice are preserved. This file is offered as-is, without any
4558 -# warranty.
4559 -
4560 -#serial 17
4561 -
4562 -AC_DEFUN([AX_BOOST_BASE],
4563 -[
4564 -AC_ARG_WITH([boost],
4565 - [AS_HELP_STRING([--with-boost@<:@=ARG@:>@],
4566 - [use Boost library from a standard location (ARG=yes),
4567 - from the specified location (ARG=<path>),
4568 - or disable it (ARG=no)
4569 - @<:@ARG=yes@:>@ ])],
4570 - [
4571 - if test "$withval" = "no"; then
4572 - want_boost="no"
4573 - elif test "$withval" = "yes"; then
4574 - want_boost="yes"
4575 - ac_boost_path=""
4576 - else
4577 - want_boost="yes"
4578 - ac_boost_path="$withval"
4579 - fi
4580 - ],
4581 - [want_boost="yes"])
4582 -
4583 -
4584 -AC_ARG_WITH([boost-libdir],
4585 - AS_HELP_STRING([--with-boost-libdir=LIB_DIR],
4586 - [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.]),
4587 - [
4588 - if test -d "$withval"
4589 - then
4590 - ac_boost_lib_path="$withval"
4591 - else
4592 - AC_MSG_ERROR(--with-boost-libdir expected directory name)
4593 - fi
4594 - ],
4595 - [ac_boost_lib_path=""]
4596 -)
4597 -
4598 -if test "x$want_boost" = "xyes"; then
4599 - boost_lib_version_req=ifelse([$1], ,1.20.0,$1)
4600 - boost_lib_version_req_shorten=`expr $boost_lib_version_req : '\([[0-9]]*\.[[0-9]]*\)'`
4601 - boost_lib_version_req_major=`expr $boost_lib_version_req : '\([[0-9]]*\)'`
4602 - boost_lib_version_req_minor=`expr $boost_lib_version_req : '[[0-9]]*\.\([[0-9]]*\)'`
4603 - boost_lib_version_req_sub_minor=`expr $boost_lib_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
4604 - if test "x$boost_lib_version_req_sub_minor" = "x" ; then
4605 - boost_lib_version_req_sub_minor="0"
4606 - fi
4607 - WANT_BOOST_VERSION=`expr $boost_lib_version_req_major \* 100000 \+ $boost_lib_version_req_minor \* 100 \+ $boost_lib_version_req_sub_minor`
4608 - AC_MSG_CHECKING(for boostlib >= $boost_lib_version_req)
4609 - succeeded=no
4610 -
4611 - dnl On x86_64 systems check for system libraries in both lib64 and lib.
4612 - dnl The former is specified by FHS, but e.g. Debian does not adhere to
4613 - dnl this (as it rises problems for generic multi-arch support).
4614 - dnl The last entry in the list is chosen by default when no libraries
4615 - dnl are found, e.g. when only header-only libraries are installed!
4616 - libsubdirs="lib"
4617 - if test `uname -m` = x86_64; then
4618 - libsubdirs="lib64 lib lib64"
4619 - fi
4620 -
4621 - dnl first we check the system location for boost libraries
4622 - dnl this location ist chosen if boost libraries are installed with the --layout=system option
4623 - dnl or if you install boost with RPM
4624 - if test "$ac_boost_path" != ""; then
4625 - BOOST_LDFLAGS="-L$ac_boost_path/$libsubdir"
4626 - BOOST_CPPFLAGS="-I$ac_boost_path/include"
4627 - elif test "$cross_compiling" != yes; then
4628 - for ac_boost_path_tmp in /usr /usr/local /opt /opt/local ; do
4629 - if test -d "$ac_boost_path_tmp/include/boost" && test -r "$ac_boost_path_tmp/include/boost"; then
4630 - for libsubdir in $libsubdirs ; do
4631 - if ls "$ac_boost_path_tmp/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
4632 - done
4633 - BOOST_LDFLAGS="-L$ac_boost_path_tmp/$libsubdir"
4634 - BOOST_CPPFLAGS="-I$ac_boost_path_tmp/include"
4635 - break;
4636 - fi
4637 - done
4638 - fi
4639 -
4640 - dnl overwrite ld flags if we have required special directory with
4641 - dnl --with-boost-libdir parameter
4642 - if test "$ac_boost_lib_path" != ""; then
4643 - BOOST_LDFLAGS="-L$ac_boost_lib_path"
4644 - fi
4645 -
4646 - CPPFLAGS_SAVED="$CPPFLAGS"
4647 - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
4648 - export CPPFLAGS
4649 -
4650 - LDFLAGS_SAVED="$LDFLAGS"
4651 - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
4652 - export LDFLAGS
4653 -
4654 - AC_REQUIRE([AC_PROG_CXX])
4655 - AC_LANG_PUSH(C++)
4656 - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4657 - @%:@include <boost/version.hpp>
4658 - ]], [[
4659 - #if BOOST_VERSION >= $WANT_BOOST_VERSION
4660 - // Everything is okay
4661 - #else
4662 - # error Boost version is too old
4663 - #endif
4664 - ]])],[
4665 - AC_MSG_RESULT(yes)
4666 - succeeded=yes
4667 - found_system=yes
4668 - ],[
4669 - ])
4670 - AC_LANG_POP([C++])
4671 -
4672 -
4673 -
4674 - dnl if we found no boost with system layout we search for boost libraries
4675 - dnl built and installed without the --layout=system option or for a staged(not installed) version
4676 - if test "x$succeeded" != "xyes"; then
4677 - _version=0
4678 - if test "$ac_boost_path" != ""; then
4679 - if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
4680 - for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
4681 - _version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
4682 - V_CHECK=`expr $_version_tmp \> $_version`
4683 - if test "$V_CHECK" = "1" ; then
4684 - _version=$_version_tmp
4685 - fi
4686 - VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
4687 - BOOST_CPPFLAGS="-I$ac_boost_path/include/boost-$VERSION_UNDERSCORE"
4688 - done
4689 - fi
4690 - else
4691 - if test "$cross_compiling" != yes; then
4692 - for ac_boost_path in /usr /usr/local /opt /opt/local ; do
4693 - if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
4694 - for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
4695 - _version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
4696 - V_CHECK=`expr $_version_tmp \> $_version`
4697 - if test "$V_CHECK" = "1" ; then
4698 - _version=$_version_tmp
4699 - best_path=$ac_boost_path
4700 - fi
4701 - done
4702 - fi
4703 - done
4704 -
4705 - VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
4706 - BOOST_CPPFLAGS="-I$best_path/include/boost-$VERSION_UNDERSCORE"
4707 - if test "$ac_boost_lib_path" = ""; then
4708 - for libsubdir in $libsubdirs ; do
4709 - if ls "$best_path/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
4710 - done
4711 - BOOST_LDFLAGS="-L$best_path/$libsubdir"
4712 - fi
4713 - fi
4714 -
4715 - if test "x$BOOST_ROOT" != "x"; then
4716 - for libsubdir in $libsubdirs ; do
4717 - if ls "$BOOST_ROOT/stage/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
4718 - done
4719 - if test -d "$BOOST_ROOT" && test -r "$BOOST_ROOT" && test -d "$BOOST_ROOT/stage/$libsubdir" && test -r "$BOOST_ROOT/stage/$libsubdir"; then
4720 - version_dir=`expr //$BOOST_ROOT : '.*/\(.*\)'`
4721 - stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'`
4722 - stage_version_shorten=`expr $stage_version : '\([[0-9]]*\.[[0-9]]*\)'`
4723 - V_CHECK=`expr $stage_version_shorten \>\= $_version`
4724 - if test "$V_CHECK" = "1" -a "$ac_boost_lib_path" = "" ; then
4725 - AC_MSG_NOTICE(We will use a staged boost library from $BOOST_ROOT)
4726 - BOOST_CPPFLAGS="-I$BOOST_ROOT"
4727 - BOOST_LDFLAGS="-L$BOOST_ROOT/stage/$libsubdir"
4728 - fi
4729 - fi
4730 - fi
4731 - fi
4732 -
4733 - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
4734 - export CPPFLAGS
4735 - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
4736 - export LDFLAGS
4737 -
4738 - AC_LANG_PUSH(C++)
4739 - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4740 - @%:@include <boost/version.hpp>
4741 - ]], [[
4742 - #if BOOST_VERSION >= $WANT_BOOST_VERSION
4743 - // Everything is okay
4744 - #else
4745 - # error Boost version is too old
4746 - #endif
4747 - ]])],[
4748 - AC_MSG_RESULT(yes)
4749 - succeeded=yes
4750 - found_system=yes
4751 - ],[
4752 - ])
4753 - AC_LANG_POP([C++])
4754 - fi
4755 -
4756 - if test "$succeeded" != "yes" ; then
4757 - if test "$_version" = "0" ; then
4758 - 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.]])
4759 - else
4760 - AC_MSG_NOTICE([Your boost libraries seems to old (version $_version).])
4761 - fi
4762 - # execute ACTION-IF-NOT-FOUND (if present):
4763 - ifelse([$3], , :, [$3])
4764 - else
4765 - AC_SUBST(BOOST_CPPFLAGS)
4766 - AC_SUBST(BOOST_LDFLAGS)
4767 - AC_DEFINE(HAVE_BOOST,,[define if the Boost library is available])
4768 - # execute ACTION-IF-FOUND (if present):
4769 - ifelse([$2], , :, [$2])
4770 - fi
4771 -
4772 - CPPFLAGS="$CPPFLAGS_SAVED"
4773 - LDFLAGS="$LDFLAGS_SAVED"
4774 -fi
4775 -
4776 -])
4777
4778 diff --git a/libbash-0.1/m4/ax_boost_filesystem.m4 b/libbash-0.1/m4/ax_boost_filesystem.m4
4779 deleted file mode 100644
4780 index 2a62da8..0000000
4781 --- a/libbash-0.1/m4/ax_boost_filesystem.m4
4782 +++ /dev/null
4783 @@ -1,118 +0,0 @@
4784 -# ===========================================================================
4785 -# http://www.gnu.org/software/autoconf-archive/ax_boost_filesystem.html
4786 -# ===========================================================================
4787 -#
4788 -# SYNOPSIS
4789 -#
4790 -# AX_BOOST_FILESYSTEM
4791 -#
4792 -# DESCRIPTION
4793 -#
4794 -# Test for Filesystem library from the Boost C++ libraries. The macro
4795 -# requires a preceding call to AX_BOOST_BASE. Further documentation is
4796 -# available at <http://randspringer.de/boost/index.html>.
4797 -#
4798 -# This macro calls:
4799 -#
4800 -# AC_SUBST(BOOST_FILESYSTEM_LIB)
4801 -#
4802 -# And sets:
4803 -#
4804 -# HAVE_BOOST_FILESYSTEM
4805 -#
4806 -# LICENSE
4807 -#
4808 -# Copyright (c) 2009 Thomas Porschberg <thomas@××××××××××××.de>
4809 -# Copyright (c) 2009 Michael Tindal
4810 -# Copyright (c) 2009 Roman Rybalko <libtorrent@××××××.info>
4811 -#
4812 -# Copying and distribution of this file, with or without modification, are
4813 -# permitted in any medium without royalty provided the copyright notice
4814 -# and this notice are preserved. This file is offered as-is, without any
4815 -# warranty.
4816 -
4817 -#serial 21
4818 -
4819 -AC_DEFUN([AX_BOOST_FILESYSTEM],
4820 -[
4821 - AC_ARG_WITH([boost-filesystem],
4822 - AS_HELP_STRING([--with-boost-filesystem@<:@=special-lib@:>@],
4823 - [use the Filesystem library from boost - it is possible to specify a certain library for the linker
4824 - e.g. --with-boost-filesystem=boost_filesystem-gcc-mt ]),
4825 - [
4826 - if test "$withval" = "no"; then
4827 - want_boost="no"
4828 - elif test "$withval" = "yes"; then
4829 - want_boost="yes"
4830 - ax_boost_user_filesystem_lib=""
4831 - else
4832 - want_boost="yes"
4833 - ax_boost_user_filesystem_lib="$withval"
4834 - fi
4835 - ],
4836 - [want_boost="yes"]
4837 - )
4838 -
4839 - if test "x$want_boost" = "xyes"; then
4840 - AC_REQUIRE([AC_PROG_CC])
4841 - CPPFLAGS_SAVED="$CPPFLAGS"
4842 - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
4843 - export CPPFLAGS
4844 -
4845 - LDFLAGS_SAVED="$LDFLAGS"
4846 - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
4847 - export LDFLAGS
4848 -
4849 - LIBS_SAVED=$LIBS
4850 - LIBS="$LIBS $BOOST_SYSTEM_LIB"
4851 - export LIBS
4852 -
4853 - AC_CACHE_CHECK(whether the Boost::Filesystem library is available,
4854 - ax_cv_boost_filesystem,
4855 - [AC_LANG_PUSH([C++])
4856 - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/filesystem/path.hpp>]],
4857 - [[using namespace boost::filesystem;
4858 - path my_path( "foo/bar/data.txt" );
4859 - return 0;]])],
4860 - ax_cv_boost_filesystem=yes, ax_cv_boost_filesystem=no)
4861 - AC_LANG_POP([C++])
4862 - ])
4863 - if test "x$ax_cv_boost_filesystem" = "xyes"; then
4864 - AC_DEFINE(HAVE_BOOST_FILESYSTEM,,[define if the Boost::Filesystem library is available])
4865 - BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
4866 - if test "x$ax_boost_user_filesystem_lib" = "x"; then
4867 - 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
4868 - ax_lib=${libextension}
4869 - AC_CHECK_LIB($ax_lib, exit,
4870 - [BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break],
4871 - [link_filesystem="no"])
4872 - done
4873 - if test "x$link_program_options" != "xyes"; then
4874 - 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
4875 - ax_lib=${libextension}
4876 - AC_CHECK_LIB($ax_lib, exit,
4877 - [BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break],
4878 - [link_filesystem="no"])
4879 - done
4880 - fi
4881 - else
4882 - for ax_lib in $ax_boost_user_filesystem_lib boost_filesystem-$ax_boost_user_filesystem_lib; do
4883 - AC_CHECK_LIB($ax_lib, exit,
4884 - [BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break],
4885 - [link_filesystem="no"])
4886 - done
4887 -
4888 - fi
4889 - if test "x$ax_lib" = "x"; then
4890 - AC_MSG_ERROR(Could not find a version of the library!)
4891 - fi
4892 - if test "x$link_filesystem" != "xyes"; then
4893 - AC_MSG_ERROR(Could not link against $ax_lib !)
4894 - fi
4895 - fi
4896 -
4897 - CPPFLAGS="$CPPFLAGS_SAVED"
4898 - LDFLAGS="$LDFLAGS_SAVED"
4899 - LIBS="$LIBS_SAVED"
4900 - fi
4901 -])
4902
4903 diff --git a/libbash-0.1/m4/ax_boost_program_options.m4 b/libbash-0.1/m4/ax_boost_program_options.m4
4904 deleted file mode 100644
4905 index d612f91..0000000
4906 --- a/libbash-0.1/m4/ax_boost_program_options.m4
4907 +++ /dev/null
4908 @@ -1,108 +0,0 @@
4909 -# ============================================================================
4910 -# http://www.gnu.org/software/autoconf-archive/ax_boost_program_options.html
4911 -# ============================================================================
4912 -#
4913 -# SYNOPSIS
4914 -#
4915 -# AX_BOOST_PROGRAM_OPTIONS
4916 -#
4917 -# DESCRIPTION
4918 -#
4919 -# Test for program options library from the Boost C++ libraries. The macro
4920 -# requires a preceding call to AX_BOOST_BASE. Further documentation is
4921 -# available at <http://randspringer.de/boost/index.html>.
4922 -#
4923 -# This macro calls:
4924 -#
4925 -# AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB)
4926 -#
4927 -# And sets:
4928 -#
4929 -# HAVE_BOOST_PROGRAM_OPTIONS
4930 -#
4931 -# LICENSE
4932 -#
4933 -# Copyright (c) 2009 Thomas Porschberg <thomas@××××××××××××.de>
4934 -#
4935 -# Copying and distribution of this file, with or without modification, are
4936 -# permitted in any medium without royalty provided the copyright notice
4937 -# and this notice are preserved. This file is offered as-is, without any
4938 -# warranty.
4939 -
4940 -#serial 20
4941 -
4942 -AC_DEFUN([AX_BOOST_PROGRAM_OPTIONS],
4943 -[
4944 - AC_ARG_WITH([boost-program-options],
4945 - AS_HELP_STRING([--with-boost-program-options@<:@=special-lib@:>@],
4946 - [use the program options library from boost - it is possible to specify a certain library for the linker
4947 - e.g. --with-boost-program-options=boost_program_options-gcc-mt-1_33_1 ]),
4948 - [
4949 - if test "$withval" = "no"; then
4950 - want_boost="no"
4951 - elif test "$withval" = "yes"; then
4952 - want_boost="yes"
4953 - ax_boost_user_program_options_lib=""
4954 - else
4955 - want_boost="yes"
4956 - ax_boost_user_program_options_lib="$withval"
4957 - fi
4958 - ],
4959 - [want_boost="yes"]
4960 - )
4961 -
4962 - if test "x$want_boost" = "xyes"; then
4963 - AC_REQUIRE([AC_PROG_CC])
4964 - export want_boost
4965 - CPPFLAGS_SAVED="$CPPFLAGS"
4966 - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
4967 - export CPPFLAGS
4968 - LDFLAGS_SAVED="$LDFLAGS"
4969 - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
4970 - export LDFLAGS
4971 - AC_CACHE_CHECK([whether the Boost::Program_Options library is available],
4972 - ax_cv_boost_program_options,
4973 - [AC_LANG_PUSH(C++)
4974 - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/program_options.hpp>
4975 - ]],
4976 - [[boost::program_options::options_description generic("Generic options");
4977 - return 0;]])],
4978 - ax_cv_boost_program_options=yes, ax_cv_boost_program_options=no)
4979 - AC_LANG_POP([C++])
4980 - ])
4981 - if test "$ax_cv_boost_program_options" = yes; then
4982 - AC_DEFINE(HAVE_BOOST_PROGRAM_OPTIONS,,[define if the Boost::PROGRAM_OPTIONS library is available])
4983 - BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
4984 - if test "x$ax_boost_user_program_options_lib" = "x"; then
4985 - 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
4986 - ax_lib=${libextension}
4987 - AC_CHECK_LIB($ax_lib, exit,
4988 - [BOOST_PROGRAM_OPTIONS_LIB="-l$ax_lib"; AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB) link_program_options="yes"; break],
4989 - [link_program_options="no"])
4990 - done
4991 - if test "x$link_program_options" != "xyes"; then
4992 - 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
4993 - ax_lib=${libextension}
4994 - AC_CHECK_LIB($ax_lib, exit,
4995 - [BOOST_PROGRAM_OPTIONS_LIB="-l$ax_lib"; AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB) link_program_options="yes"; break],
4996 - [link_program_options="no"])
4997 - done
4998 - fi
4999 - else
5000 - for ax_lib in $ax_boost_user_program_options_lib boost_program_options-$ax_boost_user_program_options_lib; do
5001 - AC_CHECK_LIB($ax_lib, main,
5002 - [BOOST_PROGRAM_OPTIONS_LIB="-l$ax_lib"; AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB) link_program_options="yes"; break],
5003 - [link_program_options="no"])
5004 - done
5005 - fi
5006 - if test "x$ax_lib" = "x"; then
5007 - AC_MSG_ERROR(Could not find a version of the library!)
5008 - fi
5009 - if test "x$link_program_options" != "xyes"; then
5010 - AC_MSG_ERROR([Could not link against [$ax_lib] !])
5011 - fi
5012 - fi
5013 - CPPFLAGS="$CPPFLAGS_SAVED"
5014 - LDFLAGS="$LDFLAGS_SAVED"
5015 - fi
5016 -])
5017
5018 diff --git a/libbash-0.1/m4/ax_boost_system.m4 b/libbash-0.1/m4/ax_boost_system.m4
5019 deleted file mode 100644
5020 index 7fbf6d3..0000000
5021 --- a/libbash-0.1/m4/ax_boost_system.m4
5022 +++ /dev/null
5023 @@ -1,120 +0,0 @@
5024 -# ===========================================================================
5025 -# http://www.gnu.org/software/autoconf-archive/ax_boost_system.html
5026 -# ===========================================================================
5027 -#
5028 -# SYNOPSIS
5029 -#
5030 -# AX_BOOST_SYSTEM
5031 -#
5032 -# DESCRIPTION
5033 -#
5034 -# Test for System library from the Boost C++ libraries. The macro requires
5035 -# a preceding call to AX_BOOST_BASE. Further documentation is available at
5036 -# <http://randspringer.de/boost/index.html>.
5037 -#
5038 -# This macro calls:
5039 -#
5040 -# AC_SUBST(BOOST_SYSTEM_LIB)
5041 -#
5042 -# And sets:
5043 -#
5044 -# HAVE_BOOST_SYSTEM
5045 -#
5046 -# LICENSE
5047 -#
5048 -# Copyright (c) 2008 Thomas Porschberg <thomas@××××××××××××.de>
5049 -# Copyright (c) 2008 Michael Tindal
5050 -# Copyright (c) 2008 Daniel Casimiro <dan.casimiro@×××××.com>
5051 -#
5052 -# Copying and distribution of this file, with or without modification, are
5053 -# permitted in any medium without royalty provided the copyright notice
5054 -# and this notice are preserved. This file is offered as-is, without any
5055 -# warranty.
5056 -
5057 -#serial 14
5058 -
5059 -AC_DEFUN([AX_BOOST_SYSTEM],
5060 -[
5061 - AC_ARG_WITH([boost-system],
5062 - AS_HELP_STRING([--with-boost-system@<:@=special-lib@:>@],
5063 - [use the System library from boost - it is possible to specify a certain library for the linker
5064 - e.g. --with-boost-system=boost_system-gcc-mt ]),
5065 - [
5066 - if test "$withval" = "no"; then
5067 - want_boost="no"
5068 - elif test "$withval" = "yes"; then
5069 - want_boost="yes"
5070 - ax_boost_user_system_lib=""
5071 - else
5072 - want_boost="yes"
5073 - ax_boost_user_system_lib="$withval"
5074 - fi
5075 - ],
5076 - [want_boost="yes"]
5077 - )
5078 -
5079 - if test "x$want_boost" = "xyes"; then
5080 - AC_REQUIRE([AC_PROG_CC])
5081 - AC_REQUIRE([AC_CANONICAL_BUILD])
5082 - CPPFLAGS_SAVED="$CPPFLAGS"
5083 - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
5084 - export CPPFLAGS
5085 -
5086 - LDFLAGS_SAVED="$LDFLAGS"
5087 - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
5088 - export LDFLAGS
5089 -
5090 - AC_CACHE_CHECK(whether the Boost::System library is available,
5091 - ax_cv_boost_system,
5092 - [AC_LANG_PUSH([C++])
5093 - CXXFLAGS_SAVE=$CXXFLAGS
5094 -
5095 - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/system/error_code.hpp>]],
5096 - [[boost::system::system_category]])],
5097 - ax_cv_boost_system=yes, ax_cv_boost_system=no)
5098 - CXXFLAGS=$CXXFLAGS_SAVE
5099 - AC_LANG_POP([C++])
5100 - ])
5101 - if test "x$ax_cv_boost_system" = "xyes"; then
5102 - AC_SUBST(BOOST_CPPFLAGS)
5103 -
5104 - AC_DEFINE(HAVE_BOOST_SYSTEM,,[define if the Boost::System library is available])
5105 - BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
5106 -
5107 - LDFLAGS_SAVE=$LDFLAGS
5108 - if test "x$ax_boost_user_system_lib" = "x"; then
5109 - 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
5110 - ax_lib=${libextension}
5111 - AC_CHECK_LIB($ax_lib, exit,
5112 - [BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break],
5113 - [link_system="no"])
5114 - done
5115 - if test "x$link_system" != "xyes"; then
5116 - 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
5117 - ax_lib=${libextension}
5118 - AC_CHECK_LIB($ax_lib, exit,
5119 - [BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break],
5120 - [link_system="no"])
5121 - done
5122 - fi
5123 -
5124 - else
5125 - for ax_lib in $ax_boost_user_system_lib boost_system-$ax_boost_user_system_lib; do
5126 - AC_CHECK_LIB($ax_lib, exit,
5127 - [BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break],
5128 - [link_system="no"])
5129 - done
5130 -
5131 - fi
5132 - if test "x$ax_lib" = "x"; then
5133 - AC_MSG_ERROR(Could not find a version of the library!)
5134 - fi
5135 - if test "x$link_system" = "xno"; then
5136 - AC_MSG_ERROR(Could not link against $ax_lib !)
5137 - fi
5138 - fi
5139 -
5140 - CPPFLAGS="$CPPFLAGS_SAVED"
5141 - LDFLAGS="$LDFLAGS_SAVED"
5142 - fi
5143 -])
5144
5145 diff --git a/libbash-0.1/m4/doxample.m4 b/libbash-0.1/m4/doxample.m4
5146 deleted file mode 100644
5147 index d9a951c..0000000
5148 --- a/libbash-0.1/m4/doxample.m4
5149 +++ /dev/null
5150 @@ -1,321 +0,0 @@
5151 -# This file is part of Autoconf. -*- Autoconf -*-
5152 -
5153 -# Copyright (C) 2004 Oren Ben-Kiki
5154 -# This file is distributed under the same terms as the Autoconf macro files.
5155 -
5156 -########## CHANGELOG ##################
5157 -# 2009-01-14 Martin Mann
5158 -# * DX_ARG_ABLE : new variable 'DX_FLAG_DX_CURRENT_FEATURE'
5159 -# * DX_CLEAR_DEPEND : use of explicit variable 'DX_FLAG_DX_CURRENT_FEATURE'
5160 -# in AC_SUBST instead of 'DX_FLAG[]DX_CURRENT_FEATURE' which is rejected by
5161 -# newer autotools
5162 -
5163 -# Generate automatic documentation using Doxygen. Works in concert with the
5164 -# aminclude.m4 file and a compatible doxygen configuration file. Defines the
5165 -# following public macros:
5166 -#
5167 -# DX_???_FEATURE(ON|OFF) - control the default setting fo a Doxygen feature.
5168 -# Supported features are 'DOXYGEN' itself, 'DOT' for generating graphics,
5169 -# 'HTML' for plain HTML, 'CHM' for compressed HTML help (for MS users), 'CHI'
5170 -# for generating a seperate .chi file by the .chm file, and 'MAN', 'RTF',
5171 -# 'XML', 'PDF' and 'PS' for the appropriate output formats. The environment
5172 -# variable DOXYGEN_PAPER_SIZE may be specified to override the default 'a4wide'
5173 -# paper size.
5174 -#
5175 -# By default, HTML, PDF and PS documentation is generated as this seems to be
5176 -# the most popular and portable combination. MAN pages created by Doxygen are
5177 -# usually problematic, though by picking an appropriate subset and doing some
5178 -# massaging they might be better than nothing. CHM and RTF are specific for MS
5179 -# (note that you can't generate both HTML and CHM at the same time). The XML is
5180 -# rather useless unless you apply specialized post-processing to it.
5181 -#
5182 -# The macro mainly controls the default state of the feature. The use can
5183 -# override the default by specifying --enable or --disable. The macros ensure
5184 -# that contradictory flags are not given (e.g., --enable-doxygen-html and
5185 -# --enable-doxygen-chm, --enable-doxygen-anything with --disable-doxygen, etc.)
5186 -# Finally, each feature will be automatically disabled (with a warning) if the
5187 -# required programs are missing.
5188 -#
5189 -# Once all the feature defaults have been specified, call DX_INIT_DOXYGEN with
5190 -# the following parameters: a one-word name for the project for use as a
5191 -# filename base etc., an optional configuration file name (the default is
5192 -# 'Doxyfile', the same as Doxygen's default), and an optional output directory
5193 -# name (the default is 'doxygen-doc').
5194 -
5195 -## ----------##
5196 -## Defaults. ##
5197 -## ----------##
5198 -
5199 -DX_ENV=""
5200 -AC_DEFUN([DX_FEATURE_doc], ON)
5201 -AC_DEFUN([DX_FEATURE_dot], ON)
5202 -AC_DEFUN([DX_FEATURE_man], OFF)
5203 -AC_DEFUN([DX_FEATURE_html], ON)
5204 -AC_DEFUN([DX_FEATURE_chm], OFF)
5205 -AC_DEFUN([DX_FEATURE_chi], OFF)
5206 -AC_DEFUN([DX_FEATURE_rtf], OFF)
5207 -AC_DEFUN([DX_FEATURE_xml], OFF)
5208 -AC_DEFUN([DX_FEATURE_pdf], ON)
5209 -AC_DEFUN([DX_FEATURE_ps], ON)
5210 -
5211 -## --------------- ##
5212 -## Private macros. ##
5213 -## --------------- ##
5214 -
5215 -# DX_ENV_APPEND(VARIABLE, VALUE)
5216 -# ------------------------------
5217 -# Append VARIABLE="VALUE" to DX_ENV for invoking doxygen.
5218 -AC_DEFUN([DX_ENV_APPEND], [AC_SUBST([DX_ENV], ["$DX_ENV $1='$2'"])])
5219 -
5220 -# DX_DIRNAME_EXPR
5221 -# ---------------
5222 -# Expand into a shell expression prints the directory part of a path.
5223 -AC_DEFUN([DX_DIRNAME_EXPR],
5224 - [[expr ".$1" : '\(\.\)[^/]*$' \| "x$1" : 'x\(.*\)/[^/]*$']])
5225 -
5226 -# DX_IF_FEATURE(FEATURE, IF-ON, IF-OFF)
5227 -# -------------------------------------
5228 -# Expands according to the M4 (static) status of the feature.
5229 -AC_DEFUN([DX_IF_FEATURE], [ifelse(DX_FEATURE_$1, ON, [$2], [$3])])
5230 -
5231 -# DX_REQUIRE_PROG(VARIABLE, PROGRAM)
5232 -# ----------------------------------
5233 -# Require the specified program to be found for the DX_CURRENT_FEATURE to work.
5234 -AC_DEFUN([DX_REQUIRE_PROG], [
5235 -AC_PATH_TOOL([$1], [$2])
5236 -if test "$DX_FLAG_DX_CURRENT_FEATURE$$1" = 1; then
5237 - AC_MSG_WARN([$2 not found - will not DX_CURRENT_DESCRIPTION])
5238 - AC_SUBST([DX_FLAG_DX_CURRENT_FEATURE], 0)
5239 -fi
5240 -])
5241 -
5242 -# DX_TEST_FEATURE(FEATURE)
5243 -# ------------------------
5244 -# Expand to a shell expression testing whether the feature is active.
5245 -AC_DEFUN([DX_TEST_FEATURE], [test "$DX_FLAG_$1" = 1])
5246 -
5247 -# DX_CHECK_DEPEND(REQUIRED_FEATURE, REQUIRED_STATE)
5248 -# -------------------------------------------------
5249 -# Verify that a required features has the right state before trying to turn on
5250 -# the DX_CURRENT_FEATURE.
5251 -AC_DEFUN([DX_CHECK_DEPEND], [
5252 -test "$DX_FLAG_$1" = "$2" \
5253 -|| AC_MSG_ERROR([doxygen-DX_CURRENT_FEATURE ifelse([$2], 1,
5254 - requires, contradicts) doxygen-DX_CURRENT_FEATURE])
5255 -])
5256 -
5257 -# DX_CLEAR_DEPEND(FEATURE, REQUIRED_FEATURE, REQUIRED_STATE)
5258 -# ----------------------------------------------------------
5259 -# Turn off the DX_CURRENT_FEATURE if the required feature is off.
5260 -AC_DEFUN([DX_CLEAR_DEPEND], [
5261 -test "$DX_FLAG_$1" = "$2" || AC_SUBST([DX_FLAG_DX_CURRENT_FEATURE], 0)
5262 -])
5263 -
5264 -
5265 -# DX_FEATURE_ARG(FEATURE, DESCRIPTION,
5266 -# CHECK_DEPEND, CLEAR_DEPEND,
5267 -# REQUIRE, DO-IF-ON, DO-IF-OFF)
5268 -# --------------------------------------------
5269 -# Parse the command-line option controlling a feature. CHECK_DEPEND is called
5270 -# if the user explicitly turns the feature on (and invokes DX_CHECK_DEPEND),
5271 -# otherwise CLEAR_DEPEND is called to turn off the default state if a required
5272 -# feature is disabled (using DX_CLEAR_DEPEND). REQUIRE performs additional
5273 -# requirement tests (DX_REQUIRE_PROG). Finally, an automake flag is set and
5274 -# DO-IF-ON or DO-IF-OFF are called according to the final state of the feature.
5275 -AC_DEFUN([DX_ARG_ABLE], [
5276 - AC_DEFUN([DX_CURRENT_FEATURE], [$1])
5277 - AC_DEFUN([DX_FLAG_DX_CURRENT_FEATURE], [DX_FLAG_$1])
5278 - AC_DEFUN([DX_CURRENT_DESCRIPTION], [$2])
5279 - AC_ARG_ENABLE(doxygen-$1,
5280 - [AS_HELP_STRING(DX_IF_FEATURE([$1], [--disable-doxygen-$1],
5281 - [--enable-doxygen-$1]),
5282 - DX_IF_FEATURE([$1], [don't $2], [$2]))],
5283 - [
5284 -case "$enableval" in
5285 -#(
5286 -y|Y|yes|Yes|YES)
5287 - AC_SUBST([DX_FLAG_$1], 1)
5288 - $3
5289 -;; #(
5290 -n|N|no|No|NO)
5291 - AC_SUBST([DX_FLAG_$1], 0)
5292 -;; #(
5293 -*)
5294 - AC_MSG_ERROR([invalid value '$enableval' given to doxygen-$1])
5295 -;;
5296 -esac
5297 -], [
5298 -AC_SUBST([DX_FLAG_$1], [DX_IF_FEATURE([$1], 1, 0)])
5299 -$4
5300 -])
5301 -if DX_TEST_FEATURE([$1]); then
5302 - $5
5303 - :
5304 -fi
5305 -if DX_TEST_FEATURE([$1]); then
5306 - AM_CONDITIONAL(DX_COND_$1, :)
5307 - $6
5308 - :
5309 -else
5310 - AM_CONDITIONAL(DX_COND_$1, false)
5311 - $7
5312 - :
5313 -fi
5314 -])
5315 -
5316 -## -------------- ##
5317 -## Public macros. ##
5318 -## -------------- ##
5319 -
5320 -# DX_XXX_FEATURE(DEFAULT_STATE)
5321 -# -----------------------------
5322 -AC_DEFUN([DX_DOXYGEN_FEATURE], [AC_DEFUN([DX_FEATURE_doc], [$1])])
5323 -AC_DEFUN([DX_MAN_FEATURE], [AC_DEFUN([DX_FEATURE_man], [$1])])
5324 -AC_DEFUN([DX_HTML_FEATURE], [AC_DEFUN([DX_FEATURE_html], [$1])])
5325 -AC_DEFUN([DX_CHM_FEATURE], [AC_DEFUN([DX_FEATURE_chm], [$1])])
5326 -AC_DEFUN([DX_CHI_FEATURE], [AC_DEFUN([DX_FEATURE_chi], [$1])])
5327 -AC_DEFUN([DX_RTF_FEATURE], [AC_DEFUN([DX_FEATURE_rtf], [$1])])
5328 -AC_DEFUN([DX_XML_FEATURE], [AC_DEFUN([DX_FEATURE_xml], [$1])])
5329 -AC_DEFUN([DX_XML_FEATURE], [AC_DEFUN([DX_FEATURE_xml], [$1])])
5330 -AC_DEFUN([DX_PDF_FEATURE], [AC_DEFUN([DX_FEATURE_pdf], [$1])])
5331 -AC_DEFUN([DX_PS_FEATURE], [AC_DEFUN([DX_FEATURE_ps], [$1])])
5332 -
5333 -# DX_INIT_DOXYGEN(PROJECT, [CONFIG-FILE], [OUTPUT-DOC-DIR])
5334 -# ---------------------------------------------------------
5335 -# PROJECT also serves as the base name for the documentation files.
5336 -# The default CONFIG-FILE is "Doxyfile" and OUTPUT-DOC-DIR is "doxygen-doc".
5337 -AC_DEFUN([DX_INIT_DOXYGEN], [
5338 -
5339 -# Files:
5340 -AC_SUBST([DX_PROJECT], [$1])
5341 -AC_SUBST([DX_CONFIG], [ifelse([$2], [], Doxyfile, [$2])])
5342 -AC_SUBST([DX_DOCDIR], [ifelse([$3], [], doxygen-doc, [$3])])
5343 -
5344 -# Environment variables used inside doxygen.cfg:
5345 -DX_ENV_APPEND(SRCDIR, $srcdir)
5346 -DX_ENV_APPEND(PROJECT, $DX_PROJECT)
5347 -DX_ENV_APPEND(DOCDIR, $DX_DOCDIR)
5348 -DX_ENV_APPEND(VERSION, $PACKAGE_VERSION)
5349 -
5350 -# Doxygen itself:
5351 -DX_ARG_ABLE(doc, [generate any doxygen documentation],
5352 - [],
5353 - [],
5354 - [DX_REQUIRE_PROG([DX_DOXYGEN], doxygen)
5355 - DX_REQUIRE_PROG([DX_PERL], perl)],
5356 - [DX_ENV_APPEND(PERL_PATH, $DX_PERL)])
5357 -
5358 -# Dot for graphics:
5359 -DX_ARG_ABLE(dot, [generate graphics for doxygen documentation],
5360 - [DX_CHECK_DEPEND(doc, 1)],
5361 - [DX_CLEAR_DEPEND(doc, 1)],
5362 - [DX_REQUIRE_PROG([DX_DOT], dot)],
5363 - [DX_ENV_APPEND(HAVE_DOT, YES)
5364 - DX_ENV_APPEND(DOT_PATH, [`DX_DIRNAME_EXPR($DX_DOT)`])],
5365 - [DX_ENV_APPEND(HAVE_DOT, NO)])
5366 -
5367 -# Man pages generation:
5368 -DX_ARG_ABLE(man, [generate doxygen manual pages],
5369 - [DX_CHECK_DEPEND(doc, 1)],
5370 - [DX_CLEAR_DEPEND(doc, 1)],
5371 - [],
5372 - [DX_ENV_APPEND(GENERATE_MAN, YES)],
5373 - [DX_ENV_APPEND(GENERATE_MAN, NO)])
5374 -
5375 -# RTF file generation:
5376 -DX_ARG_ABLE(rtf, [generate doxygen RTF documentation],
5377 - [DX_CHECK_DEPEND(doc, 1)],
5378 - [DX_CLEAR_DEPEND(doc, 1)],
5379 - [],
5380 - [DX_ENV_APPEND(GENERATE_RTF, YES)],
5381 - [DX_ENV_APPEND(GENERATE_RTF, NO)])
5382 -
5383 -# XML file generation:
5384 -DX_ARG_ABLE(xml, [generate doxygen XML documentation],
5385 - [DX_CHECK_DEPEND(doc, 1)],
5386 - [DX_CLEAR_DEPEND(doc, 1)],
5387 - [],
5388 - [DX_ENV_APPEND(GENERATE_XML, YES)],
5389 - [DX_ENV_APPEND(GENERATE_XML, NO)])
5390 -
5391 -# (Compressed) HTML help generation:
5392 -DX_ARG_ABLE(chm, [generate doxygen compressed HTML help documentation],
5393 - [DX_CHECK_DEPEND(doc, 1)],
5394 - [DX_CLEAR_DEPEND(doc, 1)],
5395 - [DX_REQUIRE_PROG([DX_HHC], hhc)],
5396 - [DX_ENV_APPEND(HHC_PATH, $DX_HHC)
5397 - DX_ENV_APPEND(GENERATE_HTML, YES)
5398 - DX_ENV_APPEND(GENERATE_HTMLHELP, YES)],
5399 - [DX_ENV_APPEND(GENERATE_HTMLHELP, NO)])
5400 -
5401 -# Seperate CHI file generation.
5402 -DX_ARG_ABLE(chi, [generate doxygen seperate compressed HTML help index file],
5403 - [DX_CHECK_DEPEND(chm, 1)],
5404 - [DX_CLEAR_DEPEND(chm, 1)],
5405 - [],
5406 - [DX_ENV_APPEND(GENERATE_CHI, YES)],
5407 - [DX_ENV_APPEND(GENERATE_CHI, NO)])
5408 -
5409 -# Plain HTML pages generation:
5410 -DX_ARG_ABLE(html, [generate doxygen plain HTML documentation],
5411 - [DX_CHECK_DEPEND(doc, 1) DX_CHECK_DEPEND(chm, 0)],
5412 - [DX_CLEAR_DEPEND(doc, 1) DX_CLEAR_DEPEND(chm, 0)],
5413 - [],
5414 - [DX_ENV_APPEND(GENERATE_HTML, YES)],
5415 - [DX_TEST_FEATURE(chm) || DX_ENV_APPEND(GENERATE_HTML, NO)])
5416 -
5417 -# PostScript file generation:
5418 -DX_ARG_ABLE(ps, [generate doxygen PostScript documentation],
5419 - [DX_CHECK_DEPEND(doc, 1)],
5420 - [DX_CLEAR_DEPEND(doc, 1)],
5421 - [DX_REQUIRE_PROG([DX_LATEX], latex)
5422 - DX_REQUIRE_PROG([DX_MAKEINDEX], makeindex)
5423 - DX_REQUIRE_PROG([DX_DVIPS], dvips)
5424 - DX_REQUIRE_PROG([DX_EGREP], egrep)])
5425 -
5426 -# PDF file generation:
5427 -DX_ARG_ABLE(pdf, [generate doxygen PDF documentation],
5428 - [DX_CHECK_DEPEND(doc, 1)],
5429 - [DX_CLEAR_DEPEND(doc, 1)],
5430 - [DX_REQUIRE_PROG([DX_PDFLATEX], pdflatex)
5431 - DX_REQUIRE_PROG([DX_MAKEINDEX], makeindex)
5432 - DX_REQUIRE_PROG([DX_EGREP], egrep)])
5433 -
5434 -# LaTeX generation for PS and/or PDF:
5435 -if DX_TEST_FEATURE(ps) || DX_TEST_FEATURE(pdf); then
5436 - AM_CONDITIONAL(DX_COND_latex, :)
5437 - DX_ENV_APPEND(GENERATE_LATEX, YES)
5438 -else
5439 - AM_CONDITIONAL(DX_COND_latex, false)
5440 - DX_ENV_APPEND(GENERATE_LATEX, NO)
5441 -fi
5442 -
5443 -# Paper size for PS and/or PDF:
5444 -AC_ARG_VAR(DOXYGEN_PAPER_SIZE,
5445 - [a4wide (default), a4, letter, legal or executive])
5446 -case "$DOXYGEN_PAPER_SIZE" in
5447 -#(
5448 -"")
5449 - AC_SUBST(DOXYGEN_PAPER_SIZE, "")
5450 -;; #(
5451 -a4wide|a4|letter|legal|executive)
5452 - DX_ENV_APPEND(PAPER_SIZE, $DOXYGEN_PAPER_SIZE)
5453 -;; #(
5454 -*)
5455 - AC_MSG_ERROR([unknown DOXYGEN_PAPER_SIZE='$DOXYGEN_PAPER_SIZE'])
5456 -;;
5457 -esac
5458 -
5459 -#For debugging:
5460 -#echo DX_FLAG_doc=$DX_FLAG_doc
5461 -#echo DX_FLAG_dot=$DX_FLAG_dot
5462 -#echo DX_FLAG_man=$DX_FLAG_man
5463 -#echo DX_FLAG_html=$DX_FLAG_html
5464 -#echo DX_FLAG_chm=$DX_FLAG_chm
5465 -#echo DX_FLAG_chi=$DX_FLAG_chi
5466 -#echo DX_FLAG_rtf=$DX_FLAG_rtf
5467 -#echo DX_FLAG_xml=$DX_FLAG_xml
5468 -#echo DX_FLAG_pdf=$DX_FLAG_pdf
5469 -#echo DX_FLAG_ps=$DX_FLAG_ps
5470 -#echo DX_ENV=$DX_ENV
5471 -])
5472
5473 diff --git a/libbash-0.1/m4/gtest.m4 b/libbash-0.1/m4/gtest.m4
5474 deleted file mode 100644
5475 index e96650b..0000000
5476 --- a/libbash-0.1/m4/gtest.m4
5477 +++ /dev/null
5478 @@ -1,74 +0,0 @@
5479 -dnl GTEST_LIB_CHECK([minimum version [,
5480 -dnl action if found [,action if not found]]])
5481 -dnl
5482 -dnl Check for the presence of the Google Test library, optionally at a minimum
5483 -dnl version, and indicate a viable version with the HAVE_GTEST flag. It defines
5484 -dnl standard variables for substitution including GTEST_CPPFLAGS,
5485 -dnl GTEST_CXXFLAGS, GTEST_LDFLAGS, and GTEST_LIBS. It also defines
5486 -dnl GTEST_VERSION as the version of Google Test found. Finally, it provides
5487 -dnl optional custom action slots in the event GTEST is found or not.
5488 -AC_DEFUN([GTEST_LIB_CHECK],
5489 -[
5490 -dnl Provide a flag to enable or disable Google Test usage.
5491 -AC_ARG_ENABLE([gtest],
5492 - [AS_HELP_STRING([--enable-gtest],
5493 - [Enable tests using the Google C++ Testing Framework.
5494 - (Default is enabled.)])],
5495 - [],
5496 - [enable_gtest=yes])
5497 -AC_ARG_VAR([GTEST_CONFIG],
5498 - [The exact path of Google Test's 'gtest-config' script.])
5499 -AC_ARG_VAR([GTEST_CPPFLAGS],
5500 - [C-like preprocessor flags for Google Test.])
5501 -AC_ARG_VAR([GTEST_CXXFLAGS],
5502 - [C++ compile flags for Google Test.])
5503 -AC_ARG_VAR([GTEST_LDFLAGS],
5504 - [Linker path and option flags for Google Test.])
5505 -AC_ARG_VAR([GTEST_LIBS],
5506 - [Library linking flags for Google Test.])
5507 -AC_ARG_VAR([GTEST_VERSION],
5508 - [The version of Google Test available.])
5509 -HAVE_GTEST="no"
5510 -AS_IF([test "x${enable_gtest}" != "xno"],
5511 - [AC_MSG_CHECKING([for 'gtest-config'])
5512 - AS_IF([test "x${enable_gtest}" != "xyes"],
5513 - [AS_IF([test -x "${enable_gtest}/scripts/gtest-config"],
5514 - [GTEST_CONFIG="${enable_gtest}/scripts/gtest-config"],
5515 - [GTEST_CONFIG="${enable_gtest}/bin/gtest-config"])
5516 - AS_IF([test -x "${GTEST_CONFIG}"], [],
5517 - [AC_MSG_RESULT([no])
5518 - AC_MSG_ERROR([dnl
5519 -Unable to locate either a built or installed Google Test.
5520 -The specific location '${enable_gtest}' was provided for a built or installed
5521 -Google Test, but no 'gtest-config' script could be found at this location.])
5522 - ])],
5523 - [AC_PATH_PROG([GTEST_CONFIG], [gtest-config])])
5524 - AS_IF([test -x "${GTEST_CONFIG}"],
5525 - [AC_MSG_RESULT([${GTEST_CONFIG}])
5526 - m4_ifval([$1],
5527 - [_gtest_min_version="--min-version=$1"
5528 - AC_MSG_CHECKING([for Google Test at least version >= $1])],
5529 - [_gtest_min_version="--min-version=0"
5530 - AC_MSG_CHECKING([for Google Test])])
5531 - AS_IF([${GTEST_CONFIG} ${_gtest_min_version}],
5532 - [AC_MSG_RESULT([yes])
5533 - HAVE_GTEST='yes'],
5534 - [AC_MSG_RESULT([no])])],
5535 - [AC_MSG_RESULT([no])])
5536 - AS_IF([test "x${HAVE_GTEST}" = "xyes"],
5537 - [GTEST_CPPFLAGS=`${GTEST_CONFIG} --cppflags`
5538 - GTEST_CXXFLAGS=`${GTEST_CONFIG} --cxxflags`
5539 - GTEST_LDFLAGS=`${GTEST_CONFIG} --ldflags`
5540 - GTEST_LIBS=`${GTEST_CONFIG} --libs`
5541 - GTEST_VERSION=`${GTEST_CONFIG} --version`
5542 - AC_DEFINE([HAVE_GTEST],[1],[Defined when Google Test is available.])],
5543 - [AS_IF([test "x${enable_gtest}" = "xyes"],
5544 - [AC_MSG_ERROR([dnl
5545 -Google Test was enabled, but no viable version could be found.])
5546 - ])])])
5547 -AC_SUBST([HAVE_GTEST])
5548 -AM_CONDITIONAL([HAVE_GTEST],[test "x$HAVE_GTEST" = "xyes"])
5549 -AS_IF([test "x$HAVE_GTEST" = "xyes"],
5550 - [m4_ifval([$2], [$2])],
5551 - [m4_ifval([$3], [$3])])
5552 -])
5553
5554 diff --git a/libbash-0.1/m4/libtool.m4 b/libbash-0.1/m4/libtool.m4
5555 deleted file mode 100644
5556 index 2f1f49e..0000000
5557 --- a/libbash-0.1/m4/libtool.m4
5558 +++ /dev/null
5559 @@ -1,7450 +0,0 @@
5560 -# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
5561 -#
5562 -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
5563 -# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
5564 -# Inc.
5565 -# Written by Gordon Matzigkeit, 1996
5566 -#
5567 -# This file is free software; the Free Software Foundation gives
5568 -# unlimited permission to copy and/or distribute it, with or without
5569 -# modifications, as long as this notice is preserved.
5570 -
5571 -m4_define([_LT_COPYING], [dnl
5572 -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
5573 -# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
5574 -# Inc.
5575 -# Written by Gordon Matzigkeit, 1996
5576 -#
5577 -# This file is part of GNU Libtool.
5578 -#
5579 -# GNU Libtool is free software; you can redistribute it and/or
5580 -# modify it under the terms of the GNU General Public License as
5581 -# published by the Free Software Foundation; either version 2 of
5582 -# the License, or (at your option) any later version.
5583 -#
5584 -# As a special exception to the GNU General Public License,
5585 -# if you distribute this file as part of a program or library that
5586 -# is built using GNU Libtool, you may include this file under the
5587 -# same distribution terms that you use for the rest of that program.
5588 -#
5589 -# GNU Libtool is distributed in the hope that it will be useful,
5590 -# but WITHOUT ANY WARRANTY; without even the implied warranty of
5591 -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5592 -# GNU General Public License for more details.
5593 -#
5594 -# You should have received a copy of the GNU General Public License
5595 -# along with GNU Libtool; see the file COPYING. If not, a copy
5596 -# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
5597 -# obtained by writing to the Free Software Foundation, Inc.,
5598 -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
5599 -])
5600 -
5601 -# serial 57 LT_INIT
5602 -
5603 -
5604 -# LT_PREREQ(VERSION)
5605 -# ------------------
5606 -# Complain and exit if this libtool version is less that VERSION.
5607 -m4_defun([LT_PREREQ],
5608 -[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
5609 - [m4_default([$3],
5610 - [m4_fatal([Libtool version $1 or higher is required],
5611 - 63)])],
5612 - [$2])])
5613 -
5614 -
5615 -# _LT_CHECK_BUILDDIR
5616 -# ------------------
5617 -# Complain if the absolute build directory name contains unusual characters
5618 -m4_defun([_LT_CHECK_BUILDDIR],
5619 -[case `pwd` in
5620 - *\ * | *\ *)
5621 - AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
5622 -esac
5623 -])
5624 -
5625 -
5626 -# LT_INIT([OPTIONS])
5627 -# ------------------
5628 -AC_DEFUN([LT_INIT],
5629 -[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
5630 -AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
5631 -AC_BEFORE([$0], [LT_LANG])dnl
5632 -AC_BEFORE([$0], [LT_OUTPUT])dnl
5633 -AC_BEFORE([$0], [LTDL_INIT])dnl
5634 -m4_require([_LT_CHECK_BUILDDIR])dnl
5635 -
5636 -dnl Autoconf doesn't catch unexpanded LT_ macros by default:
5637 -m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
5638 -m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
5639 -dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
5640 -dnl unless we require an AC_DEFUNed macro:
5641 -AC_REQUIRE([LTOPTIONS_VERSION])dnl
5642 -AC_REQUIRE([LTSUGAR_VERSION])dnl
5643 -AC_REQUIRE([LTVERSION_VERSION])dnl
5644 -AC_REQUIRE([LTOBSOLETE_VERSION])dnl
5645 -m4_require([_LT_PROG_LTMAIN])dnl
5646 -
5647 -_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
5648 -
5649 -dnl Parse OPTIONS
5650 -_LT_SET_OPTIONS([$0], [$1])
5651 -
5652 -# This can be used to rebuild libtool when needed
5653 -LIBTOOL_DEPS="$ltmain"
5654 -
5655 -# Always use our own libtool.
5656 -LIBTOOL='$(SHELL) $(top_builddir)/libtool'
5657 -AC_SUBST(LIBTOOL)dnl
5658 -
5659 -_LT_SETUP
5660 -
5661 -# Only expand once:
5662 -m4_define([LT_INIT])
5663 -])# LT_INIT
5664 -
5665 -# Old names:
5666 -AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
5667 -AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
5668 -dnl aclocal-1.4 backwards compatibility:
5669 -dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
5670 -dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
5671 -
5672 -
5673 -# _LT_CC_BASENAME(CC)
5674 -# -------------------
5675 -# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
5676 -m4_defun([_LT_CC_BASENAME],
5677 -[for cc_temp in $1""; do
5678 - case $cc_temp in
5679 - compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
5680 - distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
5681 - \-*) ;;
5682 - *) break;;
5683 - esac
5684 -done
5685 -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
5686 -])
5687 -
5688 -
5689 -# _LT_FILEUTILS_DEFAULTS
5690 -# ----------------------
5691 -# It is okay to use these file commands and assume they have been set
5692 -# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
5693 -m4_defun([_LT_FILEUTILS_DEFAULTS],
5694 -[: ${CP="cp -f"}
5695 -: ${MV="mv -f"}
5696 -: ${RM="rm -f"}
5697 -])# _LT_FILEUTILS_DEFAULTS
5698 -
5699 -
5700 -# _LT_SETUP
5701 -# ---------
5702 -m4_defun([_LT_SETUP],
5703 -[AC_REQUIRE([AC_CANONICAL_HOST])dnl
5704 -AC_REQUIRE([AC_CANONICAL_BUILD])dnl
5705 -AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
5706 -AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
5707 -
5708 -_LT_DECL([], [host_alias], [0], [The host system])dnl
5709 -_LT_DECL([], [host], [0])dnl
5710 -_LT_DECL([], [host_os], [0])dnl
5711 -dnl
5712 -_LT_DECL([], [build_alias], [0], [The build system])dnl
5713 -_LT_DECL([], [build], [0])dnl
5714 -_LT_DECL([], [build_os], [0])dnl
5715 -dnl
5716 -AC_REQUIRE([AC_PROG_CC])dnl
5717 -AC_REQUIRE([LT_PATH_LD])dnl
5718 -AC_REQUIRE([LT_PATH_NM])dnl
5719 -dnl
5720 -AC_REQUIRE([AC_PROG_LN_S])dnl
5721 -test -z "$LN_S" && LN_S="ln -s"
5722 -_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
5723 -dnl
5724 -AC_REQUIRE([LT_CMD_MAX_LEN])dnl
5725 -_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
5726 -_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
5727 -dnl
5728 -m4_require([_LT_FILEUTILS_DEFAULTS])dnl
5729 -m4_require([_LT_CHECK_SHELL_FEATURES])dnl
5730 -m4_require([_LT_CMD_RELOAD])dnl
5731 -m4_require([_LT_CHECK_MAGIC_METHOD])dnl
5732 -m4_require([_LT_CMD_OLD_ARCHIVE])dnl
5733 -m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
5734 -
5735 -_LT_CONFIG_LIBTOOL_INIT([
5736 -# See if we are running on zsh, and set the options which allow our
5737 -# commands through without removal of \ escapes INIT.
5738 -if test -n "\${ZSH_VERSION+set}" ; then
5739 - setopt NO_GLOB_SUBST
5740 -fi
5741 -])
5742 -if test -n "${ZSH_VERSION+set}" ; then
5743 - setopt NO_GLOB_SUBST
5744 -fi
5745 -
5746 -_LT_CHECK_OBJDIR
5747 -
5748 -m4_require([_LT_TAG_COMPILER])dnl
5749 -
5750 -case $host_os in
5751 -aix3*)
5752 - # AIX sometimes has problems with the GCC collect2 program. For some
5753 - # reason, if we set the COLLECT_NAMES environment variable, the problems
5754 - # vanish in a puff of smoke.
5755 - if test "X${COLLECT_NAMES+set}" != Xset; then
5756 - COLLECT_NAMES=
5757 - export COLLECT_NAMES
5758 - fi
5759 - ;;
5760 -esac
5761 -
5762 -# Global variables:
5763 -ofile=libtool
5764 -can_build_shared=yes
5765 -
5766 -# All known linkers require a `.a' archive for static linking (except MSVC,
5767 -# which needs '.lib').
5768 -libext=a
5769 -
5770 -with_gnu_ld="$lt_cv_prog_gnu_ld"
5771 -
5772 -old_CC="$CC"
5773 -old_CFLAGS="$CFLAGS"
5774 -
5775 -# Set sane defaults for various variables
5776 -test -z "$CC" && CC=cc
5777 -test -z "$LTCC" && LTCC=$CC
5778 -test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
5779 -test -z "$LD" && LD=ld
5780 -test -z "$ac_objext" && ac_objext=o
5781 -
5782 -_LT_CC_BASENAME([$compiler])
5783 -
5784 -# Only perform the check for file, if the check method requires it
5785 -test -z "$MAGIC_CMD" && MAGIC_CMD=file
5786 -case $deplibs_check_method in
5787 -file_magic*)
5788 - if test "$file_magic_cmd" = '$MAGIC_CMD'; then
5789 - _LT_PATH_MAGIC
5790 - fi
5791 - ;;
5792 -esac
5793 -
5794 -# Use C for the default configuration in the libtool script
5795 -LT_SUPPORTED_TAG([CC])
5796 -_LT_LANG_C_CONFIG
5797 -_LT_LANG_DEFAULT_CONFIG
5798 -_LT_CONFIG_COMMANDS
5799 -])# _LT_SETUP
5800 -
5801 -
5802 -# _LT_PREPARE_SED_QUOTE_VARS
5803 -# --------------------------
5804 -# Define a few sed substitution that help us do robust quoting.
5805 -m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
5806 -[# Backslashify metacharacters that are still active within
5807 -# double-quoted strings.
5808 -sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
5809 -
5810 -# Same as above, but do not quote variable references.
5811 -double_quote_subst='s/\([["`\\]]\)/\\\1/g'
5812 -
5813 -# Sed substitution to delay expansion of an escaped shell variable in a
5814 -# double_quote_subst'ed string.
5815 -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
5816 -
5817 -# Sed substitution to delay expansion of an escaped single quote.
5818 -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
5819 -
5820 -# Sed substitution to avoid accidental globbing in evaled expressions
5821 -no_glob_subst='s/\*/\\\*/g'
5822 -])
5823 -
5824 -# _LT_PROG_LTMAIN
5825 -# ---------------
5826 -# Note that this code is called both from `configure', and `config.status'
5827 -# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably,
5828 -# `config.status' has no value for ac_aux_dir unless we are using Automake,
5829 -# so we pass a copy along to make sure it has a sensible value anyway.
5830 -m4_defun([_LT_PROG_LTMAIN],
5831 -[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
5832 -_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
5833 -ltmain="$ac_aux_dir/ltmain.sh"
5834 -])# _LT_PROG_LTMAIN
5835 -
5836 -
5837 -## ------------------------------------- ##
5838 -## Accumulate code for creating libtool. ##
5839 -## ------------------------------------- ##
5840 -
5841 -# So that we can recreate a full libtool script including additional
5842 -# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
5843 -# in macros and then make a single call at the end using the `libtool'
5844 -# label.
5845 -
5846 -
5847 -# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
5848 -# ----------------------------------------
5849 -# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
5850 -m4_define([_LT_CONFIG_LIBTOOL_INIT],
5851 -[m4_ifval([$1],
5852 - [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
5853 - [$1
5854 -])])])
5855 -
5856 -# Initialize.
5857 -m4_define([_LT_OUTPUT_LIBTOOL_INIT])
5858 -
5859 -
5860 -# _LT_CONFIG_LIBTOOL([COMMANDS])
5861 -# ------------------------------
5862 -# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
5863 -m4_define([_LT_CONFIG_LIBTOOL],
5864 -[m4_ifval([$1],
5865 - [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
5866 - [$1
5867 -])])])
5868 -
5869 -# Initialize.
5870 -m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
5871 -
5872 -
5873 -# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
5874 -# -----------------------------------------------------
5875 -m4_defun([_LT_CONFIG_SAVE_COMMANDS],
5876 -[_LT_CONFIG_LIBTOOL([$1])
5877 -_LT_CONFIG_LIBTOOL_INIT([$2])
5878 -])
5879 -
5880 -
5881 -# _LT_FORMAT_COMMENT([COMMENT])
5882 -# -----------------------------
5883 -# Add leading comment marks to the start of each line, and a trailing
5884 -# full-stop to the whole comment if one is not present already.
5885 -m4_define([_LT_FORMAT_COMMENT],
5886 -[m4_ifval([$1], [
5887 -m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
5888 - [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
5889 -)])
5890 -
5891 -
5892 -
5893 -## ------------------------ ##
5894 -## FIXME: Eliminate VARNAME ##
5895 -## ------------------------ ##
5896 -
5897 -
5898 -# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
5899 -# -------------------------------------------------------------------
5900 -# CONFIGNAME is the name given to the value in the libtool script.
5901 -# VARNAME is the (base) name used in the configure script.
5902 -# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
5903 -# VARNAME. Any other value will be used directly.
5904 -m4_define([_LT_DECL],
5905 -[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
5906 - [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
5907 - [m4_ifval([$1], [$1], [$2])])
5908 - lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
5909 - m4_ifval([$4],
5910 - [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
5911 - lt_dict_add_subkey([lt_decl_dict], [$2],
5912 - [tagged?], [m4_ifval([$5], [yes], [no])])])
5913 -])
5914 -
5915 -
5916 -# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
5917 -# --------------------------------------------------------
5918 -m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
5919 -
5920 -
5921 -# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
5922 -# ------------------------------------------------
5923 -m4_define([lt_decl_tag_varnames],
5924 -[_lt_decl_filter([tagged?], [yes], $@)])
5925 -
5926 -
5927 -# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
5928 -# ---------------------------------------------------------
5929 -m4_define([_lt_decl_filter],
5930 -[m4_case([$#],
5931 - [0], [m4_fatal([$0: too few arguments: $#])],
5932 - [1], [m4_fatal([$0: too few arguments: $#: $1])],
5933 - [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
5934 - [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
5935 - [lt_dict_filter([lt_decl_dict], $@)])[]dnl
5936 -])
5937 -
5938 -
5939 -# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
5940 -# --------------------------------------------------
5941 -m4_define([lt_decl_quote_varnames],
5942 -[_lt_decl_filter([value], [1], $@)])
5943 -
5944 -
5945 -# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
5946 -# ---------------------------------------------------
5947 -m4_define([lt_decl_dquote_varnames],
5948 -[_lt_decl_filter([value], [2], $@)])
5949 -
5950 -
5951 -# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
5952 -# ---------------------------------------------------
5953 -m4_define([lt_decl_varnames_tagged],
5954 -[m4_assert([$# <= 2])dnl
5955 -_$0(m4_quote(m4_default([$1], [[, ]])),
5956 - m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
5957 - m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
5958 -m4_define([_lt_decl_varnames_tagged],
5959 -[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
5960 -
5961 -
5962 -# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
5963 -# ------------------------------------------------
5964 -m4_define([lt_decl_all_varnames],
5965 -[_$0(m4_quote(m4_default([$1], [[, ]])),
5966 - m4_if([$2], [],
5967 - m4_quote(lt_decl_varnames),
5968 - m4_quote(m4_shift($@))))[]dnl
5969 -])
5970 -m4_define([_lt_decl_all_varnames],
5971 -[lt_join($@, lt_decl_varnames_tagged([$1],
5972 - lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
5973 -])
5974 -
5975 -
5976 -# _LT_CONFIG_STATUS_DECLARE([VARNAME])
5977 -# ------------------------------------
5978 -# Quote a variable value, and forward it to `config.status' so that its
5979 -# declaration there will have the same value as in `configure'. VARNAME
5980 -# must have a single quote delimited value for this to work.
5981 -m4_define([_LT_CONFIG_STATUS_DECLARE],
5982 -[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
5983 -
5984 -
5985 -# _LT_CONFIG_STATUS_DECLARATIONS
5986 -# ------------------------------
5987 -# We delimit libtool config variables with single quotes, so when
5988 -# we write them to config.status, we have to be sure to quote all
5989 -# embedded single quotes properly. In configure, this macro expands
5990 -# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
5991 -#
5992 -# <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
5993 -m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
5994 -[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
5995 - [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
5996 -
5997 -
5998 -# _LT_LIBTOOL_TAGS
5999 -# ----------------
6000 -# Output comment and list of tags supported by the script
6001 -m4_defun([_LT_LIBTOOL_TAGS],
6002 -[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
6003 -available_tags="_LT_TAGS"dnl
6004 -])
6005 -
6006 -
6007 -# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
6008 -# -----------------------------------
6009 -# Extract the dictionary values for VARNAME (optionally with TAG) and
6010 -# expand to a commented shell variable setting:
6011 -#
6012 -# # Some comment about what VAR is for.
6013 -# visible_name=$lt_internal_name
6014 -m4_define([_LT_LIBTOOL_DECLARE],
6015 -[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
6016 - [description])))[]dnl
6017 -m4_pushdef([_libtool_name],
6018 - m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
6019 -m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
6020 - [0], [_libtool_name=[$]$1],
6021 - [1], [_libtool_name=$lt_[]$1],
6022 - [2], [_libtool_name=$lt_[]$1],
6023 - [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
6024 -m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
6025 -])
6026 -
6027 -
6028 -# _LT_LIBTOOL_CONFIG_VARS
6029 -# -----------------------
6030 -# Produce commented declarations of non-tagged libtool config variables
6031 -# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
6032 -# script. Tagged libtool config variables (even for the LIBTOOL CONFIG
6033 -# section) are produced by _LT_LIBTOOL_TAG_VARS.
6034 -m4_defun([_LT_LIBTOOL_CONFIG_VARS],
6035 -[m4_foreach([_lt_var],
6036 - m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
6037 - [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
6038 -
6039 -
6040 -# _LT_LIBTOOL_TAG_VARS(TAG)
6041 -# -------------------------
6042 -m4_define([_LT_LIBTOOL_TAG_VARS],
6043 -[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
6044 - [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
6045 -
6046 -
6047 -# _LT_TAGVAR(VARNAME, [TAGNAME])
6048 -# ------------------------------
6049 -m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
6050 -
6051 -
6052 -# _LT_CONFIG_COMMANDS
6053 -# -------------------
6054 -# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of
6055 -# variables for single and double quote escaping we saved from calls
6056 -# to _LT_DECL, we can put quote escaped variables declarations
6057 -# into `config.status', and then the shell code to quote escape them in
6058 -# for loops in `config.status'. Finally, any additional code accumulated
6059 -# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
6060 -m4_defun([_LT_CONFIG_COMMANDS],
6061 -[AC_PROVIDE_IFELSE([LT_OUTPUT],
6062 - dnl If the libtool generation code has been placed in $CONFIG_LT,
6063 - dnl instead of duplicating it all over again into config.status,
6064 - dnl then we will have config.status run $CONFIG_LT later, so it
6065 - dnl needs to know what name is stored there:
6066 - [AC_CONFIG_COMMANDS([libtool],
6067 - [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
6068 - dnl If the libtool generation code is destined for config.status,
6069 - dnl expand the accumulated commands and init code now:
6070 - [AC_CONFIG_COMMANDS([libtool],
6071 - [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
6072 -])#_LT_CONFIG_COMMANDS
6073 -
6074 -
6075 -# Initialize.
6076 -m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
6077 -[
6078 -
6079 -# The HP-UX ksh and POSIX shell print the target directory to stdout
6080 -# if CDPATH is set.
6081 -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
6082 -
6083 -sed_quote_subst='$sed_quote_subst'
6084 -double_quote_subst='$double_quote_subst'
6085 -delay_variable_subst='$delay_variable_subst'
6086 -_LT_CONFIG_STATUS_DECLARATIONS
6087 -LTCC='$LTCC'
6088 -LTCFLAGS='$LTCFLAGS'
6089 -compiler='$compiler_DEFAULT'
6090 -
6091 -# A function that is used when there is no print builtin or printf.
6092 -func_fallback_echo ()
6093 -{
6094 - eval 'cat <<_LTECHO_EOF
6095 -\$[]1
6096 -_LTECHO_EOF'
6097 -}
6098 -
6099 -# Quote evaled strings.
6100 -for var in lt_decl_all_varnames([[ \
6101 -]], lt_decl_quote_varnames); do
6102 - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
6103 - *[[\\\\\\\`\\"\\\$]]*)
6104 - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
6105 - ;;
6106 - *)
6107 - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
6108 - ;;
6109 - esac
6110 -done
6111 -
6112 -# Double-quote double-evaled strings.
6113 -for var in lt_decl_all_varnames([[ \
6114 -]], lt_decl_dquote_varnames); do
6115 - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
6116 - *[[\\\\\\\`\\"\\\$]]*)
6117 - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
6118 - ;;
6119 - *)
6120 - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
6121 - ;;
6122 - esac
6123 -done
6124 -
6125 -_LT_OUTPUT_LIBTOOL_INIT
6126 -])
6127 -
6128 -# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
6129 -# ------------------------------------
6130 -# Generate a child script FILE with all initialization necessary to
6131 -# reuse the environment learned by the parent script, and make the
6132 -# file executable. If COMMENT is supplied, it is inserted after the
6133 -# `#!' sequence but before initialization text begins. After this
6134 -# macro, additional text can be appended to FILE to form the body of
6135 -# the child script. The macro ends with non-zero status if the
6136 -# file could not be fully written (such as if the disk is full).
6137 -m4_ifdef([AS_INIT_GENERATED],
6138 -[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
6139 -[m4_defun([_LT_GENERATED_FILE_INIT],
6140 -[m4_require([AS_PREPARE])]dnl
6141 -[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
6142 -[lt_write_fail=0
6143 -cat >$1 <<_ASEOF || lt_write_fail=1
6144 -#! $SHELL
6145 -# Generated by $as_me.
6146 -$2
6147 -SHELL=\${CONFIG_SHELL-$SHELL}
6148 -export SHELL
6149 -_ASEOF
6150 -cat >>$1 <<\_ASEOF || lt_write_fail=1
6151 -AS_SHELL_SANITIZE
6152 -_AS_PREPARE
6153 -exec AS_MESSAGE_FD>&1
6154 -_ASEOF
6155 -test $lt_write_fail = 0 && chmod +x $1[]dnl
6156 -m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
6157 -
6158 -# LT_OUTPUT
6159 -# ---------
6160 -# This macro allows early generation of the libtool script (before
6161 -# AC_OUTPUT is called), incase it is used in configure for compilation
6162 -# tests.
6163 -AC_DEFUN([LT_OUTPUT],
6164 -[: ${CONFIG_LT=./config.lt}
6165 -AC_MSG_NOTICE([creating $CONFIG_LT])
6166 -_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
6167 -[# Run this file to recreate a libtool stub with the current configuration.])
6168 -
6169 -cat >>"$CONFIG_LT" <<\_LTEOF
6170 -lt_cl_silent=false
6171 -exec AS_MESSAGE_LOG_FD>>config.log
6172 -{
6173 - echo
6174 - AS_BOX([Running $as_me.])
6175 -} >&AS_MESSAGE_LOG_FD
6176 -
6177 -lt_cl_help="\
6178 -\`$as_me' creates a local libtool stub from the current configuration,
6179 -for use in further configure time tests before the real libtool is
6180 -generated.
6181 -
6182 -Usage: $[0] [[OPTIONS]]
6183 -
6184 - -h, --help print this help, then exit
6185 - -V, --version print version number, then exit
6186 - -q, --quiet do not print progress messages
6187 - -d, --debug don't remove temporary files
6188 -
6189 -Report bugs to <bug-libtool@×××.org>."
6190 -
6191 -lt_cl_version="\
6192 -m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
6193 -m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
6194 -configured by $[0], generated by m4_PACKAGE_STRING.
6195 -
6196 -Copyright (C) 2010 Free Software Foundation, Inc.
6197 -This config.lt script is free software; the Free Software Foundation
6198 -gives unlimited permision to copy, distribute and modify it."
6199 -
6200 -while test $[#] != 0
6201 -do
6202 - case $[1] in
6203 - --version | --v* | -V )
6204 - echo "$lt_cl_version"; exit 0 ;;
6205 - --help | --h* | -h )
6206 - echo "$lt_cl_help"; exit 0 ;;
6207 - --debug | --d* | -d )
6208 - debug=: ;;
6209 - --quiet | --q* | --silent | --s* | -q )
6210 - lt_cl_silent=: ;;
6211 -
6212 - -*) AC_MSG_ERROR([unrecognized option: $[1]
6213 -Try \`$[0] --help' for more information.]) ;;
6214 -
6215 - *) AC_MSG_ERROR([unrecognized argument: $[1]
6216 -Try \`$[0] --help' for more information.]) ;;
6217 - esac
6218 - shift
6219 -done
6220 -
6221 -if $lt_cl_silent; then
6222 - exec AS_MESSAGE_FD>/dev/null
6223 -fi
6224 -_LTEOF
6225 -
6226 -cat >>"$CONFIG_LT" <<_LTEOF
6227 -_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
6228 -_LTEOF
6229 -
6230 -cat >>"$CONFIG_LT" <<\_LTEOF
6231 -AC_MSG_NOTICE([creating $ofile])
6232 -_LT_OUTPUT_LIBTOOL_COMMANDS
6233 -AS_EXIT(0)
6234 -_LTEOF
6235 -chmod +x "$CONFIG_LT"
6236 -
6237 -# configure is writing to config.log, but config.lt does its own redirection,
6238 -# appending to config.log, which fails on DOS, as config.log is still kept
6239 -# open by configure. Here we exec the FD to /dev/null, effectively closing
6240 -# config.log, so it can be properly (re)opened and appended to by config.lt.
6241 -lt_cl_success=:
6242 -test "$silent" = yes &&
6243 - lt_config_lt_args="$lt_config_lt_args --quiet"
6244 -exec AS_MESSAGE_LOG_FD>/dev/null
6245 -$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
6246 -exec AS_MESSAGE_LOG_FD>>config.log
6247 -$lt_cl_success || AS_EXIT(1)
6248 -])# LT_OUTPUT
6249 -
6250 -
6251 -# _LT_CONFIG(TAG)
6252 -# ---------------
6253 -# If TAG is the built-in tag, create an initial libtool script with a
6254 -# default configuration from the untagged config vars. Otherwise add code
6255 -# to config.status for appending the configuration named by TAG from the
6256 -# matching tagged config vars.
6257 -m4_defun([_LT_CONFIG],
6258 -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6259 -_LT_CONFIG_SAVE_COMMANDS([
6260 - m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
6261 - m4_if(_LT_TAG, [C], [
6262 - # See if we are running on zsh, and set the options which allow our
6263 - # commands through without removal of \ escapes.
6264 - if test -n "${ZSH_VERSION+set}" ; then
6265 - setopt NO_GLOB_SUBST
6266 - fi
6267 -
6268 - cfgfile="${ofile}T"
6269 - trap "$RM \"$cfgfile\"; exit 1" 1 2 15
6270 - $RM "$cfgfile"
6271 -
6272 - cat <<_LT_EOF >> "$cfgfile"
6273 -#! $SHELL
6274 -
6275 -# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
6276 -# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
6277 -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
6278 -# NOTE: Changes made to this file will be lost: look at ltmain.sh.
6279 -#
6280 -_LT_COPYING
6281 -_LT_LIBTOOL_TAGS
6282 -
6283 -# ### BEGIN LIBTOOL CONFIG
6284 -_LT_LIBTOOL_CONFIG_VARS
6285 -_LT_LIBTOOL_TAG_VARS
6286 -# ### END LIBTOOL CONFIG
6287 -
6288 -_LT_EOF
6289 -
6290 - case $host_os in
6291 - aix3*)
6292 - cat <<\_LT_EOF >> "$cfgfile"
6293 -# AIX sometimes has problems with the GCC collect2 program. For some
6294 -# reason, if we set the COLLECT_NAMES environment variable, the problems
6295 -# vanish in a puff of smoke.
6296 -if test "X${COLLECT_NAMES+set}" != Xset; then
6297 - COLLECT_NAMES=
6298 - export COLLECT_NAMES
6299 -fi
6300 -_LT_EOF
6301 - ;;
6302 - esac
6303 -
6304 - _LT_PROG_LTMAIN
6305 -
6306 - # We use sed instead of cat because bash on DJGPP gets confused if
6307 - # if finds mixed CR/LF and LF-only lines. Since sed operates in
6308 - # text mode, it properly converts lines to CR/LF. This bash problem
6309 - # is reportedly fixed, but why not run on old versions too?
6310 - sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
6311 - || (rm -f "$cfgfile"; exit 1)
6312 -
6313 - _LT_PROG_XSI_SHELLFNS
6314 -
6315 - sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
6316 - || (rm -f "$cfgfile"; exit 1)
6317 -
6318 - mv -f "$cfgfile" "$ofile" ||
6319 - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
6320 - chmod +x "$ofile"
6321 -],
6322 -[cat <<_LT_EOF >> "$ofile"
6323 -
6324 -dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
6325 -dnl in a comment (ie after a #).
6326 -# ### BEGIN LIBTOOL TAG CONFIG: $1
6327 -_LT_LIBTOOL_TAG_VARS(_LT_TAG)
6328 -# ### END LIBTOOL TAG CONFIG: $1
6329 -_LT_EOF
6330 -])dnl /m4_if
6331 -],
6332 -[m4_if([$1], [], [
6333 - PACKAGE='$PACKAGE'
6334 - VERSION='$VERSION'
6335 - TIMESTAMP='$TIMESTAMP'
6336 - RM='$RM'
6337 - ofile='$ofile'], [])
6338 -])dnl /_LT_CONFIG_SAVE_COMMANDS
6339 -])# _LT_CONFIG
6340 -
6341 -
6342 -# LT_SUPPORTED_TAG(TAG)
6343 -# ---------------------
6344 -# Trace this macro to discover what tags are supported by the libtool
6345 -# --tag option, using:
6346 -# autoconf --trace 'LT_SUPPORTED_TAG:$1'
6347 -AC_DEFUN([LT_SUPPORTED_TAG], [])
6348 -
6349 -
6350 -# C support is built-in for now
6351 -m4_define([_LT_LANG_C_enabled], [])
6352 -m4_define([_LT_TAGS], [])
6353 -
6354 -
6355 -# LT_LANG(LANG)
6356 -# -------------
6357 -# Enable libtool support for the given language if not already enabled.
6358 -AC_DEFUN([LT_LANG],
6359 -[AC_BEFORE([$0], [LT_OUTPUT])dnl
6360 -m4_case([$1],
6361 - [C], [_LT_LANG(C)],
6362 - [C++], [_LT_LANG(CXX)],
6363 - [Java], [_LT_LANG(GCJ)],
6364 - [Fortran 77], [_LT_LANG(F77)],
6365 - [Fortran], [_LT_LANG(FC)],
6366 - [Windows Resource], [_LT_LANG(RC)],
6367 - [m4_ifdef([_LT_LANG_]$1[_CONFIG],
6368 - [_LT_LANG($1)],
6369 - [m4_fatal([$0: unsupported language: "$1"])])])dnl
6370 -])# LT_LANG
6371 -
6372 -
6373 -# _LT_LANG(LANGNAME)
6374 -# ------------------
6375 -m4_defun([_LT_LANG],
6376 -[m4_ifdef([_LT_LANG_]$1[_enabled], [],
6377 - [LT_SUPPORTED_TAG([$1])dnl
6378 - m4_append([_LT_TAGS], [$1 ])dnl
6379 - m4_define([_LT_LANG_]$1[_enabled], [])dnl
6380 - _LT_LANG_$1_CONFIG($1)])dnl
6381 -])# _LT_LANG
6382 -
6383 -
6384 -# _LT_LANG_DEFAULT_CONFIG
6385 -# -----------------------
6386 -m4_defun([_LT_LANG_DEFAULT_CONFIG],
6387 -[AC_PROVIDE_IFELSE([AC_PROG_CXX],
6388 - [LT_LANG(CXX)],
6389 - [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
6390 -
6391 -AC_PROVIDE_IFELSE([AC_PROG_F77],
6392 - [LT_LANG(F77)],
6393 - [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
6394 -
6395 -AC_PROVIDE_IFELSE([AC_PROG_FC],
6396 - [LT_LANG(FC)],
6397 - [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
6398 -
6399 -dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
6400 -dnl pulling things in needlessly.
6401 -AC_PROVIDE_IFELSE([AC_PROG_GCJ],
6402 - [LT_LANG(GCJ)],
6403 - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
6404 - [LT_LANG(GCJ)],
6405 - [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
6406 - [LT_LANG(GCJ)],
6407 - [m4_ifdef([AC_PROG_GCJ],
6408 - [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
6409 - m4_ifdef([A][M_PROG_GCJ],
6410 - [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
6411 - m4_ifdef([LT_PROG_GCJ],
6412 - [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
6413 -
6414 -AC_PROVIDE_IFELSE([LT_PROG_RC],
6415 - [LT_LANG(RC)],
6416 - [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
6417 -])# _LT_LANG_DEFAULT_CONFIG
6418 -
6419 -# Obsolete macros:
6420 -AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
6421 -AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
6422 -AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
6423 -AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
6424 -AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
6425 -dnl aclocal-1.4 backwards compatibility:
6426 -dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
6427 -dnl AC_DEFUN([AC_LIBTOOL_F77], [])
6428 -dnl AC_DEFUN([AC_LIBTOOL_FC], [])
6429 -dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
6430 -dnl AC_DEFUN([AC_LIBTOOL_RC], [])
6431 -
6432 -
6433 -# _LT_TAG_COMPILER
6434 -# ----------------
6435 -m4_defun([_LT_TAG_COMPILER],
6436 -[AC_REQUIRE([AC_PROG_CC])dnl
6437 -
6438 -_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
6439 -_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
6440 -_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
6441 -_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
6442 -
6443 -# If no C compiler was specified, use CC.
6444 -LTCC=${LTCC-"$CC"}
6445 -
6446 -# If no C compiler flags were specified, use CFLAGS.
6447 -LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
6448 -
6449 -# Allow CC to be a program name with arguments.
6450 -compiler=$CC
6451 -])# _LT_TAG_COMPILER
6452 -
6453 -
6454 -# _LT_COMPILER_BOILERPLATE
6455 -# ------------------------
6456 -# Check for compiler boilerplate output or warnings with
6457 -# the simple compiler test code.
6458 -m4_defun([_LT_COMPILER_BOILERPLATE],
6459 -[m4_require([_LT_DECL_SED])dnl
6460 -ac_outfile=conftest.$ac_objext
6461 -echo "$lt_simple_compile_test_code" >conftest.$ac_ext
6462 -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
6463 -_lt_compiler_boilerplate=`cat conftest.err`
6464 -$RM conftest*
6465 -])# _LT_COMPILER_BOILERPLATE
6466 -
6467 -
6468 -# _LT_LINKER_BOILERPLATE
6469 -# ----------------------
6470 -# Check for linker boilerplate output or warnings with
6471 -# the simple link test code.
6472 -m4_defun([_LT_LINKER_BOILERPLATE],
6473 -[m4_require([_LT_DECL_SED])dnl
6474 -ac_outfile=conftest.$ac_objext
6475 -echo "$lt_simple_link_test_code" >conftest.$ac_ext
6476 -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
6477 -_lt_linker_boilerplate=`cat conftest.err`
6478 -$RM -r conftest*
6479 -])# _LT_LINKER_BOILERPLATE
6480 -
6481 -# _LT_REQUIRED_DARWIN_CHECKS
6482 -# -------------------------
6483 -m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
6484 - case $host_os in
6485 - rhapsody* | darwin*)
6486 - AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
6487 - AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
6488 - AC_CHECK_TOOL([LIPO], [lipo], [:])
6489 - AC_CHECK_TOOL([OTOOL], [otool], [:])
6490 - AC_CHECK_TOOL([OTOOL64], [otool64], [:])
6491 - _LT_DECL([], [DSYMUTIL], [1],
6492 - [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
6493 - _LT_DECL([], [NMEDIT], [1],
6494 - [Tool to change global to local symbols on Mac OS X])
6495 - _LT_DECL([], [LIPO], [1],
6496 - [Tool to manipulate fat objects and archives on Mac OS X])
6497 - _LT_DECL([], [OTOOL], [1],
6498 - [ldd/readelf like tool for Mach-O binaries on Mac OS X])
6499 - _LT_DECL([], [OTOOL64], [1],
6500 - [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
6501 -
6502 - AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
6503 - [lt_cv_apple_cc_single_mod=no
6504 - if test -z "${LT_MULTI_MODULE}"; then
6505 - # By default we will add the -single_module flag. You can override
6506 - # by either setting the environment variable LT_MULTI_MODULE
6507 - # non-empty at configure time, or by adding -multi_module to the
6508 - # link flags.
6509 - rm -rf libconftest.dylib*
6510 - echo "int foo(void){return 1;}" > conftest.c
6511 - echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
6512 --dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
6513 - $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
6514 - -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
6515 - _lt_result=$?
6516 - if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
6517 - lt_cv_apple_cc_single_mod=yes
6518 - else
6519 - cat conftest.err >&AS_MESSAGE_LOG_FD
6520 - fi
6521 - rm -rf libconftest.dylib*
6522 - rm -f conftest.*
6523 - fi])
6524 - AC_CACHE_CHECK([for -exported_symbols_list linker flag],
6525 - [lt_cv_ld_exported_symbols_list],
6526 - [lt_cv_ld_exported_symbols_list=no
6527 - save_LDFLAGS=$LDFLAGS
6528 - echo "_main" > conftest.sym
6529 - LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
6530 - AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
6531 - [lt_cv_ld_exported_symbols_list=yes],
6532 - [lt_cv_ld_exported_symbols_list=no])
6533 - LDFLAGS="$save_LDFLAGS"
6534 - ])
6535 - AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
6536 - [lt_cv_ld_force_load=no
6537 - cat > conftest.c << _LT_EOF
6538 -int forced_loaded() { return 2;}
6539 -_LT_EOF
6540 - echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
6541 - $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
6542 - echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
6543 - $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
6544 - echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
6545 - $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
6546 - cat > conftest.c << _LT_EOF
6547 -int main() { return 0;}
6548 -_LT_EOF
6549 - echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
6550 - $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
6551 - _lt_result=$?
6552 - if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
6553 - lt_cv_ld_force_load=yes
6554 - else
6555 - cat conftest.err >&AS_MESSAGE_LOG_FD
6556 - fi
6557 - rm -f conftest.err libconftest.a conftest conftest.c
6558 - rm -rf conftest.dSYM
6559 - ])
6560 - case $host_os in
6561 - rhapsody* | darwin1.[[012]])
6562 - _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
6563 - darwin1.*)
6564 - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
6565 - darwin*) # darwin 5.x on
6566 - # if running on 10.5 or later, the deployment target defaults
6567 - # to the OS version, if on x86, and 10.4, the deployment
6568 - # target defaults to 10.4. Don't you love it?
6569 - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
6570 - 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
6571 - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
6572 - 10.[[012]]*)
6573 - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
6574 - 10.*)
6575 - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
6576 - esac
6577 - ;;
6578 - esac
6579 - if test "$lt_cv_apple_cc_single_mod" = "yes"; then
6580 - _lt_dar_single_mod='$single_module'
6581 - fi
6582 - if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
6583 - _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
6584 - else
6585 - _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
6586 - fi
6587 - if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
6588 - _lt_dsymutil='~$DSYMUTIL $lib || :'
6589 - else
6590 - _lt_dsymutil=
6591 - fi
6592 - ;;
6593 - esac
6594 -])
6595 -
6596 -
6597 -# _LT_DARWIN_LINKER_FEATURES
6598 -# --------------------------
6599 -# Checks for linker and compiler features on darwin
6600 -m4_defun([_LT_DARWIN_LINKER_FEATURES],
6601 -[
6602 - m4_require([_LT_REQUIRED_DARWIN_CHECKS])
6603 - _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6604 - _LT_TAGVAR(hardcode_direct, $1)=no
6605 - _LT_TAGVAR(hardcode_automatic, $1)=yes
6606 - _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
6607 - if test "$lt_cv_ld_force_load" = "yes"; then
6608 - _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\"`'
6609 - else
6610 - _LT_TAGVAR(whole_archive_flag_spec, $1)=''
6611 - fi
6612 - _LT_TAGVAR(link_all_deplibs, $1)=yes
6613 - _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
6614 - case $cc_basename in
6615 - ifort*) _lt_dar_can_shared=yes ;;
6616 - *) _lt_dar_can_shared=$GCC ;;
6617 - esac
6618 - if test "$_lt_dar_can_shared" = "yes"; then
6619 - output_verbose_link_cmd=func_echo_all
6620 - _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}"
6621 - _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
6622 - _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}"
6623 - _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}"
6624 - m4_if([$1], [CXX],
6625 -[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
6626 - _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}"
6627 - _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}"
6628 - fi
6629 -],[])
6630 - else
6631 - _LT_TAGVAR(ld_shlibs, $1)=no
6632 - fi
6633 -])
6634 -
6635 -# _LT_SYS_MODULE_PATH_AIX
6636 -# -----------------------
6637 -# Links a minimal program and checks the executable
6638 -# for the system default hardcoded library path. In most cases,
6639 -# this is /usr/lib:/lib, but when the MPI compilers are used
6640 -# the location of the communication and MPI libs are included too.
6641 -# If we don't find anything, use the default library path according
6642 -# to the aix ld manual.
6643 -m4_defun([_LT_SYS_MODULE_PATH_AIX],
6644 -[m4_require([_LT_DECL_SED])dnl
6645 -AC_LINK_IFELSE(AC_LANG_PROGRAM,[
6646 -lt_aix_libpath_sed='
6647 - /Import File Strings/,/^$/ {
6648 - /^0/ {
6649 - s/^0 *\(.*\)$/\1/
6650 - p
6651 - }
6652 - }'
6653 -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
6654 -# Check for a 64-bit object if we didn't find anything.
6655 -if test -z "$aix_libpath"; then
6656 - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
6657 -fi],[])
6658 -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
6659 -])# _LT_SYS_MODULE_PATH_AIX
6660 -
6661 -
6662 -# _LT_SHELL_INIT(ARG)
6663 -# -------------------
6664 -m4_define([_LT_SHELL_INIT],
6665 -[m4_divert_text([M4SH-INIT], [$1
6666 -])])# _LT_SHELL_INIT
6667 -
6668 -
6669 -
6670 -# _LT_PROG_ECHO_BACKSLASH
6671 -# -----------------------
6672 -# Find how we can fake an echo command that does not interpret backslash.
6673 -# In particular, with Autoconf 2.60 or later we add some code to the start
6674 -# of the generated configure script which will find a shell with a builtin
6675 -# printf (which we can use as an echo command).
6676 -m4_defun([_LT_PROG_ECHO_BACKSLASH],
6677 -[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
6678 -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
6679 -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
6680 -
6681 -AC_MSG_CHECKING([how to print strings])
6682 -# Test print first, because it will be a builtin if present.
6683 -if test "X`print -r -- -n 2>/dev/null`" = X-n && \
6684 - test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
6685 - ECHO='print -r --'
6686 -elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
6687 - ECHO='printf %s\n'
6688 -else
6689 - # Use this function as a fallback that always works.
6690 - func_fallback_echo ()
6691 - {
6692 - eval 'cat <<_LTECHO_EOF
6693 -$[]1
6694 -_LTECHO_EOF'
6695 - }
6696 - ECHO='func_fallback_echo'
6697 -fi
6698 -
6699 -# func_echo_all arg...
6700 -# Invoke $ECHO with all args, space-separated.
6701 -func_echo_all ()
6702 -{
6703 - $ECHO "$*"
6704 -}
6705 -
6706 -case "$ECHO" in
6707 - printf*) AC_MSG_RESULT([printf]) ;;
6708 - print*) AC_MSG_RESULT([print -r]) ;;
6709 - *) AC_MSG_RESULT([cat]) ;;
6710 -esac
6711 -
6712 -m4_ifdef([_AS_DETECT_SUGGESTED],
6713 -[_AS_DETECT_SUGGESTED([
6714 - test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
6715 - ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
6716 - ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
6717 - ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
6718 - PATH=/empty FPATH=/empty; export PATH FPATH
6719 - test "X`printf %s $ECHO`" = "X$ECHO" \
6720 - || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
6721 -
6722 -_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
6723 -_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
6724 -])# _LT_PROG_ECHO_BACKSLASH
6725 -
6726 -
6727 -# _LT_ENABLE_LOCK
6728 -# ---------------
6729 -m4_defun([_LT_ENABLE_LOCK],
6730 -[AC_ARG_ENABLE([libtool-lock],
6731 - [AS_HELP_STRING([--disable-libtool-lock],
6732 - [avoid locking (might break parallel builds)])])
6733 -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
6734 -
6735 -# Some flags need to be propagated to the compiler or linker for good
6736 -# libtool support.
6737 -case $host in
6738 -ia64-*-hpux*)
6739 - # Find out which ABI we are using.
6740 - echo 'int i;' > conftest.$ac_ext
6741 - if AC_TRY_EVAL(ac_compile); then
6742 - case `/usr/bin/file conftest.$ac_objext` in
6743 - *ELF-32*)
6744 - HPUX_IA64_MODE="32"
6745 - ;;
6746 - *ELF-64*)
6747 - HPUX_IA64_MODE="64"
6748 - ;;
6749 - esac
6750 - fi
6751 - rm -rf conftest*
6752 - ;;
6753 -*-*-irix6*)
6754 - # Find out which ABI we are using.
6755 - echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
6756 - if AC_TRY_EVAL(ac_compile); then
6757 - if test "$lt_cv_prog_gnu_ld" = yes; then
6758 - case `/usr/bin/file conftest.$ac_objext` in
6759 - *32-bit*)
6760 - LD="${LD-ld} -melf32bsmip"
6761 - ;;
6762 - *N32*)
6763 - LD="${LD-ld} -melf32bmipn32"
6764 - ;;
6765 - *64-bit*)
6766 - LD="${LD-ld} -melf64bmip"
6767 - ;;
6768 - esac
6769 - else
6770 - case `/usr/bin/file conftest.$ac_objext` in
6771 - *32-bit*)
6772 - LD="${LD-ld} -32"
6773 - ;;
6774 - *N32*)
6775 - LD="${LD-ld} -n32"
6776 - ;;
6777 - *64-bit*)
6778 - LD="${LD-ld} -64"
6779 - ;;
6780 - esac
6781 - fi
6782 - fi
6783 - rm -rf conftest*
6784 - ;;
6785 -
6786 -x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
6787 -s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
6788 - # Find out which ABI we are using.
6789 - echo 'int i;' > conftest.$ac_ext
6790 - if AC_TRY_EVAL(ac_compile); then
6791 - case `/usr/bin/file conftest.o` in
6792 - *32-bit*)
6793 - case $host in
6794 - x86_64-*kfreebsd*-gnu)
6795 - LD="${LD-ld} -m elf_i386_fbsd"
6796 - ;;
6797 - x86_64-*linux*)
6798 - LD="${LD-ld} -m elf_i386"
6799 - ;;
6800 - ppc64-*linux*|powerpc64-*linux*)
6801 - LD="${LD-ld} -m elf32ppclinux"
6802 - ;;
6803 - s390x-*linux*)
6804 - LD="${LD-ld} -m elf_s390"
6805 - ;;
6806 - sparc64-*linux*)
6807 - LD="${LD-ld} -m elf32_sparc"
6808 - ;;
6809 - esac
6810 - ;;
6811 - *64-bit*)
6812 - case $host in
6813 - x86_64-*kfreebsd*-gnu)
6814 - LD="${LD-ld} -m elf_x86_64_fbsd"
6815 - ;;
6816 - x86_64-*linux*)
6817 - LD="${LD-ld} -m elf_x86_64"
6818 - ;;
6819 - ppc*-*linux*|powerpc*-*linux*)
6820 - LD="${LD-ld} -m elf64ppc"
6821 - ;;
6822 - s390*-*linux*|s390*-*tpf*)
6823 - LD="${LD-ld} -m elf64_s390"
6824 - ;;
6825 - sparc*-*linux*)
6826 - LD="${LD-ld} -m elf64_sparc"
6827 - ;;
6828 - esac
6829 - ;;
6830 - esac
6831 - fi
6832 - rm -rf conftest*
6833 - ;;
6834 -
6835 -*-*-sco3.2v5*)
6836 - # On SCO OpenServer 5, we need -belf to get full-featured binaries.
6837 - SAVE_CFLAGS="$CFLAGS"
6838 - CFLAGS="$CFLAGS -belf"
6839 - AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
6840 - [AC_LANG_PUSH(C)
6841 - AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
6842 - AC_LANG_POP])
6843 - if test x"$lt_cv_cc_needs_belf" != x"yes"; then
6844 - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
6845 - CFLAGS="$SAVE_CFLAGS"
6846 - fi
6847 - ;;
6848 -sparc*-*solaris*)
6849 - # Find out which ABI we are using.
6850 - echo 'int i;' > conftest.$ac_ext
6851 - if AC_TRY_EVAL(ac_compile); then
6852 - case `/usr/bin/file conftest.o` in
6853 - *64-bit*)
6854 - case $lt_cv_prog_gnu_ld in
6855 - yes*) LD="${LD-ld} -m elf64_sparc" ;;
6856 - *)
6857 - if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
6858 - LD="${LD-ld} -64"
6859 - fi
6860 - ;;
6861 - esac
6862 - ;;
6863 - esac
6864 - fi
6865 - rm -rf conftest*
6866 - ;;
6867 -esac
6868 -
6869 -need_locks="$enable_libtool_lock"
6870 -])# _LT_ENABLE_LOCK
6871 -
6872 -
6873 -# _LT_CMD_OLD_ARCHIVE
6874 -# -------------------
6875 -m4_defun([_LT_CMD_OLD_ARCHIVE],
6876 -[AC_CHECK_TOOL(AR, ar, false)
6877 -test -z "$AR" && AR=ar
6878 -test -z "$AR_FLAGS" && AR_FLAGS=cru
6879 -_LT_DECL([], [AR], [1], [The archiver])
6880 -_LT_DECL([], [AR_FLAGS], [1])
6881 -
6882 -AC_CHECK_TOOL(STRIP, strip, :)
6883 -test -z "$STRIP" && STRIP=:
6884 -_LT_DECL([], [STRIP], [1], [A symbol stripping program])
6885 -
6886 -AC_CHECK_TOOL(RANLIB, ranlib, :)
6887 -test -z "$RANLIB" && RANLIB=:
6888 -_LT_DECL([], [RANLIB], [1],
6889 - [Commands used to install an old-style archive])
6890 -
6891 -# Determine commands to create old-style static archives.
6892 -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
6893 -old_postinstall_cmds='chmod 644 $oldlib'
6894 -old_postuninstall_cmds=
6895 -
6896 -if test -n "$RANLIB"; then
6897 - case $host_os in
6898 - openbsd*)
6899 - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
6900 - ;;
6901 - *)
6902 - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
6903 - ;;
6904 - esac
6905 - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
6906 -fi
6907 -
6908 -case $host_os in
6909 - darwin*)
6910 - lock_old_archive_extraction=yes ;;
6911 - *)
6912 - lock_old_archive_extraction=no ;;
6913 -esac
6914 -_LT_DECL([], [old_postinstall_cmds], [2])
6915 -_LT_DECL([], [old_postuninstall_cmds], [2])
6916 -_LT_TAGDECL([], [old_archive_cmds], [2],
6917 - [Commands used to build an old-style archive])
6918 -_LT_DECL([], [lock_old_archive_extraction], [0],
6919 - [Whether to use a lock for old archive extraction])
6920 -])# _LT_CMD_OLD_ARCHIVE
6921 -
6922 -
6923 -# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
6924 -# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
6925 -# ----------------------------------------------------------------
6926 -# Check whether the given compiler option works
6927 -AC_DEFUN([_LT_COMPILER_OPTION],
6928 -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6929 -m4_require([_LT_DECL_SED])dnl
6930 -AC_CACHE_CHECK([$1], [$2],
6931 - [$2=no
6932 - m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
6933 - echo "$lt_simple_compile_test_code" > conftest.$ac_ext
6934 - lt_compiler_flag="$3"
6935 - # Insert the option either (1) after the last *FLAGS variable, or
6936 - # (2) before a word containing "conftest.", or (3) at the end.
6937 - # Note that $ac_compile itself does not contain backslashes and begins
6938 - # with a dollar sign (not a hyphen), so the echo should work correctly.
6939 - # The option is referenced via a variable to avoid confusing sed.
6940 - lt_compile=`echo "$ac_compile" | $SED \
6941 - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
6942 - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
6943 - -e 's:$: $lt_compiler_flag:'`
6944 - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
6945 - (eval "$lt_compile" 2>conftest.err)
6946 - ac_status=$?
6947 - cat conftest.err >&AS_MESSAGE_LOG_FD
6948 - echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
6949 - if (exit $ac_status) && test -s "$ac_outfile"; then
6950 - # The compiler can only warn and ignore the option if not recognized
6951 - # So say no if there are warnings other than the usual output.
6952 - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
6953 - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
6954 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
6955 - $2=yes
6956 - fi
6957 - fi
6958 - $RM conftest*
6959 -])
6960 -
6961 -if test x"[$]$2" = xyes; then
6962 - m4_if([$5], , :, [$5])
6963 -else
6964 - m4_if([$6], , :, [$6])
6965 -fi
6966 -])# _LT_COMPILER_OPTION
6967 -
6968 -# Old name:
6969 -AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
6970 -dnl aclocal-1.4 backwards compatibility:
6971 -dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
6972 -
6973 -
6974 -# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
6975 -# [ACTION-SUCCESS], [ACTION-FAILURE])
6976 -# ----------------------------------------------------
6977 -# Check whether the given linker option works
6978 -AC_DEFUN([_LT_LINKER_OPTION],
6979 -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6980 -m4_require([_LT_DECL_SED])dnl
6981 -AC_CACHE_CHECK([$1], [$2],
6982 - [$2=no
6983 - save_LDFLAGS="$LDFLAGS"
6984 - LDFLAGS="$LDFLAGS $3"
6985 - echo "$lt_simple_link_test_code" > conftest.$ac_ext
6986 - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
6987 - # The linker can only warn and ignore the option if not recognized
6988 - # So say no if there are warnings
6989 - if test -s conftest.err; then
6990 - # Append any errors to the config.log.
6991 - cat conftest.err 1>&AS_MESSAGE_LOG_FD
6992 - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
6993 - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
6994 - if diff conftest.exp conftest.er2 >/dev/null; then
6995 - $2=yes
6996 - fi
6997 - else
6998 - $2=yes
6999 - fi
7000 - fi
7001 - $RM -r conftest*
7002 - LDFLAGS="$save_LDFLAGS"
7003 -])
7004 -
7005 -if test x"[$]$2" = xyes; then
7006 - m4_if([$4], , :, [$4])
7007 -else
7008 - m4_if([$5], , :, [$5])
7009 -fi
7010 -])# _LT_LINKER_OPTION
7011 -
7012 -# Old name:
7013 -AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
7014 -dnl aclocal-1.4 backwards compatibility:
7015 -dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
7016 -
7017 -
7018 -# LT_CMD_MAX_LEN
7019 -#---------------
7020 -AC_DEFUN([LT_CMD_MAX_LEN],
7021 -[AC_REQUIRE([AC_CANONICAL_HOST])dnl
7022 -# find the maximum length of command line arguments
7023 -AC_MSG_CHECKING([the maximum length of command line arguments])
7024 -AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
7025 - i=0
7026 - teststring="ABCD"
7027 -
7028 - case $build_os in
7029 - msdosdjgpp*)
7030 - # On DJGPP, this test can blow up pretty badly due to problems in libc
7031 - # (any single argument exceeding 2000 bytes causes a buffer overrun
7032 - # during glob expansion). Even if it were fixed, the result of this
7033 - # check would be larger than it should be.
7034 - lt_cv_sys_max_cmd_len=12288; # 12K is about right
7035 - ;;
7036 -
7037 - gnu*)
7038 - # Under GNU Hurd, this test is not required because there is
7039 - # no limit to the length of command line arguments.
7040 - # Libtool will interpret -1 as no limit whatsoever
7041 - lt_cv_sys_max_cmd_len=-1;
7042 - ;;
7043 -
7044 - cygwin* | mingw* | cegcc*)
7045 - # On Win9x/ME, this test blows up -- it succeeds, but takes
7046 - # about 5 minutes as the teststring grows exponentially.
7047 - # Worse, since 9x/ME are not pre-emptively multitasking,
7048 - # you end up with a "frozen" computer, even though with patience
7049 - # the test eventually succeeds (with a max line length of 256k).
7050 - # Instead, let's just punt: use the minimum linelength reported by
7051 - # all of the supported platforms: 8192 (on NT/2K/XP).
7052 - lt_cv_sys_max_cmd_len=8192;
7053 - ;;
7054 -
7055 - mint*)
7056 - # On MiNT this can take a long time and run out of memory.
7057 - lt_cv_sys_max_cmd_len=8192;
7058 - ;;
7059 -
7060 - amigaos*)
7061 - # On AmigaOS with pdksh, this test takes hours, literally.
7062 - # So we just punt and use a minimum line length of 8192.
7063 - lt_cv_sys_max_cmd_len=8192;
7064 - ;;
7065 -
7066 - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
7067 - # This has been around since 386BSD, at least. Likely further.
7068 - if test -x /sbin/sysctl; then
7069 - lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
7070 - elif test -x /usr/sbin/sysctl; then
7071 - lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
7072 - else
7073 - lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
7074 - fi
7075 - # And add a safety zone
7076 - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
7077 - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
7078 - ;;
7079 -
7080 - interix*)
7081 - # We know the value 262144 and hardcode it with a safety zone (like BSD)
7082 - lt_cv_sys_max_cmd_len=196608
7083 - ;;
7084 -
7085 - osf*)
7086 - # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
7087 - # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
7088 - # nice to cause kernel panics so lets avoid the loop below.
7089 - # First set a reasonable default.
7090 - lt_cv_sys_max_cmd_len=16384
7091 - #
7092 - if test -x /sbin/sysconfig; then
7093 - case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
7094 - *1*) lt_cv_sys_max_cmd_len=-1 ;;
7095 - esac
7096 - fi
7097 - ;;
7098 - sco3.2v5*)
7099 - lt_cv_sys_max_cmd_len=102400
7100 - ;;
7101 - sysv5* | sco5v6* | sysv4.2uw2*)
7102 - kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
7103 - if test -n "$kargmax"; then
7104 - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
7105 - else
7106 - lt_cv_sys_max_cmd_len=32768
7107 - fi
7108 - ;;
7109 - *)
7110 - lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
7111 - if test -n "$lt_cv_sys_max_cmd_len"; then
7112 - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
7113 - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
7114 - else
7115 - # Make teststring a little bigger before we do anything with it.
7116 - # a 1K string should be a reasonable start.
7117 - for i in 1 2 3 4 5 6 7 8 ; do
7118 - teststring=$teststring$teststring
7119 - done
7120 - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
7121 - # If test is not a shell built-in, we'll probably end up computing a
7122 - # maximum length that is only half of the actual maximum length, but
7123 - # we can't tell.
7124 - while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
7125 - = "X$teststring$teststring"; } >/dev/null 2>&1 &&
7126 - test $i != 17 # 1/2 MB should be enough
7127 - do
7128 - i=`expr $i + 1`
7129 - teststring=$teststring$teststring
7130 - done
7131 - # Only check the string length outside the loop.
7132 - lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
7133 - teststring=
7134 - # Add a significant safety factor because C++ compilers can tack on
7135 - # massive amounts of additional arguments before passing them to the
7136 - # linker. It appears as though 1/2 is a usable value.
7137 - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
7138 - fi
7139 - ;;
7140 - esac
7141 -])
7142 -if test -n $lt_cv_sys_max_cmd_len ; then
7143 - AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
7144 -else
7145 - AC_MSG_RESULT(none)
7146 -fi
7147 -max_cmd_len=$lt_cv_sys_max_cmd_len
7148 -_LT_DECL([], [max_cmd_len], [0],
7149 - [What is the maximum length of a command?])
7150 -])# LT_CMD_MAX_LEN
7151 -
7152 -# Old name:
7153 -AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
7154 -dnl aclocal-1.4 backwards compatibility:
7155 -dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
7156 -
7157 -
7158 -# _LT_HEADER_DLFCN
7159 -# ----------------
7160 -m4_defun([_LT_HEADER_DLFCN],
7161 -[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
7162 -])# _LT_HEADER_DLFCN
7163 -
7164 -
7165 -# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
7166 -# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
7167 -# ----------------------------------------------------------------
7168 -m4_defun([_LT_TRY_DLOPEN_SELF],
7169 -[m4_require([_LT_HEADER_DLFCN])dnl
7170 -if test "$cross_compiling" = yes; then :
7171 - [$4]
7172 -else
7173 - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
7174 - lt_status=$lt_dlunknown
7175 - cat > conftest.$ac_ext <<_LT_EOF
7176 -[#line $LINENO "configure"
7177 -#include "confdefs.h"
7178 -
7179 -#if HAVE_DLFCN_H
7180 -#include <dlfcn.h>
7181 -#endif
7182 -
7183 -#include <stdio.h>
7184 -
7185 -#ifdef RTLD_GLOBAL
7186 -# define LT_DLGLOBAL RTLD_GLOBAL
7187 -#else
7188 -# ifdef DL_GLOBAL
7189 -# define LT_DLGLOBAL DL_GLOBAL
7190 -# else
7191 -# define LT_DLGLOBAL 0
7192 -# endif
7193 -#endif
7194 -
7195 -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
7196 - find out it does not work in some platform. */
7197 -#ifndef LT_DLLAZY_OR_NOW
7198 -# ifdef RTLD_LAZY
7199 -# define LT_DLLAZY_OR_NOW RTLD_LAZY
7200 -# else
7201 -# ifdef DL_LAZY
7202 -# define LT_DLLAZY_OR_NOW DL_LAZY
7203 -# else
7204 -# ifdef RTLD_NOW
7205 -# define LT_DLLAZY_OR_NOW RTLD_NOW
7206 -# else
7207 -# ifdef DL_NOW
7208 -# define LT_DLLAZY_OR_NOW DL_NOW
7209 -# else
7210 -# define LT_DLLAZY_OR_NOW 0
7211 -# endif
7212 -# endif
7213 -# endif
7214 -# endif
7215 -#endif
7216 -
7217 -/* When -fvisbility=hidden is used, assume the code has been annotated
7218 - correspondingly for the symbols needed. */
7219 -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
7220 -void fnord () __attribute__((visibility("default")));
7221 -#endif
7222 -
7223 -void fnord () { int i=42; }
7224 -int main ()
7225 -{
7226 - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
7227 - int status = $lt_dlunknown;
7228 -
7229 - if (self)
7230 - {
7231 - if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
7232 - else
7233 - {
7234 - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
7235 - else puts (dlerror ());
7236 - }
7237 - /* dlclose (self); */
7238 - }
7239 - else
7240 - puts (dlerror ());
7241 -
7242 - return status;
7243 -}]
7244 -_LT_EOF
7245 - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
7246 - (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
7247 - lt_status=$?
7248 - case x$lt_status in
7249 - x$lt_dlno_uscore) $1 ;;
7250 - x$lt_dlneed_uscore) $2 ;;
7251 - x$lt_dlunknown|x*) $3 ;;
7252 - esac
7253 - else :
7254 - # compilation failed
7255 - $3
7256 - fi
7257 -fi
7258 -rm -fr conftest*
7259 -])# _LT_TRY_DLOPEN_SELF
7260 -
7261 -
7262 -# LT_SYS_DLOPEN_SELF
7263 -# ------------------
7264 -AC_DEFUN([LT_SYS_DLOPEN_SELF],
7265 -[m4_require([_LT_HEADER_DLFCN])dnl
7266 -if test "x$enable_dlopen" != xyes; then
7267 - enable_dlopen=unknown
7268 - enable_dlopen_self=unknown
7269 - enable_dlopen_self_static=unknown
7270 -else
7271 - lt_cv_dlopen=no
7272 - lt_cv_dlopen_libs=
7273 -
7274 - case $host_os in
7275 - beos*)
7276 - lt_cv_dlopen="load_add_on"
7277 - lt_cv_dlopen_libs=
7278 - lt_cv_dlopen_self=yes
7279 - ;;
7280 -
7281 - mingw* | pw32* | cegcc*)
7282 - lt_cv_dlopen="LoadLibrary"
7283 - lt_cv_dlopen_libs=
7284 - ;;
7285 -
7286 - cygwin*)
7287 - lt_cv_dlopen="dlopen"
7288 - lt_cv_dlopen_libs=
7289 - ;;
7290 -
7291 - darwin*)
7292 - # if libdl is installed we need to link against it
7293 - AC_CHECK_LIB([dl], [dlopen],
7294 - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
7295 - lt_cv_dlopen="dyld"
7296 - lt_cv_dlopen_libs=
7297 - lt_cv_dlopen_self=yes
7298 - ])
7299 - ;;
7300 -
7301 - *)
7302 - AC_CHECK_FUNC([shl_load],
7303 - [lt_cv_dlopen="shl_load"],
7304 - [AC_CHECK_LIB([dld], [shl_load],
7305 - [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
7306 - [AC_CHECK_FUNC([dlopen],
7307 - [lt_cv_dlopen="dlopen"],
7308 - [AC_CHECK_LIB([dl], [dlopen],
7309 - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
7310 - [AC_CHECK_LIB([svld], [dlopen],
7311 - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
7312 - [AC_CHECK_LIB([dld], [dld_link],
7313 - [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
7314 - ])
7315 - ])
7316 - ])
7317 - ])
7318 - ])
7319 - ;;
7320 - esac
7321 -
7322 - if test "x$lt_cv_dlopen" != xno; then
7323 - enable_dlopen=yes
7324 - else
7325 - enable_dlopen=no
7326 - fi
7327 -
7328 - case $lt_cv_dlopen in
7329 - dlopen)
7330 - save_CPPFLAGS="$CPPFLAGS"
7331 - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
7332 -
7333 - save_LDFLAGS="$LDFLAGS"
7334 - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
7335 -
7336 - save_LIBS="$LIBS"
7337 - LIBS="$lt_cv_dlopen_libs $LIBS"
7338 -
7339 - AC_CACHE_CHECK([whether a program can dlopen itself],
7340 - lt_cv_dlopen_self, [dnl
7341 - _LT_TRY_DLOPEN_SELF(
7342 - lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
7343 - lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
7344 - ])
7345 -
7346 - if test "x$lt_cv_dlopen_self" = xyes; then
7347 - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
7348 - AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
7349 - lt_cv_dlopen_self_static, [dnl
7350 - _LT_TRY_DLOPEN_SELF(
7351 - lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
7352 - lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
7353 - ])
7354 - fi
7355 -
7356 - CPPFLAGS="$save_CPPFLAGS"
7357 - LDFLAGS="$save_LDFLAGS"
7358 - LIBS="$save_LIBS"
7359 - ;;
7360 - esac
7361 -
7362 - case $lt_cv_dlopen_self in
7363 - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
7364 - *) enable_dlopen_self=unknown ;;
7365 - esac
7366 -
7367 - case $lt_cv_dlopen_self_static in
7368 - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
7369 - *) enable_dlopen_self_static=unknown ;;
7370 - esac
7371 -fi
7372 -_LT_DECL([dlopen_support], [enable_dlopen], [0],
7373 - [Whether dlopen is supported])
7374 -_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
7375 - [Whether dlopen of programs is supported])
7376 -_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
7377 - [Whether dlopen of statically linked programs is supported])
7378 -])# LT_SYS_DLOPEN_SELF
7379 -
7380 -# Old name:
7381 -AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
7382 -dnl aclocal-1.4 backwards compatibility:
7383 -dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
7384 -
7385 -
7386 -# _LT_COMPILER_C_O([TAGNAME])
7387 -# ---------------------------
7388 -# Check to see if options -c and -o are simultaneously supported by compiler.
7389 -# This macro does not hard code the compiler like AC_PROG_CC_C_O.
7390 -m4_defun([_LT_COMPILER_C_O],
7391 -[m4_require([_LT_DECL_SED])dnl
7392 -m4_require([_LT_FILEUTILS_DEFAULTS])dnl
7393 -m4_require([_LT_TAG_COMPILER])dnl
7394 -AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
7395 - [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
7396 - [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
7397 - $RM -r conftest 2>/dev/null
7398 - mkdir conftest
7399 - cd conftest
7400 - mkdir out
7401 - echo "$lt_simple_compile_test_code" > conftest.$ac_ext
7402 -
7403 - lt_compiler_flag="-o out/conftest2.$ac_objext"
7404 - # Insert the option either (1) after the last *FLAGS variable, or
7405 - # (2) before a word containing "conftest.", or (3) at the end.
7406 - # Note that $ac_compile itself does not contain backslashes and begins
7407 - # with a dollar sign (not a hyphen), so the echo should work correctly.
7408 - lt_compile=`echo "$ac_compile" | $SED \
7409 - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
7410 - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
7411 - -e 's:$: $lt_compiler_flag:'`
7412 - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
7413 - (eval "$lt_compile" 2>out/conftest.err)
7414 - ac_status=$?
7415 - cat out/conftest.err >&AS_MESSAGE_LOG_FD
7416 - echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
7417 - if (exit $ac_status) && test -s out/conftest2.$ac_objext
7418 - then
7419 - # The compiler can only warn and ignore the option if not recognized
7420 - # So say no if there are warnings
7421 - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
7422 - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
7423 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
7424 - _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
7425 - fi
7426 - fi
7427 - chmod u+w . 2>&AS_MESSAGE_LOG_FD
7428 - $RM conftest*
7429 - # SGI C++ compiler will create directory out/ii_files/ for
7430 - # template instantiation
7431 - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
7432 - $RM out/* && rmdir out
7433 - cd ..
7434 - $RM -r conftest
7435 - $RM conftest*
7436 -])
7437 -_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
7438 - [Does compiler simultaneously support -c and -o options?])
7439 -])# _LT_COMPILER_C_O
7440 -
7441 -
7442 -# _LT_COMPILER_FILE_LOCKS([TAGNAME])
7443 -# ----------------------------------
7444 -# Check to see if we can do hard links to lock some files if needed
7445 -m4_defun([_LT_COMPILER_FILE_LOCKS],
7446 -[m4_require([_LT_ENABLE_LOCK])dnl
7447 -m4_require([_LT_FILEUTILS_DEFAULTS])dnl
7448 -_LT_COMPILER_C_O([$1])
7449 -
7450 -hard_links="nottested"
7451 -if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
7452 - # do not overwrite the value of need_locks provided by the user
7453 - AC_MSG_CHECKING([if we can lock with hard links])
7454 - hard_links=yes
7455 - $RM conftest*
7456 - ln conftest.a conftest.b 2>/dev/null && hard_links=no
7457 - touch conftest.a
7458 - ln conftest.a conftest.b 2>&5 || hard_links=no
7459 - ln conftest.a conftest.b 2>/dev/null && hard_links=no
7460 - AC_MSG_RESULT([$hard_links])
7461 - if test "$hard_links" = no; then
7462 - AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
7463 - need_locks=warn
7464 - fi
7465 -else
7466 - need_locks=no
7467 -fi
7468 -_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
7469 -])# _LT_COMPILER_FILE_LOCKS
7470 -
7471 -
7472 -# _LT_CHECK_OBJDIR
7473 -# ----------------
7474 -m4_defun([_LT_CHECK_OBJDIR],
7475 -[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
7476 -[rm -f .libs 2>/dev/null
7477 -mkdir .libs 2>/dev/null
7478 -if test -d .libs; then
7479 - lt_cv_objdir=.libs
7480 -else
7481 - # MS-DOS does not allow filenames that begin with a dot.
7482 - lt_cv_objdir=_libs
7483 -fi
7484 -rmdir .libs 2>/dev/null])
7485 -objdir=$lt_cv_objdir
7486 -_LT_DECL([], [objdir], [0],
7487 - [The name of the directory that contains temporary libtool files])dnl
7488 -m4_pattern_allow([LT_OBJDIR])dnl
7489 -AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
7490 - [Define to the sub-directory in which libtool stores uninstalled libraries.])
7491 -])# _LT_CHECK_OBJDIR
7492 -
7493 -
7494 -# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
7495 -# --------------------------------------
7496 -# Check hardcoding attributes.
7497 -m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
7498 -[AC_MSG_CHECKING([how to hardcode library paths into programs])
7499 -_LT_TAGVAR(hardcode_action, $1)=
7500 -if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
7501 - test -n "$_LT_TAGVAR(runpath_var, $1)" ||
7502 - test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
7503 -
7504 - # We can hardcode non-existent directories.
7505 - if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
7506 - # If the only mechanism to avoid hardcoding is shlibpath_var, we
7507 - # have to relink, otherwise we might link with an installed library
7508 - # when we should be linking with a yet-to-be-installed one
7509 - ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
7510 - test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
7511 - # Linking always hardcodes the temporary library directory.
7512 - _LT_TAGVAR(hardcode_action, $1)=relink
7513 - else
7514 - # We can link without hardcoding, and we can hardcode nonexisting dirs.
7515 - _LT_TAGVAR(hardcode_action, $1)=immediate
7516 - fi
7517 -else
7518 - # We cannot hardcode anything, or else we can only hardcode existing
7519 - # directories.
7520 - _LT_TAGVAR(hardcode_action, $1)=unsupported
7521 -fi
7522 -AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
7523 -
7524 -if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
7525 - test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
7526 - # Fast installation is not supported
7527 - enable_fast_install=no
7528 -elif test "$shlibpath_overrides_runpath" = yes ||
7529 - test "$enable_shared" = no; then
7530 - # Fast installation is not necessary
7531 - enable_fast_install=needless
7532 -fi
7533 -_LT_TAGDECL([], [hardcode_action], [0],
7534 - [How to hardcode a shared library path into an executable])
7535 -])# _LT_LINKER_HARDCODE_LIBPATH
7536 -
7537 -
7538 -# _LT_CMD_STRIPLIB
7539 -# ----------------
7540 -m4_defun([_LT_CMD_STRIPLIB],
7541 -[m4_require([_LT_DECL_EGREP])
7542 -striplib=
7543 -old_striplib=
7544 -AC_MSG_CHECKING([whether stripping libraries is possible])
7545 -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
7546 - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
7547 - test -z "$striplib" && striplib="$STRIP --strip-unneeded"
7548 - AC_MSG_RESULT([yes])
7549 -else
7550 -# FIXME - insert some real tests, host_os isn't really good enough
7551 - case $host_os in
7552 - darwin*)
7553 - if test -n "$STRIP" ; then
7554 - striplib="$STRIP -x"
7555 - old_striplib="$STRIP -S"
7556 - AC_MSG_RESULT([yes])
7557 - else
7558 - AC_MSG_RESULT([no])
7559 - fi
7560 - ;;
7561 - *)
7562 - AC_MSG_RESULT([no])
7563 - ;;
7564 - esac
7565 -fi
7566 -_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
7567 -_LT_DECL([], [striplib], [1])
7568 -])# _LT_CMD_STRIPLIB
7569 -
7570 -
7571 -# _LT_SYS_DYNAMIC_LINKER([TAG])
7572 -# -----------------------------
7573 -# PORTME Fill in your ld.so characteristics
7574 -m4_defun([_LT_SYS_DYNAMIC_LINKER],
7575 -[AC_REQUIRE([AC_CANONICAL_HOST])dnl
7576 -m4_require([_LT_DECL_EGREP])dnl
7577 -m4_require([_LT_FILEUTILS_DEFAULTS])dnl
7578 -m4_require([_LT_DECL_OBJDUMP])dnl
7579 -m4_require([_LT_DECL_SED])dnl
7580 -m4_require([_LT_CHECK_SHELL_FEATURES])dnl
7581 -AC_MSG_CHECKING([dynamic linker characteristics])
7582 -m4_if([$1],
7583 - [], [
7584 -if test "$GCC" = yes; then
7585 - case $host_os in
7586 - darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
7587 - *) lt_awk_arg="/^libraries:/" ;;
7588 - esac
7589 - case $host_os in
7590 - mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
7591 - *) lt_sed_strip_eq="s,=/,/,g" ;;
7592 - esac
7593 - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
7594 - case $lt_search_path_spec in
7595 - *\;*)
7596 - # if the path contains ";" then we assume it to be the separator
7597 - # otherwise default to the standard path separator (i.e. ":") - it is
7598 - # assumed that no part of a normal pathname contains ";" but that should
7599 - # okay in the real world where ";" in dirpaths is itself problematic.
7600 - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
7601 - ;;
7602 - *)
7603 - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
7604 - ;;
7605 - esac
7606 - # Ok, now we have the path, separated by spaces, we can step through it
7607 - # and add multilib dir if necessary.
7608 - lt_tmp_lt_search_path_spec=
7609 - lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
7610 - for lt_sys_path in $lt_search_path_spec; do
7611 - if test -d "$lt_sys_path/$lt_multi_os_dir"; then
7612 - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
7613 - else
7614 - test -d "$lt_sys_path" && \
7615 - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
7616 - fi
7617 - done
7618 - lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
7619 -BEGIN {RS=" "; FS="/|\n";} {
7620 - lt_foo="";
7621 - lt_count=0;
7622 - for (lt_i = NF; lt_i > 0; lt_i--) {
7623 - if ($lt_i != "" && $lt_i != ".") {
7624 - if ($lt_i == "..") {
7625 - lt_count++;
7626 - } else {
7627 - if (lt_count == 0) {
7628 - lt_foo="/" $lt_i lt_foo;
7629 - } else {
7630 - lt_count--;
7631 - }
7632 - }
7633 - }
7634 - }
7635 - if (lt_foo != "") { lt_freq[[lt_foo]]++; }
7636 - if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
7637 -}'`
7638 - # AWK program above erroneously prepends '/' to C:/dos/paths
7639 - # for these hosts.
7640 - case $host_os in
7641 - mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
7642 - $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
7643 - esac
7644 - sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
7645 -else
7646 - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
7647 -fi])
7648 -library_names_spec=
7649 -libname_spec='lib$name'
7650 -soname_spec=
7651 -shrext_cmds=".so"
7652 -postinstall_cmds=
7653 -postuninstall_cmds=
7654 -finish_cmds=
7655 -finish_eval=
7656 -shlibpath_var=
7657 -shlibpath_overrides_runpath=unknown
7658 -version_type=none
7659 -dynamic_linker="$host_os ld.so"
7660 -sys_lib_dlsearch_path_spec="/lib /usr/lib"
7661 -need_lib_prefix=unknown
7662 -hardcode_into_libs=no
7663 -
7664 -# when you set need_version to no, make sure it does not cause -set_version
7665 -# flags to be left without arguments
7666 -need_version=unknown
7667 -
7668 -case $host_os in
7669 -aix3*)
7670 - version_type=linux
7671 - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
7672 - shlibpath_var=LIBPATH
7673 -
7674 - # AIX 3 has no versioning support, so we append a major version to the name.
7675 - soname_spec='${libname}${release}${shared_ext}$major'
7676 - ;;
7677 -
7678 -aix[[4-9]]*)
7679 - version_type=linux
7680 - need_lib_prefix=no
7681 - need_version=no
7682 - hardcode_into_libs=yes
7683 - if test "$host_cpu" = ia64; then
7684 - # AIX 5 supports IA64
7685 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
7686 - shlibpath_var=LD_LIBRARY_PATH
7687 - else
7688 - # With GCC up to 2.95.x, collect2 would create an import file
7689 - # for dependence libraries. The import file would start with
7690 - # the line `#! .'. This would cause the generated library to
7691 - # depend on `.', always an invalid library. This was fixed in
7692 - # development snapshots of GCC prior to 3.0.
7693 - case $host_os in
7694 - aix4 | aix4.[[01]] | aix4.[[01]].*)
7695 - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
7696 - echo ' yes '
7697 - echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
7698 - :
7699 - else
7700 - can_build_shared=no
7701 - fi
7702 - ;;
7703 - esac
7704 - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
7705 - # soname into executable. Probably we can add versioning support to
7706 - # collect2, so additional links can be useful in future.
7707 - if test "$aix_use_runtimelinking" = yes; then
7708 - # If using run time linking (on AIX 4.2 or later) use lib<name>.so
7709 - # instead of lib<name>.a to let people know that these are not
7710 - # typical AIX shared libraries.
7711 - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
7712 - else
7713 - # We preserve .a as extension for shared libraries through AIX4.2
7714 - # and later when we are not doing run time linking.
7715 - library_names_spec='${libname}${release}.a $libname.a'
7716 - soname_spec='${libname}${release}${shared_ext}$major'
7717 - fi
7718 - shlibpath_var=LIBPATH
7719 - fi
7720 - ;;
7721 -
7722 -amigaos*)
7723 - case $host_cpu in
7724 - powerpc)
7725 - # Since July 2007 AmigaOS4 officially supports .so libraries.
7726 - # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
7727 - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
7728 - ;;
7729 - m68k)
7730 - library_names_spec='$libname.ixlibrary $libname.a'
7731 - # Create ${libname}_ixlibrary.a entries in /sys/libs.
7732 - 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'
7733 - ;;
7734 - esac
7735 - ;;
7736 -
7737 -beos*)
7738 - library_names_spec='${libname}${shared_ext}'
7739 - dynamic_linker="$host_os ld.so"
7740 - shlibpath_var=LIBRARY_PATH
7741 - ;;
7742 -
7743 -bsdi[[45]]*)
7744 - version_type=linux
7745 - need_version=no
7746 - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
7747 - soname_spec='${libname}${release}${shared_ext}$major'
7748 - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
7749 - shlibpath_var=LD_LIBRARY_PATH
7750 - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
7751 - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
7752 - # the default ld.so.conf also contains /usr/contrib/lib and
7753 - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
7754 - # libtool to hard-code these into programs
7755 - ;;
7756 -
7757 -cygwin* | mingw* | pw32* | cegcc*)
7758 - version_type=windows
7759 - shrext_cmds=".dll"
7760 - need_version=no
7761 - need_lib_prefix=no
7762 -
7763 - case $GCC,$host_os in
7764 - yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
7765 - library_names_spec='$libname.dll.a'
7766 - # DLL is installed to $(libdir)/../bin by postinstall_cmds
7767 - postinstall_cmds='base_file=`basename \${file}`~
7768 - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
7769 - dldir=$destdir/`dirname \$dlpath`~
7770 - test -d \$dldir || mkdir -p \$dldir~
7771 - $install_prog $dir/$dlname \$dldir/$dlname~
7772 - chmod a+x \$dldir/$dlname~
7773 - if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
7774 - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
7775 - fi'
7776 - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
7777 - dlpath=$dir/\$dldll~
7778 - $RM \$dlpath'
7779 - shlibpath_overrides_runpath=yes
7780 -
7781 - case $host_os in
7782 - cygwin*)
7783 - # Cygwin DLLs use 'cyg' prefix rather than 'lib'
7784 - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
7785 -m4_if([$1], [],[
7786 - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
7787 - ;;
7788 - mingw* | cegcc*)
7789 - # MinGW DLLs use traditional 'lib' prefix
7790 - soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
7791 - ;;
7792 - pw32*)
7793 - # pw32 DLLs use 'pw' prefix rather than 'lib'
7794 - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
7795 - ;;
7796 - esac
7797 - ;;
7798 -
7799 - *)
7800 - library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
7801 - ;;
7802 - esac
7803 - dynamic_linker='Win32 ld.exe'
7804 - # FIXME: first we should search . and the directory the executable is in
7805 - shlibpath_var=PATH
7806 - ;;
7807 -
7808 -darwin* | rhapsody*)
7809 - dynamic_linker="$host_os dyld"
7810 - version_type=darwin
7811 - need_lib_prefix=no
7812 - need_version=no
7813 - library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
7814 - soname_spec='${libname}${release}${major}$shared_ext'
7815 - shlibpath_overrides_runpath=yes
7816 - shlibpath_var=DYLD_LIBRARY_PATH
7817 - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
7818 -m4_if([$1], [],[
7819 - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
7820 - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
7821 - ;;
7822 -
7823 -dgux*)
7824 - version_type=linux
7825 - need_lib_prefix=no
7826 - need_version=no
7827 - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
7828 - soname_spec='${libname}${release}${shared_ext}$major'
7829 - shlibpath_var=LD_LIBRARY_PATH
7830 - ;;
7831 -
7832 -freebsd1*)
7833 - dynamic_linker=no
7834 - ;;
7835 -
7836 -freebsd* | dragonfly*)
7837 - # DragonFly does not have aout. When/if they implement a new
7838 - # versioning mechanism, adjust this.
7839 - if test -x /usr/bin/objformat; then
7840 - objformat=`/usr/bin/objformat`
7841 - else
7842 - case $host_os in
7843 - freebsd[[123]]*) objformat=aout ;;
7844 - *) objformat=elf ;;
7845 - esac
7846 - fi
7847 - # Handle Gentoo/FreeBSD as it was Linux
7848 - case $host_vendor in
7849 - gentoo)
7850 - version_type=linux ;;
7851 - *)
7852 - version_type=freebsd-$objformat ;;
7853 - esac
7854 -
7855 - case $version_type in
7856 - freebsd-elf*)
7857 - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
7858 - need_version=no
7859 - need_lib_prefix=no
7860 - ;;
7861 - freebsd-*)
7862 - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
7863 - need_version=yes
7864 - ;;
7865 - linux)
7866 - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
7867 - soname_spec='${libname}${release}${shared_ext}$major'
7868 - need_lib_prefix=no
7869 - need_version=no
7870 - ;;
7871 - esac
7872 - shlibpath_var=LD_LIBRARY_PATH
7873 - case $host_os in
7874 - freebsd2*)
7875 - shlibpath_overrides_runpath=yes
7876 - ;;
7877 - freebsd3.[[01]]* | freebsdelf3.[[01]]*)
7878 - shlibpath_overrides_runpath=yes
7879 - hardcode_into_libs=yes
7880 - ;;
7881 - freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
7882 - freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
7883 - shlibpath_overrides_runpath=no
7884 - hardcode_into_libs=yes
7885 - ;;
7886 - *) # from 4.6 on, and DragonFly
7887 - shlibpath_overrides_runpath=yes
7888 - hardcode_into_libs=yes
7889 - ;;
7890 - esac
7891 - ;;
7892 -
7893 -gnu*)
7894 - version_type=linux
7895 - need_lib_prefix=no
7896 - need_version=no
7897 - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
7898 - soname_spec='${libname}${release}${shared_ext}$major'
7899 - shlibpath_var=LD_LIBRARY_PATH
7900 - hardcode_into_libs=yes
7901 - ;;
7902 -
7903 -haiku*)
7904 - version_type=linux
7905 - need_lib_prefix=no
7906 - need_version=no
7907 - dynamic_linker="$host_os runtime_loader"
7908 - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
7909 - soname_spec='${libname}${release}${shared_ext}$major'
7910 - shlibpath_var=LIBRARY_PATH
7911 - shlibpath_overrides_runpath=yes
7912 - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
7913 - hardcode_into_libs=yes
7914 - ;;
7915 -
7916 -hpux9* | hpux10* | hpux11*)
7917 - # Give a soname corresponding to the major version so that dld.sl refuses to
7918 - # link against other versions.
7919 - version_type=sunos
7920 - need_lib_prefix=no
7921 - need_version=no
7922 - case $host_cpu in
7923 - ia64*)
7924 - shrext_cmds='.so'
7925 - hardcode_into_libs=yes
7926 - dynamic_linker="$host_os dld.so"
7927 - shlibpath_var=LD_LIBRARY_PATH
7928 - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
7929 - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
7930 - soname_spec='${libname}${release}${shared_ext}$major'
7931 - if test "X$HPUX_IA64_MODE" = X32; then
7932 - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
7933 - else
7934 - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
7935 - fi
7936 - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
7937 - ;;
7938 - hppa*64*)
7939 - shrext_cmds='.sl'
7940 - hardcode_into_libs=yes
7941 - dynamic_linker="$host_os dld.sl"
7942 - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
7943 - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
7944 - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
7945 - soname_spec='${libname}${release}${shared_ext}$major'
7946 - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
7947 - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
7948 - ;;
7949 - *)
7950 - shrext_cmds='.sl'
7951 - dynamic_linker="$host_os dld.sl"
7952 - shlibpath_var=SHLIB_PATH
7953 - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
7954 - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
7955 - soname_spec='${libname}${release}${shared_ext}$major'
7956 - ;;
7957 - esac
7958 - # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
7959 - postinstall_cmds='chmod 555 $lib'
7960 - # or fails outright, so override atomically:
7961 - install_override_mode=555
7962 - ;;
7963 -
7964 -interix[[3-9]]*)
7965 - version_type=linux
7966 - need_lib_prefix=no
7967 - need_version=no
7968 - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
7969 - soname_spec='${libname}${release}${shared_ext}$major'
7970 - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
7971 - shlibpath_var=LD_LIBRARY_PATH
7972 - shlibpath_overrides_runpath=no
7973 - hardcode_into_libs=yes
7974 - ;;
7975 -
7976 -irix5* | irix6* | nonstopux*)
7977 - case $host_os in
7978 - nonstopux*) version_type=nonstopux ;;
7979 - *)
7980 - if test "$lt_cv_prog_gnu_ld" = yes; then
7981 - version_type=linux
7982 - else
7983 - version_type=irix
7984 - fi ;;
7985 - esac
7986 - need_lib_prefix=no
7987 - need_version=no
7988 - soname_spec='${libname}${release}${shared_ext}$major'
7989 - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
7990 - case $host_os in
7991 - irix5* | nonstopux*)
7992 - libsuff= shlibsuff=
7993 - ;;
7994 - *)
7995 - case $LD in # libtool.m4 will add one of these switches to LD
7996 - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
7997 - libsuff= shlibsuff= libmagic=32-bit;;
7998 - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
7999 - libsuff=32 shlibsuff=N32 libmagic=N32;;
8000 - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
8001 - libsuff=64 shlibsuff=64 libmagic=64-bit;;
8002 - *) libsuff= shlibsuff= libmagic=never-match;;
8003 - esac
8004 - ;;
8005 - esac
8006 - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
8007 - shlibpath_overrides_runpath=no
8008 - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
8009 - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
8010 - hardcode_into_libs=yes
8011 - ;;
8012 -
8013 -# No shared lib support for Linux oldld, aout, or coff.
8014 -linux*oldld* | linux*aout* | linux*coff*)
8015 - dynamic_linker=no
8016 - ;;
8017 -
8018 -# This must be Linux ELF.
8019 -linux* | k*bsd*-gnu | kopensolaris*-gnu)
8020 - version_type=linux
8021 - need_lib_prefix=no
8022 - need_version=no
8023 - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
8024 - soname_spec='${libname}${release}${shared_ext}$major'
8025 - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
8026 - shlibpath_var=LD_LIBRARY_PATH
8027 - shlibpath_overrides_runpath=no
8028 -
8029 - # Some binutils ld are patched to set DT_RUNPATH
8030 - AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
8031 - [lt_cv_shlibpath_overrides_runpath=no
8032 - save_LDFLAGS=$LDFLAGS
8033 - save_libdir=$libdir
8034 - eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
8035 - LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
8036 - AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
8037 - [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
8038 - [lt_cv_shlibpath_overrides_runpath=yes])])
8039 - LDFLAGS=$save_LDFLAGS
8040 - libdir=$save_libdir
8041 - ])
8042 - shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
8043 -
8044 - # This implies no fast_install, which is unacceptable.
8045 - # Some rework will be needed to allow for fast_install
8046 - # before this can be enabled.
8047 - hardcode_into_libs=yes
8048 -
8049 - # Append ld.so.conf contents to the search path
8050 - if test -f /etc/ld.so.conf; then
8051 - 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' ' '`
8052 - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
8053 - fi
8054 -
8055 - # We used to test for /lib/ld.so.1 and disable shared libraries on
8056 - # powerpc, because MkLinux only supported shared libraries with the
8057 - # GNU dynamic linker. Since this was broken with cross compilers,
8058 - # most powerpc-linux boxes support dynamic linking these days and
8059 - # people can always --disable-shared, the test was removed, and we
8060 - # assume the GNU/Linux dynamic linker is in use.
8061 - dynamic_linker='GNU/Linux ld.so'
8062 - ;;
8063 -
8064 -netbsd*)
8065 - version_type=sunos
8066 - need_lib_prefix=no
8067 - need_version=no
8068 - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
8069 - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
8070 - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
8071 - dynamic_linker='NetBSD (a.out) ld.so'
8072 - else
8073 - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
8074 - soname_spec='${libname}${release}${shared_ext}$major'
8075 - dynamic_linker='NetBSD ld.elf_so'
8076 - fi
8077 - shlibpath_var=LD_LIBRARY_PATH
8078 - shlibpath_overrides_runpath=yes
8079 - hardcode_into_libs=yes
8080 - ;;
8081 -
8082 -newsos6)
8083 - version_type=linux
8084 - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
8085 - shlibpath_var=LD_LIBRARY_PATH
8086 - shlibpath_overrides_runpath=yes
8087 - ;;
8088 -
8089 -*nto* | *qnx*)
8090 - version_type=qnx
8091 - need_lib_prefix=no
8092 - need_version=no
8093 - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
8094 - soname_spec='${libname}${release}${shared_ext}$major'
8095 - shlibpath_var=LD_LIBRARY_PATH
8096 - shlibpath_overrides_runpath=no
8097 - hardcode_into_libs=yes
8098 - dynamic_linker='ldqnx.so'
8099 - ;;
8100 -
8101 -openbsd*)
8102 - version_type=sunos
8103 - sys_lib_dlsearch_path_spec="/usr/lib"
8104 - need_lib_prefix=no
8105 - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
8106 - case $host_os in
8107 - openbsd3.3 | openbsd3.3.*) need_version=yes ;;
8108 - *) need_version=no ;;
8109 - esac
8110 - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
8111 - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
8112 - shlibpath_var=LD_LIBRARY_PATH
8113 - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
8114 - case $host_os in
8115 - openbsd2.[[89]] | openbsd2.[[89]].*)
8116 - shlibpath_overrides_runpath=no
8117 - ;;
8118 - *)
8119 - shlibpath_overrides_runpath=yes
8120 - ;;
8121 - esac
8122 - else
8123 - shlibpath_overrides_runpath=yes
8124 - fi
8125 - ;;
8126 -
8127 -os2*)
8128 - libname_spec='$name'
8129 - shrext_cmds=".dll"
8130 - need_lib_prefix=no
8131 - library_names_spec='$libname${shared_ext} $libname.a'
8132 - dynamic_linker='OS/2 ld.exe'
8133 - shlibpath_var=LIBPATH
8134 - ;;
8135 -
8136 -osf3* | osf4* | osf5*)
8137 - version_type=osf
8138 - need_lib_prefix=no
8139 - need_version=no
8140 - soname_spec='${libname}${release}${shared_ext}$major'
8141 - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
8142 - shlibpath_var=LD_LIBRARY_PATH
8143 - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
8144 - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
8145 - ;;
8146 -
8147 -rdos*)
8148 - dynamic_linker=no
8149 - ;;
8150 -
8151 -solaris*)
8152 - version_type=linux
8153 - need_lib_prefix=no
8154 - need_version=no
8155 - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
8156 - soname_spec='${libname}${release}${shared_ext}$major'
8157 - shlibpath_var=LD_LIBRARY_PATH
8158 - shlibpath_overrides_runpath=yes
8159 - hardcode_into_libs=yes
8160 - # ldd complains unless libraries are executable
8161 - postinstall_cmds='chmod +x $lib'
8162 - ;;
8163 -
8164 -sunos4*)
8165 - version_type=sunos
8166 - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
8167 - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
8168 - shlibpath_var=LD_LIBRARY_PATH
8169 - shlibpath_overrides_runpath=yes
8170 - if test "$with_gnu_ld" = yes; then
8171 - need_lib_prefix=no
8172 - fi
8173 - need_version=yes
8174 - ;;
8175 -
8176 -sysv4 | sysv4.3*)
8177 - version_type=linux
8178 - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
8179 - soname_spec='${libname}${release}${shared_ext}$major'
8180 - shlibpath_var=LD_LIBRARY_PATH
8181 - case $host_vendor in
8182 - sni)
8183 - shlibpath_overrides_runpath=no
8184 - need_lib_prefix=no
8185 - runpath_var=LD_RUN_PATH
8186 - ;;
8187 - siemens)
8188 - need_lib_prefix=no
8189 - ;;
8190 - motorola)
8191 - need_lib_prefix=no
8192 - need_version=no
8193 - shlibpath_overrides_runpath=no
8194 - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
8195 - ;;
8196 - esac
8197 - ;;
8198 -
8199 -sysv4*MP*)
8200 - if test -d /usr/nec ;then
8201 - version_type=linux
8202 - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
8203 - soname_spec='$libname${shared_ext}.$major'
8204 - shlibpath_var=LD_LIBRARY_PATH
8205 - fi
8206 - ;;
8207 -
8208 -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
8209 - version_type=freebsd-elf
8210 - need_lib_prefix=no
8211 - need_version=no
8212 - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
8213 - soname_spec='${libname}${release}${shared_ext}$major'
8214 - shlibpath_var=LD_LIBRARY_PATH
8215 - shlibpath_overrides_runpath=yes
8216 - hardcode_into_libs=yes
8217 - if test "$with_gnu_ld" = yes; then
8218 - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
8219 - else
8220 - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
8221 - case $host_os in
8222 - sco3.2v5*)
8223 - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
8224 - ;;
8225 - esac
8226 - fi
8227 - sys_lib_dlsearch_path_spec='/usr/lib'
8228 - ;;
8229 -
8230 -tpf*)
8231 - # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
8232 - version_type=linux
8233 - need_lib_prefix=no
8234 - need_version=no
8235 - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
8236 - shlibpath_var=LD_LIBRARY_PATH
8237 - shlibpath_overrides_runpath=no
8238 - hardcode_into_libs=yes
8239 - ;;
8240 -
8241 -uts4*)
8242 - version_type=linux
8243 - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
8244 - soname_spec='${libname}${release}${shared_ext}$major'
8245 - shlibpath_var=LD_LIBRARY_PATH
8246 - ;;
8247 -
8248 -*)
8249 - dynamic_linker=no
8250 - ;;
8251 -esac
8252 -AC_MSG_RESULT([$dynamic_linker])
8253 -test "$dynamic_linker" = no && can_build_shared=no
8254 -
8255 -variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
8256 -if test "$GCC" = yes; then
8257 - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
8258 -fi
8259 -
8260 -if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
8261 - sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
8262 -fi
8263 -if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
8264 - sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
8265 -fi
8266 -
8267 -_LT_DECL([], [variables_saved_for_relink], [1],
8268 - [Variables whose values should be saved in libtool wrapper scripts and
8269 - restored at link time])
8270 -_LT_DECL([], [need_lib_prefix], [0],
8271 - [Do we need the "lib" prefix for modules?])
8272 -_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
8273 -_LT_DECL([], [version_type], [0], [Library versioning type])
8274 -_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable])
8275 -_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
8276 -_LT_DECL([], [shlibpath_overrides_runpath], [0],
8277 - [Is shlibpath searched before the hard-coded library search path?])
8278 -_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
8279 -_LT_DECL([], [library_names_spec], [1],
8280 - [[List of archive names. First name is the real one, the rest are links.
8281 - The last name is the one that the linker finds with -lNAME]])
8282 -_LT_DECL([], [soname_spec], [1],
8283 - [[The coded name of the library, if different from the real name]])
8284 -_LT_DECL([], [install_override_mode], [1],
8285 - [Permission mode override for installation of shared libraries])
8286 -_LT_DECL([], [postinstall_cmds], [2],
8287 - [Command to use after installation of a shared archive])
8288 -_LT_DECL([], [postuninstall_cmds], [2],
8289 - [Command to use after uninstallation of a shared archive])
8290 -_LT_DECL([], [finish_cmds], [2],
8291 - [Commands used to finish a libtool library installation in a directory])
8292 -_LT_DECL([], [finish_eval], [1],
8293 - [[As "finish_cmds", except a single script fragment to be evaled but
8294 - not shown]])
8295 -_LT_DECL([], [hardcode_into_libs], [0],
8296 - [Whether we should hardcode library paths into libraries])
8297 -_LT_DECL([], [sys_lib_search_path_spec], [2],
8298 - [Compile-time system search path for libraries])
8299 -_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
8300 - [Run-time system search path for libraries])
8301 -])# _LT_SYS_DYNAMIC_LINKER
8302 -
8303 -
8304 -# _LT_PATH_TOOL_PREFIX(TOOL)
8305 -# --------------------------
8306 -# find a file program which can recognize shared library
8307 -AC_DEFUN([_LT_PATH_TOOL_PREFIX],
8308 -[m4_require([_LT_DECL_EGREP])dnl
8309 -AC_MSG_CHECKING([for $1])
8310 -AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
8311 -[case $MAGIC_CMD in
8312 -[[\\/*] | ?:[\\/]*])
8313 - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
8314 - ;;
8315 -*)
8316 - lt_save_MAGIC_CMD="$MAGIC_CMD"
8317 - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
8318 -dnl $ac_dummy forces splitting on constant user-supplied paths.
8319 -dnl POSIX.2 word splitting is done only on the output of word expansions,
8320 -dnl not every word. This closes a longstanding sh security hole.
8321 - ac_dummy="m4_if([$2], , $PATH, [$2])"
8322 - for ac_dir in $ac_dummy; do
8323 - IFS="$lt_save_ifs"
8324 - test -z "$ac_dir" && ac_dir=.
8325 - if test -f $ac_dir/$1; then
8326 - lt_cv_path_MAGIC_CMD="$ac_dir/$1"
8327 - if test -n "$file_magic_test_file"; then
8328 - case $deplibs_check_method in
8329 - "file_magic "*)
8330 - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
8331 - MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
8332 - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
8333 - $EGREP "$file_magic_regex" > /dev/null; then
8334 - :
8335 - else
8336 - cat <<_LT_EOF 1>&2
8337 -
8338 -*** Warning: the command libtool uses to detect shared libraries,
8339 -*** $file_magic_cmd, produces output that libtool cannot recognize.
8340 -*** The result is that libtool may fail to recognize shared libraries
8341 -*** as such. This will affect the creation of libtool libraries that
8342 -*** depend on shared libraries, but programs linked with such libtool
8343 -*** libraries will work regardless of this problem. Nevertheless, you
8344 -*** may want to report the problem to your system manager and/or to
8345 -*** bug-libtool@×××.org
8346 -
8347 -_LT_EOF
8348 - fi ;;
8349 - esac
8350 - fi
8351 - break
8352 - fi
8353 - done
8354 - IFS="$lt_save_ifs"
8355 - MAGIC_CMD="$lt_save_MAGIC_CMD"
8356 - ;;
8357 -esac])
8358 -MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
8359 -if test -n "$MAGIC_CMD"; then
8360 - AC_MSG_RESULT($MAGIC_CMD)
8361 -else
8362 - AC_MSG_RESULT(no)
8363 -fi
8364 -_LT_DECL([], [MAGIC_CMD], [0],
8365 - [Used to examine libraries when file_magic_cmd begins with "file"])dnl
8366 -])# _LT_PATH_TOOL_PREFIX
8367 -
8368 -# Old name:
8369 -AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
8370 -dnl aclocal-1.4 backwards compatibility:
8371 -dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
8372 -
8373 -
8374 -# _LT_PATH_MAGIC
8375 -# --------------
8376 -# find a file program which can recognize a shared library
8377 -m4_defun([_LT_PATH_MAGIC],
8378 -[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
8379 -if test -z "$lt_cv_path_MAGIC_CMD"; then
8380 - if test -n "$ac_tool_prefix"; then
8381 - _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
8382 - else
8383 - MAGIC_CMD=:
8384 - fi
8385 -fi
8386 -])# _LT_PATH_MAGIC
8387 -
8388 -
8389 -# LT_PATH_LD
8390 -# ----------
8391 -# find the pathname to the GNU or non-GNU linker
8392 -AC_DEFUN([LT_PATH_LD],
8393 -[AC_REQUIRE([AC_PROG_CC])dnl
8394 -AC_REQUIRE([AC_CANONICAL_HOST])dnl
8395 -AC_REQUIRE([AC_CANONICAL_BUILD])dnl
8396 -m4_require([_LT_DECL_SED])dnl
8397 -m4_require([_LT_DECL_EGREP])dnl
8398 -m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
8399 -
8400 -AC_ARG_WITH([gnu-ld],
8401 - [AS_HELP_STRING([--with-gnu-ld],
8402 - [assume the C compiler uses GNU ld @<:@default=no@:>@])],
8403 - [test "$withval" = no || with_gnu_ld=yes],
8404 - [with_gnu_ld=no])dnl
8405 -
8406 -ac_prog=ld
8407 -if test "$GCC" = yes; then
8408 - # Check if gcc -print-prog-name=ld gives a path.
8409 - AC_MSG_CHECKING([for ld used by $CC])
8410 - case $host in
8411 - *-*-mingw*)
8412 - # gcc leaves a trailing carriage return which upsets mingw
8413 - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
8414 - *)
8415 - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
8416 - esac
8417 - case $ac_prog in
8418 - # Accept absolute paths.
8419 - [[\\/]]* | ?:[[\\/]]*)
8420 - re_direlt='/[[^/]][[^/]]*/\.\./'
8421 - # Canonicalize the pathname of ld
8422 - ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
8423 - while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
8424 - ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
8425 - done
8426 - test -z "$LD" && LD="$ac_prog"
8427 - ;;
8428 - "")
8429 - # If it fails, then pretend we aren't using GCC.
8430 - ac_prog=ld
8431 - ;;
8432 - *)
8433 - # If it is relative, then search for the first ld in PATH.
8434 - with_gnu_ld=unknown
8435 - ;;
8436 - esac
8437 -elif test "$with_gnu_ld" = yes; then
8438 - AC_MSG_CHECKING([for GNU ld])
8439 -else
8440 - AC_MSG_CHECKING([for non-GNU ld])
8441 -fi
8442 -AC_CACHE_VAL(lt_cv_path_LD,
8443 -[if test -z "$LD"; then
8444 - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
8445 - for ac_dir in $PATH; do
8446 - IFS="$lt_save_ifs"
8447 - test -z "$ac_dir" && ac_dir=.
8448 - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
8449 - lt_cv_path_LD="$ac_dir/$ac_prog"
8450 - # Check to see if the program is GNU ld. I'd rather use --version,
8451 - # but apparently some variants of GNU ld only accept -v.
8452 - # Break only if it was the GNU/non-GNU ld that we prefer.
8453 - case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
8454 - *GNU* | *'with BFD'*)
8455 - test "$with_gnu_ld" != no && break
8456 - ;;
8457 - *)
8458 - test "$with_gnu_ld" != yes && break
8459 - ;;
8460 - esac
8461 - fi
8462 - done
8463 - IFS="$lt_save_ifs"
8464 -else
8465 - lt_cv_path_LD="$LD" # Let the user override the test with a path.
8466 -fi])
8467 -LD="$lt_cv_path_LD"
8468 -if test -n "$LD"; then
8469 - AC_MSG_RESULT($LD)
8470 -else
8471 - AC_MSG_RESULT(no)
8472 -fi
8473 -test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
8474 -_LT_PATH_LD_GNU
8475 -AC_SUBST([LD])
8476 -
8477 -_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
8478 -])# LT_PATH_LD
8479 -
8480 -# Old names:
8481 -AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
8482 -AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
8483 -dnl aclocal-1.4 backwards compatibility:
8484 -dnl AC_DEFUN([AM_PROG_LD], [])
8485 -dnl AC_DEFUN([AC_PROG_LD], [])
8486 -
8487 -
8488 -# _LT_PATH_LD_GNU
8489 -#- --------------
8490 -m4_defun([_LT_PATH_LD_GNU],
8491 -[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
8492 -[# I'd rather use --version here, but apparently some GNU lds only accept -v.
8493 -case `$LD -v 2>&1 </dev/null` in
8494 -*GNU* | *'with BFD'*)
8495 - lt_cv_prog_gnu_ld=yes
8496 - ;;
8497 -*)
8498 - lt_cv_prog_gnu_ld=no
8499 - ;;
8500 -esac])
8501 -with_gnu_ld=$lt_cv_prog_gnu_ld
8502 -])# _LT_PATH_LD_GNU
8503 -
8504 -
8505 -# _LT_CMD_RELOAD
8506 -# --------------
8507 -# find reload flag for linker
8508 -# -- PORTME Some linkers may need a different reload flag.
8509 -m4_defun([_LT_CMD_RELOAD],
8510 -[AC_CACHE_CHECK([for $LD option to reload object files],
8511 - lt_cv_ld_reload_flag,
8512 - [lt_cv_ld_reload_flag='-r'])
8513 -reload_flag=$lt_cv_ld_reload_flag
8514 -case $reload_flag in
8515 -"" | " "*) ;;
8516 -*) reload_flag=" $reload_flag" ;;
8517 -esac
8518 -reload_cmds='$LD$reload_flag -o $output$reload_objs'
8519 -case $host_os in
8520 - darwin*)
8521 - if test "$GCC" = yes; then
8522 - reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
8523 - else
8524 - reload_cmds='$LD$reload_flag -o $output$reload_objs'
8525 - fi
8526 - ;;
8527 -esac
8528 -_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
8529 -_LT_TAGDECL([], [reload_cmds], [2])dnl
8530 -])# _LT_CMD_RELOAD
8531 -
8532 -
8533 -# _LT_CHECK_MAGIC_METHOD
8534 -# ----------------------
8535 -# how to check for library dependencies
8536 -# -- PORTME fill in with the dynamic library characteristics
8537 -m4_defun([_LT_CHECK_MAGIC_METHOD],
8538 -[m4_require([_LT_DECL_EGREP])
8539 -m4_require([_LT_DECL_OBJDUMP])
8540 -AC_CACHE_CHECK([how to recognize dependent libraries],
8541 -lt_cv_deplibs_check_method,
8542 -[lt_cv_file_magic_cmd='$MAGIC_CMD'
8543 -lt_cv_file_magic_test_file=
8544 -lt_cv_deplibs_check_method='unknown'
8545 -# Need to set the preceding variable on all platforms that support
8546 -# interlibrary dependencies.
8547 -# 'none' -- dependencies not supported.
8548 -# `unknown' -- same as none, but documents that we really don't know.
8549 -# 'pass_all' -- all dependencies passed with no checks.
8550 -# 'test_compile' -- check by making test program.
8551 -# 'file_magic [[regex]]' -- check by looking for files in library path
8552 -# which responds to the $file_magic_cmd with a given extended regex.
8553 -# If you have `file' or equivalent on your system and you're not sure
8554 -# whether `pass_all' will *always* work, you probably want this one.
8555 -
8556 -case $host_os in
8557 -aix[[4-9]]*)
8558 - lt_cv_deplibs_check_method=pass_all
8559 - ;;
8560 -
8561 -beos*)
8562 - lt_cv_deplibs_check_method=pass_all
8563 - ;;
8564 -
8565 -bsdi[[45]]*)
8566 - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
8567 - lt_cv_file_magic_cmd='/usr/bin/file -L'
8568 - lt_cv_file_magic_test_file=/shlib/libc.so
8569 - ;;
8570 -
8571 -cygwin*)
8572 - # func_win32_libid is a shell function defined in ltmain.sh
8573 - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
8574 - lt_cv_file_magic_cmd='func_win32_libid'
8575 - ;;
8576 -
8577 -mingw* | pw32*)
8578 - # Base MSYS/MinGW do not provide the 'file' command needed by
8579 - # func_win32_libid shell function, so use a weaker test based on 'objdump',
8580 - # unless we find 'file', for example because we are cross-compiling.
8581 - # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
8582 - if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
8583 - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
8584 - lt_cv_file_magic_cmd='func_win32_libid'
8585 - else
8586 - # Keep this pattern in sync with the one in func_win32_libid.
8587 - lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
8588 - lt_cv_file_magic_cmd='$OBJDUMP -f'
8589 - fi
8590 - ;;
8591 -
8592 -cegcc*)
8593 - # use the weaker test based on 'objdump'. See mingw*.
8594 - lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
8595 - lt_cv_file_magic_cmd='$OBJDUMP -f'
8596 - ;;
8597 -
8598 -darwin* | rhapsody*)
8599 - lt_cv_deplibs_check_method=pass_all
8600 - ;;
8601 -
8602 -freebsd* | dragonfly*)
8603 - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
8604 - case $host_cpu in
8605 - i*86 )
8606 - # Not sure whether the presence of OpenBSD here was a mistake.
8607 - # Let's accept both of them until this is cleared up.
8608 - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
8609 - lt_cv_file_magic_cmd=/usr/bin/file
8610 - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
8611 - ;;
8612 - esac
8613 - else
8614 - lt_cv_deplibs_check_method=pass_all
8615 - fi
8616 - ;;
8617 -
8618 -gnu*)
8619 - lt_cv_deplibs_check_method=pass_all
8620 - ;;
8621 -
8622 -haiku*)
8623 - lt_cv_deplibs_check_method=pass_all
8624 - ;;
8625 -
8626 -hpux10.20* | hpux11*)
8627 - lt_cv_file_magic_cmd=/usr/bin/file
8628 - case $host_cpu in
8629 - ia64*)
8630 - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
8631 - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
8632 - ;;
8633 - hppa*64*)
8634 - [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]']
8635 - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
8636 - ;;
8637 - *)
8638 - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
8639 - lt_cv_file_magic_test_file=/usr/lib/libc.sl
8640 - ;;
8641 - esac
8642 - ;;
8643 -
8644 -interix[[3-9]]*)
8645 - # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
8646 - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
8647 - ;;
8648 -
8649 -irix5* | irix6* | nonstopux*)
8650 - case $LD in
8651 - *-32|*"-32 ") libmagic=32-bit;;
8652 - *-n32|*"-n32 ") libmagic=N32;;
8653 - *-64|*"-64 ") libmagic=64-bit;;
8654 - *) libmagic=never-match;;
8655 - esac
8656 - lt_cv_deplibs_check_method=pass_all
8657 - ;;
8658 -
8659 -# This must be Linux ELF.
8660 -linux* | k*bsd*-gnu | kopensolaris*-gnu)
8661 - lt_cv_deplibs_check_method=pass_all
8662 - ;;
8663 -
8664 -netbsd*)
8665 - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
8666 - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
8667 - else
8668 - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
8669 - fi
8670 - ;;
8671 -
8672 -newos6*)
8673 - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
8674 - lt_cv_file_magic_cmd=/usr/bin/file
8675 - lt_cv_file_magic_test_file=/usr/lib/libnls.so
8676 - ;;
8677 -
8678 -*nto* | *qnx*)
8679 - lt_cv_deplibs_check_method=pass_all
8680 - ;;
8681 -
8682 -openbsd*)
8683 - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
8684 - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
8685 - else
8686 - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
8687 - fi
8688 - ;;
8689 -
8690 -osf3* | osf4* | osf5*)
8691 - lt_cv_deplibs_check_method=pass_all
8692 - ;;
8693 -
8694 -rdos*)
8695 - lt_cv_deplibs_check_method=pass_all
8696 - ;;
8697 -
8698 -solaris*)
8699 - lt_cv_deplibs_check_method=pass_all
8700 - ;;
8701 -
8702 -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
8703 - lt_cv_deplibs_check_method=pass_all
8704 - ;;
8705 -
8706 -sysv4 | sysv4.3*)
8707 - case $host_vendor in
8708 - motorola)
8709 - 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]]'
8710 - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
8711 - ;;
8712 - ncr)
8713 - lt_cv_deplibs_check_method=pass_all
8714 - ;;
8715 - sequent)
8716 - lt_cv_file_magic_cmd='/bin/file'
8717 - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
8718 - ;;
8719 - sni)
8720 - lt_cv_file_magic_cmd='/bin/file'
8721 - lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
8722 - lt_cv_file_magic_test_file=/lib/libc.so
8723 - ;;
8724 - siemens)
8725 - lt_cv_deplibs_check_method=pass_all
8726 - ;;
8727 - pc)
8728 - lt_cv_deplibs_check_method=pass_all
8729 - ;;
8730 - esac
8731 - ;;
8732 -
8733 -tpf*)
8734 - lt_cv_deplibs_check_method=pass_all
8735 - ;;
8736 -esac
8737 -])
8738 -file_magic_cmd=$lt_cv_file_magic_cmd
8739 -deplibs_check_method=$lt_cv_deplibs_check_method
8740 -test -z "$deplibs_check_method" && deplibs_check_method=unknown
8741 -
8742 -_LT_DECL([], [deplibs_check_method], [1],
8743 - [Method to check whether dependent libraries are shared objects])
8744 -_LT_DECL([], [file_magic_cmd], [1],
8745 - [Command to use when deplibs_check_method == "file_magic"])
8746 -])# _LT_CHECK_MAGIC_METHOD
8747 -
8748 -
8749 -# LT_PATH_NM
8750 -# ----------
8751 -# find the pathname to a BSD- or MS-compatible name lister
8752 -AC_DEFUN([LT_PATH_NM],
8753 -[AC_REQUIRE([AC_PROG_CC])dnl
8754 -AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
8755 -[if test -n "$NM"; then
8756 - # Let the user override the test.
8757 - lt_cv_path_NM="$NM"
8758 -else
8759 - lt_nm_to_check="${ac_tool_prefix}nm"
8760 - if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
8761 - lt_nm_to_check="$lt_nm_to_check nm"
8762 - fi
8763 - for lt_tmp_nm in $lt_nm_to_check; do
8764 - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
8765 - for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
8766 - IFS="$lt_save_ifs"
8767 - test -z "$ac_dir" && ac_dir=.
8768 - tmp_nm="$ac_dir/$lt_tmp_nm"
8769 - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
8770 - # Check to see if the nm accepts a BSD-compat flag.
8771 - # Adding the `sed 1q' prevents false positives on HP-UX, which says:
8772 - # nm: unknown option "B" ignored
8773 - # Tru64's nm complains that /dev/null is an invalid object file
8774 - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
8775 - */dev/null* | *'Invalid file or object type'*)
8776 - lt_cv_path_NM="$tmp_nm -B"
8777 - break
8778 - ;;
8779 - *)
8780 - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
8781 - */dev/null*)
8782 - lt_cv_path_NM="$tmp_nm -p"
8783 - break
8784 - ;;
8785 - *)
8786 - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
8787 - continue # so that we can try to find one that supports BSD flags
8788 - ;;
8789 - esac
8790 - ;;
8791 - esac
8792 - fi
8793 - done
8794 - IFS="$lt_save_ifs"
8795 - done
8796 - : ${lt_cv_path_NM=no}
8797 -fi])
8798 -if test "$lt_cv_path_NM" != "no"; then
8799 - NM="$lt_cv_path_NM"
8800 -else
8801 - # Didn't find any BSD compatible name lister, look for dumpbin.
8802 - if test -n "$DUMPBIN"; then :
8803 - # Let the user override the test.
8804 - else
8805 - AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
8806 - case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
8807 - *COFF*)
8808 - DUMPBIN="$DUMPBIN -symbols"
8809 - ;;
8810 - *)
8811 - DUMPBIN=:
8812 - ;;
8813 - esac
8814 - fi
8815 - AC_SUBST([DUMPBIN])
8816 - if test "$DUMPBIN" != ":"; then
8817 - NM="$DUMPBIN"
8818 - fi
8819 -fi
8820 -test -z "$NM" && NM=nm
8821 -AC_SUBST([NM])
8822 -_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
8823 -
8824 -AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
8825 - [lt_cv_nm_interface="BSD nm"
8826 - echo "int some_variable = 0;" > conftest.$ac_ext
8827 - (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
8828 - (eval "$ac_compile" 2>conftest.err)
8829 - cat conftest.err >&AS_MESSAGE_LOG_FD
8830 - (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
8831 - (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
8832 - cat conftest.err >&AS_MESSAGE_LOG_FD
8833 - (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
8834 - cat conftest.out >&AS_MESSAGE_LOG_FD
8835 - if $GREP 'External.*some_variable' conftest.out > /dev/null; then
8836 - lt_cv_nm_interface="MS dumpbin"
8837 - fi
8838 - rm -f conftest*])
8839 -])# LT_PATH_NM
8840 -
8841 -# Old names:
8842 -AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
8843 -AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
8844 -dnl aclocal-1.4 backwards compatibility:
8845 -dnl AC_DEFUN([AM_PROG_NM], [])
8846 -dnl AC_DEFUN([AC_PROG_NM], [])
8847 -
8848 -
8849 -# LT_LIB_M
8850 -# --------
8851 -# check for math library
8852 -AC_DEFUN([LT_LIB_M],
8853 -[AC_REQUIRE([AC_CANONICAL_HOST])dnl
8854 -LIBM=
8855 -case $host in
8856 -*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
8857 - # These system don't have libm, or don't need it
8858 - ;;
8859 -*-ncr-sysv4.3*)
8860 - AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
8861 - AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
8862 - ;;
8863 -*)
8864 - AC_CHECK_LIB(m, cos, LIBM="-lm")
8865 - ;;
8866 -esac
8867 -AC_SUBST([LIBM])
8868 -])# LT_LIB_M
8869 -
8870 -# Old name:
8871 -AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
8872 -dnl aclocal-1.4 backwards compatibility:
8873 -dnl AC_DEFUN([AC_CHECK_LIBM], [])
8874 -
8875 -
8876 -# _LT_COMPILER_NO_RTTI([TAGNAME])
8877 -# -------------------------------
8878 -m4_defun([_LT_COMPILER_NO_RTTI],
8879 -[m4_require([_LT_TAG_COMPILER])dnl
8880 -
8881 -_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
8882 -
8883 -if test "$GCC" = yes; then
8884 - case $cc_basename in
8885 - nvcc*)
8886 - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
8887 - *)
8888 - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
8889 - esac
8890 -
8891 - _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
8892 - lt_cv_prog_compiler_rtti_exceptions,
8893 - [-fno-rtti -fno-exceptions], [],
8894 - [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
8895 -fi
8896 -_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
8897 - [Compiler flag to turn off builtin functions])
8898 -])# _LT_COMPILER_NO_RTTI
8899 -
8900 -
8901 -# _LT_CMD_GLOBAL_SYMBOLS
8902 -# ----------------------
8903 -m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
8904 -[AC_REQUIRE([AC_CANONICAL_HOST])dnl
8905 -AC_REQUIRE([AC_PROG_CC])dnl
8906 -AC_REQUIRE([AC_PROG_AWK])dnl
8907 -AC_REQUIRE([LT_PATH_NM])dnl
8908 -AC_REQUIRE([LT_PATH_LD])dnl
8909 -m4_require([_LT_DECL_SED])dnl
8910 -m4_require([_LT_DECL_EGREP])dnl
8911 -m4_require([_LT_TAG_COMPILER])dnl
8912 -
8913 -# Check for command to grab the raw symbol name followed by C symbol from nm.
8914 -AC_MSG_CHECKING([command to parse $NM output from $compiler object])
8915 -AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
8916 -[
8917 -# These are sane defaults that work on at least a few old systems.
8918 -# [They come from Ultrix. What could be older than Ultrix?!! ;)]
8919 -
8920 -# Character class describing NM global symbol codes.
8921 -symcode='[[BCDEGRST]]'
8922 -
8923 -# Regexp to match symbols that can be accessed directly from C.
8924 -sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
8925 -
8926 -# Define system-specific variables.
8927 -case $host_os in
8928 -aix*)
8929 - symcode='[[BCDT]]'
8930 - ;;
8931 -cygwin* | mingw* | pw32* | cegcc*)
8932 - symcode='[[ABCDGISTW]]'
8933 - ;;
8934 -hpux*)
8935 - if test "$host_cpu" = ia64; then
8936 - symcode='[[ABCDEGRST]]'
8937 - fi
8938 - ;;
8939 -irix* | nonstopux*)
8940 - symcode='[[BCDEGRST]]'
8941 - ;;
8942 -osf*)
8943 - symcode='[[BCDEGQRST]]'
8944 - ;;
8945 -solaris*)
8946 - symcode='[[BDRT]]'
8947 - ;;
8948 -sco3.2v5*)
8949 - symcode='[[DT]]'
8950 - ;;
8951 -sysv4.2uw2*)
8952 - symcode='[[DT]]'
8953 - ;;
8954 -sysv5* | sco5v6* | unixware* | OpenUNIX*)
8955 - symcode='[[ABDT]]'
8956 - ;;
8957 -sysv4)
8958 - symcode='[[DFNSTU]]'
8959 - ;;
8960 -esac
8961 -
8962 -# If we're using GNU nm, then use its standard symbol codes.
8963 -case `$NM -V 2>&1` in
8964 -*GNU* | *'with BFD'*)
8965 - symcode='[[ABCDGIRSTW]]' ;;
8966 -esac
8967 -
8968 -# Transform an extracted symbol line into a proper C declaration.
8969 -# Some systems (esp. on ia64) link data and code symbols differently,
8970 -# so use this general approach.
8971 -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
8972 -
8973 -# Transform an extracted symbol line into symbol name and symbol address
8974 -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'"
8975 -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'"
8976 -
8977 -# Handle CRLF in mingw tool chain
8978 -opt_cr=
8979 -case $build_os in
8980 -mingw*)
8981 - opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
8982 - ;;
8983 -esac
8984 -
8985 -# Try without a prefix underscore, then with it.
8986 -for ac_symprfx in "" "_"; do
8987 -
8988 - # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
8989 - symxfrm="\\1 $ac_symprfx\\2 \\2"
8990 -
8991 - # Write the raw and C identifiers.
8992 - if test "$lt_cv_nm_interface" = "MS dumpbin"; then
8993 - # Fake it for dumpbin and say T for any non-static function
8994 - # and D for any global variable.
8995 - # Also find C++ and __fastcall symbols from MSVC++,
8996 - # which start with @ or ?.
8997 - lt_cv_sys_global_symbol_pipe="$AWK ['"\
8998 -" {last_section=section; section=\$ 3};"\
8999 -" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
9000 -" \$ 0!~/External *\|/{next};"\
9001 -" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
9002 -" {if(hide[section]) next};"\
9003 -" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
9004 -" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
9005 -" s[1]~/^[@?]/{print s[1], s[1]; next};"\
9006 -" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
9007 -" ' prfx=^$ac_symprfx]"
9008 - else
9009 - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
9010 - fi
9011 -
9012 - # Check to see that the pipe works correctly.
9013 - pipe_works=no
9014 -
9015 - rm -f conftest*
9016 - cat > conftest.$ac_ext <<_LT_EOF
9017 -#ifdef __cplusplus
9018 -extern "C" {
9019 -#endif
9020 -char nm_test_var;
9021 -void nm_test_func(void);
9022 -void nm_test_func(void){}
9023 -#ifdef __cplusplus
9024 -}
9025 -#endif
9026 -int main(){nm_test_var='a';nm_test_func();return(0);}
9027 -_LT_EOF
9028 -
9029 - if AC_TRY_EVAL(ac_compile); then
9030 - # Now try to grab the symbols.
9031 - nlist=conftest.nm
9032 - if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
9033 - # Try sorting and uniquifying the output.
9034 - if sort "$nlist" | uniq > "$nlist"T; then
9035 - mv -f "$nlist"T "$nlist"
9036 - else
9037 - rm -f "$nlist"T
9038 - fi
9039 -
9040 - # Make sure that we snagged all the symbols we need.
9041 - if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
9042 - if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
9043 - cat <<_LT_EOF > conftest.$ac_ext
9044 -#ifdef __cplusplus
9045 -extern "C" {
9046 -#endif
9047 -
9048 -_LT_EOF
9049 - # Now generate the symbol file.
9050 - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
9051 -
9052 - cat <<_LT_EOF >> conftest.$ac_ext
9053 -
9054 -/* The mapping between symbol names and symbols. */
9055 -const struct {
9056 - const char *name;
9057 - void *address;
9058 -}
9059 -lt__PROGRAM__LTX_preloaded_symbols[[]] =
9060 -{
9061 - { "@PROGRAM@", (void *) 0 },
9062 -_LT_EOF
9063 - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
9064 - cat <<\_LT_EOF >> conftest.$ac_ext
9065 - {0, (void *) 0}
9066 -};
9067 -
9068 -/* This works around a problem in FreeBSD linker */
9069 -#ifdef FREEBSD_WORKAROUND
9070 -static const void *lt_preloaded_setup() {
9071 - return lt__PROGRAM__LTX_preloaded_symbols;
9072 -}
9073 -#endif
9074 -
9075 -#ifdef __cplusplus
9076 -}
9077 -#endif
9078 -_LT_EOF
9079 - # Now try linking the two files.
9080 - mv conftest.$ac_objext conftstm.$ac_objext
9081 - lt_save_LIBS="$LIBS"
9082 - lt_save_CFLAGS="$CFLAGS"
9083 - LIBS="conftstm.$ac_objext"
9084 - CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
9085 - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
9086 - pipe_works=yes
9087 - fi
9088 - LIBS="$lt_save_LIBS"
9089 - CFLAGS="$lt_save_CFLAGS"
9090 - else
9091 - echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
9092 - fi
9093 - else
9094 - echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
9095 - fi
9096 - else
9097 - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
9098 - fi
9099 - else
9100 - echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
9101 - cat conftest.$ac_ext >&5
9102 - fi
9103 - rm -rf conftest* conftst*
9104 -
9105 - # Do not use the global_symbol_pipe unless it works.
9106 - if test "$pipe_works" = yes; then
9107 - break
9108 - else
9109 - lt_cv_sys_global_symbol_pipe=
9110 - fi
9111 -done
9112 -])
9113 -if test -z "$lt_cv_sys_global_symbol_pipe"; then
9114 - lt_cv_sys_global_symbol_to_cdecl=
9115 -fi
9116 -if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
9117 - AC_MSG_RESULT(failed)
9118 -else
9119 - AC_MSG_RESULT(ok)
9120 -fi
9121 -
9122 -_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
9123 - [Take the output of nm and produce a listing of raw symbols and C names])
9124 -_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
9125 - [Transform the output of nm in a proper C declaration])
9126 -_LT_DECL([global_symbol_to_c_name_address],
9127 - [lt_cv_sys_global_symbol_to_c_name_address], [1],
9128 - [Transform the output of nm in a C name address pair])
9129 -_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
9130 - [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
9131 - [Transform the output of nm in a C name address pair when lib prefix is needed])
9132 -]) # _LT_CMD_GLOBAL_SYMBOLS
9133 -
9134 -
9135 -# _LT_COMPILER_PIC([TAGNAME])
9136 -# ---------------------------
9137 -m4_defun([_LT_COMPILER_PIC],
9138 -[m4_require([_LT_TAG_COMPILER])dnl
9139 -_LT_TAGVAR(lt_prog_compiler_wl, $1)=
9140 -_LT_TAGVAR(lt_prog_compiler_pic, $1)=
9141 -_LT_TAGVAR(lt_prog_compiler_static, $1)=
9142 -
9143 -AC_MSG_CHECKING([for $compiler option to produce PIC])
9144 -m4_if([$1], [CXX], [
9145 - # C++ specific cases for pic, static, wl, etc.
9146 - if test "$GXX" = yes; then
9147 - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9148 - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
9149 -
9150 - case $host_os in
9151 - aix*)
9152 - # All AIX code is PIC.
9153 - if test "$host_cpu" = ia64; then
9154 - # AIX 5 now supports IA64 processor
9155 - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
9156 - fi
9157 - ;;
9158 -
9159 - amigaos*)
9160 - case $host_cpu in
9161 - powerpc)
9162 - # see comment about AmigaOS4 .so support
9163 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
9164 - ;;
9165 - m68k)
9166 - # FIXME: we need at least 68020 code to build shared libraries, but
9167 - # adding the `-m68020' flag to GCC prevents building anything better,
9168 - # like `-m68040'.
9169 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
9170 - ;;
9171 - esac
9172 - ;;
9173 -
9174 - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
9175 - # PIC is the default for these OSes.
9176 - ;;
9177 - mingw* | cygwin* | os2* | pw32* | cegcc*)
9178 - # This hack is so that the source file can tell whether it is being
9179 - # built for inclusion in a dll (and should export symbols for example).
9180 - # Although the cygwin gcc ignores -fPIC, still need this for old-style
9181 - # (--disable-auto-import) libraries
9182 - m4_if([$1], [GCJ], [],
9183 - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
9184 - ;;
9185 - darwin* | rhapsody*)
9186 - # PIC is the default on this platform
9187 - # Common symbols not allowed in MH_DYLIB files
9188 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
9189 - ;;
9190 - *djgpp*)
9191 - # DJGPP does not support shared libraries at all
9192 - _LT_TAGVAR(lt_prog_compiler_pic, $1)=
9193 - ;;
9194 - haiku*)
9195 - # PIC is the default for Haiku.
9196 - # The "-static" flag exists, but is broken.
9197 - _LT_TAGVAR(lt_prog_compiler_static, $1)=
9198 - ;;
9199 - interix[[3-9]]*)
9200 - # Interix 3.x gcc -fpic/-fPIC options generate broken code.
9201 - # Instead, we relocate shared libraries at runtime.
9202 - ;;
9203 - sysv4*MP*)
9204 - if test -d /usr/nec; then
9205 - _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
9206 - fi
9207 - ;;
9208 - hpux*)
9209 - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
9210 - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
9211 - # sets the default TLS model and affects inlining.
9212 - case $host_cpu in
9213 - hppa*64*)
9214 - ;;
9215 - *)
9216 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
9217 - ;;
9218 - esac
9219 - ;;
9220 - *qnx* | *nto*)
9221 - # QNX uses GNU C++, but need to define -shared option too, otherwise
9222 - # it will coredump.
9223 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
9224 - ;;
9225 - *)
9226 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
9227 - ;;
9228 - esac
9229 - else
9230 - case $host_os in
9231 - aix[[4-9]]*)
9232 - # All AIX code is PIC.
9233 - if test "$host_cpu" = ia64; then
9234 - # AIX 5 now supports IA64 processor
9235 - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
9236 - else
9237 - _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
9238 - fi
9239 - ;;
9240 - chorus*)
9241 - case $cc_basename in
9242 - cxch68*)
9243 - # Green Hills C++ Compiler
9244 - # _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"
9245 - ;;
9246 - esac
9247 - ;;
9248 - dgux*)
9249 - case $cc_basename in
9250 - ec++*)
9251 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
9252 - ;;
9253 - ghcx*)
9254 - # Green Hills C++ Compiler
9255 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
9256 - ;;
9257 - *)
9258 - ;;
9259 - esac
9260 - ;;
9261 - freebsd* | dragonfly*)
9262 - # FreeBSD uses GNU C++
9263 - ;;
9264 - hpux9* | hpux10* | hpux11*)
9265 - case $cc_basename in
9266 - CC*)
9267 - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9268 - _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
9269 - if test "$host_cpu" != ia64; then
9270 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
9271 - fi
9272 - ;;
9273 - aCC*)
9274 - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9275 - _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
9276 - case $host_cpu in
9277 - hppa*64*|ia64*)
9278 - # +Z the default
9279 - ;;
9280 - *)
9281 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
9282 - ;;
9283 - esac
9284 - ;;
9285 - *)
9286 - ;;
9287 - esac
9288 - ;;
9289 - interix*)
9290 - # This is c89, which is MS Visual C++ (no shared libs)
9291 - # Anyone wants to do a port?
9292 - ;;
9293 - irix5* | irix6* | nonstopux*)
9294 - case $cc_basename in
9295 - CC*)
9296 - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9297 - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
9298 - # CC pic flag -KPIC is the default.
9299 - ;;
9300 - *)
9301 - ;;
9302 - esac
9303 - ;;
9304 - linux* | k*bsd*-gnu | kopensolaris*-gnu)
9305 - case $cc_basename in
9306 - KCC*)
9307 - # KAI C++ Compiler
9308 - _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
9309 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
9310 - ;;
9311 - ecpc* )
9312 - # old Intel C++ for x86_64 which still supported -KPIC.
9313 - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9314 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
9315 - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
9316 - ;;
9317 - icpc* )
9318 - # Intel C++, used to be incompatible with GCC.
9319 - # ICC 10 doesn't accept -KPIC any more.
9320 - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9321 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
9322 - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
9323 - ;;
9324 - pgCC* | pgcpp*)
9325 - # Portland Group C++ compiler
9326 - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9327 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
9328 - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
9329 - ;;
9330 - cxx*)
9331 - # Compaq C++
9332 - # Make sure the PIC flag is empty. It appears that all Alpha
9333 - # Linux and Compaq Tru64 Unix objects are PIC.
9334 - _LT_TAGVAR(lt_prog_compiler_pic, $1)=
9335 - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
9336 - ;;
9337 - xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
9338 - # IBM XL 8.0, 9.0 on PPC and BlueGene
9339 - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9340 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
9341 - _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
9342 - ;;
9343 - *)
9344 - case `$CC -V 2>&1 | sed 5q` in
9345 - *Sun\ C*)
9346 - # Sun C++ 5.9
9347 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
9348 - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
9349 - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
9350 - ;;
9351 - esac
9352 - ;;
9353 - esac
9354 - ;;
9355 - lynxos*)
9356 - ;;
9357 - m88k*)
9358 - ;;
9359 - mvs*)
9360 - case $cc_basename in
9361 - cxx*)
9362 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
9363 - ;;
9364 - *)
9365 - ;;
9366 - esac
9367 - ;;
9368 - netbsd*)
9369 - ;;
9370 - *qnx* | *nto*)
9371 - # QNX uses GNU C++, but need to define -shared option too, otherwise
9372 - # it will coredump.
9373 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
9374 - ;;
9375 - osf3* | osf4* | osf5*)
9376 - case $cc_basename in
9377 - KCC*)
9378 - _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
9379 - ;;
9380 - RCC*)
9381 - # Rational C++ 2.4.1
9382 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
9383 - ;;
9384 - cxx*)
9385 - # Digital/Compaq C++
9386 - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9387 - # Make sure the PIC flag is empty. It appears that all Alpha
9388 - # Linux and Compaq Tru64 Unix objects are PIC.
9389 - _LT_TAGVAR(lt_prog_compiler_pic, $1)=
9390 - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
9391 - ;;
9392 - *)
9393 - ;;
9394 - esac
9395 - ;;
9396 - psos*)
9397 - ;;
9398 - solaris*)
9399 - case $cc_basename in
9400 - CC* | sunCC*)
9401 - # Sun C++ 4.2, 5.x and Centerline C++
9402 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
9403 - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
9404 - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
9405 - ;;
9406 - gcx*)
9407 - # Green Hills C++ Compiler
9408 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
9409 - ;;
9410 - *)
9411 - ;;
9412 - esac
9413 - ;;
9414 - sunos4*)
9415 - case $cc_basename in
9416 - CC*)
9417 - # Sun C++ 4.x
9418 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
9419 - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
9420 - ;;
9421 - lcc*)
9422 - # Lucid
9423 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
9424 - ;;
9425 - *)
9426 - ;;
9427 - esac
9428 - ;;
9429 - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
9430 - case $cc_basename in
9431 - CC*)
9432 - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9433 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
9434 - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
9435 - ;;
9436 - esac
9437 - ;;
9438 - tandem*)
9439 - case $cc_basename in
9440 - NCC*)
9441 - # NonStop-UX NCC 3.20
9442 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
9443 - ;;
9444 - *)
9445 - ;;
9446 - esac
9447 - ;;
9448 - vxworks*)
9449 - ;;
9450 - *)
9451 - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
9452 - ;;
9453 - esac
9454 - fi
9455 -],
9456 -[
9457 - if test "$GCC" = yes; then
9458 - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9459 - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
9460 -
9461 - case $host_os in
9462 - aix*)
9463 - # All AIX code is PIC.
9464 - if test "$host_cpu" = ia64; then
9465 - # AIX 5 now supports IA64 processor
9466 - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
9467 - fi
9468 - ;;
9469 -
9470 - amigaos*)
9471 - case $host_cpu in
9472 - powerpc)
9473 - # see comment about AmigaOS4 .so support
9474 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
9475 - ;;
9476 - m68k)
9477 - # FIXME: we need at least 68020 code to build shared libraries, but
9478 - # adding the `-m68020' flag to GCC prevents building anything better,
9479 - # like `-m68040'.
9480 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
9481 - ;;
9482 - esac
9483 - ;;
9484 -
9485 - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
9486 - # PIC is the default for these OSes.
9487 - ;;
9488 -
9489 - mingw* | cygwin* | pw32* | os2* | cegcc*)
9490 - # This hack is so that the source file can tell whether it is being
9491 - # built for inclusion in a dll (and should export symbols for example).
9492 - # Although the cygwin gcc ignores -fPIC, still need this for old-style
9493 - # (--disable-auto-import) libraries
9494 - m4_if([$1], [GCJ], [],
9495 - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
9496 - ;;
9497 -
9498 - darwin* | rhapsody*)
9499 - # PIC is the default on this platform
9500 - # Common symbols not allowed in MH_DYLIB files
9501 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
9502 - ;;
9503 -
9504 - haiku*)
9505 - # PIC is the default for Haiku.
9506 - # The "-static" flag exists, but is broken.
9507 - _LT_TAGVAR(lt_prog_compiler_static, $1)=
9508 - ;;
9509 -
9510 - hpux*)
9511 - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
9512 - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
9513 - # sets the default TLS model and affects inlining.
9514 - case $host_cpu in
9515 - hppa*64*)
9516 - # +Z the default
9517 - ;;
9518 - *)
9519 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
9520 - ;;
9521 - esac
9522 - ;;
9523 -
9524 - interix[[3-9]]*)
9525 - # Interix 3.x gcc -fpic/-fPIC options generate broken code.
9526 - # Instead, we relocate shared libraries at runtime.
9527 - ;;
9528 -
9529 - msdosdjgpp*)
9530 - # Just because we use GCC doesn't mean we suddenly get shared libraries
9531 - # on systems that don't support them.
9532 - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
9533 - enable_shared=no
9534 - ;;
9535 -
9536 - *nto* | *qnx*)
9537 - # QNX uses GNU C++, but need to define -shared option too, otherwise
9538 - # it will coredump.
9539 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
9540 - ;;
9541 -
9542 - sysv4*MP*)
9543 - if test -d /usr/nec; then
9544 - _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
9545 - fi
9546 - ;;
9547 -
9548 - *)
9549 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
9550 - ;;
9551 - esac
9552 -
9553 - case $cc_basename in
9554 - nvcc*) # Cuda Compiler Driver 2.2
9555 - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
9556 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC'
9557 - ;;
9558 - esac
9559 - else
9560 - # PORTME Check for flag to pass linker flags through the system compiler.
9561 - case $host_os in
9562 - aix*)
9563 - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9564 - if test "$host_cpu" = ia64; then
9565 - # AIX 5 now supports IA64 processor
9566 - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
9567 - else
9568 - _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
9569 - fi
9570 - ;;
9571 -
9572 - mingw* | cygwin* | pw32* | os2* | cegcc*)
9573 - # This hack is so that the source file can tell whether it is being
9574 - # built for inclusion in a dll (and should export symbols for example).
9575 - m4_if([$1], [GCJ], [],
9576 - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
9577 - ;;
9578 -
9579 - hpux9* | hpux10* | hpux11*)
9580 - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9581 - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
9582 - # not for PA HP-UX.
9583 - case $host_cpu in
9584 - hppa*64*|ia64*)
9585 - # +Z the default
9586 - ;;
9587 - *)
9588 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
9589 - ;;
9590 - esac
9591 - # Is there a better lt_prog_compiler_static that works with the bundled CC?
9592 - _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
9593 - ;;
9594 -
9595 - irix5* | irix6* | nonstopux*)
9596 - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9597 - # PIC (with -KPIC) is the default.
9598 - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
9599 - ;;
9600 -
9601 - linux* | k*bsd*-gnu | kopensolaris*-gnu)
9602 - case $cc_basename in
9603 - # old Intel for x86_64 which still supported -KPIC.
9604 - ecc*)
9605 - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9606 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
9607 - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
9608 - ;;
9609 - # icc used to be incompatible with GCC.
9610 - # ICC 10 doesn't accept -KPIC any more.
9611 - icc* | ifort*)
9612 - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9613 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
9614 - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
9615 - ;;
9616 - # Lahey Fortran 8.1.
9617 - lf95*)
9618 - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9619 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
9620 - _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
9621 - ;;
9622 - pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
9623 - # Portland Group compilers (*not* the Pentium gcc compiler,
9624 - # which looks to be a dead project)
9625 - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9626 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
9627 - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
9628 - ;;
9629 - ccc*)
9630 - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9631 - # All Alpha code is PIC.
9632 - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
9633 - ;;
9634 - xl* | bgxl* | bgf* | mpixl*)
9635 - # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
9636 - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9637 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
9638 - _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
9639 - ;;
9640 - *)
9641 - case `$CC -V 2>&1 | sed 5q` in
9642 - *Sun\ F* | *Sun*Fortran*)
9643 - # Sun Fortran 8.3 passes all unrecognized flags to the linker
9644 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
9645 - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
9646 - _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
9647 - ;;
9648 - *Sun\ C*)
9649 - # Sun C 5.9
9650 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
9651 - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
9652 - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9653 - ;;
9654 - esac
9655 - ;;
9656 - esac
9657 - ;;
9658 -
9659 - newsos6)
9660 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
9661 - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
9662 - ;;
9663 -
9664 - *nto* | *qnx*)
9665 - # QNX uses GNU C++, but need to define -shared option too, otherwise
9666 - # it will coredump.
9667 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
9668 - ;;
9669 -
9670 - osf3* | osf4* | osf5*)
9671 - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9672 - # All OSF/1 code is PIC.
9673 - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
9674 - ;;
9675 -
9676 - rdos*)
9677 - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
9678 - ;;
9679 -
9680 - solaris*)
9681 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
9682 - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
9683 - case $cc_basename in
9684 - f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
9685 - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
9686 - *)
9687 - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
9688 - esac
9689 - ;;
9690 -
9691 - sunos4*)
9692 - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
9693 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
9694 - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
9695 - ;;
9696 -
9697 - sysv4 | sysv4.2uw2* | sysv4.3*)
9698 - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9699 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
9700 - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
9701 - ;;
9702 -
9703 - sysv4*MP*)
9704 - if test -d /usr/nec ;then
9705 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
9706 - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
9707 - fi
9708 - ;;
9709 -
9710 - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
9711 - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9712 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
9713 - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
9714 - ;;
9715 -
9716 - unicos*)
9717 - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9718 - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
9719 - ;;
9720 -
9721 - uts4*)
9722 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
9723 - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
9724 - ;;
9725 -
9726 - *)
9727 - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
9728 - ;;
9729 - esac
9730 - fi
9731 -])
9732 -case $host_os in
9733 - # For platforms which do not support PIC, -DPIC is meaningless:
9734 - *djgpp*)
9735 - _LT_TAGVAR(lt_prog_compiler_pic, $1)=
9736 - ;;
9737 - *)
9738 - _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
9739 - ;;
9740 -esac
9741 -AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
9742 -_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
9743 - [How to pass a linker flag through the compiler])
9744 -
9745 -#
9746 -# Check to make sure the PIC flag actually works.
9747 -#
9748 -if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
9749 - _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
9750 - [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
9751 - [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
9752 - [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
9753 - "" | " "*) ;;
9754 - *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
9755 - esac],
9756 - [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
9757 - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
9758 -fi
9759 -_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
9760 - [Additional compiler flags for building library objects])
9761 -
9762 -#
9763 -# Check to make sure the static flag actually works.
9764 -#
9765 -wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
9766 -_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
9767 - _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
9768 - $lt_tmp_static_flag,
9769 - [],
9770 - [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
9771 -_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
9772 - [Compiler flag to prevent dynamic linking])
9773 -])# _LT_COMPILER_PIC
9774 -
9775 -
9776 -# _LT_LINKER_SHLIBS([TAGNAME])
9777 -# ----------------------------
9778 -# See if the linker supports building shared libraries.
9779 -m4_defun([_LT_LINKER_SHLIBS],
9780 -[AC_REQUIRE([LT_PATH_LD])dnl
9781 -AC_REQUIRE([LT_PATH_NM])dnl
9782 -m4_require([_LT_FILEUTILS_DEFAULTS])dnl
9783 -m4_require([_LT_DECL_EGREP])dnl
9784 -m4_require([_LT_DECL_SED])dnl
9785 -m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
9786 -m4_require([_LT_TAG_COMPILER])dnl
9787 -AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
9788 -m4_if([$1], [CXX], [
9789 - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
9790 - case $host_os in
9791 - aix[[4-9]]*)
9792 - # If we're using GNU nm, then we don't want the "-C" option.
9793 - # -C means demangle to AIX nm, but means don't demangle with GNU nm
9794 - # Also, AIX nm treats weak defined symbols like other global defined
9795 - # symbols, whereas GNU nm marks them as "W".
9796 - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
9797 - _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'
9798 - else
9799 - _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'
9800 - fi
9801 - ;;
9802 - pw32*)
9803 - _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
9804 - ;;
9805 - cygwin* | mingw* | cegcc*)
9806 - _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'
9807 - ;;
9808 - *)
9809 - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
9810 - ;;
9811 - esac
9812 - _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
9813 -], [
9814 - runpath_var=
9815 - _LT_TAGVAR(allow_undefined_flag, $1)=
9816 - _LT_TAGVAR(always_export_symbols, $1)=no
9817 - _LT_TAGVAR(archive_cmds, $1)=
9818 - _LT_TAGVAR(archive_expsym_cmds, $1)=
9819 - _LT_TAGVAR(compiler_needs_object, $1)=no
9820 - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
9821 - _LT_TAGVAR(export_dynamic_flag_spec, $1)=
9822 - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
9823 - _LT_TAGVAR(hardcode_automatic, $1)=no
9824 - _LT_TAGVAR(hardcode_direct, $1)=no
9825 - _LT_TAGVAR(hardcode_direct_absolute, $1)=no
9826 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
9827 - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
9828 - _LT_TAGVAR(hardcode_libdir_separator, $1)=
9829 - _LT_TAGVAR(hardcode_minus_L, $1)=no
9830 - _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
9831 - _LT_TAGVAR(inherit_rpath, $1)=no
9832 - _LT_TAGVAR(link_all_deplibs, $1)=unknown
9833 - _LT_TAGVAR(module_cmds, $1)=
9834 - _LT_TAGVAR(module_expsym_cmds, $1)=
9835 - _LT_TAGVAR(old_archive_from_new_cmds, $1)=
9836 - _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
9837 - _LT_TAGVAR(thread_safe_flag_spec, $1)=
9838 - _LT_TAGVAR(whole_archive_flag_spec, $1)=
9839 - # include_expsyms should be a list of space-separated symbols to be *always*
9840 - # included in the symbol list
9841 - _LT_TAGVAR(include_expsyms, $1)=
9842 - # exclude_expsyms can be an extended regexp of symbols to exclude
9843 - # it will be wrapped by ` (' and `)$', so one must not match beginning or
9844 - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
9845 - # as well as any symbol that contains `d'.
9846 - _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
9847 - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
9848 - # platforms (ab)use it in PIC code, but their linkers get confused if
9849 - # the symbol is explicitly referenced. Since portable code cannot
9850 - # rely on this symbol name, it's probably fine to never include it in
9851 - # preloaded symbol tables.
9852 - # Exclude shared library initialization/finalization symbols.
9853 -dnl Note also adjust exclude_expsyms for C++ above.
9854 - extract_expsyms_cmds=
9855 -
9856 - case $host_os in
9857 - cygwin* | mingw* | pw32* | cegcc*)
9858 - # FIXME: the MSVC++ port hasn't been tested in a loooong time
9859 - # When not using gcc, we currently assume that we are using
9860 - # Microsoft Visual C++.
9861 - if test "$GCC" != yes; then
9862 - with_gnu_ld=no
9863 - fi
9864 - ;;
9865 - interix*)
9866 - # we just hope/assume this is gcc and not c89 (= MSVC++)
9867 - with_gnu_ld=yes
9868 - ;;
9869 - openbsd*)
9870 - with_gnu_ld=no
9871 - ;;
9872 - esac
9873 -
9874 - _LT_TAGVAR(ld_shlibs, $1)=yes
9875 -
9876 - # On some targets, GNU ld is compatible enough with the native linker
9877 - # that we're better off using the native interface for both.
9878 - lt_use_gnu_ld_interface=no
9879 - if test "$with_gnu_ld" = yes; then
9880 - case $host_os in
9881 - aix*)
9882 - # The AIX port of GNU ld has always aspired to compatibility
9883 - # with the native linker. However, as the warning in the GNU ld
9884 - # block says, versions before 2.19.5* couldn't really create working
9885 - # shared libraries, regardless of the interface used.
9886 - case `$LD -v 2>&1` in
9887 - *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
9888 - *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
9889 - *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
9890 - *)
9891 - lt_use_gnu_ld_interface=yes
9892 - ;;
9893 - esac
9894 - ;;
9895 - *)
9896 - lt_use_gnu_ld_interface=yes
9897 - ;;
9898 - esac
9899 - fi
9900 -
9901 - if test "$lt_use_gnu_ld_interface" = yes; then
9902 - # If archive_cmds runs LD, not CC, wlarc should be empty
9903 - wlarc='${wl}'
9904 -
9905 - # Set some defaults for GNU ld with shared library support. These
9906 - # are reset later if shared libraries are not supported. Putting them
9907 - # here allows them to be overridden if necessary.
9908 - runpath_var=LD_RUN_PATH
9909 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
9910 - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
9911 - # ancient GNU ld didn't support --whole-archive et. al.
9912 - if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
9913 - _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
9914 - else
9915 - _LT_TAGVAR(whole_archive_flag_spec, $1)=
9916 - fi
9917 - supports_anon_versioning=no
9918 - case `$LD -v 2>&1` in
9919 - *GNU\ gold*) supports_anon_versioning=yes ;;
9920 - *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
9921 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
9922 - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
9923 - *\ 2.11.*) ;; # other 2.11 versions
9924 - *) supports_anon_versioning=yes ;;
9925 - esac
9926 -
9927 - # See if GNU ld supports shared libraries.
9928 - case $host_os in
9929 - aix[[3-9]]*)
9930 - # On AIX/PPC, the GNU linker is very broken
9931 - if test "$host_cpu" != ia64; then
9932 - _LT_TAGVAR(ld_shlibs, $1)=no
9933 - cat <<_LT_EOF 1>&2
9934 -
9935 -*** Warning: the GNU linker, at least up to release 2.19, is reported
9936 -*** to be unable to reliably create shared libraries on AIX.
9937 -*** Therefore, libtool is disabling shared libraries support. If you
9938 -*** really care for shared libraries, you may want to install binutils
9939 -*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
9940 -*** You will then need to restart the configuration process.
9941 -
9942 -_LT_EOF
9943 - fi
9944 - ;;
9945 -
9946 - amigaos*)
9947 - case $host_cpu in
9948 - powerpc)
9949 - # see comment about AmigaOS4 .so support
9950 - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
9951 - _LT_TAGVAR(archive_expsym_cmds, $1)=''
9952 - ;;
9953 - m68k)
9954 - _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)'
9955 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
9956 - _LT_TAGVAR(hardcode_minus_L, $1)=yes
9957 - ;;
9958 - esac
9959 - ;;
9960 -
9961 - beos*)
9962 - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
9963 - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
9964 - # Joseph Beckenbach <jrb3@××××.com> says some releases of gcc
9965 - # support --undefined. This deserves some investigation. FIXME
9966 - _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
9967 - else
9968 - _LT_TAGVAR(ld_shlibs, $1)=no
9969 - fi
9970 - ;;
9971 -
9972 - cygwin* | mingw* | pw32* | cegcc*)
9973 - # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
9974 - # as there is no search path for DLLs.
9975 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
9976 - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
9977 - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
9978 - _LT_TAGVAR(always_export_symbols, $1)=no
9979 - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
9980 - _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'
9981 -
9982 - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
9983 - _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'
9984 - # If the export-symbols file already is a .def file (1st line
9985 - # is EXPORTS), use it as is; otherwise, prepend...
9986 - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
9987 - cp $export_symbols $output_objdir/$soname.def;
9988 - else
9989 - echo EXPORTS > $output_objdir/$soname.def;
9990 - cat $export_symbols >> $output_objdir/$soname.def;
9991 - fi~
9992 - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
9993 - else
9994 - _LT_TAGVAR(ld_shlibs, $1)=no
9995 - fi
9996 - ;;
9997 -
9998 - haiku*)
9999 - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
10000 - _LT_TAGVAR(link_all_deplibs, $1)=yes
10001 - ;;
10002 -
10003 - interix[[3-9]]*)
10004 - _LT_TAGVAR(hardcode_direct, $1)=no
10005 - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10006 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
10007 - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
10008 - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
10009 - # Instead, shared libraries are loaded at an image base (0x10000000 by
10010 - # default) and relocated if they conflict, which is a slow very memory
10011 - # consuming and fragmenting process. To avoid this, we pick a random,
10012 - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
10013 - # time. Moving up from 0x10000000 also allows more sbrk(2) space.
10014 - _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'
10015 - _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'
10016 - ;;
10017 -
10018 - gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
10019 - tmp_diet=no
10020 - if test "$host_os" = linux-dietlibc; then
10021 - case $cc_basename in
10022 - diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
10023 - esac
10024 - fi
10025 - if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
10026 - && test "$tmp_diet" = no
10027 - then
10028 - tmp_addflag=
10029 - tmp_sharedflag='-shared'
10030 - case $cc_basename,$host_cpu in
10031 - pgcc*) # Portland Group C compiler
10032 - _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'
10033 - tmp_addflag=' $pic_flag'
10034 - ;;
10035 - pgf77* | pgf90* | pgf95* | pgfortran*)
10036 - # Portland Group f77 and f90 compilers
10037 - _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'
10038 - tmp_addflag=' $pic_flag -Mnomain' ;;
10039 - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
10040 - tmp_addflag=' -i_dynamic' ;;
10041 - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
10042 - tmp_addflag=' -i_dynamic -nofor_main' ;;
10043 - ifc* | ifort*) # Intel Fortran compiler
10044 - tmp_addflag=' -nofor_main' ;;
10045 - lf95*) # Lahey Fortran 8.1
10046 - _LT_TAGVAR(whole_archive_flag_spec, $1)=
10047 - tmp_sharedflag='--shared' ;;
10048 - xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
10049 - tmp_sharedflag='-qmkshrobj'
10050 - tmp_addflag= ;;
10051 - nvcc*) # Cuda Compiler Driver 2.2
10052 - _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'
10053 - _LT_TAGVAR(compiler_needs_object, $1)=yes
10054 - ;;
10055 - esac
10056 - case `$CC -V 2>&1 | sed 5q` in
10057 - *Sun\ C*) # Sun C 5.9
10058 - _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'
10059 - _LT_TAGVAR(compiler_needs_object, $1)=yes
10060 - tmp_sharedflag='-G' ;;
10061 - *Sun\ F*) # Sun Fortran 8.3
10062 - tmp_sharedflag='-G' ;;
10063 - esac
10064 - _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
10065 -
10066 - if test "x$supports_anon_versioning" = xyes; then
10067 - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
10068 - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
10069 - echo "local: *; };" >> $output_objdir/$libname.ver~
10070 - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
10071 - fi
10072 -
10073 - case $cc_basename in
10074 - xlf* | bgf* | bgxlf* | mpixlf*)
10075 - # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
10076 - _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
10077 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
10078 - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
10079 - _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
10080 - if test "x$supports_anon_versioning" = xyes; then
10081 - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
10082 - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
10083 - echo "local: *; };" >> $output_objdir/$libname.ver~
10084 - $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
10085 - fi
10086 - ;;
10087 - esac
10088 - else
10089 - _LT_TAGVAR(ld_shlibs, $1)=no
10090 - fi
10091 - ;;
10092 -
10093 - netbsd*)
10094 - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
10095 - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
10096 - wlarc=
10097 - else
10098 - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
10099 - _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'
10100 - fi
10101 - ;;
10102 -
10103 - solaris*)
10104 - if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
10105 - _LT_TAGVAR(ld_shlibs, $1)=no
10106 - cat <<_LT_EOF 1>&2
10107 -
10108 -*** Warning: The releases 2.8.* of the GNU linker cannot reliably
10109 -*** create shared libraries on Solaris systems. Therefore, libtool
10110 -*** is disabling shared libraries support. We urge you to upgrade GNU
10111 -*** binutils to release 2.9.1 or newer. Another option is to modify
10112 -*** your PATH or compiler configuration so that the native linker is
10113 -*** used, and then restart.
10114 -
10115 -_LT_EOF
10116 - elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
10117 - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
10118 - _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'
10119 - else
10120 - _LT_TAGVAR(ld_shlibs, $1)=no
10121 - fi
10122 - ;;
10123 -
10124 - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
10125 - case `$LD -v 2>&1` in
10126 - *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
10127 - _LT_TAGVAR(ld_shlibs, $1)=no
10128 - cat <<_LT_EOF 1>&2
10129 -
10130 -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
10131 -*** reliably create shared libraries on SCO systems. Therefore, libtool
10132 -*** is disabling shared libraries support. We urge you to upgrade GNU
10133 -*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
10134 -*** your PATH or compiler configuration so that the native linker is
10135 -*** used, and then restart.
10136 -
10137 -_LT_EOF
10138 - ;;
10139 - *)
10140 - # For security reasons, it is highly recommended that you always
10141 - # use absolute paths for naming shared libraries, and exclude the
10142 - # DT_RUNPATH tag from executables and libraries. But doing so
10143 - # requires that you compile everything twice, which is a pain.
10144 - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
10145 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
10146 - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
10147 - _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'
10148 - else
10149 - _LT_TAGVAR(ld_shlibs, $1)=no
10150 - fi
10151 - ;;
10152 - esac
10153 - ;;
10154 -
10155 - sunos4*)
10156 - _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
10157 - wlarc=
10158 - _LT_TAGVAR(hardcode_direct, $1)=yes
10159 - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10160 - ;;
10161 -
10162 - *)
10163 - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
10164 - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
10165 - _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'
10166 - else
10167 - _LT_TAGVAR(ld_shlibs, $1)=no
10168 - fi
10169 - ;;
10170 - esac
10171 -
10172 - if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
10173 - runpath_var=
10174 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
10175 - _LT_TAGVAR(export_dynamic_flag_spec, $1)=
10176 - _LT_TAGVAR(whole_archive_flag_spec, $1)=
10177 - fi
10178 - else
10179 - # PORTME fill in a description of your system's linker (not GNU ld)
10180 - case $host_os in
10181 - aix3*)
10182 - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
10183 - _LT_TAGVAR(always_export_symbols, $1)=yes
10184 - _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'
10185 - # Note: this linker hardcodes the directories in LIBPATH if there
10186 - # are no directories specified by -L.
10187 - _LT_TAGVAR(hardcode_minus_L, $1)=yes
10188 - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
10189 - # Neither direct hardcoding nor static linking is supported with a
10190 - # broken collect2.
10191 - _LT_TAGVAR(hardcode_direct, $1)=unsupported
10192 - fi
10193 - ;;
10194 -
10195 - aix[[4-9]]*)
10196 - if test "$host_cpu" = ia64; then
10197 - # On IA64, the linker does run time linking by default, so we don't
10198 - # have to do anything special.
10199 - aix_use_runtimelinking=no
10200 - exp_sym_flag='-Bexport'
10201 - no_entry_flag=""
10202 - else
10203 - # If we're using GNU nm, then we don't want the "-C" option.
10204 - # -C means demangle to AIX nm, but means don't demangle with GNU nm
10205 - # Also, AIX nm treats weak defined symbols like other global
10206 - # defined symbols, whereas GNU nm marks them as "W".
10207 - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
10208 - _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'
10209 - else
10210 - _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'
10211 - fi
10212 - aix_use_runtimelinking=no
10213 -
10214 - # Test if we are trying to use run time linking or normal
10215 - # AIX style linking. If -brtl is somewhere in LDFLAGS, we
10216 - # need to do runtime linking.
10217 - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
10218 - for ld_flag in $LDFLAGS; do
10219 - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
10220 - aix_use_runtimelinking=yes
10221 - break
10222 - fi
10223 - done
10224 - ;;
10225 - esac
10226 -
10227 - exp_sym_flag='-bexport'
10228 - no_entry_flag='-bnoentry'
10229 - fi
10230 -
10231 - # When large executables or shared objects are built, AIX ld can
10232 - # have problems creating the table of contents. If linking a library
10233 - # or program results in "error TOC overflow" add -mminimal-toc to
10234 - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
10235 - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
10236 -
10237 - _LT_TAGVAR(archive_cmds, $1)=''
10238 - _LT_TAGVAR(hardcode_direct, $1)=yes
10239 - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
10240 - _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
10241 - _LT_TAGVAR(link_all_deplibs, $1)=yes
10242 - _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
10243 -
10244 - if test "$GCC" = yes; then
10245 - case $host_os in aix4.[[012]]|aix4.[[012]].*)
10246 - # We only want to do this on AIX 4.2 and lower, the check
10247 - # below for broken collect2 doesn't work under 4.3+
10248 - collect2name=`${CC} -print-prog-name=collect2`
10249 - if test -f "$collect2name" &&
10250 - strings "$collect2name" | $GREP resolve_lib_name >/dev/null
10251 - then
10252 - # We have reworked collect2
10253 - :
10254 - else
10255 - # We have old collect2
10256 - _LT_TAGVAR(hardcode_direct, $1)=unsupported
10257 - # It fails to find uninstalled libraries when the uninstalled
10258 - # path is not listed in the libpath. Setting hardcode_minus_L
10259 - # to unsupported forces relinking
10260 - _LT_TAGVAR(hardcode_minus_L, $1)=yes
10261 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
10262 - _LT_TAGVAR(hardcode_libdir_separator, $1)=
10263 - fi
10264 - ;;
10265 - esac
10266 - shared_flag='-shared'
10267 - if test "$aix_use_runtimelinking" = yes; then
10268 - shared_flag="$shared_flag "'${wl}-G'
10269 - fi
10270 - else
10271 - # not using gcc
10272 - if test "$host_cpu" = ia64; then
10273 - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
10274 - # chokes on -Wl,-G. The following line is correct:
10275 - shared_flag='-G'
10276 - else
10277 - if test "$aix_use_runtimelinking" = yes; then
10278 - shared_flag='${wl}-G'
10279 - else
10280 - shared_flag='${wl}-bM:SRE'
10281 - fi
10282 - fi
10283 - fi
10284 -
10285 - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
10286 - # It seems that -bexpall does not export symbols beginning with
10287 - # underscore (_), so it is better to generate a list of symbols to export.
10288 - _LT_TAGVAR(always_export_symbols, $1)=yes
10289 - if test "$aix_use_runtimelinking" = yes; then
10290 - # Warning - without using the other runtime loading flags (-brtl),
10291 - # -berok will link without error, but may produce a broken library.
10292 - _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
10293 - # Determine the default libpath from the value encoded in an
10294 - # empty executable.
10295 - _LT_SYS_MODULE_PATH_AIX
10296 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
10297 - _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"
10298 - else
10299 - if test "$host_cpu" = ia64; then
10300 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
10301 - _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
10302 - _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"
10303 - else
10304 - # Determine the default libpath from the value encoded in an
10305 - # empty executable.
10306 - _LT_SYS_MODULE_PATH_AIX
10307 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
10308 - # Warning - without using the other run time loading flags,
10309 - # -berok will link without error, but may produce a broken library.
10310 - _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
10311 - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
10312 - if test "$with_gnu_ld" = yes; then
10313 - # We only use this code for GNU lds that support --whole-archive.
10314 - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
10315 - else
10316 - # Exported symbols can be pulled into shared objects from archives
10317 - _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
10318 - fi
10319 - _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
10320 - # This is similar to how AIX traditionally builds its shared libraries.
10321 - _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'
10322 - fi
10323 - fi
10324 - ;;
10325 -
10326 - amigaos*)
10327 - case $host_cpu in
10328 - powerpc)
10329 - # see comment about AmigaOS4 .so support
10330 - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
10331 - _LT_TAGVAR(archive_expsym_cmds, $1)=''
10332 - ;;
10333 - m68k)
10334 - _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)'
10335 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
10336 - _LT_TAGVAR(hardcode_minus_L, $1)=yes
10337 - ;;
10338 - esac
10339 - ;;
10340 -
10341 - bsdi[[45]]*)
10342 - _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
10343 - ;;
10344 -
10345 - cygwin* | mingw* | pw32* | cegcc*)
10346 - # When not using gcc, we currently assume that we are using
10347 - # Microsoft Visual C++.
10348 - # hardcode_libdir_flag_spec is actually meaningless, as there is
10349 - # no search path for DLLs.
10350 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
10351 - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
10352 - # Tell ltmain to make .lib files, not .a files.
10353 - libext=lib
10354 - # Tell ltmain to make .dll files, not .so files.
10355 - shrext_cmds=".dll"
10356 - # FIXME: Setting linknames here is a bad hack.
10357 - _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
10358 - # The linker will automatically build a .lib file if we build a DLL.
10359 - _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
10360 - # FIXME: Should let the user specify the lib program.
10361 - _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
10362 - _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
10363 - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
10364 - ;;
10365 -
10366 - darwin* | rhapsody*)
10367 - _LT_DARWIN_LINKER_FEATURES($1)
10368 - ;;
10369 -
10370 - dgux*)
10371 - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10372 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
10373 - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10374 - ;;
10375 -
10376 - freebsd1*)
10377 - _LT_TAGVAR(ld_shlibs, $1)=no
10378 - ;;
10379 -
10380 - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
10381 - # support. Future versions do this automatically, but an explicit c++rt0.o
10382 - # does not break anything, and helps significantly (at the cost of a little
10383 - # extra space).
10384 - freebsd2.2*)
10385 - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
10386 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
10387 - _LT_TAGVAR(hardcode_direct, $1)=yes
10388 - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10389 - ;;
10390 -
10391 - # Unfortunately, older versions of FreeBSD 2 do not have this feature.
10392 - freebsd2*)
10393 - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
10394 - _LT_TAGVAR(hardcode_direct, $1)=yes
10395 - _LT_TAGVAR(hardcode_minus_L, $1)=yes
10396 - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10397 - ;;
10398 -
10399 - # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
10400 - freebsd* | dragonfly*)
10401 - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
10402 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
10403 - _LT_TAGVAR(hardcode_direct, $1)=yes
10404 - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10405 - ;;
10406 -
10407 - hpux9*)
10408 - if test "$GCC" = yes; then
10409 - _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'
10410 - else
10411 - _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'
10412 - fi
10413 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
10414 - _LT_TAGVAR(hardcode_libdir_separator, $1)=:
10415 - _LT_TAGVAR(hardcode_direct, $1)=yes
10416 -
10417 - # hardcode_minus_L: Not really in the search PATH,
10418 - # but as the default location of the library.
10419 - _LT_TAGVAR(hardcode_minus_L, $1)=yes
10420 - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
10421 - ;;
10422 -
10423 - hpux10*)
10424 - if test "$GCC" = yes && test "$with_gnu_ld" = no; then
10425 - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
10426 - else
10427 - _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
10428 - fi
10429 - if test "$with_gnu_ld" = no; then
10430 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
10431 - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
10432 - _LT_TAGVAR(hardcode_libdir_separator, $1)=:
10433 - _LT_TAGVAR(hardcode_direct, $1)=yes
10434 - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
10435 - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
10436 - # hardcode_minus_L: Not really in the search PATH,
10437 - # but as the default location of the library.
10438 - _LT_TAGVAR(hardcode_minus_L, $1)=yes
10439 - fi
10440 - ;;
10441 -
10442 - hpux11*)
10443 - if test "$GCC" = yes && test "$with_gnu_ld" = no; then
10444 - case $host_cpu in
10445 - hppa*64*)
10446 - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
10447 - ;;
10448 - ia64*)
10449 - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
10450 - ;;
10451 - *)
10452 - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
10453 - ;;
10454 - esac
10455 - else
10456 - case $host_cpu in
10457 - hppa*64*)
10458 - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
10459 - ;;
10460 - ia64*)
10461 - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
10462 - ;;
10463 - *)
10464 - m4_if($1, [], [
10465 - # Older versions of the 11.00 compiler do not understand -b yet
10466 - # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
10467 - _LT_LINKER_OPTION([if $CC understands -b],
10468 - _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
10469 - [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
10470 - [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
10471 - [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
10472 - ;;
10473 - esac
10474 - fi
10475 - if test "$with_gnu_ld" = no; then
10476 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
10477 - _LT_TAGVAR(hardcode_libdir_separator, $1)=:
10478 -
10479 - case $host_cpu in
10480 - hppa*64*|ia64*)
10481 - _LT_TAGVAR(hardcode_direct, $1)=no
10482 - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10483 - ;;
10484 - *)
10485 - _LT_TAGVAR(hardcode_direct, $1)=yes
10486 - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
10487 - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
10488 -
10489 - # hardcode_minus_L: Not really in the search PATH,
10490 - # but as the default location of the library.
10491 - _LT_TAGVAR(hardcode_minus_L, $1)=yes
10492 - ;;
10493 - esac
10494 - fi
10495 - ;;
10496 -
10497 - irix5* | irix6* | nonstopux*)
10498 - if test "$GCC" = yes; then
10499 - _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'
10500 - # Try to use the -exported_symbol ld option, if it does not
10501 - # work, assume that -exports_file does not work either and
10502 - # implicitly export all symbols.
10503 - save_LDFLAGS="$LDFLAGS"
10504 - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
10505 - AC_LINK_IFELSE(int foo(void) {},
10506 - _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'
10507 - )
10508 - LDFLAGS="$save_LDFLAGS"
10509 - else
10510 - _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'
10511 - _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'
10512 - fi
10513 - _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
10514 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
10515 - _LT_TAGVAR(hardcode_libdir_separator, $1)=:
10516 - _LT_TAGVAR(inherit_rpath, $1)=yes
10517 - _LT_TAGVAR(link_all_deplibs, $1)=yes
10518 - ;;
10519 -
10520 - netbsd*)
10521 - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
10522 - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
10523 - else
10524 - _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
10525 - fi
10526 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
10527 - _LT_TAGVAR(hardcode_direct, $1)=yes
10528 - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10529 - ;;
10530 -
10531 - newsos6)
10532 - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10533 - _LT_TAGVAR(hardcode_direct, $1)=yes
10534 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
10535 - _LT_TAGVAR(hardcode_libdir_separator, $1)=:
10536 - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10537 - ;;
10538 -
10539 - *nto* | *qnx*)
10540 - ;;
10541 -
10542 - openbsd*)
10543 - if test -f /usr/libexec/ld.so; then
10544 - _LT_TAGVAR(hardcode_direct, $1)=yes
10545 - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10546 - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
10547 - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
10548 - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
10549 - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
10550 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
10551 - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
10552 - else
10553 - case $host_os in
10554 - openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
10555 - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
10556 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
10557 - ;;
10558 - *)
10559 - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
10560 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
10561 - ;;
10562 - esac
10563 - fi
10564 - else
10565 - _LT_TAGVAR(ld_shlibs, $1)=no
10566 - fi
10567 - ;;
10568 -
10569 - os2*)
10570 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
10571 - _LT_TAGVAR(hardcode_minus_L, $1)=yes
10572 - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
10573 - _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'
10574 - _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
10575 - ;;
10576 -
10577 - osf3*)
10578 - if test "$GCC" = yes; then
10579 - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
10580 - _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'
10581 - else
10582 - _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
10583 - _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'
10584 - fi
10585 - _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
10586 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
10587 - _LT_TAGVAR(hardcode_libdir_separator, $1)=:
10588 - ;;
10589 -
10590 - osf4* | osf5*) # as osf3* with the addition of -msym flag
10591 - if test "$GCC" = yes; then
10592 - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
10593 - _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'
10594 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
10595 - else
10596 - _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
10597 - _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'
10598 - _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~
10599 - $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'
10600 -
10601 - # Both c and cxx compiler support -rpath directly
10602 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
10603 - fi
10604 - _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
10605 - _LT_TAGVAR(hardcode_libdir_separator, $1)=:
10606 - ;;
10607 -
10608 - solaris*)
10609 - _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
10610 - if test "$GCC" = yes; then
10611 - wlarc='${wl}'
10612 - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
10613 - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
10614 - $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
10615 - else
10616 - case `$CC -V 2>&1` in
10617 - *"Compilers 5.0"*)
10618 - wlarc=''
10619 - _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
10620 - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
10621 - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
10622 - ;;
10623 - *)
10624 - wlarc='${wl}'
10625 - _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
10626 - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
10627 - $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
10628 - ;;
10629 - esac
10630 - fi
10631 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
10632 - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10633 - case $host_os in
10634 - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
10635 - *)
10636 - # The compiler driver will combine and reorder linker options,
10637 - # but understands `-z linker_flag'. GCC discards it without `$wl',
10638 - # but is careful enough not to reorder.
10639 - # Supported since Solaris 2.6 (maybe 2.5.1?)
10640 - if test "$GCC" = yes; then
10641 - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
10642 - else
10643 - _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
10644 - fi
10645 - ;;
10646 - esac
10647 - _LT_TAGVAR(link_all_deplibs, $1)=yes
10648 - ;;
10649 -
10650 - sunos4*)
10651 - if test "x$host_vendor" = xsequent; then
10652 - # Use $CC to link under sequent, because it throws in some extra .o
10653 - # files that make .init and .fini sections work.
10654 - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
10655 - else
10656 - _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
10657 - fi
10658 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
10659 - _LT_TAGVAR(hardcode_direct, $1)=yes
10660 - _LT_TAGVAR(hardcode_minus_L, $1)=yes
10661 - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10662 - ;;
10663 -
10664 - sysv4)
10665 - case $host_vendor in
10666 - sni)
10667 - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10668 - _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
10669 - ;;
10670 - siemens)
10671 - ## LD is ld it makes a PLAMLIB
10672 - ## CC just makes a GrossModule.
10673 - _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
10674 - _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
10675 - _LT_TAGVAR(hardcode_direct, $1)=no
10676 - ;;
10677 - motorola)
10678 - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10679 - _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
10680 - ;;
10681 - esac
10682 - runpath_var='LD_RUN_PATH'
10683 - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10684 - ;;
10685 -
10686 - sysv4.3*)
10687 - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10688 - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10689 - _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
10690 - ;;
10691 -
10692 - sysv4*MP*)
10693 - if test -d /usr/nec; then
10694 - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10695 - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10696 - runpath_var=LD_RUN_PATH
10697 - hardcode_runpath_var=yes
10698 - _LT_TAGVAR(ld_shlibs, $1)=yes
10699 - fi
10700 - ;;
10701 -
10702 - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
10703 - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
10704 - _LT_TAGVAR(archive_cmds_need_lc, $1)=no
10705 - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10706 - runpath_var='LD_RUN_PATH'
10707 -
10708 - if test "$GCC" = yes; then
10709 - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10710 - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10711 - else
10712 - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10713 - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10714 - fi
10715 - ;;
10716 -
10717 - sysv5* | sco3.2v5* | sco5v6*)
10718 - # Note: We can NOT use -z defs as we might desire, because we do not
10719 - # link with -lc, and that would cause any symbols used from libc to
10720 - # always be unresolved, which means just about no library would
10721 - # ever link correctly. If we're not using GNU ld we use -z text
10722 - # though, which does catch some bad symbols but isn't as heavy-handed
10723 - # as -z defs.
10724 - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
10725 - _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
10726 - _LT_TAGVAR(archive_cmds_need_lc, $1)=no
10727 - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10728 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
10729 - _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
10730 - _LT_TAGVAR(link_all_deplibs, $1)=yes
10731 - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
10732 - runpath_var='LD_RUN_PATH'
10733 -
10734 - if test "$GCC" = yes; then
10735 - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10736 - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10737 - else
10738 - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10739 - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10740 - fi
10741 - ;;
10742 -
10743 - uts4*)
10744 - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10745 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
10746 - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10747 - ;;
10748 -
10749 - *)
10750 - _LT_TAGVAR(ld_shlibs, $1)=no
10751 - ;;
10752 - esac
10753 -
10754 - if test x$host_vendor = xsni; then
10755 - case $host in
10756 - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
10757 - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
10758 - ;;
10759 - esac
10760 - fi
10761 - fi
10762 -])
10763 -AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
10764 -test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
10765 -
10766 -_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
10767 -
10768 -_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
10769 -_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
10770 -_LT_DECL([], [extract_expsyms_cmds], [2],
10771 - [The commands to extract the exported symbol list from a shared archive])
10772 -
10773 -#
10774 -# Do we need to explicitly link libc?
10775 -#
10776 -case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
10777 -x|xyes)
10778 - # Assume -lc should be added
10779 - _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
10780 -
10781 - if test "$enable_shared" = yes && test "$GCC" = yes; then
10782 - case $_LT_TAGVAR(archive_cmds, $1) in
10783 - *'~'*)
10784 - # FIXME: we may have to deal with multi-command sequences.
10785 - ;;
10786 - '$CC '*)
10787 - # Test whether the compiler implicitly links with -lc since on some
10788 - # systems, -lgcc has to come before -lc. If gcc already passes -lc
10789 - # to ld, don't add -lc before -lgcc.
10790 - AC_CACHE_CHECK([whether -lc should be explicitly linked in],
10791 - [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
10792 - [$RM conftest*
10793 - echo "$lt_simple_compile_test_code" > conftest.$ac_ext
10794 -
10795 - if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
10796 - soname=conftest
10797 - lib=conftest
10798 - libobjs=conftest.$ac_objext
10799 - deplibs=
10800 - wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
10801 - pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
10802 - compiler_flags=-v
10803 - linker_flags=-v
10804 - verstring=
10805 - output_objdir=.
10806 - libname=conftest
10807 - lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
10808 - _LT_TAGVAR(allow_undefined_flag, $1)=
10809 - if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
10810 - then
10811 - lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
10812 - else
10813 - lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
10814 - fi
10815 - _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
10816 - else
10817 - cat conftest.err 1>&5
10818 - fi
10819 - $RM conftest*
10820 - ])
10821 - _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
10822 - ;;
10823 - esac
10824 - fi
10825 - ;;
10826 -esac
10827 -
10828 -_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
10829 - [Whether or not to add -lc for building shared libraries])
10830 -_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
10831 - [enable_shared_with_static_runtimes], [0],
10832 - [Whether or not to disallow shared libs when runtime libs are static])
10833 -_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
10834 - [Compiler flag to allow reflexive dlopens])
10835 -_LT_TAGDECL([], [whole_archive_flag_spec], [1],
10836 - [Compiler flag to generate shared objects directly from archives])
10837 -_LT_TAGDECL([], [compiler_needs_object], [1],
10838 - [Whether the compiler copes with passing no objects directly])
10839 -_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
10840 - [Create an old-style archive from a shared archive])
10841 -_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
10842 - [Create a temporary old-style archive to link instead of a shared archive])
10843 -_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
10844 -_LT_TAGDECL([], [archive_expsym_cmds], [2])
10845 -_LT_TAGDECL([], [module_cmds], [2],
10846 - [Commands used to build a loadable module if different from building
10847 - a shared archive.])
10848 -_LT_TAGDECL([], [module_expsym_cmds], [2])
10849 -_LT_TAGDECL([], [with_gnu_ld], [1],
10850 - [Whether we are building with GNU ld or not])
10851 -_LT_TAGDECL([], [allow_undefined_flag], [1],
10852 - [Flag that allows shared libraries with undefined symbols to be built])
10853 -_LT_TAGDECL([], [no_undefined_flag], [1],
10854 - [Flag that enforces no undefined symbols])
10855 -_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
10856 - [Flag to hardcode $libdir into a binary during linking.
10857 - This must work even if $libdir does not exist])
10858 -_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
10859 - [[If ld is used when linking, flag to hardcode $libdir into a binary
10860 - during linking. This must work even if $libdir does not exist]])
10861 -_LT_TAGDECL([], [hardcode_libdir_separator], [1],
10862 - [Whether we need a single "-rpath" flag with a separated argument])
10863 -_LT_TAGDECL([], [hardcode_direct], [0],
10864 - [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
10865 - DIR into the resulting binary])
10866 -_LT_TAGDECL([], [hardcode_direct_absolute], [0],
10867 - [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
10868 - DIR into the resulting binary and the resulting library dependency is
10869 - "absolute", i.e impossible to change by setting ${shlibpath_var} if the
10870 - library is relocated])
10871 -_LT_TAGDECL([], [hardcode_minus_L], [0],
10872 - [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
10873 - into the resulting binary])
10874 -_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
10875 - [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
10876 - into the resulting binary])
10877 -_LT_TAGDECL([], [hardcode_automatic], [0],
10878 - [Set to "yes" if building a shared library automatically hardcodes DIR
10879 - into the library and all subsequent libraries and executables linked
10880 - against it])
10881 -_LT_TAGDECL([], [inherit_rpath], [0],
10882 - [Set to yes if linker adds runtime paths of dependent libraries
10883 - to runtime path list])
10884 -_LT_TAGDECL([], [link_all_deplibs], [0],
10885 - [Whether libtool must link a program against all its dependency libraries])
10886 -_LT_TAGDECL([], [fix_srcfile_path], [1],
10887 - [Fix the shell variable $srcfile for the compiler])
10888 -_LT_TAGDECL([], [always_export_symbols], [0],
10889 - [Set to "yes" if exported symbols are required])
10890 -_LT_TAGDECL([], [export_symbols_cmds], [2],
10891 - [The commands to list exported symbols])
10892 -_LT_TAGDECL([], [exclude_expsyms], [1],
10893 - [Symbols that should not be listed in the preloaded symbols])
10894 -_LT_TAGDECL([], [include_expsyms], [1],
10895 - [Symbols that must always be exported])
10896 -_LT_TAGDECL([], [prelink_cmds], [2],
10897 - [Commands necessary for linking programs (against libraries) with templates])
10898 -_LT_TAGDECL([], [file_list_spec], [1],
10899 - [Specify filename containing input files])
10900 -dnl FIXME: Not yet implemented
10901 -dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
10902 -dnl [Compiler flag to generate thread safe objects])
10903 -])# _LT_LINKER_SHLIBS
10904 -
10905 -
10906 -# _LT_LANG_C_CONFIG([TAG])
10907 -# ------------------------
10908 -# Ensure that the configuration variables for a C compiler are suitably
10909 -# defined. These variables are subsequently used by _LT_CONFIG to write
10910 -# the compiler configuration to `libtool'.
10911 -m4_defun([_LT_LANG_C_CONFIG],
10912 -[m4_require([_LT_DECL_EGREP])dnl
10913 -lt_save_CC="$CC"
10914 -AC_LANG_PUSH(C)
10915 -
10916 -# Source file extension for C test sources.
10917 -ac_ext=c
10918 -
10919 -# Object file extension for compiled C test sources.
10920 -objext=o
10921 -_LT_TAGVAR(objext, $1)=$objext
10922 -
10923 -# Code to be used in simple compile tests
10924 -lt_simple_compile_test_code="int some_variable = 0;"
10925 -
10926 -# Code to be used in simple link tests
10927 -lt_simple_link_test_code='int main(){return(0);}'
10928 -
10929 -_LT_TAG_COMPILER
10930 -# Save the default compiler, since it gets overwritten when the other
10931 -# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
10932 -compiler_DEFAULT=$CC
10933 -
10934 -# save warnings/boilerplate of simple test code
10935 -_LT_COMPILER_BOILERPLATE
10936 -_LT_LINKER_BOILERPLATE
10937 -
10938 -## CAVEAT EMPTOR:
10939 -## There is no encapsulation within the following macros, do not change
10940 -## the running order or otherwise move them around unless you know exactly
10941 -## what you are doing...
10942 -if test -n "$compiler"; then
10943 - _LT_COMPILER_NO_RTTI($1)
10944 - _LT_COMPILER_PIC($1)
10945 - _LT_COMPILER_C_O($1)
10946 - _LT_COMPILER_FILE_LOCKS($1)
10947 - _LT_LINKER_SHLIBS($1)
10948 - _LT_SYS_DYNAMIC_LINKER($1)
10949 - _LT_LINKER_HARDCODE_LIBPATH($1)
10950 - LT_SYS_DLOPEN_SELF
10951 - _LT_CMD_STRIPLIB
10952 -
10953 - # Report which library types will actually be built
10954 - AC_MSG_CHECKING([if libtool supports shared libraries])
10955 - AC_MSG_RESULT([$can_build_shared])
10956 -
10957 - AC_MSG_CHECKING([whether to build shared libraries])
10958 - test "$can_build_shared" = "no" && enable_shared=no
10959 -
10960 - # On AIX, shared libraries and static libraries use the same namespace, and
10961 - # are all built from PIC.
10962 - case $host_os in
10963 - aix3*)
10964 - test "$enable_shared" = yes && enable_static=no
10965 - if test -n "$RANLIB"; then
10966 - archive_cmds="$archive_cmds~\$RANLIB \$lib"
10967 - postinstall_cmds='$RANLIB $lib'
10968 - fi
10969 - ;;
10970 -
10971 - aix[[4-9]]*)
10972 - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
10973 - test "$enable_shared" = yes && enable_static=no
10974 - fi
10975 - ;;
10976 - esac
10977 - AC_MSG_RESULT([$enable_shared])
10978 -
10979 - AC_MSG_CHECKING([whether to build static libraries])
10980 - # Make sure either enable_shared or enable_static is yes.
10981 - test "$enable_shared" = yes || enable_static=yes
10982 - AC_MSG_RESULT([$enable_static])
10983 -
10984 - _LT_CONFIG($1)
10985 -fi
10986 -AC_LANG_POP
10987 -CC="$lt_save_CC"
10988 -])# _LT_LANG_C_CONFIG
10989 -
10990 -
10991 -# _LT_LANG_CXX_CONFIG([TAG])
10992 -# --------------------------
10993 -# Ensure that the configuration variables for a C++ compiler are suitably
10994 -# defined. These variables are subsequently used by _LT_CONFIG to write
10995 -# the compiler configuration to `libtool'.
10996 -m4_defun([_LT_LANG_CXX_CONFIG],
10997 -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
10998 -m4_require([_LT_DECL_EGREP])dnl
10999 -if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
11000 - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
11001 - (test "X$CXX" != "Xg++"))) ; then
11002 - AC_PROG_CXXCPP
11003 -else
11004 - _lt_caught_CXX_error=yes
11005 -fi
11006 -
11007 -AC_LANG_PUSH(C++)
11008 -_LT_TAGVAR(archive_cmds_need_lc, $1)=no
11009 -_LT_TAGVAR(allow_undefined_flag, $1)=
11010 -_LT_TAGVAR(always_export_symbols, $1)=no
11011 -_LT_TAGVAR(archive_expsym_cmds, $1)=
11012 -_LT_TAGVAR(compiler_needs_object, $1)=no
11013 -_LT_TAGVAR(export_dynamic_flag_spec, $1)=
11014 -_LT_TAGVAR(hardcode_direct, $1)=no
11015 -_LT_TAGVAR(hardcode_direct_absolute, $1)=no
11016 -_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
11017 -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
11018 -_LT_TAGVAR(hardcode_libdir_separator, $1)=
11019 -_LT_TAGVAR(hardcode_minus_L, $1)=no
11020 -_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
11021 -_LT_TAGVAR(hardcode_automatic, $1)=no
11022 -_LT_TAGVAR(inherit_rpath, $1)=no
11023 -_LT_TAGVAR(module_cmds, $1)=
11024 -_LT_TAGVAR(module_expsym_cmds, $1)=
11025 -_LT_TAGVAR(link_all_deplibs, $1)=unknown
11026 -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
11027 -_LT_TAGVAR(reload_flag, $1)=$reload_flag
11028 -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
11029 -_LT_TAGVAR(no_undefined_flag, $1)=
11030 -_LT_TAGVAR(whole_archive_flag_spec, $1)=
11031 -_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
11032 -
11033 -# Source file extension for C++ test sources.
11034 -ac_ext=cpp
11035 -
11036 -# Object file extension for compiled C++ test sources.
11037 -objext=o
11038 -_LT_TAGVAR(objext, $1)=$objext
11039 -
11040 -# No sense in running all these tests if we already determined that
11041 -# the CXX compiler isn't working. Some variables (like enable_shared)
11042 -# are currently assumed to apply to all compilers on this platform,
11043 -# and will be corrupted by setting them based on a non-working compiler.
11044 -if test "$_lt_caught_CXX_error" != yes; then
11045 - # Code to be used in simple compile tests
11046 - lt_simple_compile_test_code="int some_variable = 0;"
11047 -
11048 - # Code to be used in simple link tests
11049 - lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
11050 -
11051 - # ltmain only uses $CC for tagged configurations so make sure $CC is set.
11052 - _LT_TAG_COMPILER
11053 -
11054 - # save warnings/boilerplate of simple test code
11055 - _LT_COMPILER_BOILERPLATE
11056 - _LT_LINKER_BOILERPLATE
11057 -
11058 - # Allow CC to be a program name with arguments.
11059 - lt_save_CC=$CC
11060 - lt_save_LD=$LD
11061 - lt_save_GCC=$GCC
11062 - GCC=$GXX
11063 - lt_save_with_gnu_ld=$with_gnu_ld
11064 - lt_save_path_LD=$lt_cv_path_LD
11065 - if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
11066 - lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
11067 - else
11068 - $as_unset lt_cv_prog_gnu_ld
11069 - fi
11070 - if test -n "${lt_cv_path_LDCXX+set}"; then
11071 - lt_cv_path_LD=$lt_cv_path_LDCXX
11072 - else
11073 - $as_unset lt_cv_path_LD
11074 - fi
11075 - test -z "${LDCXX+set}" || LD=$LDCXX
11076 - CC=${CXX-"c++"}
11077 - compiler=$CC
11078 - _LT_TAGVAR(compiler, $1)=$CC
11079 - _LT_CC_BASENAME([$compiler])
11080 -
11081 - if test -n "$compiler"; then
11082 - # We don't want -fno-exception when compiling C++ code, so set the
11083 - # no_builtin_flag separately
11084 - if test "$GXX" = yes; then
11085 - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
11086 - else
11087 - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
11088 - fi
11089 -
11090 - if test "$GXX" = yes; then
11091 - # Set up default GNU C++ configuration
11092 -
11093 - LT_PATH_LD
11094 -
11095 - # Check if GNU C++ uses GNU ld as the underlying linker, since the
11096 - # archiving commands below assume that GNU ld is being used.
11097 - if test "$with_gnu_ld" = yes; then
11098 - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
11099 - _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'
11100 -
11101 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
11102 - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
11103 -
11104 - # If archive_cmds runs LD, not CC, wlarc should be empty
11105 - # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
11106 - # investigate it a little bit more. (MM)
11107 - wlarc='${wl}'
11108 -
11109 - # ancient GNU ld didn't support --whole-archive et. al.
11110 - if eval "`$CC -print-prog-name=ld` --help 2>&1" |
11111 - $GREP 'no-whole-archive' > /dev/null; then
11112 - _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
11113 - else
11114 - _LT_TAGVAR(whole_archive_flag_spec, $1)=
11115 - fi
11116 - else
11117 - with_gnu_ld=no
11118 - wlarc=
11119 -
11120 - # A generic and very simple default shared library creation
11121 - # command for GNU C++ for the case where it uses the native
11122 - # linker, instead of GNU ld. If possible, this setting should
11123 - # overridden to take advantage of the native linker features on
11124 - # the platform it is being used on.
11125 - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
11126 - fi
11127 -
11128 - # Commands to make compiler produce verbose output that lists
11129 - # what "hidden" libraries, object files and flags are used when
11130 - # linking a shared library.
11131 - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
11132 -
11133 - else
11134 - GXX=no
11135 - with_gnu_ld=no
11136 - wlarc=
11137 - fi
11138 -
11139 - # PORTME: fill in a description of your system's C++ link characteristics
11140 - AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
11141 - _LT_TAGVAR(ld_shlibs, $1)=yes
11142 - case $host_os in
11143 - aix3*)
11144 - # FIXME: insert proper C++ library support
11145 - _LT_TAGVAR(ld_shlibs, $1)=no
11146 - ;;
11147 - aix[[4-9]]*)
11148 - if test "$host_cpu" = ia64; then
11149 - # On IA64, the linker does run time linking by default, so we don't
11150 - # have to do anything special.
11151 - aix_use_runtimelinking=no
11152 - exp_sym_flag='-Bexport'
11153 - no_entry_flag=""
11154 - else
11155 - aix_use_runtimelinking=no
11156 -
11157 - # Test if we are trying to use run time linking or normal
11158 - # AIX style linking. If -brtl is somewhere in LDFLAGS, we
11159 - # need to do runtime linking.
11160 - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
11161 - for ld_flag in $LDFLAGS; do
11162 - case $ld_flag in
11163 - *-brtl*)
11164 - aix_use_runtimelinking=yes
11165 - break
11166 - ;;
11167 - esac
11168 - done
11169 - ;;
11170 - esac
11171 -
11172 - exp_sym_flag='-bexport'
11173 - no_entry_flag='-bnoentry'
11174 - fi
11175 -
11176 - # When large executables or shared objects are built, AIX ld can
11177 - # have problems creating the table of contents. If linking a library
11178 - # or program results in "error TOC overflow" add -mminimal-toc to
11179 - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
11180 - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
11181 -
11182 - _LT_TAGVAR(archive_cmds, $1)=''
11183 - _LT_TAGVAR(hardcode_direct, $1)=yes
11184 - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
11185 - _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
11186 - _LT_TAGVAR(link_all_deplibs, $1)=yes
11187 - _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
11188 -
11189 - if test "$GXX" = yes; then
11190 - case $host_os in aix4.[[012]]|aix4.[[012]].*)
11191 - # We only want to do this on AIX 4.2 and lower, the check
11192 - # below for broken collect2 doesn't work under 4.3+
11193 - collect2name=`${CC} -print-prog-name=collect2`
11194 - if test -f "$collect2name" &&
11195 - strings "$collect2name" | $GREP resolve_lib_name >/dev/null
11196 - then
11197 - # We have reworked collect2
11198 - :
11199 - else
11200 - # We have old collect2
11201 - _LT_TAGVAR(hardcode_direct, $1)=unsupported
11202 - # It fails to find uninstalled libraries when the uninstalled
11203 - # path is not listed in the libpath. Setting hardcode_minus_L
11204 - # to unsupported forces relinking
11205 - _LT_TAGVAR(hardcode_minus_L, $1)=yes
11206 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
11207 - _LT_TAGVAR(hardcode_libdir_separator, $1)=
11208 - fi
11209 - esac
11210 - shared_flag='-shared'
11211 - if test "$aix_use_runtimelinking" = yes; then
11212 - shared_flag="$shared_flag "'${wl}-G'
11213 - fi
11214 - else
11215 - # not using gcc
11216 - if test "$host_cpu" = ia64; then
11217 - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
11218 - # chokes on -Wl,-G. The following line is correct:
11219 - shared_flag='-G'
11220 - else
11221 - if test "$aix_use_runtimelinking" = yes; then
11222 - shared_flag='${wl}-G'
11223 - else
11224 - shared_flag='${wl}-bM:SRE'
11225 - fi
11226 - fi
11227 - fi
11228 -
11229 - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
11230 - # It seems that -bexpall does not export symbols beginning with
11231 - # underscore (_), so it is better to generate a list of symbols to
11232 - # export.
11233 - _LT_TAGVAR(always_export_symbols, $1)=yes
11234 - if test "$aix_use_runtimelinking" = yes; then
11235 - # Warning - without using the other runtime loading flags (-brtl),
11236 - # -berok will link without error, but may produce a broken library.
11237 - _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
11238 - # Determine the default libpath from the value encoded in an empty
11239 - # executable.
11240 - _LT_SYS_MODULE_PATH_AIX
11241 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
11242 -
11243 - _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"
11244 - else
11245 - if test "$host_cpu" = ia64; then
11246 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
11247 - _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
11248 - _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"
11249 - else
11250 - # Determine the default libpath from the value encoded in an
11251 - # empty executable.
11252 - _LT_SYS_MODULE_PATH_AIX
11253 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
11254 - # Warning - without using the other run time loading flags,
11255 - # -berok will link without error, but may produce a broken library.
11256 - _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
11257 - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
11258 - if test "$with_gnu_ld" = yes; then
11259 - # We only use this code for GNU lds that support --whole-archive.
11260 - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
11261 - else
11262 - # Exported symbols can be pulled into shared objects from archives
11263 - _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
11264 - fi
11265 - _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
11266 - # This is similar to how AIX traditionally builds its shared
11267 - # libraries.
11268 - _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'
11269 - fi
11270 - fi
11271 - ;;
11272 -
11273 - beos*)
11274 - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
11275 - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
11276 - # Joseph Beckenbach <jrb3@××××.com> says some releases of gcc
11277 - # support --undefined. This deserves some investigation. FIXME
11278 - _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
11279 - else
11280 - _LT_TAGVAR(ld_shlibs, $1)=no
11281 - fi
11282 - ;;
11283 -
11284 - chorus*)
11285 - case $cc_basename in
11286 - *)
11287 - # FIXME: insert proper C++ library support
11288 - _LT_TAGVAR(ld_shlibs, $1)=no
11289 - ;;
11290 - esac
11291 - ;;
11292 -
11293 - cygwin* | mingw* | pw32* | cegcc*)
11294 - # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
11295 - # as there is no search path for DLLs.
11296 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
11297 - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
11298 - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
11299 - _LT_TAGVAR(always_export_symbols, $1)=no
11300 - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
11301 -
11302 - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
11303 - _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'
11304 - # If the export-symbols file already is a .def file (1st line
11305 - # is EXPORTS), use it as is; otherwise, prepend...
11306 - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
11307 - cp $export_symbols $output_objdir/$soname.def;
11308 - else
11309 - echo EXPORTS > $output_objdir/$soname.def;
11310 - cat $export_symbols >> $output_objdir/$soname.def;
11311 - fi~
11312 - $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'
11313 - else
11314 - _LT_TAGVAR(ld_shlibs, $1)=no
11315 - fi
11316 - ;;
11317 - darwin* | rhapsody*)
11318 - _LT_DARWIN_LINKER_FEATURES($1)
11319 - ;;
11320 -
11321 - dgux*)
11322 - case $cc_basename in
11323 - ec++*)
11324 - # FIXME: insert proper C++ library support
11325 - _LT_TAGVAR(ld_shlibs, $1)=no
11326 - ;;
11327 - ghcx*)
11328 - # Green Hills C++ Compiler
11329 - # FIXME: insert proper C++ library support
11330 - _LT_TAGVAR(ld_shlibs, $1)=no
11331 - ;;
11332 - *)
11333 - # FIXME: insert proper C++ library support
11334 - _LT_TAGVAR(ld_shlibs, $1)=no
11335 - ;;
11336 - esac
11337 - ;;
11338 -
11339 - freebsd[[12]]*)
11340 - # C++ shared libraries reported to be fairly broken before
11341 - # switch to ELF
11342 - _LT_TAGVAR(ld_shlibs, $1)=no
11343 - ;;
11344 -
11345 - freebsd-elf*)
11346 - _LT_TAGVAR(archive_cmds_need_lc, $1)=no
11347 - ;;
11348 -
11349 - freebsd* | dragonfly*)
11350 - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
11351 - # conventions
11352 - _LT_TAGVAR(ld_shlibs, $1)=yes
11353 - ;;
11354 -
11355 - gnu*)
11356 - ;;
11357 -
11358 - haiku*)
11359 - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
11360 - _LT_TAGVAR(link_all_deplibs, $1)=yes
11361 - ;;
11362 -
11363 - hpux9*)
11364 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
11365 - _LT_TAGVAR(hardcode_libdir_separator, $1)=:
11366 - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
11367 - _LT_TAGVAR(hardcode_direct, $1)=yes
11368 - _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
11369 - # but as the default
11370 - # location of the library.
11371 -
11372 - case $cc_basename in
11373 - CC*)
11374 - # FIXME: insert proper C++ library support
11375 - _LT_TAGVAR(ld_shlibs, $1)=no
11376 - ;;
11377 - aCC*)
11378 - _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'
11379 - # Commands to make compiler produce verbose output that lists
11380 - # what "hidden" libraries, object files and flags are used when
11381 - # linking a shared library.
11382 - #
11383 - # There doesn't appear to be a way to prevent this compiler from
11384 - # explicitly linking system object files so we need to strip them
11385 - # from the output so that they don't get included in the library
11386 - # dependencies.
11387 - 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"'
11388 - ;;
11389 - *)
11390 - if test "$GXX" = yes; then
11391 - _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'
11392 - else
11393 - # FIXME: insert proper C++ library support
11394 - _LT_TAGVAR(ld_shlibs, $1)=no
11395 - fi
11396 - ;;
11397 - esac
11398 - ;;
11399 -
11400 - hpux10*|hpux11*)
11401 - if test $with_gnu_ld = no; then
11402 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
11403 - _LT_TAGVAR(hardcode_libdir_separator, $1)=:
11404 -
11405 - case $host_cpu in
11406 - hppa*64*|ia64*)
11407 - ;;
11408 - *)
11409 - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
11410 - ;;
11411 - esac
11412 - fi
11413 - case $host_cpu in
11414 - hppa*64*|ia64*)
11415 - _LT_TAGVAR(hardcode_direct, $1)=no
11416 - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
11417 - ;;
11418 - *)
11419 - _LT_TAGVAR(hardcode_direct, $1)=yes
11420 - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
11421 - _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
11422 - # but as the default
11423 - # location of the library.
11424 - ;;
11425 - esac
11426 -
11427 - case $cc_basename in
11428 - CC*)
11429 - # FIXME: insert proper C++ library support
11430 - _LT_TAGVAR(ld_shlibs, $1)=no
11431 - ;;
11432 - aCC*)
11433 - case $host_cpu in
11434 - hppa*64*)
11435 - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
11436 - ;;
11437 - ia64*)
11438 - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
11439 - ;;
11440 - *)
11441 - _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'
11442 - ;;
11443 - esac
11444 - # Commands to make compiler produce verbose output that lists
11445 - # what "hidden" libraries, object files and flags are used when
11446 - # linking a shared library.
11447 - #
11448 - # There doesn't appear to be a way to prevent this compiler from
11449 - # explicitly linking system object files so we need to strip them
11450 - # from the output so that they don't get included in the library
11451 - # dependencies.
11452 - 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"'
11453 - ;;
11454 - *)
11455 - if test "$GXX" = yes; then
11456 - if test $with_gnu_ld = no; then
11457 - case $host_cpu in
11458 - hppa*64*)
11459 - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
11460 - ;;
11461 - ia64*)
11462 - _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'
11463 - ;;
11464 - *)
11465 - _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'
11466 - ;;
11467 - esac
11468 - fi
11469 - else
11470 - # FIXME: insert proper C++ library support
11471 - _LT_TAGVAR(ld_shlibs, $1)=no
11472 - fi
11473 - ;;
11474 - esac
11475 - ;;
11476 -
11477 - interix[[3-9]]*)
11478 - _LT_TAGVAR(hardcode_direct, $1)=no
11479 - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
11480 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
11481 - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
11482 - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
11483 - # Instead, shared libraries are loaded at an image base (0x10000000 by
11484 - # default) and relocated if they conflict, which is a slow very memory
11485 - # consuming and fragmenting process. To avoid this, we pick a random,
11486 - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
11487 - # time. Moving up from 0x10000000 also allows more sbrk(2) space.
11488 - _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'
11489 - _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'
11490 - ;;
11491 - irix5* | irix6*)
11492 - case $cc_basename in
11493 - CC*)
11494 - # SGI C++
11495 - _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'
11496 -
11497 - # Archives containing C++ object files must be created using
11498 - # "CC -ar", where "CC" is the IRIX C++ compiler. This is
11499 - # necessary to make sure instantiated templates are included
11500 - # in the archive.
11501 - _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
11502 - ;;
11503 - *)
11504 - if test "$GXX" = yes; then
11505 - if test "$with_gnu_ld" = no; then
11506 - _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'
11507 - else
11508 - _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'
11509 - fi
11510 - fi
11511 - _LT_TAGVAR(link_all_deplibs, $1)=yes
11512 - ;;
11513 - esac
11514 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
11515 - _LT_TAGVAR(hardcode_libdir_separator, $1)=:
11516 - _LT_TAGVAR(inherit_rpath, $1)=yes
11517 - ;;
11518 -
11519 - linux* | k*bsd*-gnu | kopensolaris*-gnu)
11520 - case $cc_basename in
11521 - KCC*)
11522 - # Kuck and Associates, Inc. (KAI) C++ Compiler
11523 -
11524 - # KCC will only create a shared library if the output file
11525 - # ends with ".so" (or ".sl" for HP-UX), so rename the library
11526 - # to its proper name (with version) after linking.
11527 - _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'
11528 - _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'
11529 - # Commands to make compiler produce verbose output that lists
11530 - # what "hidden" libraries, object files and flags are used when
11531 - # linking a shared library.
11532 - #
11533 - # There doesn't appear to be a way to prevent this compiler from
11534 - # explicitly linking system object files so we need to strip them
11535 - # from the output so that they don't get included in the library
11536 - # dependencies.
11537 - 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"'
11538 -
11539 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
11540 - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
11541 -
11542 - # Archives containing C++ object files must be created using
11543 - # "CC -Bstatic", where "CC" is the KAI C++ compiler.
11544 - _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
11545 - ;;
11546 - icpc* | ecpc* )
11547 - # Intel C++
11548 - with_gnu_ld=yes
11549 - # version 8.0 and above of icpc choke on multiply defined symbols
11550 - # if we add $predep_objects and $postdep_objects, however 7.1 and
11551 - # earlier do not add the objects themselves.
11552 - case `$CC -V 2>&1` in
11553 - *"Version 7."*)
11554 - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
11555 - _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'
11556 - ;;
11557 - *) # Version 8.0 or newer
11558 - tmp_idyn=
11559 - case $host_cpu in
11560 - ia64*) tmp_idyn=' -i_dynamic';;
11561 - esac
11562 - _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
11563 - _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'
11564 - ;;
11565 - esac
11566 - _LT_TAGVAR(archive_cmds_need_lc, $1)=no
11567 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
11568 - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
11569 - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
11570 - ;;
11571 - pgCC* | pgcpp*)
11572 - # Portland Group C++ compiler
11573 - case `$CC -V` in
11574 - *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
11575 - _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
11576 - rm -rf $tpldir~
11577 - $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
11578 - compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
11579 - _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
11580 - rm -rf $tpldir~
11581 - $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
11582 - $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
11583 - $RANLIB $oldlib'
11584 - _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
11585 - rm -rf $tpldir~
11586 - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
11587 - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
11588 - _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
11589 - rm -rf $tpldir~
11590 - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
11591 - $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'
11592 - ;;
11593 - *) # Version 6 and above use weak symbols
11594 - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
11595 - _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'
11596 - ;;
11597 - esac
11598 -
11599 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
11600 - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
11601 - _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'
11602 - ;;
11603 - cxx*)
11604 - # Compaq C++
11605 - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
11606 - _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'
11607 -
11608 - runpath_var=LD_RUN_PATH
11609 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
11610 - _LT_TAGVAR(hardcode_libdir_separator, $1)=:
11611 -
11612 - # Commands to make compiler produce verbose output that lists
11613 - # what "hidden" libraries, object files and flags are used when
11614 - # linking a shared library.
11615 - #
11616 - # There doesn't appear to be a way to prevent this compiler from
11617 - # explicitly linking system object files so we need to strip them
11618 - # from the output so that they don't get included in the library
11619 - # dependencies.
11620 - 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'
11621 - ;;
11622 - xl* | mpixl* | bgxl*)
11623 - # IBM XL 8.0 on PPC, with GNU ld
11624 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
11625 - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
11626 - _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
11627 - if test "x$supports_anon_versioning" = xyes; then
11628 - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
11629 - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
11630 - echo "local: *; };" >> $output_objdir/$libname.ver~
11631 - $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
11632 - fi
11633 - ;;
11634 - *)
11635 - case `$CC -V 2>&1 | sed 5q` in
11636 - *Sun\ C*)
11637 - # Sun C++ 5.9
11638 - _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
11639 - _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
11640 - _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'
11641 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
11642 - _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'
11643 - _LT_TAGVAR(compiler_needs_object, $1)=yes
11644 -
11645 - # Not sure whether something based on
11646 - # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
11647 - # would be better.
11648 - output_verbose_link_cmd='func_echo_all'
11649 -
11650 - # Archives containing C++ object files must be created using
11651 - # "CC -xar", where "CC" is the Sun C++ compiler. This is
11652 - # necessary to make sure instantiated templates are included
11653 - # in the archive.
11654 - _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
11655 - ;;
11656 - esac
11657 - ;;
11658 - esac
11659 - ;;
11660 -
11661 - lynxos*)
11662 - # FIXME: insert proper C++ library support
11663 - _LT_TAGVAR(ld_shlibs, $1)=no
11664 - ;;
11665 -
11666 - m88k*)
11667 - # FIXME: insert proper C++ library support
11668 - _LT_TAGVAR(ld_shlibs, $1)=no
11669 - ;;
11670 -
11671 - mvs*)
11672 - case $cc_basename in
11673 - cxx*)
11674 - # FIXME: insert proper C++ library support
11675 - _LT_TAGVAR(ld_shlibs, $1)=no
11676 - ;;
11677 - *)
11678 - # FIXME: insert proper C++ library support
11679 - _LT_TAGVAR(ld_shlibs, $1)=no
11680 - ;;
11681 - esac
11682 - ;;
11683 -
11684 - netbsd*)
11685 - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
11686 - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
11687 - wlarc=
11688 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
11689 - _LT_TAGVAR(hardcode_direct, $1)=yes
11690 - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
11691 - fi
11692 - # Workaround some broken pre-1.5 toolchains
11693 - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
11694 - ;;
11695 -
11696 - *nto* | *qnx*)
11697 - _LT_TAGVAR(ld_shlibs, $1)=yes
11698 - ;;
11699 -
11700 - openbsd2*)
11701 - # C++ shared libraries are fairly broken
11702 - _LT_TAGVAR(ld_shlibs, $1)=no
11703 - ;;
11704 -
11705 - openbsd*)
11706 - if test -f /usr/libexec/ld.so; then
11707 - _LT_TAGVAR(hardcode_direct, $1)=yes
11708 - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
11709 - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
11710 - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
11711 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
11712 - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
11713 - _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'
11714 - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
11715 - _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
11716 - fi
11717 - output_verbose_link_cmd=func_echo_all
11718 - else
11719 - _LT_TAGVAR(ld_shlibs, $1)=no
11720 - fi
11721 - ;;
11722 -
11723 - osf3* | osf4* | osf5*)
11724 - case $cc_basename in
11725 - KCC*)
11726 - # Kuck and Associates, Inc. (KAI) C++ Compiler
11727 -
11728 - # KCC will only create a shared library if the output file
11729 - # ends with ".so" (or ".sl" for HP-UX), so rename the library
11730 - # to its proper name (with version) after linking.
11731 - _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'
11732 -
11733 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
11734 - _LT_TAGVAR(hardcode_libdir_separator, $1)=:
11735 -
11736 - # Archives containing C++ object files must be created using
11737 - # the KAI C++ compiler.
11738 - case $host in
11739 - osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
11740 - *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
11741 - esac
11742 - ;;
11743 - RCC*)
11744 - # Rational C++ 2.4.1
11745 - # FIXME: insert proper C++ library support
11746 - _LT_TAGVAR(ld_shlibs, $1)=no
11747 - ;;
11748 - cxx*)
11749 - case $host in
11750 - osf3*)
11751 - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
11752 - _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'
11753 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
11754 - ;;
11755 - *)
11756 - _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
11757 - _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'
11758 - _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
11759 - echo "-hidden">> $lib.exp~
11760 - $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~
11761 - $RM $lib.exp'
11762 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
11763 - ;;
11764 - esac
11765 -
11766 - _LT_TAGVAR(hardcode_libdir_separator, $1)=:
11767 -
11768 - # Commands to make compiler produce verbose output that lists
11769 - # what "hidden" libraries, object files and flags are used when
11770 - # linking a shared library.
11771 - #
11772 - # There doesn't appear to be a way to prevent this compiler from
11773 - # explicitly linking system object files so we need to strip them
11774 - # from the output so that they don't get included in the library
11775 - # dependencies.
11776 - 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"'
11777 - ;;
11778 - *)
11779 - if test "$GXX" = yes && test "$with_gnu_ld" = no; then
11780 - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
11781 - case $host in
11782 - osf3*)
11783 - _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'
11784 - ;;
11785 - *)
11786 - _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'
11787 - ;;
11788 - esac
11789 -
11790 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
11791 - _LT_TAGVAR(hardcode_libdir_separator, $1)=:
11792 -
11793 - # Commands to make compiler produce verbose output that lists
11794 - # what "hidden" libraries, object files and flags are used when
11795 - # linking a shared library.
11796 - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
11797 -
11798 - else
11799 - # FIXME: insert proper C++ library support
11800 - _LT_TAGVAR(ld_shlibs, $1)=no
11801 - fi
11802 - ;;
11803 - esac
11804 - ;;
11805 -
11806 - psos*)
11807 - # FIXME: insert proper C++ library support
11808 - _LT_TAGVAR(ld_shlibs, $1)=no
11809 - ;;
11810 -
11811 - sunos4*)
11812 - case $cc_basename in
11813 - CC*)
11814 - # Sun C++ 4.x
11815 - # FIXME: insert proper C++ library support
11816 - _LT_TAGVAR(ld_shlibs, $1)=no
11817 - ;;
11818 - lcc*)
11819 - # Lucid
11820 - # FIXME: insert proper C++ library support
11821 - _LT_TAGVAR(ld_shlibs, $1)=no
11822 - ;;
11823 - *)
11824 - # FIXME: insert proper C++ library support
11825 - _LT_TAGVAR(ld_shlibs, $1)=no
11826 - ;;
11827 - esac
11828 - ;;
11829 -
11830 - solaris*)
11831 - case $cc_basename in
11832 - CC* | sunCC*)
11833 - # Sun C++ 4.2, 5.x and Centerline C++
11834 - _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
11835 - _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
11836 - _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
11837 - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
11838 - $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'
11839 -
11840 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
11841 - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
11842 - case $host_os in
11843 - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
11844 - *)
11845 - # The compiler driver will combine and reorder linker options,
11846 - # but understands `-z linker_flag'.
11847 - # Supported since Solaris 2.6 (maybe 2.5.1?)
11848 - _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
11849 - ;;
11850 - esac
11851 - _LT_TAGVAR(link_all_deplibs, $1)=yes
11852 -
11853 - output_verbose_link_cmd='func_echo_all'
11854 -
11855 - # Archives containing C++ object files must be created using
11856 - # "CC -xar", where "CC" is the Sun C++ compiler. This is
11857 - # necessary to make sure instantiated templates are included
11858 - # in the archive.
11859 - _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
11860 - ;;
11861 - gcx*)
11862 - # Green Hills C++ Compiler
11863 - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
11864 -
11865 - # The C++ compiler must be used to create the archive.
11866 - _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
11867 - ;;
11868 - *)
11869 - # GNU C++ compiler with Solaris linker
11870 - if test "$GXX" = yes && test "$with_gnu_ld" = no; then
11871 - _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
11872 - if $CC --version | $GREP -v '^2\.7' > /dev/null; then
11873 - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
11874 - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
11875 - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
11876 -
11877 - # Commands to make compiler produce verbose output that lists
11878 - # what "hidden" libraries, object files and flags are used when
11879 - # linking a shared library.
11880 - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
11881 - else
11882 - # g++ 2.7 appears to require `-G' NOT `-shared' on this
11883 - # platform.
11884 - _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
11885 - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
11886 - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
11887 -
11888 - # Commands to make compiler produce verbose output that lists
11889 - # what "hidden" libraries, object files and flags are used when
11890 - # linking a shared library.
11891 - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
11892 - fi
11893 -
11894 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
11895 - case $host_os in
11896 - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
11897 - *)
11898 - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
11899 - ;;
11900 - esac
11901 - fi
11902 - ;;
11903 - esac
11904 - ;;
11905 -
11906 - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
11907 - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
11908 - _LT_TAGVAR(archive_cmds_need_lc, $1)=no
11909 - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
11910 - runpath_var='LD_RUN_PATH'
11911 -
11912 - case $cc_basename in
11913 - CC*)
11914 - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
11915 - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
11916 - ;;
11917 - *)
11918 - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
11919 - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
11920 - ;;
11921 - esac
11922 - ;;
11923 -
11924 - sysv5* | sco3.2v5* | sco5v6*)
11925 - # Note: We can NOT use -z defs as we might desire, because we do not
11926 - # link with -lc, and that would cause any symbols used from libc to
11927 - # always be unresolved, which means just about no library would
11928 - # ever link correctly. If we're not using GNU ld we use -z text
11929 - # though, which does catch some bad symbols but isn't as heavy-handed
11930 - # as -z defs.
11931 - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
11932 - _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
11933 - _LT_TAGVAR(archive_cmds_need_lc, $1)=no
11934 - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
11935 - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
11936 - _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
11937 - _LT_TAGVAR(link_all_deplibs, $1)=yes
11938 - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
11939 - runpath_var='LD_RUN_PATH'
11940 -
11941 - case $cc_basename in
11942 - CC*)
11943 - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
11944 - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
11945 - _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
11946 - '"$_LT_TAGVAR(old_archive_cmds, $1)"
11947 - _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
11948 - '"$_LT_TAGVAR(reload_cmds, $1)"
11949 - ;;
11950 - *)
11951 - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
11952 - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
11953 - ;;
11954 - esac
11955 - ;;
11956 -
11957 - tandem*)
11958 - case $cc_basename in
11959 - NCC*)
11960 - # NonStop-UX NCC 3.20
11961 - # FIXME: insert proper C++ library support
11962 - _LT_TAGVAR(ld_shlibs, $1)=no
11963 - ;;
11964 - *)
11965 - # FIXME: insert proper C++ library support
11966 - _LT_TAGVAR(ld_shlibs, $1)=no
11967 - ;;
11968 - esac
11969 - ;;
11970 -
11971 - vxworks*)
11972 - # FIXME: insert proper C++ library support
11973 - _LT_TAGVAR(ld_shlibs, $1)=no
11974 - ;;
11975 -
11976 - *)
11977 - # FIXME: insert proper C++ library support
11978 - _LT_TAGVAR(ld_shlibs, $1)=no
11979 - ;;
11980 - esac
11981 -
11982 - AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
11983 - test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
11984 -
11985 - _LT_TAGVAR(GCC, $1)="$GXX"
11986 - _LT_TAGVAR(LD, $1)="$LD"
11987 -
11988 - ## CAVEAT EMPTOR:
11989 - ## There is no encapsulation within the following macros, do not change
11990 - ## the running order or otherwise move them around unless you know exactly
11991 - ## what you are doing...
11992 - _LT_SYS_HIDDEN_LIBDEPS($1)
11993 - _LT_COMPILER_PIC($1)
11994 - _LT_COMPILER_C_O($1)
11995 - _LT_COMPILER_FILE_LOCKS($1)
11996 - _LT_LINKER_SHLIBS($1)
11997 - _LT_SYS_DYNAMIC_LINKER($1)
11998 - _LT_LINKER_HARDCODE_LIBPATH($1)
11999 -
12000 - _LT_CONFIG($1)
12001 - fi # test -n "$compiler"
12002 -
12003 - CC=$lt_save_CC
12004 - LDCXX=$LD
12005 - LD=$lt_save_LD
12006 - GCC=$lt_save_GCC
12007 - with_gnu_ld=$lt_save_with_gnu_ld
12008 - lt_cv_path_LDCXX=$lt_cv_path_LD
12009 - lt_cv_path_LD=$lt_save_path_LD
12010 - lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
12011 - lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
12012 -fi # test "$_lt_caught_CXX_error" != yes
12013 -
12014 -AC_LANG_POP
12015 -])# _LT_LANG_CXX_CONFIG
12016 -
12017 -
12018 -# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
12019 -# ---------------------------------
12020 -# Figure out "hidden" library dependencies from verbose
12021 -# compiler output when linking a shared library.
12022 -# Parse the compiler output and extract the necessary
12023 -# objects, libraries and library flags.
12024 -m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
12025 -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
12026 -# Dependencies to place before and after the object being linked:
12027 -_LT_TAGVAR(predep_objects, $1)=
12028 -_LT_TAGVAR(postdep_objects, $1)=
12029 -_LT_TAGVAR(predeps, $1)=
12030 -_LT_TAGVAR(postdeps, $1)=
12031 -_LT_TAGVAR(compiler_lib_search_path, $1)=
12032 -
12033 -dnl we can't use the lt_simple_compile_test_code here,
12034 -dnl because it contains code intended for an executable,
12035 -dnl not a library. It's possible we should let each
12036 -dnl tag define a new lt_????_link_test_code variable,
12037 -dnl but it's only used here...
12038 -m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
12039 -int a;
12040 -void foo (void) { a = 0; }
12041 -_LT_EOF
12042 -], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
12043 -class Foo
12044 -{
12045 -public:
12046 - Foo (void) { a = 0; }
12047 -private:
12048 - int a;
12049 -};
12050 -_LT_EOF
12051 -], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
12052 - subroutine foo
12053 - implicit none
12054 - integer*4 a
12055 - a=0
12056 - return
12057 - end
12058 -_LT_EOF
12059 -], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
12060 - subroutine foo
12061 - implicit none
12062 - integer a
12063 - a=0
12064 - return
12065 - end
12066 -_LT_EOF
12067 -], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
12068 -public class foo {
12069 - private int a;
12070 - public void bar (void) {
12071 - a = 0;
12072 - }
12073 -};
12074 -_LT_EOF
12075 -])
12076 -dnl Parse the compiler output and extract the necessary
12077 -dnl objects, libraries and library flags.
12078 -if AC_TRY_EVAL(ac_compile); then
12079 - # Parse the compiler output and extract the necessary
12080 - # objects, libraries and library flags.
12081 -
12082 - # Sentinel used to keep track of whether or not we are before
12083 - # the conftest object file.
12084 - pre_test_object_deps_done=no
12085 -
12086 - for p in `eval "$output_verbose_link_cmd"`; do
12087 - case $p in
12088 -
12089 - -L* | -R* | -l*)
12090 - # Some compilers place space between "-{L,R}" and the path.
12091 - # Remove the space.
12092 - if test $p = "-L" ||
12093 - test $p = "-R"; then
12094 - prev=$p
12095 - continue
12096 - else
12097 - prev=
12098 - fi
12099 -
12100 - if test "$pre_test_object_deps_done" = no; then
12101 - case $p in
12102 - -L* | -R*)
12103 - # Internal compiler library paths should come after those
12104 - # provided the user. The postdeps already come after the
12105 - # user supplied libs so there is no need to process them.
12106 - if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
12107 - _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
12108 - else
12109 - _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
12110 - fi
12111 - ;;
12112 - # The "-l" case would never come before the object being
12113 - # linked, so don't bother handling this case.
12114 - esac
12115 - else
12116 - if test -z "$_LT_TAGVAR(postdeps, $1)"; then
12117 - _LT_TAGVAR(postdeps, $1)="${prev}${p}"
12118 - else
12119 - _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
12120 - fi
12121 - fi
12122 - ;;
12123 -
12124 - *.$objext)
12125 - # This assumes that the test object file only shows up
12126 - # once in the compiler output.
12127 - if test "$p" = "conftest.$objext"; then
12128 - pre_test_object_deps_done=yes
12129 - continue
12130 - fi
12131 -
12132 - if test "$pre_test_object_deps_done" = no; then
12133 - if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
12134 - _LT_TAGVAR(predep_objects, $1)="$p"
12135 - else
12136 - _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
12137 - fi
12138 - else
12139 - if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
12140 - _LT_TAGVAR(postdep_objects, $1)="$p"
12141 - else
12142 - _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
12143 - fi
12144 - fi
12145 - ;;
12146 -
12147 - *) ;; # Ignore the rest.
12148 -
12149 - esac
12150 - done
12151 -
12152 - # Clean up.
12153 - rm -f a.out a.exe
12154 -else
12155 - echo "libtool.m4: error: problem compiling $1 test program"
12156 -fi
12157 -
12158 -$RM -f confest.$objext
12159 -
12160 -# PORTME: override above test on systems where it is broken
12161 -m4_if([$1], [CXX],
12162 -[case $host_os in
12163 -interix[[3-9]]*)
12164 - # Interix 3.5 installs completely hosed .la files for C++, so rather than
12165 - # hack all around it, let's just trust "g++" to DTRT.
12166 - _LT_TAGVAR(predep_objects,$1)=
12167 - _LT_TAGVAR(postdep_objects,$1)=
12168 - _LT_TAGVAR(postdeps,$1)=
12169 - ;;
12170 -
12171 -linux*)
12172 - case `$CC -V 2>&1 | sed 5q` in
12173 - *Sun\ C*)
12174 - # Sun C++ 5.9
12175 -
12176 - # The more standards-conforming stlport4 library is
12177 - # incompatible with the Cstd library. Avoid specifying
12178 - # it if it's in CXXFLAGS. Ignore libCrun as
12179 - # -library=stlport4 depends on it.
12180 - case " $CXX $CXXFLAGS " in
12181 - *" -library=stlport4 "*)
12182 - solaris_use_stlport4=yes
12183 - ;;
12184 - esac
12185 -
12186 - if test "$solaris_use_stlport4" != yes; then
12187 - _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
12188 - fi
12189 - ;;
12190 - esac
12191 - ;;
12192 -
12193 -solaris*)
12194 - case $cc_basename in
12195 - CC* | sunCC*)
12196 - # The more standards-conforming stlport4 library is
12197 - # incompatible with the Cstd library. Avoid specifying
12198 - # it if it's in CXXFLAGS. Ignore libCrun as
12199 - # -library=stlport4 depends on it.
12200 - case " $CXX $CXXFLAGS " in
12201 - *" -library=stlport4 "*)
12202 - solaris_use_stlport4=yes
12203 - ;;
12204 - esac
12205 -
12206 - # Adding this requires a known-good setup of shared libraries for
12207 - # Sun compiler versions before 5.6, else PIC objects from an old
12208 - # archive will be linked into the output, leading to subtle bugs.
12209 - if test "$solaris_use_stlport4" != yes; then
12210 - _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
12211 - fi
12212 - ;;
12213 - esac
12214 - ;;
12215 -esac
12216 -])
12217 -
12218 -case " $_LT_TAGVAR(postdeps, $1) " in
12219 -*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
12220 -esac
12221 - _LT_TAGVAR(compiler_lib_search_dirs, $1)=
12222 -if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
12223 - _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
12224 -fi
12225 -_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
12226 - [The directories searched by this compiler when creating a shared library])
12227 -_LT_TAGDECL([], [predep_objects], [1],
12228 - [Dependencies to place before and after the objects being linked to
12229 - create a shared library])
12230 -_LT_TAGDECL([], [postdep_objects], [1])
12231 -_LT_TAGDECL([], [predeps], [1])
12232 -_LT_TAGDECL([], [postdeps], [1])
12233 -_LT_TAGDECL([], [compiler_lib_search_path], [1],
12234 - [The library search path used internally by the compiler when linking
12235 - a shared library])
12236 -])# _LT_SYS_HIDDEN_LIBDEPS
12237 -
12238 -
12239 -# _LT_LANG_F77_CONFIG([TAG])
12240 -# --------------------------
12241 -# Ensure that the configuration variables for a Fortran 77 compiler are
12242 -# suitably defined. These variables are subsequently used by _LT_CONFIG
12243 -# to write the compiler configuration to `libtool'.
12244 -m4_defun([_LT_LANG_F77_CONFIG],
12245 -[AC_LANG_PUSH(Fortran 77)
12246 -if test -z "$F77" || test "X$F77" = "Xno"; then
12247 - _lt_disable_F77=yes
12248 -fi
12249 -
12250 -_LT_TAGVAR(archive_cmds_need_lc, $1)=no
12251 -_LT_TAGVAR(allow_undefined_flag, $1)=
12252 -_LT_TAGVAR(always_export_symbols, $1)=no
12253 -_LT_TAGVAR(archive_expsym_cmds, $1)=
12254 -_LT_TAGVAR(export_dynamic_flag_spec, $1)=
12255 -_LT_TAGVAR(hardcode_direct, $1)=no
12256 -_LT_TAGVAR(hardcode_direct_absolute, $1)=no
12257 -_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
12258 -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
12259 -_LT_TAGVAR(hardcode_libdir_separator, $1)=
12260 -_LT_TAGVAR(hardcode_minus_L, $1)=no
12261 -_LT_TAGVAR(hardcode_automatic, $1)=no
12262 -_LT_TAGVAR(inherit_rpath, $1)=no
12263 -_LT_TAGVAR(module_cmds, $1)=
12264 -_LT_TAGVAR(module_expsym_cmds, $1)=
12265 -_LT_TAGVAR(link_all_deplibs, $1)=unknown
12266 -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
12267 -_LT_TAGVAR(reload_flag, $1)=$reload_flag
12268 -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
12269 -_LT_TAGVAR(no_undefined_flag, $1)=
12270 -_LT_TAGVAR(whole_archive_flag_spec, $1)=
12271 -_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
12272 -
12273 -# Source file extension for f77 test sources.
12274 -ac_ext=f
12275 -
12276 -# Object file extension for compiled f77 test sources.
12277 -objext=o
12278 -_LT_TAGVAR(objext, $1)=$objext
12279 -
12280 -# No sense in running all these tests if we already determined that
12281 -# the F77 compiler isn't working. Some variables (like enable_shared)
12282 -# are currently assumed to apply to all compilers on this platform,
12283 -# and will be corrupted by setting them based on a non-working compiler.
12284 -if test "$_lt_disable_F77" != yes; then
12285 - # Code to be used in simple compile tests
12286 - lt_simple_compile_test_code="\
12287 - subroutine t
12288 - return
12289 - end
12290 -"
12291 -
12292 - # Code to be used in simple link tests
12293 - lt_simple_link_test_code="\
12294 - program t
12295 - end
12296 -"
12297 -
12298 - # ltmain only uses $CC for tagged configurations so make sure $CC is set.
12299 - _LT_TAG_COMPILER
12300 -
12301 - # save warnings/boilerplate of simple test code
12302 - _LT_COMPILER_BOILERPLATE
12303 - _LT_LINKER_BOILERPLATE
12304 -
12305 - # Allow CC to be a program name with arguments.
12306 - lt_save_CC="$CC"
12307 - lt_save_GCC=$GCC
12308 - CC=${F77-"f77"}
12309 - compiler=$CC
12310 - _LT_TAGVAR(compiler, $1)=$CC
12311 - _LT_CC_BASENAME([$compiler])
12312 - GCC=$G77
12313 - if test -n "$compiler"; then
12314 - AC_MSG_CHECKING([if libtool supports shared libraries])
12315 - AC_MSG_RESULT([$can_build_shared])
12316 -
12317 - AC_MSG_CHECKING([whether to build shared libraries])
12318 - test "$can_build_shared" = "no" && enable_shared=no
12319 -
12320 - # On AIX, shared libraries and static libraries use the same namespace, and
12321 - # are all built from PIC.
12322 - case $host_os in
12323 - aix3*)
12324 - test "$enable_shared" = yes && enable_static=no
12325 - if test -n "$RANLIB"; then
12326 - archive_cmds="$archive_cmds~\$RANLIB \$lib"
12327 - postinstall_cmds='$RANLIB $lib'
12328 - fi
12329 - ;;
12330 - aix[[4-9]]*)
12331 - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
12332 - test "$enable_shared" = yes && enable_static=no
12333 - fi
12334 - ;;
12335 - esac
12336 - AC_MSG_RESULT([$enable_shared])
12337 -
12338 - AC_MSG_CHECKING([whether to build static libraries])
12339 - # Make sure either enable_shared or enable_static is yes.
12340 - test "$enable_shared" = yes || enable_static=yes
12341 - AC_MSG_RESULT([$enable_static])
12342 -
12343 - _LT_TAGVAR(GCC, $1)="$G77"
12344 - _LT_TAGVAR(LD, $1)="$LD"
12345 -
12346 - ## CAVEAT EMPTOR:
12347 - ## There is no encapsulation within the following macros, do not change
12348 - ## the running order or otherwise move them around unless you know exactly
12349 - ## what you are doing...
12350 - _LT_COMPILER_PIC($1)
12351 - _LT_COMPILER_C_O($1)
12352 - _LT_COMPILER_FILE_LOCKS($1)
12353 - _LT_LINKER_SHLIBS($1)
12354 - _LT_SYS_DYNAMIC_LINKER($1)
12355 - _LT_LINKER_HARDCODE_LIBPATH($1)
12356 -
12357 - _LT_CONFIG($1)
12358 - fi # test -n "$compiler"
12359 -
12360 - GCC=$lt_save_GCC
12361 - CC="$lt_save_CC"
12362 -fi # test "$_lt_disable_F77" != yes
12363 -
12364 -AC_LANG_POP
12365 -])# _LT_LANG_F77_CONFIG
12366 -
12367 -
12368 -# _LT_LANG_FC_CONFIG([TAG])
12369 -# -------------------------
12370 -# Ensure that the configuration variables for a Fortran compiler are
12371 -# suitably defined. These variables are subsequently used by _LT_CONFIG
12372 -# to write the compiler configuration to `libtool'.
12373 -m4_defun([_LT_LANG_FC_CONFIG],
12374 -[AC_LANG_PUSH(Fortran)
12375 -
12376 -if test -z "$FC" || test "X$FC" = "Xno"; then
12377 - _lt_disable_FC=yes
12378 -fi
12379 -
12380 -_LT_TAGVAR(archive_cmds_need_lc, $1)=no
12381 -_LT_TAGVAR(allow_undefined_flag, $1)=
12382 -_LT_TAGVAR(always_export_symbols, $1)=no
12383 -_LT_TAGVAR(archive_expsym_cmds, $1)=
12384 -_LT_TAGVAR(export_dynamic_flag_spec, $1)=
12385 -_LT_TAGVAR(hardcode_direct, $1)=no
12386 -_LT_TAGVAR(hardcode_direct_absolute, $1)=no
12387 -_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
12388 -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
12389 -_LT_TAGVAR(hardcode_libdir_separator, $1)=
12390 -_LT_TAGVAR(hardcode_minus_L, $1)=no
12391 -_LT_TAGVAR(hardcode_automatic, $1)=no
12392 -_LT_TAGVAR(inherit_rpath, $1)=no
12393 -_LT_TAGVAR(module_cmds, $1)=
12394 -_LT_TAGVAR(module_expsym_cmds, $1)=
12395 -_LT_TAGVAR(link_all_deplibs, $1)=unknown
12396 -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
12397 -_LT_TAGVAR(reload_flag, $1)=$reload_flag
12398 -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
12399 -_LT_TAGVAR(no_undefined_flag, $1)=
12400 -_LT_TAGVAR(whole_archive_flag_spec, $1)=
12401 -_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
12402 -
12403 -# Source file extension for fc test sources.
12404 -ac_ext=${ac_fc_srcext-f}
12405 -
12406 -# Object file extension for compiled fc test sources.
12407 -objext=o
12408 -_LT_TAGVAR(objext, $1)=$objext
12409 -
12410 -# No sense in running all these tests if we already determined that
12411 -# the FC compiler isn't working. Some variables (like enable_shared)
12412 -# are currently assumed to apply to all compilers on this platform,
12413 -# and will be corrupted by setting them based on a non-working compiler.
12414 -if test "$_lt_disable_FC" != yes; then
12415 - # Code to be used in simple compile tests
12416 - lt_simple_compile_test_code="\
12417 - subroutine t
12418 - return
12419 - end
12420 -"
12421 -
12422 - # Code to be used in simple link tests
12423 - lt_simple_link_test_code="\
12424 - program t
12425 - end
12426 -"
12427 -
12428 - # ltmain only uses $CC for tagged configurations so make sure $CC is set.
12429 - _LT_TAG_COMPILER
12430 -
12431 - # save warnings/boilerplate of simple test code
12432 - _LT_COMPILER_BOILERPLATE
12433 - _LT_LINKER_BOILERPLATE
12434 -
12435 - # Allow CC to be a program name with arguments.
12436 - lt_save_CC="$CC"
12437 - lt_save_GCC=$GCC
12438 - CC=${FC-"f95"}
12439 - compiler=$CC
12440 - GCC=$ac_cv_fc_compiler_gnu
12441 -
12442 - _LT_TAGVAR(compiler, $1)=$CC
12443 - _LT_CC_BASENAME([$compiler])
12444 -
12445 - if test -n "$compiler"; then
12446 - AC_MSG_CHECKING([if libtool supports shared libraries])
12447 - AC_MSG_RESULT([$can_build_shared])
12448 -
12449 - AC_MSG_CHECKING([whether to build shared libraries])
12450 - test "$can_build_shared" = "no" && enable_shared=no
12451 -
12452 - # On AIX, shared libraries and static libraries use the same namespace, and
12453 - # are all built from PIC.
12454 - case $host_os in
12455 - aix3*)
12456 - test "$enable_shared" = yes && enable_static=no
12457 - if test -n "$RANLIB"; then
12458 - archive_cmds="$archive_cmds~\$RANLIB \$lib"
12459 - postinstall_cmds='$RANLIB $lib'
12460 - fi
12461 - ;;
12462 - aix[[4-9]]*)
12463 - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
12464 - test "$enable_shared" = yes && enable_static=no
12465 - fi
12466 - ;;
12467 - esac
12468 - AC_MSG_RESULT([$enable_shared])
12469 -
12470 - AC_MSG_CHECKING([whether to build static libraries])
12471 - # Make sure either enable_shared or enable_static is yes.
12472 - test "$enable_shared" = yes || enable_static=yes
12473 - AC_MSG_RESULT([$enable_static])
12474 -
12475 - _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
12476 - _LT_TAGVAR(LD, $1)="$LD"
12477 -
12478 - ## CAVEAT EMPTOR:
12479 - ## There is no encapsulation within the following macros, do not change
12480 - ## the running order or otherwise move them around unless you know exactly
12481 - ## what you are doing...
12482 - _LT_SYS_HIDDEN_LIBDEPS($1)
12483 - _LT_COMPILER_PIC($1)
12484 - _LT_COMPILER_C_O($1)
12485 - _LT_COMPILER_FILE_LOCKS($1)
12486 - _LT_LINKER_SHLIBS($1)
12487 - _LT_SYS_DYNAMIC_LINKER($1)
12488 - _LT_LINKER_HARDCODE_LIBPATH($1)
12489 -
12490 - _LT_CONFIG($1)
12491 - fi # test -n "$compiler"
12492 -
12493 - GCC=$lt_save_GCC
12494 - CC="$lt_save_CC"
12495 -fi # test "$_lt_disable_FC" != yes
12496 -
12497 -AC_LANG_POP
12498 -])# _LT_LANG_FC_CONFIG
12499 -
12500 -
12501 -# _LT_LANG_GCJ_CONFIG([TAG])
12502 -# --------------------------
12503 -# Ensure that the configuration variables for the GNU Java Compiler compiler
12504 -# are suitably defined. These variables are subsequently used by _LT_CONFIG
12505 -# to write the compiler configuration to `libtool'.
12506 -m4_defun([_LT_LANG_GCJ_CONFIG],
12507 -[AC_REQUIRE([LT_PROG_GCJ])dnl
12508 -AC_LANG_SAVE
12509 -
12510 -# Source file extension for Java test sources.
12511 -ac_ext=java
12512 -
12513 -# Object file extension for compiled Java test sources.
12514 -objext=o
12515 -_LT_TAGVAR(objext, $1)=$objext
12516 -
12517 -# Code to be used in simple compile tests
12518 -lt_simple_compile_test_code="class foo {}"
12519 -
12520 -# Code to be used in simple link tests
12521 -lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
12522 -
12523 -# ltmain only uses $CC for tagged configurations so make sure $CC is set.
12524 -_LT_TAG_COMPILER
12525 -
12526 -# save warnings/boilerplate of simple test code
12527 -_LT_COMPILER_BOILERPLATE
12528 -_LT_LINKER_BOILERPLATE
12529 -
12530 -# Allow CC to be a program name with arguments.
12531 -lt_save_CC="$CC"
12532 -lt_save_GCC=$GCC
12533 -GCC=yes
12534 -CC=${GCJ-"gcj"}
12535 -compiler=$CC
12536 -_LT_TAGVAR(compiler, $1)=$CC
12537 -_LT_TAGVAR(LD, $1)="$LD"
12538 -_LT_CC_BASENAME([$compiler])
12539 -
12540 -# GCJ did not exist at the time GCC didn't implicitly link libc in.
12541 -_LT_TAGVAR(archive_cmds_need_lc, $1)=no
12542 -
12543 -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
12544 -_LT_TAGVAR(reload_flag, $1)=$reload_flag
12545 -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
12546 -
12547 -## CAVEAT EMPTOR:
12548 -## There is no encapsulation within the following macros, do not change
12549 -## the running order or otherwise move them around unless you know exactly
12550 -## what you are doing...
12551 -if test -n "$compiler"; then
12552 - _LT_COMPILER_NO_RTTI($1)
12553 - _LT_COMPILER_PIC($1)
12554 - _LT_COMPILER_C_O($1)
12555 - _LT_COMPILER_FILE_LOCKS($1)
12556 - _LT_LINKER_SHLIBS($1)
12557 - _LT_LINKER_HARDCODE_LIBPATH($1)
12558 -
12559 - _LT_CONFIG($1)
12560 -fi
12561 -
12562 -AC_LANG_RESTORE
12563 -
12564 -GCC=$lt_save_GCC
12565 -CC="$lt_save_CC"
12566 -])# _LT_LANG_GCJ_CONFIG
12567 -
12568 -
12569 -# _LT_LANG_RC_CONFIG([TAG])
12570 -# -------------------------
12571 -# Ensure that the configuration variables for the Windows resource compiler
12572 -# are suitably defined. These variables are subsequently used by _LT_CONFIG
12573 -# to write the compiler configuration to `libtool'.
12574 -m4_defun([_LT_LANG_RC_CONFIG],
12575 -[AC_REQUIRE([LT_PROG_RC])dnl
12576 -AC_LANG_SAVE
12577 -
12578 -# Source file extension for RC test sources.
12579 -ac_ext=rc
12580 -
12581 -# Object file extension for compiled RC test sources.
12582 -objext=o
12583 -_LT_TAGVAR(objext, $1)=$objext
12584 -
12585 -# Code to be used in simple compile tests
12586 -lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
12587 -
12588 -# Code to be used in simple link tests
12589 -lt_simple_link_test_code="$lt_simple_compile_test_code"
12590 -
12591 -# ltmain only uses $CC for tagged configurations so make sure $CC is set.
12592 -_LT_TAG_COMPILER
12593 -
12594 -# save warnings/boilerplate of simple test code
12595 -_LT_COMPILER_BOILERPLATE
12596 -_LT_LINKER_BOILERPLATE
12597 -
12598 -# Allow CC to be a program name with arguments.
12599 -lt_save_CC="$CC"
12600 -lt_save_GCC=$GCC
12601 -GCC=
12602 -CC=${RC-"windres"}
12603 -compiler=$CC
12604 -_LT_TAGVAR(compiler, $1)=$CC
12605 -_LT_CC_BASENAME([$compiler])
12606 -_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
12607 -
12608 -if test -n "$compiler"; then
12609 - :
12610 - _LT_CONFIG($1)
12611 -fi
12612 -
12613 -GCC=$lt_save_GCC
12614 -AC_LANG_RESTORE
12615 -CC="$lt_save_CC"
12616 -])# _LT_LANG_RC_CONFIG
12617 -
12618 -
12619 -# LT_PROG_GCJ
12620 -# -----------
12621 -AC_DEFUN([LT_PROG_GCJ],
12622 -[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
12623 - [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
12624 - [AC_CHECK_TOOL(GCJ, gcj,)
12625 - test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
12626 - AC_SUBST(GCJFLAGS)])])[]dnl
12627 -])
12628 -
12629 -# Old name:
12630 -AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
12631 -dnl aclocal-1.4 backwards compatibility:
12632 -dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
12633 -
12634 -
12635 -# LT_PROG_RC
12636 -# ----------
12637 -AC_DEFUN([LT_PROG_RC],
12638 -[AC_CHECK_TOOL(RC, windres,)
12639 -])
12640 -
12641 -# Old name:
12642 -AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
12643 -dnl aclocal-1.4 backwards compatibility:
12644 -dnl AC_DEFUN([LT_AC_PROG_RC], [])
12645 -
12646 -
12647 -# _LT_DECL_EGREP
12648 -# --------------
12649 -# If we don't have a new enough Autoconf to choose the best grep
12650 -# available, choose the one first in the user's PATH.
12651 -m4_defun([_LT_DECL_EGREP],
12652 -[AC_REQUIRE([AC_PROG_EGREP])dnl
12653 -AC_REQUIRE([AC_PROG_FGREP])dnl
12654 -test -z "$GREP" && GREP=grep
12655 -_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
12656 -_LT_DECL([], [EGREP], [1], [An ERE matcher])
12657 -_LT_DECL([], [FGREP], [1], [A literal string matcher])
12658 -dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
12659 -AC_SUBST([GREP])
12660 -])
12661 -
12662 -
12663 -# _LT_DECL_OBJDUMP
12664 -# --------------
12665 -# If we don't have a new enough Autoconf to choose the best objdump
12666 -# available, choose the one first in the user's PATH.
12667 -m4_defun([_LT_DECL_OBJDUMP],
12668 -[AC_CHECK_TOOL(OBJDUMP, objdump, false)
12669 -test -z "$OBJDUMP" && OBJDUMP=objdump
12670 -_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
12671 -AC_SUBST([OBJDUMP])
12672 -])
12673 -
12674 -
12675 -# _LT_DECL_SED
12676 -# ------------
12677 -# Check for a fully-functional sed program, that truncates
12678 -# as few characters as possible. Prefer GNU sed if found.
12679 -m4_defun([_LT_DECL_SED],
12680 -[AC_PROG_SED
12681 -test -z "$SED" && SED=sed
12682 -Xsed="$SED -e 1s/^X//"
12683 -_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
12684 -_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
12685 - [Sed that helps us avoid accidentally triggering echo(1) options like -n])
12686 -])# _LT_DECL_SED
12687 -
12688 -m4_ifndef([AC_PROG_SED], [
12689 -############################################################
12690 -# NOTE: This macro has been submitted for inclusion into #
12691 -# GNU Autoconf as AC_PROG_SED. When it is available in #
12692 -# a released version of Autoconf we should remove this #
12693 -# macro and use it instead. #
12694 -############################################################
12695 -
12696 -m4_defun([AC_PROG_SED],
12697 -[AC_MSG_CHECKING([for a sed that does not truncate output])
12698 -AC_CACHE_VAL(lt_cv_path_SED,
12699 -[# Loop through the user's path and test for sed and gsed.
12700 -# Then use that list of sed's as ones to test for truncation.
12701 -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
12702 -for as_dir in $PATH
12703 -do
12704 - IFS=$as_save_IFS
12705 - test -z "$as_dir" && as_dir=.
12706 - for lt_ac_prog in sed gsed; do
12707 - for ac_exec_ext in '' $ac_executable_extensions; do
12708 - if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
12709 - lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
12710 - fi
12711 - done
12712 - done
12713 -done
12714 -IFS=$as_save_IFS
12715 -lt_ac_max=0
12716 -lt_ac_count=0
12717 -# Add /usr/xpg4/bin/sed as it is typically found on Solaris
12718 -# along with /bin/sed that truncates output.
12719 -for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
12720 - test ! -f $lt_ac_sed && continue
12721 - cat /dev/null > conftest.in
12722 - lt_ac_count=0
12723 - echo $ECHO_N "0123456789$ECHO_C" >conftest.in
12724 - # Check for GNU sed and select it if it is found.
12725 - if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
12726 - lt_cv_path_SED=$lt_ac_sed
12727 - break
12728 - fi
12729 - while true; do
12730 - cat conftest.in conftest.in >conftest.tmp
12731 - mv conftest.tmp conftest.in
12732 - cp conftest.in conftest.nl
12733 - echo >>conftest.nl
12734 - $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
12735 - cmp -s conftest.out conftest.nl || break
12736 - # 10000 chars as input seems more than enough
12737 - test $lt_ac_count -gt 10 && break
12738 - lt_ac_count=`expr $lt_ac_count + 1`
12739 - if test $lt_ac_count -gt $lt_ac_max; then
12740 - lt_ac_max=$lt_ac_count
12741 - lt_cv_path_SED=$lt_ac_sed
12742 - fi
12743 - done
12744 -done
12745 -])
12746 -SED=$lt_cv_path_SED
12747 -AC_SUBST([SED])
12748 -AC_MSG_RESULT([$SED])
12749 -])#AC_PROG_SED
12750 -])#m4_ifndef
12751 -
12752 -# Old name:
12753 -AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
12754 -dnl aclocal-1.4 backwards compatibility:
12755 -dnl AC_DEFUN([LT_AC_PROG_SED], [])
12756 -
12757 -
12758 -# _LT_CHECK_SHELL_FEATURES
12759 -# ------------------------
12760 -# Find out whether the shell is Bourne or XSI compatible,
12761 -# or has some other useful features.
12762 -m4_defun([_LT_CHECK_SHELL_FEATURES],
12763 -[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
12764 -# Try some XSI features
12765 -xsi_shell=no
12766 -( _lt_dummy="a/b/c"
12767 - test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
12768 - = c,a/b,, \
12769 - && eval 'test $(( 1 + 1 )) -eq 2 \
12770 - && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
12771 - && xsi_shell=yes
12772 -AC_MSG_RESULT([$xsi_shell])
12773 -_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
12774 -
12775 -AC_MSG_CHECKING([whether the shell understands "+="])
12776 -lt_shell_append=no
12777 -( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
12778 - >/dev/null 2>&1 \
12779 - && lt_shell_append=yes
12780 -AC_MSG_RESULT([$lt_shell_append])
12781 -_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
12782 -
12783 -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
12784 - lt_unset=unset
12785 -else
12786 - lt_unset=false
12787 -fi
12788 -_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
12789 -
12790 -# test EBCDIC or ASCII
12791 -case `echo X|tr X '\101'` in
12792 - A) # ASCII based system
12793 - # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
12794 - lt_SP2NL='tr \040 \012'
12795 - lt_NL2SP='tr \015\012 \040\040'
12796 - ;;
12797 - *) # EBCDIC based system
12798 - lt_SP2NL='tr \100 \n'
12799 - lt_NL2SP='tr \r\n \100\100'
12800 - ;;
12801 -esac
12802 -_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
12803 -_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
12804 -])# _LT_CHECK_SHELL_FEATURES
12805 -
12806 -
12807 -# _LT_PROG_XSI_SHELLFNS
12808 -# ---------------------
12809 -# Bourne and XSI compatible variants of some useful shell functions.
12810 -m4_defun([_LT_PROG_XSI_SHELLFNS],
12811 -[case $xsi_shell in
12812 - yes)
12813 - cat << \_LT_EOF >> "$cfgfile"
12814 -
12815 -# func_dirname file append nondir_replacement
12816 -# Compute the dirname of FILE. If nonempty, add APPEND to the result,
12817 -# otherwise set result to NONDIR_REPLACEMENT.
12818 -func_dirname ()
12819 -{
12820 - case ${1} in
12821 - */*) func_dirname_result="${1%/*}${2}" ;;
12822 - * ) func_dirname_result="${3}" ;;
12823 - esac
12824 -}
12825 -
12826 -# func_basename file
12827 -func_basename ()
12828 -{
12829 - func_basename_result="${1##*/}"
12830 -}
12831 -
12832 -# func_dirname_and_basename file append nondir_replacement
12833 -# perform func_basename and func_dirname in a single function
12834 -# call:
12835 -# dirname: Compute the dirname of FILE. If nonempty,
12836 -# add APPEND to the result, otherwise set result
12837 -# to NONDIR_REPLACEMENT.
12838 -# value returned in "$func_dirname_result"
12839 -# basename: Compute filename of FILE.
12840 -# value retuned in "$func_basename_result"
12841 -# Implementation must be kept synchronized with func_dirname
12842 -# and func_basename. For efficiency, we do not delegate to
12843 -# those functions but instead duplicate the functionality here.
12844 -func_dirname_and_basename ()
12845 -{
12846 - case ${1} in
12847 - */*) func_dirname_result="${1%/*}${2}" ;;
12848 - * ) func_dirname_result="${3}" ;;
12849 - esac
12850 - func_basename_result="${1##*/}"
12851 -}
12852 -
12853 -# func_stripname prefix suffix name
12854 -# strip PREFIX and SUFFIX off of NAME.
12855 -# PREFIX and SUFFIX must not contain globbing or regex special
12856 -# characters, hashes, percent signs, but SUFFIX may contain a leading
12857 -# dot (in which case that matches only a dot).
12858 -func_stripname ()
12859 -{
12860 - # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
12861 - # positional parameters, so assign one to ordinary parameter first.
12862 - func_stripname_result=${3}
12863 - func_stripname_result=${func_stripname_result#"${1}"}
12864 - func_stripname_result=${func_stripname_result%"${2}"}
12865 -}
12866 -
12867 -# func_opt_split
12868 -func_opt_split ()
12869 -{
12870 - func_opt_split_opt=${1%%=*}
12871 - func_opt_split_arg=${1#*=}
12872 -}
12873 -
12874 -# func_lo2o object
12875 -func_lo2o ()
12876 -{
12877 - case ${1} in
12878 - *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
12879 - *) func_lo2o_result=${1} ;;
12880 - esac
12881 -}
12882 -
12883 -# func_xform libobj-or-source
12884 -func_xform ()
12885 -{
12886 - func_xform_result=${1%.*}.lo
12887 -}
12888 -
12889 -# func_arith arithmetic-term...
12890 -func_arith ()
12891 -{
12892 - func_arith_result=$(( $[*] ))
12893 -}
12894 -
12895 -# func_len string
12896 -# STRING may not start with a hyphen.
12897 -func_len ()
12898 -{
12899 - func_len_result=${#1}
12900 -}
12901 -
12902 -_LT_EOF
12903 - ;;
12904 - *) # Bourne compatible functions.
12905 - cat << \_LT_EOF >> "$cfgfile"
12906 -
12907 -# func_dirname file append nondir_replacement
12908 -# Compute the dirname of FILE. If nonempty, add APPEND to the result,
12909 -# otherwise set result to NONDIR_REPLACEMENT.
12910 -func_dirname ()
12911 -{
12912 - # Extract subdirectory from the argument.
12913 - func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
12914 - if test "X$func_dirname_result" = "X${1}"; then
12915 - func_dirname_result="${3}"
12916 - else
12917 - func_dirname_result="$func_dirname_result${2}"
12918 - fi
12919 -}
12920 -
12921 -# func_basename file
12922 -func_basename ()
12923 -{
12924 - func_basename_result=`$ECHO "${1}" | $SED "$basename"`
12925 -}
12926 -
12927 -dnl func_dirname_and_basename
12928 -dnl A portable version of this function is already defined in general.m4sh
12929 -dnl so there is no need for it here.
12930 -
12931 -# func_stripname prefix suffix name
12932 -# strip PREFIX and SUFFIX off of NAME.
12933 -# PREFIX and SUFFIX must not contain globbing or regex special
12934 -# characters, hashes, percent signs, but SUFFIX may contain a leading
12935 -# dot (in which case that matches only a dot).
12936 -# func_strip_suffix prefix name
12937 -func_stripname ()
12938 -{
12939 - case ${2} in
12940 - .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
12941 - *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
12942 - esac
12943 -}
12944 -
12945 -# sed scripts:
12946 -my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
12947 -my_sed_long_arg='1s/^-[[^=]]*=//'
12948 -
12949 -# func_opt_split
12950 -func_opt_split ()
12951 -{
12952 - func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
12953 - func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
12954 -}
12955 -
12956 -# func_lo2o object
12957 -func_lo2o ()
12958 -{
12959 - func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
12960 -}
12961 -
12962 -# func_xform libobj-or-source
12963 -func_xform ()
12964 -{
12965 - func_xform_result=`$ECHO "${1}" | $SED 's/\.[[^.]]*$/.lo/'`
12966 -}
12967 -
12968 -# func_arith arithmetic-term...
12969 -func_arith ()
12970 -{
12971 - func_arith_result=`expr "$[@]"`
12972 -}
12973 -
12974 -# func_len string
12975 -# STRING may not start with a hyphen.
12976 -func_len ()
12977 -{
12978 - func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`
12979 -}
12980 -
12981 -_LT_EOF
12982 -esac
12983 -
12984 -case $lt_shell_append in
12985 - yes)
12986 - cat << \_LT_EOF >> "$cfgfile"
12987 -
12988 -# func_append var value
12989 -# Append VALUE to the end of shell variable VAR.
12990 -func_append ()
12991 -{
12992 - eval "$[1]+=\$[2]"
12993 -}
12994 -_LT_EOF
12995 - ;;
12996 - *)
12997 - cat << \_LT_EOF >> "$cfgfile"
12998 -
12999 -# func_append var value
13000 -# Append VALUE to the end of shell variable VAR.
13001 -func_append ()
13002 -{
13003 - eval "$[1]=\$$[1]\$[2]"
13004 -}
13005 -
13006 -_LT_EOF
13007 - ;;
13008 - esac
13009 -])
13010
13011 diff --git a/libbash-0.1/m4/ltoptions.m4 b/libbash-0.1/m4/ltoptions.m4
13012 deleted file mode 100644
13013 index 17cfd51..0000000
13014 --- a/libbash-0.1/m4/ltoptions.m4
13015 +++ /dev/null
13016 @@ -1,369 +0,0 @@
13017 -# Helper functions for option handling. -*- Autoconf -*-
13018 -#
13019 -# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
13020 -# Inc.
13021 -# Written by Gary V. Vaughan, 2004
13022 -#
13023 -# This file is free software; the Free Software Foundation gives
13024 -# unlimited permission to copy and/or distribute it, with or without
13025 -# modifications, as long as this notice is preserved.
13026 -
13027 -# serial 7 ltoptions.m4
13028 -
13029 -# This is to help aclocal find these macros, as it can't see m4_define.
13030 -AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
13031 -
13032 -
13033 -# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
13034 -# ------------------------------------------
13035 -m4_define([_LT_MANGLE_OPTION],
13036 -[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
13037 -
13038 -
13039 -# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
13040 -# ---------------------------------------
13041 -# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
13042 -# matching handler defined, dispatch to it. Other OPTION-NAMEs are
13043 -# saved as a flag.
13044 -m4_define([_LT_SET_OPTION],
13045 -[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
13046 -m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
13047 - _LT_MANGLE_DEFUN([$1], [$2]),
13048 - [m4_warning([Unknown $1 option `$2'])])[]dnl
13049 -])
13050 -
13051 -
13052 -# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
13053 -# ------------------------------------------------------------
13054 -# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
13055 -m4_define([_LT_IF_OPTION],
13056 -[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
13057 -
13058 -
13059 -# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
13060 -# -------------------------------------------------------
13061 -# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
13062 -# are set.
13063 -m4_define([_LT_UNLESS_OPTIONS],
13064 -[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
13065 - [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
13066 - [m4_define([$0_found])])])[]dnl
13067 -m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
13068 -])[]dnl
13069 -])
13070 -
13071 -
13072 -# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
13073 -# ----------------------------------------
13074 -# OPTION-LIST is a space-separated list of Libtool options associated
13075 -# with MACRO-NAME. If any OPTION has a matching handler declared with
13076 -# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
13077 -# the unknown option and exit.
13078 -m4_defun([_LT_SET_OPTIONS],
13079 -[# Set options
13080 -m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
13081 - [_LT_SET_OPTION([$1], _LT_Option)])
13082 -
13083 -m4_if([$1],[LT_INIT],[
13084 - dnl
13085 - dnl Simply set some default values (i.e off) if boolean options were not
13086 - dnl specified:
13087 - _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
13088 - ])
13089 - _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
13090 - ])
13091 - dnl
13092 - dnl If no reference was made to various pairs of opposing options, then
13093 - dnl we run the default mode handler for the pair. For example, if neither
13094 - dnl `shared' nor `disable-shared' was passed, we enable building of shared
13095 - dnl archives by default:
13096 - _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
13097 - _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
13098 - _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
13099 - _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
13100 - [_LT_ENABLE_FAST_INSTALL])
13101 - ])
13102 -])# _LT_SET_OPTIONS
13103 -
13104 -
13105 -## --------------------------------- ##
13106 -## Macros to handle LT_INIT options. ##
13107 -## --------------------------------- ##
13108 -
13109 -# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
13110 -# -----------------------------------------
13111 -m4_define([_LT_MANGLE_DEFUN],
13112 -[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
13113 -
13114 -
13115 -# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
13116 -# -----------------------------------------------
13117 -m4_define([LT_OPTION_DEFINE],
13118 -[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
13119 -])# LT_OPTION_DEFINE
13120 -
13121 -
13122 -# dlopen
13123 -# ------
13124 -LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
13125 -])
13126 -
13127 -AU_DEFUN([AC_LIBTOOL_DLOPEN],
13128 -[_LT_SET_OPTION([LT_INIT], [dlopen])
13129 -AC_DIAGNOSE([obsolete],
13130 -[$0: Remove this warning and the call to _LT_SET_OPTION when you
13131 -put the `dlopen' option into LT_INIT's first parameter.])
13132 -])
13133 -
13134 -dnl aclocal-1.4 backwards compatibility:
13135 -dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
13136 -
13137 -
13138 -# win32-dll
13139 -# ---------
13140 -# Declare package support for building win32 dll's.
13141 -LT_OPTION_DEFINE([LT_INIT], [win32-dll],
13142 -[enable_win32_dll=yes
13143 -
13144 -case $host in
13145 -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
13146 - AC_CHECK_TOOL(AS, as, false)
13147 - AC_CHECK_TOOL(DLLTOOL, dlltool, false)
13148 - AC_CHECK_TOOL(OBJDUMP, objdump, false)
13149 - ;;
13150 -esac
13151 -
13152 -test -z "$AS" && AS=as
13153 -_LT_DECL([], [AS], [1], [Assembler program])dnl
13154 -
13155 -test -z "$DLLTOOL" && DLLTOOL=dlltool
13156 -_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
13157 -
13158 -test -z "$OBJDUMP" && OBJDUMP=objdump
13159 -_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
13160 -])# win32-dll
13161 -
13162 -AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
13163 -[AC_REQUIRE([AC_CANONICAL_HOST])dnl
13164 -_LT_SET_OPTION([LT_INIT], [win32-dll])
13165 -AC_DIAGNOSE([obsolete],
13166 -[$0: Remove this warning and the call to _LT_SET_OPTION when you
13167 -put the `win32-dll' option into LT_INIT's first parameter.])
13168 -])
13169 -
13170 -dnl aclocal-1.4 backwards compatibility:
13171 -dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
13172 -
13173 -
13174 -# _LT_ENABLE_SHARED([DEFAULT])
13175 -# ----------------------------
13176 -# implement the --enable-shared flag, and supports the `shared' and
13177 -# `disable-shared' LT_INIT options.
13178 -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
13179 -m4_define([_LT_ENABLE_SHARED],
13180 -[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
13181 -AC_ARG_ENABLE([shared],
13182 - [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
13183 - [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
13184 - [p=${PACKAGE-default}
13185 - case $enableval in
13186 - yes) enable_shared=yes ;;
13187 - no) enable_shared=no ;;
13188 - *)
13189 - enable_shared=no
13190 - # Look at the argument we got. We use all the common list separators.
13191 - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
13192 - for pkg in $enableval; do
13193 - IFS="$lt_save_ifs"
13194 - if test "X$pkg" = "X$p"; then
13195 - enable_shared=yes
13196 - fi
13197 - done
13198 - IFS="$lt_save_ifs"
13199 - ;;
13200 - esac],
13201 - [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
13202 -
13203 - _LT_DECL([build_libtool_libs], [enable_shared], [0],
13204 - [Whether or not to build shared libraries])
13205 -])# _LT_ENABLE_SHARED
13206 -
13207 -LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
13208 -LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
13209 -
13210 -# Old names:
13211 -AC_DEFUN([AC_ENABLE_SHARED],
13212 -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
13213 -])
13214 -
13215 -AC_DEFUN([AC_DISABLE_SHARED],
13216 -[_LT_SET_OPTION([LT_INIT], [disable-shared])
13217 -])
13218 -
13219 -AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
13220 -AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
13221 -
13222 -dnl aclocal-1.4 backwards compatibility:
13223 -dnl AC_DEFUN([AM_ENABLE_SHARED], [])
13224 -dnl AC_DEFUN([AM_DISABLE_SHARED], [])
13225 -
13226 -
13227 -
13228 -# _LT_ENABLE_STATIC([DEFAULT])
13229 -# ----------------------------
13230 -# implement the --enable-static flag, and support the `static' and
13231 -# `disable-static' LT_INIT options.
13232 -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
13233 -m4_define([_LT_ENABLE_STATIC],
13234 -[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
13235 -AC_ARG_ENABLE([static],
13236 - [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
13237 - [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
13238 - [p=${PACKAGE-default}
13239 - case $enableval in
13240 - yes) enable_static=yes ;;
13241 - no) enable_static=no ;;
13242 - *)
13243 - enable_static=no
13244 - # Look at the argument we got. We use all the common list separators.
13245 - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
13246 - for pkg in $enableval; do
13247 - IFS="$lt_save_ifs"
13248 - if test "X$pkg" = "X$p"; then
13249 - enable_static=yes
13250 - fi
13251 - done
13252 - IFS="$lt_save_ifs"
13253 - ;;
13254 - esac],
13255 - [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
13256 -
13257 - _LT_DECL([build_old_libs], [enable_static], [0],
13258 - [Whether or not to build static libraries])
13259 -])# _LT_ENABLE_STATIC
13260 -
13261 -LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
13262 -LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
13263 -
13264 -# Old names:
13265 -AC_DEFUN([AC_ENABLE_STATIC],
13266 -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
13267 -])
13268 -
13269 -AC_DEFUN([AC_DISABLE_STATIC],
13270 -[_LT_SET_OPTION([LT_INIT], [disable-static])
13271 -])
13272 -
13273 -AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
13274 -AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
13275 -
13276 -dnl aclocal-1.4 backwards compatibility:
13277 -dnl AC_DEFUN([AM_ENABLE_STATIC], [])
13278 -dnl AC_DEFUN([AM_DISABLE_STATIC], [])
13279 -
13280 -
13281 -
13282 -# _LT_ENABLE_FAST_INSTALL([DEFAULT])
13283 -# ----------------------------------
13284 -# implement the --enable-fast-install flag, and support the `fast-install'
13285 -# and `disable-fast-install' LT_INIT options.
13286 -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
13287 -m4_define([_LT_ENABLE_FAST_INSTALL],
13288 -[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
13289 -AC_ARG_ENABLE([fast-install],
13290 - [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
13291 - [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
13292 - [p=${PACKAGE-default}
13293 - case $enableval in
13294 - yes) enable_fast_install=yes ;;
13295 - no) enable_fast_install=no ;;
13296 - *)
13297 - enable_fast_install=no
13298 - # Look at the argument we got. We use all the common list separators.
13299 - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
13300 - for pkg in $enableval; do
13301 - IFS="$lt_save_ifs"
13302 - if test "X$pkg" = "X$p"; then
13303 - enable_fast_install=yes
13304 - fi
13305 - done
13306 - IFS="$lt_save_ifs"
13307 - ;;
13308 - esac],
13309 - [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
13310 -
13311 -_LT_DECL([fast_install], [enable_fast_install], [0],
13312 - [Whether or not to optimize for fast installation])dnl
13313 -])# _LT_ENABLE_FAST_INSTALL
13314 -
13315 -LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
13316 -LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
13317 -
13318 -# Old names:
13319 -AU_DEFUN([AC_ENABLE_FAST_INSTALL],
13320 -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
13321 -AC_DIAGNOSE([obsolete],
13322 -[$0: Remove this warning and the call to _LT_SET_OPTION when you put
13323 -the `fast-install' option into LT_INIT's first parameter.])
13324 -])
13325 -
13326 -AU_DEFUN([AC_DISABLE_FAST_INSTALL],
13327 -[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
13328 -AC_DIAGNOSE([obsolete],
13329 -[$0: Remove this warning and the call to _LT_SET_OPTION when you put
13330 -the `disable-fast-install' option into LT_INIT's first parameter.])
13331 -])
13332 -
13333 -dnl aclocal-1.4 backwards compatibility:
13334 -dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
13335 -dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
13336 -
13337 -
13338 -# _LT_WITH_PIC([MODE])
13339 -# --------------------
13340 -# implement the --with-pic flag, and support the `pic-only' and `no-pic'
13341 -# LT_INIT options.
13342 -# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
13343 -m4_define([_LT_WITH_PIC],
13344 -[AC_ARG_WITH([pic],
13345 - [AS_HELP_STRING([--with-pic],
13346 - [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
13347 - [pic_mode="$withval"],
13348 - [pic_mode=default])
13349 -
13350 -test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
13351 -
13352 -_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
13353 -])# _LT_WITH_PIC
13354 -
13355 -LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
13356 -LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
13357 -
13358 -# Old name:
13359 -AU_DEFUN([AC_LIBTOOL_PICMODE],
13360 -[_LT_SET_OPTION([LT_INIT], [pic-only])
13361 -AC_DIAGNOSE([obsolete],
13362 -[$0: Remove this warning and the call to _LT_SET_OPTION when you
13363 -put the `pic-only' option into LT_INIT's first parameter.])
13364 -])
13365 -
13366 -dnl aclocal-1.4 backwards compatibility:
13367 -dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
13368 -
13369 -## ----------------- ##
13370 -## LTDL_INIT Options ##
13371 -## ----------------- ##
13372 -
13373 -m4_define([_LTDL_MODE], [])
13374 -LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
13375 - [m4_define([_LTDL_MODE], [nonrecursive])])
13376 -LT_OPTION_DEFINE([LTDL_INIT], [recursive],
13377 - [m4_define([_LTDL_MODE], [recursive])])
13378 -LT_OPTION_DEFINE([LTDL_INIT], [subproject],
13379 - [m4_define([_LTDL_MODE], [subproject])])
13380 -
13381 -m4_define([_LTDL_TYPE], [])
13382 -LT_OPTION_DEFINE([LTDL_INIT], [installable],
13383 - [m4_define([_LTDL_TYPE], [installable])])
13384 -LT_OPTION_DEFINE([LTDL_INIT], [convenience],
13385 - [m4_define([_LTDL_TYPE], [convenience])])
13386
13387 diff --git a/libbash-0.1/m4/ltsugar.m4 b/libbash-0.1/m4/ltsugar.m4
13388 deleted file mode 100644
13389 index 9000a05..0000000
13390 --- a/libbash-0.1/m4/ltsugar.m4
13391 +++ /dev/null
13392 @@ -1,123 +0,0 @@
13393 -# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
13394 -#
13395 -# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
13396 -# Written by Gary V. Vaughan, 2004
13397 -#
13398 -# This file is free software; the Free Software Foundation gives
13399 -# unlimited permission to copy and/or distribute it, with or without
13400 -# modifications, as long as this notice is preserved.
13401 -
13402 -# serial 6 ltsugar.m4
13403 -
13404 -# This is to help aclocal find these macros, as it can't see m4_define.
13405 -AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
13406 -
13407 -
13408 -# lt_join(SEP, ARG1, [ARG2...])
13409 -# -----------------------------
13410 -# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
13411 -# associated separator.
13412 -# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
13413 -# versions in m4sugar had bugs.
13414 -m4_define([lt_join],
13415 -[m4_if([$#], [1], [],
13416 - [$#], [2], [[$2]],
13417 - [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
13418 -m4_define([_lt_join],
13419 -[m4_if([$#$2], [2], [],
13420 - [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
13421 -
13422 -
13423 -# lt_car(LIST)
13424 -# lt_cdr(LIST)
13425 -# ------------
13426 -# Manipulate m4 lists.
13427 -# These macros are necessary as long as will still need to support
13428 -# Autoconf-2.59 which quotes differently.
13429 -m4_define([lt_car], [[$1]])
13430 -m4_define([lt_cdr],
13431 -[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
13432 - [$#], 1, [],
13433 - [m4_dquote(m4_shift($@))])])
13434 -m4_define([lt_unquote], $1)
13435 -
13436 -
13437 -# lt_append(MACRO-NAME, STRING, [SEPARATOR])
13438 -# ------------------------------------------
13439 -# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
13440 -# Note that neither SEPARATOR nor STRING are expanded; they are appended
13441 -# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
13442 -# No SEPARATOR is output if MACRO-NAME was previously undefined (different
13443 -# than defined and empty).
13444 -#
13445 -# This macro is needed until we can rely on Autoconf 2.62, since earlier
13446 -# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
13447 -m4_define([lt_append],
13448 -[m4_define([$1],
13449 - m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
13450 -
13451 -
13452 -
13453 -# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
13454 -# ----------------------------------------------------------
13455 -# Produce a SEP delimited list of all paired combinations of elements of
13456 -# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
13457 -# has the form PREFIXmINFIXSUFFIXn.
13458 -# Needed until we can rely on m4_combine added in Autoconf 2.62.
13459 -m4_define([lt_combine],
13460 -[m4_if(m4_eval([$# > 3]), [1],
13461 - [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
13462 -[[m4_foreach([_Lt_prefix], [$2],
13463 - [m4_foreach([_Lt_suffix],
13464 - ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
13465 - [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
13466 -
13467 -
13468 -# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
13469 -# -----------------------------------------------------------------------
13470 -# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
13471 -# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
13472 -m4_define([lt_if_append_uniq],
13473 -[m4_ifdef([$1],
13474 - [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
13475 - [lt_append([$1], [$2], [$3])$4],
13476 - [$5])],
13477 - [lt_append([$1], [$2], [$3])$4])])
13478 -
13479 -
13480 -# lt_dict_add(DICT, KEY, VALUE)
13481 -# -----------------------------
13482 -m4_define([lt_dict_add],
13483 -[m4_define([$1($2)], [$3])])
13484 -
13485 -
13486 -# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
13487 -# --------------------------------------------
13488 -m4_define([lt_dict_add_subkey],
13489 -[m4_define([$1($2:$3)], [$4])])
13490 -
13491 -
13492 -# lt_dict_fetch(DICT, KEY, [SUBKEY])
13493 -# ----------------------------------
13494 -m4_define([lt_dict_fetch],
13495 -[m4_ifval([$3],
13496 - m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
13497 - m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
13498 -
13499 -
13500 -# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
13501 -# -----------------------------------------------------------------
13502 -m4_define([lt_if_dict_fetch],
13503 -[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
13504 - [$5],
13505 - [$6])])
13506 -
13507 -
13508 -# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
13509 -# --------------------------------------------------------------
13510 -m4_define([lt_dict_filter],
13511 -[m4_if([$5], [], [],
13512 - [lt_join(m4_quote(m4_default([$4], [[, ]])),
13513 - lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
13514 - [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
13515 -])
13516
13517 diff --git a/libbash-0.1/m4/ltversion.m4 b/libbash-0.1/m4/ltversion.m4
13518 deleted file mode 100644
13519 index 93fc771..0000000
13520 --- a/libbash-0.1/m4/ltversion.m4
13521 +++ /dev/null
13522 @@ -1,23 +0,0 @@
13523 -# ltversion.m4 -- version numbers -*- Autoconf -*-
13524 -#
13525 -# Copyright (C) 2004 Free Software Foundation, Inc.
13526 -# Written by Scott James Remnant, 2004
13527 -#
13528 -# This file is free software; the Free Software Foundation gives
13529 -# unlimited permission to copy and/or distribute it, with or without
13530 -# modifications, as long as this notice is preserved.
13531 -
13532 -# Generated from ltversion.in.
13533 -
13534 -# serial 3175 ltversion.m4
13535 -# This file is part of GNU Libtool
13536 -
13537 -m4_define([LT_PACKAGE_VERSION], [2.2.10])
13538 -m4_define([LT_PACKAGE_REVISION], [1.3175])
13539 -
13540 -AC_DEFUN([LTVERSION_VERSION],
13541 -[macro_version='2.2.10'
13542 -macro_revision='1.3175'
13543 -_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
13544 -_LT_DECL(, macro_revision, 0)
13545 -])
13546
13547 diff --git a/libbash-0.1/m4/lt~obsolete.m4 b/libbash-0.1/m4/lt~obsolete.m4
13548 deleted file mode 100644
13549 index c573da9..0000000
13550 --- a/libbash-0.1/m4/lt~obsolete.m4
13551 +++ /dev/null
13552 @@ -1,98 +0,0 @@
13553 -# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
13554 -#
13555 -# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
13556 -# Written by Scott James Remnant, 2004.
13557 -#
13558 -# This file is free software; the Free Software Foundation gives
13559 -# unlimited permission to copy and/or distribute it, with or without
13560 -# modifications, as long as this notice is preserved.
13561 -
13562 -# serial 5 lt~obsolete.m4
13563 -
13564 -# These exist entirely to fool aclocal when bootstrapping libtool.
13565 -#
13566 -# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
13567 -# which have later been changed to m4_define as they aren't part of the
13568 -# exported API, or moved to Autoconf or Automake where they belong.
13569 -#
13570 -# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
13571 -# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
13572 -# using a macro with the same name in our local m4/libtool.m4 it'll
13573 -# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
13574 -# and doesn't know about Autoconf macros at all.)
13575 -#
13576 -# So we provide this file, which has a silly filename so it's always
13577 -# included after everything else. This provides aclocal with the
13578 -# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
13579 -# because those macros already exist, or will be overwritten later.
13580 -# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
13581 -#
13582 -# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
13583 -# Yes, that means every name once taken will need to remain here until
13584 -# we give up compatibility with versions before 1.7, at which point
13585 -# we need to keep only those names which we still refer to.
13586 -
13587 -# This is to help aclocal find these macros, as it can't see m4_define.
13588 -AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
13589 -
13590 -m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
13591 -m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
13592 -m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
13593 -m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
13594 -m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
13595 -m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
13596 -m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
13597 -m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
13598 -m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
13599 -m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
13600 -m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
13601 -m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
13602 -m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
13603 -m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
13604 -m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
13605 -m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
13606 -m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
13607 -m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
13608 -m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
13609 -m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
13610 -m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
13611 -m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
13612 -m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
13613 -m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
13614 -m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
13615 -m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
13616 -m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
13617 -m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
13618 -m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
13619 -m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
13620 -m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
13621 -m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
13622 -m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
13623 -m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
13624 -m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
13625 -m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
13626 -m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
13627 -m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
13628 -m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
13629 -m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
13630 -m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
13631 -m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
13632 -m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
13633 -m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
13634 -m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
13635 -m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
13636 -m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
13637 -m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
13638 -m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
13639 -m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
13640 -m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
13641 -m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
13642 -m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
13643 -m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
13644 -m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
13645 -m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
13646 -m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
13647 -m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
13648 -m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
13649 -m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
13650 -m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
13651
13652 diff --git a/libbash-0.1/scripts/arithmetic_assignment.bash b/libbash-0.1/scripts/arithmetic_assignment.bash
13653 deleted file mode 100644
13654 index d8b1fe4..0000000
13655 --- a/libbash-0.1/scripts/arithmetic_assignment.bash
13656 +++ /dev/null
13657 @@ -1,24 +0,0 @@
13658 -value="$((100))"
13659 -FOO001="$((value*=10))"
13660 -FOO002="$((value/=10))"
13661 -FOO003="$((value%=9))"
13662 -FOO004="$((value+=10))"
13663 -FOO005="$((value-=10))"
13664 -FOO006="$((value<<=2))"
13665 -FOO007="$((value>>=2))"
13666 -FOO008="$((value&=10))"
13667 -FOO009="$((value^=5))"
13668 -FOO010="$((value|=10))"
13669 -FOO011=("CREATED" 2)
13670 -FOO012="$((${FOO011[0]}=10))"
13671 -FOO013="$((3!=5))"
13672 -value=100
13673 -let "value=${value}"
13674 -a=c
13675 -b=d
13676 -c=1
13677 -d=2
13678 -e="1+2"
13679 -echo $(($a + $b))
13680 -echo $(($a + $e))
13681 -
13682
13683 diff --git a/libbash-0.1/scripts/arithmetic_assignment.bash.result b/libbash-0.1/scripts/arithmetic_assignment.bash.result
13684 deleted file mode 100644
13685 index dd8a219..0000000
13686 --- a/libbash-0.1/scripts/arithmetic_assignment.bash.result
13687 +++ /dev/null
13688 @@ -1,22 +0,0 @@
13689 -3
13690 -4
13691 -CREATED=10
13692 -FOO001=1000
13693 -FOO002=100
13694 -FOO003=1
13695 -FOO004=11
13696 -FOO005=1
13697 -FOO006=4
13698 -FOO007=1
13699 -FOO008=0
13700 -FOO009=5
13701 -FOO010=15
13702 -FOO011=CREATED 2
13703 -FOO012=10
13704 -FOO013=1
13705 -a=c
13706 -b=d
13707 -c=1
13708 -d=2
13709 -e=1+2
13710 -value=100
13711
13712 diff --git a/libbash-0.1/scripts/bar.eclass b/libbash-0.1/scripts/bar.eclass
13713 deleted file mode 100644
13714 index 1e46230..0000000
13715 --- a/libbash-0.1/scripts/bar.eclass
13716 +++ /dev/null
13717 @@ -1,5 +0,0 @@
13718 -IUSE="abc def"
13719 -REQUIRED_USE="abc"
13720 -DEPEND="dev-util/pkgconfig"
13721 -RDEPEND="foo/bar"
13722 -PDEPEND="foo/bar"
13723
13724 diff --git a/libbash-0.1/scripts/binary_arithmetic.bash b/libbash-0.1/scripts/binary_arithmetic.bash
13725 deleted file mode 100644
13726 index 577ddbc..0000000
13727 --- a/libbash-0.1/scripts/binary_arithmetic.bash
13728 +++ /dev/null
13729 @@ -1,67 +0,0 @@
13730 -ARRAY=(1 2 3 4 5)
13731 -FOO001="$((0 || -2))"
13732 -FOO002="$((0 || 0))"
13733 -FOO003="$((-1 && 10))"
13734 -FOO004="$((-1 && 0))"
13735 -FOO005="$((1 | 2))"
13736 -FOO006="$((4 & 2))"
13737 -FOO007="$((5 ^ 10))"
13738 -FOO008="$((5 <= 5))"
13739 -FOO009="$((5 <= -10))"
13740 -FOO010="$((5 >= 5))"
13741 -FOO011="$((-5 >= 5))"
13742 -FOO012="$((5 < 6))"
13743 -FOO013="$((-5 < -5))"
13744 -FOO014="$((5 > 4))"
13745 -FOO015="$((-5 > -5))"
13746 -FOO016="$((-5 << 2))"
13747 -FOO017="$((-5 >> 2))"
13748 -FOO018="$((1 + 1))"
13749 -FOO019="$((10 - 5))"
13750 -FOO020="$((10 * 5))"
13751 -FOO021="$((10 / 4))"
13752 -FOO022="$((10 % 4))"
13753 -FOO023="$((10 ** 4))"
13754 -FOO024="$((!10))"
13755 -FOO025="$((~ 10))"
13756 -FOO026="$((1?10:5))"
13757 -FOO027="$((0?10:5))"
13758 -value="$((100))"
13759 -FOO028="$((++value))"
13760 -FOO029="$((--value))"
13761 -FOO030="$((value++))"
13762 -FOO031="$((value--))"
13763 -value="$((100))"
13764 -FOO032="$((value+++value++))"
13765 -FOO033="$((++value+value++))"
13766 -FOO034="$((10*(2+5)<<3%2**5))"
13767 -FOO035="$((10*value<<3%2**5))"
13768 -FOO036="$(( (20&5|3||1*100-20&5*10)+~(2*5) ))"
13769 -FOO037="$((ARRAY[0]++))"
13770 -FOO038="$((++ARRAY[0]))"
13771 -FOO039="$((ARRAY[0]--))"
13772 -FOO040="$((--ARRAY[0]))"
13773 -FOO041="$((ARRAY[8]=9))"
13774 -FOO042="$((ARRAY[8]*=10))"
13775 -FOO043="$((ARRAY[8]/=10))"
13776 -FOO044="$((ARRAY[8]%=2))"
13777 -FOO045="$((ARRAY[8]+=8))"
13778 -FOO046="$((ARRAY[8]-=0))"
13779 -FOO047="$((ARRAY[8]<<=1))"
13780 -FOO048="$((ARRAY[8]>>=1))"
13781 -FOO049="$((ARRAY[8]&=5))"
13782 -FOO050="$((ARRAY[8]|=10))"
13783 -FOO051="$((ARRAY[8]^=3))"
13784 -PARTIAL[8]=5
13785 -FOO052="$((PARTIAL[8]*=1))"
13786 -FOO053="$((${#ARRAY[@]}))"
13787 -FOO054="$((${ARRAY[5]:-10}))"
13788 -FOO055="$((${ARRAY:0}))"
13789 -value=100
13790 -FOO056="value"
13791 -FOO057="$((${FOO056}++))"
13792 -FOO058="$((${FOO056}+=10))"
13793 -ARRAY=(1 2 3 4 5)
13794 -FOO059="$((100**0))"
13795 -FOO060="$((FOO059||FOO059++))"
13796 -FOO061="$((0&&FOO059++))"
13797
13798 diff --git a/libbash-0.1/scripts/binary_arithmetic.bash.result b/libbash-0.1/scripts/binary_arithmetic.bash.result
13799 deleted file mode 100644
13800 index 926b23a..0000000
13801 --- a/libbash-0.1/scripts/binary_arithmetic.bash.result
13802 +++ /dev/null
13803 @@ -1,64 +0,0 @@
13804 -ARRAY=1 2 3 4 5
13805 -FOO001=1
13806 -FOO002=0
13807 -FOO003=1
13808 -FOO004=0
13809 -FOO005=3
13810 -FOO006=0
13811 -FOO007=15
13812 -FOO008=1
13813 -FOO009=0
13814 -FOO010=1
13815 -FOO011=0
13816 -FOO012=1
13817 -FOO013=0
13818 -FOO014=1
13819 -FOO015=0
13820 -FOO016=-20
13821 -FOO017=-2
13822 -FOO018=2
13823 -FOO019=5
13824 -FOO020=50
13825 -FOO021=2
13826 -FOO022=2
13827 -FOO023=10000
13828 -FOO024=0
13829 -FOO025=-11
13830 -FOO026=10
13831 -FOO027=5
13832 -FOO028=101
13833 -FOO029=100
13834 -FOO030=100
13835 -FOO031=101
13836 -FOO032=201
13837 -FOO033=206
13838 -FOO034=560
13839 -FOO035=8320
13840 -FOO036=-10
13841 -FOO037=1
13842 -FOO038=3
13843 -FOO039=3
13844 -FOO040=1
13845 -FOO041=9
13846 -FOO042=90
13847 -FOO043=9
13848 -FOO044=1
13849 -FOO045=9
13850 -FOO046=9
13851 -FOO047=18
13852 -FOO048=9
13853 -FOO049=1
13854 -FOO050=11
13855 -FOO051=8
13856 -FOO052=5
13857 -FOO053=6
13858 -FOO054=10
13859 -FOO055=1
13860 -FOO056=value
13861 -FOO057=100
13862 -FOO058=111
13863 -FOO059=1
13864 -FOO060=1
13865 -FOO061=0
13866 -PARTIAL=5
13867 -value=111
13868
13869 diff --git a/libbash-0.1/scripts/command_execution.bash b/libbash-0.1/scripts/command_execution.bash
13870 deleted file mode 100644
13871 index 76e9c4c..0000000
13872 --- a/libbash-0.1/scripts/command_execution.bash
13873 +++ /dev/null
13874 @@ -1,59 +0,0 @@
13875 -function hi()
13876 -{
13877 - echo "Hello World"
13878 -}
13879 -hi
13880 -echo hello world
13881 -true
13882 -false
13883 -FOO001=$(echo hello)
13884 -FOO002=$(hi)
13885 -true &&
13886 - echo "right"
13887 -false && echo "wrong"
13888 -! true && echo "wrong"
13889 -false || echo "right"
13890 -true ||
13891 - echo "wrong"
13892 -echo "end"
13893 -: ${DEFAULTED:="yes"}
13894 -FOO="abc" echo "command environment"
13895 -export FOO003=1 FOO004=abc FOO005=(1 2 3) FOO002
13896 -export foo
13897 -abc=1 export foo
13898 -echo "hi" > /dev/null
13899 -
13900 -function unset_inner()
13901 -{
13902 - local FOO006=3
13903 - unset FOO006 FOO007
13904 -}
13905 -function unset_outer()
13906 -{
13907 - local FOO006=1 FOO007=2
13908 - unset_inner
13909 - echo "FOO006=$FOO006 in unset_outer"
13910 - echo "FOO007=$FOO007 in unset_outer"
13911 - unset FOO006
13912 - echo "FOO006=$FOO006 in unset_outer"
13913 -}
13914 -unset_outer
13915 -echo "FOO006=$FOO006 in global"
13916 -FOO006=0
13917 -echo "FOO006=$FOO006 in global"
13918 -unset FOO006
13919 -echo "FOO006=$FOO006 in global"
13920 -declare -F unset_outer
13921 -unset -f unset_outer
13922 -declare -F unset_outer
13923 -echo '$FOO006 "abc" $(( 1 + 2 )) $(echo hi) ...'
13924 -echo "abc $(echo def) ghi"
13925 -FOO008="abc $(echo def) ghi"
13926 -eval "FOO009=10"
13927 -eval "echo abc" "def" "xyz"
13928 -shopt -s extglob
13929 -shopt -p
13930 -printf "%s %s\n" abc def
13931 -printf "%s %s\n" $FOO001, def
13932 -((FOO010=1))
13933 -echo "abc #av### ##" # for comment
13934
13935 diff --git a/libbash-0.1/scripts/command_execution.bash.result b/libbash-0.1/scripts/command_execution.bash.result
13936 deleted file mode 100644
13937 index 5f9bede..0000000
13938 --- a/libbash-0.1/scripts/command_execution.bash.result
13939 +++ /dev/null
13940 @@ -1,67 +0,0 @@
13941 -Hello World
13942 -hello world
13943 -right
13944 -right
13945 -end
13946 -command environment
13947 -We do not support command env before the export builtin.
13948 -FOO006=1 in unset_outer
13949 -FOO007= in unset_outer
13950 -FOO006= in unset_outer
13951 -FOO006= in global
13952 -FOO006=0 in global
13953 -FOO006= in global
13954 -unset_outer
13955 -$FOO006 "abc" $(( 1 + 2 )) $(echo hi) ...
13956 -abc def ghi
13957 -abc def xyz
13958 -shopt -u autocd
13959 -shopt -u cdable_vars
13960 -shopt -u cdspell
13961 -shopt -u checkhash
13962 -shopt -u checkjobs
13963 -shopt -u checkwinsize
13964 -shopt -u cmdhist
13965 -shopt -u compat31
13966 -shopt -u dirspell
13967 -shopt -u dotglob
13968 -shopt -u execfail
13969 -shopt -u expand_aliases
13970 -shopt -u extdebug
13971 -shopt -s extglob
13972 -shopt -u extquote
13973 -shopt -u failglob
13974 -shopt -u force_fignore
13975 -shopt -u globstar
13976 -shopt -u gnu_errfmt
13977 -shopt -u histappend
13978 -shopt -u histreedit
13979 -shopt -u histverify
13980 -shopt -u hostcomplete
13981 -shopt -u huponexit
13982 -shopt -u interactive
13983 -shopt -u lithist
13984 -shopt -u login_shell
13985 -shopt -u mailwarn
13986 -shopt -u no_empty_cmd_completion
13987 -shopt -u nocaseglob
13988 -shopt -u nocasematch
13989 -shopt -u nullglob
13990 -shopt -u progcomp
13991 -shopt -u promptvars
13992 -shopt -u restricted
13993 -shopt -u shift_verbose
13994 -shopt -u sourcepath
13995 -shopt -u xpg_echo
13996 -abc def
13997 -hello, def
13998 -abc #av### ##
13999 -DEFAULTED=yes
14000 -FOO001=hello
14001 -FOO002=Hello World
14002 -FOO003=1
14003 -FOO004=abc
14004 -FOO005=1 2 3
14005 -FOO008=abc def ghi
14006 -FOO009=10
14007 -FOO010=1
14008
14009 diff --git a/libbash-0.1/scripts/compound_command.bash b/libbash-0.1/scripts/compound_command.bash
14010 deleted file mode 100644
14011 index ece5504..0000000
14012 --- a/libbash-0.1/scripts/compound_command.bash
14013 +++ /dev/null
14014 @@ -1,353 +0,0 @@
14015 -for file in " foo bar "
14016 -do
14017 - echo $file
14018 -done
14019 -
14020 -for foo in abc def ghi
14021 -do
14022 - echo $foo
14023 -done
14024 -
14025 -bar=
14026 -# We behave differently from bash with "for foo in ''"
14027 -for foo in $bar
14028 -do
14029 - echo "Shouldn't print this"
14030 -done
14031 -
14032 -for (( i=1; i<4; ++i ))
14033 -do
14034 - echo $i
14035 -done
14036 -
14037 -for ((;i<10;))
14038 -do
14039 - echo $((++i))
14040 -done
14041 -
14042 -for ((;i<0;))
14043 -do
14044 - echo "Shouldn't print this"
14045 -done
14046 -
14047 -for file in foo bar
14048 -do
14049 - if [[ $file == "foo" ]]; then
14050 - continue
14051 - fi
14052 - echo $file
14053 -done
14054 -
14055 -for file in foo bar
14056 -do
14057 - if [[ $file == "bar" ]]; then
14058 - continue
14059 - fi
14060 - echo $file
14061 -done
14062 -
14063 -for file in foo bar
14064 -do
14065 - if [[ $file == "foo" ]]; then
14066 - break
14067 - fi
14068 - echo $file
14069 -done
14070 -
14071 -for file in foo bar
14072 -do
14073 - if [[ $file == "bar" ]]; then
14074 - break
14075 - fi
14076 - echo $file
14077 -done
14078 -
14079 -for outer in 1 2 3
14080 -do
14081 - for file in foo bar
14082 - do
14083 - if [[ $file == "foo" && $outer == 1 ]]; then
14084 - continue 2
14085 - fi
14086 - echo "$outer $file"
14087 - done
14088 -done
14089 -
14090 -for outer in 1 2 3
14091 -do
14092 - for file in foo bar
14093 - do
14094 - if [[ $file == "foo" && $outer == 1 ]]; then
14095 - break 2
14096 - fi
14097 - echo "$outer $file"
14098 - done
14099 -done
14100 -
14101 -i=0;
14102 -while [ $i != 4 ]
14103 -do
14104 - i=$(( i + 1 ))
14105 - echo $i
14106 -done
14107 -
14108 -while [ $i \< 0 ]
14109 -do
14110 - echo "Shouldn't print this"
14111 -done
14112 -
14113 -i=0
14114 -while [ $i != 4 ]
14115 -do
14116 - i=$(( i + 1 ))
14117 - if [[ $i == 1 ]]; then
14118 - continue
14119 - fi
14120 - echo $i
14121 -done
14122 -
14123 -i=0
14124 -while [ $i != 4 ]
14125 -do
14126 - i=$(( i + 1 ))
14127 - if [[ $i == 1 ]]; then
14128 - break
14129 - fi
14130 - echo $i
14131 -done
14132 -
14133 -i=0
14134 -j=1
14135 -while [ $i != 4 ]
14136 -do
14137 - i=$(( i + 1 ))
14138 -
14139 - while [ $j == 1 ]
14140 - do
14141 - if [[ $i == 1 ]]; then
14142 - continue 2
14143 - fi
14144 - echo $i
14145 - let ++j
14146 - done
14147 -done
14148 -
14149 -i=0
14150 -j=1
14151 -while [ $i != 4 ]
14152 -do
14153 - i=$(( i + 1 ))
14154 -
14155 - while [ $j == 1 ]
14156 - do
14157 - if [[ $i == 1 ]]; then
14158 - break 2
14159 - fi
14160 - echo $i
14161 - let ++j
14162 - done
14163 -done
14164 -
14165 -i=0;
14166 -until [ $i == 4 ]
14167 -do
14168 - i=$(( i + 1 ))
14169 - echo $i
14170 -done
14171 -
14172 -until [ $i \> 0 ]
14173 -do
14174 - echo "Shouldn't print this"
14175 -done
14176 -
14177 -i=0
14178 -until [ $i == 4 ]
14179 -do
14180 - i=$(( i + 1 ))
14181 - if [[ $i == 1 ]]; then
14182 - continue
14183 - fi
14184 - echo $i
14185 -done
14186 -
14187 -i=0
14188 -until [ $i == 4 ]
14189 -do
14190 - i=$(( i + 1 ))
14191 - if [[ $i == 1 ]]; then
14192 - break
14193 - fi
14194 - echo $i
14195 -done
14196 -
14197 -i=0
14198 -j=1
14199 -until [ $i == 4 ]
14200 -do
14201 - i=$(( i + 1 ))
14202 -
14203 - while [ $j == 1 ]
14204 - do
14205 - if [[ $i == 1 ]]; then
14206 - continue 2
14207 - fi
14208 - echo $i
14209 - let ++j
14210 - done
14211 -done
14212 -
14213 -i=0
14214 -j=1
14215 -until [ $i == 4 ]
14216 -do
14217 - i=$(( i + 1 ))
14218 -
14219 - while [ $j == 1 ]
14220 - do
14221 - if [[ $i == 1 ]]; then
14222 - break 2
14223 - fi
14224 - echo $i
14225 - let ++j
14226 - done
14227 -done
14228 -
14229 -a=1
14230 -b=2
14231 -if [ $a == $b ]
14232 -then
14233 - echo "Shouldn't print this"
14234 -fi
14235 -if [ $a != $b ]
14236 -then
14237 - echo $a
14238 -fi
14239 -
14240 -if [ $a == $b ]
14241 -then
14242 - echo "Shouldn't print this"
14243 -elif [ $a != $b ]
14244 -then
14245 - echo $b
14246 -fi
14247 -
14248 -if [ $a == $b ]
14249 -then
14250 - echo "Shouldn't print this"
14251 -else
14252 - echo $a
14253 -fi
14254 -
14255 -if [ $a == $b ]
14256 -then
14257 - echo "Shouldn't print this"
14258 -elif [ $a == $b ]
14259 -then
14260 - echo "Shouldn't print this"
14261 -else
14262 - echo $a
14263 -fi
14264 -
14265 -target=123
14266 -case $target in
14267 - 1.3)
14268 - echo "Shouldn't print this"
14269 - ;;
14270 - \d+)
14271 - echo "Shouldn't print this"
14272 - ;;
14273 - 456|1?*|789)
14274 - echo yep
14275 - ;;
14276 - 123)
14277 - echo "Shouldn't print this"
14278 - ;;
14279 -esac
14280 -target=xyz
14281 -case $target in
14282 - bcd)
14283 - echo "Shouldn't print this"
14284 - ;;
14285 - abc)
14286 - echo "Shouldn't print this"
14287 - ;;
14288 - *)
14289 - echo "default"
14290 - ;;
14291 -esac
14292 -case $target in
14293 - abc|bcd|xyz)
14294 - ;;
14295 - *)
14296 - echo "Shouldn't print this"
14297 - ;;
14298 -esac
14299 -target=a
14300 -case $target in
14301 - [def])
14302 - echo "Shouldn't print this"
14303 - ;;
14304 - [abc])
14305 - echo yep
14306 - ;;
14307 -esac
14308 -case $target in
14309 - [def])
14310 - echo "Shouldn't print this"
14311 - ;;
14312 - [a])
14313 - echo yep
14314 - ;;
14315 -esac
14316 -case $target in
14317 - [!abc])
14318 - echo "Shouldn't print this"
14319 - ;;
14320 - [!def])
14321 - echo yep
14322 - ;;
14323 -esac
14324 -case $target in
14325 - [d-z])
14326 - echo "Shouldn't print this"
14327 - ;;
14328 - [a-c])
14329 - echo yep
14330 - ;;
14331 -esac
14332 -case $target in
14333 - [!a-c])
14334 - echo "Shouldn't print this"
14335 - ;;
14336 - [!d-z])
14337 - echo yep
14338 - ;;
14339 -esac
14340 -target=bar
14341 -case $target in
14342 - a[a-cx-z]r)
14343 - echo "Shouldn't print this"
14344 - ;;
14345 - b[!d-fx-z]r)
14346 - echo yep
14347 - ;;
14348 -esac
14349 -target="a"
14350 -case $target in
14351 - [[:alnum:][:alpha:][:ascii:][:blank:][:cntrl:][:digit:][:graph:][:lower:][:print:][:punct:][:space:][:upper:][:word:][:xdigit:]])
14352 - echo yep
14353 - ;;
14354 -esac
14355 -target="a"
14356 -case $target in
14357 - [[:ascii:]])
14358 - echo yep
14359 - ;;
14360 -esac
14361 -target="_"
14362 -case $target in
14363 - [[:word:]])
14364 - echo yep
14365 - ;;
14366 -esac
14367 -echo "case end"
14368
14369 diff --git a/libbash-0.1/scripts/compound_command.bash.result b/libbash-0.1/scripts/compound_command.bash.result
14370 deleted file mode 100644
14371 index c083e6a..0000000
14372 --- a/libbash-0.1/scripts/compound_command.bash.result
14373 +++ /dev/null
14374 @@ -1,61 +0,0 @@
14375 -foo bar
14376 -abc
14377 -def
14378 -ghi
14379 -1
14380 -2
14381 -3
14382 -5
14383 -6
14384 -7
14385 -8
14386 -9
14387 -10
14388 -bar
14389 -foo
14390 -foo
14391 -2 foo
14392 -2 bar
14393 -3 foo
14394 -3 bar
14395 -1
14396 -2
14397 -3
14398 -4
14399 -2
14400 -3
14401 -4
14402 -2
14403 -1
14404 -2
14405 -3
14406 -4
14407 -2
14408 -3
14409 -4
14410 -2
14411 -1
14412 -2
14413 -1
14414 -1
14415 -yep
14416 -default
14417 -yep
14418 -yep
14419 -yep
14420 -yep
14421 -yep
14422 -yep
14423 -yep
14424 -yep
14425 -yep
14426 -case end
14427 -a=1
14428 -b=2
14429 -bar=
14430 -file=foo
14431 -foo=ghi
14432 -i=1
14433 -j=1
14434 -outer=1
14435 -target=_
14436
14437 diff --git a/libbash-0.1/scripts/foo.eclass b/libbash-0.1/scripts/foo.eclass
14438 deleted file mode 100644
14439 index 1e46230..0000000
14440 --- a/libbash-0.1/scripts/foo.eclass
14441 +++ /dev/null
14442 @@ -1,5 +0,0 @@
14443 -IUSE="abc def"
14444 -REQUIRED_USE="abc"
14445 -DEPEND="dev-util/pkgconfig"
14446 -RDEPEND="foo/bar"
14447 -PDEPEND="foo/bar"
14448
14449 diff --git a/libbash-0.1/scripts/function_def.bash b/libbash-0.1/scripts/function_def.bash
14450 deleted file mode 100644
14451 index 8b7bd50..0000000
14452 --- a/libbash-0.1/scripts/function_def.bash
14453 +++ /dev/null
14454 @@ -1,89 +0,0 @@
14455 -EAPI=3
14456 -
14457 -src_unpack() {
14458 - EAPI=$((EAPI+1))
14459 -}
14460 -
14461 -src_unpack
14462 -src_unpack
14463 -
14464 -MY_PV=2.0.3-r1
14465 -
14466 -nested_func_with_args() {
14467 - ARG6=$1
14468 - ARG7=$3
14469 -}
14470 -
14471 -func_with_args() {
14472 - ARG1=$1
14473 - ARG2=$2
14474 - ARG3=$3
14475 - ARG4=$4
14476 - ARG5=$5
14477 - nested_func_with_args $4
14478 -}
14479 -FOO001="4 5"
14480 -ARRAY=(1 2 3)
14481 -func_with_args ${ARRAY[@]} $FOO001
14482 -func_with_args 100 $ARG2 $ARG3 $ARG4
14483 -
14484 -func-with-return()
14485 -{
14486 - return 1
14487 - NOT_EXIST=1
14488 -}
14489 -func-with-return
14490 -RETURN_STATUS=$?
14491 -func_with-return2()
14492 -{
14493 - true
14494 - return
14495 - NOT_EXIST=1
14496 -}
14497 -func_with-return2
14498 -RETURN_STATUS2=$?
14499 -
14500 -func_nested1() {
14501 - echo $foo_nested ${bar_nested[0]} $localbar
14502 -}
14503 -func_nested2() {
14504 - local foo_nested=hi bar_nested=(1 2
14505 - 3) localbar
14506 - localbar=1
14507 - echo ${bar_nested[@]}
14508 - echo ${not_exist[@]}
14509 - echo ${#bar_nested[@]}
14510 - echo ${#non_exist[@]}
14511 - echo ${#foo_nested}
14512 - echo ${#non_exist}
14513 - echo ${foo_nested:-wrong}
14514 - echo ${non_exist:-right}
14515 - func_nested1
14516 -}
14517 -func_nested2
14518 -echo $localbar
14519 -
14520 -let() {
14521 - echo "overloaded let"
14522 -}
14523 -let "1 + 2"
14524 -func_positional_args() {
14525 - IFS="abc" echo "$*"
14526 - IFS="abc" echo $*
14527 - IFS=abc
14528 - echo "$*"
14529 - echo $*
14530 -}
14531 -func_positional_args 1 2 3
14532 -
14533 -if true; then
14534 - function_in_compound_statement() {
14535 - echo "function_in_compound_statement"
14536 - }
14537 -fi
14538 -if false; then
14539 - function_in_compound_statement() {
14540 - echo "I should not get called"
14541 - }
14542 -fi
14543 -function_in_compound_statement
14544
14545 diff --git a/libbash-0.1/scripts/function_def.bash.result b/libbash-0.1/scripts/function_def.bash.result
14546 deleted file mode 100644
14547 index a4af30a..0000000
14548 --- a/libbash-0.1/scripts/function_def.bash.result
14549 +++ /dev/null
14550 @@ -1,29 +0,0 @@
14551 -1 2 3
14552 -
14553 -3
14554 -0
14555 -2
14556 -0
14557 -hi
14558 -right
14559 -hi 1 1
14560 -
14561 -overloaded let
14562 -1 2 3
14563 -1 2 3
14564 -1a2a3
14565 -1 2 3
14566 -function_in_compound_statement
14567 -ARG1=100
14568 -ARG2=2
14569 -ARG3=3
14570 -ARG4=4
14571 -ARG5=
14572 -ARG6=4
14573 -ARG7=
14574 -ARRAY=1 2 3
14575 -EAPI=5
14576 -FOO001=4 5
14577 -MY_PV=2.0.3-r1
14578 -RETURN_STATUS=1
14579 -RETURN_STATUS2=0
14580
14581 diff --git a/libbash-0.1/scripts/illegal_script.sh b/libbash-0.1/scripts/illegal_script.sh
14582 deleted file mode 100644
14583 index 9a33383..0000000
14584 --- a/libbash-0.1/scripts/illegal_script.sh
14585 +++ /dev/null
14586 @@ -1 +0,0 @@
14587 -case
14588
14589 diff --git a/libbash-0.1/scripts/isolated_functions.bash b/libbash-0.1/scripts/isolated_functions.bash
14590 deleted file mode 100644
14591 index ffdc14d..0000000
14592 --- a/libbash-0.1/scripts/isolated_functions.bash
14593 +++ /dev/null
14594 @@ -1,13 +0,0 @@
14595 -die "something wrong"
14596 -has 123 456 123 456 && echo true
14597 -has 123 456 13 456 && echo false
14598 -hasq 123 123 456
14599 -EXPORT_FUNCTIONS
14600 -echo hi
14601 -use
14602 -useq
14603 -use_with
14604 -use_enable
14605 -eerror foo
14606 -debug-print foo
14607 -ewarn foo
14608
14609 diff --git a/libbash-0.1/scripts/isolated_functions.bash.result b/libbash-0.1/scripts/isolated_functions.bash.result
14610 deleted file mode 100644
14611 index a56974f..0000000
14612 --- a/libbash-0.1/scripts/isolated_functions.bash.result
14613 +++ /dev/null
14614 @@ -1,12 +0,0 @@
14615 -Die is called: something wrong
14616 -true
14617 -Die is called: EXPORT_FUNCTIONS without a defined ECLASS
14618 -hi
14619 -use shouldn't be called
14620 -useq shouldn't be called
14621 -use_with shouldn't be called
14622 -use_enable shouldn't be called
14623 -eerror: foo
14624 -debug-print: foo
14625 -ewarn: foo
14626 -item=123
14627
14628 diff --git a/libbash-0.1/scripts/source_false.sh b/libbash-0.1/scripts/source_false.sh
14629 deleted file mode 100644
14630 index c508d53..0000000
14631 --- a/libbash-0.1/scripts/source_false.sh
14632 +++ /dev/null
14633 @@ -1 +0,0 @@
14634 -false
14635
14636 diff --git a/libbash-0.1/scripts/source_return.sh b/libbash-0.1/scripts/source_return.sh
14637 deleted file mode 100644
14638 index dab5ede..0000000
14639 --- a/libbash-0.1/scripts/source_return.sh
14640 +++ /dev/null
14641 @@ -1,2 +0,0 @@
14642 -return 10
14643 -NOT_EXIST=1
14644
14645 diff --git a/libbash-0.1/scripts/source_true.sh b/libbash-0.1/scripts/source_true.sh
14646 deleted file mode 100644
14647 index a848f2e..0000000
14648 --- a/libbash-0.1/scripts/source_true.sh
14649 +++ /dev/null
14650 @@ -1,6 +0,0 @@
14651 -FOO001=hello
14652 -function foo()
14653 -{
14654 - echo hi
14655 -}
14656 -FOO002=$0
14657
14658 diff --git a/libbash-0.1/scripts/sunpinyin-2.0.3-r1.ebuild b/libbash-0.1/scripts/sunpinyin-2.0.3-r1.ebuild
14659 deleted file mode 100644
14660 index 4b00d5a..0000000
14661 --- a/libbash-0.1/scripts/sunpinyin-2.0.3-r1.ebuild
14662 +++ /dev/null
14663 @@ -1,34 +0,0 @@
14664 -EAPI="1"
14665 -
14666 -inherit foo bar
14667 -
14668 -DESCRIPTION="SunPinyin is a SLM (Statistical Language Model) based IME"
14669 -HOMEPAGE="http://sunpinyin.googlecode.com"
14670 -SRC_URI="${HOMEPAGE}/files/${P}.tar.gz
14671 - http://open-gram.googlecode.com/files/dict.utf8.tar.bz2
14672 - http://open-gram.googlecode.com/files/lm_sc.t3g.arpa.tar.bz2"
14673 -
14674 -LICENSE="LGPL-2.1 CDDL"
14675 -SLOT="0"
14676 -KEYWORDS="~amd64 ~x86"
14677 -IUSE=""
14678 -
14679 -RDEPEND="dev-db/sqlite:3"
14680 -DEPEND="${RDEPEND}
14681 - dev-util/pkgconfig"
14682 -
14683 -src_unpack() {
14684 - :
14685 -}
14686 -
14687 -src_compile() {
14688 - :
14689 -}
14690 -
14691 -src_install() {
14692 - :
14693 -}
14694 -
14695 -pkg_postinst() {
14696 - :
14697 -}
14698
14699 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
14700 deleted file mode 100644
14701 index 9298df3..0000000
14702 --- a/libbash-0.1/scripts/sunpinyin-2.0.3-r1.ebuild.result
14703 +++ /dev/null
14704 @@ -1,22 +0,0 @@
14705 -dev-db/sqlite:3 dev-util/pkgconfig
14706 -dev-db/sqlite:3 foo/bar
14707 -0
14708 -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
14709 -
14710 -http://sunpinyin.googlecode.com
14711 -LGPL-2.1 CDDL
14712 -SunPinyin is a SLM (Statistical Language Model) based IME
14713 -~amd64 ~x86
14714 -bar foo
14715 -abc def
14716 -abc
14717 -foo/bar
14718 -
14719 -1
14720 -
14721 -compile install postinst unpack
14722 -
14723 -
14724 -
14725 -
14726 -
14727
14728 diff --git a/libbash-0.1/scripts/test_expr.bash b/libbash-0.1/scripts/test_expr.bash
14729 deleted file mode 100644
14730 index 04b5a62..0000000
14731 --- a/libbash-0.1/scripts/test_expr.bash
14732 +++ /dev/null
14733 @@ -1,54 +0,0 @@
14734 -[ a = b ]
14735 -echo $? # 1
14736 -test a = a
14737 -echo $? # 0
14738 -#[ ]
14739 -#echo $? # 1
14740 -[ abc ]
14741 -echo $? # 0
14742 -[ ! abc ]
14743 -echo $? # 1
14744 -#[ ! ]
14745 -#echo $?
14746 -#[ abc -a bcd ]
14747 -#echo $?
14748 -#[ abc -o bcd ]
14749 -#echo $?
14750 -test abc == abd
14751 -echo $? # 1
14752 -[ abc != bcd ]
14753 -echo $? # 0
14754 -[ abc != abc ]
14755 -echo $? # 1
14756 -[ abc \> bcd ]
14757 -echo $? # 1
14758 -[ abc \< bcd ]
14759 -echo $? # 0
14760 -[[ abc ]] && echo true1
14761 -[[ abc < bcd ]] && echo true2
14762 -[[ abc > bcd ]] || echo true3
14763 -[[ abc != bcd ]] && echo true4
14764 -[[ abc = bcd ]] || echo true5
14765 -[[ abc == abc ]] && echo true6
14766 -[[ ! abc = bcd ]] && echo true7
14767 -[[ abc = bcd || abc == abc ]] && echo true8
14768 -[[ abc = bcd && abc == abc ]] || echo true9
14769 -# abc=bcd is treated as a simple string
14770 -[[ abc=bcd && abc == abc ]] || echo wrong
14771 -[[ -a "/" ]] && echo "true10"
14772 -[[ . -ef . ]] && echo "true11"
14773 -[[ 2 -ge 2 ]] && echo "true12"
14774 -[[ "abc def xyz" == *"def"* ]] && echo "true13"
14775 -[[ "abc def xyz" == *"defg"* ]] && echo "wrong"
14776 -[[ "abc def xyz" != *"def"* ]] && echo "wrong"
14777 -[[ "abc def xyz" != *"defg"* ]] && echo "true14"
14778 -shopt -s extglob
14779 -[[ "123" == *([[:digit:]]) ]] && echo "true15"
14780 -i=2
14781 -[[ i++ -gt 2 ]] && echo wrong
14782 -[[ i++ -gt 2 ]] && echo true16
14783 -unset i
14784 -[[ "setup.py" =~ ^(setup\.py|nosetests|py\.test|trial(\ .*)?)$ ]] && echo true17
14785 -[[ "setup.py" =~ ^(setup\.p|nosetests|py\.test|trial(\ .*)?)$ ]] && echo false
14786 -[ abc = bcd -o abc = abc ] && echo true18
14787 -[ abc = bcd -a abc = abc ] || echo true19
14788
14789 diff --git a/libbash-0.1/scripts/test_expr.bash.result b/libbash-0.1/scripts/test_expr.bash.result
14790 deleted file mode 100644
14791 index fb147eb..0000000
14792 --- a/libbash-0.1/scripts/test_expr.bash.result
14793 +++ /dev/null
14794 @@ -1,28 +0,0 @@
14795 -1
14796 -0
14797 -0
14798 -1
14799 -1
14800 -0
14801 -1
14802 -1
14803 -0
14804 -true1
14805 -true2
14806 -true3
14807 -true4
14808 -true5
14809 -true6
14810 -true7
14811 -true8
14812 -true9
14813 -true10
14814 -true11
14815 -true12
14816 -true13
14817 -true14
14818 -true15
14819 -true16
14820 -true17
14821 -true18
14822 -true19
14823
14824 diff --git a/libbash-0.1/scripts/var_def.bash b/libbash-0.1/scripts/var_def.bash
14825 deleted file mode 100644
14826 index fa07952..0000000
14827 --- a/libbash-0.1/scripts/var_def.bash
14828 +++ /dev/null
14829 @@ -1,42 +0,0 @@
14830 -EAPI="1"
14831 -DESCRIPTION="SunPinyin is a SLM (Statistical Language Model) based IME"
14832 -HOMEPAGE="http://sunpinyin.googlecode.com"
14833 -SRC_URI="http://open-gram.googlecode.com/files/dict.utf8.tar.bz2
14834 - http://open-gram.googlecode.com/files/lm_sc.t3g.arpa.tar.bz2"
14835 -LICENSE="LGPL-2.1 CDDL"
14836 -SLOT="0"
14837 -KEYWORDS="~amd64 ~x86"
14838 -IUSE=""
14839 -RDEPEND="dev-db/sqlite:3"
14840 -DEPEND="${RDEPEND}
14841 - dev-util/pkgconfig"
14842 -MY_PATCH=ldflags.patch
14843 -PATCH=("1.patch" 2.patch)
14844 -ARRAY01=(1 2 3 [5]=4 5)
14845 -ARRAY02=(1 2 3)
14846 -ARRAY02[2]=4
14847 -ARRAY02[3]=5
14848 -EMPTY=
14849 -PARTIAL[5]=5
14850 -ARRAY_LAST=${ARRAY01[6]}
14851 -EMPTY_ARRAY=()
14852 -ARRAY03=(1 2 3)
14853 -ARRAY03[0]=
14854 -ARRAY04=(1 2 3)
14855 -# The following one is equivalent to ARRAY04[0]=
14856 -ARRAY04=
14857 -ARRAY05=(1 2 3 4 5)
14858 -ARRAY06=${ARRAY05[@]}
14859 -ARRAY07=${ARRAY05[*]}
14860 -ARRAY08="${ARRAY05[@]}"
14861 -ARRAY09="${ARRAY05[*]}"
14862 -IFS=";,:"
14863 -ARRAY10="${ARRAY05[*]}"
14864 -FOO001="networkmanager"
14865 -FOO002="0.8.2"
14866 -FOO003=${FOO001}-${FOO002}
14867 -FOO004=$?
14868 -FOO004=$!
14869 -FOO005=abc
14870 -FOO005+=def
14871 -echo $-
14872
14873 diff --git a/libbash-0.1/scripts/var_def.bash.result b/libbash-0.1/scripts/var_def.bash.result
14874 deleted file mode 100644
14875 index 667c3e0..0000000
14876 --- a/libbash-0.1/scripts/var_def.bash.result
14877 +++ /dev/null
14878 @@ -1,35 +0,0 @@
14879 -$! has not been implemented yet
14880 -Bh
14881 -ARRAY01=1 2 3 4 5
14882 -ARRAY02=1 2 4 5
14883 -ARRAY03= 2 3
14884 -ARRAY04= 2 3
14885 -ARRAY05=1 2 3 4 5
14886 -ARRAY06=1 2 3 4 5
14887 -ARRAY07=1 2 3 4 5
14888 -ARRAY08=1 2 3 4 5
14889 -ARRAY09=1 2 3 4 5
14890 -ARRAY10=1;2;3;4;5
14891 -ARRAY_LAST=5
14892 -DEPEND=dev-db/sqlite:3
14893 - dev-util/pkgconfig
14894 -DESCRIPTION=SunPinyin is a SLM (Statistical Language Model) based IME
14895 -EAPI=1
14896 -EMPTY=
14897 -EMPTY_ARRAY=
14898 -FOO001=networkmanager
14899 -FOO002=0.8.2
14900 -FOO003=networkmanager-0.8.2
14901 -FOO004=
14902 -FOO005=abcdef
14903 -HOMEPAGE=http://sunpinyin.googlecode.com
14904 -IUSE=
14905 -KEYWORDS=~amd64 ~x86
14906 -LICENSE=LGPL-2.1 CDDL
14907 -MY_PATCH=ldflags.patch
14908 -PARTIAL=5
14909 -PATCH=1.patch 2.patch
14910 -RDEPEND=dev-db/sqlite:3
14911 -SLOT=0
14912 -SRC_URI=http://open-gram.googlecode.com/files/dict.utf8.tar.bz2
14913 - http://open-gram.googlecode.com/files/lm_sc.t3g.arpa.tar.bz2
14914
14915 diff --git a/libbash-0.1/scripts/var_expansion.bash b/libbash-0.1/scripts/var_expansion.bash
14916 deleted file mode 100644
14917 index 16573a9..0000000
14918 --- a/libbash-0.1/scripts/var_expansion.bash
14919 +++ /dev/null
14920 @@ -1,115 +0,0 @@
14921 -shopt -s extglob
14922 -ARRAY=(hi hello 1 2 3)
14923 -EAPI="3"
14924 -EAPI4="$((EAPI+1))"
14925 -FOO001="${EAPI:-hello}"
14926 -FOO002="${EAPI3:-hello}"
14927 -FOO003=123
14928 -FOO004=$EAPI
14929 -FOO005=$(( 1+1 ))
14930 -FOO006=${EAPI:=hello}
14931 -FOO007=${FOO008:=hello world}
14932 -FOO009=${EAPI:+hello}
14933 -FOO010=${NOT_EXIST:+hello}
14934 -FOO011=${FOO009:0}
14935 -FOO012=${FOO009:2}
14936 -FOO013=${FOO009: -2}
14937 -FOO014=${FOO009:100}
14938 -FOO015=${FOO009: -100}
14939 -FOO016=${FOO009:(-5 + 5)}
14940 -FOO017=${NOT_EXIST:0}
14941 -FOO018=${FOO009:0:2}
14942 -FOO019=${FOO009:2:2}
14943 -FOO020=${FOO009: -2:2}
14944 -FOO021=${FOO009:2:100}
14945 -FOO022=${FOO009: -2:100}
14946 -FOO023=${NOT_EXIST:0:2}
14947 -FOO024=${#FOO009}
14948 -FOO025=${#NOT_EXIST}
14949 -FOO026="${ARRAY[0]:-hello}"
14950 -FOO028="${ARRAY[5]:-hello}"
14951 -FOO029="${ARRAY2[0]:=hello}"
14952 -FOO030="${ARRAY2[0]:=hi}"
14953 -FOO031="${ARRAY2[0]:+hi}"
14954 -FOO032="${ARRAY2[1]:+hi}"
14955 -FOO033="${ARRAY[1]:1}"
14956 -FOO034="${ARRAY[1]:1:3}"
14957 -FOO035="${#ARRAY[0]}"
14958 -FOO036="${#ARRAY[@]}"
14959 -FOO037="${#ARRAY[*]}"
14960 -FOO038="${#ARRAY}"
14961 -FOO039="Hello World"
14962 -FOO040=${FOO039/nothing/nothing}
14963 -FOO041=${FOO039/o W/ow}
14964 -FOO042=${FOO039//o/e}
14965 -FOO043=${FOO039/#He/he}
14966 -FOO044=${FOO039/#he/he}
14967 -FOO045=${FOO039/%rld/rlD}
14968 -FOO046=${FOO039/%rlD/rlD}
14969 -FOO047=${FOO039/o W}
14970 -FOO048=${FOO039//o}
14971 -FOO049=${FOO039/#He}
14972 -FOO050=${FOO039/#he}
14973 -FOO051=${FOO039/%rld}
14974 -FOO052=${FOO039/%rlD}
14975 -FOO053=${FOO039/aaaaaaaaaaaa}
14976 -FOO054=${FOO039#hello}
14977 -FOO055=${FOO039##hello}
14978 -FOO056=${FOO039#Hello}
14979 -FOO057=${FOO039##Hello}
14980 -FOO058=${FOO039%world}
14981 -FOO059=${FOO039%%world}
14982 -FOO060=${FOO039%World}
14983 -FOO061=${FOO039%%World}
14984 -FOO062=${FOO039#Hel*}
14985 -FOO063=${FOO039##Hel*}
14986 -FOO064=${FOO039%*rld}
14987 -FOO065=${FOO039%%*rld}
14988 -FOO066=${FOO039/l/r}
14989 -FOO067=${FOO039//l/r}
14990 -FOO068=${FOO039/#He/he}
14991 -FOO069=${FOO039/#ello/i}
14992 -FOO070=${FOO039/%ld/d}
14993 -FOO071=${FOO039/%rl/r}
14994 -FOO072=${FOO039/+(l)/}
14995 -FOO073=${FOO039/+(l|e)}
14996 -FOO074=${FOO039/*(l)}
14997 -FOO075=${FOO039//*(l)}
14998 -FOO076=${FOO039//*(l|e)}
14999 -FOO077=${FOO039/?(l)}
15000 -FOO078=${FOO039//?(l)}
15001 -FOO079=${FOO039//?(l|e|o)}
15002 -FOO080=${FOO039/@([a-c]|[k-m])}
15003 -FOO081=${FOO039//@([a-c]|[k-m])}
15004 -target="abc123abc"
15005 -FOO082="${target##+(ab[c])*([[:digit:]])}"
15006 -function positional_parameter_test(){
15007 - FOO083=$*
15008 - FOO084=${*}
15009 - FOO085=${*:1}
15010 - FOO086=${*:1:2}
15011 - FOO087=${*: -1}
15012 - FOO088=${*: -2:5}
15013 - FOO089=${*:0}
15014 - FOO090=$@
15015 - FOO091=${@}
15016 - FOO092=${@:1}
15017 - FOO093=${@:1:2}
15018 - FOO094=${@: -1}
15019 - FOO095=${@: -2:5}
15020 - FOO096=${@:0}
15021 - echo $#
15022 -}
15023 -positional_parameter_test 1 2 3 4 5
15024 -target="abc*abc"
15025 -echo ${target/*}
15026 -echo ${target/'*'}
15027 -echo ${target/"*"}
15028 -: ${FOO089:=}
15029 -ARRAY=(1 2 3 4 5)
15030 -echo ${ARRAY[@]:1}
15031 -echo ${ARRAY[@]:1:3}
15032 -echo $#
15033 -echo a{b,c}d
15034 -echo a{a,bc}d{e,}f
15035 -echo a{ab,cd}d{ef,gh}
15036
15037 diff --git a/libbash-0.1/scripts/var_expansion.bash.result b/libbash-0.1/scripts/var_expansion.bash.result
15038 deleted file mode 100644
15039 index 52c87c0..0000000
15040 --- a/libbash-0.1/scripts/var_expansion.bash.result
15041 +++ /dev/null
15042 @@ -1,110 +0,0 @@
15043 -5
15044 -
15045 -abcabc
15046 -abcabc
15047 -2 3 4 5
15048 -2 3 4
15049 -0
15050 -abd acd
15051 -aadef aadf abcdef abcdf
15052 -aabdef aabdgh acddef acddgh
15053 -ARRAY=1 2 3 4 5
15054 -ARRAY2=hello
15055 -EAPI=3
15056 -EAPI4=4
15057 -FOO001=3
15058 -FOO002=hello
15059 -FOO003=123
15060 -FOO004=3
15061 -FOO005=2
15062 -FOO006=3
15063 -FOO007=hello world
15064 -FOO008=hello world
15065 -FOO009=hello
15066 -FOO010=
15067 -FOO011=hello
15068 -FOO012=llo
15069 -FOO013=lo
15070 -FOO014=
15071 -FOO015=
15072 -FOO016=hello
15073 -FOO017=
15074 -FOO018=he
15075 -FOO019=ll
15076 -FOO020=lo
15077 -FOO021=llo
15078 -FOO022=lo
15079 -FOO023=
15080 -FOO024=5
15081 -FOO025=0
15082 -FOO026=hi
15083 -FOO028=hello
15084 -FOO029=hello
15085 -FOO030=hello
15086 -FOO031=hi
15087 -FOO032=
15088 -FOO033=ello
15089 -FOO034=ell
15090 -FOO035=2
15091 -FOO036=5
15092 -FOO037=5
15093 -FOO038=2
15094 -FOO039=Hello World
15095 -FOO040=Hello World
15096 -FOO041=Helloworld
15097 -FOO042=Helle Werld
15098 -FOO043=hello World
15099 -FOO044=Hello World
15100 -FOO045=Hello WorlD
15101 -FOO046=Hello World
15102 -FOO047=Hellorld
15103 -FOO048=Hell Wrld
15104 -FOO049=llo World
15105 -FOO050=Hello World
15106 -FOO051=Hello Wo
15107 -FOO052=Hello World
15108 -FOO053=Hello World
15109 -FOO054=Hello World
15110 -FOO055=Hello World
15111 -FOO056= World
15112 -FOO057= World
15113 -FOO058=Hello World
15114 -FOO059=Hello World
15115 -FOO060=Hello
15116 -FOO061=Hello
15117 -FOO062=lo World
15118 -FOO063=
15119 -FOO064=Hello Wo
15120 -FOO065=
15121 -FOO066=Herlo World
15122 -FOO067=Herro Worrd
15123 -FOO068=hello World
15124 -FOO069=Hello World
15125 -FOO070=Hello Word
15126 -FOO071=Hello World
15127 -FOO072=Heo World
15128 -FOO073=Ho World
15129 -FOO074=Hello World
15130 -FOO075=Heo Word
15131 -FOO076=Ho Word
15132 -FOO077=Hello World
15133 -FOO078=Heo Word
15134 -FOO079=H Wrd
15135 -FOO080=Helo World
15136 -FOO081=Heo Word
15137 -FOO082=abc
15138 -FOO083=1 2 3 4 5
15139 -FOO084=1 2 3 4 5
15140 -FOO085=1 2 3 4 5
15141 -FOO086=1 2
15142 -FOO087=5
15143 -FOO088=4 5
15144 -FOO089=@srcdir@/scripts/var_expansion.bash 1 2 3 4 5
15145 -FOO090=1 2 3 4 5
15146 -FOO091=1 2 3 4 5
15147 -FOO092=1 2 3 4 5
15148 -FOO093=1 2
15149 -FOO094=5
15150 -FOO095=4 5
15151 -FOO096=@srcdir@/scripts/var_expansion.bash 1 2 3 4 5
15152 -target=abc*abc
15153
15154 diff --git a/libbash-0.1/src/builtins/boolean_builtins.h b/libbash-0.1/src/builtins/boolean_builtins.h
15155 deleted file mode 100644
15156 index fb7aca9..0000000
15157 --- a/libbash-0.1/src/builtins/boolean_builtins.h
15158 +++ /dev/null
15159 @@ -1,40 +0,0 @@
15160 -/*
15161 - Please use git log for copyright holder and year information
15162 -
15163 - This file is part of libbash.
15164 -
15165 - libbash is free software: you can redistribute it and/or modify
15166 - it under the terms of the GNU General Public License as published by
15167 - the Free Software Foundation, either version 2 of the License, or
15168 - (at your option) any later version.
15169 -
15170 - libbash is distributed in the hope that it will be useful,
15171 - but WITHOUT ANY WARRANTY; without even the implied warranty of
15172 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15173 - GNU General Public License for more details.
15174 -
15175 - You should have received a copy of the GNU General Public License
15176 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
15177 -*/
15178 -///
15179 -/// \file boolean_builtins.cpp
15180 -/// \brief implementations for the true and false builtins
15181 -///
15182 -#ifndef LIBBASH_BUILTINS_BOOLEAN_BUILTINS_H_
15183 -#define LIBBASH_BUILTINS_BOOLEAN_BUILTINS_H_
15184 -
15185 -#include "cppbash_builtin.h"
15186 -
15187 -struct true_builtin : public virtual cppbash_builtin
15188 -{
15189 - BUILTIN_CONSTRUCTOR(true)
15190 - virtual int exec(const std::vector<std::string>& ) { return 0; }
15191 -};
15192 -
15193 -struct false_builtin : public virtual cppbash_builtin
15194 -{
15195 - BUILTIN_CONSTRUCTOR(false)
15196 - virtual int exec(const std::vector<std::string>& ) { return 1; }
15197 -};
15198 -
15199 -#endif
15200
15201 diff --git a/libbash-0.1/src/builtins/break_builtin.cpp b/libbash-0.1/src/builtins/break_builtin.cpp
15202 deleted file mode 100644
15203 index 0ee20a7..0000000
15204 --- a/libbash-0.1/src/builtins/break_builtin.cpp
15205 +++ /dev/null
15206 @@ -1,51 +0,0 @@
15207 -/*
15208 - Please use git log for copyright holder and year information
15209 -
15210 - This file is part of libbash.
15211 -
15212 - libbash is free software: you can redistribute it and/or modify
15213 - it under the terms of the GNU General Public License as published by
15214 - the Free Software Foundation, either version 2 of the License, or
15215 - (at your option) any later version.
15216 -
15217 - libbash is distributed in the hope that it will be useful,
15218 - but WITHOUT ANY WARRANTY; without even the implied warranty of
15219 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15220 - GNU General Public License for more details.
15221 -
15222 - You should have received a copy of the GNU General Public License
15223 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
15224 -*/
15225 -///
15226 -/// \file break_builtin.h
15227 -/// \brief implementation for the break builtin
15228 -///
15229 -#include "builtins/break_builtin.h"
15230 -
15231 -#include <boost/lexical_cast.hpp>
15232 -
15233 -#include "builtins/builtin_exceptions.h"
15234 -#include "core/interpreter_exception.h"
15235 -
15236 -int break_builtin::exec(const std::vector<std::string>& bash_args)
15237 -{
15238 - int nth = 1;
15239 -
15240 - if(bash_args.size() > 1)
15241 - {
15242 - throw libbash::interpreter_exception("break: too many arguments");
15243 - }
15244 - else if(bash_args.size() == 1)
15245 - {
15246 - try
15247 - {
15248 - nth = boost::lexical_cast<int>(bash_args[0]);
15249 - }
15250 - catch(boost::bad_lexical_cast& e)
15251 - {
15252 - throw libbash::interpreter_exception("break: argument should be an integer");
15253 - }
15254 - }
15255 -
15256 - throw break_exception(nth);
15257 -}
15258
15259 diff --git a/libbash-0.1/src/builtins/break_builtin.h b/libbash-0.1/src/builtins/break_builtin.h
15260 deleted file mode 100644
15261 index fec1bc7..0000000
15262 --- a/libbash-0.1/src/builtins/break_builtin.h
15263 +++ /dev/null
15264 @@ -1,35 +0,0 @@
15265 -/*
15266 - Please use git log for copyright holder and year information
15267 -
15268 - This file is part of libbash.
15269 -
15270 - libbash is free software: you can redistribute it and/or modify
15271 - it under the terms of the GNU General Public License as published by
15272 - the Free Software Foundation, either version 2 of the License, or
15273 - (at your option) any later version.
15274 -
15275 - libbash is distributed in the hope that it will be useful,
15276 - but WITHOUT ANY WARRANTY; without even the implied warranty of
15277 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15278 - GNU General Public License for more details.
15279 -
15280 - You should have received a copy of the GNU General Public License
15281 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
15282 -*/
15283 -///
15284 -/// \file break_builtin.h
15285 -/// \brief implementation for the break builtin
15286 -///
15287 -#ifndef LIBBASH_BUILTINS_BREAK_BUILTIN_H_
15288 -#define LIBBASH_BUILTINS_BREAK_BUILTIN_H_
15289 -
15290 -#include "cppbash_builtin.h"
15291 -
15292 -class break_builtin : public virtual cppbash_builtin
15293 -{
15294 -public:
15295 - BUILTIN_CONSTRUCTOR(break)
15296 - virtual int exec(const std::vector<std::string>& );
15297 -};
15298 -
15299 -#endif
15300
15301 diff --git a/libbash-0.1/src/builtins/builtin_exceptions.h b/libbash-0.1/src/builtins/builtin_exceptions.h
15302 deleted file mode 100644
15303 index 7b45efc..0000000
15304 --- a/libbash-0.1/src/builtins/builtin_exceptions.h
15305 +++ /dev/null
15306 @@ -1,97 +0,0 @@
15307 -/*
15308 - Please use git log for copyright holder and year information
15309 -
15310 - This file is part of libbash.
15311 -
15312 - libbash is free software: you can redistribute it and/or modify
15313 - it under the terms of the GNU General Public License as published by
15314 - the Free Software Foundation, either version 2 of the License, or
15315 - (at your option) any later version.
15316 -
15317 - libbash is distributed in the hope that it will be useful,
15318 - but WITHOUT ANY WARRANTY; without even the implied warranty of
15319 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15320 - GNU General Public License for more details.
15321 -
15322 - You should have received a copy of the GNU General Public License
15323 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
15324 -*/
15325 -///
15326 -/// \file builtin_exceptions.h
15327 -/// \brief implementations for builtin exceptions
15328 -///
15329 -
15330 -#ifndef LIBBASH_BUILTINS_BUILTIN_EXCEPTIONS_H_
15331 -#define LIBBASH_BUILTINS_BUILTIN_EXCEPTIONS_H_
15332 -
15333 -#include <stdexcept>
15334 -
15335 -#include "core/exceptions.h"
15336 -
15337 -///
15338 -/// \class return_exception
15339 -/// \brief thrown when executing the return builtin
15340 -///
15341 -class return_exception: public std::runtime_error
15342 -{
15343 -public:
15344 - explicit return_exception():
15345 - runtime_error("return exception"){}
15346 -};
15347 -
15348 -class loop_control_exception
15349 -{
15350 - int count;
15351 -
15352 - virtual void rethrow() = 0;
15353 -
15354 -protected:
15355 - virtual ~loop_control_exception() {}
15356 -
15357 -public:
15358 - explicit loop_control_exception(int c): count(c) {}
15359 -
15360 - void rethrow_unless_correct_frame()
15361 - {
15362 - if(count != 1)
15363 - {
15364 - --count;
15365 - rethrow();
15366 - }
15367 - }
15368 -};
15369 -
15370 -class continue_exception: public loop_control_exception
15371 -{
15372 -protected:
15373 - virtual void rethrow()
15374 - {
15375 - throw *this;
15376 - }
15377 -
15378 -public:
15379 - explicit continue_exception(int c): loop_control_exception(c) {
15380 - if(c < 1)
15381 - throw libbash::illegal_argument_exception("continue: argument should be greater than or equal to 1");
15382 - }
15383 -};
15384 -
15385 -class break_exception: public loop_control_exception
15386 -{
15387 -protected:
15388 - virtual void rethrow()
15389 - {
15390 - throw *this;
15391 - }
15392 -
15393 -public:
15394 - explicit break_exception(int c): loop_control_exception(c) {
15395 - if(c < 1)
15396 - throw libbash::illegal_argument_exception("break: argument should be greater than or equal to 1");
15397 - }
15398 -};
15399 -
15400 -class suppress_output: public std::exception
15401 -{
15402 -};
15403 -#endif
15404
15405 diff --git a/libbash-0.1/src/builtins/continue_builtin.cpp b/libbash-0.1/src/builtins/continue_builtin.cpp
15406 deleted file mode 100644
15407 index 9bb9469..0000000
15408 --- a/libbash-0.1/src/builtins/continue_builtin.cpp
15409 +++ /dev/null
15410 @@ -1,51 +0,0 @@
15411 -/*
15412 - Please use git log for copyright holder and year information
15413 -
15414 - This file is part of libbash.
15415 -
15416 - libbash is free software: you can redistribute it and/or modify
15417 - it under the terms of the GNU General Public License as published by
15418 - the Free Software Foundation, either version 2 of the License, or
15419 - (at your option) any later version.
15420 -
15421 - libbash is distributed in the hope that it will be useful,
15422 - but WITHOUT ANY WARRANTY; without even the implied warranty of
15423 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15424 - GNU General Public License for more details.
15425 -
15426 - You should have received a copy of the GNU General Public License
15427 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
15428 -*/
15429 -///
15430 -/// \file continue_builtin.h
15431 -/// \brief implementation for the continue builtin
15432 -///
15433 -#include "builtins/continue_builtin.h"
15434 -
15435 -#include <boost/lexical_cast.hpp>
15436 -
15437 -#include "builtins/builtin_exceptions.h"
15438 -#include "core/exceptions.h"
15439 -
15440 -int continue_builtin::exec(const std::vector<std::string>& bash_args)
15441 -{
15442 - int nth = 1;
15443 -
15444 - if(bash_args.size() > 1)
15445 - {
15446 - throw libbash::illegal_argument_exception("continue: too many arguments");
15447 - }
15448 - else if(bash_args.size() == 1)
15449 - {
15450 - try
15451 - {
15452 - nth = boost::lexical_cast<int>(bash_args[0]);
15453 - }
15454 - catch(boost::bad_lexical_cast& e)
15455 - {
15456 - throw libbash::illegal_argument_exception("continue: argument should be an integer");
15457 - }
15458 - }
15459 -
15460 - throw continue_exception(nth);
15461 -}
15462
15463 diff --git a/libbash-0.1/src/builtins/continue_builtin.h b/libbash-0.1/src/builtins/continue_builtin.h
15464 deleted file mode 100644
15465 index cd5223b..0000000
15466 --- a/libbash-0.1/src/builtins/continue_builtin.h
15467 +++ /dev/null
15468 @@ -1,35 +0,0 @@
15469 -/*
15470 - Please use git log for copyright holder and year information
15471 -
15472 - This file is part of libbash.
15473 -
15474 - libbash is free software: you can redistribute it and/or modify
15475 - it under the terms of the GNU General Public License as published by
15476 - the Free Software Foundation, either version 2 of the License, or
15477 - (at your option) any later version.
15478 -
15479 - libbash is distributed in the hope that it will be useful,
15480 - but WITHOUT ANY WARRANTY; without even the implied warranty of
15481 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15482 - GNU General Public License for more details.
15483 -
15484 - You should have received a copy of the GNU General Public License
15485 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
15486 -*/
15487 -///
15488 -/// \file continue_builtin.h
15489 -/// \brief implementation for the continue builtin
15490 -///
15491 -#ifndef LIBBASH_BUILTINS_CONTINUE_BUILTIN_H_
15492 -#define LIBBASH_BUILTINS_CONTINUE_BUILTIN_H_
15493 -
15494 -#include "cppbash_builtin.h"
15495 -
15496 -class continue_builtin : public virtual cppbash_builtin
15497 -{
15498 -public:
15499 - BUILTIN_CONSTRUCTOR(continue)
15500 - virtual int exec(const std::vector<std::string>& );
15501 -};
15502 -
15503 -#endif
15504
15505 diff --git a/libbash-0.1/src/builtins/declare_builtin.cpp b/libbash-0.1/src/builtins/declare_builtin.cpp
15506 deleted file mode 100644
15507 index 2644bb7..0000000
15508 --- a/libbash-0.1/src/builtins/declare_builtin.cpp
15509 +++ /dev/null
15510 @@ -1,114 +0,0 @@
15511 -/*
15512 - Please use git log for copyright holder and year information
15513 -
15514 - This file is part of libbash.
15515 -
15516 - libbash is free software: you can redistribute it and/or modify
15517 - it under the terms of the GNU General Public License as published by
15518 - the Free Software Foundation, either version 2 of the License, or
15519 - (at your option) any later version.
15520 -
15521 - libbash is distributed in the hope that it will be useful,
15522 - but WITHOUT ANY WARRANTY; without even the implied warranty of
15523 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15524 - GNU General Public License for more details.
15525 -
15526 - You should have received a copy of the GNU General Public License
15527 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
15528 -*/
15529 -///
15530 -/// \file declare_builtin.cpp
15531 -/// \brief class that implements the declare builtin
15532 -///
15533 -#include "builtins/declare_builtin.h"
15534 -
15535 -#include <algorithm>
15536 -#include <iostream>
15537 -
15538 -#include "core/exceptions.h"
15539 -#include "core/interpreter.h"
15540 -
15541 -int declare_builtin::exec(const std::vector<std::string>& bash_args)
15542 -{
15543 - if(bash_args.empty())
15544 - {
15545 - throw libbash::illegal_argument_exception("Arguments required for declare");
15546 - return 1;
15547 - }
15548 - else if(bash_args[0].size() != 2)
15549 - {
15550 - throw libbash::unsupported_exception("Multiple arguments are not supported");
15551 - return 1;
15552 - }
15553 -
15554 - if(bash_args[0][0] != '-' && bash_args[0][0] != '+')
15555 - {
15556 - throw libbash::illegal_argument_exception("Invalid option for declare builtin");
15557 - return 1;
15558 - }
15559 -
15560 - int result = 0;
15561 - switch(bash_args[0][1])
15562 - {
15563 - case 'F':
15564 - if(bash_args[0][0] == '+')
15565 - return 0;
15566 - if(bash_args.size() > 1)
15567 - {
15568 - for(auto iter = bash_args.begin() + 1; iter != bash_args.end(); ++iter)
15569 - {
15570 - if(_walker.has_function(*iter))
15571 - *_out_stream << *iter << std::endl;
15572 - else
15573 - result = 1;
15574 - }
15575 - }
15576 - else
15577 - {
15578 - std::vector<std::string> functions;
15579 -
15580 - _walker.get_all_function_names(functions);
15581 - sort(functions.begin(), functions.end());
15582 -
15583 - for(auto iter = functions.begin(); iter != functions.end(); ++iter)
15584 - *_out_stream << "declare -f " << *iter << std::endl;
15585 - }
15586 - return result;
15587 - case 'p':
15588 - if(bash_args.size() > 1)
15589 - {
15590 - for(auto iter = bash_args.begin() + 1; iter != bash_args.end(); ++iter)
15591 - {
15592 - // We do not print the type of the variable for now
15593 - if(!_walker.is_unset(*iter))
15594 - {
15595 - *_out_stream << "declare -- " << *iter << "=\"" << _walker.resolve<std::string>(*iter) << "\"" << std::endl;
15596 - }
15597 - else
15598 - {
15599 - *_out_stream << "-bash: declare: " << *iter << ": not found" << std::endl;
15600 - result = 1;
15601 - }
15602 - }
15603 - }
15604 - else
15605 - {
15606 - throw libbash::unsupported_exception("We do not support declare -p without arguments for now");
15607 - }
15608 - return result;
15609 - case 'a':
15610 - case 'A':
15611 - case 'f':
15612 - case 'i':
15613 - case 'l':
15614 - case 'r':
15615 - case 't':
15616 - case 'u':
15617 - case 'x':
15618 - throw libbash::unsupported_exception("declare " + bash_args[0] + " is not supported yet");
15619 - return 1;
15620 - default:
15621 - throw libbash::illegal_argument_exception("Unrecognized option for declare: " + bash_args[0]);
15622 - return 1;
15623 - }
15624 -}
15625
15626 diff --git a/libbash-0.1/src/builtins/declare_builtin.h b/libbash-0.1/src/builtins/declare_builtin.h
15627 deleted file mode 100644
15628 index 971933a..0000000
15629 --- a/libbash-0.1/src/builtins/declare_builtin.h
15630 +++ /dev/null
15631 @@ -1,46 +0,0 @@
15632 -/*
15633 - Please use git log for copyright holder and year information
15634 -
15635 - This file is part of libbash.
15636 -
15637 - libbash is free software: you can redistribute it and/or modify
15638 - it under the terms of the GNU General Public License as published by
15639 - the Free Software Foundation, either version 2 of the License, or
15640 - (at your option) any later version.
15641 -
15642 - libbash is distributed in the hope that it will be useful,
15643 - but WITHOUT ANY WARRANTY; without even the implied warranty of
15644 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15645 - GNU General Public License for more details.
15646 -
15647 - You should have received a copy of the GNU General Public License
15648 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
15649 -*/
15650 -///
15651 -/// \file declare_builtin.h
15652 -/// \brief class that implements the declare builtin
15653 -///
15654 -
15655 -#ifndef LIBBASH_BUILTINS_DECLARE_BUILTIN_H_
15656 -#define LIBBASH_BUILTINS_DECLARE_BUILTIN_H_
15657 -
15658 -#include "cppbash_builtin.h"
15659 -
15660 -///
15661 -/// \class declare_builtin
15662 -/// \brief the declare builtin for bash
15663 -///
15664 -class declare_builtin: public virtual cppbash_builtin
15665 -{
15666 -public:
15667 - BUILTIN_CONSTRUCTOR(declare)
15668 -
15669 - ///
15670 - /// \brief runs the declare builtin on the supplied arguments
15671 - /// \param bash_args the arguments to the declare builtin
15672 - /// \return exit status of declare
15673 - ///
15674 - virtual int exec(const std::vector<std::string>& bash_args);
15675 -};
15676 -
15677 -#endif
15678
15679 diff --git a/libbash-0.1/src/builtins/echo_builtin.cpp b/libbash-0.1/src/builtins/echo_builtin.cpp
15680 deleted file mode 100644
15681 index 8caecef..0000000
15682 --- a/libbash-0.1/src/builtins/echo_builtin.cpp
15683 +++ /dev/null
15684 @@ -1,120 +0,0 @@
15685 -/*
15686 - Please use git log for copyright holder and year information
15687 -
15688 - This file is part of libbash.
15689 -
15690 - libbash is free software: you can redistribute it and/or modify
15691 - it under the terms of the GNU General Public License as published by
15692 - the Free Software Foundation, either version 2 of the License, or
15693 - (at your option) any later version.
15694 -
15695 - libbash is distributed in the hope that it will be useful,
15696 - but WITHOUT ANY WARRANTY; without even the implied warranty of
15697 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15698 - GNU General Public License for more details.
15699 -
15700 - You should have received a copy of the GNU General Public License
15701 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
15702 -*/
15703 -///
15704 -/// \file echo_builtin.cpp
15705 -/// \brief class that implements the echo builtin
15706 -///
15707 -
15708 -#include "echo_builtin.h"
15709 -#include <boost/spirit/include/karma.hpp>
15710 -#include <boost/spirit/include/qi.hpp>
15711 -#include <boost/spirit/include/phoenix.hpp>
15712 -
15713 -#include "builtins/builtin_exceptions.h"
15714 -
15715 -namespace qi = boost::spirit::qi;
15716 -namespace karma = boost::spirit::karma;
15717 -namespace phoenix = boost::phoenix;
15718 -
15719 -int echo_builtin::exec(const std::vector<std::string>& bash_args)
15720 -{
15721 - bool suppress_nl = false;
15722 - bool enable_escapes = false;
15723 - bool options_parsed = false;
15724 -
15725 - if(bash_args.empty())
15726 - {
15727 - this->out_buffer() << std::endl;
15728 - return 0;
15729 - }
15730 -
15731 - for(auto i = bash_args.begin(); i != bash_args.end(); i++)
15732 - {
15733 - const std::string& str = *i;
15734 -
15735 - if(!options_parsed)
15736 - {
15737 - options_parsed = determine_options(str, suppress_nl, enable_escapes);
15738 - }
15739 -
15740 - if(options_parsed)
15741 - {
15742 - if(enable_escapes)
15743 - {
15744 - for(; i != bash_args.end(); i++)
15745 - {
15746 - try
15747 - {
15748 - transform_escapes(*i, out_buffer());
15749 - }
15750 - catch(suppress_output)
15751 - {
15752 - return 0;
15753 - }
15754 - }
15755 - }
15756 - else
15757 - {
15758 - this->out_buffer() << karma::format(karma::string % ' ', std::vector<std::string>(i, bash_args.end()));
15759 - }
15760 -
15761 - if(!suppress_nl)
15762 - this->out_buffer() << std::endl;
15763 -
15764 - return 0;
15765 - }
15766 - }
15767 -
15768 - return 0;
15769 -}
15770 -
15771 -bool echo_builtin::determine_options(const std::string &string, bool &suppress_nl, bool &enable_escapes)
15772 -{
15773 - using phoenix::ref;
15774 - using qi::char_;
15775 -
15776 - bool n_matched = false, e_matched = false, E_matched = false;
15777 -
15778 - auto options = '-' >
15779 - +(
15780 - char_('n')[ref(n_matched) = true] |
15781 - char_('e')[ref(e_matched) = true, ref(E_matched) = false] |
15782 - char_('E')[ref(E_matched) = true, ref(e_matched) = false]
15783 - );
15784 -
15785 - auto first = string.begin();
15786 - qi::parse(first, string.end(), options);
15787 -
15788 - if(first != string.end()) {
15789 - return true;
15790 - }
15791 - else
15792 - {
15793 - if(n_matched)
15794 - suppress_nl = true;
15795 -
15796 - if(e_matched)
15797 - enable_escapes = true;
15798 -
15799 - if(E_matched)
15800 - enable_escapes = false;
15801 -
15802 - return false;
15803 - }
15804 -}
15805
15806 diff --git a/libbash-0.1/src/builtins/echo_builtin.h b/libbash-0.1/src/builtins/echo_builtin.h
15807 deleted file mode 100644
15808 index 3f5da62..0000000
15809 --- a/libbash-0.1/src/builtins/echo_builtin.h
15810 +++ /dev/null
15811 @@ -1,56 +0,0 @@
15812 -/*
15813 - Please use git log for copyright holder and year information
15814 -
15815 - This file is part of libbash.
15816 -
15817 - libbash is free software: you can redistribute it and/or modify
15818 - it under the terms of the GNU General Public License as published by
15819 - the Free Software Foundation, either version 2 of the License, or
15820 - (at your option) any later version.
15821 -
15822 - libbash is distributed in the hope that it will be useful,
15823 - but WITHOUT ANY WARRANTY; without even the implied warranty of
15824 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15825 - GNU General Public License for more details.
15826 -
15827 - You should have received a copy of the GNU General Public License
15828 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
15829 -*/
15830 -///
15831 -/// \file echo_builtin.h
15832 -/// \brief class that implements the echo builtin
15833 -///
15834 -
15835 -#ifndef LIBBASH_BUILTINS_ECHO_BUILTIN_H_
15836 -#define LIBBASH_BUILTINS_ECHO_BUILTIN_H_
15837 -
15838 -#include <cstdlib>
15839 -#include <iterator>
15840 -#include "../cppbash_builtin.h"
15841 -
15842 -///
15843 -/// \class echo_builtin
15844 -/// \brief the echo builtin for bash
15845 -///
15846 -class echo_builtin: public virtual cppbash_builtin
15847 -{
15848 - public:
15849 - BUILTIN_CONSTRUCTOR(echo)
15850 -
15851 - ///
15852 - /// \brief runs the echo plugin on the supplied arguments
15853 - /// \param bash_args the arguments to the echo builtin
15854 - /// \return exit status of echo
15855 - ///
15856 - virtual int exec(const std::vector<std::string>& bash_args);
15857 - private:
15858 - ///
15859 - /// \brief determines the options passed as arguments
15860 - /// \param string string to check for arguments
15861 - /// \param suppress_nl returns back whether to suppress newlines
15862 - /// \param enable_escapes returns back whether to enable escapes
15863 - /// \return false if all options have been processed
15864 - bool determine_options(const std::string &string, bool &suppress_nl, bool &enable_escapes);
15865 -};
15866 -
15867 -#endif
15868
15869 diff --git a/libbash-0.1/src/builtins/eval_builtin.cpp b/libbash-0.1/src/builtins/eval_builtin.cpp
15870 deleted file mode 100644
15871 index cf5d8fd..0000000
15872 --- a/libbash-0.1/src/builtins/eval_builtin.cpp
15873 +++ /dev/null
15874 @@ -1,38 +0,0 @@
15875 -/*
15876 - Please use git log for copyright holder and year information
15877 -
15878 - This file is part of libbash.
15879 -
15880 - libbash is free software: you can redistribute it and/or modify
15881 - it under the terms of the GNU General Public License as published by
15882 - the Free Software Foundation, either version 2 of the License, or
15883 - (at your option) any later version.
15884 -
15885 - libbash is distributed in the hope that it will be useful,
15886 - but WITHOUT ANY WARRANTY; without even the implied warranty of
15887 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15888 - GNU General Public License for more details.
15889 -
15890 - You should have received a copy of the GNU General Public License
15891 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
15892 -*/
15893 -///
15894 -/// \file eval_builtin.h
15895 -/// \brief class that implements the eval builtin
15896 -///
15897 -
15898 -#include "builtins/eval_builtin.h"
15899 -
15900 -#include <sstream>
15901 -
15902 -#include <boost/algorithm/string/join.hpp>
15903 -
15904 -#include "core/bash_ast.h"
15905 -#include "core/interpreter.h"
15906 -
15907 -int eval_builtin::exec(const std::vector<std::string>& bash_args)
15908 -{
15909 - std::stringstream script(boost::algorithm::join(bash_args, " "));
15910 - bash_ast(script).interpret_with(_walker);
15911 - return _walker.get_status();
15912 -}
15913
15914 diff --git a/libbash-0.1/src/builtins/eval_builtin.h b/libbash-0.1/src/builtins/eval_builtin.h
15915 deleted file mode 100644
15916 index ea2222c..0000000
15917 --- a/libbash-0.1/src/builtins/eval_builtin.h
15918 +++ /dev/null
15919 @@ -1,46 +0,0 @@
15920 -/*
15921 - Please use git log for copyright holder and year information
15922 -
15923 - This file is part of libbash.
15924 -
15925 - libbash is free software: you can redistribute it and/or modify
15926 - it under the terms of the GNU General Public License as published by
15927 - the Free Software Foundation, either version 2 of the License, or
15928 - (at your option) any later version.
15929 -
15930 - libbash is distributed in the hope that it will be useful,
15931 - but WITHOUT ANY WARRANTY; without even the implied warranty of
15932 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15933 - GNU General Public License for more details.
15934 -
15935 - You should have received a copy of the GNU General Public License
15936 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
15937 -*/
15938 -///
15939 -/// \file eval_builtin.h
15940 -/// \brief class that implements the eval builtin
15941 -///
15942 -
15943 -#ifndef LIBBASH_BUILTINS_eval_BUILTIN_H_
15944 -#define LIBBASH_BUILTINS_eval_BUILTIN_H_
15945 -
15946 -#include "cppbash_builtin.h"
15947 -
15948 -///
15949 -/// \class eval_builtin
15950 -/// \brief the eval builtin for bash
15951 -///
15952 -class eval_builtin: public virtual cppbash_builtin
15953 -{
15954 - public:
15955 - BUILTIN_CONSTRUCTOR(eval)
15956 -
15957 - ///
15958 - /// \brief runs the eval builtin on the supplied arguments
15959 - /// \param bash_args the arguments to the eval builtin
15960 - /// \return exit status of eval
15961 - ///
15962 - virtual int exec(const std::vector<std::string>& bash_args);
15963 -};
15964 -
15965 -#endif
15966
15967 diff --git a/libbash-0.1/src/builtins/inherit_builtin.cpp b/libbash-0.1/src/builtins/inherit_builtin.cpp
15968 deleted file mode 100644
15969 index 1490e5b..0000000
15970 --- a/libbash-0.1/src/builtins/inherit_builtin.cpp
15971 +++ /dev/null
15972 @@ -1,129 +0,0 @@
15973 -/*
15974 - Please use git log for copyright holder and year information
15975 -
15976 - This file is part of libbash.
15977 -
15978 - libbash is free software: you can redistribute it and/or modify
15979 - it under the terms of the GNU General Public License as published by
15980 - the Free Software Foundation, either version 2 of the License, or
15981 - (at your option) any later version.
15982 -
15983 - libbash is distributed in the hope that it will be useful,
15984 - but WITHOUT ANY WARRANTY; without even the implied warranty of
15985 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15986 - GNU General Public License for more details.
15987 -
15988 - You should have received a copy of the GNU General Public License
15989 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
15990 -*/
15991 -///
15992 -/// \file inherit_builtin.cpp
15993 -/// \brief class that implements the inherit builtin
15994 -///
15995 -
15996 -#include "builtins/inherit_builtin.h"
15997 -
15998 -#include <cstdlib>
15999 -
16000 -#include <string>
16001 -
16002 -#include "core/interpreter.h"
16003 -
16004 -inline void inherit_builtin::append_global(const std::string& name)
16005 -{
16006 - if(!_walker.is_unset_or_null(name, 0))
16007 - _walker.set_value("E_" + name, _walker.resolve<std::string>("E_" + name) + " " + _walker.resolve<std::string>(name));
16008 -}
16009 -
16010 -inline void inherit_builtin::restore_global(const std::string& name, const std::string& value)
16011 -{
16012 - if(value != "")
16013 - _walker.set_value(name, value);
16014 - else
16015 - _walker.unset(name);
16016 -}
16017 -
16018 -inline void inherit_builtin::backup_global(const std::string& name, std::string& value)
16019 -{
16020 - value = _walker.resolve<std::string>(name);
16021 - _walker.unset(name);
16022 -}
16023 -
16024 -inline bool inherit_builtin::hasq(const std::string& value, const std::string& name)
16025 -{
16026 - const std::string& target = _walker.resolve<std::string>(name);
16027 - return target.find(value) != std::string::npos;
16028 -}
16029 -
16030 -// We do not support any QA warning
16031 -int inherit_builtin::exec(const std::vector<std::string>& bash_args)
16032 -{
16033 - _walker.set_value("ECLASS_DEPTH", _walker.resolve<long>("ECLASS_DEPTH") + 1);
16034 -
16035 - // find eclass directory
16036 - std::string eclassdir;
16037 - if(getenv("ECLASSDIR"))
16038 - eclassdir = getenv("ECLASSDIR") + std::string("/");
16039 - else
16040 - eclassdir = "/usr/portage/eclass/";
16041 -
16042 - std::string location;
16043 - std::string export_funcs_var;
16044 - // These variables must be restored before returning
16045 - std::string PECLASS(_walker.resolve<std::string>("ECLASS"));
16046 - std::string prev_export_funcs_var(_walker.resolve<std::string>("__export_funcs_var"));
16047 -
16048 - std::string B_IUSE;
16049 - std::string B_REQUIRED_USE;
16050 - std::string B_DEPEND;
16051 - std::string B_RDEPEND;
16052 - std::string B_PDEPEND;
16053 -
16054 - for(auto iter = bash_args.begin(); iter != bash_args.end(); ++iter)
16055 - {
16056 - location = eclassdir + *iter + ".eclass";
16057 - _walker.set_value("ECLASS", *iter);
16058 - export_funcs_var = "__export_functions_" + _walker.resolve<std::string>("ECLASS_DEPTH");
16059 - _walker.unset(export_funcs_var);
16060 -
16061 - // Portage implementation performs actions for overlays here but we don't do it for now
16062 -
16063 - backup_global("IUSE", B_IUSE);
16064 - backup_global("REQUIRED_USE", B_REQUIRED_USE);
16065 - backup_global("DEPEND", B_DEPEND);
16066 - backup_global("RDEPEND", B_RDEPEND);
16067 - backup_global("PDEPEND", B_PDEPEND);
16068 -
16069 - _walker.execute_builtin("source", {location});
16070 -
16071 - append_global("IUSE");
16072 - append_global("REQUIRED_USE");
16073 - append_global("DEPEND");
16074 - append_global("RDEPEND");
16075 - append_global("PDEPEND");
16076 -
16077 - restore_global("IUSE", B_IUSE);
16078 - restore_global("REQUIRED_USE", B_REQUIRED_USE);
16079 - restore_global("DEPEND", B_DEPEND);
16080 - restore_global("RDEPEND", B_RDEPEND);
16081 - restore_global("PDEPEND", B_PDEPEND);
16082 -
16083 - // Portage implementation exports functions here but we don't do it for now
16084 -
16085 - if(!hasq(*iter, "INHERITED"))
16086 - _walker.set_value("INHERITED", _walker.resolve<std::string>("INHERITED") + " " + *iter);
16087 - }
16088 -
16089 - _walker.set_value("ECLASS_DEPTH", _walker.resolve<long>("ECLASS_DEPTH") - 1);
16090 - if(_walker.resolve<long>("ECLASS_DEPTH") > 0)
16091 - {
16092 - _walker.set_value("ECLASS", PECLASS);
16093 - }
16094 - else
16095 - {
16096 - _walker.unset("ECLASS");
16097 - _walker.unset("__export_funcs_var");
16098 - }
16099 -
16100 - return 0;
16101 -}
16102
16103 diff --git a/libbash-0.1/src/builtins/inherit_builtin.h b/libbash-0.1/src/builtins/inherit_builtin.h
16104 deleted file mode 100644
16105 index 0e7f6ef..0000000
16106 --- a/libbash-0.1/src/builtins/inherit_builtin.h
16107 +++ /dev/null
16108 @@ -1,54 +0,0 @@
16109 -/*
16110 - Please use git log for copyright holder and year information
16111 -
16112 - This file is part of libbash.
16113 -
16114 - libbash is free software: you can redistribute it and/or modify
16115 - it under the terms of the GNU General Public License as published by
16116 - the Free Software Foundation, either version 2 of the License, or
16117 - (at your option) any later version.
16118 -
16119 - libbash is distributed in the hope that it will be useful,
16120 - but WITHOUT ANY WARRANTY; without even the implied warranty of
16121 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16122 - GNU General Public License for more details.
16123 -
16124 - You should have received a copy of the GNU General Public License
16125 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
16126 -*/
16127 -///
16128 -/// \file inherit_builtin.h
16129 -/// \brief class that implements the inherit function from Portage
16130 -///
16131 -
16132 -#ifndef LIBBASH_BUILTINS_INHERIT_BUILTIN_H_
16133 -#define LIBBASH_BUILTINS_INHERIT_BUILTIN_H_
16134 -
16135 -#include "cppbash_builtin.h"
16136 -
16137 -///
16138 -/// \class inherit
16139 -/// \brief the inherit builtin for bash
16140 -///
16141 -class inherit_builtin: public virtual cppbash_builtin
16142 -{
16143 - public:
16144 - BUILTIN_CONSTRUCTOR(inherit)
16145 -
16146 - ///
16147 - /// \brief runs the inherit builtin on the supplied arguments
16148 - /// \param bash_args the arguments to the inherit builtin
16149 - /// \return exit status of inherit
16150 - ///
16151 - virtual int exec(const std::vector<std::string>& bash_args);
16152 - private:
16153 - void append_global(const std::string& name);
16154 -
16155 - void backup_global(const std::string& name, std::string& value);
16156 -
16157 - void restore_global(const std::string& name, const std::string& value);
16158 -
16159 - bool hasq(const std::string& value, const std::string& name);
16160 -};
16161 -
16162 -#endif
16163
16164 diff --git a/libbash-0.1/src/builtins/let_builtin.cpp b/libbash-0.1/src/builtins/let_builtin.cpp
16165 deleted file mode 100644
16166 index 2e731fe..0000000
16167 --- a/libbash-0.1/src/builtins/let_builtin.cpp
16168 +++ /dev/null
16169 @@ -1,37 +0,0 @@
16170 -/*
16171 - Please use git log for copyright holder and year information
16172 -
16173 - This file is part of libbash.
16174 -
16175 - libbash is free software: you can redistribute it and/or modify
16176 - it under the terms of the GNU General Public License as published by
16177 - the Free Software Foundation, either version 2 of the License, or
16178 - (at your option) any later version.
16179 -
16180 - libbash is distributed in the hope that it will be useful,
16181 - but WITHOUT ANY WARRANTY; without even the implied warranty of
16182 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16183 - GNU General Public License for more details.
16184 -
16185 - You should have received a copy of the GNU General Public License
16186 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
16187 -*/
16188 -///
16189 -/// \file let_builtin.h
16190 -/// \brief implementation for the let builtin
16191 -///
16192 -#include "builtins/let_builtin.h"
16193 -
16194 -#include <sstream>
16195 -
16196 -#include <boost/algorithm/string/join.hpp>
16197 -
16198 -#include "core/interpreter.h"
16199 -
16200 -int let_builtin::exec(const std::vector<std::string>& bash_args)
16201 -{
16202 - std::string expression(boost::algorithm::join(bash_args, " "));
16203 - _walker.eval_arithmetic(expression);
16204 -
16205 - return 0;
16206 -}
16207
16208 diff --git a/libbash-0.1/src/builtins/let_builtin.h b/libbash-0.1/src/builtins/let_builtin.h
16209 deleted file mode 100644
16210 index 9dba7d6..0000000
16211 --- a/libbash-0.1/src/builtins/let_builtin.h
16212 +++ /dev/null
16213 @@ -1,35 +0,0 @@
16214 -/*
16215 - Please use git log for copyright holder and year information
16216 -
16217 - This file is part of libbash.
16218 -
16219 - libbash is free software: you can redistribute it and/or modify
16220 - it under the terms of the GNU General Public License as published by
16221 - the Free Software Foundation, either version 2 of the License, or
16222 - (at your option) any later version.
16223 -
16224 - libbash is distributed in the hope that it will be useful,
16225 - but WITHOUT ANY WARRANTY; without even the implied warranty of
16226 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16227 - GNU General Public License for more details.
16228 -
16229 - You should have received a copy of the GNU General Public License
16230 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
16231 -*/
16232 -///
16233 -/// \file let_builtin.h
16234 -/// \brief implementation for the let builtin
16235 -///
16236 -#ifndef LIBBASH_BUILTINS_LET_BUILTIN_H_
16237 -#define LIBBASH_BUILTINS_LET_BUILTIN_H_
16238 -
16239 -#include "cppbash_builtin.h"
16240 -
16241 -class let_builtin : public virtual cppbash_builtin
16242 -{
16243 -public:
16244 - BUILTIN_CONSTRUCTOR(let)
16245 - virtual int exec(const std::vector<std::string>& );
16246 -};
16247 -
16248 -#endif
16249
16250 diff --git a/libbash-0.1/src/builtins/printf_builtin.cpp b/libbash-0.1/src/builtins/printf_builtin.cpp
16251 deleted file mode 100644
16252 index 9b5fd41..0000000
16253 --- a/libbash-0.1/src/builtins/printf_builtin.cpp
16254 +++ /dev/null
16255 @@ -1,63 +0,0 @@
16256 -/*
16257 - Please use git log for copyright holder and year information
16258 -
16259 - This file is part of libbash.
16260 -
16261 - libbash is free software: you can redistribute it and/or modify
16262 - it under the terms of the GNU General Public License as published by
16263 - the Free Software Foundation, either version 2 of the License, or
16264 - (at your option) any later version.
16265 -
16266 - libbash is distributed in the hope that it will be useful,
16267 - but WITHOUT ANY WARRANTY; without even the implied warranty of
16268 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16269 - GNU General Public License for more details.
16270 -
16271 - You should have received a copy of the GNU General Public License
16272 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
16273 -*/
16274 -///
16275 -/// \file printf_builtin.h
16276 -/// \brief implementation for the printf builtin
16277 -///
16278 -
16279 -#include "builtins/printf_builtin.h"
16280 -
16281 -#include <boost/format.hpp>
16282 -
16283 -#include "core/interpreter.h"
16284 -#include "cppbash_builtin.h"
16285 -
16286 -int printf_builtin::exec(const std::vector<std::string>& bash_args)
16287 -{
16288 - std::vector<std::string>::const_iterator begin;
16289 - if(!(bash_args[0] == "-v"))
16290 - begin = bash_args.begin();
16291 - else if(bash_args.size() < 3)
16292 - throw libbash::illegal_argument_exception("printf: illegal number of arguments");
16293 - else
16294 - begin = bash_args.begin() + 2;
16295 -
16296 - std::stringstream format_string;
16297 - transform_escapes(*begin, format_string);
16298 - boost::format formatter(format_string.str());
16299 - for(auto iter = begin + 1; iter != bash_args.end(); ++iter)
16300 - formatter = formatter % *iter;
16301 -
16302 - if(!(bash_args[0][0] == '-'))
16303 - {
16304 - *_out_stream << formatter;
16305 - }
16306 - else if(bash_args[0] == "-v")
16307 - {
16308 - std::stringstream output;
16309 - output << formatter;
16310 - _walker.set_value(bash_args[1], output.str());
16311 - }
16312 - else
16313 - {
16314 - throw libbash::illegal_argument_exception("printf: invalid option: " + bash_args[0]);
16315 - }
16316 -
16317 - return 0;
16318 -}
16319
16320 diff --git a/libbash-0.1/src/builtins/printf_builtin.h b/libbash-0.1/src/builtins/printf_builtin.h
16321 deleted file mode 100644
16322 index 07d5ac7..0000000
16323 --- a/libbash-0.1/src/builtins/printf_builtin.h
16324 +++ /dev/null
16325 @@ -1,35 +0,0 @@
16326 -/*
16327 - Please use git log for copyright holder and year information
16328 -
16329 - This file is part of libbash.
16330 -
16331 - libbash is free software: you can redistribute it and/or modify
16332 - it under the terms of the GNU General Public License as published by
16333 - the Free Software Foundation, either version 2 of the License, or
16334 - (at your option) any later version.
16335 -
16336 - libbash is distributed in the hope that it will be useful,
16337 - but WITHOUT ANY WARRANTY; without even the implied warranty of
16338 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16339 - GNU General Public License for more details.
16340 -
16341 - You should have received a copy of the GNU General Public License
16342 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
16343 -*/
16344 -///
16345 -/// \file printf_builtin.h
16346 -/// \brief implementation for the printf builtin
16347 -///
16348 -#ifndef LIBBASH_BUILTINS_printf_BUILTIN_H_
16349 -#define LIBBASH_BUILTINS_printf_BUILTIN_H_
16350 -
16351 -#include "cppbash_builtin.h"
16352 -
16353 -class printf_builtin : public virtual cppbash_builtin
16354 -{
16355 -public:
16356 - BUILTIN_CONSTRUCTOR(printf)
16357 - virtual int exec(const std::vector<std::string>& );
16358 -};
16359 -
16360 -#endif
16361
16362 diff --git a/libbash-0.1/src/builtins/return_builtin.cpp b/libbash-0.1/src/builtins/return_builtin.cpp
16363 deleted file mode 100644
16364 index 068467c..0000000
16365 --- a/libbash-0.1/src/builtins/return_builtin.cpp
16366 +++ /dev/null
16367 @@ -1,38 +0,0 @@
16368 -/*
16369 - Please use git log for copyright holder and year information
16370 -
16371 - This file is part of libbash.
16372 -
16373 - libbash is free software: you can redistribute it and/or modify
16374 - it under the terms of the GNU General Public License as published by
16375 - the Free Software Foundation, either version 2 of the License, or
16376 - (at your option) any later version.
16377 -
16378 - libbash is distributed in the hope that it will be useful,
16379 - but WITHOUT ANY WARRANTY; without even the implied warranty of
16380 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16381 - GNU General Public License for more details.
16382 -
16383 - You should have received a copy of the GNU General Public License
16384 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
16385 -*/
16386 -///
16387 -/// \file return_builtin.h
16388 -/// \brief implementation for the return builtin
16389 -///
16390 -
16391 -#include "builtins/return_builtin.h"
16392 -
16393 -#include "builtins/builtin_exceptions.h"
16394 -#include "core/interpreter.h"
16395 -#include "cppbash_builtin.h"
16396 -
16397 -int return_builtin::exec(const std::vector<std::string>& bash_args)
16398 -{
16399 - if(bash_args.size() > 1)
16400 - throw libbash::illegal_argument_exception("return: too many arguments");
16401 - else if(bash_args.size() == 1)
16402 - _walker.set_status(boost::lexical_cast<int>(bash_args[0]));
16403 -
16404 - throw return_exception();
16405 -}
16406
16407 diff --git a/libbash-0.1/src/builtins/return_builtin.h b/libbash-0.1/src/builtins/return_builtin.h
16408 deleted file mode 100644
16409 index 54663c2..0000000
16410 --- a/libbash-0.1/src/builtins/return_builtin.h
16411 +++ /dev/null
16412 @@ -1,35 +0,0 @@
16413 -/*
16414 - Please use git log for copyright holder and year information
16415 -
16416 - This file is part of libbash.
16417 -
16418 - libbash is free software: you can redistribute it and/or modify
16419 - it under the terms of the GNU General Public License as published by
16420 - the Free Software Foundation, either version 2 of the License, or
16421 - (at your option) any later version.
16422 -
16423 - libbash is distributed in the hope that it will be useful,
16424 - but WITHOUT ANY WARRANTY; without even the implied warranty of
16425 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16426 - GNU General Public License for more details.
16427 -
16428 - You should have received a copy of the GNU General Public License
16429 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
16430 -*/
16431 -///
16432 -/// \file return_builtin.h
16433 -/// \brief implementation for the return builtin
16434 -///
16435 -#ifndef LIBBASH_BUILTINS_RETURN_BUILTIN_H_
16436 -#define LIBBASH_BUILTINS_RETURN_BUILTIN_H_
16437 -
16438 -#include "cppbash_builtin.h"
16439 -
16440 -class return_builtin : public virtual cppbash_builtin
16441 -{
16442 -public:
16443 - BUILTIN_CONSTRUCTOR(return)
16444 - virtual int exec(const std::vector<std::string>& );
16445 -};
16446 -
16447 -#endif
16448
16449 diff --git a/libbash-0.1/src/builtins/shopt_builtin.cpp b/libbash-0.1/src/builtins/shopt_builtin.cpp
16450 deleted file mode 100644
16451 index f55c49e..0000000
16452 --- a/libbash-0.1/src/builtins/shopt_builtin.cpp
16453 +++ /dev/null
16454 @@ -1,68 +0,0 @@
16455 -/*
16456 - Please use git log for copyright holder and year information
16457 -
16458 - This file is part of libbash.
16459 -
16460 - libbash is free software: you can redistribute it and/or modify
16461 - it under the terms of the GNU General Public License as published by
16462 - the Free Software Foundation, either version 2 of the License, or
16463 - (at your option) any later version.
16464 -
16465 - libbash is distributed in the hope that it will be useful,
16466 - but WITHOUT ANY WARRANTY; without even the implied warranty of
16467 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16468 - GNU General Public License for more details.
16469 -
16470 - You should have received a copy of the GNU General Public License
16471 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
16472 -*/
16473 -///
16474 -/// \file shopt_builtin.cpp
16475 -/// \brief implementation for the shopt builtin
16476 -///
16477 -
16478 -#include "builtins/shopt_builtin.h"
16479 -
16480 -#include "core/exceptions.h"
16481 -#include "core/interpreter.h"
16482 -#include "cppbash_builtin.h"
16483 -
16484 -void shopt_builtin::set_opt(const std::vector<std::string>& bash_args, bool value)
16485 -{
16486 - for(auto iter = bash_args.begin() + 1; iter != bash_args.end(); ++iter)
16487 - _walker.set_additional_option(*iter, value);
16488 -}
16489 -
16490 -void shopt_builtin::print_opts() const
16491 -{
16492 - for(auto iter = _walker.additional_options_begin(); iter != _walker.additional_options_end(); ++iter)
16493 - *_out_stream << "shopt " << (iter->second ? "-s " : "-u ") << iter->first << std::endl;
16494 -}
16495 -
16496 -int shopt_builtin::exec(const std::vector<std::string>& bash_args)
16497 -{
16498 - if(bash_args.empty())
16499 - throw libbash::illegal_argument_exception("Arguments required for shopt");
16500 - else if(bash_args[0].size() != 2)
16501 - throw libbash::unsupported_exception("Multiple arguments are not supported");
16502 -
16503 - switch(bash_args[0][1])
16504 - {
16505 - case 'u':
16506 - set_opt(bash_args, false);
16507 - break;
16508 - case 's':
16509 - set_opt(bash_args, true);
16510 - break;
16511 - case 'p':
16512 - print_opts();
16513 - break;
16514 - case 'q':
16515 - case 'o':
16516 - throw libbash::unsupported_exception("shopt " + bash_args[0] + " is not supported yet");
16517 - default:
16518 - throw libbash::illegal_argument_exception("Unrecognized option for shopt: " + bash_args[0]);
16519 - }
16520 -
16521 - return 0;
16522 -}
16523
16524 diff --git a/libbash-0.1/src/builtins/shopt_builtin.h b/libbash-0.1/src/builtins/shopt_builtin.h
16525 deleted file mode 100644
16526 index 2b1f766..0000000
16527 --- a/libbash-0.1/src/builtins/shopt_builtin.h
16528 +++ /dev/null
16529 @@ -1,37 +0,0 @@
16530 -/*
16531 - Please use git log for copyright holder and year information
16532 -
16533 - This file is part of libbash.
16534 -
16535 - libbash is free software: you can redistribute it and/or modify
16536 - it under the terms of the GNU General Public License as published by
16537 - the Free Software Foundation, either version 2 of the License, or
16538 - (at your option) any later version.
16539 -
16540 - libbash is distributed in the hope that it will be useful,
16541 - but WITHOUT ANY WARRANTY; without even the implied warranty of
16542 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16543 - GNU General Public License for more details.
16544 -
16545 - You should have received a copy of the GNU General Public License
16546 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
16547 -*/
16548 -///
16549 -/// \file shopt_builtin.h
16550 -/// \brief implementation for the shopt builtin
16551 -///
16552 -#ifndef LIBBASH_BUILTINS_SHOPT_BUILTIN_H_
16553 -#define LIBBASH_BUILTINS_SHOPT_BUILTIN_H_
16554 -
16555 -#include "cppbash_builtin.h"
16556 -
16557 -class shopt_builtin : public virtual cppbash_builtin
16558 -{
16559 - void set_opt(const std::vector<std::string>& bash_args, bool value);
16560 - void print_opts() const;
16561 -public:
16562 - BUILTIN_CONSTRUCTOR(shopt)
16563 - virtual int exec(const std::vector<std::string>& );
16564 -};
16565 -
16566 -#endif
16567
16568 diff --git a/libbash-0.1/src/builtins/source_builtin.cpp b/libbash-0.1/src/builtins/source_builtin.cpp
16569 deleted file mode 100644
16570 index bec83ad..0000000
16571 --- a/libbash-0.1/src/builtins/source_builtin.cpp
16572 +++ /dev/null
16573 @@ -1,72 +0,0 @@
16574 -/*
16575 - Please use git log for copyright holder and year information
16576 -
16577 - This file is part of libbash.
16578 -
16579 - libbash is free software: you can redistribute it and/or modify
16580 - it under the terms of the GNU General Public License as published by
16581 - the Free Software Foundation, either version 2 of the License, or
16582 - (at your option) any later version.
16583 -
16584 - libbash is distributed in the hope that it will be useful,
16585 - but WITHOUT ANY WARRANTY; without even the implied warranty of
16586 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16587 - GNU General Public License for more details.
16588 -
16589 - You should have received a copy of the GNU General Public License
16590 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
16591 -*/
16592 -///
16593 -/// \file source_builtin.h
16594 -/// \brief class that implements the source builtin
16595 -///
16596 -
16597 -#include "builtins/source_builtin.h"
16598 -
16599 -#include <fstream>
16600 -#include <iostream>
16601 -#include <string>
16602 -#include <unordered_map>
16603 -
16604 -#include "builtins/builtin_exceptions.h"
16605 -#include "cppbash_builtin.h"
16606 -#include "core/exceptions.h"
16607 -#include "core/interpreter.h"
16608 -#include "core/bash_ast.h"
16609 -
16610 -int source_builtin::exec(const std::vector<std::string>& bash_args)
16611 -{
16612 - static std::unordered_map<std::string, std::shared_ptr<bash_ast>> ast_cache;
16613 -
16614 - if(bash_args.size() == 0)
16615 - throw libbash::illegal_argument_exception("should provide one argument for source builtin");
16616 -
16617 - // we need fix this to pass extra arguments as positional parameters
16618 - const std::string& path = bash_args[0];
16619 -
16620 - auto stored_ast = ast_cache.find(path);
16621 - if(stored_ast == ast_cache.end())
16622 - {
16623 - // ensure the path is cached
16624 - auto iter = ast_cache.insert(make_pair(path, std::shared_ptr<bash_ast>()));
16625 - // this may throw exception
16626 - iter.first->second.reset(new bash_ast(path));
16627 - stored_ast = iter.first;
16628 - }
16629 - else if(!(stored_ast->second))
16630 - {
16631 - throw libbash::parse_exception(path + " cannot be fully parsed");
16632 - }
16633 -
16634 - const std::string& original_path = _walker.resolve<std::string>("0");
16635 - try
16636 - {
16637 - _walker.define("0", path, true);
16638 - stored_ast->second->interpret_with(_walker);
16639 - }
16640 - catch(return_exception& e) {}
16641 -
16642 - _walker.define("0", original_path, true);
16643 -
16644 - return _walker.get_status();
16645 -}
16646
16647 diff --git a/libbash-0.1/src/builtins/source_builtin.h b/libbash-0.1/src/builtins/source_builtin.h
16648 deleted file mode 100644
16649 index d599824..0000000
16650 --- a/libbash-0.1/src/builtins/source_builtin.h
16651 +++ /dev/null
16652 @@ -1,46 +0,0 @@
16653 -/*
16654 - Please use git log for copyright holder and year information
16655 -
16656 - This file is part of libbash.
16657 -
16658 - libbash is free software: you can redistribute it and/or modify
16659 - it under the terms of the GNU General Public License as published by
16660 - the Free Software Foundation, either version 2 of the License, or
16661 - (at your option) any later version.
16662 -
16663 - libbash is distributed in the hope that it will be useful,
16664 - but WITHOUT ANY WARRANTY; without even the implied warranty of
16665 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16666 - GNU General Public License for more details.
16667 -
16668 - You should have received a copy of the GNU General Public License
16669 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
16670 -*/
16671 -///
16672 -/// \file source_builtin.h
16673 -/// \brief class that implements the source builtin
16674 -///
16675 -
16676 -#ifndef LIBBASH_BUILTINS_SOURCE_BUILTIN_H_
16677 -#define LIBBASH_BUILTINS_SOURCE_BUILTIN_H_
16678 -
16679 -#include "cppbash_builtin.h"
16680 -
16681 -///
16682 -/// \class source_builtin
16683 -/// \brief the source builtin for bash
16684 -///
16685 -class source_builtin: public virtual cppbash_builtin
16686 -{
16687 - public:
16688 - BUILTIN_CONSTRUCTOR(source)
16689 -
16690 - ///
16691 - /// \brief runs the source builtin on the supplied arguments
16692 - /// \param bash_args the arguments to the source builtin
16693 - /// \return exit status of source
16694 - ///
16695 - virtual int exec(const std::vector<std::string>& bash_args);
16696 -};
16697 -
16698 -#endif
16699
16700 diff --git a/libbash-0.1/src/builtins/tests/boolean_tests.cpp b/libbash-0.1/src/builtins/tests/boolean_tests.cpp
16701 deleted file mode 100644
16702 index 4c9616b..0000000
16703 --- a/libbash-0.1/src/builtins/tests/boolean_tests.cpp
16704 +++ /dev/null
16705 @@ -1,44 +0,0 @@
16706 -/*
16707 - Please use git log for copyright holder and year information
16708 -
16709 - This file is part of libbash.
16710 -
16711 - libbash is free software: you can redistribute it and/or modify
16712 - it under the terms of the GNU General Public License as published by
16713 - the Free Software Foundation, either version 2 of the License, or
16714 - (at your option) any later version.
16715 -
16716 - libbash is distributed in the hope that it will be useful,
16717 - but WITHOUT ANY WARRANTY; without even the implied warranty of
16718 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16719 - GNU General Public License for more details.
16720 -
16721 - You should have received a copy of the GNU General Public License
16722 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
16723 -*/
16724 -///
16725 -/// \file echo_tests.cpp
16726 -/// \brief series of unit tests for echo built in
16727 -///
16728 -#include <iostream>
16729 -
16730 -#include <gtest/gtest.h>
16731 -
16732 -#include "core/interpreter.h"
16733 -#include "cppbash_builtin.h"
16734 -
16735 -using namespace std;
16736 -
16737 -TEST(boolean_builtin_test, true)
16738 -{
16739 - interpreter walker;
16740 - int result = cppbash_builtin::exec("true", {}, std::cout, std::cerr, std::cin, walker);
16741 - ASSERT_EQ(0, result);
16742 -}
16743 -
16744 -TEST(boolean_builtin_test, false)
16745 -{
16746 - interpreter walker;
16747 - int result = cppbash_builtin::exec("false", {}, std::cout, std::cerr, std::cin, walker);
16748 - ASSERT_EQ(1, result);
16749 -}
16750
16751 diff --git a/libbash-0.1/src/builtins/tests/break_tests.cpp b/libbash-0.1/src/builtins/tests/break_tests.cpp
16752 deleted file mode 100644
16753 index eba422e..0000000
16754 --- a/libbash-0.1/src/builtins/tests/break_tests.cpp
16755 +++ /dev/null
16756 @@ -1,69 +0,0 @@
16757 -/*
16758 - Please use git log for copyright holder and year information
16759 -
16760 - This file is part of libbash.
16761 -
16762 - libbash is free software: you can redistribute it and/or modify
16763 - it under the terms of the GNU General Public License as published by
16764 - the Free Software Foundation, either version 2 of the License, or
16765 - (at your option) any later version.
16766 -
16767 - libbash is distributed in the hope that it will be useful,
16768 - but WITHOUT ANY WARRANTY; without even the implied warranty of
16769 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16770 - GNU General Public License for more details.
16771 -
16772 - You should have received a copy of the GNU General Public License
16773 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
16774 -*/
16775 -///
16776 -/// \file break_tests.cpp
16777 -/// \brief series of unit tests for break builtin
16778 -///
16779 -#include <boost/lexical_cast.hpp>
16780 -#include <gtest/gtest.h>
16781 -
16782 -#include "builtins/builtin_exceptions.h"
16783 -#include "core/interpreter.h"
16784 -#include "cppbash_builtin.h"
16785 -
16786 -TEST(break_builtin_test, bad_argument)
16787 -{
16788 - interpreter walker;
16789 - EXPECT_THROW(cppbash_builtin::exec("break", {"abc"}, std::cout, std::cerr, std::cin, walker), libbash::interpreter_exception);
16790 - EXPECT_THROW(cppbash_builtin::exec("break", {"1", "2"}, std::cout, std::cerr, std::cin, walker), libbash::interpreter_exception);
16791 - EXPECT_THROW(cppbash_builtin::exec("break", {"0"}, std::cout, std::cerr, std::cin, walker), libbash::interpreter_exception);
16792 - EXPECT_THROW(cppbash_builtin::exec("break", {"-1"}, std::cout, std::cerr, std::cin, walker), libbash::interpreter_exception);
16793 -}
16794 -
16795 -TEST(break_builtin_test, throw_exception)
16796 -{
16797 - interpreter walker;
16798 - try
16799 - {
16800 - cppbash_builtin::exec("break", {}, std::cout, std::cerr, std::cin, walker);
16801 - FAIL();
16802 - }
16803 - catch(break_exception& e)
16804 - {
16805 - EXPECT_NO_THROW(e.rethrow_unless_correct_frame());
16806 - }
16807 -
16808 - try
16809 - {
16810 - cppbash_builtin::exec("break", {"2"}, std::cout, std::cerr, std::cin, walker);
16811 - FAIL();
16812 - }
16813 - catch(break_exception& e)
16814 - {
16815 - try
16816 - {
16817 - e.rethrow_unless_correct_frame();
16818 - FAIL();
16819 - }
16820 - catch(break_exception& e)
16821 - {
16822 - EXPECT_NO_THROW(e.rethrow_unless_correct_frame());
16823 - }
16824 - }
16825 -}
16826
16827 diff --git a/libbash-0.1/src/builtins/tests/continue_tests.cpp b/libbash-0.1/src/builtins/tests/continue_tests.cpp
16828 deleted file mode 100644
16829 index c753291..0000000
16830 --- a/libbash-0.1/src/builtins/tests/continue_tests.cpp
16831 +++ /dev/null
16832 @@ -1,69 +0,0 @@
16833 -/*
16834 - Please use git log for copyright holder and year information
16835 -
16836 - This file is part of libbash.
16837 -
16838 - libbash is free software: you can redistribute it and/or modify
16839 - it under the terms of the GNU General Public License as published by
16840 - the Free Software Foundation, either version 2 of the License, or
16841 - (at your option) any later version.
16842 -
16843 - libbash is distributed in the hope that it will be useful,
16844 - but WITHOUT ANY WARRANTY; without even the implied warranty of
16845 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16846 - GNU General Public License for more details.
16847 -
16848 - You should have received a copy of the GNU General Public License
16849 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
16850 -*/
16851 -///
16852 -/// \file continue_tests.cpp
16853 -/// \brief series of unit tests for continue builtin
16854 -///
16855 -#include <boost/lexical_cast.hpp>
16856 -#include <gtest/gtest.h>
16857 -
16858 -#include "builtins/builtin_exceptions.h"
16859 -#include "core/interpreter.h"
16860 -#include "cppbash_builtin.h"
16861 -
16862 -TEST(continue_builtin_test, bad_argument)
16863 -{
16864 - interpreter walker;
16865 - EXPECT_THROW(cppbash_builtin::exec("continue", {"abc"}, std::cout, std::cerr, std::cin, walker), libbash::illegal_argument_exception);
16866 - EXPECT_THROW(cppbash_builtin::exec("continue", {"1", "2"}, std::cout, std::cerr, std::cin, walker), libbash::illegal_argument_exception);
16867 - EXPECT_THROW(cppbash_builtin::exec("continue", {"0"}, std::cout, std::cerr, std::cin, walker), libbash::illegal_argument_exception);
16868 - EXPECT_THROW(cppbash_builtin::exec("continue", {"-1"}, std::cout, std::cerr, std::cin, walker), libbash::illegal_argument_exception);
16869 -}
16870 -
16871 -TEST(continue_builtin_test, throw_exception)
16872 -{
16873 - interpreter walker;
16874 - try
16875 - {
16876 - cppbash_builtin::exec("continue", {}, std::cout, std::cerr, std::cin, walker);
16877 - FAIL();
16878 - }
16879 - catch(continue_exception& e)
16880 - {
16881 - EXPECT_NO_THROW(e.rethrow_unless_correct_frame());
16882 - }
16883 -
16884 - try
16885 - {
16886 - cppbash_builtin::exec("continue", {"2"}, std::cout, std::cerr, std::cin, walker);
16887 - FAIL();
16888 - }
16889 - catch(continue_exception& e)
16890 - {
16891 - try
16892 - {
16893 - e.rethrow_unless_correct_frame();
16894 - FAIL();
16895 - }
16896 - catch(continue_exception& e)
16897 - {
16898 - EXPECT_NO_THROW(e.rethrow_unless_correct_frame());
16899 - }
16900 - }
16901 -}
16902
16903 diff --git a/libbash-0.1/src/builtins/tests/declare_tests.cpp b/libbash-0.1/src/builtins/tests/declare_tests.cpp
16904 deleted file mode 100644
16905 index 95f4b61..0000000
16906 --- a/libbash-0.1/src/builtins/tests/declare_tests.cpp
16907 +++ /dev/null
16908 @@ -1,121 +0,0 @@
16909 -/*
16910 - Please use git log for copyright holder and year information
16911 -
16912 - This file is part of libbash.
16913 -
16914 - libbash is free software: you can redistribute it and/or modify
16915 - it under the terms of the GNU General Public License as published by
16916 - the Free Software Foundation, either version 2 of the License, or
16917 - (at your option) any later version.
16918 -
16919 - libbash is distributed in the hope that it will be useful,
16920 - but WITHOUT ANY WARRANTY; without even the implied warranty of
16921 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16922 - GNU General Public License for more details.
16923 -
16924 - You should have received a copy of the GNU General Public License
16925 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
16926 -*/
16927 -///
16928 -/// \file declare_tests.cpp
16929 -/// \brief series of unit tests for declare built in
16930 -///
16931 -#include <iostream>
16932 -#include <sstream>
16933 -#include <vector>
16934 -
16935 -#include <gtest/gtest.h>
16936 -
16937 -#include "core/bash_ast.h"
16938 -#include "core/exceptions.h"
16939 -#include "core/interpreter.h"
16940 -#include "cppbash_builtin.h"
16941 -
16942 -using namespace std;
16943 -
16944 -namespace
16945 -{
16946 - template <typename T>
16947 - void test_declare(const string& expected, std::initializer_list<string> args)
16948 - {
16949 - stringstream test_output;
16950 - interpreter walker;
16951 - try
16952 - {
16953 - cppbash_builtin::exec("declare",args,cout,test_output,cin,walker);
16954 - FAIL();
16955 - }
16956 - catch(T& e)
16957 - {
16958 - EXPECT_EQ(expected, e.what());
16959 - }
16960 - }
16961 -}
16962 -
16963 -TEST(declare_builtin_test, invalid_arguments)
16964 -{
16965 - test_declare<libbash::illegal_argument_exception>("Arguments required for declare", {});
16966 - test_declare<libbash::unsupported_exception>("Multiple arguments are not supported", {"-ap"});
16967 - test_declare<libbash::illegal_argument_exception>("Invalid option for declare builtin", {"_a"});
16968 - test_declare<libbash::illegal_argument_exception>("Unrecognized option for declare: -L", {"-L"});
16969 -}
16970 -
16971 -TEST(declare_builtin_test, _F)
16972 -{
16973 - stringstream expression("function foo() { :; }; function bar() { :; }");
16974 - interpreter walker;
16975 - bash_ast ast(expression);
16976 - ast.interpret_with(walker);
16977 -
16978 - stringstream test_output1;
16979 - EXPECT_EQ(0, cppbash_builtin::exec("declare", {"-F", "foo"}, test_output1, cerr, cin, walker));
16980 - EXPECT_EQ("foo\n", test_output1.str());
16981 -
16982 - stringstream test_output2;
16983 - EXPECT_EQ(1, cppbash_builtin::exec("declare", {"-F", "foo", "bar", "test"}, test_output2, cerr, cin, walker));
16984 - EXPECT_EQ("foo\nbar\n", test_output2.str());
16985 -
16986 - stringstream test_output3;
16987 - EXPECT_EQ(0, cppbash_builtin::exec("declare", {"+F", "foo", "bar", "test"}, test_output3, cerr, cin, walker));
16988 - EXPECT_EQ("", test_output3.str());
16989 -
16990 - stringstream test_output4;
16991 - EXPECT_EQ(0, cppbash_builtin::exec("declare", {"-F"}, test_output3, cerr, cin, walker));
16992 - EXPECT_EQ("declare -f bar\ndeclare -f foo\n", test_output3.str());
16993 -}
16994 -
16995 -TEST(declare_built_test, _p)
16996 -{
16997 - interpreter walker;
16998 - walker.define("foo", "bar");
16999 -
17000 - stringstream test_output1;
17001 - EXPECT_EQ(0, cppbash_builtin::exec("declare", {"-p", "foo"}, test_output1, cerr, cin, walker));
17002 - EXPECT_EQ("declare -- foo=\"bar\"\n", test_output1.str());
17003 -
17004 - stringstream test_output2;
17005 - EXPECT_EQ(1, cppbash_builtin::exec("declare", {"-p", "bar", "test"}, test_output2, cerr, cin, walker));
17006 - EXPECT_EQ("-bash: declare: bar: not found\n-bash: declare: test: not found\n", test_output2.str());
17007 -}
17008 -
17009 -#define TEST_DECLARE(name, expected, ...) \
17010 - TEST(declare_builtin_test, name) { test_declare<libbash::unsupported_exception>(expected, {__VA_ARGS__}); }
17011 -
17012 -TEST_DECLARE(_a, "declare -a is not supported yet", "-a", "world")
17013 -TEST_DECLARE(_A, "declare -A is not supported yet", "-A", "world")
17014 -TEST_DECLARE(_f, "declare -f is not supported yet", "-f", "world")
17015 -TEST_DECLARE(_i, "declare -i is not supported yet", "-i", "world")
17016 -TEST_DECLARE(_l, "declare -l is not supported yet", "-l", "world")
17017 -TEST_DECLARE(_r, "declare -r is not supported yet", "-r", "world")
17018 -TEST_DECLARE(_t, "declare -t is not supported yet", "-t", "world")
17019 -TEST_DECLARE(_u, "declare -u is not supported yet", "-u", "world")
17020 -TEST_DECLARE(_x, "declare -x is not supported yet", "-x", "world")
17021 -TEST_DECLARE(pa, "declare +a is not supported yet", "+a", "world")
17022 -TEST_DECLARE(pA, "declare +A is not supported yet", "+A", "world")
17023 -TEST_DECLARE(pf, "declare +f is not supported yet", "+f", "world")
17024 -TEST_DECLARE(pi, "declare +i is not supported yet", "+i", "world")
17025 -TEST_DECLARE(pl, "declare +l is not supported yet", "+l", "world")
17026 -TEST_DECLARE(pr, "declare +r is not supported yet", "+r", "world")
17027 -TEST_DECLARE(pt, "declare +t is not supported yet", "+t", "world")
17028 -TEST_DECLARE(pu, "declare +u is not supported yet", "+u", "world")
17029 -TEST_DECLARE(px, "declare +x is not supported yet", "+x", "world")
17030
17031 diff --git a/libbash-0.1/src/builtins/tests/echo_tests.cpp b/libbash-0.1/src/builtins/tests/echo_tests.cpp
17032 deleted file mode 100644
17033 index 7b38422..0000000
17034 --- a/libbash-0.1/src/builtins/tests/echo_tests.cpp
17035 +++ /dev/null
17036 @@ -1,59 +0,0 @@
17037 -/*
17038 - Please use git log for copyright holder and year information
17039 -
17040 - This file is part of libbash.
17041 -
17042 - libbash is free software: you can redistribute it and/or modify
17043 - it under the terms of the GNU General Public License as published by
17044 - the Free Software Foundation, either version 2 of the License, or
17045 - (at your option) any later version.
17046 -
17047 - libbash is distributed in the hope that it will be useful,
17048 - but WITHOUT ANY WARRANTY; without even the implied warranty of
17049 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17050 - GNU General Public License for more details.
17051 -
17052 - You should have received a copy of the GNU General Public License
17053 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
17054 -*/
17055 -///
17056 -/// \file echo_tests.cpp
17057 -/// \brief series of unit tests for echo built in
17058 -///
17059 -#include <iostream>
17060 -#include <sstream>
17061 -#include <vector>
17062 -
17063 -#include <gtest/gtest.h>
17064 -
17065 -#include "core/interpreter.h"
17066 -#include "cppbash_builtin.h"
17067 -
17068 -using namespace std;
17069 -
17070 -static void test_echo(const string& expected, std::initializer_list<string> args)
17071 -{
17072 - stringstream test_output;
17073 - interpreter walker;
17074 - cppbash_builtin::exec("echo",args,test_output,cerr,cin,walker);
17075 - ASSERT_EQ(expected, test_output.str());
17076 -}
17077 -
17078 -#define TEST_ECHO(name, expected, ...) \
17079 - TEST(echo_builtin_test, name) { test_echo(expected, {__VA_ARGS__}); }
17080 -
17081 -TEST_ECHO(simple_output, "hello world\n", "hello", "world")
17082 -TEST_ECHO(suppress_newline, "foo", "-n", "foo")
17083 -TEST_ECHO(enable_escape, "foo\t\n", "-e", "foo\\t")
17084 -TEST_ECHO(no_escape, "foo\\t\n", "foo\\t")
17085 -TEST_ECHO(only_options, "foo -e", "-n", "foo", "-e")
17086 -TEST_ECHO(only_options2, "foo -n\n", "foo", "-n")
17087 -TEST_ECHO(combined_options, "fo\to", "-ne", "fo\\to")
17088 -TEST_ECHO(combined_options2, "fo\\to", "-enE", "fo\\to")
17089 -TEST_ECHO(fake_options, "-nea fo\\to\n", "-nea", "fo\\to")
17090 -TEST_ECHO(combined_options_alternating_e, "fo\to", "-enEeEe", "fo\\to")
17091 -TEST_ECHO(conflicting_options, "fo\\to\n", "-e", "-E", "fo\\to")
17092 -TEST_ECHO(conflicting_options2, "fo\to\n", "-e", "-E", "-e", "fo\\to")
17093 -TEST_ECHO(oct_escape, "]\n", "-e", "\\0135")
17094 -TEST_ECHO(hex_escape, "W\n", "-e", "\\x57")
17095 -TEST_ECHO(suppress_escape, "foo", "-e", "foo\\cbar")
17096
17097 diff --git a/libbash-0.1/src/builtins/tests/printf_tests.cpp b/libbash-0.1/src/builtins/tests/printf_tests.cpp
17098 deleted file mode 100644
17099 index 9017b18..0000000
17100 --- a/libbash-0.1/src/builtins/tests/printf_tests.cpp
17101 +++ /dev/null
17102 @@ -1,67 +0,0 @@
17103 -/*
17104 - Please use git log for copyright holder and year information
17105 -
17106 - This file is part of libbash.
17107 -
17108 - libbash is free software: you can redistribute it and/or modify
17109 - it under the terms of the GNU General Public License as published by
17110 - the Free Software Foundation, either version 2 of the License, or
17111 - (at your option) any later version.
17112 -
17113 - libbash is distributed in the hope that it will be useful,
17114 - but WITHOUT ANY WARRANTY; without even the implied warranty of
17115 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17116 - GNU General Public License for more details.
17117 -
17118 - You should have received a copy of the GNU General Public License
17119 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
17120 -*/
17121 -///
17122 -/// \file printf_tests.cpp
17123 -/// \brief series of unit tests for printf builtin
17124 -///
17125 -#include <boost/lexical_cast.hpp>
17126 -#include <gtest/gtest.h>
17127 -
17128 -#include "builtins/builtin_exceptions.h"
17129 -#include "core/interpreter.h"
17130 -#include "cppbash_builtin.h"
17131 -
17132 -namespace
17133 -{
17134 - void verify_error(const std::vector<std::string>& arguments, const std::string& expected, interpreter& walker)
17135 - {
17136 - try
17137 - {
17138 - cppbash_builtin::exec("printf", arguments, std::cout, std::cerr, std::cin, walker);
17139 - FAIL();
17140 - }
17141 - catch(libbash::illegal_argument_exception& e)
17142 - {
17143 - EXPECT_STREQ(expected.c_str(), e.what());
17144 - }
17145 - }
17146 -
17147 - void verify_output(const std::vector<std::string>& arguments, const std::string& expected, interpreter& walker)
17148 - {
17149 - std::stringstream output;
17150 - EXPECT_EQ(0, cppbash_builtin::exec("printf", arguments, output, std::cerr, std::cin, walker));
17151 - EXPECT_STREQ(expected.c_str(), output.str().c_str());
17152 - }
17153 -}
17154 -
17155 -TEST(printf_builtin_test, bad_argument)
17156 -{
17157 - interpreter walker;
17158 - verify_error({"-v"}, "printf: illegal number of arguments", walker);
17159 - verify_error({"-p"}, "printf: invalid option: -p", walker);
17160 -}
17161 -
17162 -TEST(printf_builtin_test, normal)
17163 -{
17164 - interpreter walker;
17165 - verify_output({"-v", "foo", "%s\n", "bar"}, "", walker);
17166 - EXPECT_STREQ(walker.resolve<std::string>("foo").c_str(), "bar\n");
17167 -
17168 - verify_output({"%s %s\n", "foo", "bar"}, "foo bar\n", walker);
17169 -}
17170
17171 diff --git a/libbash-0.1/src/builtins/tests/return_tests.cpp b/libbash-0.1/src/builtins/tests/return_tests.cpp
17172 deleted file mode 100644
17173 index a9829b0..0000000
17174 --- a/libbash-0.1/src/builtins/tests/return_tests.cpp
17175 +++ /dev/null
17176 @@ -1,43 +0,0 @@
17177 -/*
17178 - Please use git log for copyright holder and year information
17179 -
17180 - This file is part of libbash.
17181 -
17182 - libbash is free software: you can redistribute it and/or modify
17183 - it under the terms of the GNU General Public License as published by
17184 - the Free Software Foundation, either version 2 of the License, or
17185 - (at your option) any later version.
17186 -
17187 - libbash is distributed in the hope that it will be useful,
17188 - but WITHOUT ANY WARRANTY; without even the implied warranty of
17189 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17190 - GNU General Public License for more details.
17191 -
17192 - You should have received a copy of the GNU General Public License
17193 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
17194 -*/
17195 -///
17196 -/// \file return_tests.cpp
17197 -/// \brief series of unit tests for return builtin
17198 -///
17199 -#include <iostream>
17200 -
17201 -#include <boost/lexical_cast.hpp>
17202 -#include <gtest/gtest.h>
17203 -
17204 -#include "builtins/builtin_exceptions.h"
17205 -#include "core/interpreter.h"
17206 -#include "cppbash_builtin.h"
17207 -
17208 -TEST(return_builtin_test, bad_argument)
17209 -{
17210 - interpreter walker;
17211 - EXPECT_THROW(cppbash_builtin::exec("return", {"abc"}, std::cout, std::cerr, std::cin, walker), boost::bad_lexical_cast);
17212 - EXPECT_THROW(cppbash_builtin::exec("return", {"abc", "def"}, std::cout, std::cerr, std::cin, walker), libbash::illegal_argument_exception);
17213 -}
17214 -
17215 -TEST(return_builtin_test, bad_location)
17216 -{
17217 - interpreter walker;
17218 - EXPECT_THROW(cppbash_builtin::exec("return", {}, std::cout, std::cerr, std::cin, walker), return_exception);
17219 -}
17220
17221 diff --git a/libbash-0.1/src/builtins/tests/shopt_tests.cpp b/libbash-0.1/src/builtins/tests/shopt_tests.cpp
17222 deleted file mode 100644
17223 index 9fe4949..0000000
17224 --- a/libbash-0.1/src/builtins/tests/shopt_tests.cpp
17225 +++ /dev/null
17226 @@ -1,76 +0,0 @@
17227 -/*
17228 - Please use git log for copyright holder and year information
17229 -
17230 - This file is part of libbash.
17231 -
17232 - libbash is free software: you can redistribute it and/or modify
17233 - it under the terms of the GNU General Public License as published by
17234 - the Free Software Foundation, either version 2 of the License, or
17235 - (at your option) any later version.
17236 -
17237 - libbash is distributed in the hope that it will be useful,
17238 - but WITHOUT ANY WARRANTY; without even the implied warranty of
17239 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17240 - GNU General Public License for more details.
17241 -
17242 - You should have received a copy of the GNU General Public License
17243 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
17244 -*/
17245 -///
17246 -/// \file shopt_tests.cpp
17247 -/// \brief series of unit tests for shopt builtin
17248 -///
17249 -#include <gtest/gtest.h>
17250 -
17251 -#include "builtins/builtin_exceptions.h"
17252 -#include "core/exceptions.h"
17253 -#include "core/interpreter.h"
17254 -#include "cppbash_builtin.h"
17255 -
17256 -namespace
17257 -{
17258 - template <typename T>
17259 - void test_shopt_builtin(const std::string& expected, const std::vector<std::string>& args)
17260 - {
17261 - std::stringstream output;
17262 - interpreter walker;
17263 - try
17264 - {
17265 - cppbash_builtin::exec("shopt", args, std::cout, output, std::cin, walker);
17266 - FAIL();
17267 - }
17268 - catch(T& e)
17269 - {
17270 - EXPECT_STREQ(expected.c_str(), e.what());
17271 - }
17272 - }
17273 -}
17274 -
17275 -TEST(shopt_builtin_test, disable_extglob)
17276 -{
17277 - test_shopt_builtin<libbash::illegal_argument_exception>("not exist is not a valid bash option", {"-u", "not exist"});
17278 -
17279 - interpreter walker;
17280 - walker.set_additional_option("autocd", true);
17281 - EXPECT_EQ(0, cppbash_builtin::exec("shopt", {"-u", "autocd", "cdspell"}, std::cout, std::cerr, std::cin, walker));
17282 - EXPECT_FALSE(walker.get_additional_option("autocd"));
17283 - EXPECT_FALSE(walker.get_additional_option("cdspell"));
17284 -}
17285 -
17286 -TEST(shopt_builtin_test, enable_extglob)
17287 -{
17288 - test_shopt_builtin<libbash::illegal_argument_exception>("not exist is not a valid bash option", {"-s", "not exist"});
17289 -
17290 - interpreter walker;
17291 - EXPECT_EQ(0, cppbash_builtin::exec("shopt", {"-s", "autocd", "cdspell"}, std::cout, std::cerr, std::cin, walker));
17292 - EXPECT_TRUE(walker.get_additional_option("autocd"));
17293 - EXPECT_TRUE(walker.get_additional_option("cdspell"));
17294 -}
17295 -
17296 -TEST(shopt_builtin_test, invalid_argument)
17297 -{
17298 - test_shopt_builtin<libbash::illegal_argument_exception>("Arguments required for shopt", {});
17299 - test_shopt_builtin<libbash::unsupported_exception>("Multiple arguments are not supported", {"-so"});
17300 - test_shopt_builtin<libbash::unsupported_exception>("shopt -q is not supported yet", {"-q"});
17301 - test_shopt_builtin<libbash::illegal_argument_exception>("Unrecognized option for shopt: -d", {"-d"});
17302 -}
17303
17304 diff --git a/libbash-0.1/src/builtins/tests/source_tests.cpp b/libbash-0.1/src/builtins/tests/source_tests.cpp
17305 deleted file mode 100644
17306 index bfcac19..0000000
17307 --- a/libbash-0.1/src/builtins/tests/source_tests.cpp
17308 +++ /dev/null
17309 @@ -1,103 +0,0 @@
17310 -/*
17311 - Please use git log for copyright holder and year information
17312 -
17313 - This file is part of libbash.
17314 -
17315 - libbash is free software: you can redistribute it and/or modify
17316 - it under the terms of the GNU General Public License as published by
17317 - the Free Software Foundation, either version 2 of the License, or
17318 - (at your option) any later version.
17319 -
17320 - libbash is distributed in the hope that it will be useful,
17321 - but WITHOUT ANY WARRANTY; without even the implied warranty of
17322 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17323 - GNU General Public License for more details.
17324 -
17325 - You should have received a copy of the GNU General Public License
17326 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
17327 -*/
17328 -///
17329 -/// \file source_tests.cpp
17330 -/// \brief series of unit tests for source built in
17331 -///
17332 -
17333 -#include <iostream>
17334 -#include <string>
17335 -
17336 -#include <gtest/gtest.h>
17337 -
17338 -#include "builtins/builtin_exceptions.h"
17339 -#include "core/interpreter.h"
17340 -#include "cppbash_builtin.h"
17341 -#include "test.h"
17342 -
17343 -TEST(source_builtin_test, source_true)
17344 -{
17345 - interpreter walker;
17346 -
17347 - int status = cppbash_builtin::exec("source",
17348 - {get_src_dir() + "/scripts/source_true.sh"},
17349 - std::cout,
17350 - std::cerr,
17351 - std::cin,
17352 - walker);
17353 - EXPECT_EQ(status, 0);
17354 -
17355 - EXPECT_TRUE(walker.has_function("foo"));
17356 -
17357 - // Call the function defined in source_true.sh
17358 - std::stringstream output;
17359 - walker.set_output_stream(&output);
17360 - interpreter::local_scope current_scope(walker);
17361 - walker.call("foo", {});
17362 - EXPECT_STREQ("hi\n", output.str().c_str());
17363 -
17364 - EXPECT_STREQ("hello", walker.resolve<std::string>("FOO001").c_str());
17365 - EXPECT_STREQ((get_src_dir() + "/scripts/source_true.sh").c_str(),
17366 - walker.resolve<std::string>("FOO002").c_str());
17367 - EXPECT_STREQ("", walker.resolve<std::string>("0").c_str());
17368 -}
17369 -
17370 -TEST(source_builtin_test, source_false)
17371 -{
17372 - interpreter walker;
17373 - int status = cppbash_builtin::exec("source",
17374 - {get_src_dir() + "/scripts/source_false.sh"},
17375 - std::cout,
17376 - std::cerr,
17377 - std::cin,
17378 - walker);
17379 - EXPECT_EQ(status, 1);
17380 -}
17381 -
17382 -TEST(source_builtin_test, source_return)
17383 -{
17384 - interpreter walker;
17385 - int status = cppbash_builtin::exec("source",
17386 - {get_src_dir() + "/scripts/source_return.sh"},
17387 - std::cout,
17388 - std::cerr,
17389 - std::cin,
17390 - walker);
17391 - EXPECT_EQ(status, 10);
17392 - EXPECT_TRUE(walker.is_unset_or_null("NOT_EXIST", 0));
17393 -}
17394 -
17395 -TEST(source_builtin_test, invalid)
17396 -{
17397 - interpreter walker;
17398 - EXPECT_THROW(cppbash_builtin::exec("source",
17399 - {},
17400 - std::cout,
17401 - std::cerr,
17402 - std::cin,
17403 - walker),
17404 - libbash::illegal_argument_exception);
17405 - EXPECT_THROW(cppbash_builtin::exec("source",
17406 - {get_src_dir() + "/scripts/illegal_script.sh"},
17407 - std::cout,
17408 - std::cerr,
17409 - std::cin,
17410 - walker),
17411 - libbash::parse_exception);
17412 -}
17413
17414 diff --git a/libbash-0.1/src/builtins/unset_builtin.cpp b/libbash-0.1/src/builtins/unset_builtin.cpp
17415 deleted file mode 100644
17416 index d8178f9..0000000
17417 --- a/libbash-0.1/src/builtins/unset_builtin.cpp
17418 +++ /dev/null
17419 @@ -1,57 +0,0 @@
17420 -/*
17421 - Please use git log for copyright holder and year information
17422 -
17423 - This file is part of libbash.
17424 -
17425 - libbash is free software: you can redistribute it and/or modify
17426 - it under the terms of the GNU General Public License as published by
17427 - the Free Software Foundation, either version 2 of the License, or
17428 - (at your option) any later version.
17429 -
17430 - libbash is distributed in the hope that it will be useful,
17431 - but WITHOUT ANY WARRANTY; without even the implied warranty of
17432 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17433 - GNU General Public License for more details.
17434 -
17435 - You should have received a copy of the GNU General Public License
17436 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
17437 -*/
17438 -///
17439 -/// \file unset_builtin.h
17440 -/// \brief implementation for the unset builtin
17441 -///
17442 -#include "builtins/unset_builtin.h"
17443 -
17444 -#include <functional>
17445 -
17446 -#include "core/interpreter.h"
17447 -
17448 -int unset_builtin::exec(const std::vector<std::string>& bash_args)
17449 -{
17450 - if(bash_args.empty())
17451 - return 0;
17452 -
17453 - if(bash_args[0] == "-f")
17454 - for_each(bash_args.begin() + 1,
17455 - bash_args.end(),
17456 - std::bind(&interpreter::unset_function, &_walker, std::placeholders::_1));
17457 - else
17458 - /* POSIX says if neither -f nor -v is specified, name refers to a variable;
17459 - * if a variable by that name does not exist, it is unspecified whether a
17460 - * function by that name, if any, shall be unset.
17461 - *
17462 - * >=bash-4.1: without options, unset first tries to unset a variable, and
17463 - * if that fails, tries to unset a function.
17464 - * (We haven't checked bash-4.0)
17465 - *
17466 - * bash-3.2: if no options are supplied, or the -v option is given, each
17467 - * name refers to a shell variable.
17468 - *
17469 - * We addhere to bash-3.2
17470 - * */
17471 - for_each(bash_args.front() == "-v" ? bash_args.begin() + 1 : bash_args.begin(),
17472 - bash_args.end(),
17473 - [&](const std::string& name) { _walker.unset(name); });
17474 -
17475 - return 0;
17476 -}
17477
17478 diff --git a/libbash-0.1/src/builtins/unset_builtin.h b/libbash-0.1/src/builtins/unset_builtin.h
17479 deleted file mode 100644
17480 index 202e78a..0000000
17481 --- a/libbash-0.1/src/builtins/unset_builtin.h
17482 +++ /dev/null
17483 @@ -1,35 +0,0 @@
17484 -/*
17485 - Please use git log for copyright holder and year information
17486 -
17487 - This file is part of libbash.
17488 -
17489 - libbash is free software: you can redistribute it and/or modify
17490 - it under the terms of the GNU General Public License as published by
17491 - the Free Software Foundation, either version 2 of the License, or
17492 - (at your option) any later version.
17493 -
17494 - libbash is distributed in the hope that it will be useful,
17495 - but WITHOUT ANY WARRANTY; without even the implied warranty of
17496 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17497 - GNU General Public License for more details.
17498 -
17499 - You should have received a copy of the GNU General Public License
17500 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
17501 -*/
17502 -///
17503 -/// \file unset_builtin.h
17504 -/// \brief implementation for the unset builtin
17505 -///
17506 -#ifndef LIBBASH_BUILTINS_UNSET_BUILTIN_H_
17507 -#define LIBBASH_BUILTINS_UNSET_BUILTIN_H_
17508 -
17509 -#include "cppbash_builtin.h"
17510 -
17511 -class unset_builtin : public virtual cppbash_builtin
17512 -{
17513 -public:
17514 - BUILTIN_CONSTRUCTOR(unset)
17515 - virtual int exec(const std::vector<std::string>& bash_args);
17516 -};
17517 -
17518 -#endif
17519
17520 diff --git a/libbash-0.1/src/common.h b/libbash-0.1/src/common.h
17521 deleted file mode 100644
17522 index 537e8d8..0000000
17523 --- a/libbash-0.1/src/common.h
17524 +++ /dev/null
17525 @@ -1,30 +0,0 @@
17526 -/*
17527 - Please use git log for copyright holder and year information
17528 -
17529 - This file is part of libbash.
17530 -
17531 - libbash is free software: you can redistribute it and/or modify
17532 - it under the terms of the GNU General Public License as published by
17533 - the Free Software Foundation, either version 2 of the License, or
17534 - (at your option) any later version.
17535 -
17536 - libbash is distributed in the hope that it will be useful,
17537 - but WITHOUT ANY WARRANTY; without even the implied warranty of
17538 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17539 - GNU General Public License for more details.
17540 -
17541 - You should have received a copy of the GNU General Public License
17542 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
17543 -*/
17544 -///
17545 -/// \file common.h
17546 -/// \brief common macros and includes
17547 -///
17548 -
17549 -#ifndef LIBBASH_COMMON_H_
17550 -#define LIBBASH_COMMON_H_
17551 -
17552 -#define LIBBASH_API __attribute__((visibility("default")))
17553 -#define LIBBASH_LOCAL __attribute__((visibility("hidden")))
17554 -
17555 -#endif
17556
17557 diff --git a/libbash-0.1/src/core/bash_ast.cpp b/libbash-0.1/src/core/bash_ast.cpp
17558 deleted file mode 100644
17559 index c7b9180..0000000
17560 --- a/libbash-0.1/src/core/bash_ast.cpp
17561 +++ /dev/null
17562 @@ -1,218 +0,0 @@
17563 -/*
17564 - Please use git log for copyright holder and year information
17565 -
17566 - This file is part of libbash.
17567 -
17568 - libbash is free software: you can redistribute it and/or modify
17569 - it under the terms of the GNU General Public License as published by
17570 - the Free Software Foundation, either version 2 of the License, or
17571 - (at your option) any later version.
17572 -
17573 - libbash is distributed in the hope that it will be useful,
17574 - but WITHOUT ANY WARRANTY; without even the implied warranty of
17575 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17576 - GNU General Public License for more details.
17577 -
17578 - You should have received a copy of the GNU General Public License
17579 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
17580 -*/
17581 -///
17582 -/// \file bash_ast.cpp
17583 -/// \brief a wrapper class that helps interpret from istream and string
17584 -///
17585 -#include "core/bash_ast.h"
17586 -
17587 -#include <fstream>
17588 -
17589 -#include <boost/numeric/conversion/cast.hpp>
17590 -
17591 -#include "core/exceptions.h"
17592 -#include "core/interpreter.h"
17593 -#include "libbashLexer.h"
17594 -#include "libbashParser.h"
17595 -#include "libbashWalker.h"
17596 -
17597 -bash_ast::bash_ast(const std::istream& source,
17598 - std::function<pANTLR3_BASE_TREE(plibbashParser)> p): parse(p)
17599 -{
17600 - std::stringstream stream;
17601 - stream << source.rdbuf();
17602 - script = stream.str();
17603 - init_parser(script, "unknown source");
17604 -}
17605 -
17606 -bash_ast::bash_ast(const std::string& script_path,
17607 - std::function<pANTLR3_BASE_TREE(plibbashParser)> p): parse(p)
17608 -{
17609 - std::stringstream stream;
17610 - std::ifstream file_stream(script_path);
17611 - if(!file_stream)
17612 - throw libbash::parse_exception(script_path + " can't be read");
17613 -
17614 - stream << file_stream.rdbuf();
17615 - script = stream.str();
17616 - init_parser(script, script_path);
17617 -}
17618 -
17619 -void bash_ast::init_parser(const std::string& script, const std::string& script_path)
17620 -{
17621 - input.reset(antlr3NewAsciiStringInPlaceStream(
17622 - reinterpret_cast<pANTLR3_UINT8>(const_cast<char*>(script.c_str())),
17623 - // We do not support strings longer than the max value of ANTLR3_UNIT32
17624 - boost::numeric_cast<ANTLR3_UINT32>(script.size()),
17625 - NULL));
17626 -
17627 - if(!input)
17628 - throw libbash::parse_exception("Unable to open file " + script + " due to malloc() failure");
17629 -
17630 - input->fileName = input->strFactory->newStr(
17631 - input->strFactory,
17632 - reinterpret_cast<pANTLR3_UINT8>(const_cast<char*>(script_path.c_str())));
17633 -
17634 - lexer.reset(libbashLexerNew(input.get()));
17635 - if(!lexer)
17636 - throw libbash::parse_exception("Unable to create the lexer due to malloc() failure");
17637 -
17638 - token_stream.reset(antlr3CommonTokenStreamSourceNew(
17639 - ANTLR3_SIZE_HINT, lexer->pLexer->rec->state->tokSource));
17640 - if(!token_stream)
17641 - throw libbash::parse_exception("Out of memory trying to allocate token stream");
17642 -
17643 - parser.reset(libbashParserNew(token_stream.get()));
17644 - if(!parser)
17645 - throw libbash::parse_exception("Out of memory trying to allocate parser");
17646 -
17647 - ast = parse(parser.get());
17648 - if(parser->pParser->rec->getNumberOfSyntaxErrors(parser->pParser->rec))
17649 - throw libbash::parse_exception("Something wrong happened while parsing");
17650 - nodes.reset(antlr3CommonTreeNodeStreamNewTree(ast, ANTLR3_SIZE_HINT));
17651 -}
17652 -
17653 -std::string bash_ast::get_dot_graph()
17654 -{
17655 - pANTLR3_STRING graph = nodes->adaptor->makeDot(nodes->adaptor, ast);
17656 - return std::string(reinterpret_cast<char*>(graph->chars));
17657 -}
17658 -
17659 -std::string bash_ast::get_string_tree()
17660 -{
17661 - return std::string(reinterpret_cast<char*>(ast->toStringTree(ast)->chars));
17662 -}
17663 -
17664 -namespace
17665 -{
17666 - void print_line_counter(std::stringstream& result,
17667 - pANTLR3_COMMON_TOKEN token,
17668 - int& line_counter,
17669 - int pos)
17670 - {
17671 - char* text = reinterpret_cast<char*>(token->getText(token)->chars);
17672 - for(int i = pos; text[i] == '\n'; ++i)
17673 - result << '\n' << line_counter++ << "\t";
17674 - }
17675 -}
17676 -
17677 -std::string bash_ast::get_parser_tokens(antlr_pointer<ANTLR3_COMMON_TOKEN_STREAM_struct>& token_stream,
17678 - std::function<std::string(ANTLR3_UINT32)> token_map)
17679 -{
17680 - std::stringstream result;
17681 - int line_counter = 1;
17682 -
17683 - // output line number for the first line
17684 - result << line_counter++ << "\t";
17685 -
17686 - pANTLR3_VECTOR token_list = token_stream->getTokens(token_stream.get());
17687 - unsigned token_size = token_list->size(token_list);
17688 -
17689 - for(unsigned i = 0u; i != token_size; ++i)
17690 - {
17691 - pANTLR3_COMMON_TOKEN token = reinterpret_cast<pANTLR3_COMMON_TOKEN>
17692 - (token_list->get(token_list, i));
17693 - std::string tokenName = token_map(token->getType(token));
17694 -
17695 - if(tokenName != "EOL" && tokenName != "COMMENT" && tokenName != "CONTINUE_LINE")
17696 - {
17697 - result << tokenName << " ";
17698 - }
17699 - // Output \n and line number before each COMMENT token for better readability
17700 - else if(tokenName == "COMMENT")
17701 - {
17702 - print_line_counter(result, token, line_counter, 0);
17703 - result << tokenName;
17704 - }
17705 - // Output \n and line number after each CONTINUE_LINE/EOL token for better readability
17706 - // omit the last \n and line number
17707 - else if(i + 1 != token_size)
17708 - {
17709 - result << tokenName;
17710 - print_line_counter(result, token, line_counter, tokenName == "CONTINUE_LINE"? 1 : 0);
17711 - }
17712 - }
17713 - return result.str();
17714 -}
17715 -
17716 -std::string bash_ast::get_walker_tokens(std::function<std::string(ANTLR3_UINT32)> token_map)
17717 -{
17718 - std::stringstream result;
17719 - pANTLR3_INT_STREAM istream = nodes->tnstream->istream;
17720 - auto istream_size = istream->size(istream);
17721 -
17722 - for(ANTLR3_UINT32 i = 1; i <= istream_size; ++i)
17723 - {
17724 - ANTLR3_UINT32 token = istream->_LA(istream, boost::numeric_cast<ANTLR3_INT32>(i));
17725 - if(token == 2)
17726 - result << "DOWN ";
17727 - else if(token == 3)
17728 - result << "UP ";
17729 - else
17730 - result << token_map(istream->_LA(istream, boost::numeric_cast<ANTLR3_INT32>(i))) << " ";
17731 - }
17732 - result << std::endl;
17733 -
17734 - return result.str();
17735 -}
17736 -
17737 -void bash_ast::walker_start(plibbashWalker tree_parser)
17738 -{
17739 - tree_parser->start(tree_parser);
17740 -}
17741 -
17742 -long bash_ast::walker_arithmetics(plibbashWalker tree_parser)
17743 -{
17744 - return tree_parser->arithmetics(tree_parser);
17745 -}
17746 -
17747 -pANTLR3_BASE_TREE bash_ast::parser_start(plibbashParser parser)
17748 -{
17749 - return parser->start(parser).tree;
17750 -}
17751 -
17752 -pANTLR3_BASE_TREE bash_ast::parser_arithmetics(plibbashParser parser)
17753 -{
17754 - return parser->arithmetics(parser).tree;
17755 -}
17756 -
17757 -void bash_ast::call_function(plibbashWalker ctx,
17758 - ANTLR3_MARKER index)
17759 -{
17760 - auto INPUT = ctx->pTreeParser->ctnstream;
17761 - // Push function index into INPUT
17762 - // The actual type of ANTLR3_MARKER is ANTLR3_INT32
17763 - INPUT->push(INPUT, boost::numeric_cast<ANTLR3_INT32>(index));
17764 - // Execute function body
17765 - ctx->compound_command(ctx);
17766 -}
17767 -
17768 -bash_ast::walker_pointer bash_ast::create_walker(interpreter& walker)
17769 -{
17770 - set_interpreter(&walker);
17771 - walker.push_current_ast(this);
17772 -
17773 - auto deleter = [&](plibbashWalker tree_parser)
17774 - {
17775 - tree_parser->free(tree_parser);
17776 - walker.pop_current_ast();
17777 - };
17778 -
17779 - return walker_pointer(libbashWalkerNew(nodes.get()), deleter);
17780 -}
17781
17782 diff --git a/libbash-0.1/src/core/bash_ast.h b/libbash-0.1/src/core/bash_ast.h
17783 deleted file mode 100644
17784 index 22635a1..0000000
17785 --- a/libbash-0.1/src/core/bash_ast.h
17786 +++ /dev/null
17787 @@ -1,114 +0,0 @@
17788 -/*
17789 - Please use git log for copyright holder and year information
17790 -
17791 - This file is part of libbash.
17792 -
17793 - libbash is free software: you can redistribute it and/or modify
17794 - it under the terms of the GNU General Public License as published by
17795 - the Free Software Foundation, either version 2 of the License, or
17796 - (at your option) any later version.
17797 -
17798 - libbash is distributed in the hope that it will be useful,
17799 - but WITHOUT ANY WARRANTY; without even the implied warranty of
17800 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17801 - GNU General Public License for more details.
17802 -
17803 - You should have received a copy of the GNU General Public License
17804 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
17805 -*/
17806 -///
17807 -/// \file bash_ast.h
17808 -/// \brief a class that helps interpret from istream and string
17809 -///
17810 -
17811 -#ifndef LIBBASH_CORE_PARSER_BUILDER_H_
17812 -#define LIBBASH_CORE_PARSER_BUILDER_H_
17813 -
17814 -#include <type_traits>
17815 -#include <functional>
17816 -#include <istream>
17817 -#include <memory>
17818 -#include <string>
17819 -#include <vector>
17820 -
17821 -#include <antlr3.h>
17822 -#include <boost/utility.hpp>
17823 -
17824 -struct libbashLexer_Ctx_struct;
17825 -struct libbashParser_Ctx_struct;
17826 -struct libbashWalker_Ctx_struct;
17827 -typedef libbashWalker_Ctx_struct* plibbashWalker;
17828 -class interpreter;
17829 -
17830 -template<typename T>
17831 -class antlr_pointer: public std::unique_ptr<T, std::function<void(T*)>>
17832 -{
17833 - typedef std::unique_ptr<T, std::function<void(T*)>> parent;
17834 -public:
17835 - antlr_pointer(T* p = 0) : parent(p, [](T* to_delete) { to_delete->free(to_delete); }) {};
17836 -};
17837 -
17838 -/// \class bash_ast
17839 -/// \brief a wrapper class that helps interpret from istream and string
17840 -class bash_ast: public boost::noncopyable
17841 -{
17842 - antlr_pointer<ANTLR3_INPUT_STREAM_struct> input;
17843 - std::string script;
17844 - antlr_pointer<libbashLexer_Ctx_struct> lexer;
17845 - antlr_pointer<ANTLR3_COMMON_TOKEN_STREAM_struct> token_stream;
17846 - antlr_pointer<libbashParser_Ctx_struct> parser;
17847 - pANTLR3_BASE_TREE ast;
17848 - antlr_pointer<ANTLR3_COMMON_TREE_NODE_STREAM_struct> nodes;
17849 - std::function<pANTLR3_BASE_TREE(libbashParser_Ctx_struct*)> parse;
17850 -
17851 - typedef std::unique_ptr<libbashWalker_Ctx_struct, std::function<void(plibbashWalker)>> walker_pointer;
17852 -
17853 - void init_parser(const std::string& script, const std::string& script_path);
17854 - walker_pointer create_walker(interpreter& walker);
17855 -
17856 -public:
17857 - bash_ast(const std::istream& source,
17858 - std::function<pANTLR3_BASE_TREE(libbashParser_Ctx_struct*)> p=parser_start);
17859 -
17860 - bash_ast(const std::string& script_path,
17861 - std::function<pANTLR3_BASE_TREE(libbashParser_Ctx_struct*)> p=parser_start);
17862 -
17863 - static void walker_start(plibbashWalker tree_parser);
17864 -
17865 - static long walker_arithmetics(plibbashWalker tree_parser);
17866 -
17867 - static void call_function(plibbashWalker tree_parser,
17868 - ANTLR3_MARKER index);
17869 -
17870 - static pANTLR3_BASE_TREE parser_start(libbashParser_Ctx_struct* parser);
17871 -
17872 - static pANTLR3_BASE_TREE parser_arithmetics(libbashParser_Ctx_struct* parser);
17873 -
17874 - ///
17875 - /// \brief interpret the script with a given interpreter
17876 - /// \param the interpreter object
17877 - /// \return the interpreted result
17878 - template<typename Functor>
17879 - typename std::result_of<Functor(plibbashWalker)>::type
17880 - interpret_with(interpreter& walker, Functor walk)
17881 - {
17882 - walker_pointer p_tree_parser = create_walker(walker);
17883 - return walk(p_tree_parser.get());
17884 - }
17885 -
17886 - void interpret_with(interpreter& walker)
17887 - {
17888 - interpret_with(walker, walker_start);
17889 - }
17890 -
17891 - std::string get_dot_graph();
17892 -
17893 - std::string get_string_tree();
17894 -
17895 - static std::string get_parser_tokens(antlr_pointer<ANTLR3_COMMON_TOKEN_STREAM_struct>& token_stream,
17896 - std::function<std::string(ANTLR3_UINT32)>);
17897 -
17898 - std::string get_walker_tokens(std::function<std::string(ANTLR3_UINT32)>);
17899 -};
17900 -
17901 -#endif
17902
17903 diff --git a/libbash-0.1/src/core/bash_condition.cpp b/libbash-0.1/src/core/bash_condition.cpp
17904 deleted file mode 100644
17905 index af57b90..0000000
17906 --- a/libbash-0.1/src/core/bash_condition.cpp
17907 +++ /dev/null
17908 @@ -1,186 +0,0 @@
17909 -/*
17910 - Please use git log for copyright holder and year information
17911 -
17912 - This file is part of libbash.
17913 -
17914 - libbash is free software: you can redistribute it and/or modify
17915 - it under the terms of the GNU General Public License as published by
17916 - the Free Software Foundation, either version 2 of the License, or
17917 - (at your option) any later version.
17918 -
17919 - libbash is distributed in the hope that it will be useful,
17920 - but WITHOUT ANY WARRANTY; without even the implied warranty of
17921 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17922 - GNU General Public License for more details.
17923 -
17924 - You should have received a copy of the GNU General Public License
17925 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
17926 - */
17927 -///
17928 -/// \file bash_condition.cpp
17929 -/// \brief implementation for Bash Conditional Expressions
17930 -///
17931 -#include "core/bash_condition.h"
17932 -
17933 -#include <ctime>
17934 -
17935 -#include <boost/lexical_cast.hpp>
17936 -#include <sys/stat.h>
17937 -#include <unistd.h>
17938 -
17939 -#include "core/bash_ast.h"
17940 -#include "core/exceptions.h"
17941 -#include "core/interpreter.h"
17942 -
17943 -namespace
17944 -{
17945 - bool test_file_stat(char op, const std::string& path)
17946 - {
17947 - struct stat info;
17948 - int status = 0;
17949 -
17950 - // symbol link use lstat so we need to separate this.
17951 - if(op == 'L' || op == 'h')
17952 - return lstat(path.c_str(), &info) == 0 && S_ISLNK(info.st_mode);
17953 -
17954 - status = stat(path.c_str(), &info);
17955 - if(status != 0 || access(path.c_str(), F_OK))
17956 - return false;
17957 -
17958 - switch(op)
17959 - {
17960 - case 'a':
17961 - case 'e':
17962 - return true;
17963 - case 'b':
17964 - return S_ISBLK(info.st_mode);
17965 - case 'c':
17966 - return S_ISCHR(info.st_mode);
17967 - case 'd':
17968 - return S_ISDIR(info.st_mode);
17969 - case 'f':
17970 - return S_ISREG(info.st_mode);
17971 - case 'g':
17972 - return S_ISGID & info.st_mode;
17973 - case 'k':
17974 - return S_ISVTX & info.st_mode;
17975 - case 'p':
17976 - return S_ISFIFO(info.st_mode);
17977 - case 'r':
17978 - return access(path.c_str(), R_OK) == 0;
17979 - case 's':
17980 - return info.st_size > 0;
17981 - case 'u':
17982 - return S_ISUID & info.st_mode;
17983 - case 'w':
17984 - return access(path.c_str(), W_OK) == 0;
17985 - case 'x':
17986 - return access(path.c_str(), X_OK) == 0;
17987 - case 'O':
17988 - return geteuid() == info.st_uid;
17989 - case 'G':
17990 - return getegid() == info.st_gid;
17991 - case 'S':
17992 - return S_ISSOCK(info.st_mode);
17993 - case 'N':
17994 - return info.st_mtime >= info.st_atime;
17995 - default:
17996 - throw libbash::illegal_argument_exception(std::string("Unrecognized test operator -") + op);
17997 - }
17998 - }
17999 -}
18000 -
18001 -bool internal::test_unary(char op, const std::string& target)
18002 -{
18003 - switch(op)
18004 - {
18005 - case 'z':
18006 - return target.empty();
18007 - case 'n':
18008 - return !target.empty();
18009 - case 'o':
18010 - throw libbash::unsupported_exception("Shell option test is not supported");
18011 - case 't':
18012 - try
18013 - {
18014 - int fd = boost::lexical_cast<int>(target);
18015 - return isatty(fd);
18016 - }
18017 - catch(boost::bad_lexical_cast& e)
18018 - {
18019 - return false;
18020 - }
18021 - default:
18022 - return test_file_stat(op, target);
18023 - }
18024 -}
18025 -
18026 -namespace
18027 -{
18028 - bool file_comp(char op,
18029 - const std::string& lhs,
18030 - const std::string& rhs)
18031 - {
18032 - struct stat lst, rst;
18033 - int lstatus, rstatus;
18034 -
18035 - lstatus = stat(lhs.c_str(), &lst);
18036 - rstatus = stat(rhs.c_str(), &rst);
18037 - if(op == 'e' && (lstatus < 0 || rstatus < 0))
18038 - return false;
18039 -
18040 - switch(op)
18041 - {
18042 - case 'n':
18043 - /* -nt */
18044 - return ((lstatus > rstatus) || (lstatus == 0 && lst.st_mtime > rst.st_mtime));
18045 - case 'o':
18046 - /* -ot */
18047 - return ((lstatus < rstatus) || (rstatus == 0 && lst.st_mtime < rst.st_mtime));
18048 - case 'e':
18049 - /* -ef */
18050 - return (lst.st_dev == rst.st_dev && lst.st_ino == rst.st_ino);
18051 - default:
18052 - throw libbash::illegal_argument_exception(std::string("Unrecognized option for file test ") + op);
18053 - }
18054 - }
18055 -}
18056 -
18057 -bool internal::test_binary(const std::string& op,
18058 - const std::string& lhs,
18059 - const std::string& rhs,
18060 - interpreter& walker)
18061 -{
18062 - if(op.size() != 2)
18063 - throw libbash::illegal_argument_exception("Unrecognized operator " + op);
18064 -
18065 - try
18066 - {
18067 - if(op == "nt")
18068 - return file_comp('n', lhs, rhs);
18069 - else if(op == "ot")
18070 - return file_comp('o', lhs, rhs);
18071 - else if(op == "ef")
18072 - return file_comp('e', lhs, rhs);
18073 - // We do not support arithmetic expressions inside keyword test for now.
18074 - // So the operands can only be raw integers.
18075 - else if(op == "eq")
18076 - return walker.eval_arithmetic(lhs) == walker.eval_arithmetic(rhs);
18077 - else if(op == "ne")
18078 - return walker.eval_arithmetic(lhs) != walker.eval_arithmetic(rhs);
18079 - else if(op == "lt")
18080 - return walker.eval_arithmetic(lhs) < walker.eval_arithmetic(rhs);
18081 - else if(op == "le")
18082 - return walker.eval_arithmetic(lhs) <= walker.eval_arithmetic(rhs);
18083 - else if(op == "gt")
18084 - return walker.eval_arithmetic(lhs) > walker.eval_arithmetic(rhs);
18085 - else if(op == "ge")
18086 - return walker.eval_arithmetic(lhs) >= walker.eval_arithmetic(rhs);
18087 - else
18088 - throw libbash::illegal_argument_exception("Unrecognized operator " + op);
18089 - }
18090 - catch(boost::bad_lexical_cast& e)
18091 - {
18092 - return false;
18093 - }
18094 -}
18095
18096 diff --git a/libbash-0.1/src/core/bash_condition.h b/libbash-0.1/src/core/bash_condition.h
18097 deleted file mode 100644
18098 index e8e4096..0000000
18099 --- a/libbash-0.1/src/core/bash_condition.h
18100 +++ /dev/null
18101 @@ -1,40 +0,0 @@
18102 -/*
18103 - Please use git log for copyright holder and year information
18104 -
18105 - This file is part of libbash.
18106 -
18107 - libbash is free software: you can redistribute it and/or modify
18108 - it under the terms of the GNU General Public License as published by
18109 - the Free Software Foundation, either version 2 of the License, or
18110 - (at your option) any later version.
18111 -
18112 - libbash is distributed in the hope that it will be useful,
18113 - but WITHOUT ANY WARRANTY; without even the implied warranty of
18114 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18115 - GNU General Public License for more details.
18116 -
18117 - You should have received a copy of the GNU General Public License
18118 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
18119 - */
18120 -///
18121 -/// \file bash_condition.h
18122 -/// \brief implementation for Bash Conditional Expressions
18123 -///
18124 -#ifndef LIBBASH_CORE_BASH_CONDITION_H_
18125 -#define LIBBASH_CORE_BASH_CONDITION_H_
18126 -
18127 -#include <string>
18128 -
18129 -class interpreter;
18130 -
18131 -namespace internal
18132 -{
18133 - bool test_unary(char op, const std::string& target);
18134 -
18135 - bool test_binary(const std::string& op,
18136 - const std::string& lhs,
18137 - const std::string& rhs,
18138 - interpreter& walker);
18139 -}
18140 -
18141 -#endif
18142
18143 diff --git a/libbash-0.1/src/core/divide_by_zero_error.h b/libbash-0.1/src/core/divide_by_zero_error.h
18144 deleted file mode 100644
18145 index 10603cc..0000000
18146 --- a/libbash-0.1/src/core/divide_by_zero_error.h
18147 +++ /dev/null
18148 @@ -1,47 +0,0 @@
18149 -/*
18150 - Please use git log for copyright holder and year information
18151 -
18152 - This file is part of libbash.
18153 -
18154 - libbash is free software: you can redistribute it and/or modify
18155 - it under the terms of the GNU General Public License as published by
18156 - the Free Software Foundation, either version 2 of the License, or
18157 - (at your option) any later version.
18158 -
18159 - libbash is distributed in the hope that it will be useful,
18160 - but WITHOUT ANY WARRANTY; without even the implied warranty of
18161 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18162 - GNU General Public License for more details.
18163 -
18164 - You should have received a copy of the GNU General Public License
18165 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
18166 -*/
18167 -///
18168 -/// \file divide_by_zero_error.h
18169 -/// \brief implementation for divide_by_zero_error
18170 -///
18171 -
18172 -#ifndef LIBBASH_CORE_DIVIDE_BY_ZERO_ERROR_H_
18173 -#define LIBBASH_CORE_DIVIDE_BY_ZERO_ERROR_H_
18174 -
18175 -#include <stdexcept>
18176 -#include <string>
18177 -
18178 -#include "common.h"
18179 -#include "interpreter_exception.h"
18180 -
18181 -namespace libbash
18182 -{
18183 - ///
18184 - /// \class divide_by_zero_error
18185 - /// \brief exception for dividing by zero error
18186 - ///
18187 - class LIBBASH_API divide_by_zero_error: public libbash::interpreter_exception
18188 - {
18189 - public:
18190 - explicit divide_by_zero_error(const std::string& err_msg):
18191 - libbash::interpreter_exception(err_msg){}
18192 - };
18193 -}
18194 -
18195 -#endif
18196
18197 diff --git a/libbash-0.1/src/core/exceptions.h b/libbash-0.1/src/core/exceptions.h
18198 deleted file mode 100644
18199 index 519d16a..0000000
18200 --- a/libbash-0.1/src/core/exceptions.h
18201 +++ /dev/null
18202 @@ -1,35 +0,0 @@
18203 -/*
18204 - Please use git log for copyright holder and year information
18205 -
18206 - This file is part of libbash.
18207 -
18208 - libbash is free software: you can redistribute it and/or modify
18209 - it under the terms of the GNU General Public License as published by
18210 - the Free Software Foundation, either version 2 of the License, or
18211 - (at your option) any later version.
18212 -
18213 - libbash is distributed in the hope that it will be useful,
18214 - but WITHOUT ANY WARRANTY; without even the implied warranty of
18215 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18216 - GNU General Public License for more details.
18217 -
18218 - You should have received a copy of the GNU General Public License
18219 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
18220 - */
18221 -///
18222 -/// \file exceptions.h
18223 -/// \author Mu Qiao
18224 -/// \brief headers for all exceptions
18225 -///
18226 -#ifndef LIBBASH_CORE_EXCEPTIOND_H_
18227 -#define LIBBASH_CORE_EXCEPTIOND_H_
18228 -
18229 -#include "core/divide_by_zero_error.h"
18230 -#include "core/illegal_argument_exception.h"
18231 -#include "core/interpreter_exception.h"
18232 -#include "core/parse_exception.h"
18233 -#include "core/readonly_exception.h"
18234 -#include "core/runtime_exception.h"
18235 -#include "core/unsupported_exception.h"
18236 -
18237 -#endif
18238
18239 diff --git a/libbash-0.1/src/core/function.cpp b/libbash-0.1/src/core/function.cpp
18240 deleted file mode 100644
18241 index 5fda04b..0000000
18242 --- a/libbash-0.1/src/core/function.cpp
18243 +++ /dev/null
18244 @@ -1,38 +0,0 @@
18245 -/*
18246 - Please use git log for copyright holder and year information
18247 -
18248 - This file is part of libbash.
18249 -
18250 - libbash is free software: you can redistribute it and/or modify
18251 - it under the terms of the GNU General Public License as published by
18252 - the Free Software Foundation, either version 2 of the License, or
18253 - (at your option) any later version.
18254 -
18255 - libbash is distributed in the hope that it will be useful,
18256 - but WITHOUT ANY WARRANTY; without even the implied warranty of
18257 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18258 - GNU General Public License for more details.
18259 -
18260 - You should have received a copy of the GNU General Public License
18261 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
18262 - */
18263 -///
18264 -/// \file function.cpp
18265 -/// \author Mu Qiao
18266 -/// \brief implementation for function
18267 -///
18268 -
18269 -#include "core/function.h"
18270 -
18271 -#include <functional>
18272 -
18273 -#include "core/bash_ast.h"
18274 -#include "core/interpreter.h"
18275 -
18276 -void function::call(interpreter& walker)
18277 -{
18278 - ast.interpret_with(walker,
18279 - std::bind(bash_ast::call_function,
18280 - std::placeholders::_1,
18281 - index));
18282 -}
18283
18284 diff --git a/libbash-0.1/src/core/function.h b/libbash-0.1/src/core/function.h
18285 deleted file mode 100644
18286 index fcd0e91..0000000
18287 --- a/libbash-0.1/src/core/function.h
18288 +++ /dev/null
18289 @@ -1,44 +0,0 @@
18290 -/*
18291 - Please use git log for copyright holder and year information
18292 -
18293 - This file is part of libbash.
18294 -
18295 - libbash is free software: you can redistribute it and/or modify
18296 - it under the terms of the GNU General Public License as published by
18297 - the Free Software Foundation, either version 2 of the License, or
18298 - (at your option) any later version.
18299 -
18300 - libbash is distributed in the hope that it will be useful,
18301 - but WITHOUT ANY WARRANTY; without even the implied warranty of
18302 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18303 - GNU General Public License for more details.
18304 -
18305 - You should have received a copy of the GNU General Public License
18306 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
18307 -*/
18308 -///
18309 -/// \file function.hpp
18310 -/// \brief implementation for function
18311 -///
18312 -
18313 -#ifndef LIBBASH_CORE_FUNCTION_H_
18314 -#define LIBBASH_CORE_FUNCTION_H_
18315 -
18316 -#include "core/exceptions.h"
18317 -
18318 -#include <antlr3.h>
18319 -
18320 -class bash_ast;
18321 -class interpreter;
18322 -
18323 -class function
18324 -{
18325 - bash_ast& ast;
18326 - ANTLR3_MARKER index;
18327 -public:
18328 - function(bash_ast& ast_, ANTLR3_MARKER i): ast(ast_), index(i){}
18329 -
18330 - void call(interpreter& walker);
18331 -};
18332 -
18333 -#endif
18334
18335 diff --git a/libbash-0.1/src/core/illegal_argument_exception.h b/libbash-0.1/src/core/illegal_argument_exception.h
18336 deleted file mode 100644
18337 index f67a9f6..0000000
18338 --- a/libbash-0.1/src/core/illegal_argument_exception.h
18339 +++ /dev/null
18340 @@ -1,47 +0,0 @@
18341 -/*
18342 - Please use git log for copyright holder and year information
18343 -
18344 - This file is part of libbash.
18345 -
18346 - libbash is free software: you can redistribute it and/or modify
18347 - it under the terms of the GNU General Public License as published by
18348 - the Free Software Foundation, either version 2 of the License, or
18349 - (at your option) any later version.
18350 -
18351 - libbash is distributed in the hope that it will be useful,
18352 - but WITHOUT ANY WARRANTY; without even the implied warranty of
18353 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18354 - GNU General Public License for more details.
18355 -
18356 - You should have received a copy of the GNU General Public License
18357 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
18358 -*/
18359 -///
18360 -/// \file illegal_argument_exception.h
18361 -/// \brief implementation for illegal_argument_exception
18362 -///
18363 -
18364 -#ifndef LIBBASH_CORE_ILLEGAL_ARGUMENT_EXCEPTION_H_
18365 -#define LIBBASH_CORE_ILLEGAL_ARGUMENT_EXCEPTION_H_
18366 -
18367 -#include <stdexcept>
18368 -#include <string>
18369 -
18370 -#include "common.h"
18371 -#include "interpreter_exception.h"
18372 -
18373 -namespace libbash
18374 -{
18375 - ///
18376 - /// \class illegal_argument_exception
18377 - /// \brief exception for parsing errors
18378 - ///
18379 - class LIBBASH_API illegal_argument_exception: public libbash::interpreter_exception
18380 - {
18381 - public:
18382 - explicit illegal_argument_exception(const std::string& err_msg):
18383 - libbash::interpreter_exception(err_msg){}
18384 - };
18385 -}
18386 -
18387 -#endif
18388
18389 diff --git a/libbash-0.1/src/core/interpreter.cpp b/libbash-0.1/src/core/interpreter.cpp
18390 deleted file mode 100644
18391 index ed9f626..0000000
18392 --- a/libbash-0.1/src/core/interpreter.cpp
18393 +++ /dev/null
18394 @@ -1,437 +0,0 @@
18395 -/*
18396 - Please use git log for copyright holder and year information
18397 -
18398 - This file is part of libbash.
18399 -
18400 - libbash is free software: you can redistribute it and/or modify
18401 - it under the terms of the GNU General Public License as published by
18402 - the Free Software Foundation, either version 2 of the License, or
18403 - (at your option) any later version.
18404 -
18405 - libbash is distributed in the hope that it will be useful,
18406 - but WITHOUT ANY WARRANTY; without even the implied warranty of
18407 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18408 - GNU General Public License for more details.
18409 -
18410 - You should have received a copy of the GNU General Public License
18411 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
18412 -*/
18413 -///
18414 -/// \file interpreter.cpp
18415 -/// \brief implementations for bash interpreter (visitor pattern).
18416 -///
18417 -#include "core/interpreter.h"
18418 -
18419 -#include <cctype>
18420 -
18421 -#include <functional>
18422 -#include <limits>
18423 -
18424 -#include <boost/algorithm/string/classification.hpp>
18425 -#include <boost/algorithm/string/join.hpp>
18426 -#include <boost/algorithm/string/replace.hpp>
18427 -#include <boost/algorithm/string/split.hpp>
18428 -#include <boost/algorithm/string/trim.hpp>
18429 -#include <boost/foreach.hpp>
18430 -#include <boost/range/adaptor/filtered.hpp>
18431 -#include <boost/range/adaptor/map.hpp>
18432 -#include <boost/range/algorithm/copy.hpp>
18433 -
18434 -#include "core/bash_ast.h"
18435 -
18436 -namespace
18437 -{
18438 - std::string get_options(std::map<char, bool>& options)
18439 - {
18440 - std::string result;
18441 - boost::copy(options | boost::adaptors::map_keys
18442 - | boost::adaptors::filtered(
18443 - [&](char option) -> bool {
18444 - return options[option];
18445 - }
18446 - ),
18447 - back_inserter(result));
18448 - return result;
18449 - }
18450 -}
18451 -
18452 -interpreter::interpreter(): _out(&std::cout), _err(&std::cerr), _in(&std::cin), additional_options(
18453 - {
18454 - {"autocd", false},
18455 - {"cdable_vars", false},
18456 - {"cdspell", false},
18457 - {"checkhash", false},
18458 - {"checkjobs", false},
18459 - {"checkwinsize", false},
18460 - {"cmdhist", false},
18461 - {"compat31", false},
18462 - {"dirspell", false},
18463 - {"dotglob", false},
18464 - {"execfail", false},
18465 - {"expand_aliases", false},
18466 - {"extdebug", false},
18467 - {"extglob", false},
18468 - {"extquote", false},
18469 - {"failglob", false},
18470 - {"force_fignore", false},
18471 - {"globstar", false},
18472 - {"gnu_errfmt", false},
18473 - {"histappend", false},
18474 - {"histreedit", false},
18475 - {"histverify", false},
18476 - {"hostcomplete", false},
18477 - {"huponexit", false},
18478 - {"interactive", false},
18479 - {"lithist", false},
18480 - {"login_shell", false},
18481 - {"mailwarn", false},
18482 - {"no_empty_cmd_completion", false},
18483 - {"nocaseglob", false},
18484 - {"nocasematch", false},
18485 - {"nullglob", false},
18486 - {"progcomp", false},
18487 - {"promptvars", false},
18488 - {"restricted", false},
18489 - {"shift_verbose", false},
18490 - {"sourcepath", false},
18491 - {"xpg_echo", false},
18492 - }
18493 - ), options(
18494 - {
18495 - {'a', false},
18496 - {'b', false},
18497 - {'e', false},
18498 - {'f', false},
18499 - {'h', true},
18500 - {'k', false},
18501 - {'m', false},
18502 - {'n', false},
18503 - {'p', false},
18504 - {'t', false},
18505 - {'u', false},
18506 - {'v', false},
18507 - {'x', false},
18508 - {'B', true},
18509 - {'C', false},
18510 - {'E', false},
18511 - {'H', false},
18512 - {'P', false},
18513 - {'T', false},
18514 - }
18515 - ), status(0)
18516 -{
18517 - define("IFS", " \t\n");
18518 - // We do not support the options set by the shell itself (such as the -i option)
18519 - define("-", get_options(options));
18520 -}
18521 -
18522 -std::shared_ptr<variable> interpreter::resolve_variable(const std::string& name) const
18523 -{
18524 - if(name.empty())
18525 - return std::shared_ptr<variable>();
18526 -
18527 - BOOST_REVERSE_FOREACH(auto& frame, local_members)
18528 - {
18529 - auto iter_local = frame.find(name);
18530 - if(iter_local != frame.end())
18531 - return iter_local->second;
18532 - }
18533 -
18534 - auto iter_global = members.find(name);
18535 - if(iter_global == members.end())
18536 - return std::shared_ptr<variable>();
18537 - return iter_global->second;
18538 -}
18539 -
18540 -bool interpreter::is_unset_or_null(const std::string& name,
18541 - const unsigned index) const
18542 -{
18543 - auto var = resolve_variable(name);
18544 - if(!var)
18545 - return true;
18546 - return var->is_null(index);
18547 -}
18548 -
18549 -std::string interpreter::get_substring(const std::string& name,
18550 - long long offset,
18551 - unsigned length,
18552 - const unsigned index) const
18553 -{
18554 - std::string value = resolve<std::string>(name, index);
18555 - if(!get_real_offset(offset, boost::numeric_cast<unsigned>(value.size())))
18556 - return "";
18557 - // After get_real_offset, we know offset can be cast to unsigned.
18558 - return value.substr(boost::numeric_cast<std::string::size_type>(offset), length);
18559 -}
18560 -
18561 -const std::string interpreter::do_substring_expansion(const std::string& name,
18562 - long long offset,
18563 - const unsigned index) const
18564 -{
18565 - return get_substring(name, offset, std::numeric_limits<unsigned>::max(), index);
18566 -}
18567 -
18568 -const std::string interpreter::do_substring_expansion(const std::string& name,
18569 - long long offset,
18570 - int length,
18571 - const unsigned index) const
18572 -{
18573 - if(length < 0)
18574 - throw libbash::illegal_argument_exception("length of substring expression should be greater or equal to zero");
18575 -
18576 - return get_substring(name, offset, boost::numeric_cast<unsigned>(length), index);
18577 -}
18578 -
18579 -std::string interpreter::get_subarray(const std::string& name,
18580 - long long offset,
18581 - unsigned length) const
18582 -{
18583 - std::vector<std::string> array;
18584 - if(name == "*" || name == "@")
18585 - {
18586 - // ${*:1} has the same content as ${*}, ${*:0} contains current script name as the first element
18587 - if(offset > 0)
18588 - offset--;
18589 - else if(offset == 0)
18590 - array.push_back(resolve<std::string>("0"));
18591 - }
18592 - // We do not support arrays that have size bigger than numeric_limits<unsigned>::max()
18593 - if(resolve_array(name, array) && get_real_offset(offset, boost::numeric_cast<unsigned>(array.size())))
18594 - {
18595 - // We do not support arrays that have size bigger than numeric_limits<unsigned>::max()
18596 - // After get_real_offset, we know offset can be cast to unsigned.
18597 - unsigned max_length = boost::numeric_cast<unsigned>(array.size()) - boost::numeric_cast<unsigned>(offset);
18598 - if(length > max_length)
18599 - length = max_length;
18600 -
18601 - auto start = array.begin() + boost::numeric_cast<std::vector<std::string>::difference_type>(offset);
18602 - auto end = array.begin() + boost::numeric_cast<std::vector<std::string>::difference_type>(offset + length);
18603 - return boost::algorithm::join(std::vector<std::string>(start, end), resolve<std::string>("IFS").substr(0, 1));
18604 - }
18605 - else
18606 - {
18607 - return "";
18608 - }
18609 -}
18610 -
18611 -const std::string interpreter::do_subarray_expansion(const std::string& name,
18612 - long long offset) const
18613 -{
18614 - return get_subarray(name, offset, std::numeric_limits<unsigned>::max());
18615 -}
18616 -
18617 -const std::string interpreter::do_subarray_expansion(const std::string& name,
18618 - long long offset,
18619 - int length) const
18620 -{
18621 - if(length < 0)
18622 - throw libbash::illegal_argument_exception("length of substring expression should be greater or equal to zero");
18623 -
18624 - return get_subarray(name, offset, boost::numeric_cast<unsigned>(length));
18625 -}
18626 -
18627 -std::string interpreter::do_replace_expansion(const std::string& name,
18628 - std::function<void(std::string&)> replacer,
18629 - const unsigned index) const
18630 -{
18631 - std::string value = resolve<std::string>(name, index);
18632 - replacer(value);
18633 - return value;
18634 -}
18635 -
18636 -std::string::size_type interpreter::get_length(const std::string& name,
18637 - const unsigned index) const
18638 -{
18639 - auto var = resolve_variable(name);
18640 - if(!var)
18641 - return 0;
18642 - return var->get_length(index);
18643 -}
18644 -
18645 -variable::size_type interpreter::get_array_length(const std::string& name) const
18646 -{
18647 - auto var = resolve_variable(name);
18648 - if(!var)
18649 - return 0;
18650 - return var->get_array_length();
18651 -}
18652 -
18653 -void interpreter::get_all_elements_joined(const std::string& name,
18654 - const std::string& delim,
18655 - std::string& result) const
18656 -{
18657 - std::vector<std::string> array;
18658 -
18659 - if(resolve_array(name, array))
18660 - result = boost::algorithm::join(array, delim);
18661 - else
18662 - result = "";
18663 -}
18664 -
18665 -void interpreter::get_all_elements(const std::string& name,
18666 - std::string& result) const
18667 -{
18668 - get_all_elements_joined(name, " ", result);
18669 -}
18670 -
18671 -void interpreter::get_all_elements_IFS_joined(const std::string& name,
18672 - std::string& result) const
18673 -{
18674 - get_all_elements_joined(name,
18675 - resolve<std::string>("IFS").substr(0, 1),
18676 - result);
18677 -}
18678 -
18679 -void interpreter::split_word(const std::string& word, std::vector<std::string>& output) const
18680 -{
18681 - const std::string& delimeter = resolve<std::string>("IFS");
18682 - std::string trimmed(word);
18683 - boost::trim_if(trimmed, boost::is_any_of(delimeter));
18684 -
18685 - if(trimmed == "")
18686 - return;
18687 -
18688 - std::vector<std::string> splitted_values;
18689 - boost::split(splitted_values, trimmed, boost::is_any_of(delimeter), boost::token_compress_on);
18690 - output.insert(output.end(), splitted_values.begin(), splitted_values.end());
18691 -}
18692 -
18693 -void interpreter::define_function_arguments(scope& current_stack,
18694 - const std::vector<std::string>& arguments)
18695 -{
18696 - std::map<unsigned, std::string> positional_args;
18697 -
18698 - for(auto i = 1u; i <= arguments.size(); ++i)
18699 - positional_args[i] = arguments[i - 1];
18700 -
18701 - current_stack["*"].reset(new variable("*", positional_args, true));
18702 -}
18703 -
18704 -void interpreter::call(const std::string& name,
18705 - const std::vector<std::string>& arguments)
18706 -{
18707 - // Prepare arguments
18708 - define_function_arguments(local_members.back(), arguments);
18709 -
18710 - auto iter = functions.find(name);
18711 - if(iter != functions.end())
18712 - iter->second.call(*this);
18713 - else
18714 - throw libbash::runtime_exception(name + " is not defined.");
18715 -}
18716 -
18717 -void interpreter::replace_all(std::string& value,
18718 - const boost::xpressive::sregex& pattern,
18719 - const std::string& replacement)
18720 -{
18721 - value = boost::xpressive::regex_replace(value,
18722 - pattern,
18723 - replacement,
18724 - boost::xpressive::regex_constants::format_literal);
18725 -}
18726 -
18727 -void interpreter::lazy_remove_at_end(std::string& value,
18728 - const boost::xpressive::sregex& pattern)
18729 -{
18730 - boost::xpressive::smatch what;
18731 - if(boost::xpressive::regex_match(value,
18732 - what,
18733 - pattern))
18734 - value = what[1];
18735 -}
18736 -
18737 -void interpreter::replace_first(std::string& value,
18738 - const boost::xpressive::sregex& pattern,
18739 - const std::string& replacement)
18740 -{
18741 - value = boost::xpressive::regex_replace(value,
18742 - pattern,
18743 - replacement,
18744 - boost::xpressive::regex_constants::format_literal | boost::xpressive::regex_constants::format_first_only);
18745 -}
18746 -
18747 -void interpreter::trim_trailing_eols(std::string& value)
18748 -{
18749 - boost::trim_right_if(value, boost::is_any_of("\n"));
18750 -}
18751 -
18752 -void interpreter::get_all_function_names(std::vector<std::string>& function_names) const
18753 -{
18754 - boost::copy(functions | boost::adaptors::map_keys, back_inserter(function_names));
18755 -}
18756 -
18757 -namespace
18758 -{
18759 - void check_unset_positional(const std::string& name)
18760 - {
18761 - // Unsetting positional parameters is not allowed
18762 - if(isdigit(name[0]))
18763 - throw libbash::runtime_exception("unset: not a valid identifier");
18764 - }
18765 -}
18766 -
18767 -void interpreter::unset(const std::string& name)
18768 -{
18769 - check_unset_positional(name);
18770 -
18771 - auto unsetter = [&](scope& frame) -> bool {
18772 - auto iter_local = frame.find(name);
18773 - if(iter_local != frame.end())
18774 - {
18775 - if(iter_local->second->is_readonly())
18776 - throw libbash::readonly_exception("unset a readonly variable");
18777 - frame.erase(iter_local);
18778 - return true;
18779 - }
18780 - return false;
18781 - };
18782 -
18783 - if(std::none_of(local_members.rbegin(), local_members.rend(), unsetter))
18784 - unsetter(members);
18785 -}
18786 -
18787 -// We need to return false when unsetting readonly functions in future
18788 -void interpreter::unset_function(const std::string& name)
18789 -{
18790 - auto function = functions.find(name);
18791 - if(function != functions.end())
18792 - functions.erase(name);
18793 -}
18794 -
18795 -void interpreter::unset(const std::string& name,
18796 - const unsigned index)
18797 -{
18798 - check_unset_positional(name);
18799 -
18800 - auto var = resolve_variable(name);
18801 - if(var)
18802 - {
18803 - if(var->is_readonly())
18804 - throw libbash::readonly_exception("unset a readonly variable");
18805 - var->unset_value(index);
18806 - }
18807 -}
18808 -
18809 -bool interpreter::get_additional_option(const std::string& name) const
18810 -{
18811 - auto iter = additional_options.find(name);
18812 - if(iter == additional_options.end())
18813 - throw libbash::illegal_argument_exception("Invalid bash option");
18814 -
18815 - return iter->second;
18816 -}
18817 -
18818 -void interpreter::set_additional_option(const std::string& name, bool value)
18819 -{
18820 - auto iter = additional_options.find(name);
18821 - if(iter == additional_options.end())
18822 - throw libbash::illegal_argument_exception(name + " is not a valid bash option");
18823 -
18824 - iter->second = value;
18825 -}
18826 -
18827 -long interpreter::eval_arithmetic(const std::string& expression)
18828 -{
18829 - bash_ast ast(std::stringstream(expression), &bash_ast::parser_arithmetics);
18830 - return ast.interpret_with(*this, &bash_ast::walker_arithmetics);
18831 -}
18832
18833 diff --git a/libbash-0.1/src/core/interpreter.h b/libbash-0.1/src/core/interpreter.h
18834 deleted file mode 100644
18835 index b0cfda5..0000000
18836 --- a/libbash-0.1/src/core/interpreter.h
18837 +++ /dev/null
18838 @@ -1,517 +0,0 @@
18839 -/*
18840 - Please use git log for copyright holder and year information
18841 -
18842 - This file is part of libbash.
18843 -
18844 - libbash is free software: you can redistribute it and/or modify
18845 - it under the terms of the GNU General Public License as published by
18846 - the Free Software Foundation, either version 2 of the License, or
18847 - (at your option) any later version.
18848 -
18849 - libbash is distributed in the hope that it will be useful,
18850 - but WITHOUT ANY WARRANTY; without even the implied warranty of
18851 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18852 - GNU General Public License for more details.
18853 -
18854 - You should have received a copy of the GNU General Public License
18855 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
18856 -*/
18857 -///
18858 -/// \file interpreter.h
18859 -/// \brief implementation for bash interpreter (visitor pattern)
18860 -///
18861 -
18862 -#ifndef LIBBASH_CORE_INTERPRETER_H_
18863 -#define LIBBASH_CORE_INTERPRETER_H_
18864 -
18865 -#include <functional>
18866 -#include <memory>
18867 -#include <string>
18868 -
18869 -#include <boost/utility.hpp>
18870 -#include <boost/xpressive/xpressive.hpp>
18871 -#include <boost/numeric/conversion/cast.hpp>
18872 -
18873 -#include "core/function.h"
18874 -#include "core/symbols.hpp"
18875 -#include "cppbash_builtin.h"
18876 -
18877 -typedef std::unordered_map<std::string, std::shared_ptr<variable>> scope;
18878 -
18879 -///
18880 -/// \class interpreter
18881 -/// \brief implementation for bash interpreter
18882 -///
18883 -class interpreter: public boost::noncopyable
18884 -{
18885 -
18886 - /// \var private::members
18887 - /// \brief global symbol table for variables
18888 - scope members;
18889 -
18890 - /// \var private::function_definitions
18891 - /// \brief global symbol table for functions
18892 - std::unordered_map<std::string, function> functions;
18893 -
18894 - std::stack<bash_ast*> ast_stack;
18895 -
18896 - /// \var private::local_members
18897 - /// \brief local scope for function arguments, execution environment and
18898 - /// local variables
18899 - std::vector<scope> local_members;
18900 -
18901 - std::ostream* _out;
18902 -
18903 - std::ostream* _err;
18904 -
18905 - std::istream* _in;
18906 -
18907 - // std::map is chosen for sorted output in shopt -p
18908 - std::map<std::string, bool> additional_options;
18909 -
18910 - // std::map is chosen for sorted output in $-. The order may not be the same
18911 - // as bash implementation.
18912 - std::map<char, bool> options;
18913 -
18914 - /// \var private::status
18915 - /// \brief the return status of the last command
18916 - int status;
18917 -
18918 - /// \brief calculate the correct offset when offset < 0 and check whether
18919 - /// the real offset is in legal range
18920 - /// \param[in,out] a value/result argument referring to offset
18921 - /// \param[in] the original string
18922 - /// \return whether the real offset is in legal range
18923 - bool get_real_offset(long long& offset, const unsigned size) const
18924 - {
18925 - offset = (offset >= 0? offset : size + offset);
18926 - return !(offset < 0 || offset >= size);
18927 - }
18928 -
18929 - void get_all_elements_joined(const std::string& name,
18930 - const std::string& delim,
18931 - std::string& result) const;
18932 -
18933 - std::shared_ptr<variable> resolve_variable(const std::string&) const;
18934 -
18935 - void define_function_arguments(scope& current_stack,
18936 - const std::vector<std::string>& arguments);
18937 -
18938 - std::string get_substring(const std::string& name,
18939 - long long offset,
18940 - unsigned length,
18941 - const unsigned index) const;
18942 -
18943 - std::string get_subarray(const std::string& name,
18944 - long long offset,
18945 - unsigned length) const;
18946 -public:
18947 -
18948 - typedef std::map<std::string, bool>::const_iterator option_iterator;
18949 -
18950 - ///
18951 - /// \class local_scope
18952 - /// \brief RAII concept for local scope management
18953 - ///
18954 - class local_scope
18955 - {
18956 - interpreter& walker;
18957 -
18958 - public:
18959 - local_scope(interpreter& w): walker(w)
18960 - {
18961 - walker.local_members.push_back(scope());
18962 - }
18963 -
18964 - ~local_scope()
18965 - {
18966 - walker.local_members.pop_back();
18967 - }
18968 - };
18969 -
18970 - interpreter();
18971 -
18972 - ///
18973 - /// \brief return the number of variables
18974 - /// \return the number of variables
18975 - scope::size_type size() const
18976 - {
18977 - return members.size();
18978 - }
18979 -
18980 - ///
18981 - /// \brief return an iterator referring to the first variable
18982 - /// \return iterator referring to the first variable
18983 - scope::iterator begin()
18984 - {
18985 - return members.begin();
18986 - }
18987 -
18988 - ///
18989 - /// \brief return a const iterator referring to the first variable
18990 - /// \return const iterator referring to the first variable
18991 - scope::const_iterator begin() const
18992 - {
18993 - return members.begin();
18994 - }
18995 -
18996 - ///
18997 - /// \brief return an iterator referring to the next element after the
18998 - /// last variable
18999 - /// \return iterator referring to he next element after the last variable
19000 - scope::iterator end()
19001 - {
19002 - return members.end();
19003 - }
19004 -
19005 - ///
19006 - /// \brief return a const iterator referring to the next element after
19007 - /// the last variable
19008 - /// \return const iterator referring to he next element after the last
19009 - /// variable
19010 - scope::const_iterator end() const
19011 - {
19012 - return members.end();
19013 - }
19014 -
19015 - void set_output_stream(std::ostream* stream)
19016 - {
19017 - _out = stream;
19018 - }
19019 -
19020 - void restore_output_stream()
19021 - {
19022 - _out = &std::cout;
19023 - }
19024 -
19025 - /// \brief resolve string/long variable, local scope will be
19026 - /// checked first, then global scope
19027 - /// \param variable name
19028 - /// \param array index, use index=0 if it's not an array
19029 - /// \return the value of the variable, call default constructor if
19030 - /// it's undefined
19031 - template <typename T>
19032 - T resolve(const std::string& name, const unsigned index=0) const
19033 - {
19034 - auto var = resolve_variable(name);
19035 - if(var)
19036 - return var->get_value<T>(index);
19037 - else
19038 - return T{};
19039 - }
19040 -
19041 - /// \brief resolve array variable
19042 - /// \param variable name
19043 - /// \param[out] vector that stores all array values
19044 - template <typename T>
19045 - bool resolve_array(const std::string& name, std::vector<T>& values) const
19046 - {
19047 - auto var = resolve_variable(name);
19048 - if(!var)
19049 - return false;
19050 -
19051 - var->get_all_values(values);
19052 - return true;
19053 - }
19054 -
19055 - /// \brief check whether the value of the variable is null, return true
19056 - /// if the variable is undefined
19057 - /// \param variable name
19058 - /// \return whether the value of the variable is null
19059 - bool is_unset_or_null(const std::string& name, const unsigned index) const;
19060 -
19061 - /// \brief check whether the value of the variable is unset
19062 - /// \param variable name
19063 - /// \return whether the value of the variable is unset
19064 - bool is_unset(const std::string& name) const
19065 - {
19066 - return members.find(name) == members.end();
19067 - }
19068 -
19069 - /// \brief update the variable value, raise libbash::interpreter_exception if
19070 - /// it's readonly, will define the variable if it doesn't exist
19071 - /// \param variable name
19072 - /// \param new value
19073 - /// \param array index, use index=0 if it's not an array
19074 - /// \return the new value of the variable
19075 - template <typename T>
19076 - const T& set_value(const std::string& name,
19077 - const T& new_value,
19078 - const unsigned index=0)
19079 - {
19080 - auto var = resolve_variable(name);
19081 - if(var)
19082 - var->set_value(new_value, index);
19083 - else
19084 - define(name, new_value, false, index);
19085 - return new_value;
19086 - }
19087 -
19088 - /// \brief set the return status of the last command
19089 - /// \param the value of the return status
19090 - void set_status(int s)
19091 - {
19092 - status = s;
19093 - }
19094 -
19095 - /// \brief get the return status of the last command
19096 - /// \param the value of the return status
19097 - int get_status(void) const
19098 - {
19099 - return status;
19100 - }
19101 -
19102 - /// \brief unset a variable
19103 - /// \param the name of the variable
19104 - void unset(const std::string& name);
19105 -
19106 - /// \brief unset a function
19107 - /// \param the name of the function
19108 - void unset_function(const std::string& name);
19109 -
19110 - /// \brief unset a array member
19111 - /// \param the name of the array
19112 - /// \param the index of the member
19113 - void unset(const std::string& name, const unsigned index);
19114 -
19115 - /// \brief define a new global variable
19116 - /// \param the name of the variable
19117 - /// \param the value of the variable
19118 - /// \param whether it's readonly, default is false
19119 - /// \param whether it's null, default is false
19120 - template <typename T>
19121 - void define(const std::string& name,
19122 - const T& value,
19123 - bool readonly=false,
19124 - const unsigned index=0)
19125 - {
19126 - members[name].reset(new variable(name, value, readonly, index));
19127 - }
19128 -
19129 - /// \brief define a new local variable
19130 - /// \param the name of the variable
19131 - /// \param the value of the variable
19132 - /// \param whether it's readonly, default is false
19133 - /// \param whether it's null, default is false
19134 - template <typename T>
19135 - void define_local(const std::string& name,
19136 - const T& value,
19137 - bool readonly=false,
19138 - const unsigned index=0)
19139 - {
19140 - local_members.back()[name].reset(new variable(name, value, readonly, index));
19141 - }
19142 -
19143 - /// \brief define a new function
19144 - /// \param the name of the function
19145 - /// \param the body index of the function
19146 - void define_function(const std::string& name,
19147 - ANTLR3_MARKER body_index)
19148 - {
19149 - functions.insert(make_pair(name, function(*ast_stack.top(), body_index)));
19150 - }
19151 -
19152 - /// \brief push current AST, used for function definition
19153 - /// \param current ast
19154 - void push_current_ast(bash_ast* ast)
19155 - {
19156 - ast_stack.push(ast);
19157 - }
19158 -
19159 - /// \brief pop current AST, used for function definition
19160 - void pop_current_ast()
19161 - {
19162 - ast_stack.pop();
19163 - }
19164 -
19165 - /// \brief make function call
19166 - /// \param function name
19167 - /// \param function arguments
19168 - void call(const std::string& name,
19169 - const std::vector<std::string>& arguments);
19170 -
19171 - /// \brief check if we have 'name' defined as a function
19172 - /// \param function name
19173 - /// \return whether 'name' is a function
19174 - bool has_function(const std::string& name) const
19175 - {
19176 - return functions.find(name) != functions.end();
19177 - }
19178 -
19179 - void get_all_function_names(std::vector<std::string>& function_names) const;
19180 -
19181 - /// \brief execute builtin
19182 - /// \param builtin name
19183 - /// \param builtin arguments
19184 - /// \return the return value of the builtin
19185 - int execute_builtin(const std::string& name,
19186 - const std::vector<std::string>& args,
19187 - std::ostream* output=0,
19188 - std::ostream* error=0,
19189 - std::istream* input=0)
19190 - {
19191 - return cppbash_builtin::exec(name,
19192 - args,
19193 - output == 0 ? *_out : *output,
19194 - error == 0 ? *_err : *error,
19195 - input == 0 ? *_in : *input,
19196 - *this);
19197 - }
19198 -
19199 - /// \brief perform ${parameter:−word} expansion
19200 - /// \param the name of the parameter
19201 - /// \param the value of the word
19202 - /// \return the expansion result
19203 - const std::string do_default_expansion(const std::string& name,
19204 - const std::string& value,
19205 - const unsigned index) const
19206 - {
19207 - return (is_unset_or_null(name, index)?
19208 - value : resolve<std::string>(name, index));
19209 - }
19210 -
19211 - /// \brief perform ${parameter:=word} expansion
19212 - /// \param the name of the parameter
19213 - /// \param the value of the word
19214 - /// \return the expansion result
19215 - const std::string do_assign_expansion(const std::string& name,
19216 - const std::string& value,
19217 - const unsigned index)
19218 - {
19219 - return (is_unset_or_null(name, index)?
19220 - set_value(name, value, index) : resolve<std::string>(name, index));
19221 - }
19222 -
19223 - /// \brief perform ${parameter:+word} expansion
19224 - /// \param the name of the parameter
19225 - /// \param the value of the word
19226 - /// \return the expansion result
19227 - const std::string do_alternate_expansion(const std::string& name,
19228 - const std::string& value,
19229 - const unsigned index) const
19230 - {
19231 - return (is_unset_or_null(name, index)? "" : value);
19232 - }
19233 -
19234 - /// \brief perform substring expansion
19235 - /// \param the offset of the substring
19236 - /// \return the expansion result
19237 - const std::string do_substring_expansion(const std::string& name,
19238 - long long offset,
19239 - const unsigned index) const;
19240 -
19241 - /// \brief perform substring expansion
19242 - /// \param the offset of the substring
19243 - /// \param the length of the substring
19244 - /// \return the expansion result
19245 - const std::string do_substring_expansion(const std::string& name,
19246 - long long offset,
19247 - int length,
19248 - const unsigned index) const;
19249 -
19250 - /// \brief perform subarray expansion
19251 - /// \param the offset of the subarray
19252 - /// \return the expansion result
19253 - const std::string do_subarray_expansion(const std::string& name,
19254 - long long offset) const;
19255 -
19256 - /// \brief perform subarray expansion
19257 - /// \param the offset of the subarray
19258 - /// \param the length of the subarray
19259 - /// \return the expansion result
19260 - const std::string do_subarray_expansion(const std::string& name,
19261 - long long offset,
19262 - int length) const;
19263 -
19264 - /// \brief perform replacement expansion
19265 - /// \param the name of the varaible that needs to be expanded
19266 - /// \param the function object used to perform expansion
19267 - /// \param array index, use index=0 if it's not an array
19268 - /// \return the expanded value
19269 - std::string do_replace_expansion(const std::string& name,
19270 - std::function<void(std::string&)> replacer,
19271 - const unsigned index) const;
19272 -
19273 - /// \brief get the length of a string variable
19274 - /// \param the name of the variable
19275 - /// \return the length
19276 - std::string::size_type get_length(const std::string& name, const unsigned index=0) const;
19277 -
19278 - /// \brief get the length of an array
19279 - /// \param the name of the array
19280 - /// \return the length of the array
19281 - variable::size_type get_array_length(const std::string& name) const;
19282 -
19283 - /// \brief get all array elements concatenated by space
19284 - /// \param the name of the array
19285 - /// \param[out] the concatenated string
19286 - void get_all_elements(const std::string&, std::string&) const;
19287 -
19288 - /// \brief get all array elements concatenated by the first character of IFS
19289 - /// \param the name of the array
19290 - /// \param[out] the concatenated string
19291 - void get_all_elements_IFS_joined(const std::string&, std::string&) const;
19292 -
19293 - /// \brief implementation of word splitting
19294 - /// \param the value of the word
19295 - //. \param[out] the splitted result will be appended to output
19296 - void split_word(const std::string& word, std::vector<std::string>& output) const;
19297 -
19298 - /// \brief get the status of shell optional behavior
19299 - /// \param the option name
19300 - /// \return zero unless the name is not a valid shell option
19301 - bool get_additional_option(const std::string& name) const;
19302 -
19303 - /// \brief set the status of shell optional behavior
19304 - /// \param the option name
19305 - /// \param[in] true if option is enabled, false otherwise
19306 - /// \return zero unless the name is not a valid shell option
19307 - void set_additional_option(const std::string& name, bool value);
19308 -
19309 - /// \brief return an iterator referring to the first variable
19310 - /// \return iterator referring to the first variable
19311 - option_iterator additional_options_begin() const
19312 - {
19313 - return additional_options.begin();
19314 - }
19315 -
19316 - /// \brief return an iterator referring to the next element after the
19317 - /// last variable
19318 - /// \return iterator referring to he next element after the last variable
19319 - option_iterator additional_options_end() const
19320 - {
19321 - return additional_options.end();
19322 - }
19323 -
19324 - /// \brief evaluate arithmetic expression and return the result
19325 - /// \param the arithmetic expression
19326 - /// \return the evaluated result
19327 - long eval_arithmetic(const std::string& expression);
19328 -
19329 - /// \brief perform expansion like ${var//foo/bar}
19330 - /// \param the value to be expanded
19331 - /// \param the pattern used to match the value
19332 - /// \param the replacement string
19333 - static void replace_all(std::string& value,
19334 - const boost::xpressive::sregex& pattern,
19335 - const std::string& replacement);
19336 -
19337 - /// \brief perform expansion like ${var%foo}
19338 - /// \param the value to be expanded
19339 - /// \param the pattern used to match the value
19340 - static void lazy_remove_at_end(std::string& value,
19341 - const boost::xpressive::sregex& pattern);
19342 -
19343 - /// \brief perform expansion like ${var/foo/bar}
19344 - /// \param the value to be expanded
19345 - /// \param the pattern used to match the value
19346 - /// \param the replacement string
19347 - static void replace_first(std::string& value,
19348 - const boost::xpressive::sregex& pattern,
19349 - const std::string& replacement);
19350 -
19351 - /// \brief remove trailing EOLs from the value
19352 - /// \param[in, out] the target
19353 - static void trim_trailing_eols(std::string& value);
19354 -};
19355 -#endif
19356
19357 diff --git a/libbash-0.1/src/core/interpreter_exception.h b/libbash-0.1/src/core/interpreter_exception.h
19358 deleted file mode 100644
19359 index ea5a9ef..0000000
19360 --- a/libbash-0.1/src/core/interpreter_exception.h
19361 +++ /dev/null
19362 @@ -1,46 +0,0 @@
19363 -/*
19364 - Please use git log for copyright holder and year information
19365 -
19366 - This file is part of libbash.
19367 -
19368 - libbash is free software: you can redistribute it and/or modify
19369 - it under the terms of the GNU General Public License as published by
19370 - the Free Software Foundation, either version 2 of the License, or
19371 - (at your option) any later version.
19372 -
19373 - libbash is distributed in the hope that it will be useful,
19374 - but WITHOUT ANY WARRANTY; without even the implied warranty of
19375 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19376 - GNU General Public License for more details.
19377 -
19378 - You should have received a copy of the GNU General Public License
19379 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
19380 -*/
19381 -///
19382 -/// \file interpreter_exception.h
19383 -/// \brief implementation for interpreter_exception
19384 -///
19385 -
19386 -#ifndef LIBBASH_CORE_INTERPRETER_EXCEPTION_H_
19387 -#define LIBBASH_CORE_INTERPRETER_EXCEPTION_H_
19388 -
19389 -#include <stdexcept>
19390 -#include <string>
19391 -
19392 -#include "common.h"
19393 -
19394 -namespace libbash
19395 -{
19396 - ///
19397 - /// \class interpreter_exception
19398 - /// \brief runtime exception occured during interpreting
19399 - ///
19400 - class LIBBASH_API interpreter_exception: public std::runtime_error
19401 - {
19402 - public:
19403 - explicit interpreter_exception(const std::string& err_msg):
19404 - runtime_error(err_msg){}
19405 - };
19406 -}
19407 -
19408 -#endif
19409
19410 diff --git a/libbash-0.1/src/core/parse_exception.h b/libbash-0.1/src/core/parse_exception.h
19411 deleted file mode 100644
19412 index 20860b4..0000000
19413 --- a/libbash-0.1/src/core/parse_exception.h
19414 +++ /dev/null
19415 @@ -1,47 +0,0 @@
19416 -/*
19417 - Please use git log for copyright holder and year information
19418 -
19419 - This file is part of libbash.
19420 -
19421 - libbash is free software: you can redistribute it and/or modify
19422 - it under the terms of the GNU General Public License as published by
19423 - the Free Software Foundation, either version 2 of the License, or
19424 - (at your option) any later version.
19425 -
19426 - libbash is distributed in the hope that it will be useful,
19427 - but WITHOUT ANY WARRANTY; without even the implied warranty of
19428 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19429 - GNU General Public License for more details.
19430 -
19431 - You should have received a copy of the GNU General Public License
19432 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
19433 -*/
19434 -///
19435 -/// \file parse_exception.h
19436 -/// \brief implementation for parse_exception
19437 -///
19438 -
19439 -#ifndef LIBBASH_CORE_PARSE_EXCEPTION_H_
19440 -#define LIBBASH_CORE_PARSE_EXCEPTION_H_
19441 -
19442 -#include <stdexcept>
19443 -#include <string>
19444 -
19445 -#include "common.h"
19446 -#include "interpreter_exception.h"
19447 -
19448 -namespace libbash
19449 -{
19450 - ///
19451 - /// \class parse_exception
19452 - /// \brief exception for parsing errors
19453 - ///
19454 - class LIBBASH_API parse_exception: public libbash::interpreter_exception
19455 - {
19456 - public:
19457 - explicit parse_exception(const std::string& err_msg):
19458 - libbash::interpreter_exception(err_msg){}
19459 - };
19460 -}
19461 -
19462 -#endif
19463
19464 diff --git a/libbash-0.1/src/core/readonly_exception.h b/libbash-0.1/src/core/readonly_exception.h
19465 deleted file mode 100644
19466 index 97964de..0000000
19467 --- a/libbash-0.1/src/core/readonly_exception.h
19468 +++ /dev/null
19469 @@ -1,47 +0,0 @@
19470 -/*
19471 - Please use git log for copyright holder and year information
19472 -
19473 - This file is part of libbash.
19474 -
19475 - libbash is free software: you can redistribute it and/or modify
19476 - it under the terms of the GNU General Public License as published by
19477 - the Free Software Foundation, either version 2 of the License, or
19478 - (at your option) any later version.
19479 -
19480 - libbash is distributed in the hope that it will be useful,
19481 - but WITHOUT ANY WARRANTY; without even the implied warranty of
19482 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19483 - GNU General Public License for more details.
19484 -
19485 - You should have received a copy of the GNU General Public License
19486 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
19487 -*/
19488 -///
19489 -/// \file readonly_exception.h
19490 -/// \brief implementation for readonly_exception
19491 -///
19492 -
19493 -#ifndef LIBBASH_CORE_READONLY_EXCEPTION_H_
19494 -#define LIBBASH_CORE_READONLY_EXCEPTION_H_
19495 -
19496 -#include <stdexcept>
19497 -#include <string>
19498 -
19499 -#include "common.h"
19500 -#include "interpreter_exception.h"
19501 -
19502 -namespace libbash
19503 -{
19504 - ///
19505 - /// \class readonly_exception
19506 - /// \brief exception for modifying readonly symbols
19507 - ///
19508 - class LIBBASH_API readonly_exception: public libbash::interpreter_exception
19509 - {
19510 - public:
19511 - explicit readonly_exception(const std::string& err_msg):
19512 - libbash::interpreter_exception(err_msg){}
19513 - };
19514 -}
19515 -
19516 -#endif
19517
19518 diff --git a/libbash-0.1/src/core/runtime_exception.h b/libbash-0.1/src/core/runtime_exception.h
19519 deleted file mode 100644
19520 index da6fffa..0000000
19521 --- a/libbash-0.1/src/core/runtime_exception.h
19522 +++ /dev/null
19523 @@ -1,47 +0,0 @@
19524 -/*
19525 - Please use git log for copyright holder and year information
19526 -
19527 - This file is part of libbash.
19528 -
19529 - libbash is free software: you can redistribute it and/or modify
19530 - it under the terms of the GNU General Public License as published by
19531 - the Free Software Foundation, either version 2 of the License, or
19532 - (at your option) any later version.
19533 -
19534 - libbash is distributed in the hope that it will be useful,
19535 - but WITHOUT ANY WARRANTY; without even the implied warranty of
19536 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19537 - GNU General Public License for more details.
19538 -
19539 - You should have received a copy of the GNU General Public License
19540 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
19541 -*/
19542 -///
19543 -/// \file runtime_exception.h
19544 -/// \brief implementation for runtime_exception
19545 -///
19546 -
19547 -#ifndef LIBBASH_CORE_RUNTIME_EXCEPTION_H_
19548 -#define LIBBASH_CORE_RUNTIME_EXCEPTION_H_
19549 -
19550 -#include <stdexcept>
19551 -#include <string>
19552 -
19553 -#include "common.h"
19554 -#include "interpreter_exception.h"
19555 -
19556 -namespace libbash
19557 -{
19558 - ///
19559 - /// \class runtime_exception
19560 - /// \brief exception for runtime errors
19561 - ///
19562 - class LIBBASH_API runtime_exception: public libbash::interpreter_exception
19563 - {
19564 - public:
19565 - explicit runtime_exception(const std::string& err_msg):
19566 - libbash::interpreter_exception(err_msg){}
19567 - };
19568 -}
19569 -
19570 -#endif
19571
19572 diff --git a/libbash-0.1/src/core/symbols.hpp b/libbash-0.1/src/core/symbols.hpp
19573 deleted file mode 100644
19574 index 8c6dec7..0000000
19575 --- a/libbash-0.1/src/core/symbols.hpp
19576 +++ /dev/null
19577 @@ -1,246 +0,0 @@
19578 -/*
19579 - Please use git log for copyright holder and year information
19580 -
19581 - This file is part of libbash.
19582 -
19583 - libbash is free software: you can redistribute it and/or modify
19584 - it under the terms of the GNU General Public License as published by
19585 - the Free Software Foundation, either version 2 of the License, or
19586 - (at your option) any later version.
19587 -
19588 - libbash is distributed in the hope that it will be useful,
19589 - but WITHOUT ANY WARRANTY; without even the implied warranty of
19590 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19591 - GNU General Public License for more details.
19592 -
19593 - You should have received a copy of the GNU General Public License
19594 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
19595 -*/
19596 -///
19597 -/// \file symbols.hpp
19598 -/// \brief template implementation for symbols and symbol table
19599 -///
19600 -
19601 -#ifndef LIBBASH_CORE_SYMBOLS_HPP_
19602 -#define LIBBASH_CORE_SYMBOLS_HPP_
19603 -
19604 -#include <map>
19605 -#include <memory>
19606 -#include <sstream>
19607 -#include <string>
19608 -#include <unordered_map>
19609 -#include <vector>
19610 -
19611 -#include <boost/variant.hpp>
19612 -#include <boost/lexical_cast.hpp>
19613 -
19614 -#include "core/exceptions.h"
19615 -
19616 -///
19617 -/// \class converter
19618 -/// \brief template class of converter
19619 -///
19620 -template<typename T>
19621 -class converter: public boost::static_visitor<T>
19622 -{};
19623 -
19624 -///
19625 -/// \class converter
19626 -/// \brief specialized converter for long
19627 -///
19628 -template<>
19629 -class converter<long>: public boost::static_visitor<long>
19630 -{
19631 -public:
19632 - /// \brief converter for long value
19633 - /// \param the value to be converted
19634 - /// \return the converted long
19635 - long operator() (const long value) const
19636 - {
19637 - return value;
19638 - }
19639 -
19640 - /// \brief converter for string value
19641 - /// \param the value to be converted
19642 - /// \return the converted long
19643 - long operator() (const std::string& value) const
19644 - {
19645 - long result = 0;
19646 - try
19647 - {
19648 - result = boost::lexical_cast<long>(value);
19649 - }
19650 - catch(boost::bad_lexical_cast& e)
19651 - {
19652 - std::cerr << "can't cast " << value << " to long" << std::endl;
19653 - }
19654 - return result;
19655 - }
19656 -};
19657 -
19658 -///
19659 -/// \class converter
19660 -/// \brief specialized converter for string
19661 -///
19662 -template<>
19663 -class converter<std::string>:
19664 - public boost::static_visitor<std::string>
19665 -{
19666 -public:
19667 - /// \brief converter for long value
19668 - /// \param the value to be converted
19669 - /// \return the converted string
19670 - std::string operator() (const long value) const
19671 - {
19672 - return boost::lexical_cast<std::string>(value);
19673 - }
19674 -
19675 - /// \brief converter for string value
19676 - /// \param the value to be converted
19677 - /// \return the converted string
19678 - std::string operator() (const std::string& value) const
19679 - {
19680 - return value;
19681 - }
19682 -};
19683 -
19684 -///
19685 -/// \class variable
19686 -/// \brief implementation for all variable types
19687 -///
19688 -class variable
19689 -{
19690 - /// \var private::name
19691 - /// \brief variable name
19692 - std::string name;
19693 -
19694 - /// \var private::value
19695 - /// \brief actual value of the variable. We put string in front of long
19696 - /// because we want "" as default string value; Otherwise we
19697 - /// will get "0".
19698 - std::map<unsigned, boost::variant<std::string, long>> value;
19699 -
19700 - /// \var private::readonly
19701 - /// \brief whether the variable is readonly
19702 - bool readonly;
19703 -
19704 -public:
19705 - typedef std::map<unsigned, boost::variant<std::string, long>>::size_type size_type;
19706 -
19707 - /// \brief retrieve variable name
19708 - /// \return const string value of variable name
19709 - const std::string& get_name() const
19710 - {
19711 - return name;
19712 - }
19713 -
19714 - template <typename T>
19715 - variable(const std::string& name,
19716 - const T& v,
19717 - bool ro=false,
19718 - const unsigned index=0)
19719 - : name(name), readonly(ro)
19720 - {
19721 - value[index] = v;
19722 - }
19723 -
19724 - /// \brief retrieve actual value of the variable, if index is out of bound,
19725 - /// will return the default value of type T
19726 - /// \return the value of the variable
19727 - template<typename T>
19728 - T get_value(const unsigned index=0) const
19729 - {
19730 - static converter<T> visitor;
19731 -
19732 - auto iter = value.find(index);
19733 - if(iter == value.end())
19734 - return T{};
19735 -
19736 - return boost::apply_visitor(visitor, iter->second);
19737 - }
19738 -
19739 - /// \brief retrieve all values of the array
19740 - /// \param[out] vector that stores all array values
19741 - template<typename T>
19742 - void get_all_values(std::vector<T>& all_values) const
19743 - {
19744 - static converter<T> visitor;
19745 -
19746 - for(auto iter = value.begin(); iter != value.end(); ++iter)
19747 - all_values.push_back(
19748 - boost::apply_visitor(visitor, iter->second));
19749 - }
19750 -
19751 -
19752 - /// \brief set the value of the variable, raise exception if it's readonly
19753 - /// \param the new value to be set
19754 - /// \param array index, use index=0 if it's not an array
19755 - /// \param whether to set the variable to null value, default is false
19756 - template <typename T>
19757 - void set_value(const T& new_value,
19758 - const unsigned index=0)
19759 - {
19760 - if(readonly)
19761 - throw libbash::readonly_exception(get_name() + " is readonly variable");
19762 -
19763 - value[index] = new_value;
19764 - }
19765 -
19766 - /// \brief unset the variable, only used for array variable
19767 - /// \param the index to be unset
19768 - void unset_value(const unsigned index)
19769 - {
19770 - if(readonly)
19771 - throw libbash::readonly_exception(get_name() + " is readonly variable");
19772 -
19773 - value.erase(index);
19774 - }
19775 -
19776 - /// \brief get the length of a variable
19777 - /// \param the index of the variable, use 0 if it's not an array
19778 - /// \return the length of the variable
19779 - std::string::size_type get_length(const unsigned index=0) const
19780 - {
19781 - return get_value<std::string>(index).size();
19782 - }
19783 -
19784 - /// \brief get the length of an array variable
19785 - /// \return the length of the array
19786 - size_type get_array_length() const
19787 - {
19788 - return value.size();
19789 - }
19790 -
19791 - /// \brief check whether the value of the variable is null
19792 - /// \return whether the value of the variable is null
19793 - bool is_unset(const unsigned index=0) const
19794 - {
19795 - return value.find(index) == value.end();
19796 - }
19797 -
19798 - /// \brief check whether the value of the variable is unset
19799 - /// \return whether the value of the variable is unset
19800 - bool is_null(const unsigned index=0) const
19801 - {
19802 - return get_value<std::string>(index) == "";
19803 - }
19804 -
19805 - /// \brief check whether the value of the variable is readonly
19806 - /// \return whether the value of the variable is readonly
19807 - bool is_readonly() const
19808 - {
19809 - return readonly;
19810 - }
19811 -};
19812 -
19813 -// specialization for arrays
19814 -template <>
19815 -inline variable::variable<>(const std::string& name,
19816 - const std::map<unsigned, std::string>& v,
19817 - bool ro,
19818 - unsigned)
19819 - : name(name), value(v.begin(), v.end()), readonly(ro)
19820 -{
19821 -}
19822 -
19823 -#endif
19824
19825 diff --git a/libbash-0.1/src/core/tests/bash_ast_test.cpp b/libbash-0.1/src/core/tests/bash_ast_test.cpp
19826 deleted file mode 100644
19827 index b01393d..0000000
19828 --- a/libbash-0.1/src/core/tests/bash_ast_test.cpp
19829 +++ /dev/null
19830 @@ -1,56 +0,0 @@
19831 -/*
19832 - Please use git log for copyright holder and year information
19833 -
19834 - This file is part of libbash.
19835 -
19836 - libbash is free software: you can redistribute it and/or modify
19837 - it under the terms of the GNU General Public License as published by
19838 - the Free Software Foundation, either version 2 of the License, or
19839 - (at your option) any later version.
19840 -
19841 - libbash is distributed in the hope that it will be useful,
19842 - but WITHOUT ANY WARRANTY; without even the implied warranty of
19843 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19844 - GNU General Public License for more details.
19845 -
19846 - You should have received a copy of the GNU General Public License
19847 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
19848 -*/
19849 -///
19850 -/// \file bash_ast_test.cpp
19851 -/// \brief series of unit tests for interpreter.
19852 -///
19853 -
19854 -#include <fstream>
19855 -#include <sstream>
19856 -#include <string>
19857 -
19858 -#include <gtest/gtest.h>
19859 -
19860 -#include "core/bash_ast.h"
19861 -#include "core/interpreter.h"
19862 -#include "test.h"
19863 -
19864 -TEST(bash_ast, parse_illegal_script)
19865 -{
19866 - EXPECT_THROW(bash_ast ast(get_src_dir() + std::string("/scripts/illegal_script.sh")), libbash::parse_exception);
19867 -}
19868 -
19869 -TEST(bash_ast, parse_legal_script)
19870 -{
19871 - bash_ast(get_src_dir() + std::string("/scripts/source_true.sh"));
19872 - bash_ast(get_src_dir() + std::string("/scripts/source_false.sh"));
19873 -}
19874 -
19875 -TEST(bash_ast, parse_arithmetics)
19876 -{
19877 - std::string expr("1 + 2");
19878 - bash_ast ast(std::stringstream(expr), bash_ast::parser_arithmetics);
19879 - interpreter walker;
19880 - EXPECT_EQ(3, ast.interpret_with(walker, &bash_ast::walker_arithmetics));
19881 -}
19882 -
19883 -TEST(bash_ast, illegal_path)
19884 -{
19885 - EXPECT_THROW(bash_ast("not_exist"), libbash::parse_exception);
19886 -}
19887
19888 diff --git a/libbash-0.1/src/core/tests/bash_condition_test.cpp b/libbash-0.1/src/core/tests/bash_condition_test.cpp
19889 deleted file mode 100644
19890 index 09f441a..0000000
19891 --- a/libbash-0.1/src/core/tests/bash_condition_test.cpp
19892 +++ /dev/null
19893 @@ -1,191 +0,0 @@
19894 -/*
19895 - Please use git log for copyright holder and year information
19896 -
19897 - This file is part of libbash.
19898 -
19899 - libbash is free software: you can redistribute it and/or modify
19900 - it under the terms of the GNU General Public License as published by
19901 - the Free Software Foundation, either version 2 of the License, or
19902 - (at your option) any later version.
19903 -
19904 - libbash is distributed in the hope that it will be useful,
19905 - but WITHOUT ANY WARRANTY; without even the implied warranty of
19906 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19907 - GNU General Public License for more details.
19908 -
19909 - You should have received a copy of the GNU General Public License
19910 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
19911 -*/
19912 -///
19913 -/// \file bash_condition_test.cpp
19914 -/// \brief series of unit tests for interpreter.
19915 -///
19916 -#include <fcntl.h>
19917 -#include <stdlib.h>
19918 -#include <sys/stat.h>
19919 -#include <unistd.h>
19920 -#include <utime.h>
19921 -
19922 -#include <boost/lexical_cast.hpp>
19923 -#include <gtest/gtest.h>
19924 -
19925 -#include "core/bash_condition.h"
19926 -#include "core/exceptions.h"
19927 -#include "core/interpreter.h"
19928 -
19929 -namespace
19930 -{
19931 - void set_time(const std::string& target, int ac, int mod)
19932 - {
19933 - struct utimbuf timebuf;
19934 - timebuf.actime = ac;
19935 - timebuf.modtime = mod;
19936 - EXPECT_EQ(0, utime(target.c_str(), &timebuf));
19937 - }
19938 -
19939 - class file_test: public testing::Test
19940 - {
19941 - protected:
19942 - const std::string positive;
19943 - const std::string negative;
19944 - const std::string test_link;
19945 - const std::string test_fifo;
19946 -
19947 - file_test(): positive("scripts/test.positive"),
19948 - negative("scripts/test.negative"),
19949 - test_link("scripts/test.link"),
19950 - test_fifo("scripts/test.fifo") {}
19951 -
19952 - virtual void SetUp()
19953 - {
19954 - EXPECT_NE(-1, creat(positive.c_str(),
19955 - S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)
19956 - ) << "Can't create " << positive << " for test";
19957 - set_time(positive, 0, 0);
19958 - EXPECT_NE(-1, creat(negative.c_str(), 0)) << "Can't create " << negative << " for test";
19959 - set_time(negative, 2, 1);
19960 - EXPECT_EQ(0, symlink(positive.c_str(), test_link.c_str()));
19961 - EXPECT_EQ(0, mkfifo(test_fifo.c_str(), 0));
19962 - }
19963 -
19964 - virtual void TearDown()
19965 - {
19966 - EXPECT_EQ(0, unlink(test_fifo.c_str()));
19967 - EXPECT_EQ(0, unlink(positive.c_str()));
19968 - EXPECT_EQ(0, unlink(negative.c_str()));
19969 - EXPECT_EQ(0, unlink(test_link.c_str()));
19970 - }
19971 - };
19972 -}
19973 -
19974 -TEST_F(file_test, file_flags_positive)
19975 -{
19976 - EXPECT_TRUE(internal::test_unary('a', "/"));
19977 - EXPECT_TRUE(internal::test_unary('b', "/dev/root")) << "You should have /dev/root, or unit test won't pass";
19978 - EXPECT_TRUE(internal::test_unary('c', "/dev/random"));
19979 - EXPECT_TRUE(internal::test_unary('d', "/"));
19980 - EXPECT_TRUE(internal::test_unary('e', "/"));
19981 - EXPECT_TRUE(internal::test_unary('f', positive));
19982 - EXPECT_TRUE(internal::test_unary('g', positive));
19983 - EXPECT_TRUE(internal::test_unary('h', test_link));
19984 - EXPECT_TRUE(internal::test_unary('k', positive));
19985 - EXPECT_TRUE(internal::test_unary('p', test_fifo));
19986 - EXPECT_TRUE(internal::test_unary('r', positive));
19987 - EXPECT_TRUE(internal::test_unary('s', "/etc/fstab"));
19988 - EXPECT_TRUE(internal::test_unary('u', positive));
19989 - EXPECT_TRUE(internal::test_unary('w', positive));
19990 - EXPECT_TRUE(internal::test_unary('x', positive));
19991 - EXPECT_TRUE(internal::test_unary('L', test_link));
19992 - EXPECT_TRUE(internal::test_unary('O', positive));
19993 - EXPECT_TRUE(internal::test_unary('G', positive));
19994 - EXPECT_TRUE(internal::test_unary('S', "/dev/log")) << "You should have /dev/log, or unit test won't pass";
19995 - EXPECT_TRUE(internal::test_unary('N', positive));
19996 -}
19997 -
19998 -TEST_F(file_test, file_flags_negative)
19999 -{
20000 - EXPECT_FALSE(internal::test_unary('a', "not_exist"));
20001 - EXPECT_FALSE(internal::test_unary('b', negative));
20002 - EXPECT_FALSE(internal::test_unary('c', negative));
20003 - EXPECT_FALSE(internal::test_unary('d', negative));
20004 - EXPECT_FALSE(internal::test_unary('e', "not_exist"));
20005 - EXPECT_FALSE(internal::test_unary('f', "/"));
20006 - EXPECT_FALSE(internal::test_unary('g', negative));
20007 - EXPECT_FALSE(internal::test_unary('h', negative));
20008 - EXPECT_FALSE(internal::test_unary('k', negative));
20009 - EXPECT_FALSE(internal::test_unary('p', negative));
20010 - EXPECT_FALSE(internal::test_unary('r', negative));
20011 - EXPECT_FALSE(internal::test_unary('s', negative));
20012 - EXPECT_FALSE(internal::test_unary('t', "/dev/stdin"));
20013 - EXPECT_FALSE(internal::test_unary('u', negative));
20014 - EXPECT_FALSE(internal::test_unary('w', negative));
20015 - EXPECT_FALSE(internal::test_unary('x', negative));
20016 - EXPECT_FALSE(internal::test_unary('L', negative));
20017 - EXPECT_FALSE(internal::test_unary('O', "/etc/fstab"));
20018 - EXPECT_FALSE(internal::test_unary('G', "/etc/fstab"));
20019 - EXPECT_FALSE(internal::test_unary('S', negative));
20020 - EXPECT_FALSE(internal::test_unary('N', negative));
20021 -}
20022 -
20023 -TEST(bash_condition, string_unary_operator)
20024 -{
20025 - EXPECT_TRUE(internal::test_unary('z', ""));
20026 - EXPECT_FALSE(internal::test_unary('z', "hello"));
20027 -
20028 - EXPECT_FALSE(internal::test_unary('n', ""));
20029 - EXPECT_TRUE(internal::test_unary('n', "hello"));
20030 -
20031 - EXPECT_THROW(internal::test_unary('o', "extglob"), libbash::unsupported_exception);
20032 -}
20033 -
20034 -TEST_F(file_test, binary_operator)
20035 -{
20036 - interpreter walker;
20037 - EXPECT_TRUE(internal::test_binary("nt", negative, positive, walker));
20038 - EXPECT_FALSE(internal::test_binary("ot", negative, positive, walker));
20039 -
20040 - EXPECT_TRUE(internal::test_binary("ot", positive, negative, walker));
20041 - EXPECT_FALSE(internal::test_binary("nt", positive, negative, walker));
20042 -
20043 - EXPECT_FALSE(internal::test_binary("ot", positive, positive, walker));
20044 - EXPECT_FALSE(internal::test_binary("nt", positive, positive, walker));
20045 -
20046 - EXPECT_TRUE(internal::test_binary("ef", positive, positive, walker));
20047 - EXPECT_FALSE(internal::test_binary("ef", positive, negative, walker));
20048 - EXPECT_FALSE(internal::test_binary("ef", "not exist", negative, walker));
20049 -
20050 - EXPECT_THROW(internal::test_binary("efd", positive, negative, walker), libbash::illegal_argument_exception);
20051 -}
20052 -
20053 -TEST(bash_condition, arithmetic_operator)
20054 -{
20055 - interpreter walker;
20056 - walker.define("foo", 1);
20057 -
20058 - EXPECT_TRUE(internal::test_binary("eq", "1", "1", walker));
20059 - EXPECT_FALSE(internal::test_binary("eq", "2", "1", walker));
20060 -
20061 - EXPECT_TRUE(internal::test_binary("ne", "2", "1", walker));
20062 - EXPECT_FALSE(internal::test_binary("ne", "1", "1", walker));
20063 -
20064 - EXPECT_TRUE(internal::test_binary("lt", "0", "1", walker));
20065 - EXPECT_FALSE(internal::test_binary("lt", "1", "1", walker));
20066 - EXPECT_FALSE(internal::test_binary("lt", "2", "1", walker));
20067 -
20068 - EXPECT_TRUE(internal::test_binary("le", "0", "1", walker));
20069 - EXPECT_TRUE(internal::test_binary("le", "1", "1", walker));
20070 - EXPECT_FALSE(internal::test_binary("le", "2", "1", walker));
20071 -
20072 - EXPECT_TRUE(internal::test_binary("gt", "1", "0", walker));
20073 - EXPECT_FALSE(internal::test_binary("gt", "1", "1", walker));
20074 - EXPECT_FALSE(internal::test_binary("gt", "0", "1", walker));
20075 -
20076 - EXPECT_TRUE(internal::test_binary("ge", "1", "1", walker));
20077 - EXPECT_TRUE(internal::test_binary("ge", "2", "1", walker));
20078 - EXPECT_FALSE(internal::test_binary("ge", "0", "1", walker));
20079 -
20080 - EXPECT_FALSE(internal::test_binary("ge", "blah", "1", walker));
20081 -
20082 - EXPECT_FALSE(internal::test_binary("ge", "foo++", "2", walker));
20083 - EXPECT_TRUE(internal::test_binary("ge", "foo++", "2", walker));
20084 -}
20085
20086 diff --git a/libbash-0.1/src/core/tests/interpreter_test.cpp b/libbash-0.1/src/core/tests/interpreter_test.cpp
20087 deleted file mode 100644
20088 index d20697b..0000000
20089 --- a/libbash-0.1/src/core/tests/interpreter_test.cpp
20090 +++ /dev/null
20091 @@ -1,263 +0,0 @@
20092 -/*
20093 - Please use git log for copyright holder and year information
20094 -
20095 - This file is part of libbash.
20096 -
20097 - libbash is free software: you can redistribute it and/or modify
20098 - it under the terms of the GNU General Public License as published by
20099 - the Free Software Foundation, either version 2 of the License, or
20100 - (at your option) any later version.
20101 -
20102 - libbash is distributed in the hope that it will be useful,
20103 - but WITHOUT ANY WARRANTY; without even the implied warranty of
20104 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20105 - GNU General Public License for more details.
20106 -
20107 - You should have received a copy of the GNU General Public License
20108 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
20109 -*/
20110 -///
20111 -/// \file interpreter_test.cpp
20112 -/// \brief series of unit tests for interpreter.
20113 -///
20114 -
20115 -#include <gtest/gtest.h>
20116 -
20117 -#include "core/interpreter.h"
20118 -
20119 -using namespace std;
20120 -
20121 -TEST(interpreter, define_resolve_int)
20122 -{
20123 - interpreter walker;
20124 - walker.define("aint", 4);
20125 - EXPECT_EQ(4, walker.resolve<long>("aint"));
20126 - EXPECT_EQ(0, walker.resolve<long>("undefined"));
20127 - EXPECT_EQ(0, walker.resolve<long>(""));
20128 -}
20129 -
20130 -TEST(interpreter, define_resolve_string)
20131 -{
20132 - interpreter walker;
20133 - walker.define("astring", "hello");
20134 - EXPECT_STREQ("hello", walker.resolve<string>("astring").c_str());
20135 - EXPECT_STREQ("", walker.resolve<string>("undefined").c_str());
20136 - EXPECT_STREQ("", walker.resolve<string>("").c_str());
20137 -}
20138 -
20139 -TEST(interpreter, define_resolve_array)
20140 -{
20141 - interpreter walker;
20142 - std::map<unsigned, std::string> values = {{0, "1"}, {1, "2"}, {2, "3"}};
20143 - walker.define("array", values);
20144 - EXPECT_STREQ("1", walker.resolve<string>("array", 0).c_str());
20145 - EXPECT_STREQ("2", walker.resolve<string>("array", 1).c_str());
20146 - EXPECT_STREQ("3", walker.resolve<string>("array", 2).c_str());
20147 - EXPECT_STREQ("", walker.resolve<string>("undefined",100).c_str());
20148 -
20149 - walker.define("partial", 10, false, 8);
20150 - EXPECT_EQ(1, walker.get_array_length("partial"));
20151 - EXPECT_EQ(10, walker.resolve<long>("partial", 8));
20152 -
20153 - EXPECT_EQ(0, walker.get_array_length("not exist"));
20154 -}
20155 -
20156 -TEST(interpreter, is_unset_or_null)
20157 -{
20158 - interpreter walker;
20159 - walker.define("foo", "hello");
20160 - EXPECT_FALSE(walker.is_unset_or_null("foo", 0));
20161 - walker.define("foo", "hello", false, true);
20162 - EXPECT_TRUE(walker.is_unset_or_null("foo", 0));
20163 -
20164 - std::map<unsigned, std::string> values = {{0, "1"}, {1, "2"}, {2, "3"}};
20165 - walker.define("bar", values);
20166 - EXPECT_FALSE(walker.is_unset_or_null("bar", 0));
20167 - EXPECT_FALSE(walker.is_unset_or_null("bar", 1));
20168 - EXPECT_FALSE(walker.is_unset_or_null("bar", 2));
20169 - EXPECT_TRUE(walker.is_unset_or_null("bar", 3));
20170 -}
20171 -
20172 -TEST(interpreter, is_unset)
20173 -{
20174 - interpreter walker;
20175 - walker.define("foo", "hello");
20176 - EXPECT_FALSE(walker.is_unset("foo"));
20177 - EXPECT_TRUE(walker.is_unset("bar"));
20178 -}
20179 -
20180 -TEST(interpreter, set_int_value)
20181 -{
20182 - interpreter walker;
20183 - walker.define("aint", 4);
20184 - EXPECT_EQ(10, walker.set_value("aint", 10));
20185 - EXPECT_EQ(10, walker.resolve<long>("aint"));
20186 - EXPECT_EQ(10, walker.set_value("undefined", 10));
20187 - EXPECT_EQ(10, walker.resolve<long>("undefined"));
20188 -
20189 - walker.define("aint_ro", 4, true);
20190 - EXPECT_THROW(walker.set_value("aint_ro", 10),
20191 - libbash::readonly_exception);
20192 - EXPECT_EQ(4, walker.resolve<long>("aint_ro"));
20193 -}
20194 -
20195 -TEST(interpreter, set_string_value)
20196 -{
20197 - interpreter walker;
20198 - walker.define("astring", "hi");
20199 - EXPECT_STREQ("hello", walker.set_value<string>("astring", "hello").c_str());
20200 - EXPECT_STREQ("hello", walker.resolve<string>("astring").c_str());
20201 - EXPECT_STREQ("hello", walker.set_value<string>("undefined", "hello").c_str());
20202 - EXPECT_STREQ("hello", walker.resolve<string>("undefined").c_str());
20203 -
20204 - walker.define("astring_ro", "hi", true);
20205 - EXPECT_THROW(walker.set_value<string>("astring_ro", "hello"),
20206 - libbash::readonly_exception);
20207 - EXPECT_STREQ("hi", walker.resolve<string>("astring_ro").c_str());
20208 -}
20209 -
20210 -TEST(interpreter, set_array_value)
20211 -{
20212 - interpreter walker;
20213 - std::map<unsigned, std::string> values = {{0, "1"}, {1, "2"}, {2, "3"}};
20214 - walker.define("array", values);
20215 - EXPECT_STREQ("2", walker.set_value<string>("array", "2", 0).c_str());
20216 - EXPECT_STREQ("2", walker.resolve<string>("array", 0).c_str());
20217 - EXPECT_STREQ("out_of_bound", walker.set_value<string>("array", "out_of_bound", 10).c_str());
20218 - EXPECT_STREQ("out_of_bound", walker.resolve<string>("array",10).c_str());
20219 -
20220 - walker.define("ro_array", values, true);
20221 - EXPECT_THROW(walker.set_value<string>("ro_array", "hello", 1),
20222 - libbash::readonly_exception);
20223 - EXPECT_STREQ("2", walker.resolve<string>("ro_array", 1).c_str());
20224 -}
20225 -
20226 -TEST(interpreter, get_array_values)
20227 -{
20228 - interpreter walker;
20229 - std::map<unsigned, std::string> values = {{0, "1"}, {1, "2"}, {2, "3"}};
20230 - walker.define("array", values);
20231 -
20232 - std::vector<long> array_values;
20233 - EXPECT_TRUE(walker.resolve_array("array", array_values));
20234 - EXPECT_EQ(1, array_values[0]);
20235 - EXPECT_EQ(2, array_values[1]);
20236 - EXPECT_EQ(3, array_values[2]);
20237 - EXPECT_FALSE(walker.resolve_array("undefined", array_values));
20238 -}
20239 -
20240 -TEST(interpreter, unset_arrays)
20241 -{
20242 - interpreter walker;
20243 - std::map<unsigned, std::string> values = {{0, "1"}, {1, "2"}, {2, "3"}};
20244 - walker.define("array", values);
20245 - walker.define("ro_array", values, true);
20246 - interpreter::local_scope temp_scope(walker);
20247 - values[0] = "local";
20248 - walker.define_local("array", values);
20249 - walker.define_local("ro_local_array", values, true);
20250 -
20251 - // unset arrays
20252 - EXPECT_STREQ("local", walker.resolve<string>("array", 0).c_str());
20253 - // unset local
20254 - walker.unset("array", 0);
20255 - EXPECT_STREQ("", walker.resolve<string>("array", 0).c_str());
20256 - // unset local
20257 - walker.unset("array");
20258 - // resolve to global
20259 - EXPECT_STREQ("1", walker.resolve<string>("array", 0).c_str());
20260 - EXPECT_STREQ("2", walker.resolve<string>("array", 1).c_str());
20261 - EXPECT_STREQ("3", walker.resolve<string>("array", 2).c_str());
20262 - // unset global
20263 - walker.unset("array");
20264 - EXPECT_STREQ("", walker.resolve<string>("array", 0).c_str());
20265 - EXPECT_STREQ("", walker.resolve<string>("array", 1).c_str());
20266 - EXPECT_STREQ("", walker.resolve<string>("array", 2).c_str());
20267 - walker.unset("array");
20268 -
20269 - EXPECT_THROW(walker.unset("ro_array", 1), libbash::readonly_exception);
20270 - EXPECT_THROW(walker.unset("ro_local_array", 1), libbash::readonly_exception);
20271 - EXPECT_THROW(walker.unset("ro_array"), libbash::readonly_exception);
20272 - EXPECT_THROW(walker.unset("ro_local_array"), libbash::readonly_exception);
20273 -
20274 - EXPECT_THROW(walker.unset("1", 1), libbash::runtime_exception);
20275 -}
20276 -
20277 -TEST(interpreter, unset_variables)
20278 -{
20279 - interpreter walker;
20280 - walker.define("var", "123");
20281 - walker.define("ro_var", "123", true);
20282 - interpreter::local_scope temp_scope(walker);
20283 - walker.define_local("var", 456);
20284 - walker.define_local("ro_local_var", 456, true);
20285 -
20286 - EXPECT_STREQ("456", walker.resolve<string>("var").c_str());
20287 - walker.unset("var");
20288 - EXPECT_STREQ("123", walker.resolve<string>("var").c_str());
20289 - walker.unset("var");
20290 - EXPECT_STREQ("", walker.resolve<string>("var").c_str());
20291 - walker.unset("var");
20292 -
20293 - EXPECT_THROW(walker.unset("ro_var"), libbash::readonly_exception);
20294 - EXPECT_THROW(walker.unset("ro_local_var"), libbash::readonly_exception);
20295 - EXPECT_THROW(walker.unset("1"), libbash::runtime_exception);
20296 -}
20297 -
20298 -TEST(interpreter, unset_functions)
20299 -{
20300 - interpreter walker;
20301 - walker.push_current_ast(0);
20302 - walker.define_function("foo", 0);
20303 - EXPECT_TRUE(walker.has_function("foo"));
20304 - walker.unset_function("foo");
20305 - EXPECT_FALSE(walker.has_function("foo"));
20306 -}
20307 -
20308 -TEST(interperter, substring_expansion)
20309 -{
20310 - interpreter walker;
20311 - EXPECT_STREQ("", walker.do_substring_expansion("@", 0, 1, 2).c_str());
20312 - EXPECT_THROW(walker.do_substring_expansion("", 0, -1, 0), libbash::illegal_argument_exception);
20313 -}
20314 -
20315 -TEST(interpreter, word_split)
20316 -{
20317 - interpreter walker;
20318 - std::vector<std::string> splitted_values;
20319 - walker.split_word(" \n\t", splitted_values);
20320 - EXPECT_EQ(0, splitted_values.size());
20321 -
20322 - splitted_values.clear();
20323 - walker.split_word(" \tfoo\n bar \n", splitted_values);
20324 - EXPECT_EQ(2, splitted_values.size());
20325 - EXPECT_STREQ("foo", splitted_values[0].c_str());
20326 - EXPECT_STREQ("bar", splitted_values[1].c_str());
20327 -}
20328 -
20329 -TEST(interpreter, bash_additional_option)
20330 -{
20331 - interpreter walker;
20332 -
20333 - EXPECT_THROW(walker.set_additional_option("not exist", false), libbash::illegal_argument_exception);
20334 - EXPECT_THROW(walker.get_additional_option("not exist"), libbash::illegal_argument_exception);
20335 -
20336 - EXPECT_FALSE(walker.get_additional_option("extglob"));
20337 - walker.set_additional_option("extglob", true);
20338 - EXPECT_TRUE(walker.get_additional_option("extglob"));
20339 -}
20340 -
20341 -TEST(interpreter, bash_option)
20342 -{
20343 - interpreter walker;
20344 -
20345 - EXPECT_STREQ("Bh", walker.resolve<std::string>("-").c_str());
20346 -}
20347 -
20348 -TEST(interpreter, undefined_function)
20349 -{
20350 - interpreter walker;
20351 - interpreter::local_scope temp_scope(walker);
20352 -
20353 - EXPECT_THROW(walker.call("undefined", {}), libbash::runtime_exception);
20354 -}
20355
20356 diff --git a/libbash-0.1/src/core/tests/symbols_test.cpp b/libbash-0.1/src/core/tests/symbols_test.cpp
20357 deleted file mode 100644
20358 index e5b4649..0000000
20359 --- a/libbash-0.1/src/core/tests/symbols_test.cpp
20360 +++ /dev/null
20361 @@ -1,152 +0,0 @@
20362 -/*
20363 - Please use git log for copyright holder and year information
20364 -
20365 - This file is part of libbash.
20366 -
20367 - libbash is free software: you can redistribute it and/or modify
20368 - it under the terms of the GNU General Public License as published by
20369 - the Free Software Foundation, either version 2 of the License, or
20370 - (at your option) any later version.
20371 -
20372 - libbash is distributed in the hope that it will be useful,
20373 - but WITHOUT ANY WARRANTY; without even the implied warranty of
20374 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20375 - GNU General Public License for more details.
20376 -
20377 - You should have received a copy of the GNU General Public License
20378 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
20379 -*/
20380 -///
20381 -/// \file symbols_test.cpp
20382 -/// \brief series of unit tests for symbols and symbol table.
20383 -///
20384 -
20385 -#include <gtest/gtest.h>
20386 -
20387 -#include "core/symbols.hpp"
20388 -
20389 -using namespace std;
20390 -
20391 -TEST(symbol_test, int_variable)
20392 -{
20393 - // readonly integer
20394 - variable ro_integer("integer", 10, true);
20395 - EXPECT_STREQ("integer", ro_integer.get_name().c_str());
20396 - EXPECT_EQ(10, ro_integer.get_value<long>());
20397 - EXPECT_THROW(ro_integer.set_value(100), libbash::interpreter_exception);
20398 - EXPECT_EQ(10, ro_integer.get_value<long>());
20399 -
20400 - // normal only integer
20401 - variable normal_integer("integer", 10);
20402 - normal_integer.set_value(100);
20403 - EXPECT_EQ(100, normal_integer.get_value<long>());
20404 -
20405 - // get string value of an integer
20406 - EXPECT_STREQ("100", normal_integer.get_value<string>().c_str());
20407 -}
20408 -
20409 -TEST(symbol_test, string_variable)
20410 -{
20411 - // readonly string
20412 - variable ro_string("string", "hello", true);
20413 - EXPECT_STREQ("string", ro_string.get_name().c_str());
20414 - EXPECT_STREQ("hello", ro_string.get_value<string>().c_str());
20415 - EXPECT_THROW(ro_string.set_value("hello world"), libbash::interpreter_exception);
20416 - EXPECT_STREQ("hello", ro_string.get_value<string>().c_str());
20417 -
20418 - // normal string
20419 - variable normal_string("string", "hello");
20420 - normal_string.set_value("hello world");
20421 - EXPECT_STREQ("hello world", normal_string.get_value<string>().c_str());
20422 -
20423 - // string contains integer value
20424 - variable int_string("string", "123");
20425 - EXPECT_EQ(123, int_string.get_value<long>());
20426 - int_string.set_value("abc");
20427 - EXPECT_EQ(0, int_string.get_value<long>());
20428 -}
20429 -
20430 -TEST(symbol_test, array_variable)
20431 -{
20432 - map<unsigned, string> values = {{0, "1"}, {1, "2"}, {2, "3"}};
20433 -
20434 - // readonly array
20435 - variable ro_array("foo", values, true);
20436 - EXPECT_STREQ("foo", ro_array.get_name().c_str());
20437 - EXPECT_STREQ("1", ro_array.get_value<string>(0).c_str());
20438 - EXPECT_STREQ("2", ro_array.get_value<string>(1).c_str());
20439 - EXPECT_STREQ("3", ro_array.get_value<string>(2).c_str());
20440 - EXPECT_THROW(ro_array.set_value("4", 0), libbash::interpreter_exception);
20441 - EXPECT_STREQ("1", ro_array.get_value<string>(0).c_str());
20442 -
20443 - // out of bound
20444 - EXPECT_STREQ("", ro_array.get_value<string>(100).c_str());
20445 -
20446 - // normal array
20447 - variable normal_array("foo", values);
20448 - normal_array.set_value("5", 4);
20449 - EXPECT_STREQ("1", normal_array.get_value<string>(0).c_str());
20450 - EXPECT_STREQ("2", normal_array.get_value<string>(1).c_str());
20451 - EXPECT_STREQ("3", normal_array.get_value<string>(2).c_str());
20452 - EXPECT_STREQ("", normal_array.get_value<string>(3).c_str());
20453 - EXPECT_STREQ("5", normal_array.get_value<string>(4).c_str());
20454 -
20455 - // get integer value
20456 - EXPECT_EQ(3, normal_array.get_value<long>(2));
20457 -}
20458 -
20459 -TEST(symbol_test, get_all_values)
20460 -{
20461 - map<unsigned, string> values = {{0, "1"}, {1, "2"}, {2, "3"}};
20462 - variable array("foo", values);
20463 - vector<string> string_values;
20464 - array.get_all_values(string_values);
20465 -
20466 - EXPECT_EQ(3, string_values.size());
20467 - EXPECT_STREQ("1", string_values[0].c_str());
20468 - EXPECT_STREQ("2", string_values[1].c_str());
20469 - EXPECT_STREQ("3", string_values[2].c_str());
20470 -
20471 - variable a_string("foo", 10);
20472 - // Won't clear the original vector
20473 - a_string.get_all_values(string_values);
20474 - EXPECT_EQ(4, string_values.size());
20475 - EXPECT_STREQ("1", string_values[0].c_str());
20476 -
20477 - variable an_int("foo", 10);
20478 - vector<long> int_values;
20479 - an_int.get_all_values(int_values);
20480 - EXPECT_EQ(1, int_values.size());
20481 - EXPECT_EQ(10, int_values[0]);
20482 -}
20483 -
20484 -TEST(symbol_test, is_null)
20485 -{
20486 - variable var("foo", 10);
20487 - EXPECT_FALSE(var.is_null());
20488 - var.set_value("");
20489 - EXPECT_TRUE(var.is_null());
20490 - EXPECT_TRUE(variable("foo", "").is_null());
20491 -}
20492 -
20493 -TEST(symbol_test, is_unset)
20494 -{
20495 - map<unsigned, string> values = {{0, "1"}, {1, "2"}, {2, "3"}};
20496 - variable array("foo", values);
20497 - array.unset_value(1);
20498 - EXPECT_TRUE(array.is_unset(1));
20499 -}
20500 -
20501 -TEST(symbol_test, get_length)
20502 -{
20503 - variable an_int("foo", 10);
20504 - EXPECT_EQ(2, an_int.get_length());
20505 -
20506 - variable an_string("bar", "hello world");
20507 - EXPECT_EQ(11, an_string.get_length());
20508 -
20509 - map<unsigned, string> values = {{0, "1"}, {1, "2"}, {2, "hello"}};
20510 - variable array("array", values);
20511 - EXPECT_EQ(5, array.get_length(2));
20512 - EXPECT_EQ(3, array.get_array_length());
20513 -}
20514
20515 diff --git a/libbash-0.1/src/core/unsupported_exception.h b/libbash-0.1/src/core/unsupported_exception.h
20516 deleted file mode 100644
20517 index 338b087..0000000
20518 --- a/libbash-0.1/src/core/unsupported_exception.h
20519 +++ /dev/null
20520 @@ -1,47 +0,0 @@
20521 -/*
20522 - Please use git log for copyright holder and year information
20523 -
20524 - This file is part of libbash.
20525 -
20526 - libbash is free software: you can redistribute it and/or modify
20527 - it under the terms of the GNU General Public License as published by
20528 - the Free Software Foundation, either version 2 of the License, or
20529 - (at your option) any later version.
20530 -
20531 - libbash is distributed in the hope that it will be useful,
20532 - but WITHOUT ANY WARRANTY; without even the implied warranty of
20533 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20534 - GNU General Public License for more details.
20535 -
20536 - You should have received a copy of the GNU General Public License
20537 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
20538 -*/
20539 -///
20540 -/// \file unsupported_exception.h
20541 -/// \brief implementation for unsupported_exception
20542 -///
20543 -
20544 -#ifndef LIBBASH_CORE_UNSUPPORTED_EXCEPTION_H_
20545 -#define LIBBASH_CORE_UNSUPPORTED_EXCEPTION_H_
20546 -
20547 -#include <stdexcept>
20548 -#include <string>
20549 -
20550 -#include "common.h"
20551 -#include "interpreter_exception.h"
20552 -
20553 -namespace libbash
20554 -{
20555 - ///
20556 - /// \class unsupported_exception
20557 - /// \brief exception for unsupported features
20558 - ///
20559 - class LIBBASH_API unsupported_exception: public libbash::interpreter_exception
20560 - {
20561 - public:
20562 - explicit unsupported_exception(const std::string& err_msg):
20563 - libbash::interpreter_exception(err_msg){}
20564 - };
20565 -}
20566 -
20567 -#endif
20568
20569 diff --git a/libbash-0.1/src/cppbash_builtin.cpp b/libbash-0.1/src/cppbash_builtin.cpp
20570 deleted file mode 100644
20571 index 52c5c9b..0000000
20572 --- a/libbash-0.1/src/cppbash_builtin.cpp
20573 +++ /dev/null
20574 @@ -1,104 +0,0 @@
20575 -/*
20576 - Please use git log for copyright holder and year information
20577 -
20578 - This file is part of libbash.
20579 -
20580 - libbash is free software: you can redistribute it and/or modify
20581 - it under the terms of the GNU General Public License as published by
20582 - the Free Software Foundation, either version 2 of the License, or
20583 - (at your option) any later version.
20584 -
20585 - libbash is distributed in the hope that it will be useful,
20586 - but WITHOUT ANY WARRANTY; without even the implied warranty of
20587 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20588 - GNU General Public License for more details.
20589 -
20590 - You should have received a copy of the GNU General Public License
20591 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
20592 -*/
20593 -///
20594 -/// \file cppbash_builtin.cpp
20595 -/// \brief Implementation of class to inherit builtins from
20596 -///
20597 -
20598 -#include "cppbash_builtin.h"
20599 -
20600 -#include <boost/spirit/include/karma.hpp>
20601 -#include <boost/spirit/include/qi.hpp>
20602 -#include <boost/spirit/include/phoenix.hpp>
20603 -
20604 -#include "builtins/boolean_builtins.h"
20605 -#include "builtins/builtin_exceptions.h"
20606 -#include "builtins/break_builtin.h"
20607 -#include "builtins/continue_builtin.h"
20608 -#include "builtins/declare_builtin.h"
20609 -#include "builtins/echo_builtin.h"
20610 -#include "builtins/eval_builtin.h"
20611 -#include "builtins/inherit_builtin.h"
20612 -#include "builtins/let_builtin.h"
20613 -#include "builtins/return_builtin.h"
20614 -#include "builtins/printf_builtin.h"
20615 -#include "builtins/shopt_builtin.h"
20616 -#include "builtins/source_builtin.h"
20617 -#include "builtins/unset_builtin.h"
20618 -
20619 -namespace qi = boost::spirit::qi;
20620 -namespace karma = boost::spirit::karma;
20621 -namespace phoenix = boost::phoenix;
20622 -
20623 -cppbash_builtin::cppbash_builtin(BUILTIN_ARGS): _out_stream(&out), _err_stream(&err), _inp_stream(&in), _walker(walker)
20624 -{
20625 -}
20626 -
20627 -cppbash_builtin::builtins_type& cppbash_builtin::builtins() {
20628 - static boost::scoped_ptr<builtins_type> p(new builtins_type {
20629 - {"break", boost::factory<break_builtin*>()},
20630 - {"continue", boost::factory<continue_builtin*>()},
20631 - {"echo", boost::factory<echo_builtin*>()},
20632 - {"eval", boost::factory<eval_builtin*>()},
20633 - {"declare", boost::factory<declare_builtin*>()},
20634 - {"source", boost::factory<source_builtin*>()},
20635 - {"shopt", boost::factory<shopt_builtin*>()},
20636 - {"inherit", boost::factory<inherit_builtin*>()},
20637 - {":", boost::factory<true_builtin*>()},
20638 - {"true", boost::factory<true_builtin*>()},
20639 - {"false", boost::factory<false_builtin*>()},
20640 - {"return", boost::factory<return_builtin*>()},
20641 - {"printf", boost::factory<printf_builtin*>()},
20642 - {"let", boost::factory<let_builtin*>()},
20643 - {"unset", boost::factory<unset_builtin*>()},
20644 - });
20645 - return *p;
20646 -}
20647 -
20648 -void cppbash_builtin::transform_escapes(const std::string &string,
20649 - std::ostream& output) const
20650 -{
20651 - using phoenix::val;
20652 - using qi::lit;
20653 -
20654 - auto escape_parser =
20655 - +(
20656 - lit('\\') >>
20657 - (
20658 - lit('a')[output << val("\a")] |
20659 - lit('b')[output << val("\b")] |
20660 - // \e is a GNU extension
20661 - lit('e')[output << val("\033")] |
20662 - lit('f')[output << val("\f")] |
20663 - lit('n')[output << val("\n")] |
20664 - lit('r')[output << val("\r")] |
20665 - lit('t')[output << val("\t")] |
20666 - lit('v')[output << val("\v")] |
20667 - lit('c')[phoenix::throw_(suppress_output())] |
20668 - lit('\\')[output << val('\\')] |
20669 - lit("0") >> qi::uint_parser<unsigned, 8, 1, 3>()[ output << phoenix::static_cast_<char>(qi::_1)] |
20670 - lit("x") >> qi::uint_parser<unsigned, 16, 1, 2>()[ output << phoenix::static_cast_<char>(qi::_1)]
20671 -
20672 - ) |
20673 - qi::char_[output << qi::_1]
20674 - );
20675 -
20676 - auto begin = string.begin();
20677 - qi::parse(begin, string.end(), escape_parser);
20678 -}
20679
20680 diff --git a/libbash-0.1/src/cppbash_builtin.h b/libbash-0.1/src/cppbash_builtin.h
20681 deleted file mode 100644
20682 index c42ee1a..0000000
20683 --- a/libbash-0.1/src/cppbash_builtin.h
20684 +++ /dev/null
20685 @@ -1,132 +0,0 @@
20686 -/*
20687 - Please use git log for copyright holder and year information
20688 -
20689 - This file is part of libbash.
20690 -
20691 - libbash is free software: you can redistribute it and/or modify
20692 - it under the terms of the GNU General Public License as published by
20693 - the Free Software Foundation, either version 2 of the License, or
20694 - (at your option) any later version.
20695 -
20696 - libbash is distributed in the hope that it will be useful,
20697 - but WITHOUT ANY WARRANTY; without even the implied warranty of
20698 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20699 - GNU General Public License for more details.
20700 -
20701 - You should have received a copy of the GNU General Public License
20702 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
20703 -*/
20704 -///
20705 -/// \file cppbash_builtin.h
20706 -/// \brief Base class for builtin functions in bash
20707 -///
20708 -
20709 -#ifndef LIBBASH_CPPBASH_BUILTIN_H_
20710 -#define LIBBASH_CPPBASH_BUILTIN_H_
20711 -
20712 -#include <iostream>
20713 -#include <map>
20714 -#include <string>
20715 -#include <vector>
20716 -
20717 -#include <boost/functional/factory.hpp>
20718 -#include <boost/function.hpp>
20719 -#include <boost/scoped_ptr.hpp>
20720 -#include <boost/utility.hpp>
20721 -
20722 -#define BUILTIN_ARGS std::ostream &out, std::ostream &err, std::istream &in, interpreter &walker
20723 -
20724 -class interpreter;
20725 -///
20726 -/// \class cppbash_builtin
20727 -/// \brief a virtual class to inherit builtin functions from
20728 -///
20729 -class cppbash_builtin: public boost::noncopyable
20730 -{
20731 - public:
20732 - ///
20733 - /// \brief Default constructor, sets default streams
20734 - /// \param outstream where to send standard output. Default: cout
20735 - /// \param errstream where to send standard error. Default: cerr
20736 - /// \param instream where to get standard input from. Default: stdin
20737 - ///
20738 - explicit cppbash_builtin(BUILTIN_ARGS);
20739 -
20740 - virtual ~cppbash_builtin() {};
20741 - ///
20742 - /// \brief executes the code associated with the builtin
20743 - /// \param bash_args arguments passed to the builtin
20744 - /// \return return status of the command
20745 - ///
20746 - virtual int exec(const std::vector<std::string>& bash_args)=0;
20747 - ///
20748 - /// \brief accessor to the std output stream
20749 - /// \return output buffer for the builtin
20750 - ///
20751 - std::ostream& out_buffer() {return *_out_stream;}
20752 - ///
20753 - /// \brief accessor to the std error stream
20754 - /// \return error buffer for the builtin
20755 - ///
20756 - std::ostream& err_buffer() {return *_err_stream;}
20757 - ///
20758 - /// \brief accessor to the std input stream
20759 - /// \return input buffer for the builtin
20760 - ///
20761 - std::istream& input_buffer() {return *_inp_stream;}
20762 -
20763 - static int exec(const std::string& builtin,
20764 - const std::vector<std::string>& args,
20765 - BUILTIN_ARGS)
20766 - {
20767 - boost::scoped_ptr<cppbash_builtin> p(builtins()[builtin](out,err,in,walker));
20768 - return p->exec(args);
20769 - }
20770 -
20771 - ///
20772 - /// \brief check existence of the builtin
20773 - /// \param builtin name
20774 - /// \param whether it is a builtin
20775 - ///
20776 - static bool is_builtin(const std::string& builtin)
20777 - {
20778 - builtins_type& builtin_map = builtins();
20779 - return builtin_map.find(builtin) != builtin_map.end();
20780 - }
20781 -
20782 - protected:
20783 - ///
20784 - /// \var *_out_stream
20785 - /// \brief current standard output stream
20786 - ///
20787 - std::ostream *_out_stream;
20788 - ///
20789 - /// \var *_err_stream
20790 - /// \brief current standard error stream
20791 - ///
20792 - std::ostream *_err_stream;
20793 - ///
20794 - /// \var *_inp_stream
20795 - /// \brief current standard input stream
20796 - ///
20797 - std::istream *_inp_stream;
20798 -
20799 - interpreter& _walker;
20800 -
20801 - ///
20802 - /// \var builtins
20803 - /// \brief holds factories for creating instances of child classes
20804 - ///
20805 - typedef std::map<std::string, boost::function< cppbash_builtin*(BUILTIN_ARGS) >> builtins_type;
20806 - static builtins_type& builtins();
20807 -
20808 - /// \brief transforms escapes in echo input
20809 - /// \param the target string
20810 - /// \param the place to write
20811 - void transform_escapes(const std::string &string, std::ostream& output) const;
20812 -};
20813 -
20814 -#define BUILTIN_CONSTRUCTOR(name) \
20815 - name ## _builtin(BUILTIN_ARGS) : cppbash_builtin(out, err, in, walker) {}
20816 -
20817 -#endif
20818
20819 diff --git a/libbash-0.1/src/libbash.cpp b/libbash-0.1/src/libbash.cpp
20820 deleted file mode 100644
20821 index 98f20b6..0000000
20822 --- a/libbash-0.1/src/libbash.cpp
20823 +++ /dev/null
20824 @@ -1,80 +0,0 @@
20825 -/*
20826 - Please use git log for copyright holder and year information
20827 -
20828 - This file is part of libbash.
20829 -
20830 - libbash is free software: you can redistribute it and/or modify
20831 - it under the terms of the GNU General Public License as published by
20832 - the Free Software Foundation, either version 2 of the License, or
20833 - (at your option) any later version.
20834 -
20835 - libbash is distributed in the hope that it will be useful,
20836 - but WITHOUT ANY WARRANTY; without even the implied warranty of
20837 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20838 - GNU General Public License for more details.
20839 -
20840 - You should have received a copy of the GNU General Public License
20841 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
20842 -*/
20843 -///
20844 -/// \file libbash.cpp
20845 -/// \brief implementation for libbash interface
20846 -///
20847 -
20848 -#include "libbash.h"
20849 -
20850 -#include <fstream>
20851 -
20852 -#include <boost/numeric/conversion/cast.hpp>
20853 -
20854 -#include "core/interpreter.h"
20855 -#include "core/bash_ast.h"
20856 -
20857 -namespace internal
20858 -{
20859 - int interpret(interpreter& walker,
20860 - const std::string& path,
20861 - std::unordered_map<std::string, std::vector<std::string>>& variables,
20862 - std::vector<std::string>& functions)
20863 - {
20864 - // Initialize bash environment
20865 - for(auto iter = variables.begin(); iter != variables.end(); ++iter)
20866 - walker.define(iter->first, (iter->second)[0]);
20867 - walker.define("0", path, true);
20868 - variables.clear();
20869 -
20870 - bash_ast ast(path);
20871 - ast.interpret_with(walker);
20872 -
20873 - for(auto iter = walker.begin(); iter != walker.end(); ++iter)
20874 - iter->second->get_all_values<std::string>(variables[iter->first]);
20875 - walker.get_all_function_names(functions);
20876 -
20877 - return walker.get_status();
20878 - }
20879 -}
20880 -
20881 -namespace libbash
20882 -{
20883 - int interpret(const std::string& target_path,
20884 - std::unordered_map<std::string, std::vector<std::string>>& variables,
20885 - std::vector<std::string>& functions)
20886 - {
20887 - interpreter walker;
20888 - return internal::interpret(walker, target_path, variables, functions);
20889 - }
20890 -
20891 - int interpret(const std::string& target_path,
20892 - const std::string& preload_path,
20893 - std::unordered_map<std::string, std::vector<std::string>>& variables,
20894 - std::vector<std::string>& functions)
20895 - {
20896 - interpreter walker;
20897 -
20898 - // Preloading
20899 - bash_ast preload_ast(preload_path);
20900 - preload_ast.interpret_with(walker);
20901 -
20902 - return internal::interpret(walker, target_path, variables, functions);
20903 - }
20904 -}
20905
20906 diff --git a/libbash-0.1/src/libbash.h b/libbash-0.1/src/libbash.h
20907 deleted file mode 100644
20908 index f42d278..0000000
20909 --- a/libbash-0.1/src/libbash.h
20910 +++ /dev/null
20911 @@ -1,62 +0,0 @@
20912 -/*
20913 - Please use git log for copyright holder and year information
20914 -
20915 - This file is part of libbash.
20916 -
20917 - libbash is free software: you can redistribute it and/or modify
20918 - it under the terms of the GNU General Public License as published by
20919 - the Free Software Foundation, either version 2 of the License, or
20920 - (at your option) any later version.
20921 -
20922 - libbash is distributed in the hope that it will be useful,
20923 - but WITHOUT ANY WARRANTY; without even the implied warranty of
20924 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20925 - GNU General Public License for more details.
20926 -
20927 - You should have received a copy of the GNU General Public License
20928 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
20929 -*/
20930 -///
20931 -/// \file libbash.h
20932 -/// \brief public interface for libbash
20933 -///
20934 -
20935 -#ifndef LIBBASH_LIBBASH_H_
20936 -#define LIBBASH_LIBBASH_H_
20937 -
20938 -#include <memory>
20939 -#include <string>
20940 -#include <unordered_map>
20941 -#include <vector>
20942 -
20943 -#include "common.h"
20944 -#include "core/exceptions.h"
20945 -
20946 -namespace libbash
20947 -{
20948 - ///
20949 - /// \brief interpret a script specifid by path, return a map filled with
20950 - /// variables defined in the script
20951 - /// \param the path of target script
20952 - /// \param[in, out] we use the map to initialize bash environment and store the result
20953 - /// \param[out] store the names of the functions defined in the script
20954 - /// \return the return status of the script
20955 - int LIBBASH_API interpret(const std::string& target_path,
20956 - std::unordered_map<std::string, std::vector<std::string>>& variables,
20957 - std::vector<std::string>& functions);
20958 -
20959 - ///
20960 - /// \brief interpret a script specifid by path, return a map filled with
20961 - /// variables defined in the script
20962 - /// \param the path of target script
20963 - /// \param the path of a script that you want to source before interpreting
20964 - /// \param[in, out] we use the map to initialize bash environment and store the result. The environment will be initialized after preloading.
20965 - /// \param[out] store the names of the functions defined in the script
20966 - /// \return the return status of the script
20967 - int LIBBASH_API interpret(const std::string& target_path,
20968 - const std::string& preload_path,
20969 - std::unordered_map<std::string, std::vector<std::string>>& variables,
20970 - std::vector<std::string>& functions);
20971 -}
20972 -
20973 -#endif
20974
20975 diff --git a/libbash-0.1/test/api_test.cpp b/libbash-0.1/test/api_test.cpp
20976 deleted file mode 100644
20977 index 917b7e9..0000000
20978 --- a/libbash-0.1/test/api_test.cpp
20979 +++ /dev/null
20980 @@ -1,85 +0,0 @@
20981 -/*
20982 - Please use git log for copyright holder and year information
20983 -
20984 - This file is part of libbash.
20985 -
20986 - libbash is free software: you can redistribute it and/or modify
20987 - it under the terms of the GNU General Public License as published by
20988 - the Free Software Foundation, either version 2 of the License, or
20989 - (at your option) any later version.
20990 -
20991 - libbash is distributed in the hope that it will be useful,
20992 - but WITHOUT ANY WARRANTY; without even the implied warranty of
20993 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20994 - GNU General Public License for more details.
20995 -
20996 - You should have received a copy of the GNU General Public License
20997 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
20998 -*/
20999 -///
21000 -/// \file api_test.cpp
21001 -/// \brief series of unit tests for the public interface
21002 -///
21003 -
21004 -#include <gtest/gtest.h>
21005 -
21006 -#include "libbash.h"
21007 -#include "test.h"
21008 -
21009 -TEST(libbashapi, bad_path)
21010 -{
21011 - std::unordered_map<std::string, std::vector<std::string>> variables;
21012 - std::vector<std::string> functions;
21013 - EXPECT_THROW(libbash::interpret("not exist", variables, functions),
21014 - libbash::parse_exception);
21015 - EXPECT_THROW(libbash::interpret("/scripts/source_true.sh", "not exist", variables, functions),
21016 - libbash::parse_exception);
21017 -}
21018 -
21019 -TEST(libbashapi, illegal_script)
21020 -{
21021 - std::unordered_map<std::string, std::vector<std::string>> variables;
21022 - std::vector<std::string> functions;
21023 - EXPECT_THROW(libbash::interpret(get_src_dir() + "/scripts/illegal_script.sh", variables, functions),
21024 - libbash::parse_exception);
21025 -}
21026 -
21027 -TEST(libbashapi, legal_script)
21028 -{
21029 - std::unordered_map<std::string, std::vector<std::string>> variables;
21030 - std::vector<std::string> functions;
21031 - int result = libbash::interpret(get_src_dir() + std::string("/scripts/source_true.sh"),
21032 - variables,
21033 - functions);
21034 - EXPECT_EQ(0, result);
21035 -
21036 - result = libbash::interpret(get_src_dir() + std::string("/scripts/source_false.sh"),
21037 - variables,
21038 - functions);
21039 - EXPECT_NE(0, result);
21040 -
21041 - EXPECT_STREQ((get_src_dir() + std::string("/scripts/source_false.sh")).c_str(),
21042 - variables["0"][0].c_str());
21043 -}
21044 -
21045 -TEST(libbashapi, preload)
21046 -{
21047 - std::unordered_map<std::string, std::vector<std::string>> variables;
21048 - std::vector<std::string> functions;
21049 - int result = libbash::interpret(get_src_dir() + std::string("/scripts/source_true.sh"),
21050 - get_src_dir() + std::string("/scripts/source_true.sh"),
21051 - variables,
21052 - functions);
21053 - EXPECT_EQ(0, result);
21054 - result = libbash::interpret(get_src_dir() + std::string("/scripts/source_true.sh"),
21055 - get_src_dir() + std::string("/scripts/source_false.sh"),
21056 - variables,
21057 - functions);
21058 - EXPECT_NE(0, result);
21059 -
21060 - EXPECT_THROW(libbash::interpret(get_src_dir() + std::string("/scripts/source_true.sh"),
21061 - get_src_dir() + std::string("/scripts/illegal_script.sh"),
21062 - variables,
21063 - functions),
21064 - libbash::parse_exception);
21065 -}
21066
21067 diff --git a/libbash-0.1/test/ast_printer_test.sh b/libbash-0.1/test/ast_printer_test.sh
21068 deleted file mode 100755
21069 index 8b0d724..0000000
21070 --- a/libbash-0.1/test/ast_printer_test.sh
21071 +++ /dev/null
21072 @@ -1,33 +0,0 @@
21073 -#!/bin/sh
21074 -
21075 -declare -i error=0
21076 -
21077 -./ast_printer -f $srcdir/bashast/features_script/features.sh\
21078 - | diff -u $srcdir/bashast/features_script/features.sh.ast -
21079 -error+=$?
21080 -
21081 -./ast_printer -t libbash.tokens -f $srcdir/bashast/features_script/features.sh\
21082 - | diff -u $srcdir/bashast/features_script/features.sh.tokens -
21083 -error+=$?
21084 -
21085 -./ast_printer -w libbashWalker.tokens -f $srcdir/bashast/features_script/features.sh\
21086 - | diff -u $srcdir/bashast/features_script/features.sh.walker.tokens -
21087 -error+=$?
21088 -
21089 -./ast_printer -t libbash.tokens -f $srcdir/scripts/illegal_script.sh\
21090 - | diff -u $srcdir/scripts/illegal_script.sh.tokens -
21091 -error+=$?
21092 -
21093 -./ast_printer -f $srcdir/bashast/features_script/illegal_script.sh 2 > /dev/null
21094 -if [[ $? == 0 ]]
21095 -then
21096 - error+=1
21097 -fi
21098 -
21099 -./ast_printer -e "case" 2 > /dev/null
21100 -if [[ $? == 0 ]]
21101 -then
21102 - error+=1
21103 -fi
21104 -
21105 -exit $error
21106
21107 diff --git a/libbash-0.1/test/ebuild_compiler.sh b/libbash-0.1/test/ebuild_compiler.sh
21108 deleted file mode 100755
21109 index 7828476..0000000
21110 --- a/libbash-0.1/test/ebuild_compiler.sh
21111 +++ /dev/null
21112 @@ -1,11 +0,0 @@
21113 -#!/bin/sh
21114 -
21115 -declare -i error=0
21116 -
21117 -for ebuild in $@
21118 -do
21119 - ECLASSDIR=$srcdir/scripts ./metadata_generator $ebuild | diff -u $ebuild.result -
21120 - error+=$?
21121 -done
21122 -
21123 -exit $error
21124
21125 diff --git a/libbash-0.1/test/post_check.cpp b/libbash-0.1/test/post_check.cpp
21126 deleted file mode 100644
21127 index 715ccf5..0000000
21128 --- a/libbash-0.1/test/post_check.cpp
21129 +++ /dev/null
21130 @@ -1,49 +0,0 @@
21131 -/*
21132 - Please use git log for copyright holder and year information
21133 -
21134 - This file is part of libbash.
21135 -
21136 - libbash is free software: you can redistribute it and/or modify
21137 - it under the terms of the GNU General Public License as published by
21138 - the Free Software Foundation, either version 2 of the License, or
21139 - (at your option) any later version.
21140 -
21141 - libbash is distributed in the hope that it will be useful,
21142 - but WITHOUT ANY WARRANTY; without even the implied warranty of
21143 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21144 - GNU General Public License for more details.
21145 -
21146 - You should have received a copy of the GNU General Public License
21147 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
21148 -*/
21149 -///
21150 -/// \file post_check.cpp
21151 -/// \brief series of unit tests for generated source files.
21152 -///
21153 -
21154 -#include <boost/filesystem.hpp>
21155 -#include <gtest/gtest.h>
21156 -
21157 -using namespace std;
21158 -
21159 -static void check_file_size(const char *path, uintmax_t size_max)
21160 -{
21161 - uintmax_t file_size = boost::filesystem::file_size(path);
21162 - EXPECT_GT(file_size, 0);
21163 - EXPECT_LT(file_size, size_max);
21164 -}
21165 -
21166 -TEST(post_check, lexer_size)
21167 -{
21168 - check_file_size("libbashLexer.cpp", 1024 * 1024);
21169 -}
21170 -
21171 -TEST(post_check, parser_size)
21172 -{
21173 - check_file_size("libbashParser.cpp", 3*1024*1024);
21174 -}
21175 -
21176 -TEST(post_check, walker_size)
21177 -{
21178 - check_file_size("libbashWalker.cpp", 4096 * 1024);
21179 -}
21180
21181 diff --git a/libbash-0.1/test/run_tests.cpp b/libbash-0.1/test/run_tests.cpp
21182 deleted file mode 100644
21183 index 6606a90..0000000
21184 --- a/libbash-0.1/test/run_tests.cpp
21185 +++ /dev/null
21186 @@ -1,37 +0,0 @@
21187 -/*
21188 - Please use git log for copyright holder and year information
21189 -
21190 - This file is part of libbash.
21191 -
21192 - libbash is free software: you can redistribute it and/or modify
21193 - it under the terms of the GNU General Public License as published by
21194 - the Free Software Foundation, either version 2 of the License, or
21195 - (at your option) any later version.
21196 -
21197 - libbash is distributed in the hope that it will be useful,
21198 - but WITHOUT ANY WARRANTY; without even the implied warranty of
21199 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21200 - GNU General Public License for more details.
21201 -
21202 - You should have received a copy of the GNU General Public License
21203 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
21204 -*/
21205 -///
21206 -/// \file run_tests.cpp
21207 -/// \brief runs unit tests for post_check
21208 -///
21209 -
21210 -#include <cstdio>
21211 -
21212 -#include<gtest/gtest.h>
21213 -
21214 -///
21215 -/// \brief runs all the unit tests linked to this file
21216 -///
21217 -int main(int argc, char* argv[])
21218 -{
21219 - if(!freopen("/dev/null", "w", stderr))
21220 - return EXIT_FAILURE;
21221 - ::testing::InitGoogleTest(&argc, argv);
21222 - return RUN_ALL_TESTS();
21223 -}
21224
21225 diff --git a/libbash-0.1/test/script_compiler.sh b/libbash-0.1/test/script_compiler.sh
21226 deleted file mode 100755
21227 index 6ff5672..0000000
21228 --- a/libbash-0.1/test/script_compiler.sh
21229 +++ /dev/null
21230 @@ -1,14 +0,0 @@
21231 -#!/bin/sh
21232 -
21233 -declare -i error=0
21234 -result=$(mktemp)
21235 -
21236 -for script in $@
21237 -do
21238 - sed "s/@srcdir@/$srcdir/" $script.result > $result
21239 - ./variable_printer $script 2>&1 | diff -u $result -
21240 - error+=$?
21241 -done
21242 -
21243 -rm -rf $result
21244 -exit $error
21245
21246 diff --git a/libbash-0.1/test/test.cpp b/libbash-0.1/test/test.cpp
21247 deleted file mode 100644
21248 index e460fc1..0000000
21249 --- a/libbash-0.1/test/test.cpp
21250 +++ /dev/null
21251 @@ -1,34 +0,0 @@
21252 -/*
21253 - Please use git log for copyright holder and year information
21254 -
21255 - This file is part of libbash.
21256 -
21257 - libbash is free software: you can redistribute it and/or modify
21258 - it under the terms of the GNU General Public License as published by
21259 - the Free Software Foundation, either version 2 of the License, or
21260 - (at your option) any later version.
21261 -
21262 - libbash is distributed in the hope that it will be useful,
21263 - but WITHOUT ANY WARRANTY; without even the implied warranty of
21264 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21265 - GNU General Public License for more details.
21266 -
21267 - You should have received a copy of the GNU General Public License
21268 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
21269 - */
21270 -///
21271 -/// \file test.cpp
21272 -/// \brief helper functions for tests
21273 -///
21274 -#include <cstdlib>
21275 -
21276 -#include "test.h"
21277 -
21278 -std::string get_src_dir()
21279 -{
21280 - std::string srcdir(".");
21281 - if(getenv("srcdir"))
21282 - srcdir = getenv("srcdir");
21283 -
21284 - return srcdir;
21285 -}
21286
21287 diff --git a/libbash-0.1/test/test.h b/libbash-0.1/test/test.h
21288 deleted file mode 100644
21289 index ba5cd1f..0000000
21290 --- a/libbash-0.1/test/test.h
21291 +++ /dev/null
21292 @@ -1,30 +0,0 @@
21293 -/*
21294 - Please use git log for copyright holder and year information
21295 -
21296 - This file is part of libbash.
21297 -
21298 - libbash is free software: you can redistribute it and/or modify
21299 - it under the terms of the GNU General Public License as published by
21300 - the Free Software Foundation, either version 2 of the License, or
21301 - (at your option) any later version.
21302 -
21303 - libbash is distributed in the hope that it will be useful,
21304 - but WITHOUT ANY WARRANTY; without even the implied warranty of
21305 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21306 - GNU General Public License for more details.
21307 -
21308 - You should have received a copy of the GNU General Public License
21309 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
21310 - */
21311 -///
21312 -/// \file test.h
21313 -/// \brief helper functions for tests
21314 -///
21315 -#ifndef LIBBASH_TEST_H_
21316 -#define LIBBASH_TEST_H_
21317 -
21318 -#include <string>
21319 -
21320 -std::string get_src_dir();
21321 -
21322 -#endif
21323
21324 diff --git a/libbash-0.1/test/verify_bashs_test.sh b/libbash-0.1/test/verify_bashs_test.sh
21325 deleted file mode 100755
21326 index 8b70030..0000000
21327 --- a/libbash-0.1/test/verify_bashs_test.sh
21328 +++ /dev/null
21329 @@ -1,5 +0,0 @@
21330 -#!/bin/bash
21331 -
21332 -num_of_ebuild_files=$(grep 'scripts/.*.bash' $srcdir/Makefile.am | wc -l)
21333 -[[ $num_of_ebuild_files == $(ls $srcdir/scripts/*.bash* | wc -l) ]]
21334 -exit $?
21335
21336 diff --git a/libbash-0.1/test/verify_error_output_test.sh b/libbash-0.1/test/verify_error_output_test.sh
21337 deleted file mode 100755
21338 index 4bb0465..0000000
21339 --- a/libbash-0.1/test/verify_error_output_test.sh
21340 +++ /dev/null
21341 @@ -1,5 +0,0 @@
21342 -#!/bin/sh
21343 -
21344 -illegal="${srcdir}/scripts/illegal_script.sh"
21345 -output=$(./variable_printer "$illegal" 2>&1)
21346 -[[ $output == "${illegal}(1) : error 3 : "???":1: command_atom : ( compound_command | function | simple_command );, at offset 3"* ]]
21347
21348 diff --git a/libbash-0.1/test/walker_test.cpp b/libbash-0.1/test/walker_test.cpp
21349 deleted file mode 100644
21350 index 4f87c26..0000000
21351 --- a/libbash-0.1/test/walker_test.cpp
21352 +++ /dev/null
21353 @@ -1,102 +0,0 @@
21354 -/*
21355 - Please use git log for copyright holder and year information
21356 -
21357 - This file is part of libbash.
21358 -
21359 - libbash is free software: you can redistribute it and/or modify
21360 - it under the terms of the GNU General Public License as published by
21361 - the Free Software Foundation, either version 2 of the License, or
21362 - (at your option) any later version.
21363 -
21364 - libbash is distributed in the hope that it will be useful,
21365 - but WITHOUT ANY WARRANTY; without even the implied warranty of
21366 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21367 - GNU General Public License for more details.
21368 -
21369 - You should have received a copy of the GNU General Public License
21370 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
21371 -*/
21372 -///
21373 -/// \file lib_test.cpp
21374 -/// \brief series of unit tests for generated walker.
21375 -///
21376 -
21377 -#include <sstream>
21378 -
21379 -#include <gtest/gtest.h>
21380 -
21381 -#include "core/interpreter.h"
21382 -#include "core/bash_ast.h"
21383 -
21384 -static void check_string_assignment(const char* script,
21385 - const std::string& name,
21386 - const char* exp_value)
21387 -{
21388 - interpreter walker;
21389 - std::istringstream input(script);
21390 - bash_ast ast(input);
21391 - ast.interpret_with(walker);
21392 - EXPECT_STREQ(exp_value, walker.resolve<std::string>(name).c_str());
21393 -}
21394 -
21395 -#define TEST_STRING_ASSIGNMENT(name, script, var_name, exp_value)\
21396 - TEST(string_assignment, name) \
21397 - { check_string_assignment(script, var_name, exp_value); }
21398 -
21399 -TEST_STRING_ASSIGNMENT(str_assignment, "str=\"abc\"", "str", "abc")
21400 -TEST_STRING_ASSIGNMENT(str_assignment2, "str=\"abc_def\"", "str", "abc_def")
21401 -TEST_STRING_ASSIGNMENT(str_assignment3, "str=\"abc def\"", "str", "abc def")
21402 -TEST_STRING_ASSIGNMENT(str_assignment4,
21403 - "str=\"case esac do done elif else fi if for function in select then until while time\"",
21404 - "str",
21405 - "case esac do done elif else fi if for function in select then until while time")
21406 -TEST_STRING_ASSIGNMENT(str_assignment5,
21407 - "str=\"123 abc = % %% - . .. : -a -aa test _ ~ ++ -- *= /= %= += -= <<= >>= &= ^= |= \\a ^ aä\"",
21408 - "str",
21409 - "123 abc = % %% - . .. : -a -aa test _ ~ ++ -- *= /= %= += -= <<= >>= &= ^= |= \\a ^ aä")
21410 -TEST_STRING_ASSIGNMENT(str_assignment6,
21411 - "str=\"/ \n \r\n & && ||| || > < ' : ; , ( (( ) )) ;; { } >= <=\"",
21412 - "str",
21413 - "/ \n \r\n & && ||| || > < ' : ; , ( (( ) )) ;; { } >= <=")
21414 -
21415 -TEST(array_index, out_of_bound)
21416 -{
21417 - interpreter walker;
21418 -
21419 - std::string script = "a[-1]=\"1\"";
21420 - std::istringstream input(script);
21421 - bash_ast ast(input);
21422 - EXPECT_THROW(ast.interpret_with(walker), libbash::illegal_argument_exception);
21423 -
21424 - std::string script2 = "a=(1 2 [-5]=1)";
21425 - std::istringstream input2(script2);
21426 - bash_ast ast2(input2);
21427 - EXPECT_THROW(ast2.interpret_with(walker), libbash::illegal_argument_exception);
21428 -}
21429 -
21430 -TEST(extglob, used_when_disabled)
21431 -{
21432 - interpreter walker;
21433 -
21434 - std::string script = "echo ${abc/?([a-z])}";
21435 - std::istringstream input(script);
21436 - bash_ast ast(input);
21437 - try
21438 - {
21439 - ast.interpret_with(walker);
21440 - }
21441 - catch(libbash::unsupported_exception& e)
21442 - {
21443 - EXPECT_STREQ(e.what(), "Entered extended pattern matching with extglob disabled");
21444 - }
21445 -}
21446 -
21447 -TEST(brace_expansion, not_in_raw_string)
21448 -{
21449 - interpreter walker;
21450 -
21451 - std::string script = "echo $ab{c,d}e";
21452 - std::istringstream input(script);
21453 - bash_ast ast(input);
21454 - EXPECT_THROW(ast.interpret_with(walker), libbash::unsupported_exception);
21455 -}
21456
21457 diff --git a/libbash-0.1/test_coverage.sh b/libbash-0.1/test_coverage.sh
21458 deleted file mode 100755
21459 index 20f70d9..0000000
21460 --- a/libbash-0.1/test_coverage.sh
21461 +++ /dev/null
21462 @@ -1,35 +0,0 @@
21463 -#!/bin/sh
21464 -
21465 -which lcov 1>/dev/null 2>&1
21466 -if [ $? != 0 ]
21467 -then
21468 - echo "You need to have lcov installed in order to generate the test coverage report"
21469 - exit 1
21470 -fi
21471 -
21472 -if [ ! $DIST_ARCHIVES ]
21473 -then
21474 - echo "You need to provide the archive name by running DIST_ARCHIVES=\"ARCHIVE_NAME\" $0"
21475 - exit 1
21476 -fi
21477 -
21478 -tar zxf $DIST_ARCHIVES
21479 -srcdir=${DIST_ARCHIVES/.tar.gz}
21480 -cd $srcdir
21481 -
21482 -# Reconfigure with gcov support
21483 -CXXFLAGS="-g -O0 --coverage" CFLAGS="-g -O0 --coverage" ./autogen.sh --disable-shared
21484 -
21485 -# Generate gcov output
21486 -${MAKE}
21487 -
21488 -# Generate html report
21489 -lcov --base-directory . --directory . --zerocounters -q
21490 -${MAKE} check
21491 -lcov --base-directory . --directory . -c -o libbash_test.info
21492 -lcov --remove libbash_test.info "/usr*" -o libbash_test.info # remove output for external libraries
21493 -rm -rf ../test_coverage
21494 -genhtml -o ../test_coverage -t "libbash test coverage" --num-spaces 4 libbash_test.info
21495 -
21496 -# Clean work space
21497 -cd .. && rm -rf $srcdir
21498
21499 diff --git a/libbash-0.1/utils/ast_printer.cpp b/libbash-0.1/utils/ast_printer.cpp
21500 deleted file mode 100644
21501 index d2dabc9..0000000
21502 --- a/libbash-0.1/utils/ast_printer.cpp
21503 +++ /dev/null
21504 @@ -1,240 +0,0 @@
21505 -/*
21506 - Please use git log for copyright holder and year information
21507 -
21508 - This file is part of libbash.
21509 -
21510 - libbash is free software: you can redistribute it and/or modify
21511 - it under the terms of the GNU General Public License as published by
21512 - the Free Software Foundation, either version 2 of the License, or
21513 - (at your option) any later version.
21514 -
21515 - libbash is distributed in the hope that it will be useful,
21516 - but WITHOUT ANY WARRANTY; without even the implied warranty of
21517 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21518 - GNU General Public License for more details.
21519 -
21520 - You should have received a copy of the GNU General Public License
21521 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
21522 -*/
21523 -///
21524 -/// \file ast_printer.cpp
21525 -/// \brief helper program to visualize AST
21526 -///
21527 -
21528 -#include <fstream>
21529 -#include <functional>
21530 -#include <iostream>
21531 -#include <sstream>
21532 -#include <string>
21533 -#include <unordered_map>
21534 -#include <vector>
21535 -
21536 -#include <antlr3.h>
21537 -#include <boost/numeric/conversion/cast.hpp>
21538 -#include <boost/program_options.hpp>
21539 -#include <boost/spirit/include/qi.hpp>
21540 -#include <boost/fusion/include/adapt_struct.hpp>
21541 -
21542 -#include "core/bash_ast.h"
21543 -#include "core/exceptions.h"
21544 -#include "libbashLexer.h"
21545 -#include "libbashParser.h"
21546 -
21547 -namespace po = boost::program_options;
21548 -namespace qi = boost::spirit::qi;
21549 -
21550 -struct reversed_pair : std::pair<ANTLR3_INT32, std::string>
21551 -{};
21552 -
21553 -BOOST_FUSION_ADAPT_STRUCT(
21554 - reversed_pair
21555 - , (std::string, second)
21556 - (ANTLR3_INT32, first)
21557 -)
21558 -
21559 -static void print_ast(std::istream& input, bool silent, bool dot)
21560 -{
21561 - bash_ast ast(input);
21562 -
21563 - if(silent)
21564 - return;
21565 -
21566 - if(dot)
21567 - std::cout << ast.get_dot_graph() << std::endl;
21568 - else
21569 - std::cout << ast.get_string_tree() << std::endl;
21570 -}
21571 -
21572 -static inline std::string token_mapper(std::unordered_map<ANTLR3_INT32, std::string> token_map,
21573 - ANTLR3_INT32 token)
21574 -{
21575 - return token_map[token];
21576 -}
21577 -
21578 -static bool build_token_map(std::unordered_map<ANTLR3_INT32, std::string>& token_map,
21579 - const std::string& path)
21580 -{
21581 - std::ifstream token_file(path);
21582 - token_file.unsetf(std::ios::skipws);
21583 -
21584 - typedef boost::spirit::istream_iterator iterator;
21585 -
21586 - iterator first(token_file);
21587 - iterator last;
21588 -
21589 - qi::rule<iterator, reversed_pair()> line = +~qi::char_('=') >> '=' >> qi::int_parser<ANTLR3_INT32>();
21590 -
21591 - return qi::parse(first, last, line % qi::eol >> qi::eol, token_map) && first == last;
21592 -}
21593 -
21594 -static void print_parser_token(std::istream& input,
21595 - const std::string& token_path,
21596 - bool silent)
21597 -{
21598 - if(silent)
21599 - return;
21600 -
21601 - std::stringstream script_stream;
21602 - script_stream << input.rdbuf();
21603 - std::string script(script_stream.str());
21604 - antlr_pointer<ANTLR3_INPUT_STREAM_struct> input_stream(antlr3NewAsciiStringInPlaceStream(
21605 - reinterpret_cast<pANTLR3_UINT8>(const_cast<char*>(script.c_str())),
21606 - boost::numeric_cast<ANTLR3_UINT32>(script.size()),
21607 - NULL));
21608 - if(!input)
21609 - throw libbash::interpreter_exception("Unable to open the file due to malloc() failure");
21610 -
21611 - antlr_pointer<libbashLexer_Ctx_struct> lexer(libbashLexerNew(input_stream.get()));
21612 - if(!lexer)
21613 - throw libbash::interpreter_exception("Unable to create the lexer due to malloc() failure");
21614 -
21615 - antlr_pointer<ANTLR3_COMMON_TOKEN_STREAM_struct> token_stream(
21616 - antlr3CommonTokenStreamSourceNew(ANTLR3_SIZE_HINT, lexer->pLexer->rec->state->tokSource));
21617 - if(!token_stream)
21618 - throw libbash::interpreter_exception("Out of memory trying to allocate token stream");
21619 -
21620 - std::unordered_map<ANTLR3_INT32, std::string> token_map;
21621 -
21622 - if(build_token_map(token_map, token_path))
21623 - std::cout << bash_ast::get_parser_tokens(token_stream,
21624 - std::bind(&token_mapper,
21625 - token_map,
21626 - std::placeholders::_1))
21627 - << std::endl;
21628 - else
21629 - std::cerr << "Building token map failed" << std::endl;
21630 -}
21631 -
21632 -static void print_walker_token(std::istream& input,
21633 - const std::string& token_path,
21634 - bool silent)
21635 -{
21636 - if(silent)
21637 - return;
21638 -
21639 - bash_ast ast(input);
21640 - std::unordered_map<ANTLR3_INT32, std::string> token_map;
21641 -
21642 - if(build_token_map(token_map, token_path))
21643 - std::cout << ast.get_walker_tokens(std::bind(&token_mapper,
21644 - token_map,
21645 - std::placeholders::_1))
21646 - << std::endl;
21647 - else
21648 - std::cerr << "Building token map failed" << std::endl;
21649 -}
21650 -
21651 -static void print_files(const std::vector<std::string>& files,
21652 - bool print_name,
21653 - std::function<void(std::istream&)> printer)
21654 -{
21655 - for(auto iter = files.begin(); iter != files.end(); ++iter)
21656 - {
21657 - if(print_name)
21658 - std::cout << "Interpreting " << *iter << std::endl;
21659 -
21660 - std::ifstream input(iter->c_str());
21661 - printer(input);
21662 - }
21663 -}
21664 -
21665 -static inline void print_expression(const std::string& expr,
21666 - std::function<void(std::istream&)> printer)
21667 -{
21668 - std::istringstream input(expr);
21669 - printer(input);
21670 -}
21671 -
21672 -static inline void print_cin(std::function<void(std::istream&)> printer)
21673 -{
21674 - printer(std::cin);
21675 -}
21676 -
21677 -int main(int argc, char** argv)
21678 -{
21679 - std::vector<std::string> files;
21680 - std::string expr;
21681 -
21682 - po::options_description desc("Allowed options");
21683 - desc.add_options()
21684 - ("help,h", "produce help message")
21685 - ("files,f", po::value<std::vector<std::string>>()->multitoken(),
21686 - "input scripts. If this option and -e are not specified, "
21687 - "will use standard input")
21688 - ("expr,e", po::value<std::string>(), "one line of script")
21689 - ("dot,d", "print graphviz doc file instead of tree string if -s is not specified")
21690 - ("token,t", po::value<std::string>(), "Print all tokens instead of AST. "
21691 - "The argument is the path to libbash.tokens")
21692 - ("walker-token,w", po::value<std::string>(), "Print all tokens received by the walker. "
21693 - "The argument is the path to libbashWalker.tokens")
21694 - ("name,n", "When using files as input scripts, print out file names")
21695 - ("silent,s", "do not print any AST")
21696 - ;
21697 -
21698 - po::variables_map vm;
21699 - po::store(po::parse_command_line(argc, argv, desc), vm);
21700 - po::notify(vm);
21701 -
21702 - if(vm.count("help"))
21703 - {
21704 - std::cout << desc << std::endl;
21705 - return EXIT_FAILURE;
21706 - }
21707 -
21708 - std::function<void(std::istream&)> printer;
21709 - if(vm.count("token"))
21710 - printer = std::bind(&print_parser_token,
21711 - std::placeholders::_1,
21712 - vm["token"].as<std::string>(),
21713 - vm.count("silent"));
21714 - else if(vm.count("walker-token"))
21715 - printer = std::bind(&print_walker_token,
21716 - std::placeholders::_1,
21717 - vm["walker-token"].as<std::string>(),
21718 - vm.count("silent"));
21719 - else
21720 - printer = std::bind(&print_ast,
21721 - std::placeholders::_1,
21722 - vm.count("silent"),
21723 - vm.count("dot"));
21724 -
21725 - try
21726 - {
21727 - if(vm.count("files"))
21728 - print_files(vm["files"].as<std::vector<std::string>>(),
21729 - vm.count("name"),
21730 - printer);
21731 - else if(vm.count("expr"))
21732 - print_expression(vm["expr"].as<std::string>(), printer);
21733 - else
21734 - print_cin(printer);
21735 - }
21736 - catch(libbash::interpreter_exception& e)
21737 - {
21738 - if(!vm.count("silent"))
21739 - std::cerr << e.what() << std::endl;
21740 - return EXIT_FAILURE;
21741 - }
21742 -
21743 - return EXIT_SUCCESS;
21744 -}
21745
21746 diff --git a/libbash-0.1/utils/command_line.cpp b/libbash-0.1/utils/command_line.cpp
21747 deleted file mode 100644
21748 index 8d238b4..0000000
21749 --- a/libbash-0.1/utils/command_line.cpp
21750 +++ /dev/null
21751 @@ -1,88 +0,0 @@
21752 -/* This file was copied from Paludis src/clients/instruo/command_line.cc that is licensed as follows: */
21753 -
21754 -/*
21755 - * Copyright (c) 2007, 2008, 2009, 2010 Ciaran McCreesh
21756 - *
21757 - * This file is part of the Paludis package manager. Paludis is free software;
21758 - * you can redistribute it and/or modify it under the terms of the GNU General
21759 - * Public License version 2, as published by the Free Software Foundation.
21760 - *
21761 - * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
21762 - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
21763 - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
21764 - * details.
21765 - *
21766 - * You should have received a copy of the GNU General Public License along with
21767 - * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
21768 - * Place, Suite 330, Boston, MA 02111-1307 USA
21769 - */
21770 -
21771 -#include "command_line.h"
21772 -#include <paludis/util/singleton-impl.hh>
21773 -
21774 -using namespace paludis;
21775 -
21776 -template class paludis::Singleton<CommandLine>;
21777 -
21778 -CommandLine::CommandLine() :
21779 - ArgsHandler(),
21780 -
21781 - action_args(main_options_section(), "Actions",
21782 - "Selects which basic action to perform. Exactly one action should "
21783 - "be specified."),
21784 - a_generate_cache(&action_args, "generate-cache", 'g', "Generate cache", false),
21785 - a_version(&action_args, "version", 'V', "Display program version", false),
21786 - a_help(&action_args, "help", 'h', "Display program help", false),
21787 -
21788 - general_args(main_options_section(), "General options",
21789 - "Options which are relevant for most or all actions."),
21790 - a_log_level(&general_args, "log-level", '\0'),
21791 - a_no_colour(&general_args, "no-colour", '\0', "Do not use colour", false),
21792 - a_no_color(&a_no_colour, "no-color"),
21793 - a_force_colour(&general_args, "force-colour", '\0', "Force the use of colour", false),
21794 - a_force_color(&a_force_colour, "force-color"),
21795 - a_repository_directory(&general_args, "repository-dir", 'D',
21796 - "Where to find the repository (default: current directory)"),
21797 - a_output_directory(&general_args, "output-dir", 'o',
21798 - "Where to place generated metadata (default: current directory)"),
21799 - a_master_repository_name(&general_args, "master-repository-name", '\0',
21800 - "Use the specified name for the master repository. Specify the location using --extra-repository-dir. "
21801 - "Only for repositories with no metadata/layout.conf."),
21802 - a_extra_repository_dir(&general_args, "extra-repository-dir", '\0',
21803 - "Also include the repository at this location. May be specified multiple times, in creation order."),
21804 - a_report_file(&general_args, "report-file", 'r',
21805 - "Write report to the specified file, rather than stdout")
21806 -{
21807 - add_usage_line("--generate-cache [ at least one of --repository-dir /dir or --output-dir /dir ]");
21808 -
21809 - add_description_line("instruo is configured purely from the command line. It does not use any user "
21810 - "configuration files.");
21811 -
21812 - add_environment_variable("INSTRUO_OPTIONS", "Default command-line options.");
21813 - add_environment_variable("INSTRUO_THREADS", "Number of threads to use. Default: 5");
21814 -}
21815 -
21816 -std::string
21817 -CommandLine::app_name() const
21818 -{
21819 - return "instruo";
21820 -}
21821 -
21822 -std::string
21823 -CommandLine::app_synopsis() const
21824 -{
21825 - return "Metadata generation client for Paludis";
21826 -}
21827 -
21828 -std::string
21829 -CommandLine::app_description() const
21830 -{
21831 - return
21832 - "instruo is a metadata generation client for Paludis. It generates metadata cache for every ID in a "
21833 - "given repository and produces a report of any failures.";
21834 -}
21835 -
21836 -CommandLine::~CommandLine()
21837 -{
21838 -}
21839 -
21840
21841 diff --git a/libbash-0.1/utils/command_line.h b/libbash-0.1/utils/command_line.h
21842 deleted file mode 100644
21843 index 2fdb10b..0000000
21844 --- a/libbash-0.1/utils/command_line.h
21845 +++ /dev/null
21846 @@ -1,62 +0,0 @@
21847 -/* This file was copied from Paludis src/clients/instruo/command_line.hh that is licensed as follows: */
21848 -
21849 -/*
21850 - * Copyright (c) 2007, 2008, 2010 Ciaran McCreesh
21851 - *
21852 - * This file is part of the Paludis package manager. Paludis is free software;
21853 - * you can redistribute it and/or modify it under the terms of the GNU General
21854 - * Public License version 2, as published by the Free Software Foundation.
21855 - *
21856 - * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
21857 - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
21858 - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
21859 - * details.
21860 - *
21861 - * You should have received a copy of the GNU General Public License along with
21862 - * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
21863 - * Place, Suite 330, Boston, MA 02111-1307 USA
21864 - */
21865 -
21866 -#ifndef PALUDIS_GUARD_SRC_CLIENTS_INSTRUO_COMMAND_LINE_HH
21867 -#define PALUDIS_GUARD_SRC_CLIENTS_INSTRUO_COMMAND_LINE_HH 1
21868 -
21869 -#include <paludis/args/args.hh>
21870 -#include <paludis/util/singleton.hh>
21871 -#include <paludis/args/log_level_arg.hh>
21872 -
21873 -class CommandLine :
21874 - public paludis::args::ArgsHandler,
21875 - public paludis::Singleton<CommandLine>
21876 -{
21877 - friend class paludis::Singleton<CommandLine>;
21878 -
21879 - private:
21880 - CommandLine();
21881 - ~CommandLine();
21882 -
21883 - public:
21884 - virtual std::string app_name() const;
21885 - virtual std::string app_synopsis() const;
21886 - virtual std::string app_description() const;
21887 -
21888 - paludis::args::ArgsGroup action_args;
21889 -
21890 - paludis::args::SwitchArg a_generate_cache;
21891 - paludis::args::SwitchArg a_version;
21892 - paludis::args::SwitchArg a_help;
21893 -
21894 - paludis::args::ArgsGroup general_args;
21895 -
21896 - paludis::args::LogLevelArg a_log_level;
21897 - paludis::args::SwitchArg a_no_colour;
21898 - paludis::args::AliasArg a_no_color;
21899 - paludis::args::SwitchArg a_force_colour;
21900 - paludis::args::AliasArg a_force_color;
21901 - paludis::args::StringArg a_repository_directory;
21902 - paludis::args::StringArg a_output_directory;
21903 - paludis::args::StringArg a_master_repository_name;
21904 - paludis::args::StringSequenceArg a_extra_repository_dir;
21905 - paludis::args::StringArg a_report_file;
21906 -};
21907 -
21908 -#endif
21909
21910 diff --git a/libbash-0.1/utils/instruo.cpp b/libbash-0.1/utils/instruo.cpp
21911 deleted file mode 100644
21912 index dcd3924..0000000
21913 --- a/libbash-0.1/utils/instruo.cpp
21914 +++ /dev/null
21915 @@ -1,263 +0,0 @@
21916 -/* This file was partly copied from Paludis src/clients/instruo/instruo.cc.
21917 - * The metadata generation logic is reimplemented with libbash. This file is
21918 - * licensed as follows: */
21919 -
21920 -/*
21921 - * Copyright (c) 2007, 2008, 2009, 2010 Ciaran McCreesh
21922 - *
21923 - * This file is part of the Paludis package manager. Paludis is free software;
21924 - * you can redistribute it and/or modify it under the terms of the GNU General
21925 - * Public License version 2, as published by the Free Software Foundation.
21926 - *
21927 - * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
21928 - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
21929 - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
21930 - * details.
21931 - *
21932 - * You should have received a copy of the GNU General Public License along with
21933 - * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
21934 - * Place, Suite 330, Boston, MA 02111-1307 USA
21935 - */
21936 -
21937 -#include <algorithm>
21938 -#include <fstream>
21939 -#include <functional>
21940 -#include <iostream>
21941 -#include <map>
21942 -
21943 -#include <paludis/args/do_help.hh>
21944 -#include <paludis/about.hh>
21945 -#include <paludis/action.hh>
21946 -#include <paludis/package_id.hh>
21947 -#include <paludis/generator.hh>
21948 -#include <paludis/filter.hh>
21949 -#include <paludis/filtered_generator.hh>
21950 -#include <paludis/selection.hh>
21951 -#include <paludis/util/system.hh>
21952 -#include <paludis/util/join.hh>
21953 -#include <paludis/util/log.hh>
21954 -#include <paludis/util/sequence.hh>
21955 -#include <paludis/util/map.hh>
21956 -#include <paludis/util/visitor_cast.hh>
21957 -#include <paludis/util/set.hh>
21958 -#include <paludis/util/make_named_values.hh>
21959 -#include <paludis/util/mutex.hh>
21960 -#include <paludis/util/thread_pool.hh>
21961 -#include <paludis/util/destringify.hh>
21962 -#include <paludis/util/safe_ofstream.hh>
21963 -#include <paludis/util/pretty_print.hh>
21964 -#include <paludis/util/indirect_iterator-impl.hh>
21965 -#include <paludis/util/timestamp.hh>
21966 -#include <paludis/util/accept_visitor.hh>
21967 -#include <paludis/environments/no_config/no_config_environment.hh>
21968 -#include <paludis/package_database.hh>
21969 -#include <paludis/metadata_key.hh>
21970 -
21971 -#include "builtins/builtin_exceptions.h"
21972 -#include "command_line.h"
21973 -#include "libbash.h"
21974 -#include "utils/metadata.h"
21975 -
21976 -using namespace paludis;
21977 -using std::cout;
21978 -using std::cerr;
21979 -using std::endl;
21980 -
21981 -void worker(const std::shared_ptr<PackageIDSequence> &ids)
21982 -{
21983 - std::unordered_map<std::string, std::vector<std::string>> variables;
21984 -
21985 - std::shared_ptr<const PackageID> id;
21986 - unsigned total(0);
21987 - CategoryNamePart old_cat("OLDCAT");
21988 - while(!ids->empty())
21989 - {
21990 - id = *ids->begin();
21991 - ids->pop_front();
21992 - if (id->name().category() != old_cat)
21993 - {
21994 - std::cout << "Processing " << stringify(id->name().category()) << "..." << std::endl;
21995 - old_cat = id->name().category();
21996 - FSPath(CommandLine::get_instance()->a_output_directory.argument() + "/" +
21997 - stringify(id->name().category())).mkdir(0755, {fspmkdo_ok_if_exists});
21998 - ++total;
21999 - }
22000 -
22001 - Context i_context("When generating metadata for ID '" + stringify(*id) + "':");
22002 -
22003 - variables.clear();
22004 - variables["PN"].push_back(stringify(id->name().package()));
22005 - variables["PV"].push_back(stringify(id->version().remove_revision()));
22006 - variables["P"].push_back(stringify(id->name().package()) + "-" +
22007 - stringify(id->version().remove_revision()));
22008 - variables["PR"].push_back(id->version().revision_only());
22009 - variables["PVR"].push_back(stringify(id->version()));
22010 - variables["PF"].push_back(stringify(id->name().package()) + "-" + stringify(id->version()));
22011 - variables["CATEGORY"].push_back(stringify(id->name().category()));
22012 - std::vector<std::string> functions;
22013 -
22014 - std::string ebuild_path(CommandLine::get_instance()->a_repository_directory.argument() +
22015 - variables["CATEGORY"][0] + "/" +
22016 - variables["PN"][0] + "/" +
22017 - variables["PN"][0] + "-" +
22018 - variables["PVR"][0] + ".ebuild");
22019 - try
22020 - {
22021 - libbash::interpret(ebuild_path, "utils/isolated-functions.sh", variables, functions);
22022 - }
22023 - catch(const libbash::interpreter_exception& e)
22024 - {
22025 - cerr << "Exception occurred while interpreting " << ebuild_path << ". The error message is:\n"
22026 - << e.what() << endl;
22027 - continue;
22028 - }
22029 - catch(const return_exception& e)
22030 - {
22031 - cerr << "Unhandled return exception in " << ebuild_path << ". The error message is:\n"
22032 - << e.what() << endl;
22033 - continue;
22034 - }
22035 - catch (...)
22036 - {
22037 - cerr << "Unhandled exception in " << ebuild_path << endl;
22038 - continue;
22039 - }
22040 -
22041 - std::string output_path(CommandLine::get_instance()->a_output_directory.argument() + "/" +
22042 - variables["CATEGORY"][0] + "/" +
22043 - variables["PN"][0] + "-" +
22044 - variables["PVR"][0]);
22045 - FSPath(output_path).dirname().mkdir(0755, {fspmkdo_ok_if_exists});
22046 - std::ofstream output(output_path, std::ofstream::out | std::ofstream::trunc);
22047 - write_metadata(output, variables, functions);
22048 - }
22049 -}
22050 -
22051 -int main(int argc, char** argv)
22052 -{
22053 - try
22054 - {
22055 - std::string options(paludis::getenv_with_default("INSTRUO_OPTIONS", ""));
22056 - if (! options.empty())
22057 - options = "(" + options + ") ";
22058 - options += join(argv + 1, argv + argc, " ");
22059 -
22060 - Context context(std::string("In program ") + argv[0] + " " + options + ":");
22061 -
22062 - CommandLine::get_instance()->run(argc, argv, "instruo", "INSTRUO_OPTIONS", "INSTRUO_CMDLINE");
22063 -
22064 - if (CommandLine::get_instance()->a_help.specified())
22065 - throw args::DoHelp();
22066 -
22067 - if (CommandLine::get_instance()->a_log_level.specified())
22068 - Log::get_instance()->set_log_level(CommandLine::get_instance()->a_log_level.option());
22069 - else
22070 - Log::get_instance()->set_log_level(ll_qa);
22071 -
22072 - if (1 < (
22073 - CommandLine::get_instance()->a_generate_cache.specified() +
22074 - CommandLine::get_instance()->a_version.specified()
22075 - ))
22076 - throw args::DoHelp("you should specify exactly one action");
22077 -
22078 - if (! CommandLine::get_instance()->a_repository_directory.specified())
22079 - CommandLine::get_instance()->a_repository_directory.set_argument(stringify(FSPath::cwd()));
22080 -
22081 - if (CommandLine::get_instance()->a_version.specified())
22082 - {
22083 - cout << "instruo, part of " << PALUDIS_PACKAGE << " " << PALUDIS_VERSION_MAJOR << "."
22084 - << PALUDIS_VERSION_MINOR << "." << PALUDIS_VERSION_MICRO << PALUDIS_VERSION_SUFFIX;
22085 - if (! std::string(PALUDIS_GIT_HEAD).empty())
22086 - cout << " git " << PALUDIS_GIT_HEAD;
22087 - cout << endl << endl;
22088 - cout << "Paludis comes with ABSOLUTELY NO WARRANTY. Paludis is free software, and you" << endl;
22089 - cout << "are welcome to redistribute it under the terms of the GNU General Public" << endl;
22090 - cout << "License, version 2." << endl;
22091 -
22092 - return EXIT_SUCCESS;
22093 - }
22094 -
22095 - if ((
22096 - CommandLine::get_instance()->a_repository_directory.specified() +
22097 - CommandLine::get_instance()->a_output_directory.specified()
22098 - ) < 1)
22099 - throw args::DoHelp("at least one of '--" + CommandLine::get_instance()->a_repository_directory.long_name() + "' or '--"
22100 - + CommandLine::get_instance()->a_output_directory.long_name() + "' must be specified");
22101 -
22102 - if (! CommandLine::get_instance()->a_output_directory.specified())
22103 - CommandLine::get_instance()->a_output_directory.set_argument(stringify(FSPath::cwd()));
22104 -
22105 - std::shared_ptr<FSPathSequence> extra_repository_dirs(std::make_shared<FSPathSequence>());
22106 - for (args::StringSequenceArg::ConstIterator d(CommandLine::get_instance()->a_extra_repository_dir.begin_args()),
22107 - d_end(CommandLine::get_instance()->a_extra_repository_dir.end_args()) ;
22108 - d != d_end ; ++d)
22109 - extra_repository_dirs->push_back(FSPath(*d));
22110 -
22111 - std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
22112 - keys->insert("append_repository_name_to_write_cache", "false");
22113 - NoConfigEnvironment env(make_named_values<no_config_environment::Params>(
22114 - n::accept_unstable() = true,
22115 - n::disable_metadata_cache() = true,
22116 - n::extra_accept_keywords() = "",
22117 - n::extra_params() = keys,
22118 - n::extra_repository_dirs() = extra_repository_dirs,
22119 - n::master_repository_name() = CommandLine::get_instance()->a_master_repository_name.argument(),
22120 - n::profiles_if_not_auto() = "",
22121 - n::repository_dir() = CommandLine::get_instance()->a_repository_directory.argument(),
22122 - n::repository_type() = no_config_environment::ncer_ebuild,
22123 - n::write_cache() = CommandLine::get_instance()->a_output_directory.argument()
22124 - ));
22125 -
22126 - FSPath(CommandLine::get_instance()->a_output_directory.argument()).mkdir(0755, {fspmkdo_ok_if_exists});
22127 -
22128 - std::shared_ptr<PackageIDSequence> ids(env[selection::AllVersionsSorted(
22129 - generator::InRepository(env.main_repository()->name()))]);
22130 - worker(ids);
22131 - }
22132 - catch (const paludis::args::ArgsError & e)
22133 - {
22134 - cerr << "Usage error: " << e.message() << endl;
22135 - cerr << "Try " << argv[0] << " --help" << endl;
22136 - return EXIT_FAILURE;
22137 - }
22138 - catch (const args::DoHelp & h)
22139 - {
22140 - if (h.message.empty())
22141 - {
22142 - cout << "Usage: " << argv[0] << " [options]" << endl;
22143 - cout << endl;
22144 - cout << *CommandLine::get_instance();
22145 - return EXIT_SUCCESS;
22146 - }
22147 - else
22148 - {
22149 - cerr << "Usage error: " << h.message << endl;
22150 - cerr << "Try " << argv[0] << " --help" << endl;
22151 - return EXIT_FAILURE;
22152 - }
22153 - }
22154 - catch (const Exception & e)
22155 - {
22156 - cout << endl;
22157 - cerr << "Unhandled exception:" << endl
22158 - << " * " << e.backtrace("\n * ")
22159 - << e.message() << " (" << e.what() << ")" << endl;
22160 - return EXIT_FAILURE;
22161 - }
22162 - catch (const std::exception & e)
22163 - {
22164 - cout << endl;
22165 - cerr << "Unhandled exception:" << endl
22166 - << " * " << e.what() << endl;
22167 - return EXIT_FAILURE;
22168 - }
22169 - catch (...)
22170 - {
22171 - cout << endl;
22172 - cerr << "Unhandled exception:" << endl
22173 - << " * Unknown exception type. Ouch..." << endl;
22174 - return EXIT_FAILURE;
22175 - }
22176 -
22177 - return EXIT_SUCCESS;
22178 -}
22179
22180 diff --git a/libbash-0.1/utils/isolated-functions.sh b/libbash-0.1/utils/isolated-functions.sh
22181 deleted file mode 100755
22182 index 9d189ed..0000000
22183 --- a/libbash-0.1/utils/isolated-functions.sh
22184 +++ /dev/null
22185 @@ -1,55 +0,0 @@
22186 -die(){
22187 - echo "Die is called: $*"
22188 -}
22189 -
22190 -has() {
22191 - hasq $*
22192 -}
22193 -
22194 -hasq() {
22195 - for item in ${*:2}
22196 - do
22197 - [[ $item == $1 ]] && return 0
22198 - done
22199 - return 1
22200 -}
22201 -
22202 -EXPORT_FUNCTIONS() {
22203 - if [ -z "$ECLASS" ]; then
22204 - die "EXPORT_FUNCTIONS without a defined ECLASS"
22205 - return 1
22206 - fi
22207 - __export_funcs_var="$__export_funcs_var $*"
22208 -}
22209 -
22210 -use() {
22211 - echo "use shouldn't be called"
22212 - return 1
22213 -}
22214 -
22215 -useq() {
22216 - echo "useq shouldn't be called"
22217 - return 1
22218 -}
22219 -
22220 -use_with() {
22221 - echo "use_with shouldn't be called"
22222 - return 1
22223 -}
22224 -
22225 -use_enable() {
22226 - echo "use_enable shouldn't be called"
22227 - return 1
22228 -}
22229 -
22230 -eerror() {
22231 - echo "eerror: $*"
22232 -}
22233 -
22234 -debug-print() {
22235 - echo "debug-print: $*"
22236 -}
22237 -
22238 -ewarn() {
22239 - echo "ewarn: $*"
22240 -}
22241
22242 diff --git a/libbash-0.1/utils/metadata.cpp b/libbash-0.1/utils/metadata.cpp
22243 deleted file mode 100644
22244 index ed07092..0000000
22245 --- a/libbash-0.1/utils/metadata.cpp
22246 +++ /dev/null
22247 @@ -1,117 +0,0 @@
22248 -/*
22249 - Please use git log for copyright holder and year information
22250 -
22251 - This file is part of libbash.
22252 -
22253 - libbash is free software: you can redistribute it and/or modify
22254 - it under the terms of the GNU General Public License as published by
22255 - the Free Software Foundation, either version 2 of the License, or
22256 - (at your option) any later version.
22257 -
22258 - libbash is distributed in the hope that it will be useful,
22259 - but WITHOUT ANY WARRANTY; without even the implied warranty of
22260 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22261 - GNU General Public License for more details.
22262 -
22263 - You should have received a copy of the GNU General Public License
22264 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
22265 - */
22266 -///
22267 -/// \file metadata.cpp
22268 -/// \brief a helper for printing metadata content
22269 -///
22270 -#include "utils/metadata.h"
22271 -
22272 -#include <set>
22273 -
22274 -#include <boost/spirit/include/karma.hpp>
22275 -#include <boost/algorithm/string/classification.hpp>
22276 -#include <boost/algorithm/string/split.hpp>
22277 -#include <boost/algorithm/string/trim.hpp>
22278 -
22279 -static const std::vector<std::string> metadata_names = {"DEPEND", "RDEPEND", "SLOT", "SRC_URI",
22280 - "RESTRICT", "HOMEPAGE", "LICENSE", "DESCRIPTION",
22281 - "KEYWORDS", "INHERITED", "IUSE", "REQUIRED_USE",
22282 - "PDEPEND", "PROVIDE", "EAPI", "PROPERTIES"};
22283 -
22284 -static const std::unordered_map<std::string, std::string> phases = {
22285 - {"pkg_pretend", "ppretend"},
22286 - {"pkg_setup", "setup"},
22287 - {"src_unpack", "unpack"},
22288 - {"src_prepare", "prepare"},
22289 - {"src_configure", "configure"},
22290 - {"src_compile", "compile"},
22291 - {"src_test", "test"},
22292 - {"src_install", "install"},
22293 - {"pkg_preinst", "preinst"},
22294 - {"pkg_postinst", "postinst"},
22295 - {"pkg_prerm", "prerm"},
22296 - {"pkg_postrm", "postrm"},
22297 - {"pkg_config", "config"},
22298 - {"pkg_info", "info"},
22299 - {"pkg_nofetch", "nofetch"}
22300 -};
22301 -
22302 -void write_metadata(std::ostream& output,
22303 - std::unordered_map<std::string, std::vector<std::string>>& variables,
22304 - std::vector<std::string>& functions)
22305 -{
22306 - for(auto iter_name = metadata_names.begin(); iter_name != metadata_names.end(); ++iter_name)
22307 - {
22308 - auto iter_value = variables.find(*iter_name);
22309 - std::string value;
22310 -
22311 - if(iter_value != variables.end())
22312 - value = iter_value->second[0];
22313 -
22314 - // Check if global is defined
22315 - auto iter_global = variables.find("E_" + *iter_name);
22316 - if(iter_global != variables.end())
22317 - {
22318 - boost::trim_if(iter_global->second[0], boost::is_any_of(" \t\n"));
22319 - std::vector<std::string> splitted_global;
22320 - boost::split(splitted_global,
22321 - iter_global->second[0],
22322 - boost::is_any_of(" \t\n"),
22323 - boost::token_compress_on);
22324 -
22325 - // Append the global value to 'value' if it doesn't cause duplication
22326 - for(auto iter_splitted_global = splitted_global.begin();
22327 - iter_splitted_global != splitted_global.end();
22328 - ++iter_splitted_global)
22329 - {
22330 - if(value.find(*iter_splitted_global) == std::string::npos)
22331 - value += " " + *iter_splitted_global;
22332 - }
22333 - }
22334 -
22335 - boost::trim_if(value, boost::is_any_of(" \t\n"));
22336 -
22337 - std::vector<std::string> splitted_value;
22338 - boost::split(splitted_value,
22339 - value,
22340 - boost::is_any_of(" \t\n"),
22341 - boost::token_compress_on);
22342 -
22343 - // INHERITED eclasses should be sorted
22344 - if(*iter_name == "INHERITED")
22345 - sort(splitted_value.begin(), splitted_value.end());
22346 -
22347 - using namespace boost::spirit::karma;
22348 - output << format(string % ' ', splitted_value) << std::endl;
22349 - }
22350 -
22351 - // Print defined phases
22352 - std::set<std::string> sorted_phases;
22353 - for(auto iter = functions.begin(); iter != functions.end(); ++iter)
22354 - {
22355 - auto iter_phase = phases.find(*iter);
22356 - if(iter_phase != phases.end())
22357 - sorted_phases.insert(iter_phase->second);
22358 - }
22359 - using namespace boost::spirit::karma;
22360 - output << format(string % ' ', sorted_phases) << std::endl;
22361 -
22362 - // Print empty lines
22363 - output << std::endl << std::endl << std::endl << std::endl << std::endl;
22364 -}
22365
22366 diff --git a/libbash-0.1/utils/metadata.h b/libbash-0.1/utils/metadata.h
22367 deleted file mode 100644
22368 index 7071ce0..0000000
22369 --- a/libbash-0.1/utils/metadata.h
22370 +++ /dev/null
22371 @@ -1,30 +0,0 @@
22372 -/*
22373 - Please use git log for copyright holder and year information
22374 -
22375 - This file is part of libbash.
22376 -
22377 - libbash is free software: you can redistribute it and/or modify
22378 - it under the terms of the GNU General Public License as published by
22379 - the Free Software Foundation, either version 2 of the License, or
22380 - (at your option) any later version.
22381 -
22382 - libbash is distributed in the hope that it will be useful,
22383 - but WITHOUT ANY WARRANTY; without even the implied warranty of
22384 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22385 - GNU General Public License for more details.
22386 -
22387 - You should have received a copy of the GNU General Public License
22388 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
22389 - */
22390 -///
22391 -/// \file metadata.h
22392 -/// \brief a helper for printing metadata content
22393 -///
22394 -#include <iostream>
22395 -#include <string>
22396 -#include <unordered_map>
22397 -#include <vector>
22398 -
22399 -void write_metadata(std::ostream& output,
22400 - std::unordered_map<std::string, std::vector<std::string>>& variables,
22401 - std::vector<std::string>& functions);
22402
22403 diff --git a/libbash-0.1/utils/metadata_diff.sh b/libbash-0.1/utils/metadata_diff.sh
22404 deleted file mode 100755
22405 index 7a21855..0000000
22406 --- a/libbash-0.1/utils/metadata_diff.sh
22407 +++ /dev/null
22408 @@ -1,36 +0,0 @@
22409 -#!/bin/bash
22410 -
22411 -source /etc/make.conf
22412 -
22413 -outputdir=${1:-$(mktemp -d)}
22414 -
22415 -if [[ ! (-d $outputdir && -w $outputdir) ]]
22416 -then
22417 - echo "$outputdir is not writable"
22418 -fi
22419 -
22420 -echo "Generating metadata at $outputdir"
22421 -
22422 -time ./instruo -D ${PORTDIR:-/usr/portage/} -o $outputdir 2>$outputdir/error_output
22423 -
22424 -echo "Running diff..."
22425 -
22426 -declare -i error_count=0 total_num=0
22427 -
22428 -for category_dir in ${PORTDIR:-/usr/portage}/*
22429 -do
22430 - category=${category_dir##*\/}
22431 - cache_dir=${PORTDIR:-/usr/portage}/metadata/cache/${category}
22432 - if [[ -d $cache_dir ]]
22433 - then
22434 - for path in $cache_dir/*
22435 - do
22436 - filename=${path##*\/}
22437 - diff -u $cache_dir/$file $outputdir/$category/$filename > $outputdir/$category/$filename.diff 2>>$outputdir/error_output
22438 - error_count+=$(($? != 0))
22439 - total_num+=1
22440 - done
22441 - fi
22442 -done
22443 -
22444 -echo "$((total_num - error_count)) out of $total_num metadata files are correct. See file.diff for more details."
22445
22446 diff --git a/libbash-0.1/utils/metadata_generator.cpp b/libbash-0.1/utils/metadata_generator.cpp
22447 deleted file mode 100644
22448 index 8951044..0000000
22449 --- a/libbash-0.1/utils/metadata_generator.cpp
22450 +++ /dev/null
22451 @@ -1,45 +0,0 @@
22452 -/*
22453 - Please use git log for copyright holder and year information
22454 -
22455 - This file is part of libbash.
22456 -
22457 - libbash is free software: you can redistribute it and/or modify
22458 - it under the terms of the GNU General Public License as published by
22459 - the Free Software Foundation, either version 2 of the License, or
22460 - (at your option) any later version.
22461 -
22462 - libbash is distributed in the hope that it will be useful,
22463 - but WITHOUT ANY WARRANTY; without even the implied warranty of
22464 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22465 - GNU General Public License for more details.
22466 -
22467 - You should have received a copy of the GNU General Public License
22468 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
22469 - */
22470 -///
22471 -/// \file metadata_generator.cpp
22472 -/// \brief a simple utility for generating metadata
22473 -///
22474 -#include <iostream>
22475 -#include <string>
22476 -#include <vector>
22477 -
22478 -#include "libbash.h"
22479 -#include "utils/metadata.h"
22480 -
22481 -int main(int argc, char** argv)
22482 -{
22483 - if(argc != 2)
22484 - {
22485 - std::cerr<<"Please provide your script as an argument"<<std::endl;
22486 - exit(EXIT_FAILURE);
22487 - }
22488 -
22489 - std::unordered_map<std::string, std::vector<std::string>> variables;
22490 - std::vector<std::string> functions;
22491 - libbash::interpret(argv[1], variables, functions);
22492 -
22493 - write_metadata(std::cout, variables, functions);
22494 -
22495 - return EXIT_SUCCESS;
22496 -}
22497
22498 diff --git a/libbash-0.1/utils/variable_printer.cpp b/libbash-0.1/utils/variable_printer.cpp
22499 deleted file mode 100644
22500 index d44dc35..0000000
22501 --- a/libbash-0.1/utils/variable_printer.cpp
22502 +++ /dev/null
22503 @@ -1,77 +0,0 @@
22504 -/*
22505 - Please use git log for copyright holder and year information
22506 -
22507 - This file is part of libbash.
22508 -
22509 - libbash is free software: you can redistribute it and/or modify
22510 - it under the terms of the GNU General Public License as published by
22511 - the Free Software Foundation, either version 2 of the License, or
22512 - (at your option) any later version.
22513 -
22514 - libbash is distributed in the hope that it will be useful,
22515 - but WITHOUT ANY WARRANTY; without even the implied warranty of
22516 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22517 - GNU General Public License for more details.
22518 -
22519 - You should have received a copy of the GNU General Public License
22520 - along with libbash. If not, see <http://www.gnu.org/licenses/>.
22521 -*/
22522 -///
22523 -/// \file variable_printer.cpp
22524 -/// \brief a program to write variables in a script into standard output
22525 -///
22526 -
22527 -#include <algorithm>
22528 -#include <iostream>
22529 -#include <map>
22530 -
22531 -#include <gtest/gtest.h>
22532 -#include <boost/spirit/include/karma.hpp>
22533 -#include <boost/fusion/include/std_pair.hpp>
22534 -
22535 -#include "libbash.h"
22536 -
22537 -static const std::vector<std::string> special_variables
22538 -{
22539 - "IFS", "*", "0", "-"
22540 -};
22541 -
22542 -static std::string get_src_dir()
22543 -{
22544 - std::string srcdir(".");
22545 - if(getenv("srcdir"))
22546 - srcdir = getenv("srcdir");
22547 -
22548 - return srcdir;
22549 -}
22550 -
22551 -int main(int argc, char** argv)
22552 -{
22553 - if(argc != 2)
22554 - {
22555 - std::cerr<<"Please provide your script as an argument"<<std::endl;
22556 - exit(EXIT_FAILURE);
22557 - }
22558 -
22559 - std::unordered_map<std::string, std::vector<std::string>> variables;
22560 - std::vector<std::string> functions;
22561 - try
22562 - {
22563 - libbash::interpret(argv[1], get_src_dir() + "/utils/isolated-functions.sh", variables, functions);
22564 - }
22565 - catch(libbash::interpreter_exception& e)
22566 - {
22567 - std::cerr << e.what() << std::endl;
22568 - return EXIT_FAILURE;
22569 - }
22570 -
22571 - std::map<std::string, std::vector<std::string>> sorted(variables.begin(), variables.end());
22572 - // Currently we don't need internal variables
22573 - for(auto iter = special_variables.begin(); iter != special_variables.end(); ++iter)
22574 - sorted.erase(*iter);
22575 -
22576 - using namespace boost::spirit::karma;
22577 - std::cout << format((string << '=' << -(string % ' ')) % eol, sorted) << std::endl;
22578 -
22579 - return 0;
22580 -}