Commit 79801091 by Craig Rodrigues

re PR bootstrap/5117 (irix6.5 bootstrap failure when using SGI's compiler)

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.

From-SVN: r48493
parent bf7edb60
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.
* 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:
......
......@@ -40,8 +40,7 @@ AM_MAKEFLAGS = \
INCLUDES = -I. -I$(top_srcdir) $(ZINCS)
bin_PROGRAMS = jar
EXTRA_PROGRAMS = grepjar
bin_PROGRAMS = jar grepjar
jar_SOURCES = jartool.c dostime.c compress.c pushback.c jartool.h zipfile.h dostime.h compress.h pushback.h
jar_LDADD = $(ZLIBS)
jar_DEPENDENCIES = $(ZDEPS)
......
......@@ -77,46 +77,12 @@ ZINCS = @ZINCS@
ZLIBS = @ZLIBS@
fastjar_warn_cflags = @fastjar_warn_cflags@
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_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)"
INCLUDES = -I. -I$(top_srcdir) $(ZINCS)
bin_PROGRAMS = jar
EXTRA_PROGRAMS = grepjar
bin_PROGRAMS = jar grepjar
jar_SOURCES = jartool.c dostime.c compress.c pushback.c jartool.h zipfile.h dostime.h compress.h pushback.h
jar_LDADD = $(ZLIBS)
jar_DEPENDENCIES = $(ZDEPS)
......@@ -129,7 +95,7 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES = install-defs.sh
bin_PROGRAMS = jar$(EXEEXT)
bin_PROGRAMS = jar$(EXEEXT) grepjar$(EXEEXT)
PROGRAMS = $(bin_PROGRAMS)
......@@ -137,10 +103,10 @@ DEFS = @DEFS@ -I. -I$(srcdir) -I.
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
grepjar_OBJECTS = jargrep.o dostime.o compress.o pushback.o
grepjar_LDFLAGS =
jar_OBJECTS = jartool.o dostime.o compress.o pushback.o
jar_LDFLAGS =
grepjar_OBJECTS = jargrep.o dostime.o compress.o pushback.o
grepjar_LDFLAGS =
CFLAGS = @CFLAGS@
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
......@@ -152,10 +118,10 @@ configure.in install-defs.sh.in install-sh missing mkinstalldirs
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
TAR = gtar
GZIP_ENV = --best
SOURCES = $(grepjar_SOURCES) $(jar_SOURCES)
OBJECTS = $(grepjar_OBJECTS) $(jar_OBJECTS)
SOURCES = $(jar_SOURCES) $(grepjar_SOURCES)
OBJECTS = $(jar_OBJECTS) $(grepjar_OBJECTS)
all: all-redirect
.SUFFIXES:
......@@ -249,14 +215,14 @@ distclean-compile:
maintainer-clean-compile:
grepjar$(EXEEXT): $(grepjar_OBJECTS) $(grepjar_DEPENDENCIES)
@rm -f grepjar$(EXEEXT)
$(LINK) $(grepjar_LDFLAGS) $(grepjar_OBJECTS) $(grepjar_LDADD) $(LIBS)
jar$(EXEEXT): $(jar_OBJECTS) $(jar_DEPENDENCIES)
@rm -f jar$(EXEEXT)
$(LINK) $(jar_LDFLAGS) $(jar_OBJECTS) $(jar_LDADD) $(LIBS)
grepjar$(EXEEXT): $(grepjar_OBJECTS) $(grepjar_DEPENDENCIES)
@rm -f grepjar$(EXEEXT)
$(LINK) $(grepjar_LDFLAGS) $(grepjar_OBJECTS) $(grepjar_LDADD) $(LIBS)
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP)
......@@ -327,7 +293,7 @@ distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
cp -pr $$/$$file $(distdir)/$$file; \
cp -pr $$d/$$file $(distdir)/$$file; \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
......
/* $Id: compress.c,v 1.1 2000/12/09 03:08:23 apbianco Exp $
/* $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>
......@@ -110,6 +138,7 @@ int compress_file(int in_fd, int out_fd, struct zipentry *ze){
Bytef out_buff[RDSZ];
unsigned int rdamt, wramt;
unsigned long tr = 0;
int rtval;
rdamt = 0;
......@@ -125,14 +154,16 @@ int compress_file(int in_fd, int out_fd, struct zipentry *ze){
/* If deflate is out of input, fill the input buffer for it */
if(zs.avail_in == 0 && zs.avail_out > 0){
if((rdamt = read(in_fd, in_buff, RDSZ)) == 0)
if((rtval = read(in_fd, in_buff, RDSZ)) == 0)
break;
if(rdamt == -1){
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);
......@@ -170,7 +201,7 @@ int compress_file(int in_fd, int out_fd, struct zipentry *ze){
wramt = RDSZ - zs.avail_out;
if(write(out_fd, out_buff, wramt) != wramt){
if(write(out_fd, out_buff, wramt) != (int)wramt){
perror("write");
exit(1);
}
......@@ -184,7 +215,7 @@ int compress_file(int in_fd, int out_fd, struct zipentry *ze){
while(deflate(&zs, Z_FINISH) == Z_OK){
wramt = RDSZ - zs.avail_out;
if(write(out_fd, out_buff, wramt) != wramt){
if(write(out_fd, out_buff, wramt) != (int)wramt){
perror("write");
exit(1);
}
......@@ -197,7 +228,7 @@ int compress_file(int in_fd, int out_fd, struct zipentry *ze){
if(zs.avail_out != RDSZ){
wramt = RDSZ - zs.avail_out;
if(write(out_fd, out_buff, wramt) != wramt){
if(write(out_fd, out_buff, wramt) != (int)wramt){
perror("write");
exit(1);
}
......@@ -261,7 +292,7 @@ int inflate_file(pb_file *pbf, int out_fd, struct zipentry *ze){
if(zs.avail_in == 0){
if((rdamt = pb_read(pbf, in_buff, RDSZ)) == 0)
break;
else if(rdamt < 0){
else if((int)rdamt < 0){
perror("read");
exit(1);
}
......@@ -287,7 +318,7 @@ int inflate_file(pb_file *pbf, int out_fd, struct zipentry *ze){
if(out_fd >= 0)
if(write(out_fd, out_buff, (RDSZ - zs.avail_out)) !=
(RDSZ - zs.avail_out)){
(int)(RDSZ - zs.avail_out)){
perror("write");
exit(1);
}
......@@ -304,7 +335,7 @@ int inflate_file(pb_file *pbf, int out_fd, struct zipentry *ze){
if(out_fd >= 0)
if(write(out_fd, out_buff, (RDSZ - zs.avail_out)) !=
(RDSZ - zs.avail_out)){
(int)(RDSZ - zs.avail_out)){
perror("write");
exit(1);
}
......
......@@ -40,6 +40,9 @@
/* Define if you have the <ndir.h> header file. */
#undef HAVE_NDIR_H
/* Define if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define if you have the <sys/dir.h> header file. */
#undef HAVE_SYS_DIR_H
......
......@@ -22,7 +22,7 @@ dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_STRUCT_TM
AC_CHECK_HEADERS(fcntl.h unistd.h sys/param.h getopt.h)
AC_CHECK_HEADERS(fcntl.h unistd.h sys/param.h getopt.h stdlib.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_OFF_T
......
......@@ -21,9 +21,15 @@
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: jargrep.c,v 1.3 2000/12/14 18:45:35 ghazi Exp $
/* $Id: jargrep.c,v 1.4 2000/12/15 18:45:09 tromey Exp $
$Log: jargrep.c,v $
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:
......@@ -90,7 +96,7 @@ will test some other platforms later.
#include <sys/stat.h>
#include <fcntl.h>
#include <ctype.h>
#ifdef STDC_HEADERS
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#include "jargrep.h"
......@@ -440,7 +446,7 @@ 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;
ub4 crc=0;
ub4 lcrc;
ub1 scratch[16];
......@@ -550,7 +556,7 @@ static int cont_grep(regex_t *exp, regex_t *nl_exp, int fd, pb_file *pbf, int op
char *filename;
char *str_stream;
regmatch_t *match_array;
regmatch_t *nl_offsets;
regmatch_t *nl_offsets=0;
if(pb_read(pbf, (file_header + 4), 26) != 26) {
perror("read");
......
......@@ -17,9 +17,13 @@
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: jartool.c,v 1.8 2001/08/29 01:35:31 apbianco Exp $
/* $Id: jartool.c,v 1.9 2001/10/12 00:49:42 bryce Exp $
$Log: jartool.c,v $
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>
......@@ -176,7 +180,7 @@
#include <zlib.h>
#ifdef STDC_HEADERS
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
......@@ -1444,7 +1448,7 @@ int extract_jar(int fd, char **files, int file_num){
ze.crc = crc32(ze.crc, NULL, 0); /* initialize the crc */
while(out_a < csize){
while(out_a < (int)csize){
rdamt = (in_a > RDSZ ? RDSZ : in_a);
if(pb_read(&pbf, rd_buff, rdamt) != rdamt){
perror("read");
......@@ -1587,7 +1591,7 @@ int list_jar(int fd, char **files, int file_num){
/* printf("Central header offset = %d\n", tmp); */
if(lseek(fd, tmp, SEEK_SET) != tmp){
if(lseek(fd, tmp, SEEK_SET) != (int)tmp){
perror("lseek");
exit(1);
}
......
/* $Id: pushback.c,v 1.1 2000/12/09 03:08:23 apbianco Exp $
/* $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>
......@@ -63,7 +91,7 @@ int pb_push(pb_file *pbf, void *buff, int amt){
#endif
/* determine how much we can take */
if((RDSZ - pbf->buff_amt) < amt)
if((int)(RDSZ - pbf->buff_amt) < amt)
in_amt = RDSZ - pbf->buff_amt;
else
in_amt = amt;
......@@ -110,7 +138,7 @@ int pb_read(pb_file *pbf, void *buff, int amt){
#endif
/* calculate how much we can actually give the caller */
if( (amt - out_amt) < pbf->buff_amt )
if( (amt - out_amt) < (int)pbf->buff_amt )
tmp = (amt - out_amt);
else
tmp = pbf->buff_amt;
......
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