summaryrefslogtreecommitdiff
path: root/gas/compress-debug.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2015-03-31 03:55:56 -0700
committerH.J. Lu <hjl.tools@gmail.com>2015-03-31 03:56:12 -0700
commit0138187e9fc351c6d4615bbe2ab020a3ac646b50 (patch)
tree5863d905a08e1fca6445b29b1f8aada03c805b86 /gas/compress-debug.c
parent0ee42ecde7aadb3e68ae5b944f7b1b6a859ebcfd (diff)
downloadbinutils-gdb-0138187e9fc351c6d4615bbe2ab020a3ac646b50.tar.gz
Add --with-system-zlib in gas
This patch adds --with-system-zlib and remove --with-zlib in gas. gas/ * Makefile.am (ZLIBINC): New. (AM_CFLAGS): Add $(ZLIBINC). * as.c: (show_usage): Don't check HAVE_ZLIB_H. (parse_args): Likewise. * compress-debug.c: Don't check HAVE_ZLIB_H to include <zlib.h>. (compress_init): Don't check HAVE_ZLIB_H. (compress_data): Likewise. (compress_finish): Likewise. * configure.ac (AM_ZLIB): Removed. (zlibinc): New. AC_SUBST. Add --with-system-zlib. * Makefile.in: Regenerated. * config.in: Likewise. * configure: Likewise. * doc/Makefile.in: Likewise. gas/testsuite/ * gas/i386/dw2-compress-1.d: Expect .zdebug_info.
Diffstat (limited to 'gas/compress-debug.c')
-rw-r--r--gas/compress-debug.c30
1 files changed, 5 insertions, 25 deletions
diff --git a/gas/compress-debug.c b/gas/compress-debug.c
index b036610d381..87493998651 100644
--- a/gas/compress-debug.c
+++ b/gas/compress-debug.c
@@ -20,21 +20,15 @@
#include "config.h"
#include <stdio.h>
+#include <zlib.h>
#include "ansidecl.h"
#include "compress-debug.h"
-#ifdef HAVE_ZLIB_H
-#include <zlib.h>
-#endif
-
/* Initialize the compression engine. */
struct z_stream_s *
compress_init (void)
{
-#ifndef HAVE_ZLIB_H
- return NULL;
-#else
static struct z_stream_s strm;
strm.zalloc = NULL;
@@ -42,22 +36,15 @@ compress_init (void)
strm.opaque = NULL;
deflateInit (&strm, Z_DEFAULT_COMPRESSION);
return &strm;
-#endif /* HAVE_ZLIB_H */
}
/* Stream the contents of a frag to the compression engine. Output
from the engine goes into the current frag on the obstack. */
int
-compress_data (struct z_stream_s *strm ATTRIBUTE_UNUSED,
- const char **next_in ATTRIBUTE_UNUSED,
- int *avail_in ATTRIBUTE_UNUSED,
- char **next_out ATTRIBUTE_UNUSED,
- int *avail_out ATTRIBUTE_UNUSED)
+compress_data (struct z_stream_s *strm, const char **next_in,
+ int *avail_in, char **next_out, int *avail_out)
{
-#ifndef HAVE_ZLIB_H
- return -1;
-#else
int out_size = 0;
int x;
@@ -77,7 +64,6 @@ compress_data (struct z_stream_s *strm ATTRIBUTE_UNUSED,
*avail_out = strm->avail_out;
return out_size;
-#endif /* HAVE_ZLIB_H */
}
/* Finish the compression and consume the remaining compressed output.
@@ -85,14 +71,9 @@ compress_data (struct z_stream_s *strm ATTRIBUTE_UNUSED,
needed. */
int
-compress_finish (struct z_stream_s *strm ATTRIBUTE_UNUSED,
- char **next_out ATTRIBUTE_UNUSED,
- int *avail_out ATTRIBUTE_UNUSED,
- int *out_size ATTRIBUTE_UNUSED)
+compress_finish (struct z_stream_s *strm, char **next_out,
+ int *avail_out, int *out_size)
{
-#ifndef HAVE_ZLIB_H
- return -1;
-#else
int x;
strm->avail_in = 0;
@@ -113,5 +94,4 @@ compress_finish (struct z_stream_s *strm ATTRIBUTE_UNUSED,
if (strm->avail_out != 0)
return -1;
return 1;
-#endif /* HAVE_ZLIB_H */
}