Commit 76c6ea0c by Tom Tromey Committed by Tom Tromey

Makefile.in: Rebuilt.

fastjar
	Removed
libjava
	* Makefile.in: Rebuilt.
	* Makefile.am (ZIP): Removed.
	(libgcj-$(gcc_version).jar): Use $(JAR).
	(src.zip): Likewise.
	* configure: Rebuilt.
	* configure.ac: Check for jar.  Removed code to set ZIP.

From-SVN: r112654
parent 46bdbc00
Bryan Burns and Cory Jon Hollingsworth.
0.92 08/24/2000 Improved support for other Unix platforms.
Now works on Solaris, AIX, True 64, and HP-UX.
Hopefully resolved all big endian problems.
Fixed bug in update which caused it to skip
openning update file
0.90 12/06/1999 Fixed recursive archival bug.
0.86 10/12/1999 Applied patch to fix leading "./" problem.
0.85 5/10/1999 The -t and -x flags now work. Hooray! Those
took quite a long time to get working.
Handling extraction/listing added quite a bit
of code, 500-1000 lines. ouch!
0.75 4/27/1999 Added support for -C flag, allowing you to
change directories before adding files. See
fastjar's usage screen for more info. Also
improved the total compression display, and
added install/uninstall targets to the
Makefile.
0.71 4/27/1999 Added -V flag to print version info. Added
better error messages, and added configure
script for better portability.
0.70 4/25/1999 Added compression. Only deflation is supported
at this time (only one jar supports) and is
enabled by default. use the -0 flag to disable
compression.
0.60 4/21/1999 Added support for manifest files (-m, -M).
Fixed bug with mod time/date in central header.
0.50.1 4/20/1999 Added patch from John Bley. (Fixes bug with
not properly closing the file)
0.50 4/20/1999 First public release
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
2006-02-08 Thomas Fitzsimmons <fitzsim@redhat.com>
* jartool.h (ACTION_INDEX): New macro.
* jartool.c (main): Handle -i option.
* fastjar.texi (Invoking fastjar): Add description of -i option.
2006-01-31 Tom Tromey <tromey@redhat.com>
* jartool.c (version): Use 2006.
* jargrep.c (version): Use 2006.
2005-11-29 Tom Tromey <tromey@redhat.com>
* compress.c (write_data): Mark 'ze' as unused.
* jartool.h (__attribute__): New define.
* shift.c (shift_up): Added cast.
(shift_down): Likewise.
* jartool.c (help): Split string constant.
2005-06-29 Kelley Cook <kcook@gcc.gnu.org>
* all files: Update FSF address.
2005-05-17 Kelley Cook <kcook@gcc.gnu.org>
* configure.ac: Use AC_C_BIGENDIAN instead of AC_C_BIGENDIAN_CROSS.
Use AC_CHECK_SIZEOF instead of AC_COMPILE_CHECK_SIZEOF.
* Makefile.am: Remove ACLOCAL_AMFLAGS.
* aclocal.m4, Makefile.in, configure, config.h.in: Regenerate.
2005-03-28 Marcin Dalecki <martin@dalecki.de>
* jartool.c (main): Indentation fixlet.
(add_entry): Likewise.
(init_args): Don't use K&R style.
(jt_strdup): Likewise.
(get_next_arg): Add explicit '(void)'.
(init_headers): Likewise.
(version): Likewise.
2005-03-15 Zack Weinberg <zack@codesourcery.com>
* Makefile.am (fastjar_TEXINFOS): Add gcc-vers.texi.
(BASEVER, DEVPHASE): New variables.
(POD2MAN): Adjust setting of --release option.
(fastjar.1, grepjar.1, gcc-vers.texi): New rules.
* Makefile.in: Regenerate.
* configure.ac: Do not invoke TL_AC_GCC_VERSION.
* aclocal.m4, configure: Regenerate.
2004-12-02 Richard Sandiford <rsandifo@redhat.com>
* configure.ac: Use TL_AC_GCC_VERSION to set gcc_version.
* configure, aclocal.m4, Makefile.in: Regenerate.
2004-11-15 Kelley Cook <kcook@gcc.gnu.org>
* Makefile.am: Remove -no-dependencies.
* Makefile.in: Regenerate.
2004-11-13 Kelley Cook <kcook@gcc.gnu.org>
* Makefile.am: Define ACLOCAL_AMFLAGS.
* acinclude.m4: Remove unnecessary sinclude.
* aclocal.m4, Makefile.in, configure: Regenerate (autoreconf 1.9.3).
2004-09-23 Tom Tromey <tromey@redhat.com>
* jartool.c (extract_jar): Unconditionally read extra data in the
entry header; don't read it after the file contents.
2004-08-11 Kelley Cook <kcook@gcc.gnu.org>
PR bootstrap/16164
* Makefile.am: Force fastjar.info to be built in build directory.
* Makefile.in: Regenerate.
2004-07-23 Thomas Fitzsimmons <fitzsim@redhat.com>
* Makefile.am: Rename jar binary to fastjar.
* Makefile.in: Regenerate.
* fastjar.texi: Rename references to jar binary with fastjar.
2004-07-19 Bryce McKinlay <mckinlay@redhat.com>
* jartool.c (main): Ensure that only one of ftruncate and _chsize
is used.
2004-07-11 Bryce McKinlay <mckinlay@redhat.com>
PR 16472
* configure.ac: Check for ftruncate() and _chsize().
* jartool.c (main): Use _chsize if ftruncate not available.
* configure, config.h.in: Rebuilt.
2004-07-09 Richard Sandiford <rsandifo@redhat.com>
* jartool.c (find_entry, looks_like_dir): Remove inline spec.
2004-07-07 Matthias Klose <doko@debian.org>
* Makefile.am (jar_CPPFLAGS): Add AM_CPPFLAGS.
* Makefile.in: Regenerate.
2004-07-06 Matthias Klose <doko@debian.org>
* Makefile.in: Regenerate.
* fastjar.texi: Update for '-u'.
2004-07-06 Casey Marshall <csm@gnu.org>
PR 7854
* Makefile.am
(jar_SOURCES): added shift.c, shift.h.
(jar_CPPFLAGS): define WITH_SHIFT_DOWN.
* compress.c
Added FSF copyright.
(write_data): new function.
(compress_file): call write_data.
* jartool.c
Updated copyright year.
(progname): new variable.
(end_of_entries): new variable.
(main): open and read file when updating.
(find_entry): new function.
(looks_like_dir): new function.
(read_entries): new function.
(make_manifest): added parameter `updating'.
Call `add_file_to_jar' with `updating'.
(add_to_jar_with_dir): added parameter `updating'.
Call `add_to_jar' with `updating'.
(add_to_jar): added parameter `updating'.
Call `add_file_to_jar' with `updating'.
Don't add directories if they already exist.
(add_file_to_jar): added parameter `updating'.
Update entries if they already exist.
* jartool.h
Added #ifndef __FASTJAR_JARTOOL_H__.
(struct zipentry): added `flags'.
* shift.c: new file.
* shift.h: new file.
* zipfile.h
(CEN_FLAGS): new constant.
2004-07-05 Kelley Cook <kcook@gcc.gnu.org>
* Makefile.am: Silence two automake warnings.
* Makefile.in: Regenerate.
2004-06-25 Kelley Cook <kcook@gcc.gnu.org>
PR other/15194
* configure.ac: Add check for long long.
* jartool.h: Check for long long before using it.
* configure: Regenerate
* config.h.in: Regenerate.
2004-06-15 Paolo Bonzini <bonzini@gnu.org>
* acinclude.m4: Quote first argument of AC_DEFUNs.
* aclocal.m4: Regenerate with automake 1.8.
* Makefile.in: Likewise.
* configure: Regenerate.
* .cvsignore: New file.
2004-04-12 Kelley Cook <kcook@gcc.gnu.org>
PR bootstrap/14905
* configure.ac: Parse --enable-generated-files-in-srcdir.
* Makefile.am: Copy man and info files to srcdir if requested.
* configure: Regenerate.
* Makefile.in Regenerate.
2004-03-10 Kelley Cook <kcook@gcc.gnu.org>
* configure.ac: Bump AC_PREREQ to 2.59.
* configure: Regenerate.
2004-03-09 Hans-Peter Nilsson <hp@axis.com>
* configure: Regenerate for config/accross.m4 correction.
2004-01-09 Kelley Cook <kcook@gcc.gnu.org>
* configure.in: Rename file to ...
* configure.ac: ... this. Add in AC_PREREQ(2.57)
* config.h.in: Regenerate.
* aclocal.m4: Regenerate.
* Makefile.in: Regenerate.
2004-01-07 Andreas Tobler <a.tobler@schweiz.ch>
* jartool.c (make_manifest): Fix off-by-one bug when creating
an empty MANIFEST.MF.
2003-12-01 Kelley Cook <kcook@gcc.gnu.org>
* Makefile.am: Define AM_MAKINFOFLAGS. Remove Automake 1.4 hack.
* Makefile.in: Regenerate with automake 1.7.6 & autoconf 2.57 tools.
* aclocal.m4, config.h.in, configure: Likewise.
* install-sh, missing, mkinstalldirs, stamp-h.in: Remove.
2003-11-21 Kelley Cook <kcook@gcc.gnu.org>
* .cvsignore: Delete.
2003-10-30 Kelley Cook <kcook@gcc.gnu.org>
* Makefile.am (my_make_i_flags): Add $(srcdir) and update comment
to match.
(fastjar.info): Update target to write to build directory.
(%.1): New implicit rule from a .pod file.
(jar.1): Delete.
(grepjar.1): Delete.
(jar.pod): New intermediate rule.
(grepjar.pod): Likewise.
* Makefile.in: Regenerate.
2003-08-13 Matthias Klose <doko@debian.org>
* fastjar.texi: License manual under the GPL.
* Makefile.am: Remove reference to fdl.texi
* Makefile.in: Regenerate
2003-07-29 Nathanael Nerode <neroden@gcc.gnu.org>
* mkinstalldirs: Import autoconf 2.57 / automake 1.7 version.
2003-07-11 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
* README: Note that FastJar is not part of GCC.
2003-07-02 Nathanael Nerode <neroden@gcc.gnu.org>
PR java/9532
* jartool.c (add_to_jar): Return 1 on failure to open file.
Split out -C case to:
* jartool.c (add_to_jar_with_dir): New function.
2003-06-15 Nathanael Nerode <neroden@gcc.gnu.org>
PR java/9532
* jartool.c (main) Give proper error messages with -C, and
check for missing arguments properly. Send error messages
to stderr.
* jartool.c (add_to_jar): Make getcwd() call portable,
and check for error return.
2003-03-30 Joseph S. Myers <jsm@polyomino.org.uk>
* fastjar.texi: Remove @ at start of file.
2003-03-10 Mohan Embar <gnustuff@thisiscool.com>
* dostime.c: add #include <stddef.h> for definition of NULL
2003-02-04 Joseph S. Myers <jsm@polyomino.org.uk>
* fastjar.texi: Update to GFDL 1.2.
2003-01-31 Daiki Ueno <ueno@unixuser.org>
* jartool.c (extract_jar): Don't lseek to skip extra fields.
(consume): If the stream is seekable, do lseek.
2003-01-28 Ranjit Mathew <rmathew@hotmail.com>
* jargrep.c: Include xregex.h from libiberty instead of
system regex.h for better portability.
2003-01-21 Ranjit Mathew <rmathew@hotmail.com>
* jartool.c (list_jar): Terminate the 'ascii_date' buffer
with a '\0' to guard against the case where the formatted
time string is more than the size allowed by the buffer.
2003-01-14 Tom Tromey <tromey@redhat.com>
* config.h.in: Rebuilt.
2002-12-30 DJ Delorie <dj@redhat.com>
* Makefile.am (jar.1, grepjar.1): Protect against
texi2pod/pod2man failing.
* Makefile.in: Regenerated.
2002-12-23 Joseph S. Myers <jsm@polyomino.org.uk>
* fastjar.texi: Include Cover Texts in man page.
2002-12-04 Jakub Jelinek <jakub@redhat.com>
* fastjar.texi (jar @direntry, grepjar @direntry): Add (fastjar).
2002-11-23 H.J. Lu <hjl@gnu.org>
* acinclude.m4: Include ../config/accross.m4.
(gcc_AC_COMPILE_CHECK_SIZEOF): Removed.
(gcc_AC_EXAMINE_OBJECT): Removed.
(gcc_AC_C_COMPILE_ENDIAN): Removed.
* aclocal.m4; Rebuild.
* configure.in: Replace AC_C_BIGENDIAN with AC_C_BIGENDIAN_CROSS.
Replace AC_CHECK_SIZEOF with AC_COMPILE_CHECK_SIZEOF.
* configure: Likewise.
2002-11-21 Ranjit Mathew <rmathew@hotmail.com>
* jartool.c (extract_jar): Use "open" with O_BINARY instead of
"creat" to create extracted files.
2002-11-11 Tom Tromey <tromey@redhat.com>
* dostime.c (dos2unixtime): Mask for seconds is 0x1f. Correctly
compute month.
(unix2dostime): Handle years before 1980. Correctly compute month
and day of month.
2002-11-10 Jakub Jelinek <jakub@redhat.com>
* jartool.c (add_to_jar): Only compare file to jarfile if jarfile is
non-NULL.
* configure.in (AC_CHECK_HEADERS): Add limits.h.
* configure, config.h.in: Rebuilt.
2002-11-07 Tom Tromey <tromey@redhat.com>
* dostime.c: Rewrote from scratch.
* dostime.h (dostime): Removed.
2002-10-20 Tom Tromey <tromey@redhat.com>
* jartool.c: Use mode 0666 when opening new file.
2002-09-16 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
* jargrep.c (chk_wrd): Remove unused variable(s).
* jartool.c (main, create_central_header, list_jar): Likewise.
2002-10-15 Ranjit Mathew <rmathew@hotmail.com>
* configure, config.h.in: Rebuilt.
* configure.in: Call gcc_AC_FUNC_MKDIR_TAKES_ONE_ARG.
2002-09-11 Tom Tromey <tromey@redhat.com>
* Makefile.in: Rebuilt.
* Makefile.am (TEXINFO_TEX): New macro.
(info_TEXINFOS): Likewise.
(fastjar_TEXINFOS): Likewise.
(man_MANS): Likewise.
(EXTRA_DIST): Likewise.
(my_makei_flags): Likewise.
(fastjar.info): New rule.
(fastjar_TEXINFOS): Don't mention `$(srcdir)'.
(TEXINFO_TEX): Likewise.
(AUTOMAKE_OPTIONS): Added `cygnus'.
2002-09-11 Matthias Klose <doko@debian.org>
* Makefile.am: Revert the previous patch.
* Makefile.in: Regenerated.
2002-09-10 Matthias Klose <doko@debian.org>
* fastjar.texi: New.
* Makefile.am: Support building info docs and manpages.
* Makefile.in: Regenerated.
* configure.in: Set gcc_version.
* configure: Regenerated.
* jargrep.c: Update usage and help strings.
2002-09-09 Tom Tromey <tromey@redhat.com>
* jartool.c (mkdir): Define.
* config.h.in: Rebuilt.
* aclocal.m4, configure: Rebuilt.
* acinclude.m4: New file. Copied gcc_AC_COMPILE_CHECK_SIZEOF,
gcc_AC_EXAMINE_OBJECT, and fastjar_AC_COMPILE_C_BIGENDIAN from
aclocal.m4.
2002-09-04 Tom Tromey <tromey@redhat.com>
From greenrd@hotmail.com:
* jartool.c (list_jar): Correctly determine when new `filename'
buffer must be allocated. Fixes PR java/7830.
2002-06-03 Geoffrey Keating <geoffk@redhat.com>
* configure.in: Support cross-compiling.
* configure: Regenerate.
* aclocal.m4 (gcc_AC_COMPILE_CHECK_SIZEOF): New.
(gcc_AC_EXAMINE_OBJECT): New.
(fastjar_AC_COMPILE_C_BIGENDIAN): New.
2002-03-18 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
* jartool.c (expand_options): Handle tar-style argument list with a
leading "-".
2002-02-23 Anthony Green <green@redhat.com>
* jartool.c (main): Fix handling of -C.
2002-01-30 Tom Tromey <tromey@redhat.com>
* jartool.c (main): NULL-terminate new_argv. Pass 0 as argument
to init_args.
2002-01-11 Tom Tromey <tromey@redhat.com>
* Makefile.in: Rebuilt.
* Makefile.am (AUTOMAKE_OPTIONS): New macro.
2002-01-09 Tom Tromey <tromey@redhat.com>
For PR libgcj/5303:
* jargrep.h: Removed RCS keywords.
(GVERSION): Removed.
* configure, Makefile.in, config.h.in: Rebuilt.
* configure.in: Added AM_MAINTAINER_MODE.
Don't look for getopt.h. Use `fastjar' as package name.
* Makefile.am (INCLUDES): Look in ../include.
(LIBIBERTY): New macro.
(jar_LDADD): Use it.
(jar_DEPENDENCIES): Likewise.
(grepjar_LDADD): Likewise.
(grepjar_DEPENDENCIES): Likewise.
* jargrep.c: Removed RCS keywords. Always include getopt.h.
(LONG_OPT): New macro.
(OPT_HELP): Likewise.
(main): Use getopt_long. Let getopt print invalid argument
message. Handle --help. Use version().
(version): New function.
(optarg, optind): Don't declare.
(option_vec): New global.
(help): New function.
(Usage): Updated to GNU standards.
* jartool.c: Removed RCS keywords. Include getopt.h.
(LONG_OPT): New macro.
(OPT_HELP): Likewise.
(options): New global.
(help): New function.
(usage): Print a single line.
(version): New function.
(expand_options): New function.
(main): Use getopt_long and expand_options. Fail if `-u'
specified. Changed handling of -f, -m, -V options.
(OPTION_STRING): New macro.
(version_string): Removed.
2001-01-02 Craig Rodrigues <rodrigc@gcc.gnu.org>
PR bootstrap/5117
* configure.in (AC_CHECK_HEADERS): Check for stdlib.h.
* Makefile.am: Move grepjar to bin_PROGRAMS.
* config.h.in: Regenerated.
* Makefile.in: Regenerated.
* aclocal.m4: Regenerated.
* stamp-h.in: Regenerated.
* jargrep.c: Eliminate some signed/unsigned and default
uninitialized warnings. Use HAVE_STDLIB_H instead of
STDC_HEADERS macro.
* jartool.c: Likewise.
* compress.c: Likewise.
2001-09-17 Tom Tromey <tromey@redhat.com>
For PR java/4295:
* aclocal.m4, configure, Makefile.in: Rebuilt.
* configure.in: Added AC_EXEEXT.
2001-10-12 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
* jatool.c (extract_jar): Account for null termination when determining
whether to expand "filename".
2001-08-28 Alexandre Petit-Bianco <apbianco@redhat.com>
* jartool.c (add_to_jar): Return 1 if `stat' initialy failed.
Fixes PR java/3949.
2001-08-27 Tom Tromey <tromey@redhat.com>
* jartool.c (jarfile): Remove length limitation.
(main): Use jt_strdup when initializing jarfile.
2001-07-04 Tom Tromey <tromey@redhat.com>
Modified from patch by Julian Hall <jules@acris.co.uk>:
* jartool.c (errno): Conditionally declare.
(O_BINARY): Conditionally define.
(main): Use open, not creat. Use O_BINARY everywhere.
(make_manifest): Use O_BINARY.
(add_to_jar): Likewise.
2001-06-28 Tom Tromey <tromey@redhat.com>
* configure: Rebuilt.
* configure.in: Accept --with-system-zlib. Fixes PR java/3441.
2001-05-15 Per Bothner <per@bothner.com>
* Makefile.am (bin_PROGRAMS): Renamed from "fastjar" to "jar".
2001-05-03 John David Anglin <dave@hiauly1.hia.nrc.ca>
* jartool.c (jt_strdup): New function.
(get_next_arg): Use jt_strdup instead of strdup.
2001-01-21 Tom Tromey <tromey@redhat.com>
* Makefile.in: Rebuilt.
* Makefile.am (bin_PROGRAMS): Remove grepjar.
(EXTRA_PROGRAMS): New macro.
2000-12-28 Robert Lipe <robertl@sco.com>
* jartool.c (MAXPATHLEN): Provide if not defined.
2000-12-15 Tom Tromey <tromey@redhat.com>
Kelley Cook <kelleycook@home.com>
* jargrep.c: Include getopt.h if it exists.
(optind): Declare.
* configure, config.h: Rebuilt.
* configure.in: Check for getopt.h.
2000-12-14 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* configure.in (fastjar_warn_cflags): Set when using gcc.
* Makefile.am (AM_CFLAGS): Set to @fastjar_warn_cflags@.
2000-12-14 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* compress.c: Include stdlib.h and compress.h.
(rcsid): Delete.
(report_str_error): Make static.
(ez_inflate_str): Delete unused variable. Add parens in if-stmt.
(hrd_inflate_str): Likewise.
* compress.h (init_compression, end_compression, init_inflation,
end_inflation): Prototype void arguments.
* dostime.c (rcsid): Delete.
* jargrep.c: Include ctype.h, stdlib.h, zlib.h and compress.h.
Make functions static. Cast ctype function argument to `unsigned
char'. Add parens in if-stmts. Constify.
(Usage): Change into a macro.
(jargrep): Remove unused parameter.
* jartool.c: Constify. Add parens in if-stmts. Align
signed/unsigned char pointers in functions calls using casts.
(rcsid): Delete.
(list_jar): Fix printf format specifier.
(usage): Chop long string into bits. Reformat.
* pushback.c (rcsid): Delete.
2000-12-13 Tom Tromey <tromey@redhat.com>
* jartool.c (extract_jar): Use strchr, not index.
2000-12-11 Alexandre Petit-Bianco <apbianco@cygnus.com>
* install-defs.sh: Removed.
2000-12-10 Robert Lipe <robertlipe@usa.net>
* jargrep.c (jargrep): Added null statement after case.
2000-12-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
* Makefile: Removed.
* Makefile.in: Rebuilt with `-i' and `--enable-foreign'.
Tue Nov 16 15:11:36 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
* Makefile.am: New file.
* Makefile.in: Rebuilt.
* aclocal.m4: Likewise.
* stamp-h.in: Likewise.
* config.h.in: Likewise.
* configure.in (AM_INIT_AUTOMAKE): Added.
(AM_CONFIG_HEADER): Likewise.
(AC_CHECK_HEADERS): Check for sys/param.h
(AC_CHECK_LIB): Don't check for system's zlib.
(AC_CHECK_FUNC): Removed system's zlib function checks.
(ZDEPS. ZLIBS, ZINCS): Added.
* configure: Rebuilt.
* jartool.c (sys/param.h): Conditionally included or define MAXPATHLEN.
(init_args, get_next_arg): New function.
(use_explicit_list_only, read_names_from_stdin): New global
(main): Parse new non standard options 'E' and '@', check and
report their usage if necessary. Use init_args and get_next_arg.
Fixed indentation.
(add_to_jar): Don't read directory content if `use_explicit_list_only'.
(usage): Added `-E' and `-@'.
* jartool.h (VERSION): Macro removed.
Tue Nov 14 15:10:44 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
* fastjar imported from sourceforge.net/projects/fastjar with
Bryan Burns' permission. Check `CHANGES' for post import changes.
* ChangeLog: Created.
* NEWS: Likewise.
* mkinstalldirs: Likewise.
* COPYING: Likewise.
* AUTHORS: Likewise.
----------------------
How to install fastjar
----------------------
1. Run the 'configure' script to generate config.h and Makefile. You can
use 'configure --help' to get a list of command-line options.
2. If you're feeling experimental, you can change some settings in jartool.h
to optimize fastjar for your particular system.
3. Type 'make' to create the fastjar binary.
4. Type 'make install' to install fastjar in whichever directory you supplied
to configure (or the default directory if you didn't specify one.)
# Process this with automake to create Makefile.in
# Work around what appears to be a GNU make bug handling MAKEFLAGS
# values defined in terms of make variables, as is the case for CC and
# friends when we are called from the top level Makefile.
AM_MAKEFLAGS = \
"AR_FLAGS=$(AR_FLAGS)" \
"CC_FOR_BUILD=$(CC_FOR_BUILD)" \
"CFLAGS=$(CFLAGS)" \
"CXXFLAGS=$(CXXFLAGS)" \
"CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
"CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
"INSTALL=$(INSTALL)" \
"INSTALL_DATA=$(INSTALL_DATA)" \
"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
"INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
"JC1FLAGS=$(JC1FLAGS)" \
"LDFLAGS=$(LDFLAGS)" \
"LIBCFLAGS=$(LIBCFLAGS)" \
"LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
"MAKE=$(MAKE)" \
"MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
"PICFLAG=$(PICFLAG)" \
"PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
"SHELL=$(SHELL)" \
"exec_prefix=$(exec_prefix)" \
"infodir=$(infodir)" \
"libdir=$(libdir)" \
"prefix=$(prefix)" \
"AR=$(AR)" \
"AS=$(AS)" \
"CC=$(CC)" \
"CXX=$(CXX)" \
"LD=$(LD)" \
"LIBCFLAGS=$(LIBCFLAGS)" \
"NM=$(NM)" \
"PICFLAG=$(PICFLAG)" \
"RANLIB=$(RANLIB)" \
"DESTDIR=$(DESTDIR)"
AM_CPPFLAGS = -I. -I$(top_srcdir) $(ZINCS) -I$(top_srcdir)/../include
LIBIBERTY = ../libiberty/libiberty.a
bin_PROGRAMS = fastjar grepjar
fastjar_SOURCES = jartool.c dostime.c compress.c pushback.c shift.c jartool.h \
zipfile.h dostime.h compress.h pushback.h shift.h
fastjar_LDADD = $(ZLIBS) $(LIBIBERTY)
fastjar_DEPENDENCIES = $(ZDEPS) $(LIBIBERTY)
fastjar_CPPFLAGS = $(AM_CPPFLAGS) -DWITH_SHIFT_DOWN
grepjar_SOURCES = jargrep.c dostime.c compress.c pushback.c jartool.h \
zipfile.h dostime.h compress.h pushback.h
grepjar_LDADD = $(ZLIBS) $(LIBIBERTY)
grepjar_DEPENDENCIES = $(ZDEPS) $(LIBIBERTY)
AM_CFLAGS = @fastjar_warn_cflags@
AM_MAKEINFOFLAGS = -I $(srcdir)/../gcc/doc/include
TEXINFO_TEX = ../gcc/doc/include/texinfo.tex
info_TEXINFOS = fastjar.texi
fastjar_TEXINFOS = \
../gcc/doc/include/gcc-common.texi \
../gcc/doc/include/gpl.texi \
gcc-vers.texi
man_MANS = fastjar.1 grepjar.1
EXTRA_DIST = $(man_MANS)
BASEVER = $(srcdir)/../gcc/BASE-VER
DEVPHASE = $(srcdir)/../gcc/DEV-PHASE
TEXI2POD = perl $(srcdir)/../contrib/texi2pod.pl
POD2MAN = pod2man --center="GNU" --release="gcc-$(shell cat $(BASEVER))"
.pod.1:
-($(POD2MAN) --section=1 $< > $(@).T$$$$ && \
mv -f $(@).T$$$$ $@) || \
(rm -f $(@).T$$$$ && exit 1)
.INTERMEDIATE: fastjar.pod grepjar.pod
fastjar.pod: $(srcdir)/fastjar.texi
-$(TEXI2POD) -D fastjar $< > $@
grepjar.pod: $(srcdir)/fastjar.texi
-$(TEXI2POD) -D grepjar $< > $@
fastjar.1 grepjar.1: $(BASEVER)
# gcc-vers.texi is generated from the version files.
gcc-vers.texi: $(BASEVER) $(DEVPHASE)
(echo "@set version-GCC $(shell cat $(BASEVER))"; \
if [ "$(shell cat $(DEVPHASE))" = "experimental" ]; \
then echo "@set DEVELOPMENT"; \
else echo "@clear DEVELOPMENT"; \
fi) > $@T
mv -f $@T $@
# GCC LOCAL CHANGE
# The following commands allow us to release tarballs with the man pages
# and info documentation prebuilt. This feature is enabled via
# --enable-generated-files-in-srcdir in the configure script.
if GENINSRC
STAMP_GENINSRC = stamp-geninsrc
else
STAMP_GENINSRC =
endif
all-local: $(STAMP_GENINSRC)
stamp-geninsrc: fastjar.1 grepjar.1 fastjar.info
-cp -p $(top_builddir)/fastjar.1 $(srcdir)/fastjar.1
-cp -p $(top_builddir)/grepjar.1 $(srcdir)/grepjar.1
-cp -p $(top_builddir)/fastjar.info $(srcdir)/fastjar.info
touch $@
CLEANFILES = stamp-geninsrc fastjar.info
MAINTAINERCLEANFILES = $(srcdir)/fastjar.1 \
$(srcdir)/grepjar.1 \
$(srcdir)/fastjar.info
# Makefile.in generated by automake 1.9.3 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
# Process this with automake to create Makefile.in
SOURCES = $(fastjar_SOURCES) $(grepjar_SOURCES)
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = .
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
bin_PROGRAMS = fastjar$(EXEEXT) grepjar$(EXEEXT)
subdir = .
DIST_COMMON = README $(am__configure_deps) $(fastjar_TEXINFOS) \
$(srcdir)/../compile $(srcdir)/../depcomp \
$(srcdir)/../install-sh $(srcdir)/../missing \
$(srcdir)/../mkinstalldirs $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
$(srcdir)/install-defs.sh.in $(top_srcdir)/configure AUTHORS \
COPYING ChangeLog INSTALL NEWS
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno configure.status.lineno
mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES = install-defs.sh
am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(infodir)" \
"$(DESTDIR)$(man1dir)"
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
PROGRAMS = $(bin_PROGRAMS)
am_fastjar_OBJECTS = fastjar-jartool.$(OBJEXT) \
fastjar-dostime.$(OBJEXT) fastjar-compress.$(OBJEXT) \
fastjar-pushback.$(OBJEXT) fastjar-shift.$(OBJEXT)
fastjar_OBJECTS = $(am_fastjar_OBJECTS)
am__DEPENDENCIES_1 =
am__DEPENDENCIES_2 = ../libiberty/libiberty.a
am_grepjar_OBJECTS = jargrep.$(OBJEXT) dostime.$(OBJEXT) \
compress.$(OBJEXT) pushback.$(OBJEXT)
grepjar_OBJECTS = $(am_grepjar_OBJECTS)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I.
depcomp = $(SHELL) $(top_srcdir)/../depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(fastjar_SOURCES) $(grepjar_SOURCES)
DIST_SOURCES = $(fastjar_SOURCES) $(grepjar_SOURCES)
INFO_DEPS = fastjar.info
am__TEXINFO_TEX_DIR = $(srcdir)/../gcc/doc/include
DVIS = fastjar.dvi
PDFS = fastjar.pdf
PSS = fastjar.ps
HTMLS = fastjar.html
TEXINFOS = fastjar.texi
TEXI2DVI = texi2dvi
TEXI2PDF = $(TEXI2DVI) --pdf --batch
MAKEINFOHTML = $(MAKEINFO) --html
AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS)
DVIPS = dvips
man1dir = $(mandir)/man1
NROFF = nroff
MANS = $(man_MANS)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
{ test ! -d $(distdir) \
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -fr $(distdir); }; }
DIST_ARCHIVES = $(distdir).tar.gz
GZIP_ENV = --best
distuninstallcheck_listfiles = find . -type f -print
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CHMOD = @CHMOD@
CP = @CP@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GENINSRC_FALSE = @GENINSRC_FALSE@
GENINSRC_TRUE = @GENINSRC_TRUE@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RM = @RM@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
ZDEPS = @ZDEPS@
ZINCS = @ZINCS@
ZLIBS = @ZLIBS@
ac_ct_CC = @ac_ct_CC@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build_alias = @build_alias@
datadir = @datadir@
exec_prefix = @exec_prefix@
fastjar_warn_cflags = @fastjar_warn_cflags@
host_alias = @host_alias@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
# Work around what appears to be a GNU make bug handling MAKEFLAGS
# values defined in terms of make variables, as is the case for CC and
# friends when we are called from the top level Makefile.
AM_MAKEFLAGS = \
"AR_FLAGS=$(AR_FLAGS)" \
"CC_FOR_BUILD=$(CC_FOR_BUILD)" \
"CFLAGS=$(CFLAGS)" \
"CXXFLAGS=$(CXXFLAGS)" \
"CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
"CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
"INSTALL=$(INSTALL)" \
"INSTALL_DATA=$(INSTALL_DATA)" \
"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
"INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
"JC1FLAGS=$(JC1FLAGS)" \
"LDFLAGS=$(LDFLAGS)" \
"LIBCFLAGS=$(LIBCFLAGS)" \
"LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
"MAKE=$(MAKE)" \
"MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
"PICFLAG=$(PICFLAG)" \
"PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
"SHELL=$(SHELL)" \
"exec_prefix=$(exec_prefix)" \
"infodir=$(infodir)" \
"libdir=$(libdir)" \
"prefix=$(prefix)" \
"AR=$(AR)" \
"AS=$(AS)" \
"CC=$(CC)" \
"CXX=$(CXX)" \
"LD=$(LD)" \
"LIBCFLAGS=$(LIBCFLAGS)" \
"NM=$(NM)" \
"PICFLAG=$(PICFLAG)" \
"RANLIB=$(RANLIB)" \
"DESTDIR=$(DESTDIR)"
AM_CPPFLAGS = -I. -I$(top_srcdir) $(ZINCS) -I$(top_srcdir)/../include
LIBIBERTY = ../libiberty/libiberty.a
fastjar_SOURCES = jartool.c dostime.c compress.c pushback.c shift.c jartool.h \
zipfile.h dostime.h compress.h pushback.h shift.h
fastjar_LDADD = $(ZLIBS) $(LIBIBERTY)
fastjar_DEPENDENCIES = $(ZDEPS) $(LIBIBERTY)
fastjar_CPPFLAGS = $(AM_CPPFLAGS) -DWITH_SHIFT_DOWN
grepjar_SOURCES = jargrep.c dostime.c compress.c pushback.c jartool.h \
zipfile.h dostime.h compress.h pushback.h
grepjar_LDADD = $(ZLIBS) $(LIBIBERTY)
grepjar_DEPENDENCIES = $(ZDEPS) $(LIBIBERTY)
AM_CFLAGS = @fastjar_warn_cflags@
AM_MAKEINFOFLAGS = -I $(srcdir)/../gcc/doc/include
TEXINFO_TEX = ../gcc/doc/include/texinfo.tex
info_TEXINFOS = fastjar.texi
fastjar_TEXINFOS = \
../gcc/doc/include/gcc-common.texi \
../gcc/doc/include/gpl.texi \
gcc-vers.texi
man_MANS = fastjar.1 grepjar.1
EXTRA_DIST = $(man_MANS)
BASEVER = $(srcdir)/../gcc/BASE-VER
DEVPHASE = $(srcdir)/../gcc/DEV-PHASE
TEXI2POD = perl $(srcdir)/../contrib/texi2pod.pl
POD2MAN = pod2man --center="GNU" --release="gcc-$(shell cat $(BASEVER))"
@GENINSRC_FALSE@STAMP_GENINSRC =
# GCC LOCAL CHANGE
# The following commands allow us to release tarballs with the man pages
# and info documentation prebuilt. This feature is enabled via
# --enable-generated-files-in-srcdir in the configure script.
@GENINSRC_TRUE@STAMP_GENINSRC = stamp-geninsrc
CLEANFILES = stamp-geninsrc fastjar.info
MAINTAINERCLEANFILES = $(srcdir)/fastjar.1 \
$(srcdir)/grepjar.1 \
$(srcdir)/fastjar.info
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES:
.SUFFIXES: .1 .c .dvi .o .obj .pod .ps
am--refresh:
@:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \
cd $(srcdir) && $(AUTOMAKE) --gnu \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
config.h: stamp-h1
@if test ! -f $@; then \
rm -f stamp-h1; \
$(MAKE) stamp-h1; \
else :; fi
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status config.h
$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_srcdir) && $(AUTOHEADER)
rm -f stamp-h1
touch $@
distclean-hdr:
-rm -f config.h stamp-h1
install-defs.sh: $(top_builddir)/config.status $(srcdir)/install-defs.sh.in
cd $(top_builddir) && $(SHELL) ./config.status $@
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
@list='$(bin_PROGRAMS)'; for p in $$list; do \
p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
if test -f $$p \
; then \
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
$(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
else :; fi; \
done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(bin_PROGRAMS)'; for p in $$list; do \
f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
rm -f "$(DESTDIR)$(bindir)/$$f"; \
done
clean-binPROGRAMS:
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
fastjar$(EXEEXT): $(fastjar_OBJECTS) $(fastjar_DEPENDENCIES)
@rm -f fastjar$(EXEEXT)
$(LINK) $(fastjar_LDFLAGS) $(fastjar_OBJECTS) $(fastjar_LDADD) $(LIBS)
grepjar$(EXEEXT): $(grepjar_OBJECTS) $(grepjar_DEPENDENCIES)
@rm -f grepjar$(EXEEXT)
$(LINK) $(grepjar_LDFLAGS) $(grepjar_OBJECTS) $(grepjar_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compress.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dostime.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fastjar-compress.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fastjar-dostime.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fastjar-jartool.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fastjar-pushback.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fastjar-shift.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jargrep.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pushback.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
fastjar-jartool.o: jartool.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fastjar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fastjar-jartool.o -MD -MP -MF "$(DEPDIR)/fastjar-jartool.Tpo" -c -o fastjar-jartool.o `test -f 'jartool.c' || echo '$(srcdir)/'`jartool.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/fastjar-jartool.Tpo" "$(DEPDIR)/fastjar-jartool.Po"; else rm -f "$(DEPDIR)/fastjar-jartool.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jartool.c' object='fastjar-jartool.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fastjar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fastjar-jartool.o `test -f 'jartool.c' || echo '$(srcdir)/'`jartool.c
fastjar-jartool.obj: jartool.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fastjar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fastjar-jartool.obj -MD -MP -MF "$(DEPDIR)/fastjar-jartool.Tpo" -c -o fastjar-jartool.obj `if test -f 'jartool.c'; then $(CYGPATH_W) 'jartool.c'; else $(CYGPATH_W) '$(srcdir)/jartool.c'; fi`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/fastjar-jartool.Tpo" "$(DEPDIR)/fastjar-jartool.Po"; else rm -f "$(DEPDIR)/fastjar-jartool.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jartool.c' object='fastjar-jartool.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fastjar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fastjar-jartool.obj `if test -f 'jartool.c'; then $(CYGPATH_W) 'jartool.c'; else $(CYGPATH_W) '$(srcdir)/jartool.c'; fi`
fastjar-dostime.o: dostime.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fastjar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fastjar-dostime.o -MD -MP -MF "$(DEPDIR)/fastjar-dostime.Tpo" -c -o fastjar-dostime.o `test -f 'dostime.c' || echo '$(srcdir)/'`dostime.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/fastjar-dostime.Tpo" "$(DEPDIR)/fastjar-dostime.Po"; else rm -f "$(DEPDIR)/fastjar-dostime.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dostime.c' object='fastjar-dostime.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fastjar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fastjar-dostime.o `test -f 'dostime.c' || echo '$(srcdir)/'`dostime.c
fastjar-dostime.obj: dostime.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fastjar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fastjar-dostime.obj -MD -MP -MF "$(DEPDIR)/fastjar-dostime.Tpo" -c -o fastjar-dostime.obj `if test -f 'dostime.c'; then $(CYGPATH_W) 'dostime.c'; else $(CYGPATH_W) '$(srcdir)/dostime.c'; fi`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/fastjar-dostime.Tpo" "$(DEPDIR)/fastjar-dostime.Po"; else rm -f "$(DEPDIR)/fastjar-dostime.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dostime.c' object='fastjar-dostime.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fastjar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fastjar-dostime.obj `if test -f 'dostime.c'; then $(CYGPATH_W) 'dostime.c'; else $(CYGPATH_W) '$(srcdir)/dostime.c'; fi`
fastjar-compress.o: compress.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fastjar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fastjar-compress.o -MD -MP -MF "$(DEPDIR)/fastjar-compress.Tpo" -c -o fastjar-compress.o `test -f 'compress.c' || echo '$(srcdir)/'`compress.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/fastjar-compress.Tpo" "$(DEPDIR)/fastjar-compress.Po"; else rm -f "$(DEPDIR)/fastjar-compress.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='compress.c' object='fastjar-compress.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fastjar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fastjar-compress.o `test -f 'compress.c' || echo '$(srcdir)/'`compress.c
fastjar-compress.obj: compress.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fastjar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fastjar-compress.obj -MD -MP -MF "$(DEPDIR)/fastjar-compress.Tpo" -c -o fastjar-compress.obj `if test -f 'compress.c'; then $(CYGPATH_W) 'compress.c'; else $(CYGPATH_W) '$(srcdir)/compress.c'; fi`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/fastjar-compress.Tpo" "$(DEPDIR)/fastjar-compress.Po"; else rm -f "$(DEPDIR)/fastjar-compress.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='compress.c' object='fastjar-compress.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fastjar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fastjar-compress.obj `if test -f 'compress.c'; then $(CYGPATH_W) 'compress.c'; else $(CYGPATH_W) '$(srcdir)/compress.c'; fi`
fastjar-pushback.o: pushback.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fastjar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fastjar-pushback.o -MD -MP -MF "$(DEPDIR)/fastjar-pushback.Tpo" -c -o fastjar-pushback.o `test -f 'pushback.c' || echo '$(srcdir)/'`pushback.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/fastjar-pushback.Tpo" "$(DEPDIR)/fastjar-pushback.Po"; else rm -f "$(DEPDIR)/fastjar-pushback.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pushback.c' object='fastjar-pushback.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fastjar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fastjar-pushback.o `test -f 'pushback.c' || echo '$(srcdir)/'`pushback.c
fastjar-pushback.obj: pushback.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fastjar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fastjar-pushback.obj -MD -MP -MF "$(DEPDIR)/fastjar-pushback.Tpo" -c -o fastjar-pushback.obj `if test -f 'pushback.c'; then $(CYGPATH_W) 'pushback.c'; else $(CYGPATH_W) '$(srcdir)/pushback.c'; fi`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/fastjar-pushback.Tpo" "$(DEPDIR)/fastjar-pushback.Po"; else rm -f "$(DEPDIR)/fastjar-pushback.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pushback.c' object='fastjar-pushback.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fastjar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fastjar-pushback.obj `if test -f 'pushback.c'; then $(CYGPATH_W) 'pushback.c'; else $(CYGPATH_W) '$(srcdir)/pushback.c'; fi`
fastjar-shift.o: shift.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fastjar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fastjar-shift.o -MD -MP -MF "$(DEPDIR)/fastjar-shift.Tpo" -c -o fastjar-shift.o `test -f 'shift.c' || echo '$(srcdir)/'`shift.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/fastjar-shift.Tpo" "$(DEPDIR)/fastjar-shift.Po"; else rm -f "$(DEPDIR)/fastjar-shift.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='shift.c' object='fastjar-shift.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fastjar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fastjar-shift.o `test -f 'shift.c' || echo '$(srcdir)/'`shift.c
fastjar-shift.obj: shift.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fastjar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fastjar-shift.obj -MD -MP -MF "$(DEPDIR)/fastjar-shift.Tpo" -c -o fastjar-shift.obj `if test -f 'shift.c'; then $(CYGPATH_W) 'shift.c'; else $(CYGPATH_W) '$(srcdir)/shift.c'; fi`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/fastjar-shift.Tpo" "$(DEPDIR)/fastjar-shift.Po"; else rm -f "$(DEPDIR)/fastjar-shift.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='shift.c' object='fastjar-shift.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fastjar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fastjar-shift.obj `if test -f 'shift.c'; then $(CYGPATH_W) 'shift.c'; else $(CYGPATH_W) '$(srcdir)/shift.c'; fi`
fastjar.info: fastjar.texi $(fastjar_TEXINFOS)
restore=: && backupdir="$(am__leading_dot)am$$$$" && \
rm -rf $$backupdir && mkdir $$backupdir && \
for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \
if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \
done; \
if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
-o $@ `test -f 'fastjar.texi' || echo '$(srcdir)/'`fastjar.texi; \
then \
rc=0; \
else \
rc=$$?; \
$$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \
fi; \
rm -rf $$backupdir; exit $$rc
fastjar.dvi: fastjar.texi $(fastjar_TEXINFOS)
TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
$(TEXI2DVI) -o $@ `test -f 'fastjar.texi' || echo '$(srcdir)/'`fastjar.texi
fastjar.pdf: fastjar.texi $(fastjar_TEXINFOS)
TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
$(TEXI2PDF) -o $@ `test -f 'fastjar.texi' || echo '$(srcdir)/'`fastjar.texi
fastjar.html: fastjar.texi $(fastjar_TEXINFOS)
rm -rf $(@:.html=.htp)
if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
-o $(@:.html=.htp) `test -f 'fastjar.texi' || echo '$(srcdir)/'`fastjar.texi; \
then \
rm -rf $@; \
if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \
mv $(@:.html=) $@; else mv $(@:.html=.htp) $@; fi; \
else \
if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \
rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \
exit 1; \
fi
.dvi.ps:
$(DVIPS) -o $@ $<
uninstall-info-am:
$(PRE_UNINSTALL)
@if (install-info --version && \
install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
list='$(INFO_DEPS)'; \
for file in $$list; do \
relfile=`echo "$$file" | sed 's|^.*/||'`; \
echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \
install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \
done; \
else :; fi
@$(NORMAL_UNINSTALL)
@list='$(INFO_DEPS)'; \
for file in $$list; do \
relfile=`echo "$$file" | sed 's|^.*/||'`; \
relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \
(if cd "$(DESTDIR)$(infodir)"; then \
echo " rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9])"; \
rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \
else :; fi); \
done
dist-info: $(INFO_DEPS)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
list='$(INFO_DEPS)'; \
for base in $$list; do \
case $$base in \
$(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \
esac; \
if test -f $$base; then d=.; else d=$(srcdir); fi; \
for file in $$d/$$base*; do \
relfile=`expr "$$file" : "$$d/\(.*\)"`; \
test -f $(distdir)/$$relfile || \
cp -p $$file $(distdir)/$$relfile; \
done; \
done
mostlyclean-aminfo:
-rm -rf fastjar.aux fastjar.cp fastjar.cps fastjar.fn fastjar.fns fastjar.ky \
fastjar.kys fastjar.log fastjar.pg fastjar.pgs fastjar.tmp \
fastjar.toc fastjar.tp fastjar.tps fastjar.vr fastjar.vrs \
fastjar.dvi fastjar.pdf fastjar.ps fastjar.html
maintainer-clean-aminfo:
@list='$(INFO_DEPS)'; for i in $$list; do \
i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \
echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \
rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \
done
install-man1: $(man1_MANS) $(man_MANS)
@$(NORMAL_INSTALL)
test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)"
@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
for i in $$l2; do \
case "$$i" in \
*.1*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
else file=$$i; fi; \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
case "$$ext" in \
1*) ;; \
*) ext='1' ;; \
esac; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \
done
uninstall-man1:
@$(NORMAL_UNINSTALL)
@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
for i in $$l2; do \
case "$$i" in \
*.1*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
case "$$ext" in \
1*) ;; \
*) ext='1' ;; \
esac; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \
rm -f "$(DESTDIR)$(man1dir)/$$inst"; \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
$(am__remove_distdir)
mkdir $(distdir)
$(mkdir_p) $(distdir)/. $(distdir)/.. $(distdir)/../gcc/doc/include
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$(top_distdir)" distdir="$(distdir)" \
dist-info
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r $(distdir)
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
$(am__remove_distdir)
dist-tarZ: distdir
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__remove_distdir)
dist-shar: distdir
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__remove_distdir)
dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
$(am__remove_distdir)
dist dist-all: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
chmod -R a-w $(distdir); chmod a+w $(distdir)
mkdir $(distdir)/_build
mkdir $(distdir)/_inst
chmod a-w $(distdir)
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& cd $(distdir)/_build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
$(DISTCHECK_CONFIGURE_FLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
distuninstallcheck \
&& chmod -R a-w "$$dc_install_base" \
&& ({ \
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
} || { rm -rf "$$dc_destdir"; exit 1; }) \
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist \
&& rm -rf $(DIST_ARCHIVES) \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck
$(am__remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
distuninstallcheck:
@cd $(distuninstallcheck_dir) \
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
fi ; \
$(distuninstallcheck_listfiles) ; \
exit 1; } >&2
distcleancheck: distclean
@if test '$(srcdir)' = . ; then \
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
exit 1 ; \
fi
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left in build directory after distclean:" ; \
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
check: check-am
all-am: Makefile $(INFO_DEPS) $(PROGRAMS) $(MANS) config.h all-local
installdirs:
for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(infodir)" "$(DESTDIR)$(man1dir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
clean: clean-am
clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
distclean: distclean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-hdr distclean-tags
dvi: dvi-am
dvi-am: $(DVIS)
html: html-am
html-am: $(HTMLS)
info: info-am
info-am: $(INFO_DEPS)
install-data-am: install-info-am install-man
install-exec-am: install-binPROGRAMS
install-info: install-info-am
install-info-am: $(INFO_DEPS)
@$(NORMAL_INSTALL)
test -z "$(infodir)" || $(mkdir_p) "$(DESTDIR)$(infodir)"
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
list='$(INFO_DEPS)'; \
for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
esac; \
if test -f $$file; then d=.; else d=$(srcdir); fi; \
file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \
for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \
$$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \
if test -f $$ifile; then \
relfile=`echo "$$ifile" | sed 's|^.*/||'`; \
echo " $(INSTALL_DATA) '$$ifile' '$(DESTDIR)$(infodir)/$$relfile'"; \
$(INSTALL_DATA) "$$ifile" "$(DESTDIR)$(infodir)/$$relfile"; \
else : ; fi; \
done; \
done
@$(POST_INSTALL)
@if (install-info --version && \
install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
list='$(INFO_DEPS)'; \
for file in $$list; do \
relfile=`echo "$$file" | sed 's|^.*/||'`; \
echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\
install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\
done; \
else : ; fi
install-man: install-man1
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-aminfo \
maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-aminfo mostlyclean-compile \
mostlyclean-generic
pdf: pdf-am
pdf-am: $(PDFS)
ps: ps-am
ps-am: $(PSS)
uninstall-am: uninstall-binPROGRAMS uninstall-info-am uninstall-man
uninstall-man: uninstall-man1
.PHONY: CTAGS GTAGS all all-am all-local am--refresh check check-am \
clean clean-binPROGRAMS clean-generic ctags dist dist-all \
dist-bzip2 dist-gzip dist-info dist-shar dist-tarZ dist-zip \
distcheck distclean distclean-compile distclean-generic \
distclean-hdr distclean-tags distcleancheck distdir \
distuninstallcheck dvi dvi-am html html-am info info-am \
install install-am install-binPROGRAMS install-data \
install-data-am install-exec install-exec-am install-info \
install-info-am install-man install-man1 install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-aminfo maintainer-clean-generic mostlyclean \
mostlyclean-aminfo mostlyclean-compile mostlyclean-generic pdf \
pdf-am ps ps-am tags uninstall uninstall-am \
uninstall-binPROGRAMS uninstall-info-am uninstall-man \
uninstall-man1
.pod.1:
-($(POD2MAN) --section=1 $< > $(@).T$$$$ && \
mv -f $(@).T$$$$ $@) || \
(rm -f $(@).T$$$$ && exit 1)
.INTERMEDIATE: fastjar.pod grepjar.pod
fastjar.pod: $(srcdir)/fastjar.texi
-$(TEXI2POD) -D fastjar $< > $@
grepjar.pod: $(srcdir)/fastjar.texi
-$(TEXI2POD) -D grepjar $< > $@
fastjar.1 grepjar.1: $(BASEVER)
# gcc-vers.texi is generated from the version files.
gcc-vers.texi: $(BASEVER) $(DEVPHASE)
(echo "@set version-GCC $(shell cat $(BASEVER))"; \
if [ "$(shell cat $(DEVPHASE))" = "experimental" ]; \
then echo "@set DEVELOPMENT"; \
else echo "@clear DEVELOPMENT"; \
fi) > $@T
mv -f $@T $@
all-local: $(STAMP_GENINSRC)
stamp-geninsrc: fastjar.1 grepjar.1 fastjar.info
-cp -p $(top_builddir)/fastjar.1 $(srcdir)/fastjar.1
-cp -p $(top_builddir)/grepjar.1 $(srcdir)/grepjar.1
-cp -p $(top_builddir)/fastjar.info $(srcdir)/fastjar.info
touch $@
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
Noteworthy changes in fastjar, 11/2000
--------------------------------------
Fastjar as been imported from sourceforge.net/projects/fastjar with
Brian Burns' permission so that it can be used as a replacement to the
zip utility in order to create the libgcj.zip archive. Several missing
distribution files were created, most notably Makefile.am.
Two new options were added: `-E' to prevent fastjar from reading the
content of a directory when specifying one (and instead relying on the
provided list of files to populate the archive with regard to the
directory entry) and `-@' to let fastjar read the name of the files to
add to the archive from the standard input. This last option is
supported only when creating or augmenting an archive.
This directory contains the FastJar package, which is not part of GCC but
shipped with GCC as convenience.
=======
FastJar 0.90
12/6/1999
=======
FastJar is an attempt at creating a feature-for-feature copy of Sun's JDK's
'jar' command. Sun's jar (or Blackdown's for that matter) is written entirely
in Java which makes it dog slow. Since FastJar is written in C, it can create
the same .jar file as Sun's tool in a fraction of the time. On my system,
Sun's jar takes 50 seconds to create a 10MB jar file, while FastJar only takes
a little over a second.
The reason I wrote fastjar is that building .jar files is a regular process
of the build where I work. The way we have it setup, you have to re-create
the .jar file everytime you want to test it out, which is about every 5 minutes
when I'm busy coding. The .jar file wasn't -that- big, but it did take about
30 seconds to be made, and watching all the garbage collection messages was
pretty irritating as well. I probably wasted a half-hour a day watching
Sun's jar tool chug along. By writing the program in C, I spend much less time
banging my head against the monitor waiting for the build to finish. Yay!
FastJar has been tested on Solaris and Linux 2.2.x systems and nothing else.
It should compile/run without any problems on either system, provided you have
zlib installed.
Please mail any bug reports to burnsbr@ucs.orst.edu.
If you use FastJar and want me to add the rest of the features, send me mail
(toast@users.sourceforge.net). I'll be much more likely to put more work into this
if I know other people find it useful other than me.
As always, this not being a final release, bugs may exist. I test each
release pretty well, but I can always miss things...
Compression will slow things down quite a bit. A 10MB jar file takes about
1 second on my machine without compression, and 9 seconds with it. If you
want fastjar to be fast, use the -0 (zero, not O) flag to turn off compression.
Supported flags:
--------------------------
-c | create a new archive
-v | verbose output
-f | specify archive file name
-m | specify existing manifest file
-M | don't create manifest
-0 | store only
-C | change to dir
-t | list contents
-x | extract contents
Unsupported flags:
----------------------------
-u | update exisiting archive
If you use the "unsupported" flags, nothing bad will happen, but then again
nothing will happen at all.
Unsupported features (in this release):
---------------------------------------------
* updating
* full manifest support (?)
Order or features for the future:
--------------------------------------------
* archive updating
* full manifest support
* filtering
* dependency checking
===========================================================================
http://fastjar.sourceforge.net
toast@users.sourceforge.net
dnl Define MKDIR_TAKES_ONE_ARG if mkdir accepts only one argument instead
dnl of the usual 2.
AC_DEFUN([gcc_AC_FUNC_MKDIR_TAKES_ONE_ARG],
[AC_CACHE_CHECK([if mkdir takes one argument], gcc_cv_mkdir_takes_one_arg,
[AC_TRY_COMPILE([
#include <sys/types.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#ifdef HAVE_DIRECT_H
# include <direct.h>
#endif], [mkdir ("foo", 0);],
gcc_cv_mkdir_takes_one_arg=no, gcc_cv_mkdir_takes_one_arg=yes)])
if test $gcc_cv_mkdir_takes_one_arg = yes ; then
AC_DEFINE(MKDIR_TAKES_ONE_ARG, 1, [Define if host mkdir takes a
single argument.])
fi
])
# generated automatically by aclocal 1.9.3 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
# Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
# -*- Autoconf -*-
# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
# Generated from amversion.in; do not edit by hand.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# AM_AUTOMAKE_VERSION(VERSION)
# ----------------------------
# Automake X.Y traces this macro to ensure aclocal.m4 has been
# generated from the m4 files accompanying Automake X.Y.
AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
# AM_SET_CURRENT_AUTOMAKE_VERSION
# -------------------------------
# Call AM_AUTOMAKE_VERSION so it can be traced.
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.9.3])])
# AM_AUX_DIR_EXPAND
# Copyright (C) 2001, 2003 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
#
# Of course, Automake must honor this variable whenever it calls a
# tool from the auxiliary directory. The problem is that $srcdir (and
# therefore $ac_aux_dir as well) can be either absolute or relative,
# depending on how configure is run. This is pretty annoying, since
# it makes $ac_aux_dir quite unusable in subdirectories: in the top
# source directory, any form will work fine, but in subdirectories a
# relative path needs to be adjusted first.
#
# $ac_aux_dir/missing
# fails when called from a subdirectory if $ac_aux_dir is relative
# $top_srcdir/$ac_aux_dir/missing
# fails if $ac_aux_dir is absolute,
# fails when called from a subdirectory in a VPATH build with
# a relative $ac_aux_dir
#
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
# are both prefixed by $srcdir. In an in-source build this is usually
# harmless because $srcdir is `.', but things will broke when you
# start a VPATH build or use an absolute $srcdir.
#
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
# and then we would define $MISSING as
# MISSING="\${SHELL} $am_aux_dir/missing"
# This will work as long as MISSING is not called from configure, because
# unfortunately $(top_srcdir) has no meaning in configure.
# However there are other variables, like CC, which are often used in
# configure, and could therefore not use this "fixed" $ac_aux_dir.
#
# Another solution, used here, is to always expand $ac_aux_dir to an
# absolute PATH. The drawback is that using absolute paths prevent a
# configured tree to be moved without reconfiguration.
AC_DEFUN([AM_AUX_DIR_EXPAND],
[dnl Rely on autoconf to set up CDPATH properly.
AC_PREREQ([2.50])dnl
# expand $ac_aux_dir to an absolute path
am_aux_dir=`cd $ac_aux_dir && pwd`
])
# AM_CONDITIONAL -*- Autoconf -*-
# Copyright (C) 1997, 2000, 2001, 2003, 2004 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# serial 6
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
# -------------------------------------
# Define a conditional.
AC_DEFUN([AM_CONDITIONAL],
[AC_PREREQ(2.52)dnl
ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
AC_SUBST([$1_TRUE])
AC_SUBST([$1_FALSE])
if $2; then
$1_TRUE=
$1_FALSE='#'
else
$1_TRUE='#'
$1_FALSE=
fi
AC_CONFIG_COMMANDS_PRE(
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
AC_MSG_ERROR([[conditional "$1" was never defined.
Usually this means the macro was only invoked conditionally.]])
fi])])
# serial 7 -*- Autoconf -*-
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
# written in clear, in which case automake, when reading aclocal.m4,
# will think it sees a *use*, and therefore will trigger all it's
# C support machinery. Also note that it means that autoscan, seeing
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
# _AM_DEPENDENCIES(NAME)
# ----------------------
# See how the compiler implements dependency checking.
# NAME is "CC", "CXX", "GCJ", or "OBJC".
# We try a few techniques and use that to set a single cache variable.
#
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
# dependency, and given that the user is not expected to run this macro,
# just rely on AC_PROG_CC.
AC_DEFUN([_AM_DEPENDENCIES],
[AC_REQUIRE([AM_SET_DEPDIR])dnl
AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
AC_REQUIRE([AM_MAKE_INCLUDE])dnl
AC_REQUIRE([AM_DEP_TRACK])dnl
ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
[$1], CXX, [depcc="$CXX" am_compiler_list=],
[$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
[$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
[depcc="$$1" am_compiler_list=])
AC_CACHE_CHECK([dependency style of $depcc],
[am_cv_$1_dependencies_compiler_type],
[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
# We make a subdir and do the tests there. Otherwise we can end up
# making bogus files that we don't know about and never remove. For
# instance it was reported that on HP-UX the gcc test will end up
# making a dummy file named `D' -- because `-MD' means `put the output
# in D'.
mkdir conftest.dir
# Copy depcomp to subdir because otherwise we won't find it if we're
# using a relative directory.
cp "$am_depcomp" conftest.dir
cd conftest.dir
# We will build objects and dependencies in a subdirectory because
# it helps to detect inapplicable dependency modes. For instance
# both Tru64's cc and ICC support -MD to output dependencies as a
# side effect of compilation, but ICC will put the dependencies in
# the current directory while Tru64 will put them in the object
# directory.
mkdir sub
am_cv_$1_dependencies_compiler_type=none
if test "$am_compiler_list" = ""; then
am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
fi
for depmode in $am_compiler_list; do
# Setup a source with many dependencies, because some compilers
# like to wrap large dependency lists on column 80 (with \), and
# we should not choose a depcomp mode which is confused by this.
#
# We need to recreate these files for each test, as the compiler may
# overwrite some of them when testing with obscure command lines.
# This happens at least with the AIX C compiler.
: > sub/conftest.c
for i in 1 2 3 4 5 6; do
echo '#include "conftst'$i'.h"' >> sub/conftest.c
# Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
# Solaris 8's {/usr,}/bin/sh.
touch sub/conftst$i.h
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
case $depmode in
nosideeffect)
# after this tag, mechanisms are not by side-effect, so they'll
# only be used when explicitly requested
if test "x$enable_dependency_tracking" = xyes; then
continue
else
break
fi
;;
none) break ;;
esac
# We check with `-c' and `-o' for the sake of the "dashmstdout"
# mode. It turns out that the SunPro C++ compiler does not properly
# handle `-M -o', and we need to detect this.
if depmode=$depmode \
source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
$SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
>/dev/null 2>conftest.err &&
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
# icc doesn't choke on unknown options, it will just issue warnings
# or remarks (even with -Werror). So we grep stderr for any message
# that says an option was ignored or not supported.
# When given -MP, icc 7.0 and 7.1 complain thusly:
# icc: Command line warning: ignoring option '-M'; no argument required
# The diagnosis changed in icc 8.0:
# icc: Command line remark: option '-MP' not supported
if (grep 'ignoring option' conftest.err ||
grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
am_cv_$1_dependencies_compiler_type=$depmode
break
fi
fi
done
cd ..
rm -rf conftest.dir
else
am_cv_$1_dependencies_compiler_type=none
fi
])
AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
AM_CONDITIONAL([am__fastdep$1], [
test "x$enable_dependency_tracking" != xno \
&& test "$am_cv_$1_dependencies_compiler_type" = gcc3])
])
# AM_SET_DEPDIR
# -------------
# Choose a directory name for dependency files.
# This macro is AC_REQUIREd in _AM_DEPENDENCIES
AC_DEFUN([AM_SET_DEPDIR],
[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
])
# AM_DEP_TRACK
# ------------
AC_DEFUN([AM_DEP_TRACK],
[AC_ARG_ENABLE(dependency-tracking,
[ --disable-dependency-tracking speeds up one-time build
--enable-dependency-tracking do not reject slow dependency extractors])
if test "x$enable_dependency_tracking" != xno; then
am_depcomp="$ac_aux_dir/depcomp"
AMDEPBACKSLASH='\'
fi
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
AC_SUBST([AMDEPBACKSLASH])
])
# Generate code to set up dependency tracking. -*- Autoconf -*-
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
#serial 2
# _AM_OUTPUT_DEPENDENCY_COMMANDS
# ------------------------------
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
[for mf in $CONFIG_FILES; do
# Strip MF so we end up with the name of the file.
mf=`echo "$mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile or not.
# We used to match only the files named `Makefile.in', but
# some people rename them; so instead we look at the file content.
# Grep'ing the first line is not enough: some people post-process
# each Makefile.in and add a new line on top of each file to say so.
# So let's grep whole file.
if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
dirpart=`AS_DIRNAME("$mf")`
else
continue
fi
# Extract the definition of DEPDIR, am__include, and am__quote
# from the Makefile without running `make'.
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
test -z "$DEPDIR" && continue
am__include=`sed -n 's/^am__include = //p' < "$mf"`
test -z "am__include" && continue
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
# When using ansi2knr, U may be empty or an underscore; expand it
U=`sed -n 's/^U = //p' < "$mf"`
# Find all dependency output files, they are included files with
# $(DEPDIR) in their names. We invoke sed twice because it is the
# simplest approach to changing $(DEPDIR) to its actual value in the
# expansion.
for file in `sed -n "
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
fdir=`AS_DIRNAME(["$file"])`
AS_MKDIR_P([$dirpart/$fdir])
# echo "creating $dirpart/$file"
echo '# dummy' > "$dirpart/$file"
done
done
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
# AM_OUTPUT_DEPENDENCY_COMMANDS
# -----------------------------
# This macro should only be invoked once -- use via AC_REQUIRE.
#
# This code is only required when automatic dependency tracking
# is enabled. FIXME. This creates each `.P' file that we will
# need in order to bootstrap the dependency handling code.
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
[AC_CONFIG_COMMANDS([depfiles],
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
])
# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
# Copyright (C) 1996, 1997, 2000, 2001, 2003 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# serial 7
# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
# Do all the work for Automake. -*- Autoconf -*-
# This macro actually does too much some checks are only needed if
# your package does certain things. But this isn't really a big deal.
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# serial 11
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
# AM_INIT_AUTOMAKE([OPTIONS])
# -----------------------------------------------
# The call with PACKAGE and VERSION arguments is the old style
# call (pre autoconf-2.50), which is being phased out. PACKAGE
# and VERSION should now be passed to AC_INIT and removed from
# the call to AM_INIT_AUTOMAKE.
# We support both call styles for the transition. After
# the next Automake release, Autoconf can make the AC_INIT
# arguments mandatory, and then we can depend on a new Autoconf
# release and drop the old call support.
AC_DEFUN([AM_INIT_AUTOMAKE],
[AC_PREREQ([2.58])dnl
dnl Autoconf wants to disallow AM_ names. We explicitly allow
dnl the ones we care about.
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
AC_REQUIRE([AC_PROG_INSTALL])dnl
# test to see if srcdir already configured
if test "`cd $srcdir && pwd`" != "`pwd`" &&
test -f $srcdir/config.status; then
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
fi
# test whether we have cygpath
if test -z "$CYGPATH_W"; then
if (cygpath --version) >/dev/null 2>/dev/null; then
CYGPATH_W='cygpath -w'
else
CYGPATH_W=echo
fi
fi
AC_SUBST([CYGPATH_W])
# Define the identity of the package.
dnl Distinguish between old-style and new-style calls.
m4_ifval([$2],
[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
AC_SUBST([PACKAGE], [$1])dnl
AC_SUBST([VERSION], [$2])],
[_AM_SET_OPTIONS([$1])dnl
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
_AM_IF_OPTION([no-define],,
[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
# Some tools Automake needs.
AC_REQUIRE([AM_SANITY_CHECK])dnl
AC_REQUIRE([AC_ARG_PROGRAM])dnl
AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
AM_MISSING_PROG(AUTOCONF, autoconf)
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
AM_MISSING_PROG(AUTOHEADER, autoheader)
AM_MISSING_PROG(MAKEINFO, makeinfo)
AM_PROG_INSTALL_SH
AM_PROG_INSTALL_STRIP
AC_REQUIRE([AM_PROG_MKDIR_P])dnl
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
AC_REQUIRE([AC_PROG_AWK])dnl
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
[_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
[_AM_PROG_TAR([v7])])])
_AM_IF_OPTION([no-dependencies],,
[AC_PROVIDE_IFELSE([AC_PROG_CC],
[_AM_DEPENDENCIES(CC)],
[define([AC_PROG_CC],
defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
AC_PROVIDE_IFELSE([AC_PROG_CXX],
[_AM_DEPENDENCIES(CXX)],
[define([AC_PROG_CXX],
defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
])
])
# When config.status generates a header, we must update the stamp-h file.
# This file resides in the same directory as the config header
# that is generated. The stamp files are numbered to have different names.
# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
# loop where config.status creates the headers, so we can generate
# our stamp files there.
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
[# Compute $1's index in $config_headers.
_am_stamp_count=1
for _am_header in $config_headers :; do
case $_am_header in
$1 | $1:* )
break ;;
* )
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
esac
done
echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
# AM_PROG_INSTALL_SH
# ------------------
# Define $install_sh.
# Copyright (C) 2001, 2003 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
AC_DEFUN([AM_PROG_INSTALL_SH],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
install_sh=${install_sh-"$am_aux_dir/install-sh"}
AC_SUBST(install_sh)])
# -*- Autoconf -*-
# Copyright (C) 2003 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# serial 1
# Check whether the underlying file-system supports filenames
# with a leading dot. For instance MS-DOS doesn't.
AC_DEFUN([AM_SET_LEADING_DOT],
[rm -rf .tst 2>/dev/null
mkdir .tst 2>/dev/null
if test -d .tst; then
am__leading_dot=.
else
am__leading_dot=_
fi
rmdir .tst 2>/dev/null
AC_SUBST([am__leading_dot])])
# Add --enable-maintainer-mode option to configure.
# From Jim Meyering
# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# serial 3
AC_DEFUN([AM_MAINTAINER_MODE],
[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
dnl maintainer-mode is disabled by default
AC_ARG_ENABLE(maintainer-mode,
[ --enable-maintainer-mode enable make rules and dependencies not useful
(and sometimes confusing) to the casual installer],
USE_MAINTAINER_MODE=$enableval,
USE_MAINTAINER_MODE=no)
AC_MSG_RESULT([$USE_MAINTAINER_MODE])
AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
MAINT=$MAINTAINER_MODE_TRUE
AC_SUBST(MAINT)dnl
]
)
AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
# Check to see how 'make' treats includes. -*- Autoconf -*-
# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# serial 2
# AM_MAKE_INCLUDE()
# -----------------
# Check to see how make treats includes.
AC_DEFUN([AM_MAKE_INCLUDE],
[am_make=${MAKE-make}
cat > confinc << 'END'
am__doit:
@echo done
.PHONY: am__doit
END
# If we don't find an include directive, just comment out the code.
AC_MSG_CHECKING([for style of include used by $am_make])
am__include="#"
am__quote=
_am_result=none
# First try GNU make style include.
echo "include confinc" > confmf
# We grep out `Entering directory' and `Leaving directory'
# messages which can occur if `w' ends up in MAKEFLAGS.
# In particular we don't look at `^make:' because GNU make might
# be invoked under some other name (usually "gmake"), in which
# case it prints its new name instead of `make'.
if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
am__include=include
am__quote=
_am_result=GNU
fi
# Now try BSD make style include.
if test "$am__include" = "#"; then
echo '.include "confinc"' > confmf
if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
am__include=.include
am__quote="\""
_am_result=BSD
fi
fi
AC_SUBST([am__include])
AC_SUBST([am__quote])
AC_MSG_RESULT([$_am_result])
rm -f confinc confmf
])
# -*- Autoconf -*-
# Copyright (C) 1997, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# serial 3
# AM_MISSING_PROG(NAME, PROGRAM)
# ------------------------------
AC_DEFUN([AM_MISSING_PROG],
[AC_REQUIRE([AM_MISSING_HAS_RUN])
$1=${$1-"${am_missing_run}$2"}
AC_SUBST($1)])
# AM_MISSING_HAS_RUN
# ------------------
# Define MISSING if not defined so far and test if it supports --run.
# If it does, set am_missing_run to use it, otherwise, to nothing.
AC_DEFUN([AM_MISSING_HAS_RUN],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
# Use eval to expand $SHELL
if eval "$MISSING --run true"; then
am_missing_run="$MISSING --run "
else
am_missing_run=
AC_MSG_WARN([`missing' script is too old or missing])
fi
])
# AM_PROG_MKDIR_P
# ---------------
# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
# Copyright (C) 2003, 2004 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
# created by `make install' are always world readable, even if the
# installer happens to have an overly restrictive umask (e.g. 077).
# This was a mistake. There are at least two reasons why we must not
# use `-m 0755':
# - it causes special bits like SGID to be ignored,
# - it may be too restrictive (some setups expect 775 directories).
#
# Do not use -m 0755 and let people choose whatever they expect by
# setting umask.
#
# We cannot accept any implementation of `mkdir' that recognizes `-p'.
# Some implementations (such as Solaris 8's) are not thread-safe: if a
# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
# concurrently, both version can detect that a/ is missing, but only
# one can create it and the other will error out. Consequently we
# restrict ourselves to GNU make (using the --version option ensures
# this.)
AC_DEFUN([AM_PROG_MKDIR_P],
[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
# We used to keeping the `.' as first argument, in order to
# allow $(mkdir_p) to be used without argument. As in
# $(mkdir_p) $(somedir)
# where $(somedir) is conditionally defined. However this is wrong
# for two reasons:
# 1. if the package is installed by a user who cannot write `.'
# make install will fail,
# 2. the above comment should most certainly read
# $(mkdir_p) $(DESTDIR)$(somedir)
# so it does not work when $(somedir) is undefined and
# $(DESTDIR) is not.
# To support the latter case, we have to write
# test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
# so the `.' trick is pointless.
mkdir_p='mkdir -p --'
else
# On NextStep and OpenStep, the `mkdir' command does not
# recognize any option. It will interpret all options as
# directories to create, and then abort because `.' already
# exists.
for d in ./-p ./--version;
do
test -d $d && rmdir $d
done
# $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
if test -f "$ac_aux_dir/mkinstalldirs"; then
mkdir_p='$(mkinstalldirs)'
else
mkdir_p='$(install_sh) -d'
fi
fi
AC_SUBST([mkdir_p])])
# Helper functions for option handling. -*- Autoconf -*-
# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# serial 2
# _AM_MANGLE_OPTION(NAME)
# -----------------------
AC_DEFUN([_AM_MANGLE_OPTION],
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
# _AM_SET_OPTION(NAME)
# ------------------------------
# Set option NAME. Presently that only means defining a flag for this option.
AC_DEFUN([_AM_SET_OPTION],
[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
# _AM_SET_OPTIONS(OPTIONS)
# ----------------------------------
# OPTIONS is a space-separated list of Automake options.
AC_DEFUN([_AM_SET_OPTIONS],
[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
# -------------------------------------------
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
#
# Check to make sure that the build environment is sane.
#
# Copyright (C) 1996, 1997, 2000, 2001, 2003 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# serial 3
# AM_SANITY_CHECK
# ---------------
AC_DEFUN([AM_SANITY_CHECK],
[AC_MSG_CHECKING([whether build environment is sane])
# Just in case
sleep 1
echo timestamp > conftest.file
# Do `set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
if test "$[*]" = "X"; then
# -L didn't work.
set X `ls -t $srcdir/configure conftest.file`
fi
rm -f conftest.file
if test "$[*]" != "X $srcdir/configure conftest.file" \
&& test "$[*]" != "X conftest.file $srcdir/configure"; then
# If neither matched, then we have a broken ls. This can happen
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
alias in your environment])
fi
test "$[2]" = conftest.file
)
then
# Ok.
:
else
AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock])
fi
AC_MSG_RESULT(yes)])
# AM_PROG_INSTALL_STRIP
# Copyright (C) 2001, 2003 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# One issue with vendor `install' (even GNU) is that you can't
# specify the program used to strip binaries. This is especially
# annoying in cross-compiling environments, where the build's strip
# is unlikely to handle the host's binaries.
# Fortunately install-sh will honor a STRIPPROG variable, so we
# always use install-sh in `make install-strip', and initialize
# STRIPPROG with the value of the STRIP variable (set by the user).
AC_DEFUN([AM_PROG_INSTALL_STRIP],
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
# Installed binaries are usually stripped using `strip' when the user
# run `make install-strip'. However `strip' might not be the right
# tool to use in cross-compilation environments, therefore Automake
# will honor the `STRIP' environment variable to overrule this program.
dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
if test "$cross_compiling" != no; then
AC_CHECK_TOOL([STRIP], [strip], :)
fi
INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
# Check how to create a tarball. -*- Autoconf -*-
# Copyright (C) 2004 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# serial 1
# _AM_PROG_TAR(FORMAT)
# --------------------
# Check how to create a tarball in format FORMAT.
# FORMAT should be one of `v7', `ustar', or `pax'.
#
# Substitute a variable $(am__tar) that is a command
# writing to stdout a FORMAT-tarball containing the directory
# $tardir.
# tardir=directory && $(am__tar) > result.tar
#
# Substitute a variable $(am__untar) that extract such
# a tarball read from stdin.
# $(am__untar) < result.tar
AC_DEFUN([_AM_PROG_TAR],
[# Always define AMTAR for backward compatibility.
AM_MISSING_PROG([AMTAR], [tar])
m4_if([$1], [v7],
[am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
[m4_case([$1], [ustar],, [pax],,
[m4_fatal([Unknown tar format])])
AC_MSG_CHECKING([how to create a $1 tar archive])
# Loop over all known methods to create a tar archive until one works.
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
_am_tools=${am_cv_prog_tar_$1-$_am_tools}
# Do not fold the above two line into one, because Tru64 sh and
# Solaris sh will not grok spaces in the rhs of `-'.
for _am_tool in $_am_tools
do
case $_am_tool in
gnutar)
for _am_tar in tar gnutar gtar;
do
AM_RUN_LOG([$_am_tar --version]) && break
done
am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
am__untar="$_am_tar -xf -"
;;
plaintar)
# Must skip GNU tar: if it does not support --format= it doesn't create
# ustar tarball either.
(tar --version) >/dev/null 2>&1 && continue
am__tar='tar chf - "$$tardir"'
am__tar_='tar chf - "$tardir"'
am__untar='tar xf -'
;;
pax)
am__tar='pax -L -x $1 -w "$$tardir"'
am__tar_='pax -L -x $1 -w "$tardir"'
am__untar='pax -r'
;;
cpio)
am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
am__untar='cpio -i -H $1 -d'
;;
none)
am__tar=false
am__tar_=false
am__untar=false
;;
esac
# If the value was cached, stop now. We just wanted to have am__tar
# and am__untar set.
test -n "${am_cv_prog_tar_$1}" && break
# tar/untar a dummy directory, and stop if the command works
rm -rf conftest.dir
mkdir conftest.dir
echo GrepMe > conftest.dir/file
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
rm -rf conftest.dir
if test -s conftest.tar; then
AM_RUN_LOG([$am__untar <conftest.tar])
grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
fi
done
rm -rf conftest.dir
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
AC_MSG_RESULT([$am_cv_prog_tar_$1])])
AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR
m4_include([acinclude.m4])
/* $Id: compress.c,v 1.2 2000/12/14 18:45:35 ghazi Exp $
$Log: compress.c,v $
Revision 1.2 2000/12/14 18:45:35 ghazi
Warning fixes:
* compress.c: Include stdlib.h and compress.h.
(rcsid): Delete.
(report_str_error): Make static.
(ez_inflate_str): Delete unused variable. Add parens in if-stmt.
(hrd_inflate_str): Likewise.
* compress.h (init_compression, end_compression, init_inflation,
end_inflation): Prototype void arguments.
* dostime.c (rcsid): Delete.
* jargrep.c: Include ctype.h, stdlib.h, zlib.h and compress.h.
Make functions static. Cast ctype function argument to `unsigned
char'. Add parens in if-stmts. Constify.
(Usage): Change into a macro.
(jargrep): Remove unused parameter.
* jartool.c: Constify. Add parens in if-stmts. Align
signed/unsigned char pointers in functions calls using casts.
(rcsid): Delete.
(list_jar): Fix printf format specifier.
(usage): Chop long string into bits. Reformat.
* pushback.c (rcsid): Delete.
Revision 1.1 2000/12/09 03:08:23 apbianco
2000-12-08 Alexandre Petit-Bianco <apbianco@cygnus.com>
* fastjar: Imported.
Revision 1.7 2000/09/13 14:02:02 cory
Reformatted some of the code to more closly match the layout of the orriginal
fastjar utility.
Revision 1.6 2000/09/12 22:29:36 cory
Jargrep now seems to do what I want it to do. Performs properly on Linux x86,
will test some other platforms later.
Revision 1.1.1.1 1999/12/06 03:09:16 toast
initial checkin..
Revision 1.7 1999/05/10 08:50:05 burnsbr
*** empty log message ***
Revision 1.6 1999/05/10 08:38:44 burnsbr
*** empty log message ***
Revision 1.5 1999/05/10 08:30:29 burnsbr
added inflation code
Revision 1.4 1999/04/27 10:03:33 burnsbr
added configure support
Revision 1.3 1999/04/26 02:35:32 burnsbr
compression now works.. yahoo
Revision 1.2 1999/04/23 12:01:59 burnsbr
added licence stuff.
Revision 1.1 1999/04/23 11:58:25 burnsbr
Initial revision
*/
/*
compress.c - code for handling deflation
Copyright (C) 1999 Bryan Burns
Copyright (C) 2004 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "config.h"
#include <zlib.h>
#include <string.h>
#include <stdio.h>
#include <errno.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#include <sys/types.h>
#include "jartool.h"
#include "pushback.h"
#include "compress.h"
#include "shift.h"
int write_data (int, void *, size_t, struct zipentry *);
extern int seekable;
extern off_t end_of_entries;
static z_stream zs;
void init_compression(){
memset(&zs, 0, sizeof(z_stream));
zs.zalloc = Z_NULL;
zs.zfree = Z_NULL;
zs.opaque = Z_NULL;
/* Why -MAX_WBITS? zlib has an undocumented feature, where if the windowbits
parameter is negative, it omits the zlib header, which seems to kill
any other zip/unzip program. This caused me SO much pain.. */
if(deflateInit2(&zs, Z_DEFAULT_COMPRESSION, Z_DEFLATED, -MAX_WBITS,
9, Z_DEFAULT_STRATEGY) != Z_OK){
fprintf(stderr, "Error initializing deflation!\n");
exit(1);
}
}
int
write_data (int fd, void *buf, size_t len,
struct zipentry *ze __attribute__((unused)))
{
#ifdef WITH_SHIFT_DOWN
struct zipentry *next = NULL;
off_t here = lseek (fd, 0, SEEK_CUR);
/*
* If we are updating and there is not enough space before the next
* entry, expand the file.
*/
if (ze)
{
next = ze->next_entry;
if (next && here + len >= next->offset)
{
if (shift_down (fd, next->offset, (here + len) - next->offset, next))
{
perror ("can't expand file");
exit (1);
}
}
}
#endif /* WITH_SHIFT_DOWN */
return write (fd, buf, len);
}
int compress_file(int in_fd, int out_fd, struct zipentry *ze,
struct zipentry *existing)
{
Bytef in_buff[RDSZ];
Bytef out_buff[RDSZ];
unsigned int rdamt, wramt;
unsigned long tr = 0;
int rtval;
rdamt = 0;
zs.avail_in = 0;
zs.next_in = in_buff;
zs.next_out = out_buff;
zs.avail_out = (uInt)RDSZ;
ze->crc = crc32(0L, Z_NULL, 0);
for(; ;){
/* If deflate is out of input, fill the input buffer for it */
if(zs.avail_in == 0 && zs.avail_out > 0){
if((rtval = read(in_fd, in_buff, RDSZ)) == 0)
break;
if(rtval == -1){
perror("read");
exit(1);
}
rdamt = rtval;
/* compute the CRC while we're at it */
ze->crc = crc32(ze->crc, in_buff, rdamt);
/* update the total amount read sofar */
tr += rdamt;
zs.next_in = in_buff;
zs.avail_in = rdamt;
}
/* deflate the data */
if(deflate(&zs, 0) != Z_OK){
fprintf(stderr, "Error deflating! %s:%d\n", __FILE__, __LINE__);
exit(1);
}
/* If the output buffer is full, dump it to disk */
if(zs.avail_out == 0){
if (write_data (out_fd, out_buff, RDSZ, existing) != RDSZ)
{
perror("write");
exit(1);
}
/* clear the output buffer */
zs.next_out = out_buff;
zs.avail_out = (uInt)RDSZ;
}
}
/* If we have any data waiting in the buffer after we're done with the file
we can flush it */
if(zs.avail_out < RDSZ){
wramt = RDSZ - zs.avail_out;
if (write_data (out_fd, out_buff, wramt, existing) != (int)wramt)
{
perror("write");
exit(1);
}
/* clear the output buffer */
zs.next_out = out_buff;
zs.avail_out = (uInt)RDSZ;
}
/* finish deflation. This purges zlib's internal data buffers */
while(deflate(&zs, Z_FINISH) == Z_OK){
wramt = RDSZ - zs.avail_out;
if (write_data (out_fd, out_buff, wramt, existing) != (int)wramt)
{
perror("write");
exit(1);
}
zs.next_out = out_buff;
zs.avail_out = (uInt)RDSZ;
}
/* If there's any data left in the buffer, write it out */
if(zs.avail_out != RDSZ){
wramt = RDSZ - zs.avail_out;
if (write_data (out_fd, out_buff, wramt, existing) != (int)wramt)
{
perror("write");
exit(1);
}
}
/* update fastjar's entry information */
ze->usize = (ub4)zs.total_in;
ze->csize = (ub4)zs.total_out;
/* Reset the deflation for the next time around */
if(deflateReset(&zs) != Z_OK){
fprintf(stderr, "Error resetting deflation\n");
exit(1);
}
return 0;
}
void end_compression(){
int rtval;
/* Oddly enough, zlib always returns Z_DATA_ERROR if you specify no
zlib header. Go fig. */
if((rtval = deflateEnd(&zs)) != Z_OK && rtval != Z_DATA_ERROR){
fprintf(stderr, "Error calling deflateEnd\n");
fprintf(stderr, "error: (%d) %s\n", rtval, zs.msg);
exit(1);
}
}
void init_inflation(){
memset(&zs, 0, sizeof(z_stream));
zs.zalloc = Z_NULL;
zs.zfree = Z_NULL;
zs.opaque = Z_NULL;
if(inflateInit2(&zs, -15) != Z_OK){
fprintf(stderr, "Error initializing deflation!\n");
exit(1);
}
}
int inflate_file(pb_file *pbf, int out_fd, struct zipentry *ze){
Bytef in_buff[RDSZ];
Bytef out_buff[RDSZ];
unsigned int rdamt;
int rtval;
ub4 crc = 0;
zs.avail_in = 0;
crc = crc32(crc, NULL, 0); /* initialize crc */
/* loop until we've consumed all the compressed data */
for(;;){
if(zs.avail_in == 0){
if((rdamt = pb_read(pbf, in_buff, RDSZ)) == 0)
break;
else if((int)rdamt < 0){
perror("read");
exit(1);
}
#ifdef DEBUG
printf("%d bytes read\n", rdamt);
#endif
zs.next_in = in_buff;
zs.avail_in = rdamt;
}
zs.next_out = out_buff;
zs.avail_out = RDSZ;
if((rtval = inflate(&zs, 0)) != Z_OK){
if(rtval == Z_STREAM_END){
#ifdef DEBUG
printf("end of stream\n");
#endif
if(zs.avail_out != RDSZ){
crc = crc32(crc, out_buff, (RDSZ - zs.avail_out));
if(out_fd >= 0)
if(write(out_fd, out_buff, (RDSZ - zs.avail_out)) !=
(int)(RDSZ - zs.avail_out)){
perror("write");
exit(1);
}
}
break;
} else {
fprintf(stderr, "Error inflating file! (%d)\n", rtval);
exit(1);
}
} else {
if(zs.avail_out != RDSZ){
crc = crc32(crc, out_buff, (RDSZ - zs.avail_out));
if(out_fd >= 0)
if(write(out_fd, out_buff, (RDSZ - zs.avail_out)) !=
(int)(RDSZ - zs.avail_out)){
perror("write");
exit(1);
}
zs.next_out = out_buff;
zs.avail_out = RDSZ;
}
}
}
#ifdef DEBUG
printf("done inflating\n");
#endif
#ifdef DEBUG
printf("%d bytes left over\n", zs.avail_in);
#endif
#ifdef DEBUG
printf("CRC is %x\n", crc);
#endif
ze->crc = crc;
pb_push(pbf, zs.next_in, zs.avail_in);
ze->usize = zs.total_out;
inflateReset(&zs);
return 0;
}
/*
Function name: report_str_error
args: val Error code returned from zlib.
purpose: Put out an error message corresponding to error code returned from zlib.
Be suitably cryptic seeing I don't really know exactly what these errors mean.
*/
static void report_str_error(int val) {
switch(val) {
case Z_STREAM_END:
break;
case Z_NEED_DICT:
fprintf(stderr, "Need a dictionary?\n");
exit(1);
case Z_DATA_ERROR:
fprintf(stderr, "Z_DATA_ERROR\n");
exit(1);
case Z_STREAM_ERROR:
fprintf(stderr, "Z_STREAM_ERROR\n");
exit(1);
case Z_MEM_ERROR:
fprintf(stderr, "Z_MEM_ERROR\n");
exit(1);
case Z_BUF_ERROR:
fprintf(stderr, "Z_BUF_ERROR\n");
exit(1);
case Z_OK:
break;
default:
fprintf(stderr, "Unknown behavior from inflate\n");
exit(1);
}
}
/*
Function name: ez_inflate_str
args: pbf Pointer to pushback handle for file.
csize Compressed size of embedded file.
usize Uncompressed size of embedded file.
purpose: Read in and decompress the contents of an embedded file and store it in a
byte array.
returns: Byte array of uncompressed embedded file.
*/
static Bytef *ez_inflate_str(pb_file *pbf, ub4 csize, ub4 usize) {
Bytef *out_buff;
Bytef *in_buff;
unsigned int rdamt;
if((zs.next_in = in_buff = (Bytef *) malloc(csize))) {
if((zs.next_out = out_buff = (Bytef *) malloc(usize + 1))) {
if((rdamt = pb_read(pbf, zs.next_in, csize)) == csize) {
zs.avail_in = csize;
zs.avail_out = usize;
report_str_error(inflate(&zs, 0));
free(in_buff);
inflateReset(&zs);
out_buff[usize] = '\0';
}
else {
fprintf(stderr, "Read failed on input file.\n");
fprintf(stderr, "Tried to read %u but read %u instead.\n", csize, rdamt);
free(in_buff);
free(out_buff);
exit(1);
}
}
else {
fprintf(stderr, "Malloc of out_buff failed.\n");
fprintf(stderr, "Error: %s\n", strerror(errno));
free(in_buff);
exit(1);
}
}
else {
fprintf(stderr, "Malloc of in_buff failed.\n");
fprintf(stderr, "Error: %s\n", strerror(errno));
exit(1);
}
return out_buff;
}
/*
Function name: hrd_inflate_str
args: pbf Pointer to pushback handle for file.
csize Pointer to compressed size of embedded file.
usize Pointer to uncompressed size of embedded file.
purpose: Read and decompress an embedded file into a string. Set csize and usize
accordingly. This function does the reading for us in the case there is not size
information in the header for the embedded file.
returns: Byte array of the contents of the embedded file.
*/
static Bytef *hrd_inflate_str(pb_file *pbf, ub4 *csize, ub4 *usize) {
Bytef *out_buff;
Bytef *tmp;
Bytef in_buff[RDSZ];
unsigned int rdamt;
int i;
int zret;
i = 1;
out_buff = NULL;
zret = Z_OK;
while(zret != Z_STREAM_END && (rdamt = pb_read(pbf, in_buff, RDSZ)))
{
zs.avail_in = rdamt;
zs.avail_out = 0;
zs.next_in = in_buff;
do {
if((tmp = (Bytef *) realloc(out_buff, (RDSZ * i) + 1))) {
out_buff = tmp;
zs.next_out = &(out_buff[(RDSZ * (i - 1)) - zs.avail_out]);
zs.avail_out += RDSZ;
i++;
}
else {
fprintf(stderr, "Realloc of out_buff failed.\n");
fprintf(stderr, "Error: %s\n", strerror(errno));
exit(1);
}
} while((zret = inflate(&zs, 0)) == Z_OK);
report_str_error(zret);
}
pb_push(pbf, zs.next_in, zs.avail_in);
out_buff[(RDSZ * (i - 1)) - zs.avail_out] = '\0';
*usize = zs.total_out;
*csize = zs.total_in;
inflateReset(&zs);
return out_buff;
}
/*
Function name: inflate_string
args: pbf Pointer to pushback handle for file.
csize Pointer to compressed size of embedded file. May be 0 if not set.
usize Pointer to uncompressed size of embedded file. May be 0 if not set.
purpose: Decide the easiest (in computer terms) methos of decompressing this embedded
file to a string.
returns: Pointer to a string containing the decompressed contents of the embedded file.
If csize and usize are not set set them to correct numbers.
*/
Bytef *inflate_string(pb_file *pbf, ub4 *csize, ub4 *usize) {
Bytef *ret_buf;
if(*csize && *usize) ret_buf = ez_inflate_str(pbf, *csize, *usize);
else ret_buf = hrd_inflate_str(pbf, csize, usize);
return ret_buf;
}
/* $Id: compress.h,v 1.1 2000/12/09 03:08:23 apbianco Exp $
$Log: compress.h,v $
Revision 1.1 2000/12/09 03:08:23 apbianco
2000-12-08 Alexandre Petit-Bianco <apbianco@cygnus.com>
* fastjar: Imported.
Revision 1.1.1.1 1999/12/06 03:09:12 toast
initial checkin..
Revision 1.3 1999/05/10 08:32:09 burnsbr
added new function protos.
Revision 1.2 1999/04/23 12:02:20 burnsbr
added licence
Revision 1.1 1999/04/23 11:59:37 burnsbr
Initial revision
*/
/*
compress.h - header for compression
Copyright (C) 1999 Bryan Burns
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/* Initializes the compression data structure(s) */
void init_compression(void);
/* Compresses the file specified by in_fd and appends it to out_fd */
int compress_file(int, int, struct zipentry *, struct zipentry *);
/* Frees memory used by compression function */
void end_compression(void);
void init_inflation(void);
int inflate_file(pb_file *, int, struct zipentry *);
void end_inflation(void);
Bytef *inflate_string(pb_file *, ub4 *, ub4 *);
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
*/
#undef HAVE_DIRENT_H
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define to 1 if you have the `ftruncate' function. */
#undef HAVE_FTRUNCATE
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
/* Define to 1 if the system has the type `long long'. */
#undef HAVE_LONG_LONG
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
#undef HAVE_NDIR_H
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
*/
#undef HAVE_SYS_DIR_H
/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
*/
#undef HAVE_SYS_NDIR_H
/* Define to 1 if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if you have the `_chsize' function. */
#undef HAVE__CHSIZE
/* Define if host mkdir takes a single argument. */
#undef MKDIR_TAKES_ONE_ARG
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* The size of a `char', as computed by sizeof. */
#undef SIZEOF_CHAR
/* The size of a `int', as computed by sizeof. */
#undef SIZEOF_INT
/* The size of a `long', as computed by sizeof. */
#undef SIZEOF_LONG
/* The size of a `long long', as computed by sizeof. */
#undef SIZEOF_LONG_LONG
/* The size of a `short', as computed by sizeof. */
#undef SIZEOF_SHORT
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
#undef TM_IN_SYS_TIME
/* Version number of package */
#undef VERSION
/* Define to 1 if your processor stores words with the most significant byte
first (like Motorola and SPARC, unlike Intel and VAX). */
#undef WORDS_BIGENDIAN
/* Define to `long' if <sys/types.h> does not define. */
#undef off_t
This source diff could not be displayed because it is too large. You can view the blob instead.
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT(jartool.h)
AM_INIT_AUTOMAKE(fastjar, 0.92-gcc)
AM_CONFIG_HEADER(config.h)
dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PATH_PROG(RM, rm, /bin/rm, $PATH:/bin:/usr/bin:/usr/local/bin)
AC_PATH_PROG(CP, cp, /bin/cp, $PATH:/bin:/usr/bin:/usr/local/bin)
AC_PATH_PROG(STRIP, strip, /usr/bin/strip, $PATH:/bin:/usr/bin:/usr/local/bin)
AC_PATH_PROG(CHMOD, chmod, /bin/chmod, $PATH:/bin:/usr/bin:/usr/local/bin)
AC_EXEEXT
AM_MAINTAINER_MODE
dnl Add warning flags if we are using gcc.
if test "$GCC" = yes; then
fastjar_warn_cflags='-W -Wall -pedantic -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings'
fi
AC_SUBST(fastjar_warn_cflags)
dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_STRUCT_TM
AC_CHECK_HEADERS(fcntl.h unistd.h sys/param.h stdlib.h limits.h)
AC_CHECK_FUNCS(ftruncate _chsize)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_OFF_T
AC_STRUCT_TM
# mkdir takes a single argument on some systems.
gcc_AC_FUNC_MKDIR_TAKES_ONE_ARG
dnl Check for type-widths
AC_CHECK_SIZEOF(char)
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
AC_CHECK_TYPES([long long],[AC_CHECK_SIZEOF(long long)])
dnl Check byte order
AC_C_BIGENDIAN
AC_ARG_WITH(system-zlib,
[ --with-system-zlib use installed libz])
ZLIBS=
ZDEPS=
ZINCS=
use_zlib=maybe
if test "$with_system_zlib" = yes; then
AC_CHECK_LIB(z, deflate, ZLIBS=-lz, use_zlib=no)
else
use_zlib=no
fi
if test "$use_zlib" = no; then
# Brain dead way to find tree's zlib.
ZDEPS='$(top_builddir)/../zlib/libz.a'
ZLIBS="$ZDEPS -L\$(here)/../zlib/$libsubdir"
ZINCS='-I$(top_srcdir)/../zlib'
fi
AC_SUBST(ZLIBS)
AC_SUBST(ZDEPS)
AC_SUBST(ZINCS)
# GCC LOCAL CHANGE
# We would like to our source tree to be readonly. However when releases or
# pre-releases are generated, the man pages need to be included as they are
# converted from the texi files via perl which we don't require end users to
# have installed.
# Therefore we have --enable-generated-files-in-srcdir to do just that.
AC_MSG_CHECKING([whether to place generated files in the source directory])
dnl generated-files-in-srcdir is disabled by default
AC_ARG_ENABLE(generated-files-in-srcdir,
[ --enable-generated-files-in-srcdir
put copies of generated files in source dir
intended for creating source tarballs for users
without texinfo, perl, bison or flex.],
generated_files_in_srcdir=$enableval,
generated_files_in_srcdir=no)
AC_MSG_RESULT($generated_files_in_srcdir)
AM_CONDITIONAL(GENINSRC, test x$generated_files_in_srcdir = xyes)
AC_OUTPUT(Makefile install-defs.sh)
/* dostime.c - convert dos time to/from time_t.
Copyright (C) 2002 Free Software Foundation
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <config.h>
#include <time.h>
#include <stddef.h>
#include "dostime.h"
/*
* The specification to which this was written. From Joe Buck.
* The DOS format appears to have only 2 second resolution. It is an
* unsigned long, and ORs together
*
* (year-1980)<<25
* month<<21 (month is tm_mon + 1, 1=Jan through 12=Dec)
* day<<16 (day is tm_mday, 1-31)
* hour<<11 (hour is tm_hour, 0-23)
* min<<5 (min is tm_min, 0-59)
* sec>>1 (sec is tm_sec, 0-59, that's right, we throw away the LSB)
*
* DOS uses local time, so the localtime() call is used to turn the time_t
* into a struct tm.
*/
time_t
dos2unixtime (unsigned long dostime)
{
struct tm ltime;
time_t now = time (NULL);
/* Call localtime to initialize timezone in TIME. */
ltime = *localtime (&now);
ltime.tm_year = (dostime >> 25) + 80;
ltime.tm_mon = ((dostime >> 21) & 0x0f) - 1;
ltime.tm_mday = (dostime >> 16) & 0x1f;
ltime.tm_hour = (dostime >> 11) & 0x0f;
ltime.tm_min = (dostime >> 5) & 0x3f;
ltime.tm_sec = (dostime & 0x1f) << 1;
ltime.tm_wday = -1;
ltime.tm_yday = -1;
ltime.tm_isdst = -1;
return mktime (&ltime);
}
unsigned long
unix2dostime (time_t *time)
{
struct tm *ltime = localtime (time);
int year = ltime->tm_year - 80;
if (year < 0)
year = 0;
return (year << 25
| (ltime->tm_mon + 1) << 21
| ltime->tm_mday << 16
| ltime->tm_hour << 11
| ltime->tm_min << 5
| ltime->tm_sec >> 1);
}
/*
dostime.h - function prototypes
Copyright (C) 1999, 2002 Bryan Burns
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
time_t dos2unixtime(unsigned long dostime);
unsigned long unix2dostime(time_t*);
\input texinfo @c -*-texinfo-*-
@setfilename fastjar.info
@settitle Guide to GNU jar utilites
@c Note: When reading this manual you'll find lots of strange
@c circumlocutions like ``compiler for the Java language''.
@c This is necessary due to Sun's restrictions on the use of
@c the word ``Java'.
@c When this manual is copyrighted.
@set copyrights-fastjar 2002
@include gcc-common.texi
@c Versions
@set which-gcj GCC-@value{version-GCC}
@ifinfo
@format
@dircategory Programming
@direntry
* fastjar: (fastjar). GNU jar utilities
@end direntry
@dircategory Individual utilities
@direntry
* fastjar: (fastjar)Invoking fastjar.
An archive tool for Java archives
* grepjar: (fastjar)Invoking grepjar.
Search files in a jar file for a pattern
@end direntry
@end format
@c man begin COPYRIGHT
Copyright (C) @value{copyrights-fastjar} Matthias Klose
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version. A copy of the license is included in the
@c man end
section entitled ``GNU General Public License''.
@ignore
@c man begin COPYRIGHT
man page gpl(7).
@c man end
@end ignore
@end ifinfo
@titlepage
@title GNU jar utilites
@author Brian Burns
@page
@vskip 0pt plus 1filll
Copyright @copyright{} @value{copyrights-gcj} Matthias Klose
@sp 2
For the @value{which-gcj} Version*
@sp 1
Published by the Free Software Foundation @*
51 Franklin Street, Fifth Floor@*
Boston, MA 02110-1301, USA@*
@sp 1
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version. A copy of the license is included in the
section entitled ``GNU General Public License''.
@end titlepage
@contents
@page
@node Top
@top Introduction
This manual describes how to use @command{fastjar} and @command{grepjar}.
@menu
* Invoking fastjar:: Options supported by @command{fastjar}
* Invoking grepjar:: Options supported by @command{grepjar}
* Copying:: The GNU General Public License
@end menu
@node Invoking fastjar
@chapter Invoking fastjar
@c man title fastjar archive tool for Java archives
@c man begin DESCRIPTION fastjar
@code{fastjar} is an implementation of Sun's jar utility that comes with
the JDK, written entirely in C, and runs in a fraction of the time while
being feature compatible.
If any file is a directory then it is processed recursively. The
manifest file name and the archive file name needs to be specified in
the same order the @option{-m} and @option{-f} flags are specified.
@c man end
@ignore
@c man begin SYNOPSIS fastjar
fastjar @option{-ctxu} [@option{OPTIONS}] [@var{jar-file}] [@var{manifest-file}] [@option{-C} @var{dir}] @var{files}@dots{}
@c man end
@c man begin SEEALSO fastjar
gcj(1), gij(1), grepjar(1)
and the Info entry for @file{gcj}.
@c man end
@end ignore
@c man begin OPTIONS fastjar
Exactly one of the following actions must be specified:
@table @gcctabopt
@item -c
Create new archive.
@item -t
List table of contents for archive.
@item -x
Extract named (or all) files from archive.
@item -u
Update existing archive.
@end table
The following parameters are optional:
@table @gcctabopt
@item -@@
Read the names of the files to add to the archive from stdin. This
option is supported only in combination with @option{-c} or @option{-u}.
Non standard option added in the GCC version.
@item -C @var{directory}
Change to the @var{directory} and include the following file.
@item -E
Prevent fastjar from reading the content of a directory when specifying
one (and instead relying on the provided list of files to populate the
archive with regard to the directory entry). Non standard option added
in the GCC version.
@item -M
Do not create a manifest file for the entries.
@item -i
Generate an index of the packages in this jar and its Class-Path
(currently a no-op for jar command-line compatibility).
@item -0
Store only; use no ZIP compression.
@item -V
@itemx --version
Display version information.
@item -f @var{archive}
Specify archive file name.
@item -m @var{manifest}
Include manifest information from specified @var{manifest} file.
@item -v
Generate verbose output on standard output.
@end table
All remaining options are considered to be names of files.
@c man end
@node Invoking grepjar
@chapter Invoking grepjar
@c man title grepjar search files in a jar file for a pattern
@c man begin DESCRIPTION grepjar
The @code{grepjar} program can be used to search files in a jar file for
a pattern.
@c man end
@ignore
@c man begin SYNOPSIS grepjar
grepjar [@option{-bcinsw}] @option{-e} @var{PATTERN} | @var{PATTERN} @var{files}@dots{}
@c man end
@c man begin SEEALSO grepjar
fastjar(1), gcj(1), gij(1), gfdl(7) and the Info entry for @file{gcj}.
@c man end
@end ignore
@c man begin OPTIONS grepjar
@table @gcctabopt
@item -b
Print byte offset of match.
@item -c
Print number of matches.
@item -i
Compare case-insensitively.
@item -n
Print line number of each match.
@item -s
Suppress error messages.
@item -w
Force @var{PATTERN} to match only whole words.
@item -e @var{PATTERN}
Use @var{PATTERN} as regular expression.
@item --help
Print help, then exit.
@item -V
@itemx --version
Print version number, then exit.
@end table
@c man end
@include gpl.texi
@bye
CP=@CP@
STRIP=@STRIP@
CHMOD=@CHMOD@
prefix=@prefix@
exec_prefix=@exec_prefix@
BINDIR=@bindir@
/*
jargrep.c - main functions for jargrep utility
Copyright (C) 2002, 2003, 2006 Free Software Foundation
Copyright (C) 1999, 2000 Bryan Burns
Copyright (C) 2000 Cory Hollingsworth
Parts of this program are base on Bryan Burns work with fastjar
Copyright (C) 1999.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/* Id: jargrep.c,v 1.5 2002/01/03 04:57:56 rodrigc Exp
Log: jargrep.c,v
Revision 1.5 2002/01/03 04:57:56 rodrigc
2001-01-02 Craig Rodrigues <rodrigc@gcc.gnu.org>
PR bootstrap/5117
* configure.in (AC_CHECK_HEADERS): Check for stdlib.h.
* Makefile.am: Move grepjar to bin_PROGRAMS.
* config.h.in: Regenerated.
* Makefile.in: Regenerated.
* aclocal.m4: Regenerated.
* jargrep.c: Eliminate some signed/unsigned and default
uninitialized warnings. Use HAVE_STDLIB_H instead of
STDC_HEADERS macro.
* jartool.c: Likewise.
* compress.c: Likewise.
Revision 1.4 2000/12/15 18:45:09 tromey
* jargrep.c: Include getopt.h if it exists.
(optind): Declare.
* configure, config.h: Rebuilt.
* configure.in: Check for getopt.h.
Revision 1.3 2000/12/14 18:45:35 ghazi
Warning fixes:
* compress.c: Include stdlib.h and compress.h.
(rcsid): Delete.
(report_str_error): Make static.
(ez_inflate_str): Delete unused variable. Add parens in if-stmt.
(hrd_inflate_str): Likewise.
* compress.h (init_compression, end_compression, init_inflation,
end_inflation): Prototype void arguments.
* dostime.c (rcsid): Delete.
* jargrep.c: Include ctype.h, stdlib.h, zlib.h and compress.h.
Make functions static. Cast ctype function argument to `unsigned
char'. Add parens in if-stmts. Constify.
(Usage): Change into a macro.
(jargrep): Remove unused parameter.
* jartool.c: Constify. Add parens in if-stmts. Align
signed/unsigned char pointers in functions calls using casts.
(rcsid): Delete.
(list_jar): Fix printf format specifier.
(usage): Chop long string into bits. Reformat.
* pushback.c (rcsid): Delete.
Revision 1.2 2000/12/11 02:59:55 apbianco
2000-12-10 Robert Lipe <robertlipe@usa.net>
* jargrep.c (jargrep): Added null statement after case.
2000-12-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
* Makefile: Removed.
* Makefile.in: Rebuilt with `-i' and `--enable-foreign'.
(http://gcc.gnu.org/ml/gcc/2000-12/msg00294.html)
Revision 1.1 2000/12/09 03:08:23 apbianco
2000-12-08 Alexandre Petit-Bianco <apbianco@cygnus.com>
* fastjar: Imported.
Revision 1.8 2000/09/13 14:02:02 cory
Reformatted some of the code to more closly match the layout of the orriginal
fastjar utility.
Revision 1.7 2000/09/12 22:29:36 cory
Jargrep now seems to do what I want it to do. Performs properly on Linux x86,
will test some other platforms later.
*/
#include "config.h"
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <ctype.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#include "xregex.h"
#include "jargrep.h"
#include "jartool.h"
#include "pushback.h"
#include "zipfile.h"
#include "zlib.h"
#include "compress.h"
#include <getopt.h>
void version(void);
void help(const char *name);
#define Usage "Usage: %s [-bcinsVw] [--version|--help] <-e PATTERN | PATTERN> FILE ...\n"
/*
Function name: opt_valid
arg: options Bitfield flag that contains the command line options of grepjar.
purpose: To guard agains the occurance of certain incompatible flags being used
together.
returns: TRUE if options are valid, FALSE otherwise.
*/
static int opt_valid(int options) {
int retflag;
if((options & JG_PRINT_COUNT) &&
(options & (JG_PRINT_BYTEOFFSET | JG_PRINT_LINE_NUMBER)))
{
retflag = FALSE;
}
else retflag = TRUE;
return retflag;
}
/*
Function name: create_regexp
args: regstr String containing the uncompiled regular expression. This may be the
expression as is passed in through argv.
options This is the flag containing the commandline options that have been
parsed by getopt.
purpose: Handle the exception handling involved with setting upt a new regular
expression.
returns: Newly allocated compile regular expression ready to be used in an regexec call.
*/
static regex_t *create_regexp(const char *regstr, int options) {
regex_t *exp;
int errcode;
int msgsize;
char *errmsg;
if((exp = (regex_t *) malloc(sizeof(regex_t))))
{
if((errcode = regcomp(exp, regstr, (options & JG_IGNORE_CASE) ? REG_ICASE : 0))) {
fprintf(stderr, "regcomp of regex failed,\n");
if((errmsg = (char *) malloc(msgsize = regerror(errcode, exp, NULL, 0) + 1))) {
regerror(errcode, exp, errmsg, msgsize);
fprintf(stderr, "Error: %s\n", errmsg);
free(exp);
free(errmsg);
exit(1);
}
else {
fprintf(stderr, "Malloc of errmsg failed.\n");
fprintf(stderr, "Error: %s\n", strerror(errno));
free(exp);
exit(1);
}
}
}
else {
fprintf(stderr, "Malloc of regex failed,\n");
fprintf(stderr, "Error: %s\n", strerror(errno));
exit(1);
}
return exp;
}
/*
Function name: check_sig
args: scratch Pointer to array of bytes containing signature.
pbf Pointer to push back handle for jar file.
purpose: Verify that checksum is correct.
returns: 0, 1, or 2. 0 means we are ready to read embedded file information. 1 means
we have read beyound the embedded file list and can exit knowing we have read all the
relevent information. 2 means we still haven't reached embdedded file list and need to
do some more reading.
*/
static int check_sig(ub1 *scratch, pb_file *pbfp) {
ub4 signature;
int retflag = 0;
signature = UNPACK_UB4(scratch, 0);
#ifdef DEBUG
printf("signature is %x\n", signature);
#endif
if(signature == 0x08074b50){
#ifdef DEBUG
printf("skipping data descriptor\n");
#endif
pb_read(pbfp, scratch, 12);
retflag = 2;
} else if(signature == 0x02014b50){
#ifdef DEBUG
printf("Central header reached.. we're all done!\n");
#endif
retflag = 1;
}else if(signature != 0x04034b50){
printf("Ick! %#x\n", signature);
retflag = 1;
}
return retflag;
}
/*
Function name: decd_siz
args csize Pointer to embedded file's compressed size.
usize Pointer to embedded file's uncmpressed size.
fnlen Pointer to embedded file's file name length.
elfen Pointer to length of extra fields in jar file.
flags Pointer to bitmapped flags.
method Pointer to indicator of storage method of embedded file.
file_header Pointer to string containing the above values to be unbacked.
Purpose: Unpack the series of values from file_header.
*/
static void decd_siz(ub4 *csize, ub4 *usize, ub2 *fnlen, ub2 *eflen, ub2 *flags, ub2 *method, ub1 *file_header) {
*csize = UNPACK_UB4(file_header, LOC_CSIZE);
#ifdef DEBUG
printf("Compressed size is %u\n", *csize);
#endif
*usize = UNPACK_UB4(file_header, LOC_USIZE);
#ifdef DEBUG
printf("Uncompressed size is %u\n", *usize);
#endif
*fnlen = UNPACK_UB2(file_header, LOC_FNLEN);
#ifdef DEBUG
printf("Filename length is %hu\n", *fnlen);
#endif
*eflen = UNPACK_UB2(file_header, LOC_EFLEN);
#ifdef DEBUG
printf("Extra field length is %hu\n", *eflen);
#endif
*flags = UNPACK_UB2(file_header, LOC_EXTRA);
#ifdef DEBUG
printf("Flags are %#hx\n", *flags);
#endif
*method = UNPACK_UB2(file_header, LOC_COMP);
#ifdef DEBUG
printf("Compression method is %#hx\n", *method);
#endif
}
/*
Function name: new_filename
args: pbf Pointer to push back file handle. Used for reading input file.
len Length of file name to be read.
purpose: Read in the embedded file name from jar file.
returns: Pointer to newly allocated string containing file name.
*/
static char *new_filename(pb_file *pbf, ub4 len) {
char *filename;
if(!(filename = (char *) malloc(len + 1))) {
fprintf(stderr, "Malloc failed of filename\n");
fprintf(stderr, "Error: %s\n", strerror(errno));
}
pb_read(pbf, filename, len);
filename[len] = '\0';
#ifdef DEBUG
printf("filename is %s\n", filename);
#endif
return filename;
}
/*
Funtion name: read_string
args: pbf Pointer to push back file handle. Used for reading input file.
size Size of embedded file in bytes.
purpose: Create a string containing the contents of the embedded noncompressed file.
returns: Pointer to newly allocated string containing embedded file contents.
*/
static char *read_string(pb_file *pbf, int size) {
char *page;
if((page = (char *) malloc(size + 1))) {
pb_read(pbf, page, size);
page[size] = '\0';
}
else {
fprintf(stderr, "Malloc of page buffer failed.\n");
fprintf(stderr, "Error: %s\n", strerror(errno));
exit(1);
}
return page;
}
/*
Function name: extract_line
args: stream String containing the full contents of a file which is to be substringed
in order to provide line representing our grep output.
begin Index into stream which regular expression first matches.
end Index into stream which end of match to the regular expression.
b Pointer to the index of what will be the beginning of the line when
string is returned. Used for -b option.
purpose: Create a string that can be printed by jargrep from the long string stream.
The matching line that is printed out by jargrep is generated by this function.
returns: Pointer to newly allocated string containing matched expression.
*/
static char *extract_line(const char *stream, regoff_t begin, regoff_t end, int *b) {
int e;
int length;
char *retstr;
for(*b = begin; *b >= 0 && !iscntrl((unsigned char)stream[*b]); (*b)--);
(*b)++;
for(e = end; stream[e] == '\t' || !iscntrl((unsigned char)stream[e]); e++);
length = e - *b;
if((retstr = (char *) malloc(length + 1))) {
sprintf(retstr, "%d:", *b);
strncpy(retstr, &(stream[*b]), length);
retstr[length] = '\0';
}
else {
fprintf(stderr, "Malloc failed of output string.\n");
fprintf(stderr, "Error: %s\n", strerror(errno));
exit(1);
}
return retstr;
}
/*
Function name: chk_wrd
args: exp Pointer to compiled POSIX style regular expression of search target.
str String known to contain at least one match of exp.
purpose: Verify that the occurance of the regular expression in str occurs as a whole
word and not a substring of another word.
returns: TRUE if it is a word, FALSE of it is a substring.
*/
static int chk_wrd(regex_t *exp, const char *str) {
int wrd_fnd = FALSE;
int frnt_ok;
int bck_ok;
const char *str2;
regmatch_t match;
str2 = str;
frnt_ok = bck_ok = FALSE;
while(!wrd_fnd && !regexec(exp, str2, 1, &match, 0)) {
if(!match.rm_so && (str2 == str)) frnt_ok = TRUE;
else if(!isalnum((unsigned char)str2[match.rm_so - 1])
&& str2[match.rm_so - 1] != '_')
frnt_ok = TRUE;
else frnt_ok = FALSE;
if(frnt_ok) {
if(str2[match.rm_eo] == '\0') bck_ok = TRUE;
else if(!isalnum((unsigned char)str2[match.rm_eo])
&& str2[match.rm_eo] != '_')
bck_ok = TRUE;
else bck_ok = FALSE;
}
wrd_fnd = frnt_ok && bck_ok;
str2 = &(str2[match.rm_eo]);
}
return wrd_fnd;
}
/*
Function name: prnt_mtchs
args: exp Pointer to compiled POSIX style regular expression of search target.
filename String containing the name of the embedded file which matches have
been found in.
stream String containing the processed contents of the embedded jar file
represended with filename.
pmatch Array of regmatch_t matches into stream.
nl_offset Array of offsets of '\n' characters in stream. May be NULL if -n is
not set on command line.
num Number of matches in pmatch array.
lines Number of lines in file. Not set if -n is not set on command line.
options Bitwise flag containing flags set to represent the command line
options.
purpose: Control output of jargrep. Output is controlled by which options have been
set at the command line.
*/
static void prnt_mtchs(regex_t *exp, const char *filename, const char *stream, regmatch_t *pmatch, regmatch_t *nl_offset, int num, int lines, int options) {
int i;
int j = 0;
int ln_cnt;
int begin;
int o_begin;
char *str;
o_begin = -1;
ln_cnt = 0;
for(i = 0; i < num; i++) {
str = extract_line(stream, pmatch[i].rm_so, pmatch[i].rm_eo, &begin);
if(begin > o_begin) {
if(!(options & JG_WORD_EXPRESSIONS) || chk_wrd(exp, str)) {
ln_cnt++;
if(!(options & JG_PRINT_COUNT)) {
printf("%s:", filename);
if(options & JG_PRINT_LINE_NUMBER) {
for(; j < lines && nl_offset[j].rm_so < begin; j++);
printf("%d:", j + 1);
}
if(options & JG_PRINT_BYTEOFFSET) printf("%d:", begin);
printf("%s\n", str);
}
}
}
o_begin = begin;
free(str);
}
if(options & JG_PRINT_COUNT) printf("%s:%d\n", filename, ln_cnt);
}
/*
Function name: check_crc
args: pbf Pointer to pushback file pointer for jar file.
stream String containing the non modified contents fo the extraced file entry.
usize Size of file in bytes.
purpose: Verify the CRC matches that as what is stored in the jar file.
*/
static void check_crc(pb_file *pbf, const char *stream, ub4 usize) {
ub4 crc=0;
ub4 lcrc;
ub1 scratch[16];
crc = crc32(crc, NULL, 0);
crc = crc32(crc, (const unsigned char *)stream, usize);
if(pb_read(pbf, scratch, 16) != 16) {
perror("read");
exit(1);
}
if(UNPACK_UB4(scratch, 0) != 0x08074b50) {
fprintf(stderr, "Error! Missing data descriptor!\n");
exit(1);
}
lcrc = UNPACK_UB4(scratch, 4);
if(crc != lcrc){
fprintf(stderr, "Error! CRCs do not match! Got %x, expected %x\n",
crc, lcrc);
exit(1);
}
}
/*
Function name mk_ascii
args: stream String that contains the contents of the extraced file entry.
usize String size.
purpose: Make certain that the contents of the file are ASCII, not binary. This
permits grepping of binary files as well by converting non ASCII and control characters
into '\n'.
*/
static void mk_ascii(char *stream, size_t usize) {
size_t i;
for(i = 0; i < usize; i++)
if(stream[i] != '\t'
&& (iscntrl((unsigned char)stream[i])
|| (unsigned char) stream[i] >= 128))
stream[i] = '\n';
}
/*
Funtion name: fnd_match
args: exp Pointer to compiled POSIX style regular expression of search target.
str_stream String that contains the contents of the extracted file entry.
i Pointer to counter and index of matches.
purpose: Search str_stream for occurances of the regular expression exp and create
an array of matches.
returns: Pointer to newly allocated array of regmatch_t which gives indexes to start
and end of matches. NULL is returned upon no matches found.
*/
static regmatch_t *fnd_match(regex_t *exp, const char *str_stream, int *i) {
int regflag;
regmatch_t match;
regmatch_t *match_array;
regmatch_t *tmp;
match_array = NULL;
for(*i = 0, regflag = regexec(exp, str_stream, 1, &match, 0); !regflag;
regflag = regexec(exp, &(str_stream[match.rm_eo]), 1, &match, 0), (*i)++)
{
if((tmp = (regmatch_t *)
realloc(match_array, sizeof(regmatch_t) * ((*i) + 1))))
{
match_array = tmp;
if(*i) {
match.rm_so += match_array[(*i) - 1].rm_eo;
match.rm_eo += match_array[(*i) - 1].rm_eo;
}
match_array[*i] = match;
}
else {
fprintf(stderr, "Realloc of match_array failed.\n");
fprintf(stderr, "Error: %s\n", strerror(errno));
exit(1);
}
}
return match_array;
}
/*
Function name: cont_grep
args: exp Pointer to compiled POSIX style regular expression of search target.
nl_exp Pointer to compiled POSIX style regular expression of newlines. This
argument is NULL unless the -n option is used on the command line.
fd File descriptor of the jar file being grepped.
pbf Pointer to pushback file style file stream. This is for use with
the pushback.c file io funtions.
options Bitwise flag containing flags set to represent the command line options.
purpose: This function handles single entries in an open jar file. The header is
read and then the embeded file is extracted and grepped.
returns: FALSE upon failure, TRUE otherwise.
*/
static int cont_grep(regex_t *exp, regex_t *nl_exp, int fd, pb_file *pbf, int options) {
int retflag = TRUE;
int i;
int j;
ub4 csize;
ub4 usize;
ub2 fnlen;
ub2 eflen;
ub2 flags;
ub2 method;
ub1 file_header[30];
char *filename;
char *str_stream;
regmatch_t *match_array;
regmatch_t *nl_offsets=0;
if(pb_read(pbf, (file_header + 4), 26) != 26) {
perror("read");
retflag = FALSE;
}
else {
decd_siz(&csize, &usize, &fnlen, &eflen, &flags, &method, file_header);
filename = new_filename(pbf, fnlen);
lseek(fd, eflen, SEEK_CUR);
if(filename[fnlen - 1] != '/') {
str_stream = (method == 8 || (flags & 0x0008)) ?
(char *) inflate_string(pbf, &csize, &usize) :
read_string(pbf, csize);
if(flags & 0x008) check_crc(pbf, str_stream, usize);
mk_ascii(str_stream, usize);
match_array = fnd_match(exp, str_stream, &i);
if((options & JG_PRINT_LINE_NUMBER) && i)
nl_offsets = fnd_match(nl_exp, str_stream, &j);
prnt_mtchs(exp, filename, str_stream, match_array, nl_offsets, i, j, options);
if(match_array) free(match_array);
free(str_stream);
}
free(filename);
retflag = TRUE;
}
return retflag;
}
/*
Funtion name: jargrep
args: exp Pointer to compiled POSIX style regular expression of search target.
nl_exp Pointer to compiled regular expression for newlines or NULL. Only set
if -n option is present at command line.
jarfile Filename of jar file to be searched.
options Bitwise flag containing flags set to represent the command line options.
purpose: Open jar file. Check signatures. When right signature is found go to deeper
grep routine.
*/
static void jargrep(regex_t *exp, regex_t *nl_exp, const char *jarfile, int options){
int fd;
int floop = TRUE;
pb_file pbf;
ub1 scratch[16];
if((fd = open(jarfile, O_RDONLY)) == -1) {
if(!(options & JG_SUPRESS_ERROR))
fprintf(stderr, "Error reading file '%s': %s\n", jarfile, strerror(errno));
}
else {
pb_init(&pbf, fd);
do {
if(pb_read(&pbf, scratch, 4) != 4) {
perror("read");
floop = FALSE;
}
else {
switch (check_sig(scratch, &pbf)) {
case 0:
floop = cont_grep(exp, nl_exp, fd, &pbf, options);
break;
case 1:
floop = FALSE;
break;
case 2:
/* fall through continue */
;
}
}
} while(floop);
}
}
/* This is used to mark options with no short value. */
#define LONG_OPT(Num) ((Num) + 128)
#define OPT_HELP LONG_OPT (0)
static const struct option option_vec[] =
{
{ "help", no_argument, NULL, OPT_HELP },
{ "version", no_argument, NULL, 'V' },
{ NULL, no_argument, NULL, 0 }
};
/*
Funtion Name: main
args: argc number of in coming args.
argv array of strings.
purpose: Entry point of the program. Parse command line arguments and set options.
Set up regular expressions. Call grep routines for each file as input.
returns: 1 on error 0 on success.
*/
int main(int argc, char **argv) {
int c;
int retval = 0;
int fileindex;
int options = 0;
regex_t *regexp;
regex_t *nl_exp = NULL;
char *regexpstr = NULL;
while((c = getopt_long(argc, argv, "bce:insVw",
option_vec, NULL)) != -1) {
switch(c) {
case 'b':
options |= JG_PRINT_BYTEOFFSET;
break;
case 'c':
options |= JG_PRINT_COUNT;
break;
case 'e':
if(!(regexpstr = (char *) malloc(strlen(optarg) + 1))) {
fprintf(stderr, "Malloc failure.\n");
fprintf(stderr, "Error: %s\n", strerror(errno));
exit(1);
}
strcpy(regexpstr, optarg);
break;
case 'i':
options |= JG_IGNORE_CASE;
break;
case 'n':
options |= JG_PRINT_LINE_NUMBER;
break;
case 's':
options |= JG_SUPRESS_ERROR;
break;
case 'v':
options |= JG_INVERT;
break;
case 'V':
version ();
break;
case 'w':
options |= JG_WORD_EXPRESSIONS;
break;
case OPT_HELP:
help(argv[0]);
break;
default:
fprintf(stderr, Usage, argv[0]);
exit(1);
}
}
if(!regexpstr){
if(((argc - optind) >= 2)) {
regexpstr = argv[optind];
fileindex = optind + 1;
}
else {
fprintf(stderr, "Invalid arguments.\n");
fprintf(stderr, Usage, argv[0]);
exit(1);
}
}
else if((argc - optind) == 1) {
fileindex = optind;
}
else {
fprintf(stderr, "Invalid arguments.\n");
fprintf(stderr, Usage, argv[0]);
exit(1);
}
if(opt_valid(options)) {
regexp = create_regexp(regexpstr, options);
if(options & JG_PRINT_LINE_NUMBER) nl_exp = create_regexp("\n", 0);
init_inflation();
for(; fileindex < argc; fileindex++)
jargrep(regexp, nl_exp, argv[fileindex], options);
regfree(regexp);
if(options & JG_PRINT_LINE_NUMBER) regfree(nl_exp);
}
else {
retval = 1;
fprintf(stderr, "Error: Invalid combination of options.\n");
}
return retval;
}
void help(const char *filename)
{
printf (Usage, filename);
printf ("\
\n\
Search files in a jar file for a pattern.\n\
\n\
-b print byte offset of match\n\
-c print number of matches\n\
-i compare case-insensitively\n\
-n print line number of each match\n\
-s suppress error messages\n\
-w force PATTERN to match only whole words\n\
-e PATTERN use PATTERN as regular expression\n\
-V|--version print version number and exit\n\
--help print help\n\
");
exit (0);
}
void version ()
{
printf("grepjar (%s) %s\n\n", PACKAGE, VERSION);
printf("Copyright 1999, 2000, 2001 Bryan Burns\n");
printf("Copyright 2000 Cory Hollingsworth\n");
printf("Copyright 2006 Free Software Foundation\n");
printf("\
This is free software; see the source for copying conditions. There is NO\n\
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n");
exit (0);
}
/*
jargrep.h - header file for jargrep utility
Copyright (C) 2002 Free Software Foundation
Copyright (C) 2000 Cory Hollingsworth
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#define JG_PRINT_BYTEOFFSET 0x00000001
#define JG_PRINT_COUNT 0x00000002
#define JG_IGNORE_CASE 0x00000004
#define JG_PRINT_LINE_NUMBER 0x00000008
#define JG_SUPRESS_ERROR 0x00000010
#define JG_INVERT 0x00000020
#define JG_WORD_EXPRESSIONS 0x00000040
/*
jartool.c - main functions for fastjar utility
Copyright (C) 2002, 2004, 2005, 2006 Free Software Foundation
Copyright (C) 1999, 2000, 2001 Bryan Burns
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/*
Revision 1.10 2002/01/03 04:57:56 rodrigc
2001-01-02 Craig Rodrigues <rodrigc@gcc.gnu.org>
PR bootstrap/5117
* configure.in (AC_CHECK_HEADERS): Check for stdlib.h.
* Makefile.am: Move grepjar to bin_PROGRAMS.
* config.h.in: Regenerated.
* Makefile.in: Regenerated.
* aclocal.m4: Regenerated.
* jargrep.c: Eliminate some signed/unsigned and default
uninitialized warnings. Use HAVE_STDLIB_H instead of
STDC_HEADERS macro.
* jartool.c: Likewise.
* compress.c: Likewise.
Revision 1.9 2001/10/12 00:49:42 bryce
* jatool.c (extract_jar): Account for null termination when
determining whether to expand "filename".
Revision 1.8 2001/08/29 01:35:31 apbianco
2001-08-28 Alexandre Petit-Bianco <apbianco@redhat.com>
* jartool.c (add_to_jar): Return 1 if `stat' initialy failed.
Fixes PR java/3949.
(http://gcc.gnu.org/ml/gcc-patches/2001-08/msg01641.html)
Revision 1.7 2001/08/27 23:09:37 tromey
* jartool.c (jarfile): Remove length limitation.
(main): Use jt_strdup when initializing jarfile.
Revision 1.6 2001/07/04 18:33:53 tromey
Modified from patch by Julian Hall <jules@acris.co.uk>:
* jartool.c (errno): Conditionally declare.
(O_BINARY): Conditionally define.
(main): Use open, not creat. Use O_BINARY everywhere.
(make_manifest): Use O_BINARY.
(add_to_jar): Likewise.
Revision 1.5 2001/05/03 21:40:47 danglin
* jartool.c (jt_strdup): New function.
(get_next_arg): Use jt_strdup instead of strdup.
Revision 1.4 2000/12/28 21:47:37 robertl
2000-12-28 Robert Lipe <robertl@sco.com>
* jartool.c (MAXPATHLEN): Provide if not defined.
Revision 1.3 2000/12/14 18:45:35 ghazi
Warning fixes:
* compress.c: Include stdlib.h and compress.h.
(rcsid): Delete.
(report_str_error): Make static.
(ez_inflate_str): Delete unused variable. Add parens in if-stmt.
(hrd_inflate_str): Likewise.
* compress.h (init_compression, end_compression, init_inflation,
end_inflation): Prototype void arguments.
* dostime.c (rcsid): Delete.
* jargrep.c: Include ctype.h, stdlib.h, zlib.h and compress.h.
Make functions static. Cast ctype function argument to `unsigned
char'. Add parens in if-stmts. Constify.
(Usage): Change into a macro.
(jargrep): Remove unused parameter.
* jartool.c: Constify. Add parens in if-stmts. Align
signed/unsigned char pointers in functions calls using casts.
(rcsid): Delete.
(list_jar): Fix printf format specifier.
(usage): Chop long string into bits. Reformat.
* pushback.c (rcsid): Delete.
Revision 1.2 2000/12/13 18:11:57 tromey
* jartool.c (extract_jar): Use strchr, not index.
Revision 1.1 2000/12/09 03:08:23 apbianco
2000-12-08 Alexandre Petit-Bianco <apbianco@cygnus.com>
* fastjar: Imported.
Revision 1.5 2000/08/24 15:01:27 cory
Made certain that fastjar opened the jar file before trying to update it
with the -u option.
Revision 1.4 2000/08/24 13:39:21 cory
Changed +'s to |'s in jartool.c to insure there was no confusion with sign
when byte swapping. Better safe than sorry.
Revision 1.3 2000/08/23 19:42:17 cory
Added support for more Unix platforms. The following code has been hacked
to work on AIX, Solaris, True 64, and HP-UX.
Added bigendian check. Probably works on most big and little endian platforms
now.
Revision 1.2 1999/12/06 07:38:28 toast
fixed recursive archiving bug
Revision 1.1.1.1 1999/12/06 03:09:34 toast
initial checkin..
Revision 1.22 1999/10/12 19:45:13 burnsbr
adding patch to fix compat problem
Revision 1.21 1999/05/10 09:15:49 burnsbr
fixed manifest file version info
Revision 1.20 1999/05/10 08:53:16 burnsbr
*** empty log message ***
Revision 1.19 1999/05/10 08:30:39 burnsbr
added extract / listing code
Revision 1.18 1999/04/28 04:24:29 burnsbr
updated version
Revision 1.17 1999/04/28 04:21:23 burnsbr
added support for -C dir-changing flag.. Updated total compression display
Revision 1.16 1999/04/27 10:28:22 burnsbr
updated version string
Revision 1.15 1999/04/27 10:04:06 burnsbr
configure support
Revision 1.14 1999/04/27 08:56:14 burnsbr
added -V flag, better error messages
Revision 1.13 1999/04/26 02:35:21 burnsbr
changed all sorts of stuff.. compression now works 100%
Revision 1.12 1999/04/23 12:00:45 burnsbr
90% done with compression code
Revision 1.11 1999/04/22 04:12:57 burnsbr
finished first round of Manifest file support..
might need to do more, digest etc..
Revision 1.10 1999/04/22 02:35:23 burnsbr
added more manifest support, about 75% done now. Replaced all the
redundant shifts and bit-logic with a macro or two, making the code
easier to read.
Revision 1.9 1999/04/21 09:55:16 burnsbr
pulled out printfs
Revision 1.8 1999/04/21 02:58:01 burnsbr
started manifest code
Revision 1.7 1999/04/20 23:15:28 burnsbr
added patch sent by John Bley <jbb6@acpub.duke.edu>
Revision 1.6 1999/04/20 08:56:02 burnsbr
added GPL comment
Revision 1.5 1999/04/20 08:16:09 burnsbr
fixed verbose flag, did some optimization
Revision 1.4 1999/04/20 05:09:59 burnsbr
added rcsid variable
Revision 1.3 1999/04/20 05:08:54 burnsbr
fixed Log statement
*/
#include "config.h"
#include <zlib.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <stdio.h>
#include <sys/stat.h>
#include <sys/types.h>
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#ifndef MAXPATHLEN
#define MAXPATHLEN 1024
#endif
#ifdef HAVE_DIRENT_H
#include <dirent.h>
#endif
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
#include <string.h>
#include <errno.h>
#ifdef TM_IN_SYS_TIME
#include <sys/time.h>
#else
#include <time.h>
#endif
#include <getopt.h>
#include "jartool.h"
#include "zipfile.h"
#include "dostime.h"
#include "pushback.h"
#include "compress.h"
#include "shift.h"
/* Some systems have mkdir that takes a single argument. */
#ifdef MKDIR_TAKES_ONE_ARG
# define mkdir(a,b) mkdir(a)
#endif
#ifdef WORDS_BIGENDIAN
#define L2BI(l) ((l & 0xff000000) >> 24) | \
((l & 0x00ff0000) >> 8) | \
((l & 0x0000ff00) << 8) | \
((l & 0x000000ff) << 24);
#define L2BS(l) ((l & 0xff00) >> 8) | ((l & 0x00ff) << 8);
#endif
#ifndef errno
extern int errno;
#endif
#ifndef O_BINARY
#define O_BINARY 0
#endif
void usage(const char*);
void help(const char *);
void version(void);
void add_entry(struct zipentry *);
void init_headers(void);
int consume(pb_file *, int);
int list_jar(int, char**, int);
int extract_jar(int, char**, int);
int add_file_to_jar(int, int, const char*, struct stat*, int);
int add_to_jar(int, const char*, int);
int add_to_jar_with_dir(int, const char*, const char*, int);
int create_central_header(int);
int make_manifest(int, const char*, int);
int read_entries (int);
static void init_args(char **, int);
static char *get_next_arg (void);
static char *jt_strdup (char*);
static void expand_options (int *argcp, char ***argvp);
static struct zipentry *find_entry (const char *);
static int looks_like_dir (const char *);
/* global variables */
ub1 file_header[30];
ub1 data_descriptor[16];
int do_compress;
int seekable;
int verbose;
char *jarfile;
/* If non zero, then don't recurse in directory. Instead, add the
directory entry and relie on an explicit list of files to populate
the archive. This option isn't supported by the original jar tool. */
int use_explicit_list_only;
/* If non zero, then read the entry names from stdin. This option
isn't supported by the original jar tool. */
int read_names_from_stdin;
zipentry *ziplist; /* linked list of entries */
zipentry *ziptail; /* tail of the linked list */
int number_of_entries; /* number of entries in the linked list */
/* What we go by. */
const char *progname;
/* The offset of the end of the last zip entry. */
ub4 end_of_entries;
/* This is used to mark options with no short value. */
#define LONG_OPT(Num) ((Num) + 128)
#define OPT_HELP LONG_OPT (0)
/* This holds all options. */
#define OPTION_STRING "-ctxuvVf:m:C:0MiE@"
/* Define the MANIFEST content here to have it easier with calculations
below. This is for the case we create an empty MANIFEST.MF. */
#define MANIFEST_STR "Manifest-Version: 1.0\nCreated-By: "
#define MANIFEST_END "\n\n"
static const struct option options[] =
{
{ "help", no_argument, NULL, OPT_HELP },
{ "version", no_argument, NULL, 'V' },
{ NULL, no_argument, NULL, 0 }
};
int main(int argc, char **argv)
{
char *mfile = NULL;
int action = ACTION_NONE;
int manifest = TRUE;
int opt;
int jarfd = -1;
/* These are used to collect file names and `-C' options for the
second pass through the command line. */
int new_argc;
char **new_argv;
progname = argv[0];
do_compress = TRUE;
verbose = FALSE;
ziplist = NULL;
number_of_entries = 0;
if(argc < 2)
usage(argv[0]);
new_argc = 0;
new_argv = (char **) malloc (argc * sizeof (char *));
expand_options (&argc, &argv);
while ((opt = getopt_long (argc, argv, OPTION_STRING,
options, NULL)) != -1) {
switch(opt){
case 'C':
new_argv[new_argc++] = (char *) "-C";
/* ... fall through ... */
case 1:
/* File name or unparsed option, due to RETURN_IN_ORDER. */
new_argv[new_argc++] = optarg;
break;
case 'c':
action = ACTION_CREATE;
break;
case 't':
action = ACTION_LIST;
break;
case 'x':
action = ACTION_EXTRACT;
break;
case 'u':
action = ACTION_UPDATE;
break;
case 'v':
verbose = TRUE;
break;
case 'V':
version();
exit(0);
case 'f':
jarfile = optarg;
break;
case 'm':
mfile = optarg;
break;
case '0':
do_compress = FALSE;
break;
case 'M':
manifest = FALSE;
break;
case 'i':
action = ACTION_INDEX;
break;
case OPT_HELP:
help(argv[0]);
break;
/* The following options aren't supported by the original jar tool. */
case 'E':
use_explicit_list_only = TRUE;
break;
case '@':
read_names_from_stdin = TRUE;
break;
default:
usage(argv[0]);
}
}
if(verbose && action == ACTION_INDEX)
fprintf(stderr, "Warning: '-i' option is currently a no-op\n");
/* FIXME: implement -i option. */
if(action == ACTION_INDEX)
exit(0);
/* We might have seen `--'. In this case we want to make sure that
all following options are handled as file names. */
while (optind < argc)
new_argv[new_argc++] = argv[optind++];
new_argv[new_argc] = NULL;
if(action == ACTION_NONE){
fprintf(stderr, "%s: one of options -{ctxu} must be specified.\n",
progname);
usage(argv[0]);
}
/* Verify unsupported combinations and warn of the use of non
standard features */
if(verbose && use_explicit_list_only)
fprintf (stderr, "Warning: using non standard '-E' option\n");
if(verbose && read_names_from_stdin)
fprintf (stderr, "Warning: using non standard '-@' option\n");
if(read_names_from_stdin
&& (action != ACTION_CREATE && action != ACTION_UPDATE)){
fprintf(stderr, "%s: option '-@' is supported only with '-c' or '-u'.\n",
progname);
usage(argv[0]);
}
/* create the jarfile */
if(action == ACTION_CREATE){
if(jarfile){
jarfd = open(jarfile, O_CREAT | O_BINARY | O_WRONLY | O_TRUNC, 0666);
if(jarfd < 0){
fprintf(stderr, "%s: error opening %s for writing: %s\n", progname,
jarfile, strerror (errno));
exit(1);
}
/* We assume that the file is seekable */
seekable = TRUE;
} else {
jarfd = STDOUT_FILENO; /* jarfd is stdout otherwise */
/* standard out is not seekable */
seekable = FALSE;
/* don't want our output to be part of the jar file.. figured this one
out the hard way.. =P */
verbose = FALSE;
}
} else if(action == ACTION_LIST || action == ACTION_EXTRACT){
if(jarfile){
jarfd = open(jarfile, O_RDONLY | O_BINARY);
if(jarfd < 0){
fprintf(stderr, "%s: error opening %s for reading: %s\n", progname,
jarfile, strerror (errno));
exit(1);
}
seekable = TRUE;
} else {
jarfd = STDIN_FILENO; /* jarfd is standard in */
/* we assume that the stream isn't seekable for safety */
seekable = FALSE;
}
}
if (action == ACTION_UPDATE)
{
if (!jarfile)
{
fprintf (stderr, "%s: `-u' mode requires a file name\n",
argv[0]);
exit (1);
}
if ((jarfd = open (jarfile, O_RDWR | O_BINARY)) < 0)
{
fprintf (stderr, "Error opening %s for reading!\n", jarfile);
perror (jarfile);
exit (1);
}
/* Assert that jarfd is seekable. */
if (lseek (jarfd, 0, SEEK_CUR) == -1)
{
fprintf (stderr, "%s: %s is not seekable\n", argv[0], jarfile);
exit (1);
}
seekable = TRUE;
}
if(action == ACTION_CREATE || action == ACTION_UPDATE){
const char *arg;
init_headers();
if(do_compress)
init_compression();
if (action == ACTION_UPDATE)
{
if (read_entries (jarfd))
exit (1);
}
/* Add the META-INF/ directory and the manifest */
if(manifest && mfile)
make_manifest(jarfd, mfile, action == ACTION_UPDATE);
else if(manifest && action == ACTION_CREATE)
make_manifest(jarfd, NULL, FALSE);
init_args (new_argv, 0);
/* now we add the files to the archive */
while ((arg = get_next_arg ())){
if(!strcmp(arg, "-C")){
const char *dir_to_change = get_next_arg ();
const char *file_to_add = get_next_arg ();
if (!dir_to_change || !file_to_add) {
fprintf(stderr, "%s: error: missing argument for -C.\n", progname);
exit(1);
}
if (add_to_jar_with_dir(jarfd, dir_to_change, file_to_add,
action == ACTION_UPDATE))
{
fprintf(stderr,
"Error adding %s (in directory %s) to jar archive!\n",
file_to_add, dir_to_change);
exit(1);
}
} else {
if(add_to_jar(jarfd, arg, action == ACTION_UPDATE)){
fprintf(stderr, "Error adding %s to jar archive!\n", arg);
exit(1);
}
}
}
/* de-initialize the compression DS */
if(do_compress)
end_compression();
if (action == ACTION_UPDATE)
lseek (jarfd, end_of_entries, SEEK_SET);
create_central_header(jarfd);
#if ! (HAVE_FTRUNCATE || HAVE__CHSIZE)
#error neither ftruncate() or _chsize() available
#endif
/* Check if the file shrunk when we updated it. */
if (action == ACTION_UPDATE)
#if HAVE_FTRUNCATE
ftruncate (jarfd, lseek (jarfd, 0, SEEK_CUR));
#else
_chsize (jarfd, lseek (jarfd, 0, SEEK_CUR));
#endif
if (jarfd != STDIN_FILENO && close(jarfd) != 0) {
fprintf(stderr, "%s: error closing jar archive: %s\n",
progname, strerror (errno));
exit (1);
}
} else if(action == ACTION_LIST){
list_jar(jarfd, &new_argv[0], new_argc);
} else if(action == ACTION_EXTRACT){
extract_jar(jarfd, &new_argv[0], new_argc);
}
exit(0);
}
static int args_current_g;
static char **args_g;
static void
init_args(char **args, int current)
{
if(!read_names_from_stdin)
{
args_g = args;
args_current_g = current;
}
}
static char *
get_next_arg (void)
{
static int reached_end = 0;
if (reached_end)
return NULL;
if (args_g)
{
if (!args_g [args_current_g])
{
reached_end = 1;
return NULL;
}
return args_g [args_current_g++];
}
else
{
/* Read the name from stdin. Delimiters are '\n' and
'\r'. Reading EOF indicates that we don't have anymore file
names characters to read. */
char s [MAXPATHLEN];
int pos = 0;
/* Get rid of '\n' and '\r' first. */
while (1)
{
int c = getc (stdin);
if (c == '\n' || c == '\r')
continue;
else
{
if (c == EOF)
return NULL;
ungetc (c, stdin);
break;
}
}
while (1)
{
int c = getc (stdin);
/* Exit when we get a delimiter or don't have any characters
to read */
if (c == '\n'|| c == '\r'|| c == EOF)
break;
s [pos++] = (char) c;
}
if (pos)
{
s [pos] = '\0';
return jt_strdup (s);
}
else
return NULL;
}
}
void init_headers(void)
{
/* packing file header */
/* magic number */
file_header[0] = 0x50;
file_header[1] = 0x4b;
file_header[2] = 0x03;
file_header[3] = 0x04;
/* version number (Unix 1.0)*/
file_header[4] = 10;
file_header[5] = 0;
/* bit flag (normal deflation)*/
file_header[6] = 0x00;
file_header[7] = 0x00;
/* do_compression method (deflation) */
file_header[8] = 0;
file_header[9] = 0;
/* last mod file time (MS-DOS format) */
file_header[10] = 0;
file_header[11] = 0;
/* last mod file date (MS-DOS format) */
file_header[12] = 0;
file_header[13] = 0;
/* CRC 32 */
file_header[14] = 0;
file_header[15] = 0;
file_header[16] = 0;
file_header[17] = 0;
/* compressed size */
file_header[18] = 0;
file_header[19] = 0;
file_header[20] = 0;
file_header[21] = 0;
/* uncompressed size */
file_header[22] = 0;
file_header[23] = 0;
file_header[24] = 0;
file_header[25] = 0;
/* filename length */
file_header[26] = 0;
file_header[27] = 0;
/* extra field length */
file_header[28] = 0;
file_header[29] = 0;
/* Initialize the compression DS */
PACK_UB4(data_descriptor, 0, 0x08074b50);
}
void add_entry(struct zipentry *ze)
{
if(ziplist == NULL){
ziplist = ze;
ziptail = ziplist;
} else {
ziplist->next_entry = ze;
ziplist = ze;
}
number_of_entries++;
}
static struct zipentry *
find_entry (const char *fname)
{
struct zipentry *ze;
for (ze = ziptail; ze; ze = ze->next_entry)
{
if (!strcmp (ze->filename, fname))
return ze;
}
return NULL;
}
static int
looks_like_dir (const char *fname)
{
struct zipentry *ze;
size_t len = strlen (fname);
for (ze = ziptail; ze; ze = ze->next_entry)
{
if (strlen (ze->filename) > len
&& !strncmp (fname, ze->filename, len)
&& ze->filename[len] == '/')
return 1;
}
return 0;
}
/*
* Read the zip entries of an existing file, building `ziplist' as we go.
*/
int read_entries (int fd)
{
struct zipentry *ze;
ub1 intbuf[4];
ub1 header[46];
ub2 len;
ub2 count, i;
off_t offset;
if (lseek (fd, -22, SEEK_END) == -1)
{
fprintf (stderr, "%s: %s: can't seek file\n", progname, jarfile);
return 1;
}
if (read (fd, intbuf, 4) < 4)
{
perror (progname);
return 1;
}
/* Is there a zipfile comment? */
while (UNPACK_UB4(intbuf, 0) != 0x06054b50)
{
if (lseek (fd, -5, SEEK_CUR) == -1 ||
read (fd, intbuf, 4) != 4)
{
fprintf (stderr, "%s: can't find end of central directory: %s\n",
progname, strerror (errno));
return 1;
}
}
/* Skip disk numbers. */
if (lseek (fd, 6, SEEK_CUR) == -1)
{
perror (progname);
return 1;
}
/* Number of entries in the central directory. */
if (read (fd, intbuf, 2) != 2)
{
perror (progname);
return 1;
}
count = UNPACK_UB2(intbuf, 0);
if (lseek (fd, 4, SEEK_CUR) == -1)
{
perror (progname);
return 1;
}
/* Offset where the central directory begins. */
if (read (fd, intbuf, 4) != 4)
{
perror (progname);
return 1;
}
offset = UNPACK_UB4(intbuf, 0);
end_of_entries = offset;
if (lseek (fd, offset, SEEK_SET) != offset)
{
perror (progname);
return 1;
}
if (read (fd, header, 46) != 46)
{
fprintf (stderr, "%s: %s: unexpected end of file\n",
progname, jarfile);
return 1;
}
for (i = 0; i < count; i++)
{
if (UNPACK_UB4(header, 0) != 0x02014b50)
{
fprintf (stderr, "%s: can't find central directory header\n",
progname);
return 1;
}
ze = (struct zipentry *) malloc (sizeof (struct zipentry));
if (!ze)
{
perror (progname);
return 1;
}
memset (ze, 0, sizeof (struct zipentry));
ze->flags = UNPACK_UB2(header, CEN_FLAGS);
ze->mod_time = UNPACK_UB2(header, CEN_MODTIME);
ze->mod_date = UNPACK_UB2(header, CEN_MODDATE);
ze->crc = UNPACK_UB4(header, CEN_CRC);
ze->usize = UNPACK_UB4(header, CEN_USIZE);
ze->csize = UNPACK_UB4(header, CEN_CSIZE);
ze->offset = UNPACK_UB4(header, CEN_OFFSET);
ze->compressed = (header[CEN_COMP] || header[CEN_COMP+1]);
len = UNPACK_UB2(header, CEN_FNLEN);
ze->filename = (char *) malloc ((len+1) * sizeof (char));
if (!ze->filename)
{
perror (progname);
return 1;
}
if (read (fd, ze->filename, len) != len)
{
fprintf (stderr, "%s: %s: unexpected end of file\n",
progname, jarfile);
return 1;
}
len = UNPACK_UB4(header, CEN_EFLEN);
len += UNPACK_UB4(header, CEN_COMLEN);
if (lseek (fd, len, SEEK_CUR) == -1)
{
perror (progname);
return 1;
}
add_entry (ze);
if (i < count - 1)
{
if (read (fd, header, 46) != 46)
{
fprintf (stderr, "%s: %s: unexpected end of file\n",
progname, jarfile);
return 1;
}
}
}
lseek (fd, 0, SEEK_SET);
return 0;
}
int make_manifest(int jfd, const char *mf_name, int updating)
{
time_t current_time;
int nlen; /* length of file name */
int mod_time; /* file modification time */
struct zipentry *ze;
nlen = 9; /* trust me on this one */
memset((file_header + 12), '\0', 16); /*clear mod time, crc, size fields*/
current_time = time(NULL);
if(current_time == (time_t)-1){
perror("time");
exit(1);
}
mod_time = unix2dostime(&current_time);
PACK_UB2(file_header, LOC_EXTRA, 0);
PACK_UB2(file_header, LOC_COMP, 0);
PACK_UB2(file_header, LOC_FNLEN, nlen);
PACK_UB4(file_header, LOC_MODTIME, mod_time);
if(verbose)
printf("adding: META-INF/ (in=0) (out=0) (stored 0%%)\n");
ze = (zipentry*)malloc(sizeof(zipentry));
if(ze == NULL){
perror("malloc");
exit(1);
}
memset(ze, 0, sizeof(zipentry)); /* clear all the fields*/
ze->filename = (char*)malloc((nlen + 1) * sizeof(char) + 1);
strcpy(ze->filename, "META-INF/");
ze->filename[nlen] = '\0';
ze->offset = lseek(jfd, 0, SEEK_CUR);
ze->mod_time = (ub2)(mod_time & 0x0000ffff);
ze->mod_date = (ub2)((mod_time & 0xffff0000) >> 16);
ze->compressed = FALSE;
add_entry(ze);
write(jfd, file_header, 30);
write(jfd, "META-INF/", nlen);
/* if the user didn't specify an external manifest file... */
if(mf_name == NULL){
int mf_len = strlen(MANIFEST_STR) + strlen(VERSION) + strlen(MANIFEST_END);
char *mf;
if((mf = (char *) malloc(mf_len + 1))) {
uLong crc;
sprintf(mf, "%s%s%s", MANIFEST_STR, VERSION, MANIFEST_END);
crc = crc32(0L, Z_NULL, 0);
crc = crc32(crc, (const unsigned char *)mf, mf_len);
nlen = 20; /* once again, trust me */
PACK_UB2(file_header, LOC_EXTRA, 0);
PACK_UB2(file_header, LOC_COMP, 0);
PACK_UB2(file_header, LOC_FNLEN, nlen);
PACK_UB4(file_header, LOC_USIZE, mf_len);
memcpy((file_header + LOC_CSIZE), (file_header + LOC_USIZE), 4);
PACK_UB4(file_header, LOC_CRC, crc);
if(verbose)
printf("adding: META-INF/MANIFEST.MF (in=56) (out=56) (stored 0%%)\n");
ze = (zipentry*)malloc(sizeof(zipentry));
if(ze == NULL){
perror("malloc");
exit(1);
}
memset(ze, 0, sizeof(zipentry)); /* clear all the fields*/
ze->filename = (char*)malloc((nlen + 1) * sizeof(char) + 1);
strcpy(ze->filename, "META-INF/MANIFEST.MF");
ze->filename[nlen] = '\0';
ze->offset = lseek(jfd, 0, SEEK_CUR);
ze->mod_time = (ub2)(mod_time & 0x0000ffff);
ze->mod_date = (ub2)((mod_time & 0xffff0000) >> 16);
ze->crc = crc;
ze->csize = mf_len;
ze->usize = ze->csize;
ze->compressed = FALSE;
add_entry(ze);
write(jfd, file_header, 30);
write(jfd, "META-INF/MANIFEST.MF", nlen);
write(jfd, mf, mf_len);
free(mf);
}
else {
printf("malloc errror\n");
exit(-1);
}
} else {
int mfd;
struct stat statbuf;
stat(mf_name, &statbuf);
if(!S_ISREG(statbuf.st_mode)){
fprintf(stderr, "Invalid manifest file specified.\n");
exit(1);
}
mfd = open(mf_name, O_RDONLY | O_BINARY);
if(mfd < 0){
fprintf(stderr, "Error opening %s.\n", mf_name);
exit(1);
}
if(add_file_to_jar(jfd, mfd, "META-INF/MANIFEST.MF", &statbuf, updating)){
perror("error writing to jar");
exit(1);
}
}
return 0;
}
/* Implements -C by wrapping add_to_jar. new_dir is the directory
to switch to.
`updating', if nonzero, will indicate that we are updating an
existing file, and will need to take special care. If set, we will
also expect that the linked list of zip entries will be filled in
with the jar file's current contents.
*/
int
add_to_jar_with_dir (int fd, const char* new_dir, const char* file,
const int updating)
{
int retval;
char old_dir[MAXPATHLEN];
if (getcwd(old_dir, MAXPATHLEN) == NULL) {
perror("getcwd");
return 1;
}
if (chdir(new_dir) == -1) {
perror(new_dir);
return 1;
}
retval=add_to_jar(fd, file, updating);
if (chdir(old_dir) == -1) {
perror(old_dir);
return 1;
}
return retval;
}
int
add_to_jar (int fd, const char *file, const int updating)
{
struct stat statbuf;
DIR *dir;
struct dirent *de;
zipentry *ze;
zipentry *existing = NULL;
int stat_return;
/* This is a quick compatibility fix -- Simon Weijgers <simon@weijgers.com>
* It fixes this:
* "normal" jar : org/apache/java/io/LogRecord.class
* fastjar : ./org/apache/java/io/LogRecord.class
* Fastjar's preservation of the ./'s makes the jarfile unusuable for use
* with both kaffe-1.0b4 and JDK.
*/
while (*file=='.' && *(file+1)=='/')
file+=2;
if(jarfile && !strcmp(file, jarfile)){
if(verbose)
printf("skipping: %s\n", file);
return 0; /* we don't want to add ourselves.. */
}
stat_return = stat(file, &statbuf);
if(stat_return == -1){
perror(file);
return 1;
} else if(S_ISDIR(statbuf.st_mode)){
char *fullname;
char *t_ptr;
int nlen;
unsigned long mod_time;
dir = opendir(file);
if(dir == NULL){
perror("opendir");
return 1;
}
nlen = strlen(file) + 256;
fullname = (char*)malloc(nlen * sizeof(char));
memset(fullname, 0, (nlen * sizeof(char)));
if(fullname == NULL){
fprintf(stderr, "Filename is NULL!\n");
return 1;
}
strcpy(fullname, file);
nlen = strlen(file);
if(fullname[nlen - 1] != '/'){
fullname[nlen] = '/';
t_ptr = (fullname + nlen + 1);
} else
t_ptr = (fullname + nlen);
memset((file_header + 12), '\0', 16); /*clear mod time, crc, size fields*/
nlen = (t_ptr - fullname);
mod_time = unix2dostime(&statbuf.st_mtime);
PACK_UB2(file_header, LOC_EXTRA, 0);
PACK_UB2(file_header, LOC_COMP, 0);
PACK_UB2(file_header, LOC_FNLEN, nlen);
PACK_UB4(file_header, LOC_MODTIME, mod_time);
ze = (zipentry*)malloc(sizeof(zipentry));
if(ze == NULL){
perror("malloc");
exit(1);
}
memset(ze, 0, sizeof(zipentry)); /* clear all the fields*/
ze->filename = (char*)malloc((nlen + 1) * sizeof(char) + 1);
strcpy(ze->filename, fullname);
ze->filename[nlen] = '\0';
ze->offset = lseek(fd, 0, SEEK_CUR);
ze->mod_time = (ub2)(mod_time & 0x0000ffff);
ze->mod_date = (ub2)((mod_time & 0xffff0000) >> 16);
ze->compressed = FALSE;
if (updating)
{
if ((existing = find_entry (ze->filename)) != NULL)
{
if (existing->usize != 0)
{
/* XXX overwriting non-directory with directory? */
fprintf (stderr, "%s: %s: can't overwrite non-directory with directory\n",
progname, fullname);
return 1;
}
}
if (lseek (fd, end_of_entries, SEEK_SET) == -1)
{
fprintf (stderr, "%s %d\n", __FILE__, __LINE__);
perror ("lseek");
return 1;
}
}
if (!existing)
{
add_entry (ze);
write (fd, file_header, 30);
write (fd, fullname, nlen);
end_of_entries = lseek (fd, 0, SEEK_CUR);
if (verbose)
printf ("adding: %s (in=%d) (out=%d) (stored 0%%)\n", fullname, 0, 0);
}
while(!use_explicit_list_only && (de = readdir(dir)) != NULL){
if(de->d_name[0] == '.')
continue;
if(jarfile && !strcmp(de->d_name, jarfile)){
/* we don't want to add ourselves. Believe me */
if(verbose)
printf("skipping: %s\n", de->d_name);
continue;
}
strcpy(t_ptr, de->d_name);
if (add_to_jar(fd, fullname, updating)) {
fprintf(stderr, "Error adding file to jar!\n");
return 1;
}
}
free(fullname);
closedir(dir);
} else if(S_ISREG(statbuf.st_mode)){
int add_fd;
add_fd = open(file, O_RDONLY | O_BINARY);
if(add_fd < 0){
fprintf(stderr, "Error opening %s.\n", file);
return 1;
}
if(add_file_to_jar(fd, add_fd, file, &statbuf, updating)){
fprintf(stderr, "Error adding file to jar!\n");
return 1;
}
} else {
fprintf(stderr, "Illegal file specified: %s\n", file);
}
return 0;
}
int add_file_to_jar(int jfd, int ffd, const char *fname, struct stat *statbuf,
const int updating)
{
unsigned short file_name_length;
unsigned long mod_time;
ub1 rd_buff[RDSZ];
uLong crc = 0;
off_t offset = 0;
int rdamt;
struct zipentry *ze;
struct zipentry *existing = NULL;
if (updating)
{
existing = find_entry (fname);
if (existing && looks_like_dir (fname))
{
fprintf (stderr, "%s: %s is a directory in the archive\n",
progname, fname);
return 1;
}
}
mod_time = unix2dostime(&(statbuf->st_mtime));
file_name_length = strlen(fname);
if(!seekable && !do_compress){
crc = crc32(0L, Z_NULL, 0);
while((rdamt = read(ffd, rd_buff, RDSZ)) != 0)
crc = crc32(crc, rd_buff, rdamt);
lseek(ffd, 0, SEEK_SET);
}
/* data descriptor */
if(!seekable && do_compress){
PACK_UB2(file_header, LOC_EXTRA, 8);
} else {
PACK_UB2(file_header, LOC_EXTRA, 0);
}
if(do_compress){
PACK_UB2(file_header, LOC_COMP, 8);
} else {
PACK_UB2(file_header, LOC_COMP, 0);
}
PACK_UB4(file_header, LOC_MODTIME, mod_time);
PACK_UB2(file_header, LOC_FNLEN, file_name_length);
if(!seekable && !do_compress){
PACK_UB4(file_header, LOC_CRC, crc);
PACK_UB4(file_header, LOC_USIZE, statbuf->st_size);
PACK_UB4(file_header, LOC_CSIZE, statbuf->st_size);
} else
memset((file_header + LOC_CRC), '\0', 12); /* clear crc/usize/csize */
ze = (zipentry*)malloc(sizeof(zipentry));
if(ze == NULL){
perror("malloc");
exit(1);
}
memset(ze, 0, sizeof(zipentry)); /* clear all the fields*/
ze->filename = (char*)malloc((file_name_length + 1) * sizeof(char));
strcpy(ze->filename, fname);
ze->mod_time = (ub2)(mod_time & 0x0000ffff);
ze->mod_date = (ub2)((mod_time & 0xffff0000) >> 16);
if(!seekable && !do_compress)
ze->crc = crc;
ze->csize = statbuf->st_size;
ze->usize = ze->csize;
if (existing)
ze->offset = existing->offset;
else if (updating)
ze->offset = end_of_entries;
else
ze->offset = lseek(jfd, 0, SEEK_CUR);
if(do_compress)
ze->compressed = TRUE;
else
ze->compressed = FALSE;
if (!existing)
add_entry(ze);
if (updating && lseek (jfd, ze->offset, SEEK_SET) < 0)
{
perror ("lseek");
return 1;
}
/* We can safely write the header here, since it will be the same size
as before */
/* Write the local header */
write(jfd, file_header, 30);
/* write the file name to the zip file */
write(jfd, fname, file_name_length);
if(verbose){
if (existing)
printf ("updating: %s ", fname);
else
printf("adding: %s ", fname);
fflush(stdout);
}
if(do_compress){
/* compress the file */
compress_file(ffd, jfd, ze, existing);
} else {
/* If we are not writing the last entry, make space for it. */
if (existing && existing->next_entry)
{
if (ze->usize > existing->usize)
{
if (shift_down (jfd, existing->next_entry->offset,
ze->usize - existing->usize, existing->next_entry))
{
fprintf (stderr, "%s: %s\n", progname, strerror (errno));
return 1;
}
}
}
/* Write the contents of the file (uncompressed) to the zip file */
/* calculate the CRC as we go along */
ze->crc = crc32(0L, Z_NULL, 0);
while((rdamt = read(ffd, rd_buff, RDSZ)) != 0){
ze->crc = crc32(ze->crc, rd_buff, rdamt);
if(write(jfd, rd_buff, rdamt) != rdamt){
perror("write");
return 0;
}
}
}
close(ffd);
/* write out data descriptor */
PACK_UB4(data_descriptor, 4, ze->crc);
PACK_UB4(data_descriptor, 8, ze->csize);
PACK_UB4(data_descriptor, 12, ze->usize);
/* we need to seek back and fill the header */
if(seekable){
offset = (ze->csize + strlen(ze->filename) + 16);
if(lseek(jfd, -offset, SEEK_CUR) == (off_t)-1){
perror("lseek");
exit(1);
}
if(write(jfd, (data_descriptor + 4), 12) != 12){
perror("write");
return 0;
}
offset -= 12;
if(lseek(jfd, offset, SEEK_CUR) == (off_t)-1){
perror("lseek");
exit(1);
}
} else if(do_compress){
/* Sun's jar tool will only allow a data descriptor if the entry is
compressed, but we'll save 16 bytes/entry if we only use it when
we can't seek back on the file */
/* Technically, you CAN'T have a data descriptor unless the data
part has an obvious end, which DEFLATED does. Otherwise, there
would not be any way to determine where the data descriptor is.
Store an uncompressed file that ends with 0x504b0708, and see.
-- csm */
if(write(jfd, data_descriptor, 16) != 16){
perror("write");
return 0;
}
}
if (existing)
{
int dd = (existing->flags & (1 << 3)) ? 12 : 0;
if (existing->next_entry && ze->csize < existing->csize + dd)
{
if (shift_up (jfd, existing->next_entry->offset,
existing->csize + dd - ze->csize,
existing->next_entry))
{
perror (progname);
return 1;
}
}
/* Replace the existing entry data with this entry's. */
existing->csize = ze->csize;
existing->usize = ze->usize;
existing->crc = ze->crc;
existing->mod_time = ze->mod_time;
existing->mod_date = ze->mod_date;
free (ze->filename);
free (ze);
}
else if (updating)
end_of_entries = lseek (jfd, 0, SEEK_CUR);
if(verbose)
printf("(in=%d) (out=%d) (%s %d%%)\n",
(int)ze->usize, (int)ze->csize,
(do_compress ? "deflated" : "stored"),
(do_compress ? ((int)((1 - ze->csize/(float)ze->usize) * 100)) : 0));
return 0;
}
int create_central_header(int fd){
ub1 header[46];
ub1 end_header[22];
int start_offset;
int dir_size;
int total_in = 0, total_out = 22;
zipentry *ze;
/* magic number */
header[0] = 'P';
header[1] = 'K';
header[2] = 1;
header[3] = 2;
/* version made by */
header[4] = 10;
header[5] = 0;
/* version needed to extract */
header[6] = 10;
header[7] = 0;
/* bit flag */
header[8] = 0;
header[9] = 0;
/* compression method */
header[10] = 0;
header[11] = 0;
/* file mod time */
header[12] = 0;
header[13] = 0;
/* file mod date */
header[14] = 0;
header[15] = 0;
/* crc 32 */
header[16] = 0;
header[17] = 0;
header[18] = 0;
header[19] = 0;
/* compressed size */
header[20] = 0;
header[21] = 0;
header[22] = 0;
header[23] = 0;
/* uncompressed size */
header[24] = 0;
header[25] = 0;
header[26] = 0;
header[27] = 0;
/* filename length */
header[28] = 0;
header[29] = 0;
/* extra field length */
header[30] = 0;
header[31] = 0;
/* file comment length */
header[32] = 0;
header[33] = 0;
/* disk number start */
header[34] = 0;
header[35] = 0;
/* internal file attribs */
header[36] = 0;
header[37] = 0;
/* external file attribs */
header[38] = 0;
header[39] = 0;
header[40] = 0;
header[41] = 0;
/* relative offset of local header */
header[42] = 0;
header[43] = 0;
header[44] = 0;
header[45] = 0;
start_offset = lseek(fd, 0, SEEK_CUR);
for(ze = ziptail; ze != NULL; ze = ze->next_entry){
total_in += ze->usize;
total_out += ze->csize + 76 + strlen(ze->filename) * 2;
if(ze->compressed){
PACK_UB2(header, CEN_COMP, 8);
} else {
PACK_UB2(header, CEN_COMP, 0);
}
PACK_UB2(header, CEN_MODTIME, ze->mod_time);
PACK_UB2(header, CEN_MODDATE, ze->mod_date);
PACK_UB4(header, CEN_CRC, ze->crc);
PACK_UB4(header, CEN_CSIZE, ze->csize);
PACK_UB4(header, CEN_USIZE, ze->usize);
PACK_UB2(header, CEN_FNLEN, strlen(ze->filename));
PACK_UB4(header, CEN_OFFSET, ze->offset);
write(fd, header, 46);
write(fd, ze->filename, strlen(ze->filename));
}
dir_size = lseek(fd, 0, SEEK_CUR) - start_offset;
/* magic number */
end_header[0] = 0x50;
end_header[1] = 0x4b;
end_header[2] = 0x05;
end_header[3] = 0x06;
/* number of this disk */
end_header[4] = 0;
end_header[5] = 0;
/* number of disk w/ start of central header */
end_header[6] = 0;
end_header[7] = 0;
/* total number of entries in central dir on this disk*/
PACK_UB2(end_header, 8, number_of_entries);
/* total number of entries in central dir*/
PACK_UB2(end_header, 10, number_of_entries);
/* size of central dir. */
PACK_UB4(end_header, 12, dir_size);
/* offset of start of central dir */
PACK_UB4(end_header, 16, start_offset);
/* zipfile comment length */
end_header[20] = 0;
end_header[21] = 0;
write(fd, end_header, 22);
if(verbose)
printf("Total:\n------\n(in = %d) (out = %d) (%s %d%%)\n",
total_in,
total_out,
(do_compress ? "deflated" : "stored"),
(int)((1 - (total_out / (float)total_in)) * 100)
);
return 0;
}
int extract_jar(int fd, char **files, int file_num){
int rdamt;
int out_a, in_a;
ub4 signature;
ub4 csize;
ub4 crc;
ub2 fnlen;
ub2 eflen;
ub2 flags;
ub2 method;
ub1 *filename = NULL;
int filename_len = 0;
ub4 rd_buff[RDSZ];
pb_file pbf;
ub1 scratch[16];
zipentry ze;
int f_fd;
int dir;
int handle;
int j;
init_inflation();
pb_init(&pbf, fd);
for(;;){
f_fd = 0;
crc = 0;
ze.crc = 0;
dir = FALSE; /* by default, the file isn't a dir */
handle = TRUE; /* by default we'll extract/create the file */
if((rdamt = pb_read(&pbf, scratch, 4)) != 4){
perror("read");
break;
}
signature = UNPACK_UB4(scratch, 0);
#ifdef DEBUG
printf("signature is %x\n", signature);
#endif
if(signature == 0x08074b50){
#ifdef DEBUG
printf("skipping data descriptor\n");
#endif
pb_read(&pbf, scratch, 12);
continue;
} else if(signature == 0x02014b50){
#ifdef DEBUG
printf("Central header reached.. we're all done!\n");
#endif
break;
}else if(signature != 0x04034b50){
printf("Ick! %#x\n", signature);
break;
}
if((rdamt = pb_read(&pbf, (file_header + 4), 26)) != 26){
perror("read");
break;
}
csize = UNPACK_UB4(file_header, LOC_CSIZE);
#ifdef DEBUG
printf("Compressed size is %u\n", csize);
#endif
fnlen = UNPACK_UB2(file_header, LOC_FNLEN);
#ifdef DEBUG
printf("Filename length is %hu\n", fnlen);
#endif
eflen = UNPACK_UB2(file_header, LOC_EFLEN);
#ifdef DEBUG
printf("Extra field length is %hu\n", eflen);
#endif
flags = UNPACK_UB2(file_header, LOC_EXTRA);
#ifdef DEBUG
printf("Flags are %#hx\n", flags);
#endif
method = UNPACK_UB2(file_header, LOC_COMP);
#ifdef DEBUG
printf("Compression method is %#hx\n", method);
#endif
/* if there isn't a data descriptor */
if(!(flags & 0x0008)){
crc = UNPACK_UB4(file_header, LOC_CRC);
#ifdef DEBUG
printf("CRC is %x\n", crc);
#endif
}
if(filename_len < fnlen + 1){
if(filename != NULL)
free(filename);
filename = malloc(sizeof(ub1) * (fnlen + 1));
filename_len = fnlen + 1;
}
pb_read(&pbf, filename, fnlen);
filename[fnlen] = '\0';
#ifdef DEBUG
printf("filename is %s\n", filename);
#endif
if(file_num > 0){
handle = FALSE;
for(j = 0; j < file_num; j++)
if(strcmp(files[j], (const char *)filename) == 0){
handle = TRUE;
break;
}
}
if(!handle)
f_fd = -1;
/* OK, there is some directory information in the file. Nothing to do
but ensure the directory(s) exist, and create them if they don't.
What a pain! */
if(strchr((const char *)filename, '/') != NULL && handle){
/* Loop through all the directories in the path, (everything w/ a '/') */
const ub1 *start = filename;
char *tmp_buff;
struct stat sbuf;
tmp_buff = malloc(sizeof(char) * strlen((const char *)filename));
for(;;){
const ub1 *idx = (const unsigned char *)strchr((const char *)start, '/');
if(idx == NULL)
break;
else if(idx == start){
start++;
continue;
}
start = idx + 1;
strncpy(tmp_buff, (const char *)filename, (idx - filename));
tmp_buff[(idx - filename)] = '\0';
#ifdef DEBUG
printf("checking the existance of %s\n", tmp_buff);
#endif
if(stat(tmp_buff, &sbuf) < 0){
if(errno != ENOENT){
perror("stat");
exit(1);
}
} else if(S_ISDIR(sbuf.st_mode)){
#ifdef DEBUG
printf("Directory exists\n");
#endif
continue;
}else {
fprintf(stderr, "Hmmm.. %s exists but isn't a directory!\n",
tmp_buff);
exit(1);
}
#ifdef DEBUG
printf("Making directory..\n");
#endif
if(mkdir(tmp_buff, 0755) < 0){
perror("mkdir");
exit(1);
}
if(verbose && handle)
printf("%10s: %s/\n", "created", tmp_buff);
}
/* only a directory */
if(strlen((const char *)start) == 0)
dir = TRUE;
#ifdef DEBUG
printf("Leftovers are \"%s\" (%d)\n", start, strlen((const char *)start));
#endif
/* If the entry was just a directory, don't write to file, etc */
if(strlen((const char *)start) == 0)
f_fd = -1;
free(tmp_buff);
}
if(f_fd != -1 && handle){
f_fd = open((const char *)filename,
O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0644);
if(f_fd < 0){
fprintf(stderr, "Error extracting JAR archive!\n");
perror((const char *)filename);
exit(1);
}
}
if(method != 8 && flags & 0x0008){
fprintf(stderr, "Error in JAR file! (not compressed but data desc.)\n");
exit(1);
}
if (eflen > 0)
consume(&pbf, eflen);
if(method == 8 || flags & 0x0008){
inflate_file(&pbf, f_fd, &ze);
} else {
#ifdef DEBUG
printf("writing stored data.. (%d bytes)\n", csize);
#endif
out_a = 0;
in_a = csize;
ze.crc = crc32(ze.crc, NULL, 0); /* initialize the crc */
while(out_a < (int)csize){
rdamt = (in_a > RDSZ ? RDSZ : in_a);
if(pb_read(&pbf, rd_buff, rdamt) != rdamt){
perror("read");
exit(1);
}
ze.crc = crc32(ze.crc, (Bytef*)rd_buff, rdamt);
if(f_fd >= 0)
write(f_fd, rd_buff, rdamt);
out_a += rdamt;
in_a -= rdamt;
#ifdef DEBUG
printf("%d bytes written\n", out_a);
#endif
}
}
/* if there is a data descriptor left, compare the CRC */
if(flags & 0x0008){
if(pb_read(&pbf, scratch, 16) != 16){
perror("read");
exit(1);
}
signature = UNPACK_UB4(scratch, 0);
if(signature != 0x08074b50){
fprintf(stderr, "Error! Missing data descriptor!\n");
exit(1);
}
crc = UNPACK_UB4(scratch, 4);
}
if(crc != ze.crc){
fprintf(stderr, "Error! CRCs do not match! Got %x, expected %x\n",
ze.crc, crc);
exit(1);
}
close(f_fd);
if(verbose && dir == FALSE && handle)
printf("%10s: %s\n",
(method == 8 ? "inflated" : "extracted"),
filename);
}
return 0;
}
int list_jar(int fd, char **files, int file_num){
ub4 signature;
ub4 csize;
ub4 usize;
ub4 mdate;
ub4 tmp;
ub2 fnlen;
ub2 eflen;
ub2 clen;
ub2 flags;
ub2 method;
ub2 cen_size;
ub1 *filename = NULL;
ub1 scratch[16];
ub1 cen_header[46];
int filename_len = 0;
off_t size;
int i, j;
time_t tdate;
struct tm *s_tm;
char ascii_date[31];
zipentry ze;
#ifdef DEBUG
printf("Listing jar file, looking for %d files\n", file_num);
#endif
/* This should be the start of the central-header-end section */
if(seekable){
if(lseek(fd, -22, SEEK_END) == (off_t)-1){
perror("lseek");
exit(1);
}
if(read(fd, &tmp, sizeof(ub4)) != 4){
perror("read");
exit(1);
}
#ifdef WORDS_BIGENDIAN
tmp = L2BI(tmp);
#endif
if(tmp != 0x06054b50){
fprintf(stderr, "Error in JAR file format. zip-style comment?\n");
exit(1);
}
if(lseek(fd, 6, SEEK_CUR) == (off_t)-1){
perror("lseek");
exit(1);
}
if(read(fd, &cen_size, 2) != 2){
perror("read");
exit(1);
}
#ifdef WORDS_BIGENDIAN
cen_size = L2BS(cen_size);
#endif
/* printf("%hu entries in central header\n", cen_size); */
if(lseek(fd, 4, SEEK_CUR) == (off_t)-1){
perror("lseek");
exit(1);
}
if(read(fd, &tmp, 4) != 4){
perror("read");
exit(1);
}
#ifdef WORDS_BIGENDIAN
tmp = L2BI(tmp);
#endif
/* printf("Central header offset = %d\n", tmp); */
if(lseek(fd, tmp, SEEK_SET) != (int)tmp){
perror("lseek");
exit(1);
}
/* Loop through the entries in the central header */
for(i = 0; i < cen_size; i++){
if(read(fd, &cen_header, 46) != 46){
perror("read");
exit(1);
}
signature = UNPACK_UB4(cen_header, 0);
if(signature != 0x02014b50){
fprintf(stderr, "Error in JAR file! Cannot locate central header!\n");
exit(1);
}
usize = UNPACK_UB4(cen_header, CEN_USIZE);
fnlen = UNPACK_UB2(cen_header, CEN_FNLEN);
eflen = UNPACK_UB2(cen_header, CEN_EFLEN);
clen = UNPACK_UB2(cen_header, CEN_COMLEN);
/* If we're providing verbose output, we need to make an ASCII
* formatted version of the date. */
if(verbose){
mdate = UNPACK_UB4(cen_header, CEN_MODTIME);
tdate = dos2unixtime(mdate);
s_tm = localtime(&tdate);
strftime(ascii_date, 30, "%a %b %d %H:%M:%S %Z %Y", s_tm);
ascii_date[30] = '\0';
}
if(filename_len < fnlen + 1){
if(filename != NULL)
free(filename);
filename = malloc(sizeof(ub1) * (fnlen + 1));
filename_len = fnlen + 1;
}
if(read(fd, filename, fnlen) != fnlen){
perror("read");
exit(1);
}
filename[fnlen] = '\0';
/* if the user specified a list of files on the command line,
we'll only display those, otherwise we'll display everything */
if(file_num > 0){
for(j = 0; j < file_num; j++)
if(strcmp(files[j], (const char *)filename) == 0){
if(verbose)
printf("%6d %s %s\n", usize, ascii_date, filename);
else
printf("%s\n", filename);
break;
}
} else {
if(verbose)
printf("%6d %s %s\n", usize, ascii_date, filename);
else
printf("%s\n", filename);
}
size = eflen + clen;
if(size > 0){
if(lseek(fd, size, SEEK_CUR) == (off_t)-1){
perror("lseek");
exit(1);
}
}
}
} else {
/* the file isn't seekable.. evil! */
pb_file pbf;
pb_init(&pbf, fd);
init_inflation();
for(;;){
if(pb_read(&pbf, scratch, 4) != 4){
perror("read");
break;
}
signature = UNPACK_UB4(scratch, 0);
#ifdef DEBUG
printf("signature is %x\n", signature);
#endif
if(signature == 0x08074b50){
#ifdef DEBUG
printf("skipping data descriptor\n");
#endif
pb_read(&pbf, scratch, 12);
continue;
} else if(signature == 0x02014b50){
#ifdef DEBUG
printf("Central header reached.. we're all done!\n");
#endif
break;
}else if(signature != 0x04034b50){
#ifdef DEBUG
printf("Ick! %#x\n", signature);
#endif
break;
}
if(pb_read(&pbf, (file_header + 4), 26) != 26){
perror("read");
break;
}
csize = UNPACK_UB4(file_header, LOC_CSIZE);
#ifdef DEBUG
printf("Compressed size is %u\n", csize);
#endif
fnlen = UNPACK_UB2(file_header, LOC_FNLEN);
#ifdef DEBUG
printf("Filename length is %hu\n", fnlen);
#endif
eflen = UNPACK_UB2(file_header, LOC_EFLEN);
#ifdef DEBUG
printf("Extra field length is %hu\n", eflen);
#endif
method = UNPACK_UB2(file_header, LOC_COMP);
#ifdef DEBUG
printf("Compression method is %#hx\n", method);
#endif
flags = UNPACK_UB2(file_header, LOC_EXTRA);
#ifdef DEBUG
printf("Flags are %#hx\n", flags);
#endif
usize = UNPACK_UB4(file_header, LOC_USIZE);
/* If we're providing verbose output, we need to make an ASCII
* formatted version of the date. */
if(verbose){
mdate = UNPACK_UB4(file_header, LOC_MODTIME);
tdate = dos2unixtime(mdate);
s_tm = localtime(&tdate);
strftime(ascii_date, 30, "%a %b %d %H:%M:%S %Z %Y", s_tm);
}
if(filename_len < fnlen + 1){
if(filename != NULL)
free(filename);
filename = malloc(sizeof(ub1) * (fnlen + 1));
ascii_date[30] = '\0';
filename_len = fnlen + 1;
}
pb_read(&pbf, filename, fnlen);
filename[fnlen] = '\0';
/* the header is at the end. In a JAR file, this means that the data
happens to be compressed. We have no choice but to inflate the
data */
if(flags & 0x0008){
size = eflen;
if(size > 0)
consume(&pbf, size);
if(method == 8){
#ifdef DEBUG
printf("inflating %s\n", filename);
#endif
inflate_file(&pbf, -1, &ze);
usize = ze.usize;
} else
printf("We're shit outta luck!\n");
} else {
size = csize + (eflen > 0 ? eflen : 0);
#ifdef DEBUG
printf("Skipping %ld bytes\n", (long)size);
#endif
consume(&pbf, size);
}
/* print out the listing */
if(file_num > 0){
for(j = 0; j < file_num; j++)
if(strcmp(files[j], (const char *)filename) == 0){
if(verbose)
printf("%6d %s %s\n", usize, ascii_date, filename);
else
printf("%s\n", filename);
break;
}
} else {
if(verbose)
printf("%6d %s %s\n", usize, ascii_date, filename);
else
printf("%s\n", filename);
}
}
}
return 0;
}
int consume(pb_file *pbf, int amt){
int tc = 0; /* total amount consumed */
ub1 buff[RDSZ];
int rdamt;
#ifdef DEBUG
printf("Consuming %d bytes\n", amt);
#endif
if (seekable){
if (amt <= (int)pbf->buff_amt)
pb_read(pbf, buff, amt);
else {
lseek(pbf->fd, amt - pbf->buff_amt, SEEK_CUR);
pb_read(pbf, buff, pbf->buff_amt); /* clear pbf */
}
} else
while(tc < amt){
rdamt = pb_read(pbf, buff, ((amt - tc) < RDSZ ? (amt - tc) : RDSZ));
#ifdef DEBUG
printf("got %d bytes\n", rdamt);
#endif
tc += rdamt;
}
#ifdef DEBUG
printf("%d bytes consumed\n", amt);
#endif
return 0;
}
void usage(const char *filename){
fprintf(stderr, "Try `%s --help' for more information.\n", filename);
exit (1);
}
void version (void)
{
printf("jar (%s) %s\n\n", PACKAGE, VERSION);
printf("Copyright 1999, 2000, 2001 Bryan Burns\n");
printf("Copyright 2006 Free Software Foundation\n");
printf("\
This is free software; see the source for copying conditions. There is NO\n\
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n");
exit (0);
}
void help(const char *filename)
{
printf("\
Usage: %s {ctxuV}[vfm0ME@] [jar-file] [manifest-file] [-C dir] files ...\n\
\n\
Store many files together in a single `jar' file.\n\
\n\
-c create new archive\n\
-t list table of contents for archive\n\
-x extract named (or all) files from archive\n\
-u update existing archive\n\
", filename);
printf("\n\
-@ read names from stdin\n\
-0 store only; use no ZIP compression\n\
-C DIR FILE change to the specified directory and include\n\
the following file\n\
-E don't include the files found in a directory\n\
-f FILE specify archive file name\n\
--help print this help, then exit\n\
");
printf("\
-m FILE include manifest information from specified manifest file\n\
-M Do not create a manifest file for the entries\n\
-i generate an index of the packages in this jar\n\
and its Class-Path (currently unimplemented)\n\
-v generate verbose output on standard output\n\
-V, --version display version information\n\
");
printf("\n\
If any file is a directory then it is processed recursively.\n\
The manifest file name and the archive file name needs to be specified\n\
in the same order the 'm' and 'f' flags are specified.\n\
\n\
Example 1: to archive two class files into an archive called classes.jar: \n\
jar cvf classes.jar Foo.class Bar.class \n\
Example 2: use an existing manifest file 'mymanifest' and archive all the\n\
files in the foo/ directory into 'classes.jar': \n\
jar cvfm classes.jar mymanifest -C foo/ .\n\
");
exit(0);
}
static char *
jt_strdup(char *s)
{
char *result = (char*)malloc(strlen(s) + 1);
if (result == (char*)0)
return (char*)0;
strcpy(result, s);
return result;
}
/* Convert "tar-style" first argument to a form expected by getopt.
This idea and the code comes from GNU tar. This can allocate a new
argument vector. This might leak some memory, but we don't care. */
static void
expand_options (int *argcp, char ***argvp)
{
int argc = *argcp;
char **argv = *argvp;
/* Accept arguments with a leading "-" (eg "-cvf"), but don't do expansion
if a long argument (like "--help") is detected. */
if (argc > 1 && argv[1][1] != '-')
{
char buf[3];
char **new_argv;
int new_argc;
int args_to_expand;
char *p;
char **in, **out;
buf[0] = '-';
buf[2] = '\0';
args_to_expand = strlen (argv[1]);
if (argv[1][0] == '-')
--args_to_expand;
new_argc = argc - 1 + args_to_expand;
new_argv = (char **) malloc (new_argc * sizeof (char *));
in = argv;
out = new_argv;
*out++ = *in++;
p = *in++;
if (*p == '-')
p++;
while (*p != '\0')
{
char *opt;
buf[1] = *p;
*out++ = jt_strdup (buf);
/* If the option takes an argument, move the next argument
to just after this option. */
opt = strchr (OPTION_STRING, *p);
if (opt && opt[1] == ':')
{
if (in < argv + argc)
*out++ = *in++;
else
{
fprintf(stderr, "%s: option `%s' requires an argument.\n",
argv[0], buf);
usage(argv[0]);
}
}
++p;
}
/* Copy remaining options. */
while (in < argv + argc)
*out++ = *in++;
*argcp = new_argc;
*argvp = new_argv;
}
}
/* $Id: jartool.h,v 1.4 2000/08/24 15:23:35 cory Exp $
$Log: jartool.h,v $
Revision 1.4 2000/08/24 15:23:35 cory
Set version number since I think we can let this one out.
Revision 1.3 2000/08/23 19:42:17 cory
Added support for more Unix platforms. The following code has been hacked
to work on AIX, Solaris, True 64, and HP-UX.
Added bigendian check. Probably works on most big and little endian platforms
now.
Revision 1.2 1999/12/06 03:47:20 toast
fixing version string
Revision 1.1.1.1 1999/12/06 03:08:24 toast
initial checkin..
Revision 1.6 1999/05/10 09:16:08 burnsbr
*** empty log message ***
Revision 1.5 1999/04/27 10:04:20 burnsbr
configure support
Revision 1.4 1999/04/26 02:36:15 burnsbr
changed RDSZ to 4096 from 512
Revision 1.3 1999/04/23 12:00:29 burnsbr
modified zipentry struct
*/
/*
jartool.h - generic defines, struct defs etc.
Copyright (C) 1999, 2005 Bryan Burns
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __FASTJAR_JARTOOL_H__
#define __FASTJAR_JARTOOL_H__
#include <sys/types.h>
#include "config.h"
#define ACTION_NONE 0
#define ACTION_CREATE 1
#define ACTION_EXTRACT 2
#define ACTION_UPDATE 3
#define ACTION_LIST 4
#define ACTION_INDEX 5
#define TRUE 1
#define FALSE 0
/* Amount of bytes to read at a time. You can change this to optimize for
your system */
#define RDSZ 4096
/* Change these to match your system:
ub1 == unsigned 1 byte word
ub2 == unsigned 2 byte word
ub4 == unsigned 4 byte word
*/
#if SIZEOF_CHAR == 1
typedef unsigned char ub1;
#else
typedef u_int8_t ub1;
#endif
#if SIZEOF_SHORT == 2
typedef unsigned short ub2;
#elif SIZEOF_INT == 2
typedef unsigned int ub2;
#else
typedef u_int16_t ub2;
#endif
#if SIZEOF_INT == 4
typedef unsigned int ub4;
#elif SIZEOF_LONG == 4
typedef unsigned long ub4;
#elif defined(HAVE_LONG_LONG) && SIZEOF_LONG_LONG == 4
typedef unsigned long long ub4;
#else
typedef u_int32_t ub4;
#endif
struct zipentry {
ub2 mod_time;
ub2 mod_date;
ub4 crc;
ub4 csize;
ub4 usize;
ub4 offset;
ub1 compressed;
ub2 flags;
char *filename;
struct zipentry *next_entry;
};
typedef struct zipentry zipentry;
#ifndef __GNUC__
#define __attribute__()
#endif
#endif /* __FASTJAR_JARTOOL_H__ */
/* $Id: pushback.c,v 1.2 2000/12/14 18:45:35 ghazi Exp $
$Log: pushback.c,v $
Revision 1.2 2000/12/14 18:45:35 ghazi
Warning fixes:
* compress.c: Include stdlib.h and compress.h.
(rcsid): Delete.
(report_str_error): Make static.
(ez_inflate_str): Delete unused variable. Add parens in if-stmt.
(hrd_inflate_str): Likewise.
* compress.h (init_compression, end_compression, init_inflation,
end_inflation): Prototype void arguments.
* dostime.c (rcsid): Delete.
* jargrep.c: Include ctype.h, stdlib.h, zlib.h and compress.h.
Make functions static. Cast ctype function argument to `unsigned
char'. Add parens in if-stmts. Constify.
(Usage): Change into a macro.
(jargrep): Remove unused parameter.
* jartool.c: Constify. Add parens in if-stmts. Align
signed/unsigned char pointers in functions calls using casts.
(rcsid): Delete.
(list_jar): Fix printf format specifier.
(usage): Chop long string into bits. Reformat.
* pushback.c (rcsid): Delete.
Revision 1.1 2000/12/09 03:08:23 apbianco
2000-12-08 Alexandre Petit-Bianco <apbianco@cygnus.com>
* fastjar: Imported.
Revision 1.2 2000/08/23 19:42:17 cory
Added support for more Unix platforms. The following code has been hacked
to work on AIX, Solaris, True 64, and HP-UX.
Added bigendian check. Probably works on most big and little endian platforms
now.
Revision 1.1.1.1 1999/12/06 03:09:13 toast
initial checkin..
Revision 1.1 1999/05/10 08:32:37 burnsbr
Initial revision
*/
/*
pushback.c - code for a pushback buffer to handle file I/O
Copyright (C) 1999 Bryan Burns
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <unistd.h>
#include <string.h>
#include <stdio.h>
#include "jartool.h"
#include "pushback.h"
void pb_init(pb_file *pbf, int fd){
pbf->fd = fd;
pbf->next = pbf->pb_buff;
pbf->buff_amt = 0;
}
int pb_push(pb_file *pbf, void *buff, int amt){
int in_amt;
int wrap = 0;
#ifdef DEBUG
printf("%d bytes being pushed back to the buffer\n", amt);
#endif
/* determine how much we can take */
if((int)(RDSZ - pbf->buff_amt) < amt)
in_amt = RDSZ - pbf->buff_amt;
else
in_amt = amt;
if(in_amt == 0)
return 0;
/* figure out if we need to wrap around, and if so, by how much */
if(((pbf->pb_buff + RDSZ) - pbf->next) < in_amt)
wrap = in_amt - ((pbf->pb_buff + RDSZ) - pbf->next);
/* write everything up til the end of the buffer */
memcpy(pbf->next, buff, (in_amt - wrap));
/* finish writing what's wrapped around */
memcpy(pbf->pb_buff, ((char *)buff + (in_amt - wrap)), wrap);
/* update the buff_amt field */
pbf->buff_amt += in_amt;
#ifdef DEBUG
printf("%d bytes we can't accept\n", (amt - in_amt));
#endif
return in_amt;
}
int pb_read(pb_file *pbf, void *buff, int amt){
int out_amt = 0;
int wrap = 0;
void *bp = buff;
int tmp;
#ifdef DEBUG
printf("%d bytes requested from us\n", amt);
#endif
while(out_amt < amt){
/* if our push-back buffer contains some data */
if(pbf->buff_amt > 0){
#ifdef DEBUG
printf("giving data from buffer\n");
#endif
/* calculate how much we can actually give the caller */
if( (amt - out_amt) < (int)pbf->buff_amt )
tmp = (amt - out_amt);
else
tmp = pbf->buff_amt;
/* Determine if we're going to need to wrap around the buffer */
if(tmp > ((pbf->pb_buff + RDSZ) - pbf->next))
wrap = tmp - ((pbf->pb_buff + RDSZ) - pbf->next);
memcpy(bp, pbf->next, (tmp - wrap));
bp = &(((char *)bp)[tmp - wrap]);
/* If we need to wrap, read from the start of the buffer */
if(wrap > 0){
memcpy(bp, pbf->pb_buff, wrap);
bp = &(((char *)bp)[wrap]);
}
/* update the buff_amt field */
pbf->buff_amt -= tmp;
pbf->next += tmp;
#ifdef DEBUG
printf("%d bytes remaining in buffer\n", pbf->buff_amt);
#endif
/* if the buffer is empty, reset the next header to the front of the
buffer so subsequent pushbacks/reads won't have to wrap */
if(pbf->buff_amt == 0)
pbf->next = pbf->pb_buff;
out_amt += tmp;
} else {
#ifdef DEBUG
printf("Reading from file..\n");
#endif
/* The pushback buffer was empty, so we just need to read from the file */
tmp = read(pbf->fd, bp, (amt - out_amt));
if(tmp == 0)
break;
else
out_amt += tmp;
bp = &(((char *)bp)[tmp]);
}
}
#ifdef DEBUG
printf("managed to read %d bytes\n", out_amt);
#endif
return out_amt;
}
/*
pushback.h - header for pushback.c
Copyright (C) 1999 Bryan Burns
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
struct pb_file {
unsigned int buff_amt;
ub1 pb_buff[RDSZ];
int fd;
ub1 *next;
};
typedef struct pb_file pb_file;
void pb_init(pb_file *, int);
int pb_push(pb_file *, void *, int);
int pb_read(pb_file *, void *, int);
/* shift.c -- utilities to move regions of data in a file.
Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at
your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include "jartool.h"
#include "shift.h"
#define BUFFER_SIZE 1024
#define MIN(a, b) ((a) < (b) ? (a) : (b))
/*
* Shift the contents of a file up by `amount' bytes, starting at `begin'.
* The file is not truncated, data from `amount' to `begin - amount' is
* overwritten. The current file pointer of `fd' is preserved. Note that
* this might be past the new "end" of the file.
*
* If this function is passed a `struct zipentry', then all `offset'
* fields from that entry down the list that are greater than or equal
* to `begin' will be decreased by `amount'.
*
* fd - The file descriptor.
* begin - The offset of the first byte that should be shifted.
* amount - The number of bytes to shift by.
* ze - A pointer into a list of zip entries that should be updated
* to reflect the modified offset.
*/
int
shift_up (int fd, off_t begin, off_t amount, struct zipentry *ze)
{
extern off_t end_of_entries;
int len, moved = 0;
ub1 buffer[BUFFER_SIZE];
off_t where, end, save;
if (amount <= 0)
return 0;
if ((save = lseek (fd, 0, SEEK_CUR)) == -1)
return 1;
if ((end = lseek (fd, 0, SEEK_END)) == -1)
return 1;
if (end < begin)
return 0;
where = begin;
do
{
if (lseek (fd, where, SEEK_SET) < 0)
return 1;
if ((len = read (fd, buffer, BUFFER_SIZE)) < 0)
return 1;
if (len == 0)
break;
if (lseek (fd, where - amount, SEEK_SET) < 0)
return 1;
if (write (fd, buffer, len) < 0)
return 1;
where += len;
}
while (where < end);
for (; ze; ze = ze->next_entry)
{
if ((off_t) ze->offset >= begin)
{
ze->offset -= amount;
moved = 1;
}
}
if (moved)
end_of_entries -= amount;
if (lseek (fd, save, SEEK_SET) == -1)
return 1;
return 0;
}
/*
* Shift the contents of this file down by `amount' bytes, extending the
* end of file, starting at `begin'. This function will preserve the
* current file pointer of `fd'. Naturally, this function will fail if
* `fd' is not seekable.
*
* If this function is passed a `struct zipentry', then all `offset'
* fields from that entry down the list that are greater than or equal
* to `begin' will be increased by `amount'.
*
* fd - The file descriptor.
* begin - The offset of the first byte that should be shifted.
* amount - The number of bytes to shift by.
* ze - A pointer into a list of zip entries that should be updated
* to reflect the modified offset.
*/
int
shift_down (int fd, off_t begin, off_t amount, struct zipentry *ze)
{
extern off_t end_of_entries;
int off, len, moved = 0;
ub1 buffer[BUFFER_SIZE];
off_t where, save;
if (amount <= 0)
return 0;
if ((save = lseek (fd, 0, SEEK_CUR)) == -1)
return 1;
if ((where = lseek (fd, 0, SEEK_END)) == -1)
return 1;
if (where < begin)
return 0;
off = (where - begin) % BUFFER_SIZE;
if (off == 0)
where -= BUFFER_SIZE;
else
where -= off;
do
{
if (lseek (fd, where, SEEK_SET) < 0)
return 1;
if ((len = read (fd, buffer, BUFFER_SIZE)) < 0)
return 1;
if (lseek (fd, where + amount, SEEK_SET) < 0)
return 1;
if (write (fd, buffer, len) < 0)
return 1;
where -= BUFFER_SIZE;
}
while (where >= begin);
for (; ze; ze = ze->next_entry)
{
if ((off_t) ze->offset >= begin)
{
ze->offset += amount;
moved = 1;
}
}
if (moved)
end_of_entries += amount;
if (lseek (fd, save, SEEK_SET) == -1)
return 1;
return 0;
}
/* shift.h -- utilities to move regions of data in a file.
Copyright (C) 2004 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at
your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#ifndef __FASTJAR_SHIFT_H__
#define __FASTJAR_SHIFT_H__
#include <sys/types.h>
#include "jartool.h"
int shift_down (int, off_t, off_t, struct zipentry *);
int shift_up (int, off_t, off_t, struct zipentry *);
#endif /* __FASTJAR_SHIFT_H__ */
/* $Id: zipfile.h,v 1.1.1.1 1999/12/06 03:09:11 toast Exp $
$Log: zipfile.h,v $
Revision 1.1.1.1 1999/12/06 03:09:11 toast
initial checkin..
Revision 1.6 1999/05/10 08:33:08 burnsbr
added UNPACK_UB4 and UNPACK_UB2
Revision 1.5 1999/04/26 02:36:34 burnsbr
added LOC_EXTRA macro
Revision 1.4 1999/04/23 12:01:19 burnsbr
added more defines
*/
/*
zipfile.h - defines for indexing zipfile headers
Copyright (C) 1999 Bryan Burns
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#define LOC_EXTRA 6 /* extra bytes */
#define LOC_COMP 8 /* compression method */
#define LOC_MODTIME 10 /* last modification time */
#define LOC_MODDATE 12 /* last modification date */
#define LOC_CRC 14 /* CRC */
#define LOC_CSIZE 18 /* compressed size */
#define LOC_USIZE 22 /* uncompressed size */
#define LOC_FNLEN 26 /* filename length */
#define LOC_EFLEN 28 /* extra-field length */
#define CEN_FLAGS 8
#define CEN_COMP 10 /* compression method */
#define CEN_MODTIME 12
#define CEN_MODDATE 14
#define CEN_CRC 16
#define CEN_CSIZE 20
#define CEN_USIZE 24
#define CEN_FNLEN 28
#define CEN_EFLEN 30
#define CEN_COMLEN 32
#define CEN_OFFSET 42
/* macros */
#define PACK_UB4(d, o, v) d[o] = (ub1)((v) & 0x000000ff); \
d[o + 1] = (ub1)(((v) & 0x0000ff00) >> 8); \
d[o + 2] = (ub1)(((v) & 0x00ff0000) >> 16); \
d[o + 3] = (ub1)(((v) & 0xff000000) >> 24)
#define PACK_UB2(d, o, v) d[o] = (ub1)((v) & 0x00ff); \
d[o + 1] = (ub1)(((v) & 0xff00) >> 8)
#define UNPACK_UB4(s, o) (ub4)s[o] + (((ub4)s[o + 1]) << 8) +\
(((ub4)s[o + 2]) << 16) + (((ub4)s[o + 3]) << 24)
#define UNPACK_UB2(s, o) (ub2)s[o] + (((ub2)s[o + 1]) << 8)
2006-04-03 Tom Tromey <tromey@redhat.com>
* Makefile.in: Rebuilt.
* Makefile.am (ZIP): Removed.
(libgcj-$(gcc_version).jar): Use $(JAR).
(src.zip): Likewise.
* configure: Rebuilt.
* configure.ac: Check for jar. Removed code to set ZIP.
2006-04-03 Andrew Haley <aph@redhat.com>
* testsuite/libjava.lang/Float_2.java: New file.
......
......@@ -87,7 +87,6 @@ bin_SCRIPTS = addr2name.awk
##
GCJH = @GCJH@
ZIP = @ZIP@
## The compiler with whatever flags we want for both -c and -C
## compiles.
......@@ -322,10 +321,7 @@ $(propertyo_files): %.lo: classpath/resource/%
$(LTGCJCOMPILE) -o $@ -c $< -Wc,--resource,$(@:.lo=)
libgcj-$(gcc_version).jar:
jardir=`dirname $(ZIP)`; \
jardir=`cd $$jardir && pwd`; \
jarname=`basename $(ZIP)`; \
cd classpath/lib; $$jardir/$$jarname -cfM \
cd classpath/lib; $(JAR) -cfM \
../../libgcj-$(gcc_version).jar gnu java javax org
CLEANFILES = libgcj-$(gcc_version).jar \
......@@ -883,9 +879,10 @@ src.zip:
echo $$file; \
done ); \
) | \
## Many of the above circumlocutions are because ZIP will most likely
## be a relative path to fastjar.
$(ZIP) -cfM@ $$here/src.zip
## Many of the above circumlocutions were because ZIP used to be a
## relative path to fastjar. It didn't seem worthwhile to change the
## code when we moved to an external jar.
$(JAR) -cfM@ $$here/src.zip
## Override GNU Classpath sources with libgcj replacements.
here=`pwd`; \
( \
......@@ -897,7 +894,7 @@ src.zip:
echo $$file; \
done ); \
) | \
$(ZIP) -ufM@ $$here/src.zip
$(JAR) -ufM@ $$here/src.zip
## We use a variable for this in case the user wants to override it.
sourcesdir = $(jardir)
......
......@@ -488,6 +488,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTERPRETER = @INTERPRETER@
JAR = @JAR@
JAVA_HOME = @JAVA_HOME@
JAVA_HOME_SET_FALSE = @JAVA_HOME_SET_FALSE@
JAVA_HOME_SET_TRUE = @JAVA_HOME_SET_TRUE@
......@@ -579,7 +580,6 @@ X_EXTRA_LIBS = @X_EXTRA_LIBS@
X_LIBS = @X_LIBS@
X_PRE_LIBS = @X_PRE_LIBS@
ZINCS = @ZINCS@
ZIP = @ZIP@
ZLIBS = @ZLIBS@
ZLIBSPEC = @ZLIBSPEC@
ZLIBTESTSPEC = @ZLIBTESTSPEC@
......@@ -8423,10 +8423,7 @@ $(propertyo_files): %.lo: classpath/resource/%
$(LTGCJCOMPILE) -o $@ -c $< -Wc,--resource,$(@:.lo=)
libgcj-$(gcc_version).jar:
jardir=`dirname $(ZIP)`; \
jardir=`cd $$jardir && pwd`; \
jarname=`basename $(ZIP)`; \
cd classpath/lib; $$jardir/$$jarname -cfM \
cd classpath/lib; $(JAR) -cfM \
../../libgcj-$(gcc_version).jar gnu java javax org
mostlyclean-local:
......@@ -10726,7 +10723,7 @@ src.zip:
echo $$file; \
done ); \
) | \
$(ZIP) -cfM@ $$here/src.zip
$(JAR) -cfM@ $$here/src.zip
here=`pwd`; \
( \
( cd $(srcdir); \
......@@ -10737,7 +10734,7 @@ src.zip:
echo $$file; \
done ); \
) | \
$(ZIP) -ufM@ $$here/src.zip
$(JAR) -ufM@ $$here/src.zip
install-src.zip: src.zip
$(INSTALL_DATA) src.zip $(DESTDIR)$(sourcesdir)/src-$(gcc_version).zip
......
......@@ -310,7 +310,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os build_subdir host_subdir target_subdir libgcj_basedir host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical LN_S mkinstalldirs CC ac_ct_CC EXEEXT OBJEXT CXX ac_ct_CXX CFLAGS CXXFLAGS LDFLAGS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE AS ac_ct_AS LD ac_ct_LD AR ac_ct_AR RANLIB ac_ct_RANLIB MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT LIBGCJ_CFLAGS LIBGCJ_CXXFLAGS LIBGCJ_JAVAFLAGS LIBGCJ_LD_SYMBOLIC LIBGCJDEBUG TOOLKIT XLIB_AWT_TRUE XLIB_AWT_FALSE GTK_AWT_TRUE GTK_AWT_FALSE QT_AWT_TRUE QT_AWT_FALSE GCJH ZIP INCLTDL LIBLTDL DIRLTDL LIBTOOL CXXCPP CPPFLAGS GCJ GCJFLAGS GCJDEPMODE am__fastdepGCJ_TRUE am__fastdepGCJ_FALSE subdirs TESTSUBDIR_TRUE TESTSUBDIR_FALSE JAVA_HOME_SET_TRUE JAVA_HOME_SET_FALSE JAVA_HOME INTERPRETER LIBFFI LIBFFIINCS PLATFORM_INNER_NAT_HDRS CPP EGREP USING_WIN32_PLATFORM_TRUE USING_WIN32_PLATFORM_FALSE USING_POSIX_PLATFORM_TRUE USING_POSIX_PLATFORM_FALSE USING_DARWIN_CRT_TRUE USING_DARWIN_CRT_FALSE SYSTEMSPEC LIBGCJTESTSPEC ZLIBSPEC ZLIBTESTSPEC X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS GTK_CAIRO_TRUE GTK_CAIRO_FALSE PKG_CONFIG CAIRO_CFLAGS CAIRO_LIBS PANGOFT2_CFLAGS PANGOFT2_LIBS extra_ldflags_libjava GCLIBS GCINCS GCDEPS GCSPEC JC1GCSPEC GCTESTSPEC USING_BOEHMGC_TRUE USING_BOEHMGC_FALSE USING_NOGC_TRUE USING_NOGC_FALSE THREADLIBS THREADINCS THREADDEPS THREADSPEC THREADLDFLAGS THREADCXXFLAGS USING_POSIX_THREADS_TRUE USING_POSIX_THREADS_FALSE USING_WIN32_THREADS_TRUE USING_WIN32_THREADS_FALSE USING_NO_THREADS_TRUE USING_NO_THREADS_FALSE HASH_SYNC_SPEC USING_GCC_TRUE USING_GCC_FALSE LIBICONV LTLIBICONV GTK_CFLAGS GTK_LIBS GLIB_CFLAGS GLIB_LIBS LIBART_CFLAGS LIBART_LIBS CLASSPATH_SEPARATOR ac_ct_GCJ ZLIBS SYS_ZLIBS ZINCS DIVIDESPEC CHECKREFSPEC EXCEPTIONSPEC BACKTRACESPEC IEEESPEC NATIVE_TRUE NATIVE_FALSE NEEDS_DATA_START_TRUE NEEDS_DATA_START_FALSE GCC_UNWIND_INCLUDE toolexecdir toolexecmainlibdir toolexeclibdir dbexecdir GCJVERSION gxx_include_dir libstdcxx_incdir ALLOCA PERL SYSDEP_SOURCES LD_START_STATIC_SPEC LD_FINISH_STATIC_SPEC here LIBOBJS LTLIBOBJS'
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os build_subdir host_subdir target_subdir libgcj_basedir host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical LN_S mkinstalldirs CC ac_ct_CC EXEEXT OBJEXT CXX ac_ct_CXX CFLAGS CXXFLAGS LDFLAGS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE AS ac_ct_AS LD ac_ct_LD AR ac_ct_AR RANLIB ac_ct_RANLIB JAR MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT LIBGCJ_CFLAGS LIBGCJ_CXXFLAGS LIBGCJ_JAVAFLAGS LIBGCJ_LD_SYMBOLIC LIBGCJDEBUG TOOLKIT XLIB_AWT_TRUE XLIB_AWT_FALSE GTK_AWT_TRUE GTK_AWT_FALSE QT_AWT_TRUE QT_AWT_FALSE GCJH INCLTDL LIBLTDL DIRLTDL LIBTOOL CXXCPP CPPFLAGS GCJ GCJFLAGS GCJDEPMODE am__fastdepGCJ_TRUE am__fastdepGCJ_FALSE subdirs TESTSUBDIR_TRUE TESTSUBDIR_FALSE JAVA_HOME_SET_TRUE JAVA_HOME_SET_FALSE JAVA_HOME INTERPRETER LIBFFI LIBFFIINCS PLATFORM_INNER_NAT_HDRS CPP EGREP USING_WIN32_PLATFORM_TRUE USING_WIN32_PLATFORM_FALSE USING_POSIX_PLATFORM_TRUE USING_POSIX_PLATFORM_FALSE USING_DARWIN_CRT_TRUE USING_DARWIN_CRT_FALSE SYSTEMSPEC LIBGCJTESTSPEC ZLIBSPEC ZLIBTESTSPEC X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS GTK_CAIRO_TRUE GTK_CAIRO_FALSE PKG_CONFIG CAIRO_CFLAGS CAIRO_LIBS PANGOFT2_CFLAGS PANGOFT2_LIBS extra_ldflags_libjava GCLIBS GCINCS GCDEPS GCSPEC JC1GCSPEC GCTESTSPEC USING_BOEHMGC_TRUE USING_BOEHMGC_FALSE USING_NOGC_TRUE USING_NOGC_FALSE THREADLIBS THREADINCS THREADDEPS THREADSPEC THREADLDFLAGS THREADCXXFLAGS USING_POSIX_THREADS_TRUE USING_POSIX_THREADS_FALSE USING_WIN32_THREADS_TRUE USING_WIN32_THREADS_FALSE USING_NO_THREADS_TRUE USING_NO_THREADS_FALSE HASH_SYNC_SPEC USING_GCC_TRUE USING_GCC_FALSE LIBICONV LTLIBICONV GTK_CFLAGS GTK_LIBS GLIB_CFLAGS GLIB_LIBS LIBART_CFLAGS LIBART_LIBS CLASSPATH_SEPARATOR ac_ct_GCJ ZLIBS SYS_ZLIBS ZINCS DIVIDESPEC CHECKREFSPEC EXCEPTIONSPEC BACKTRACESPEC IEEESPEC NATIVE_TRUE NATIVE_FALSE NEEDS_DATA_START_TRUE NEEDS_DATA_START_FALSE GCC_UNWIND_INCLUDE toolexecdir toolexecmainlibdir toolexeclibdir dbexecdir GCJVERSION gxx_include_dir libstdcxx_incdir ALLOCA PERL SYSDEP_SOURCES LD_START_STATIC_SPEC LD_FINISH_STATIC_SPEC here LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
......@@ -3964,6 +3964,52 @@ else
RANLIB="$ac_cv_prog_RANLIB"
fi
for ac_prog in jar fastjar
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_JAR+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$JAR"; then
ac_cv_prog_JAR="$JAR" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_JAR="$ac_prog"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
fi
fi
JAR=$ac_cv_prog_JAR
if test -n "$JAR"; then
echo "$as_me:$LINENO: result: $JAR" >&5
echo "${ECHO_T}$JAR" >&6
else
echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi
test -n "$JAR" && break
done
test -n "$JAR" || JAR="false"
if test "$JAR" = false; then
{ { echo "$as_me:$LINENO: error: jar program not found" >&5
echo "$as_me: error: jar program not found" >&2;}
{ (exit 1); exit 1; }; }
fi
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
......@@ -4805,7 +4851,6 @@ case "${which_gcj}" in
built)
GCJ="$built_gcc_dir/gcj -B`${PWDCMD-pwd}`/ -B$built_gcc_dir/"
GCJH='$(top_builddir)/$(MULTIBUILDTOP)../../$(host_subdir)/gcc/gcjh'
ZIP='$(top_builddir)/$(MULTIBUILDTOP)../../$(host_subdir)/fastjar/fastjar'
;;
cross)
if test "x${with_newlib}" = "xyes"; then
......@@ -4815,21 +4860,16 @@ case "${which_gcj}" in
else
GCJ="${target_noncanonical}-gcj -B`${PWDCMD-pwd}`/"
fi
ZIP='$(target_noncanonical)-fastjar'
GCJH='$(target_noncanonical)-gcjh'
;;
path)
GCJ="gcj -B`${PWDCMD-pwd}`/"
## In this case, gcj is found outside the build tree. However, zip is
## found in the build tree.
ZIP='$(top_builddir)/$(MULTIBUILDTOP)../$(COMPPATH)/fastjar/fastjar'
GCJH=gcjh
;;
esac
# Create it, so that compile/link tests don't fail
test -f libgcj.spec || touch libgcj.spec
......@@ -5668,7 +5708,7 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
case $host in
*-*-irix6*)
# Find out which ABI we are using.
echo '#line 5671 "configure"' > conftest.$ac_ext
echo '#line 5711 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
......@@ -6671,7 +6711,7 @@ if test "${enable_sjlj_exceptions+set}" = set; then
:
else
cat > conftest.$ac_ext << EOF
#line 6674 "configure"
#line 6714 "configure"
struct S { ~S(); };
void bar();
void foo()
......@@ -17807,6 +17847,7 @@ s,@AR@,$AR,;t t
s,@ac_ct_AR@,$ac_ct_AR,;t t
s,@RANLIB@,$RANLIB,;t t
s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
s,@JAR@,$JAR,;t t
s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t
s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t
s,@MAINT@,$MAINT,;t t
......@@ -17823,7 +17864,6 @@ s,@GTK_AWT_FALSE@,$GTK_AWT_FALSE,;t t
s,@QT_AWT_TRUE@,$QT_AWT_TRUE,;t t
s,@QT_AWT_FALSE@,$QT_AWT_FALSE,;t t
s,@GCJH@,$GCJH,;t t
s,@ZIP@,$ZIP,;t t
s,@INCLTDL@,$INCLTDL,;t t
s,@LIBLTDL@,$LIBLTDL,;t t
s,@DIRLTDL@,$DIRLTDL,;t t
......
......@@ -116,6 +116,10 @@ AC_CHECK_TOOL(AS, as)
AC_CHECK_TOOL(LD, ld)
AC_CHECK_TOOL(AR, ar)
AC_CHECK_TOOL(RANLIB, ranlib, :)
AC_CHECK_PROGS(JAR, [jar fastjar], false)
if test "$JAR" = false; then
AC_MSG_ERROR(jar program not found)
fi
AC_PROG_INSTALL
......@@ -289,7 +293,6 @@ case "${which_gcj}" in
built)
GCJ="$built_gcc_dir/gcj -B`${PWDCMD-pwd}`/ -B$built_gcc_dir/"
GCJH='$(top_builddir)/$(MULTIBUILDTOP)../../$(host_subdir)/gcc/gcjh'
ZIP='$(top_builddir)/$(MULTIBUILDTOP)../../$(host_subdir)/fastjar/fastjar'
;;
cross)
if test "x${with_newlib}" = "xyes"; then
......@@ -299,20 +302,15 @@ case "${which_gcj}" in
else
GCJ="${target_noncanonical}-gcj -B`${PWDCMD-pwd}`/"
fi
ZIP='$(target_noncanonical)-fastjar'
GCJH='$(target_noncanonical)-gcjh'
;;
path)
GCJ="gcj -B`${PWDCMD-pwd}`/"
## In this case, gcj is found outside the build tree. However, zip is
## found in the build tree.
ZIP='$(top_builddir)/$(MULTIBUILDTOP)../$(COMPPATH)/fastjar/fastjar'
GCJH=gcjh
;;
esac
AC_SUBST(GCJH)
AC_SUBST(ZIP)
# Create it, so that compile/link tests don't fail
test -f libgcj.spec || touch libgcj.spec
......
......@@ -138,6 +138,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTERPRETER = @INTERPRETER@
JAR = @JAR@
JAVA_HOME = @JAVA_HOME@
JAVA_HOME_SET_FALSE = @JAVA_HOME_SET_FALSE@
JAVA_HOME_SET_TRUE = @JAVA_HOME_SET_TRUE@
......@@ -229,7 +230,6 @@ X_EXTRA_LIBS = @X_EXTRA_LIBS@
X_LIBS = @X_LIBS@
X_PRE_LIBS = @X_PRE_LIBS@
ZINCS = @ZINCS@
ZIP = @ZIP@
ZLIBS = @ZLIBS@
ZLIBSPEC = @ZLIBSPEC@
ZLIBTESTSPEC = @ZLIBTESTSPEC@
......
......@@ -137,6 +137,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTERPRETER = @INTERPRETER@
JAR = @JAR@
JAVA_HOME = @JAVA_HOME@
JAVA_HOME_SET_FALSE = @JAVA_HOME_SET_FALSE@
JAVA_HOME_SET_TRUE = @JAVA_HOME_SET_TRUE@
......@@ -228,7 +229,6 @@ X_EXTRA_LIBS = @X_EXTRA_LIBS@
X_LIBS = @X_LIBS@
X_PRE_LIBS = @X_PRE_LIBS@
ZINCS = @ZINCS@
ZIP = @ZIP@
ZLIBS = @ZLIBS@
ZLIBSPEC = @ZLIBSPEC@
ZLIBTESTSPEC = @ZLIBTESTSPEC@
......
......@@ -126,6 +126,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTERPRETER = @INTERPRETER@
JAR = @JAR@
JAVA_HOME = @JAVA_HOME@
JAVA_HOME_SET_FALSE = @JAVA_HOME_SET_FALSE@
JAVA_HOME_SET_TRUE = @JAVA_HOME_SET_TRUE@
......@@ -217,7 +218,6 @@ X_EXTRA_LIBS = @X_EXTRA_LIBS@
X_LIBS = @X_LIBS@
X_PRE_LIBS = @X_PRE_LIBS@
ZINCS = @ZINCS@
ZIP = @ZIP@
ZLIBS = @ZLIBS@
ZLIBSPEC = @ZLIBSPEC@
ZLIBTESTSPEC = @ZLIBTESTSPEC@
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment