/[debburn]/mods-archive/05_zisofs.dpatch
ViewVC logotype

Contents of /mods-archive/05_zisofs.dpatch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 224 - (show annotations) (download)
Tue Sep 5 19:18:45 2006 UTC (6 years, 8 months ago) by blade
File size: 133495 byte(s)
Parked the mods archive outside of the trunk
1 #! /bin/sh -e
2 ## 05.dpatch by Joerg Jaspert <joerg@debian.org>
3 ##
4 ## All lines beginning with `## DP:' are a description of the patch.
5 ## DP: Adds the zisofs_tools to the build tree.
6 ## DP: The zisofs filesystem is an extension to the ISO9660 filesystem
7 ## DP: that allows files, on a file-by-file basis, to be stored compressed
8 ## DP: and decompressed in real time. The zisofs filesystem is supported by
9 ## DP: recent versions of Linux (2.4.14 or later). Legacy systems can still
10 ## DP: read uncompressed files. zisofs-tools contains the tools necessary to
11 ## DP: create such a compressed ISO9660 filesystem and to read compressed
12 ## DP: files on a legacy system.
13
14 if [ $# -ne 1 ]; then
15 echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
16 exit 1
17 fi
18 case "$1" in
19 -patch) patch -f --no-backup-if-mismatch -p0 < $0;;
20 -unpatch) patch -f --no-backup-if-mismatch -R -p0 < $0;;
21 *)
22 echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
23 exit 1;;
24 esac
25
26 exit 0
27
28
29 @DPATCH@
30 --- TARGETS/55zisofs_tools 1970-01-01 01:00:00.000000000 +0100
31 +++ TARGETS/55zisofs_tools 2002-12-27 14:48:49.000000000 +0100
32 @@ -0,0 +1 @@
33 +Tools for preparing compressed filesystems
34
35 --- zisofs_tools/aclocal.m4 1970-01-01 01:00:00.000000000 +0100
36 +++ zisofs_tools/aclocal.m4 2002-12-27 14:48:49.000000000 +0100
37 @@ -0,0 +1,35 @@
38 +dnl --------------------------------------------------------------------------
39 +dnl PA_ADD_CFLAGS()
40 +dnl
41 +dnl Attempt to add the given option to CFLAGS, if it doesn't break compilation
42 +dnl --------------------------------------------------------------------------
43 +AC_DEFUN(PA_ADD_CFLAGS,
44 +[AC_MSG_CHECKING([if $CC accepts $1])
45 + pa_add_cflags__old_cflags="$CFLAGS"
46 + CFLAGS="$CFLAGS $1"
47 + AC_TRY_COMPILE([#include <stdio.h>],
48 + [printf("Hello, World!\n");],
49 + AC_MSG_RESULT([yes]),
50 + AC_MSG_RESULT([no])
51 + CFLAGS="$pa_add_cflags__old_cflags")])
52 +
53 +dnl ------------------------------------------------------------------------
54 +dnl PA_WITH_BOOL
55 +dnl
56 +dnl PA_WITH_BOOL(option, default, help, enable, disable)
57 +dnl
58 +dnl Provides a more convenient way to specify --with-option and
59 +dnl --without-option, with a default. default should be either 0 or 1.
60 +dnl ------------------------------------------------------------------------
61 +AC_DEFUN(PA_WITH_BOOL,
62 +[AC_ARG_WITH([$1], [$3],
63 +if test ["$withval"] != no; then
64 +[$4]
65 +else
66 +[$5]
67 +fi,
68 +if test [$2] -ne 0; then
69 +[$4]
70 +else
71 +[$5]
72 +fi)])
73
74 --- zisofs_tools/CHANGES 1970-01-01 01:00:00.000000000 +0100
75 +++ zisofs_tools/CHANGES 2002-12-27 14:48:49.000000000 +0100
76 @@ -0,0 +1,49 @@
77 +Changes in zisofs-tools-1.0.4:
78 +
79 + Update the documentation.
80 +
81 +Changes in zisofs-tools-1.0.3:
82 +
83 + Update cdrtools patch.
84 +
85 +Changes in zisofs-tools-1.0.2:
86 +
87 + Add "make install" target :)
88 +
89 +Changes in zisofs-tools-1.0.1:
90 +
91 + By default, abort if file modes, times and ownership cannot be
92 + set. Since this isn't always possible, add new option
93 + -s/--sloppy to suppress this error.
94 +
95 + Fix man page typo, and add a BUGS section.
96 +
97 + Remove problems with extremely long symlinks.
98 +
99 + Move all command line options into common "opt" structure.
100 +
101 + Fix bug in command line parsing: -z option not recognized.
102 +
103 +
104 +Changes in zisofs-tools-1.0:
105 +
106 + Restructured code; now split into a number of modules.
107 +
108 + Use autoconf for configuration.
109 +
110 + Add support for long options if the platform has
111 + getopt_long().
112 +
113 + Support compiling on systems without lchown().
114 +
115 + Support the following new options:
116 + -x Don't descend into other filesystems
117 + -X Same as -x, but don't create mount point directories
118 + -l Don't descend into any subdirectories
119 + -L Same as -l, but don't create stub directories
120 + -F Allow compression or decompression of single files.
121 + -V Explicitly set the verbosity.
122 + -w Display program version.
123 +
124 + Update the mkisofs patch to warn if -z is specified without
125 + -r/-R.
126
127 --- zisofs_tools/compress.c 1970-01-01 01:00:00.000000000 +0100
128 +++ zisofs_tools/compress.c 2002-12-27 14:48:49.000000000 +0100
129 @@ -0,0 +1,141 @@
130 +/* $Id: compress.c,v 1.3 2001/07/31 03:20:52 hpa Exp $ */
131 +/* ----------------------------------------------------------------------- *
132 + *
133 + * Copyright 2001 H. Peter Anvin - All Rights Reserved
134 + *
135 + * This program is free software; you can redistribute it and/or modify
136 + * it under the terms of the GNU General Public License as published by
137 + * the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139,
138 + * USA; either version 2 of the License, or (at your option) any later
139 + * version; incorporated herein by reference.
140 + *
141 + * ----------------------------------------------------------------------- */
142 +
143 +#include <stdlib.h>
144 +#include <stdio.h>
145 +#include <utime.h>
146 +#include <unistd.h>
147 +#include <zlib.h>
148 +#include "mkzftree.h"
149 +#include "iso9660.h"
150 +
151 +
152 +int block_compress_file(FILE *input, FILE *output, off_t size)
153 +{
154 + struct compressed_file_header hdr;
155 + char inbuf[CBLOCK_SIZE], outbuf[2*CBLOCK_SIZE];
156 + size_t bytes, pointer_bytes, nblocks, block;
157 + uLong cbytes; /* uLong is a zlib datatype */
158 + char *pointer_block, *curptr;
159 + off_t position;
160 + int i;
161 + int force_compress = opt.force;
162 + int zerr;
163 + int err = EX_SOFTWARE;
164 +
165 + if ( (sizeof hdr) & 3 ) {
166 + fputs("INTERNAL ERROR: header is not a multiple of 4\n", stderr);
167 + abort();
168 + }
169 +
170 + memset(&hdr, 0, sizeof hdr);
171 + memcpy(&hdr.magic, zisofs_magic, sizeof zisofs_magic);
172 + hdr.header_size = (sizeof hdr) >> 2;
173 + hdr.block_size = CBLOCK_SIZE_LG2;
174 + set_731(&hdr.uncompressed_len, size);
175 +
176 + if ( fwrite(&hdr, sizeof hdr, 1, output) != 1 )
177 + return EX_CANTCREAT;
178 +
179 + nblocks = (size+CBLOCK_SIZE-1) >> CBLOCK_SIZE_LG2;
180 + pointer_bytes = 4*(nblocks+1);
181 + pointer_block = xmalloc(pointer_bytes);
182 + memset(pointer_block, 0, pointer_bytes);
183 +
184 + if ( fseek(output, pointer_bytes, SEEK_CUR) == -1 ) {
185 + err = EX_CANTCREAT;
186 + goto free_ptr_bail;
187 + }
188 +
189 + curptr = pointer_block;
190 + position = sizeof hdr + pointer_bytes;
191 +
192 + block = 0;
193 + while ( (bytes = fread(inbuf, 1, CBLOCK_SIZE, input)) > 0 ) {
194 + if ( bytes < CBLOCK_SIZE && block < nblocks-1 ) {
195 + err = EX_IOERR;
196 + goto free_ptr_bail;
197 + }
198 +
199 + /* HACK: If the file has our magic number, always compress */
200 + if ( block == 0 && bytes >= sizeof zisofs_magic ) {
201 + if ( !memcmp(inbuf, zisofs_magic, sizeof zisofs_magic) )
202 + force_compress = 1;
203 + }
204 +
205 + set_731(curptr, position); curptr += 4;
206 +
207 + /* We have two special cases: a zero-length block is defined as all zero,
208 + and a block the length of which is equal to the block size is unencoded. */
209 +
210 + for ( i = 0 ; i < (int)CBLOCK_SIZE ; i++ ) {
211 + if ( inbuf[i] ) break;
212 + }
213 +
214 + if ( i == CBLOCK_SIZE ) {
215 + /* All-zero block. No output */
216 + } else {
217 + cbytes = 2*CBLOCK_SIZE;
218 + if ( (zerr = compress2(outbuf, &cbytes, inbuf, bytes, opt.level))
219 + != Z_OK ) {
220 + err = (zerr == Z_MEM_ERROR) ? EX_OSERR : EX_SOFTWARE;
221 + goto free_ptr_bail; /* Compression failure */
222 + }
223 + if ( fwrite(outbuf, 1, cbytes, output) != cbytes ) {
224 + err = EX_CANTCREAT;
225 + goto free_ptr_bail;
226 + }
227 + position += cbytes;
228 + }
229 + block++;
230 + }
231 +
232 + /* Set pointer to the end of the final block */
233 + set_731(curptr, position);
234 +
235 + /* Now write the pointer table */
236 + if ( fseek(output, sizeof hdr, SEEK_SET) == -1 ||
237 + fwrite(pointer_block, 1, pointer_bytes, output) != pointer_bytes ) {
238 + err = EX_CANTCREAT;
239 + goto free_ptr_bail;
240 + }
241 +
242 + free(pointer_block);
243 +
244 + /* Now make sure that this was actually the right thing to do */
245 + if ( !force_compress && position >= size ) {
246 + /* Incompressible file, just copy it */
247 + rewind(input);
248 + rewind(output);
249 +
250 + position = 0;
251 + while ( (bytes = fread(inbuf, 1, CBLOCK_SIZE, input)) > 0 ) {
252 + if ( fwrite(inbuf, 1, bytes, output) != bytes )
253 + return EX_CANTCREAT;
254 + position += bytes;
255 + }
256 +
257 + /* Truncate the file to the correct size */
258 + fflush(output);
259 + ftruncate(fileno(output), position);
260 + }
261 +
262 + /* If we get here, we're done! */
263 + return 0;
264 +
265 + /* Common bailout code */
266 + free_ptr_bail:
267 + free(pointer_block);
268 + return err;
269 +}
270 +
271
272 --- zisofs_tools/config.h 1970-01-01 01:00:00.000000000 +0100
273 +++ zisofs_tools/config.h 2002-12-27 14:48:49.000000000 +0100
274 @@ -0,0 +1,28 @@
275 +/* config.h. Generated automatically by configure. */
276 +/* -*- c -*- ------------------------------------------------------------- *
277 + *
278 + * Copyright 2001 H. Peter Anvin - All Rights Reserved
279 + *
280 + * This program is free software; you can redistribute it and/or modify
281 + * it under the terms of the GNU General Public License as published by
282 + * the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139,
283 + * USA; either version 2 of the License, or (at your option) any later
284 + * version; incorporated herein by reference.
285 + *
286 + * ----------------------------------------------------------------------- */
287 +/* $Id: config.h.in,v 1.1 2001/07/27 14:37:07 hpa Exp $ */
288 +
289 +/*
290 + * config.h.in
291 + *
292 + * Pattern file for configurations
293 + */
294 +
295 +#define HAVE_SYSEXITS_H 1 /* Define if <sysexits.h> exists */
296 +#define HAVE_GETOPT_H 1 /* Define if <getopt.h> exists */
297 +#define HAVE_GETOPT_LONG 1 /* Define if we have getopt_long() */
298 +#define HAVE_LCHOWN 1 /* Define if we have lchown() */
299 +/* #undef off_t */ /* Define to long if off_t missing */
300 +/* #undef size_t */ /* Define to unsigned long if size_t missing */
301 +/* #undef ssize_t */ /* Define to long if ssize_t missing */
302 +
303
304 --- zisofs_tools/config.h.in 1970-01-01 01:00:00.000000000 +0100
305 +++ zisofs_tools/config.h.in 2002-12-27 14:48:49.000000000 +0100
306 @@ -0,0 +1,27 @@
307 +/* -*- c -*- ------------------------------------------------------------- *
308 + *
309 + * Copyright 2001 H. Peter Anvin - All Rights Reserved
310 + *
311 + * This program is free software; you can redistribute it and/or modify
312 + * it under the terms of the GNU General Public License as published by
313 + * the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139,
314 + * USA; either version 2 of the License, or (at your option) any later
315 + * version; incorporated herein by reference.
316 + *
317 + * ----------------------------------------------------------------------- */
318 +/* $Id: config.h.in,v 1.1 2001/07/27 14:37:07 hpa Exp $ */
319 +
320 +/*
321 + * config.h.in
322 + *
323 + * Pattern file for configurations
324 + */
325 +
326 +#undef HAVE_SYSEXITS_H /* Define if <sysexits.h> exists */
327 +#undef HAVE_GETOPT_H /* Define if <getopt.h> exists */
328 +#undef HAVE_GETOPT_LONG /* Define if we have getopt_long() */
329 +#undef HAVE_LCHOWN /* Define if we have lchown() */
330 +#undef off_t /* Define to long if off_t missing */
331 +#undef size_t /* Define to unsigned long if size_t missing */
332 +#undef ssize_t /* Define to long if ssize_t missing */
333 +
334
335 --- zisofs_tools/configure 1970-01-01 01:00:00.000000000 +0100
336 +++ zisofs_tools/configure 2002-12-27 14:48:49.000000000 +0100
337 @@ -0,0 +1,2186 @@
338 +#! /bin/sh
339 +
340 +# Guess values for system-dependent variables and create Makefiles.
341 +# Generated automatically using autoconf version 2.13
342 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
343 +#
344 +# This configure script is free software; the Free Software Foundation
345 +# gives unlimited permission to copy, distribute and modify it.
346 +
347 +# Defaults:
348 +ac_help=
349 +ac_default_prefix=/usr/local
350 +# Any additions from configure.in:
351 +ac_default_prefix=/usr
352 +
353 +# Initialize some variables set by options.
354 +# The variables have the same names as the options, with
355 +# dashes changed to underlines.
356 +build=NONE
357 +cache_file=./config.cache
358 +exec_prefix=NONE
359 +host=NONE
360 +no_create=
361 +nonopt=NONE
362 +no_recursion=
363 +prefix=NONE
364 +program_prefix=NONE
365 +program_suffix=NONE
366 +program_transform_name=s,x,x,
367 +silent=
368 +site=
369 +srcdir=
370 +target=NONE
371 +verbose=
372 +x_includes=NONE
373 +x_libraries=NONE
374 +bindir='${exec_prefix}/bin'
375 +sbindir='${exec_prefix}/sbin'
376 +libexecdir='${exec_prefix}/libexec'
377 +datadir='${prefix}/share'
378 +sysconfdir='${prefix}/etc'
379 +sharedstatedir='${prefix}/com'
380 +localstatedir='${prefix}/var'
381 +libdir='${exec_prefix}/lib'
382 +includedir='${prefix}/include'
383 +oldincludedir='/usr/include'
384 +infodir='${prefix}/info'
385 +mandir='${prefix}/man'
386 +
387 +# Initialize some other variables.
388 +subdirs=
389 +MFLAGS= MAKEFLAGS=
390 +SHELL=${CONFIG_SHELL-/bin/sh}
391 +# Maximum number of lines to put in a shell here document.
392 +ac_max_here_lines=12
393 +
394 +ac_prev=
395 +for ac_option
396 +do
397 +
398 + # If the previous option needs an argument, assign it.
399 + if test -n "$ac_prev"; then
400 + eval "$ac_prev=\$ac_option"
401 + ac_prev=
402 + continue
403 + fi
404 +
405 + case "$ac_option" in
406 + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
407 + *) ac_optarg= ;;
408 + esac
409 +
410 + # Accept the important Cygnus configure options, so we can diagnose typos.
411 +
412 + case "$ac_option" in
413 +
414 + -bindir | --bindir | --bindi | --bind | --bin | --bi)
415 + ac_prev=bindir ;;
416 + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
417 + bindir="$ac_optarg" ;;
418 +
419 + -build | --build | --buil | --bui | --bu)
420 + ac_prev=build ;;
421 + -build=* | --build=* | --buil=* | --bui=* | --bu=*)
422 + build="$ac_optarg" ;;
423 +
424 + -cache-file | --cache-file | --cache-fil | --cache-fi \
425 + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
426 + ac_prev=cache_file ;;
427 + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
428 + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
429 + cache_file="$ac_optarg" ;;
430 +
431 + -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
432 + ac_prev=datadir ;;
433 + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
434 + | --da=*)
435 + datadir="$ac_optarg" ;;
436 +
437 + -disable-* | --disable-*)
438 + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
439 + # Reject names that are not valid shell variable names.
440 + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
441 + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
442 + fi
443 + ac_feature=`echo $ac_feature| sed 's/-/_/g'`
444 + eval "enable_${ac_feature}=no" ;;
445 +
446 + -enable-* | --enable-*)
447 + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
448 + # Reject names that are not valid shell variable names.
449 + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
450 + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
451 + fi
452 + ac_feature=`echo $ac_feature| sed 's/-/_/g'`
453 + case "$ac_option" in
454 + *=*) ;;
455 + *) ac_optarg=yes ;;
456 + esac
457 + eval "enable_${ac_feature}='$ac_optarg'" ;;
458 +
459 + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
460 + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
461 + | --exec | --exe | --ex)
462 + ac_prev=exec_prefix ;;
463 + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
464 + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
465 + | --exec=* | --exe=* | --ex=*)
466 + exec_prefix="$ac_optarg" ;;
467 +
468 + -gas | --gas | --ga | --g)
469 + # Obsolete; use --with-gas.
470 + with_gas=yes ;;
471 +
472 + -help | --help | --hel | --he)
473 + # Omit some internal or obsolete options to make the list less imposing.
474 + # This message is too long to be a string in the A/UX 3.1 sh.
475 + cat << EOF
476 +Usage: configure [options] [host]
477 +Options: [defaults in brackets after descriptions]
478 +Configuration:
479 + --cache-file=FILE cache test results in FILE
480 + --help print this message
481 + --no-create do not create output files
482 + --quiet, --silent do not print \`checking...' messages
483 + --version print the version of autoconf that created configure
484 +Directory and file names:
485 + --prefix=PREFIX install architecture-independent files in PREFIX
486 + [$ac_default_prefix]
487 + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
488 + [same as prefix]
489 + --bindir=DIR user executables in DIR [EPREFIX/bin]
490 + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
491 + --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
492 + --datadir=DIR read-only architecture-independent data in DIR
493 + [PREFIX/share]
494 + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
495 + --sharedstatedir=DIR modifiable architecture-independent data in DIR
496 + [PREFIX/com]
497 + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
498 + --libdir=DIR object code libraries in DIR [EPREFIX/lib]
499 + --includedir=DIR C header files in DIR [PREFIX/include]
500 + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
501 + --infodir=DIR info documentation in DIR [PREFIX/info]
502 + --mandir=DIR man documentation in DIR [PREFIX/man]
503 + --srcdir=DIR find the sources in DIR [configure dir or ..]
504 + --program-prefix=PREFIX prepend PREFIX to installed program names
505 + --program-suffix=SUFFIX append SUFFIX to installed program names
506 + --program-transform-name=PROGRAM
507 + run sed PROGRAM on installed program names
508 +EOF
509 + cat << EOF
510 +Host type:
511 + --build=BUILD configure for building on BUILD [BUILD=HOST]
512 + --host=HOST configure for HOST [guessed]
513 + --target=TARGET configure for TARGET [TARGET=HOST]
514 +Features and packages:
515 + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
516 + --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
517 + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
518 + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
519 + --x-includes=DIR X include files are in DIR
520 + --x-libraries=DIR X library files are in DIR
521 +EOF
522 + if test -n "$ac_help"; then
523 + echo "--enable and --with options recognized:$ac_help"
524 + fi
525 + exit 0 ;;
526 +
527 + -host | --host | --hos | --ho)
528 + ac_prev=host ;;
529 + -host=* | --host=* | --hos=* | --ho=*)
530 + host="$ac_optarg" ;;
531 +
532 + -includedir | --includedir | --includedi | --included | --include \
533 + | --includ | --inclu | --incl | --inc)
534 + ac_prev=includedir ;;
535 + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
536 + | --includ=* | --inclu=* | --incl=* | --inc=*)
537 + includedir="$ac_optarg" ;;
538 +
539 + -infodir | --infodir | --infodi | --infod | --info | --inf)
540 + ac_prev=infodir ;;
541 + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
542 + infodir="$ac_optarg" ;;
543 +
544 + -libdir | --libdir | --libdi | --libd)
545 + ac_prev=libdir ;;
546 + -libdir=* | --libdir=* | --libdi=* | --libd=*)
547 + libdir="$ac_optarg" ;;
548 +
549 + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
550 + | --libexe | --libex | --libe)
551 + ac_prev=libexecdir ;;
552 + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
553 + | --libexe=* | --libex=* | --libe=*)
554 + libexecdir="$ac_optarg" ;;
555 +
556 + -localstatedir | --localstatedir | --localstatedi | --localstated \
557 + | --localstate | --localstat | --localsta | --localst \
558 + | --locals | --local | --loca | --loc | --lo)
559 + ac_prev=localstatedir ;;
560 + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
561 + | --localstate=* | --localstat=* | --localsta=* | --localst=* \
562 + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
563 + localstatedir="$ac_optarg" ;;
564 +
565 + -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
566 + ac_prev=mandir ;;
567 + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
568 + mandir="$ac_optarg" ;;
569 +
570 + -nfp | --nfp | --nf)
571 + # Obsolete; use --without-fp.
572 + with_fp=no ;;
573 +
574 + -no-create | --no-create | --no-creat | --no-crea | --no-cre \
575 + | --no-cr | --no-c)
576 + no_create=yes ;;
577 +
578 + -no-recursion | --no-recursion | --no-recursio | --no-recursi \
579 + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
580 + no_recursion=yes ;;
581 +
582 + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
583 + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
584 + | --oldin | --oldi | --old | --ol | --o)
585 + ac_prev=oldincludedir ;;
586 + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
587 + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
588 + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
589 + oldincludedir="$ac_optarg" ;;
590 +
591 + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
592 + ac_prev=prefix ;;
593 + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
594 + prefix="$ac_optarg" ;;
595 +
596 + -program-prefix | --program-prefix | --program-prefi | --program-pref \
597 + | --program-pre | --program-pr | --program-p)
598 + ac_prev=program_prefix ;;
599 + -program-prefix=* | --program-prefix=* | --program-prefi=* \
600 + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
601 + program_prefix="$ac_optarg" ;;
602 +
603 + -program-suffix | --program-suffix | --program-suffi | --program-suff \
604 + | --program-suf | --program-su | --program-s)
605 + ac_prev=program_suffix ;;
606 + -program-suffix=* | --program-suffix=* | --program-suffi=* \
607 + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
608 + program_suffix="$ac_optarg" ;;
609 +
610 + -program-transform-name | --program-transform-name \
611 + | --program-transform-nam | --program-transform-na \
612 + | --program-transform-n | --program-transform- \
613 + | --program-transform | --program-transfor \
614 + | --program-transfo | --program-transf \
615 + | --program-trans | --program-tran \
616 + | --progr-tra | --program-tr | --program-t)
617 + ac_prev=program_transform_name ;;
618 + -program-transform-name=* | --program-transform-name=* \
619 + | --program-transform-nam=* | --program-transform-na=* \
620 + | --program-transform-n=* | --program-transform-=* \
621 + | --program-transform=* | --program-transfor=* \
622 + | --program-transfo=* | --program-transf=* \
623 + | --program-trans=* | --program-tran=* \
624 + | --progr-tra=* | --program-tr=* | --program-t=*)
625 + program_transform_name="$ac_optarg" ;;
626 +
627 + -q | -quiet | --quiet | --quie | --qui | --qu | --q \
628 + | -silent | --silent | --silen | --sile | --sil)
629 + silent=yes ;;
630 +
631 + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
632 + ac_prev=sbindir ;;
633 + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
634 + | --sbi=* | --sb=*)
635 + sbindir="$ac_optarg" ;;
636 +
637 + -sharedstatedir | --sharedstatedir | --sharedstatedi \
638 + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
639 + | --sharedst | --shareds | --shared | --share | --shar \
640 + | --sha | --sh)
641 + ac_prev=sharedstatedir ;;
642 + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
643 + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
644 + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
645 + | --sha=* | --sh=*)
646 + sharedstatedir="$ac_optarg" ;;
647 +
648 + -site | --site | --sit)
649 + ac_prev=site ;;
650 + -site=* | --site=* | --sit=*)
651 + site="$ac_optarg" ;;
652 +
653 + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
654 + ac_prev=srcdir ;;
655 + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
656 + srcdir="$ac_optarg" ;;
657 +
658 + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
659 + | --syscon | --sysco | --sysc | --sys | --sy)
660 + ac_prev=sysconfdir ;;
661 + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
662 + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
663 + sysconfdir="$ac_optarg" ;;
664 +
665 + -target | --target | --targe | --targ | --tar | --ta | --t)
666 + ac_prev=target ;;
667 + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
668 + target="$ac_optarg" ;;
669 +
670 + -v | -verbose | --verbose | --verbos | --verbo | --verb)
671 + verbose=yes ;;
672 +
673 + -version | --version | --versio | --versi | --vers)
674 + echo "configure generated by autoconf version 2.13"
675 + exit 0 ;;
676 +
677 + -with-* | --with-*)
678 + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
679 + # Reject names that are not valid shell variable names.
680 + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
681 + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
682 + fi
683 + ac_package=`echo $ac_package| sed 's/-/_/g'`
684 + case "$ac_option" in
685 + *=*) ;;
686 + *) ac_optarg=yes ;;
687 + esac
688 + eval "with_${ac_package}='$ac_optarg'" ;;
689 +
690 + -without-* | --without-*)
691 + ac_package=`echo $ac_option|sed -e 's/-*without-//'`
692 + # Reject names that are not valid shell variable names.
693 + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
694 + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
695 + fi
696 + ac_package=`echo $ac_package| sed 's/-/_/g'`
697 + eval "with_${ac_package}=no" ;;
698 +
699 + --x)
700 + # Obsolete; use --with-x.
701 + with_x=yes ;;
702 +
703 + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
704 + | --x-incl | --x-inc | --x-in | --x-i)
705 + ac_prev=x_includes ;;
706 + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
707 + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
708 + x_includes="$ac_optarg" ;;
709 +
710 + -x-libraries | --x-libraries | --x-librarie | --x-librari \
711 + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
712 + ac_prev=x_libraries ;;
713 + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
714 + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
715 + x_libraries="$ac_optarg" ;;
716 +
717 + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
718 + ;;
719 +
720 + *)
721 + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
722 + echo "configure: warning: $ac_option: invalid host type" 1>&2
723 + fi
724 + if test "x$nonopt" != xNONE; then
725 + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
726 + fi
727 + nonopt="$ac_option"
728 + ;;
729 +
730 + esac
731 +done
732 +
733 +if test -n "$ac_prev"; then
734 + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
735 +fi
736 +
737 +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
738 +
739 +# File descriptor usage:
740 +# 0 standard input
741 +# 1 file creation
742 +# 2 errors and warnings
743 +# 3 some systems may open it to /dev/tty
744 +# 4 used on the Kubota Titan
745 +# 6 checking for... messages and results
746 +# 5 compiler messages saved in config.log
747 +if test "$silent" = yes; then
748 + exec 6>/dev/null
749 +else
750 + exec 6>&1
751 +fi
752 +exec 5>./config.log
753 +
754 +echo "\
755 +This file contains any messages produced by compilers while
756 +running configure, to aid debugging if configure makes a mistake.
757 +" 1>&5
758 +
759 +# Strip out --no-create and --no-recursion so they do not pile up.
760 +# Also quote any args containing shell metacharacters.
761 +ac_configure_args=
762 +for ac_arg
763 +do
764 + case "$ac_arg" in
765 + -no-create | --no-create | --no-creat | --no-crea | --no-cre \
766 + | --no-cr | --no-c) ;;
767 + -no-recursion | --no-recursion | --no-recursio | --no-recursi \
768 + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
769 + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
770 + ac_configure_args="$ac_configure_args '$ac_arg'" ;;
771 + *) ac_configure_args="$ac_configure_args $ac_arg" ;;
772 + esac
773 +done
774 +
775 +# NLS nuisances.
776 +# Only set these to C if already set. These must not be set unconditionally
777 +# because not all systems understand e.g. LANG=C (notably SCO).
778 +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
779 +# Non-C LC_CTYPE values break the ctype check.
780 +if test "${LANG+set}" = set; then LANG=C; export LANG; fi
781 +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
782 +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
783 +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
784 +
785 +# confdefs.h avoids OS command line length limits that DEFS can exceed.
786 +rm -rf conftest* confdefs.h
787 +# AIX cpp loses on an empty file, so make sure it contains at least a newline.
788 +echo > confdefs.h
789 +
790 +# A filename unique to this package, relative to the directory that
791 +# configure is in, which we can look for to find out if srcdir is correct.
792 +ac_unique_file=MCONFIG.in
793 +
794 +# Find the source files, if location was not specified.
795 +if test -z "$srcdir"; then
796 + ac_srcdir_defaulted=yes
797 + # Try the directory containing this script, then its parent.
798 + ac_prog=$0
799 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
800 + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
801 + srcdir=$ac_confdir
802 + if test ! -r $srcdir/$ac_unique_file; then
803 + srcdir=..
804 + fi
805 +else
806 + ac_srcdir_defaulted=no
807 +fi
808 +if test ! -r $srcdir/$ac_unique_file; then
809 + if test "$ac_srcdir_defaulted" = yes; then
810 + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
811 + else
812 + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
813 + fi
814 +fi
815 +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
816 +
817 +# Prefer explicitly selected file to automatically selected ones.
818 +if test -z "$CONFIG_SITE"; then
819 + if test "x$prefix" != xNONE; then
820 + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
821 + else
822 + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
823 + fi
824 +fi
825 +for ac_site_file in $CONFIG_SITE; do
826 + if test -r "$ac_site_file"; then
827 + echo "loading site script $ac_site_file"
828 + . "$ac_site_file"
829 + fi
830 +done
831 +
832 +if test -r "$cache_file"; then
833 + echo "loading cache $cache_file"
834 + . $cache_file
835 +else
836 + echo "creating cache $cache_file"
837 + > $cache_file
838 +fi
839 +
840 +ac_ext=c
841 +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
842 +ac_cpp='$CPP $CPPFLAGS'
843 +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
844 +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
845 +cross_compiling=$ac_cv_prog_cc_cross
846 +
847 +ac_exeext=
848 +ac_objext=o
849 +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
850 + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
851 + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
852 + ac_n= ac_c='
853 +' ac_t=' '
854 + else
855 + ac_n=-n ac_c= ac_t=
856 + fi
857 +else
858 + ac_n= ac_c='\c' ac_t=
859 +fi
860 +
861 +
862 +
863 +
864 +# Extract the first word of "gcc", so it can be a program name with args.
865 +set dummy gcc; ac_word=$2
866 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
867 +echo "configure:531: checking for $ac_word" >&5
868 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
869 + echo $ac_n "(cached) $ac_c" 1>&6
870 +else
871 + if test -n "$CC"; then
872 + ac_cv_prog_CC="$CC" # Let the user override the test.
873 +else
874 + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
875 + ac_dummy="$PATH"
876 + for ac_dir in $ac_dummy; do
877 + test -z "$ac_dir" && ac_dir=.
878 + if test -f $ac_dir/$ac_word; then
879 + ac_cv_prog_CC="gcc"
880 + break
881 + fi
882 + done
883 + IFS="$ac_save_ifs"
884 +fi
885 +fi
886 +CC="$ac_cv_prog_CC"
887 +if test -n "$CC"; then
888 + echo "$ac_t""$CC" 1>&6
889 +else
890 + echo "$ac_t""no" 1>&6
891 +fi
892 +
893 +if test -z "$CC"; then
894 + # Extract the first word of "cc", so it can be a program name with args.
895 +set dummy cc; ac_word=$2
896 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
897 +echo "configure:561: checking for $ac_word" >&5
898 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
899 + echo $ac_n "(cached) $ac_c" 1>&6
900 +else
901 + if test -n "$CC"; then
902 + ac_cv_prog_CC="$CC" # Let the user override the test.
903 +else
904 + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
905 + ac_prog_rejected=no
906 + ac_dummy="$PATH"
907 + for ac_dir in $ac_dummy; do
908 + test -z "$ac_dir" && ac_dir=.
909 + if test -f $ac_dir/$ac_word; then
910 + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
911 + ac_prog_rejected=yes
912 + continue
913 + fi
914 + ac_cv_prog_CC="cc"
915 + break
916 + fi
917 + done
918 + IFS="$ac_save_ifs"
919 +if test $ac_prog_rejected = yes; then
920 + # We found a bogon in the path, so make sure we never use it.
921 + set dummy $ac_cv_prog_CC
922 + shift
923 + if test $# -gt 0; then
924 + # We chose a different compiler from the bogus one.
925 + # However, it has the same basename, so the bogon will be chosen
926 + # first if we set CC to just the basename; use the full file name.
927 + shift
928 + set dummy "$ac_dir/$ac_word" "$@"
929 + shift
930 + ac_cv_prog_CC="$@"
931 + fi
932 +fi
933 +fi
934 +fi
935 +CC="$ac_cv_prog_CC"
936 +if test -n "$CC"; then
937 + echo "$ac_t""$CC" 1>&6
938 +else
939 + echo "$ac_t""no" 1>&6
940 +fi
941 +
942 + if test -z "$CC"; then
943 + case "`uname -s`" in
944 + *win32* | *WIN32*)
945 + # Extract the first word of "cl", so it can be a program name with args.
946 +set dummy cl; ac_word=$2
947 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
948 +echo "configure:612: checking for $ac_word" >&5
949 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
950 + echo $ac_n "(cached) $ac_c" 1>&6
951 +else
952 + if test -n "$CC"; then
953 + ac_cv_prog_CC="$CC" # Let the user override the test.
954 +else
955 + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
956 + ac_dummy="$PATH"
957 + for ac_dir in $ac_dummy; do
958 + test -z "$ac_dir" && ac_dir=.
959 + if test -f $ac_dir/$ac_word; then
960 + ac_cv_prog_CC="cl"
961 + break
962 + fi
963 + done
964 + IFS="$ac_save_ifs"
965 +fi
966 +fi
967 +CC="$ac_cv_prog_CC"
968 +if test -n "$CC"; then
969 + echo "$ac_t""$CC" 1>&6
970 +else
971 + echo "$ac_t""no" 1>&6
972 +fi
973 + ;;
974 + esac
975 + fi
976 + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
977 +fi
978 +
979 +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
980 +echo "configure:644: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
981 +
982 +ac_ext=c
983 +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
984 +ac_cpp='$CPP $CPPFLAGS'
985 +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
986 +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
987 +cross_compiling=$ac_cv_prog_cc_cross
988 +
989 +cat > conftest.$ac_ext << EOF
990 +
991 +#line 655 "configure"
992 +#include "confdefs.h"
993 +
994 +main(){return(0);}
995 +EOF
996 +if { (eval echo configure:660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
997 + ac_cv_prog_cc_works=yes
998 + # If we can't run a trivial program, we are probably using a cross compiler.
999 + if (./conftest; exit) 2>/dev/null; then
1000 + ac_cv_prog_cc_cross=no
1001 + else
1002 + ac_cv_prog_cc_cross=yes
1003 + fi
1004 +else
1005 + echo "configure: failed program was:" >&5
1006 + cat conftest.$ac_ext >&5
1007 + ac_cv_prog_cc_works=no
1008 +fi
1009 +rm -fr conftest*
1010 +ac_ext=c
1011 +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1012 +ac_cpp='$CPP $CPPFLAGS'
1013 +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1014 +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1015 +cross_compiling=$ac_cv_prog_cc_cross
1016 +
1017 +echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1018 +if test $ac_cv_prog_cc_works = no; then
1019 + { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1020 +fi
1021 +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1022 +echo "configure:686: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1023 +echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1024 +cross_compiling=$ac_cv_prog_cc_cross
1025 +
1026 +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1027 +echo "configure:691: checking whether we are using GNU C" >&5
1028 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
1029 + echo $ac_n "(cached) $ac_c" 1>&6
1030 +else
1031 + cat > conftest.c <<EOF
1032 +#ifdef __GNUC__
1033 + yes;
1034 +#endif
1035 +EOF
1036 +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:700: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1037 + ac_cv_prog_gcc=yes
1038 +else
1039 + ac_cv_prog_gcc=no
1040 +fi
1041 +fi
1042 +
1043 +echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1044 +
1045 +if test $ac_cv_prog_gcc = yes; then
1046 + GCC=yes
1047 +else
1048 + GCC=
1049 +fi
1050 +
1051 +ac_test_CFLAGS="${CFLAGS+set}"
1052 +ac_save_CFLAGS="$CFLAGS"
1053 +CFLAGS=
1054 +echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1055 +echo "configure:719: checking whether ${CC-cc} accepts -g" >&5
1056 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
1057 + echo $ac_n "(cached) $ac_c" 1>&6
1058 +else
1059 + echo 'void f(){}' > conftest.c
1060 +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1061 + ac_cv_prog_cc_g=yes
1062 +else
1063 + ac_cv_prog_cc_g=no
1064 +fi
1065 +rm -f conftest*
1066 +
1067 +fi
1068 +
1069 +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1070 +if test "$ac_test_CFLAGS" = set; then
1071 + CFLAGS="$ac_save_CFLAGS"
1072 +elif test $ac_cv_prog_cc_g = yes; then
1073 + if test "$GCC" = yes; then
1074 + CFLAGS="-g -O2"
1075 + else
1076 + CFLAGS="-g"
1077 + fi
1078 +else
1079 + if test "$GCC" = yes; then
1080 + CFLAGS="-O2"
1081 + else
1082 + CFLAGS=
1083 + fi
1084 +fi
1085 +
1086 +echo $ac_n "checking for working const""... $ac_c" 1>&6
1087 +echo "configure:751: checking for working const" >&5
1088 +if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
1089 + echo $ac_n "(cached) $ac_c" 1>&6
1090 +else
1091 + cat > conftest.$ac_ext <<EOF
1092 +#line 756 "configure"
1093 +#include "confdefs.h"
1094 +
1095 +int main() {
1096 +
1097 +/* Ultrix mips cc rejects this. */
1098 +typedef int charset[2]; const charset x;
1099 +/* SunOS 4.1.1 cc rejects this. */
1100 +char const *const *ccp;
1101 +char **p;
1102 +/* NEC SVR4.0.2 mips cc rejects this. */
1103 +struct point {int x, y;};
1104 +static struct point const zero = {0,0};
1105 +/* AIX XL C 1.02.0.0 rejects this.
1106 + It does not let you subtract one const X* pointer from another in an arm
1107 + of an if-expression whose if-part is not a constant expression */
1108 +const char *g = "string";
1109 +ccp = &g + (g ? g-g : 0);
1110 +/* HPUX 7.0 cc rejects these. */
1111 +++ccp;
1112 +p = (char**) ccp;
1113 +ccp = (char const *const *) p;
1114 +{ /* SCO 3.2v4 cc rejects this. */
1115 + char *t;
1116 + char const *s = 0 ? (char *) 0 : (char const *) 0;
1117 +
1118 + *t++ = 0;
1119 +}
1120 +{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
1121 + int x[] = {25, 17};
1122 + const int *foo = &x[0];
1123 + ++foo;
1124 +}
1125 +{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
1126 + typedef const int *iptr;
1127 + iptr p = 0;
1128 + ++p;
1129 +}
1130 +{ /* AIX XL C 1.02.0.0 rejects this saying
1131 + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
1132 + struct s { int j; const int *ap[3]; };
1133 + struct s *b; b->j = 5;
1134 +}
1135 +{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
1136 + const int foo = 10;
1137 +}
1138 +
1139 +; return 0; }
1140 +EOF
1141 +if { (eval echo configure:805: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1142 + rm -rf conftest*
1143 + ac_cv_c_const=yes
1144 +else
1145 + echo "configure: failed program was:" >&5
1146 + cat conftest.$ac_ext >&5
1147 + rm -rf conftest*
1148 + ac_cv_c_const=no
1149 +fi
1150 +rm -f conftest*
1151 +fi
1152 +
1153 +echo "$ac_t""$ac_cv_c_const" 1>&6
1154 +if test $ac_cv_c_const = no; then
1155 + cat >> confdefs.h <<\EOF
1156 +#define const
1157 +EOF
1158 +
1159 +fi
1160 +
1161 +echo $ac_n "checking for inline""... $ac_c" 1>&6
1162 +echo "configure:826: checking for inline" >&5
1163 +if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
1164 + echo $ac_n "(cached) $ac_c" 1>&6
1165 +else
1166 + ac_cv_c_inline=no
1167 +for ac_kw in inline __inline__ __inline; do
1168 + cat > conftest.$ac_ext <<EOF
1169 +#line 833 "configure"
1170 +#include "confdefs.h"
1171 +
1172 +int main() {
1173 +} $ac_kw foo() {
1174 +; return 0; }
1175 +EOF
1176 +if { (eval echo configure:840: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1177 + rm -rf conftest*
1178 + ac_cv_c_inline=$ac_kw; break
1179 +else
1180 + echo "configure: failed program was:" >&5
1181 + cat conftest.$ac_ext >&5
1182 +fi
1183 +rm -f conftest*
1184 +done
1185 +
1186 +fi
1187 +
1188 +echo "$ac_t""$ac_cv_c_inline" 1>&6
1189 +case "$ac_cv_c_inline" in
1190 + inline | yes) ;;
1191 + no) cat >> confdefs.h <<\EOF
1192 +#define inline
1193 +EOF
1194 + ;;
1195 + *) cat >> confdefs.h <<EOF
1196 +#define inline $ac_cv_c_inline
1197 +EOF
1198 + ;;
1199 +esac
1200 +
1201 +
1202 +echo $ac_n "checking if $CC accepts -Wall""... $ac_c" 1>&6
1203 +echo "configure:867: checking if $CC accepts -Wall" >&5
1204 + pa_add_cflags__old_cflags="$CFLAGS"
1205 + CFLAGS="$CFLAGS -Wall"
1206 + cat > conftest.$ac_ext <<EOF
1207 +#line 871 "configure"
1208 +#include "confdefs.h"
1209 +#include <stdio.h>
1210 +int main() {
1211 +printf("Hello, World!\n");
1212 +; return 0; }
1213 +EOF
1214 +if { (eval echo configure:878: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1215 + rm -rf conftest*
1216 + echo "$ac_t""yes" 1>&6
1217 +else
1218 + echo "configure: failed program was:" >&5
1219 + cat conftest.$ac_ext >&5
1220 + rm -rf conftest*
1221 + echo "$ac_t""no" 1>&6
1222 + CFLAGS="$pa_add_cflags__old_cflags"
1223 +fi
1224 +rm -f conftest*
1225 +echo $ac_n "checking if $CC accepts -W""... $ac_c" 1>&6
1226 +echo "configure:890: checking if $CC accepts -W" >&5
1227 + pa_add_cflags__old_cflags="$CFLAGS"
1228 + CFLAGS="$CFLAGS -W"
1229 + cat > conftest.$ac_ext <<EOF
1230 +#line 894 "configure"
1231 +#include "confdefs.h"
1232 +#include <stdio.h>
1233 +int main() {
1234 +printf("Hello, World!\n");
1235 +; return 0; }
1236 +EOF
1237 +if { (eval echo configure:901: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1238 + rm -rf conftest*
1239 + echo "$ac_t""yes" 1>&6
1240 +else
1241 + echo "configure: failed program was:" >&5
1242 + cat conftest.$ac_ext >&5
1243 + rm -rf conftest*
1244 + echo "$ac_t""no" 1>&6
1245 + CFLAGS="$pa_add_cflags__old_cflags"
1246 +fi
1247 +rm -f conftest*
1248 +echo $ac_n "checking if $CC accepts -Wpointer-arith""... $ac_c" 1>&6
1249 +echo "configure:913: checking if $CC accepts -Wpointer-arith" >&5
1250 + pa_add_cflags__old_cflags="$CFLAGS"
1251 + CFLAGS="$CFLAGS -Wpointer-arith"
1252 + cat > conftest.$ac_ext <<EOF
1253 +#line 917 "configure"
1254 +#include "confdefs.h"
1255 +#include <stdio.h>
1256 +int main() {
1257 +printf("Hello, World!\n");
1258 +; return 0; }
1259 +EOF
1260 +if { (eval echo configure:924: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1261 + rm -rf conftest*
1262 + echo "$ac_t""yes" 1>&6
1263 +else
1264 + echo "configure: failed program was:" >&5
1265 + cat conftest.$ac_ext >&5
1266 + rm -rf conftest*
1267 + echo "$ac_t""no" 1>&6
1268 + CFLAGS="$pa_add_cflags__old_cflags"
1269 +fi
1270 +rm -f conftest*
1271 +echo $ac_n "checking if $CC accepts -Wbad-function-cast""... $ac_c" 1>&6
1272 +echo "configure:936: checking if $CC accepts -Wbad-function-cast" >&5
1273 + pa_add_cflags__old_cflags="$CFLAGS"
1274 + CFLAGS="$CFLAGS -Wbad-function-cast"
1275 + cat > conftest.$ac_ext <<EOF
1276 +#line 940 "configure"
1277 +#include "confdefs.h"
1278 +#include <stdio.h>
1279 +int main() {
1280 +printf("Hello, World!\n");
1281 +; return 0; }
1282 +EOF
1283 +if { (eval echo configure:947: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1284 + rm -rf conftest*
1285 + echo "$ac_t""yes" 1>&6
1286 +else
1287 + echo "configure: failed program was:" >&5
1288 + cat conftest.$ac_ext >&5
1289 + rm -rf conftest*
1290 + echo "$ac_t""no" 1>&6
1291 + CFLAGS="$pa_add_cflags__old_cflags"
1292 +fi
1293 +rm -f conftest*
1294 +echo $ac_n "checking if $CC accepts -Wcast-equal""... $ac_c" 1>&6
1295 +echo "configure:959: checking if $CC accepts -Wcast-equal" >&5
1296 + pa_add_cflags__old_cflags="$CFLAGS"
1297 + CFLAGS="$CFLAGS -Wcast-equal"
1298 + cat > conftest.$ac_ext <<EOF
1299 +#line 963 "configure"
1300 +#include "confdefs.h"
1301 +#include <stdio.h>
1302 +int main() {
1303 +printf("Hello, World!\n");
1304 +; return 0; }
1305 +EOF
1306 +if { (eval echo configure:970: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1307 + rm -rf conftest*
1308 + echo "$ac_t""yes" 1>&6
1309 +else
1310 + echo "configure: failed program was:" >&5
1311 + cat conftest.$ac_ext >&5
1312 + rm -rf conftest*
1313 + echo "$ac_t""no" 1>&6
1314 + CFLAGS="$pa_add_cflags__old_cflags"
1315 +fi
1316 +rm -f conftest*
1317 +echo $ac_n "checking if $CC accepts -Wstrict-prototypes""... $ac_c" 1>&6
1318 +echo "configure:982: checking if $CC accepts -Wstrict-prototypes" >&5
1319 + pa_add_cflags__old_cflags="$CFLAGS"
1320 + CFLAGS="$CFLAGS -Wstrict-prototypes"
1321 + cat > conftest.$ac_ext <<EOF
1322 +#line 986 "configure"
1323 +#include "confdefs.h"
1324 +#include <stdio.h>
1325 +int main() {
1326 +printf("Hello, World!\n");
1327 +; return 0; }
1328 +EOF
1329 +if { (eval echo configure:993: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1330 + rm -rf conftest*
1331 + echo "$ac_t""yes" 1>&6
1332 +else
1333 + echo "configure: failed program was:" >&5
1334 + cat conftest.$ac_ext >&5
1335 + rm -rf conftest*
1336 + echo "$ac_t""no" 1>&6
1337 + CFLAGS="$pa_add_cflags__old_cflags"
1338 +fi
1339 +rm -f conftest*
1340 +echo $ac_n "checking if $CC accepts -Wmissing-prototypes""... $ac_c" 1>&6
1341 +echo "configure:1005: checking if $CC accepts -Wmissing-prototypes" >&5
1342 + pa_add_cflags__old_cflags="$CFLAGS"
1343 + CFLAGS="$CFLAGS -Wmissing-prototypes"
1344 + cat > conftest.$ac_ext <<EOF
1345 +#line 1009 "configure"
1346 +#include "confdefs.h"
1347 +#include <stdio.h>
1348 +int main() {
1349 +printf("Hello, World!\n");
1350 +; return 0; }
1351 +EOF
1352 +if { (eval echo configure:1016: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1353 + rm -rf conftest*
1354 + echo "$ac_t""yes" 1>&6
1355 +else
1356 + echo "configure: failed program was:" >&5
1357 + cat conftest.$ac_ext >&5
1358 + rm -rf conftest*
1359 + echo "$ac_t""no" 1>&6
1360 + CFLAGS="$pa_add_cflags__old_cflags"
1361 +fi
1362 +rm -f conftest*
1363 +echo $ac_n "checking if $CC accepts -Wmissing-declarations""... $ac_c" 1>&6
1364 +echo "configure:1028: checking if $CC accepts -Wmissing-declarations" >&5
1365 + pa_add_cflags__old_cflags="$CFLAGS"
1366 + CFLAGS="$CFLAGS -Wmissing-declarations"
1367 + cat > conftest.$ac_ext <<EOF
1368 +#line 1032 "configure"
1369 +#include "confdefs.h"
1370 +#include <stdio.h>
1371 +int main() {
1372 +printf("Hello, World!\n");
1373 +; return 0; }
1374 +EOF
1375 +if { (eval echo configure:1039: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1376 + rm -rf conftest*
1377 + echo "$ac_t""yes" 1>&6
1378 +else
1379 + echo "configure: failed program was:" >&5
1380 + cat conftest.$ac_ext >&5
1381 + rm -rf conftest*
1382 + echo "$ac_t""no" 1>&6
1383 + CFLAGS="$pa_add_cflags__old_cflags"
1384 +fi
1385 +rm -f conftest*
1386 +echo $ac_n "checking if $CC accepts -Wnested-externs""... $ac_c" 1>&6
1387 +echo "configure:1051: checking if $CC accepts -Wnested-externs" >&5
1388 + pa_add_cflags__old_cflags="$CFLAGS"
1389 + CFLAGS="$CFLAGS -Wnested-externs"
1390 + cat > conftest.$ac_ext <<EOF
1391 +#line 1055 "configure"
1392 +#include "confdefs.h"
1393 +#include <stdio.h>
1394 +int main() {
1395 +printf("Hello, World!\n");
1396 +; return 0; }
1397 +EOF
1398 +if { (eval echo configure:1062: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1399 + rm -rf conftest*
1400 + echo "$ac_t""yes" 1>&6
1401 +else
1402 + echo "configure: failed program was:" >&5
1403 + cat conftest.$ac_ext >&5
1404 + rm -rf conftest*
1405 + echo "$ac_t""no" 1>&6
1406 + CFLAGS="$pa_add_cflags__old_cflags"
1407 +fi
1408 +rm -f conftest*
1409 +echo $ac_n "checking if $CC accepts -Winline""... $ac_c" 1>&6
1410 +echo "configure:1074: checking if $CC accepts -Winline" >&5
1411 + pa_add_cflags__old_cflags="$CFLAGS"
1412 + CFLAGS="$CFLAGS -Winline"
1413 + cat > conftest.$ac_ext <<EOF
1414 +#line 1078 "configure"
1415 +#include "confdefs.h"
1416 +#include <stdio.h>
1417 +int main() {
1418 +printf("Hello, World!\n");
1419 +; return 0; }
1420 +EOF
1421 +if { (eval echo configure:1085: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1422 + rm -rf conftest*
1423 + echo "$ac_t""yes" 1>&6
1424 +else
1425 + echo "configure: failed program was:" >&5
1426 + cat conftest.$ac_ext >&5
1427 + rm -rf conftest*
1428 + echo "$ac_t""no" 1>&6
1429 + CFLAGS="$pa_add_cflags__old_cflags"
1430 +fi
1431 +rm -f conftest*
1432 +echo $ac_n "checking if $CC accepts -Wshadow""... $ac_c" 1>&6
1433 +echo "configure:1097: checking if $CC accepts -Wshadow" >&5
1434 + pa_add_cflags__old_cflags="$CFLAGS"
1435 + CFLAGS="$CFLAGS -Wshadow"
1436 + cat > conftest.$ac_ext <<EOF
1437 +#line 1101 "configure"
1438 +#include "confdefs.h"
1439 +#include <stdio.h>
1440 +int main() {
1441 +printf("Hello, World!\n");
1442 +; return 0; }
1443 +EOF
1444 +if { (eval echo configure:1108: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1445 + rm -rf conftest*
1446 + echo "$ac_t""yes" 1>&6
1447 +else
1448 + echo "configure: failed program was:" >&5
1449 + cat conftest.$ac_ext >&5
1450 + rm -rf conftest*
1451 + echo "$ac_t""no" 1>&6
1452 + CFLAGS="$pa_add_cflags__old_cflags"
1453 +fi
1454 +rm -f conftest*
1455 +echo $ac_n "checking if $CC accepts -Wcast-align""... $ac_c" 1>&6
1456 +echo "configure:1120: checking if $CC accepts -Wcast-align" >&5
1457 + pa_add_cflags__old_cflags="$CFLAGS"
1458 + CFLAGS="$CFLAGS -Wcast-align"
1459 + cat > conftest.$ac_ext <<EOF
1460 +#line 1124 "configure"
1461 +#include "confdefs.h"
1462 +#include <stdio.h>
1463 +int main() {
1464 +printf("Hello, World!\n");
1465 +; return 0; }
1466 +EOF
1467 +if { (eval echo configure:1131: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1468 + rm -rf conftest*
1469 + echo "$ac_t""yes" 1>&6
1470 +else
1471 + echo "configure: failed program was:" >&5
1472 + cat conftest.$ac_ext >&5
1473 + rm -rf conftest*
1474 + echo "$ac_t""no" 1>&6
1475 + CFLAGS="$pa_add_cflags__old_cflags"
1476 +fi
1477 +rm -f conftest*
1478 +echo $ac_n "checking if $CC accepts -pipe""... $ac_c" 1>&6
1479 +echo "configure:1143: checking if $CC accepts -pipe" >&5
1480 + pa_add_cflags__old_cflags="$CFLAGS"
1481 + CFLAGS="$CFLAGS -pipe"
1482 + cat > conftest.$ac_ext <<EOF
1483 +#line 1147 "configure"
1484 +#include "confdefs.h"
1485 +#include <stdio.h>
1486 +int main() {
1487 +printf("Hello, World!\n");
1488 +; return 0; }
1489 +EOF
1490 +if { (eval echo configure:1154: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1491 + rm -rf conftest*
1492 + echo "$ac_t""yes" 1>&6
1493 +else
1494 + echo "configure: failed program was:" >&5
1495 + cat conftest.$ac_ext >&5
1496 + rm -rf conftest*
1497 + echo "$ac_t""no" 1>&6
1498 + CFLAGS="$pa_add_cflags__old_cflags"
1499 +fi
1500 +rm -f conftest*
1501 +
1502 +echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
1503 +echo "configure:1167: checking how to run the C preprocessor" >&5
1504 +# On Suns, sometimes $CPP names a directory.
1505 +if test -n "$CPP" && test -d "$CPP"; then
1506 + CPP=
1507 +fi
1508 +if test -z "$CPP"; then
1509 +if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
1510 + echo $ac_n "(cached) $ac_c" 1>&6
1511 +else
1512 + # This must be in double quotes, not single quotes, because CPP may get
1513 + # substituted into the Makefile and "${CC-cc}" will confuse make.
1514 + CPP="${CC-cc} -E"
1515 + # On the NeXT, cc -E runs the code through the compiler's parser,
1516 + # not just through cpp.
1517 + cat > conftest.$ac_ext <<EOF
1518 +#line 1182 "configure"
1519 +#include "confdefs.h"
1520 +#include <assert.h>
1521 +Syntax Error
1522 +EOF
1523 +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1524 +{ (eval echo configure:1188: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1525 +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1526 +if test -z "$ac_err"; then
1527 + :
1528 +else
1529 + echo "$ac_err" >&5
1530 + echo "configure: failed program was:" >&5
1531 + cat conftest.$ac_ext >&5
1532 + rm -rf conftest*
1533 + CPP="${CC-cc} -E -traditional-cpp"
1534 + cat > conftest.$ac_ext <<EOF
1535 +#line 1199 "configure"
1536 +#include "confdefs.h"
1537 +#include <assert.h>
1538 +Syntax Error
1539 +EOF
1540 +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1541 +{ (eval echo configure:1205: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1542 +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1543 +if test -z "$ac_err"; then
1544 + :
1545 +else
1546 + echo "$ac_err" >&5
1547 + echo "configure: failed program was:" >&5
1548 + cat conftest.$ac_ext >&5
1549 + rm -rf conftest*
1550 + CPP="${CC-cc} -nologo -E"
1551 + cat > conftest.$ac_ext <<EOF
1552 +#line 1216 "configure"
1553 +#include "confdefs.h"
1554 +#include <assert.h>
1555 +Syntax Error
1556 +EOF
1557 +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1558 +{ (eval echo configure:1222: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1559 +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1560 +if test -z "$ac_err"; then
1561 + :
1562 +else
1563 + echo "$ac_err" >&5
1564 + echo "configure: failed program was:" >&5
1565 + cat conftest.$ac_ext >&5
1566 + rm -rf conftest*
1567 + CPP=/lib/cpp
1568 +fi
1569 +rm -f conftest*
1570 +fi
1571 +rm -f conftest*
1572 +fi
1573 +rm -f conftest*
1574 + ac_cv_prog_CPP="$CPP"
1575 +fi
1576 + CPP="$ac_cv_prog_CPP"
1577 +else
1578 + ac_cv_prog_CPP="$CPP"
1579 +fi
1580 +echo "$ac_t""$CPP" 1>&6
1581 +
1582 +for ac_hdr in sysexits.h
1583 +do
1584 +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1585 +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1586 +echo "configure:1250: checking for $ac_hdr" >&5
1587 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1588 + echo $ac_n "(cached) $ac_c" 1>&6
1589 +else
1590 + cat > conftest.$ac_ext <<EOF
1591 +#line 1255 "configure"
1592 +#include "confdefs.h"
1593 +#include <$ac_hdr>
1594 +EOF
1595 +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1596 +{ (eval echo configure:1260: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1597 +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1598 +if test -z "$ac_err"; then
1599 + rm -rf conftest*
1600 + eval "ac_cv_header_$ac_safe=yes"
1601 +else
1602 + echo "$ac_err" >&5
1603 + echo "configure: failed program was:" >&5
1604 + cat conftest.$ac_ext >&5
1605 + rm -rf conftest*
1606 + eval "ac_cv_header_$ac_safe=no"
1607 +fi
1608 +rm -f conftest*
1609 +fi
1610 +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1611 + echo "$ac_t""yes" 1>&6
1612 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1613 + cat >> confdefs.h <<EOF
1614 +#define $ac_tr_hdr 1
1615 +EOF
1616 +
1617 +else
1618 + echo "$ac_t""no" 1>&6
1619 +fi
1620 +done
1621 +
1622 +for ac_hdr in getopt.h
1623 +do
1624 +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1625 +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1626 +echo "configure:1290: checking for $ac_hdr" >&5
1627 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1628 + echo $ac_n "(cached) $ac_c" 1>&6
1629 +else
1630 + cat > conftest.$ac_ext <<EOF
1631 +#line 1295 "configure"
1632 +#include "confdefs.h"
1633 +#include <$ac_hdr>
1634 +EOF
1635 +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1636 +{ (eval echo configure:1300: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1637 +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1638 +if test -z "$ac_err"; then
1639 + rm -rf conftest*
1640 + eval "ac_cv_header_$ac_safe=yes"
1641 +else
1642 + echo "$ac_err" >&5
1643 + echo "configure: failed program was:" >&5
1644 + cat conftest.$ac_ext >&5
1645 + rm -rf conftest*
1646 + eval "ac_cv_header_$ac_safe=no"
1647 +fi
1648 +rm -f conftest*
1649 +fi
1650 +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1651 + echo "$ac_t""yes" 1>&6
1652 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1653 + cat >> confdefs.h <<EOF
1654 +#define $ac_tr_hdr 1
1655 +EOF
1656 +
1657 +else
1658 + echo "$ac_t""no" 1>&6
1659 +fi
1660 +done
1661 +
1662 +
1663 +echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
1664 +echo "configure:1328: checking for ANSI C header files" >&5
1665 +if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
1666 + echo $ac_n "(cached) $ac_c" 1>&6
1667 +else
1668 + cat > conftest.$ac_ext <<EOF
1669 +#line 1333 "configure"
1670 +#include "confdefs.h"
1671 +#include <stdlib.h>
1672 +#include <stdarg.h>
1673 +#include <string.h>
1674 +#include <float.h>
1675 +EOF
1676 +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1677 +{ (eval echo configure:1341: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1678 +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1679 +if test -z "$ac_err"; then
1680 + rm -rf conftest*
1681 + ac_cv_header_stdc=yes
1682 +else
1683 + echo "$ac_err" >&5
1684 + echo "configure: failed program was:" >&5
1685 + cat conftest.$ac_ext >&5
1686 + rm -rf conftest*
1687 + ac_cv_header_stdc=no
1688 +fi
1689 +rm -f conftest*
1690 +
1691 +if test $ac_cv_header_stdc = yes; then
1692 + # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
1693 +cat > conftest.$ac_ext <<EOF
1694 +#line 1358 "configure"
1695 +#include "confdefs.h"
1696 +#include <string.h>
1697 +EOF
1698 +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1699 + egrep "memchr" >/dev/null 2>&1; then
1700 + :
1701 +else
1702 + rm -rf conftest*
1703 + ac_cv_header_stdc=no
1704 +fi
1705 +rm -f conftest*
1706 +
1707 +fi
1708 +
1709 +if test $ac_cv_header_stdc = yes; then
1710 + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
1711 +cat > conftest.$ac_ext <<EOF
1712 +#line 1376 "configure"
1713 +#include "confdefs.h"
1714 +#include <stdlib.h>
1715 +EOF
1716 +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1717 + egrep "free" >/dev/null 2>&1; then
1718 + :
1719 +else
1720 + rm -rf conftest*
1721 + ac_cv_header_stdc=no
1722 +fi
1723 +rm -f conftest*
1724 +
1725 +fi
1726 +
1727 +if test $ac_cv_header_stdc = yes; then
1728 + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
1729 +if test "$cross_compiling" = yes; then
1730 + :
1731 +else
1732 + cat > conftest.$ac_ext <<EOF
1733 +#line 1397 "configure"
1734 +#include "confdefs.h"
1735 +#include <ctype.h>
1736 +#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
1737 +#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
1738 +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
1739 +int main () { int i; for (i = 0; i < 256; i++)
1740 +if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
1741 +exit (0); }
1742 +
1743 +EOF
1744 +if { (eval echo configure:1408: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
1745 +then
1746 + :
1747 +else
1748 + echo "configure: failed program was:" >&5
1749 + cat conftest.$ac_ext >&5
1750 + rm -fr conftest*
1751 + ac_cv_header_stdc=no
1752 +fi
1753 +rm -fr conftest*
1754 +fi
1755 +
1756 +fi
1757 +fi
1758 +
1759 +echo "$ac_t""$ac_cv_header_stdc" 1>&6
1760 +if test $ac_cv_header_stdc = yes; then
1761 + cat >> confdefs.h <<\EOF
1762 +#define STDC_HEADERS 1
1763 +EOF
1764 +
1765 +fi
1766 +
1767 +echo $ac_n "checking for off_t""... $ac_c" 1>&6
1768 +echo "configure:1432: checking for off_t" >&5
1769 +if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
1770 + echo $ac_n "(cached) $ac_c" 1>&6
1771 +else
1772 + cat > conftest.$ac_ext <<EOF
1773 +#line 1437 "configure"
1774 +#include "confdefs.h"
1775 +#include <sys/types.h>
1776 +#if STDC_HEADERS
1777 +#include <stdlib.h>
1778 +#include <stddef.h>
1779 +#endif
1780 +EOF
1781 +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1782 + egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
1783 + rm -rf conftest*
1784 + ac_cv_type_off_t=yes
1785 +else
1786 + rm -rf conftest*
1787 + ac_cv_type_off_t=no
1788 +fi
1789 +rm -f conftest*
1790 +
1791 +fi
1792 +echo "$ac_t""$ac_cv_type_off_t" 1>&6
1793 +if test $ac_cv_type_off_t = no; then
1794 + cat >> confdefs.h <<\EOF
1795 +#define off_t signed long
1796 +EOF
1797 +
1798 +fi
1799 +
1800 +echo $ac_n "checking for size_t""... $ac_c" 1>&6
1801 +echo "configure:1465: checking for size_t" >&5
1802 +if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
1803 + echo $ac_n "(cached) $ac_c" 1>&6
1804 +else
1805 + cat > conftest.$ac_ext <<EOF
1806 +#line 1470 "configure"
1807 +#include "confdefs.h"
1808 +#include <sys/types.h>
1809 +#if STDC_HEADERS
1810 +#include <stdlib.h>
1811 +#include <stddef.h>
1812 +#endif
1813 +EOF
1814 +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1815 + egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
1816 + rm -rf conftest*
1817 + ac_cv_type_size_t=yes
1818 +else
1819 + rm -rf conftest*
1820 + ac_cv_type_size_t=no
1821 +fi
1822 +rm -f conftest*
1823 +
1824 +fi
1825 +echo "$ac_t""$ac_cv_type_size_t" 1>&6
1826 +if test $ac_cv_type_size_t = no; then
1827 + cat >> confdefs.h <<\EOF
1828 +#define size_t unsigned long
1829 +EOF
1830 +
1831 +fi
1832 +
1833 +echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
1834 +echo "configure:1498: checking for ssize_t" >&5
1835 +if eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then
1836 + echo $ac_n "(cached) $ac_c" 1>&6
1837 +else
1838 + cat > conftest.$ac_ext <<EOF
1839 +#line 1503 "configure"
1840 +#include "confdefs.h"
1841 +#include <sys/types.h>
1842 +#if STDC_HEADERS
1843 +#include <stdlib.h>
1844 +#include <stddef.h>
1845 +#endif
1846 +EOF
1847 +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1848 + egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
1849 + rm -rf conftest*
1850 + ac_cv_type_ssize_t=yes
1851 +else
1852 + rm -rf conftest*
1853 + ac_cv_type_ssize_t=no
1854 +fi
1855 +rm -f conftest*
1856 +
1857 +fi
1858 +echo "$ac_t""$ac_cv_type_ssize_t" 1>&6
1859 +if test $ac_cv_type_ssize_t = no; then
1860 + cat >> confdefs.h <<\EOF
1861 +#define ssize_t signed long
1862 +EOF
1863 +
1864 +fi
1865 +
1866 +
1867 +for ac_func in lchown
1868 +do
1869 +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1870 +echo "configure:1534: checking for $ac_func" >&5
1871 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1872 + echo $ac_n "(cached) $ac_c" 1>&6
1873 +else
1874 + cat > conftest.$ac_ext <<EOF
1875 +#line 1539 "configure"
1876 +#include "confdefs.h"
1877 +/* System header to define __stub macros and hopefully few prototypes,
1878 + which can conflict with char $ac_func(); below. */
1879 +#include <assert.h>
1880 +/* Override any gcc2 internal prototype to avoid an error. */
1881 +/* We use char because int might match the return type of a gcc2
1882 + builtin and then its argument prototype would still apply. */
1883 +char $ac_func();
1884 +
1885 +int main() {
1886 +
1887 +/* The GNU C library defines this for functions which it implements
1888 + to always fail with ENOSYS. Some functions are actually named
1889 + something starting with __ and the normal name is an alias. */
1890 +#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1891 +choke me
1892 +#else
1893 +$ac_func();
1894 +#endif
1895 +
1896 +; return 0; }
1897 +EOF
1898 +if { (eval echo configure:1562: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1899 + rm -rf conftest*
1900 + eval "ac_cv_func_$ac_func=yes"
1901 +else
1902 + echo "configure: failed program was:" >&5
1903 + cat conftest.$ac_ext >&5
1904 + rm -rf conftest*
1905 + eval "ac_cv_func_$ac_func=no"
1906 +fi
1907 +rm -f conftest*
1908 +fi
1909 +
1910 +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1911 + echo "$ac_t""yes" 1>&6
1912 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1913 + cat >> confdefs.h <<EOF
1914 +#define $ac_tr_func 1
1915 +EOF
1916 +
1917 +else
1918 + echo "$ac_t""no" 1>&6
1919 +fi
1920 +done
1921 +
1922 +
1923 +
1924 +echo $ac_n "checking for library containing compress2""... $ac_c" 1>&6
1925 +echo "configure:1589: checking for library containing compress2" >&5
1926 +if eval "test \"`echo '$''{'ac_cv_search_compress2'+set}'`\" = set"; then
1927 + echo $ac_n "(cached) $ac_c" 1>&6
1928 +else
1929 + ac_func_search_save_LIBS="$LIBS"
1930 +ac_cv_search_compress2="no"
1931 +cat > conftest.$ac_ext <<EOF
1932 +#line 1596 "configure"
1933 +#include "confdefs.h"
1934 +/* Override any gcc2 internal prototype to avoid an error. */
1935 +/* We use char because int might match the return type of a gcc2
1936 + builtin and then its argument prototype would still apply. */
1937 +char compress2();
1938 +
1939 +int main() {
1940 +compress2()
1941 +; return 0; }
1942 +EOF
1943 +if { (eval echo configure:1607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1944 + rm -rf conftest*
1945 + ac_cv_search_compress2="none required"
1946 +else
1947 + echo "configure: failed program was:" >&5
1948 + cat conftest.$ac_ext >&5
1949 +fi
1950 +rm -f conftest*
1951 +test "$ac_cv_search_compress2" = "no" && for i in z; do
1952 +LIBS="-l$i $ac_func_search_save_LIBS"
1953 +cat > conftest.$ac_ext <<EOF
1954 +#line 1618 "configure"
1955 +#include "confdefs.h"
1956 +/* Override any gcc2 internal prototype to avoid an error. */
1957 +/* We use char because int might match the return type of a gcc2
1958 + builtin and then its argument prototype would still apply. */
1959 +char compress2();
1960 +
1961 +int main() {
1962 +compress2()
1963 +; return 0; }
1964 +EOF
1965 +if { (eval echo configure:1629: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1966 + rm -rf conftest*
1967 + ac_cv_search_compress2="-l$i"
1968 +break
1969 +else
1970 + echo "configure: failed program was:" >&5
1971 + cat conftest.$ac_ext >&5
1972 +fi
1973 +rm -f conftest*
1974 +done
1975 +LIBS="$ac_func_search_save_LIBS"
1976 +fi
1977 +
1978 +echo "$ac_t""$ac_cv_search_compress2" 1>&6
1979 +if test "$ac_cv_search_compress2" != "no"; then
1980 + test "$ac_cv_search_compress2" = "none required" || LIBS="$ac_cv_search_compress2 $LIBS"
1981 +
1982 +else :
1983 + { echo "configure: error: zlib not found" 1>&2; exit 1; }
1984 +fi
1985 +
1986 +echo $ac_n "checking for library containing getopt_long""... $ac_c" 1>&6
1987 +echo "configure:1651: checking for library containing getopt_long" >&5
1988 +if eval "test \"`echo '$''{'ac_cv_search_getopt_long'+set}'`\" = set"; then
1989 + echo $ac_n "(cached) $ac_c" 1>&6
1990 +else
1991 + ac_func_search_save_LIBS="$LIBS"
1992 +ac_cv_search_getopt_long="no"
1993 +cat > conftest.$ac_ext <<EOF
1994 +#line 1658 "configure"
1995 +#include "confdefs.h"
1996 +/* Override any gcc2 internal prototype to avoid an error. */
1997 +/* We use char because int might match the return type of a gcc2
1998 + builtin and then its argument prototype would still apply. */
1999 +char getopt_long();
2000 +
2001 +int main() {
2002 +getopt_long()
2003 +; return 0; }
2004 +EOF
2005 +if { (eval echo configure:1669: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2006 + rm -rf conftest*
2007 + ac_cv_search_getopt_long="none required"
2008 +else
2009 + echo "configure: failed program was:" >&5
2010 + cat conftest.$ac_ext >&5
2011 +fi
2012 +rm -f conftest*
2013 +test "$ac_cv_search_getopt_long" = "no" && for i in getopt getopt_long; do
2014 +LIBS="-l$i $ac_func_search_save_LIBS"
2015 +cat > conftest.$ac_ext <<EOF
2016 +#line 1680 "configure"
2017 +#include "confdefs.h"
2018 +/* Override any gcc2 internal prototype to avoid an error. */
2019 +/* We use char because int might match the return type of a gcc2
2020 + builtin and then its argument prototype would still apply. */
2021 +char getopt_long();
2022 +
2023 +int main() {
2024 +getopt_long()
2025 +; return 0; }
2026 +EOF
2027 +if { (eval echo configure:1691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2028 + rm -rf conftest*
2029 + ac_cv_search_getopt_long="-l$i"
2030 +break
2031 +else
2032 + echo "configure: failed program was:" >&5
2033 + cat conftest.$ac_ext >&5
2034 +fi
2035 +rm -f conftest*
2036 +done
2037 +LIBS="$ac_func_search_save_LIBS"
2038 +fi
2039 +
2040 +echo "$ac_t""$ac_cv_search_getopt_long" 1>&6
2041 +if test "$ac_cv_search_getopt_long" != "no"; then
2042 + test "$ac_cv_search_getopt_long" = "none required" || LIBS="$ac_cv_search_getopt_long $LIBS"
2043 + cat >> confdefs.h <<\EOF
2044 +#define HAVE_GETOPT_LONG 1
2045 +EOF
2046 +
2047 +else :
2048 +
2049 +fi
2050 +
2051 +# Extract the first word of "ranlib", so it can be a program name with args.
2052 +set dummy ranlib; ac_word=$2
2053 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2054 +echo "configure:1718: checking for $ac_word" >&5
2055 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
2056 + echo $ac_n "(cached) $ac_c" 1>&6
2057 +else
2058 + if test -n "$RANLIB"; then
2059 + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2060 +else
2061 + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
2062 + ac_dummy="$PATH"
2063 + for ac_dir in $ac_dummy; do
2064 + test -z "$ac_dir" && ac_dir=.
2065 + if test -f $ac_dir/$ac_word; then
2066 + ac_cv_prog_RANLIB="ranlib"
2067 + break
2068 + fi
2069 + done
2070 + IFS="$ac_save_ifs"
2071 + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
2072 +fi
2073 +fi
2074 +RANLIB="$ac_cv_prog_RANLIB"
2075 +if test -n "$RANLIB"; then
2076 + echo "$ac_t""$RANLIB" 1>&6
2077 +else
2078 + echo "$ac_t""no" 1>&6
2079 +fi
2080 +
2081 +ac_aux_dir=
2082 +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
2083 + if test -f $ac_dir/install-sh; then
2084 + ac_aux_dir=$ac_dir
2085 + ac_install_sh="$ac_aux_dir/install-sh -c"
2086 + break
2087 + elif test -f $ac_dir/install.sh; then
2088 + ac_aux_dir=$ac_dir
2089 + ac_install_sh="$ac_aux_dir/install.sh -c"
2090 + break
2091 + fi
2092 +done
2093 +if test -z "$ac_aux_dir"; then
2094 + { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
2095 +fi
2096 +ac_config_guess=$ac_aux_dir/config.guess
2097 +ac_config_sub=$ac_aux_dir/config.sub
2098 +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
2099 +
2100 +# Find a good install program. We prefer a C program (faster),
2101 +# so one script is as good as another. But avoid the broken or
2102 +# incompatible versions:
2103 +# SysV /etc/install, /usr/sbin/install
2104 +# SunOS /usr/etc/install
2105 +# IRIX /sbin/install
2106 +# AIX /bin/install
2107 +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2108 +# AFS /usr/afsws/bin/install, which mishandles nonexistent args
2109 +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2110 +# ./install, which can be erroneously created by make from ./install.sh.
2111 +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
2112 +echo "configure:1776: checking for a BSD compatible install" >&5
2113 +if test -z "$INSTALL"; then
2114 +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
2115 + echo $ac_n "(cached) $ac_c" 1>&6
2116 +else
2117 + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
2118 + for ac_dir in $PATH; do
2119 + # Account for people who put trailing slashes in PATH elements.
2120 + case "$ac_dir/" in
2121 + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
2122 + *)
2123 + # OSF1 and SCO ODT 3.0 have their own names for install.
2124 + # Don't use installbsd from OSF since it installs stuff as root
2125 + # by default.
2126 + for ac_prog in ginstall scoinst install; do
2127 + if test -f $ac_dir/$ac_prog; then
2128 + if test $ac_prog = install &&
2129 + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
2130 + # AIX install. It has an incompatible calling convention.
2131 + :
2132 + else
2133 + ac_cv_path_install="$ac_dir/$ac_prog -c"
2134 + break 2
2135 + fi
2136 + fi
2137 + done
2138 + ;;
2139 + esac
2140 + done
2141 + IFS="$ac_save_IFS"
2142 +
2143 +fi
2144 + if test "${ac_cv_path_install+set}" = set; then
2145 + INSTALL="$ac_cv_path_install"
2146 + else
2147 + # As a last resort, use the slow shell script. We don't cache a
2148 + # path for INSTALL within a source directory, because that will
2149 + # break other packages using the cache if that directory is
2150 + # removed, or if the path is relative.
2151 + INSTALL="$ac_install_sh"
2152 + fi
2153 +fi
2154 +echo "$ac_t""$INSTALL" 1>&6
2155 +
2156 +# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2157 +# It thinks the first close brace ends the variable substitution.
2158 +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2159 +
2160 +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
2161 +
2162 +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2163 +
2164 +
2165 +
2166 +trap '' 1 2 15
2167 +cat > confcache <<\EOF
2168 +# This file is a shell script that caches the results of configure
2169 +# tests run on this system so they can be shared between configure
2170 +# scripts and configure runs. It is not useful on other systems.
2171 +# If it contains results you don't want to keep, you may remove or edit it.
2172 +#
2173 +# By default, configure uses ./config.cache as the cache file,
2174 +# creating it if it does not exist already. You can give configure
2175 +# the --cache-file=FILE option to use a different cache file; that is
2176 +# what configure does when it calls configure scripts in
2177 +# subdirectories, so they share the cache.
2178 +# Giving --cache-file=/dev/null disables caching, for debugging configure.
2179 +# config.status only pays attention to the cache file if you give it the
2180 +# --recheck option to rerun configure.
2181 +#
2182 +EOF
2183 +# The following way of writing the cache mishandles newlines in values,
2184 +# but we know of no workaround that is simple, portable, and efficient.
2185 +# So, don't put newlines in cache variables' values.
2186 +# Ultrix sh set writes to stderr and can't be redirected directly,
2187 +# and sets the high bit in the cache file unless we assign to the vars.
2188 +(set) 2>&1 |
2189 + case `(ac_space=' '; set | grep ac_space) 2>&1` in
2190 + *ac_space=\ *)
2191 + # `set' does not quote correctly, so add quotes (double-quote substitution
2192 + # turns \\\\ into \\, and sed turns \\ into \).
2193 + sed -n \
2194 + -e "s/'/'\\\\''/g" \
2195 + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
2196 + ;;
2197 + *)
2198 + # `set' quotes correctly as required by POSIX, so do not add quotes.
2199 + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
2200 + ;;
2201 + esac >> confcache
2202 +if cmp -s $cache_file confcache; then
2203 + :
2204 +else
2205 + if test -w $cache_file; then
2206 + echo "updating cache $cache_file"
2207 + cat confcache > $cache_file
2208 + else
2209 + echo "not updating unwritable cache $cache_file"
2210 + fi
2211 +fi
2212 +rm -f confcache
2213 +
2214 +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
2215 +
2216 +test "x$prefix" = xNONE && prefix=$ac_default_prefix
2217 +# Let make expand exec_prefix.
2218 +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
2219 +
2220 +# Any assignment to VPATH causes Sun make to only execute
2221 +# the first set of double-colon rules, so remove it if not needed.
2222 +# If there is a colon in the path, we need to keep it.
2223 +if test "x$srcdir" = x.; then
2224 + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
2225 +fi
2226 +
2227 +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
2228 +
2229 +DEFS=-DHAVE_CONFIG_H
2230 +
2231 +# Without the "./", some shells look in PATH for config.status.
2232 +: ${CONFIG_STATUS=./config.status}
2233 +
2234 +echo creating $CONFIG_STATUS
2235 +rm -f $CONFIG_STATUS
2236 +cat > $CONFIG_STATUS <<EOF
2237 +#! /bin/sh
2238 +# Generated automatically by configure.
2239 +# Run this file to recreate the current configuration.
2240 +# This directory was configured as follows,
2241 +# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
2242 +#
2243 +# $0 $ac_configure_args
2244 +#
2245 +# Compiler output produced by configure, useful for debugging
2246 +# configure, is in ./config.log if it exists.
2247 +
2248 +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
2249 +for ac_option
2250 +do
2251 + case "\$ac_option" in
2252 + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
2253 + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
2254 + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
2255 + -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
2256 + echo "$CONFIG_STATUS generated by autoconf version 2.13"
2257 + exit 0 ;;
2258 + -help | --help | --hel | --he | --h)
2259 + echo "\$ac_cs_usage"; exit 0 ;;
2260 + *) echo "\$ac_cs_usage"; exit 1 ;;
2261 + esac
2262 +done
2263 +
2264 +ac_given_srcdir=$srcdir
2265 +ac_given_INSTALL="$INSTALL"
2266 +
2267 +trap 'rm -fr `echo "MCONFIG config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
2268 +EOF
2269 +cat >> $CONFIG_STATUS <<EOF
2270 +
2271 +# Protect against being on the right side of a sed subst in config.status.
2272 +sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
2273 + s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
2274 +$ac_vpsub
2275 +$extrasub
2276 +s%@SHELL@%$SHELL%g
2277 +s%@CFLAGS@%$CFLAGS%g
2278 +s%@CPPFLAGS@%$CPPFLAGS%g
2279 +s%@CXXFLAGS@%$CXXFLAGS%g
2280 +s%@FFLAGS@%$FFLAGS%g
2281 +s%@DEFS@%$DEFS%g
2282 +s%@LDFLAGS@%$LDFLAGS%g
2283 +s%@LIBS@%$LIBS%g
2284 +s%@exec_prefix@%$exec_prefix%g
2285 +s%@prefix@%$prefix%g
2286 +s%@program_transform_name@%$program_transform_name%g
2287 +s%@bindir@%$bindir%g
2288 +s%@sbindir@%$sbindir%g
2289 +s%@libexecdir@%$libexecdir%g
2290 +s%@datadir@%$datadir%g
2291 +s%@sysconfdir@%$sysconfdir%g
2292 +s%@sharedstatedir@%$sharedstatedir%g
2293 +s%@localstatedir@%$localstatedir%g
2294 +s%@libdir@%$libdir%g
2295 +s%@includedir@%$includedir%g
2296 +s%@oldincludedir@%$oldincludedir%g
2297 +s%@infodir@%$infodir%g
2298 +s%@mandir@%$mandir%g
2299 +s%@CC@%$CC%g
2300 +s%@CPP@%$CPP%g
2301 +s%@RANLIB@%$RANLIB%g
2302 +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
2303 +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
2304 +s%@INSTALL_DATA@%$INSTALL_DATA%g
2305 +
2306 +CEOF
2307 +EOF
2308 +
2309 +cat >> $CONFIG_STATUS <<\EOF
2310 +
2311 +# Split the substitutions into bite-sized pieces for seds with
2312 +# small command number limits, like on Digital OSF/1 and HP-UX.
2313 +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
2314 +ac_file=1 # Number of current file.
2315 +ac_beg=1 # First line for current file.
2316 +ac_end=$ac_max_sed_cmds # Line after last line for current file.
2317 +ac_more_lines=:
2318 +ac_sed_cmds=""
2319 +while $ac_more_lines; do
2320 + if test $ac_beg -gt 1; then
2321 + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
2322 + else
2323 + sed "${ac_end}q" conftest.subs > conftest.s$ac_file
2324 + fi
2325 + if test ! -s conftest.s$ac_file; then
2326 + ac_more_lines=false
2327 + rm -f conftest.s$ac_file
2328 + else
2329 + if test -z "$ac_sed_cmds"; then
2330 + ac_sed_cmds="sed -f conftest.s$ac_file"
2331 + else
2332 + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
2333 + fi
2334 + ac_file=`expr $ac_file + 1`
2335 + ac_beg=$ac_end
2336 + ac_end=`expr $ac_end + $ac_max_sed_cmds`
2337 + fi
2338 +done
2339 +if test -z "$ac_sed_cmds"; then
2340 + ac_sed_cmds=cat
2341 +fi
2342 +EOF
2343 +
2344 +cat >> $CONFIG_STATUS <<EOF
2345 +
2346 +CONFIG_FILES=\${CONFIG_FILES-"MCONFIG"}
2347 +EOF
2348 +cat >> $CONFIG_STATUS <<\EOF
2349 +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
2350 + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
2351 + case "$ac_file" in
2352 + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
2353 + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
2354 + *) ac_file_in="${ac_file}.in" ;;
2355 + esac
2356 +
2357 + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
2358 +
2359 + # Remove last slash and all that follows it. Not all systems have dirname.
2360 + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
2361 + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
2362 + # The file is in a subdirectory.
2363 + test ! -d "$ac_dir" && mkdir "$ac_dir"
2364 + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
2365 + # A "../" for each directory in $ac_dir_suffix.
2366 + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
2367 + else
2368 + ac_dir_suffix= ac_dots=
2369 + fi
2370 +
2371 + case "$ac_given_srcdir" in
2372 + .) srcdir=.
2373 + if test -z "$ac_dots"; then top_srcdir=.
2374 + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
2375 + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
2376 + *) # Relative path.
2377 + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
2378 + top_srcdir="$ac_dots$ac_given_srcdir" ;;
2379 + esac
2380 +
2381 + case "$ac_given_INSTALL" in
2382 + [/$]*) INSTALL="$ac_given_INSTALL" ;;
2383 + *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
2384 + esac
2385 +
2386 + echo creating "$ac_file"
2387 + rm -f "$ac_file"
2388 + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
2389 + case "$ac_file" in
2390 + *Makefile*) ac_comsub="1i\\
2391 +# $configure_input" ;;
2392 + *) ac_comsub= ;;
2393 + esac
2394 +
2395 + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
2396 + sed -e "$ac_comsub
2397 +s%@configure_input@%$configure_input%g
2398 +s%@srcdir@%$srcdir%g
2399 +s%@top_srcdir@%$top_srcdir%g
2400 +s%@INSTALL@%$INSTALL%g
2401 +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
2402 +fi; done
2403 +rm -f conftest.s*
2404 +
2405 +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
2406 +# NAME is the cpp macro being defined and VALUE is the value it is being given.
2407 +#
2408 +# ac_d sets the value in "#define NAME VALUE" lines.
2409 +ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
2410 +ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
2411 +ac_dC='\3'
2412 +ac_dD='%g'
2413 +# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
2414 +ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
2415 +ac_uB='\([ ]\)%\1#\2define\3'
2416 +ac_uC=' '
2417 +ac_uD='\4%g'
2418 +# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
2419 +ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
2420 +ac_eB='$%\1#\2define\3'
2421 +ac_eC=' '
2422 +ac_eD='%g'
2423 +
2424 +if test "${CONFIG_HEADERS+set}" != set; then
2425 +EOF
2426 +cat >> $CONFIG_STATUS <<EOF
2427 + CONFIG_HEADERS="config.h"
2428 +EOF
2429 +cat >> $CONFIG_STATUS <<\EOF
2430 +fi
2431 +for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
2432 + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
2433 + case "$ac_file" in
2434 + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
2435 + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
2436 + *) ac_file_in="${ac_file}.in" ;;
2437 + esac
2438 +
2439 + echo creating $ac_file
2440 +
2441 + rm -f conftest.frag conftest.in conftest.out
2442 + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
2443 + cat $ac_file_inputs > conftest.in
2444 +
2445 +EOF
2446 +
2447 +# Transform confdefs.h into a sed script conftest.vals that substitutes
2448 +# the proper values into config.h.in to produce config.h. And first:
2449 +# Protect against being on the right side of a sed subst in config.status.
2450 +# Protect against being in an unquoted here document in config.status.
2451 +rm -f conftest.vals
2452 +cat > conftest.hdr <<\EOF
2453 +s/[\\&%]/\\&/g
2454 +s%[\\$`]%\\&%g
2455 +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
2456 +s%ac_d%ac_u%gp
2457 +s%ac_u%ac_e%gp
2458 +EOF
2459 +sed -n -f conftest.hdr confdefs.h > conftest.vals
2460 +rm -f conftest.hdr
2461 +
2462 +# This sed command replaces #undef with comments. This is necessary, for
2463 +# example, in the case of _POSIX_SOURCE, which is predefined and required
2464 +# on some systems where configure will not decide to define it.
2465 +cat >> conftest.vals <<\EOF
2466 +s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
2467 +EOF
2468 +
2469 +# Break up conftest.vals because some shells have a limit on
2470 +# the size of here documents, and old seds have small limits too.
2471 +
2472 +rm -f conftest.tail
2473 +while :
2474 +do
2475 + ac_lines=`grep -c . conftest.vals`
2476 + # grep -c gives empty output for an empty file on some AIX systems.
2477 + if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
2478 + # Write a limited-size here document to conftest.frag.
2479 + echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
2480 + sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
2481 + echo 'CEOF
2482 + sed -f conftest.frag conftest.in > conftest.out
2483 + rm -f conftest.in
2484 + mv conftest.out conftest.in
2485 +' >> $CONFIG_STATUS
2486 + sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
2487 + rm -f conftest.vals
2488 + mv conftest.tail conftest.vals
2489 +done
2490 +rm -f conftest.vals
2491 +
2492 +cat >> $CONFIG_STATUS <<\EOF
2493 + rm -f conftest.frag conftest.h
2494 + echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
2495 + cat conftest.in >> conftest.h
2496 + rm -f conftest.in
2497 + if cmp -s $ac_file conftest.h 2>/dev/null; then
2498 + echo "$ac_file is unchanged"
2499 + rm -f conftest.h
2500 + else
2501 + # Remove last slash and all that follows it. Not all systems have dirname.
2502 + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
2503 + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
2504 + # The file is in a subdirectory.
2505 + test ! -d "$ac_dir" && mkdir "$ac_dir"
2506 + fi
2507 + rm -f $ac_file
2508 + mv conftest.h $ac_file
2509 + fi
2510 +fi; done
2511 +
2512 +EOF
2513 +cat >> $CONFIG_STATUS <<EOF
2514 +
2515 +EOF
2516 +cat >> $CONFIG_STATUS <<\EOF
2517 +
2518 +exit 0
2519 +EOF
2520 +chmod +x $CONFIG_STATUS
2521 +rm -fr confdefs* $ac_clean_files
2522 +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
2523 +
2524
2525 --- zisofs_tools/configure.in 1970-01-01 01:00:00.000000000 +0100
2526 +++ zisofs_tools/configure.in 2002-12-27 14:48:49.000000000 +0100
2527 @@ -0,0 +1,42 @@
2528 +dnl
2529 +dnl autoconf input file to generate MCONFIG
2530 +dnl
2531 +
2532 +AC_INIT(MCONFIG.in)
2533 +AC_PREFIX_DEFAULT(/usr)
2534 +
2535 +AC_PROG_CC
2536 +AC_C_CONST
2537 +AC_C_INLINE
2538 +
2539 +PA_ADD_CFLAGS(-Wall)
2540 +PA_ADD_CFLAGS(-W)
2541 +PA_ADD_CFLAGS(-Wpointer-arith)
2542 +PA_ADD_CFLAGS(-Wbad-function-cast)
2543 +PA_ADD_CFLAGS(-Wcast-equal)
2544 +PA_ADD_CFLAGS(-Wstrict-prototypes)
2545 +PA_ADD_CFLAGS(-Wmissing-prototypes)
2546 +PA_ADD_CFLAGS(-Wmissing-declarations)
2547 +PA_ADD_CFLAGS(-Wnested-externs)
2548 +PA_ADD_CFLAGS(-Winline)
2549 +PA_ADD_CFLAGS(-Wshadow)
2550 +PA_ADD_CFLAGS(-Wcast-align)
2551 +PA_ADD_CFLAGS(-pipe)
2552 +
2553 +AC_CHECK_HEADERS(sysexits.h)
2554 +AC_CHECK_HEADERS(getopt.h)
2555 +
2556 +AC_CHECK_TYPE(off_t, signed long)
2557 +AC_CHECK_TYPE(size_t, unsigned long)
2558 +AC_CHECK_TYPE(ssize_t, signed long)
2559 +
2560 +AC_CHECK_FUNCS(lchown)
2561 +
2562 +AC_SEARCH_LIBS(compress2, z, , [AC_MSG_ERROR(zlib not found, cannot continue)])
2563 +AC_SEARCH_LIBS(getopt_long, [getopt getopt_long], AC_DEFINE(HAVE_GETOPT_LONG))
2564 +
2565 +AC_PROG_RANLIB
2566 +AC_PROG_INSTALL
2567 +
2568 +AC_CONFIG_HEADER(config.h)
2569 +AC_OUTPUT(MCONFIG)
2570
2571 --- zisofs_tools/hash.c 1970-01-01 01:00:00.000000000 +0100
2572 +++ zisofs_tools/hash.c 2002-12-27 14:48:49.000000000 +0100
2573 @@ -0,0 +1,68 @@
2574 +#ident "$Id: hash.c,v 1.1 2001/07/27 14:37:07 hpa Exp $"
2575 +/* ----------------------------------------------------------------------- *
2576 + *
2577 + * Copyright 2001 H. Peter Anvin - All Rights Reserved
2578 + *
2579 + * This program is free software; you can redistribute it and/or modify
2580 + * it under the terms of the GNU General Public License as published by
2581 + * the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139,
2582 + * USA; either version 2 of the License, or (at your option) any later
2583 + * version; incorporated herein by reference.
2584 + *
2585 + * ----------------------------------------------------------------------- */
2586 +
2587 +/*
2588 + * hash.c
2589 + *
2590 + * Hash table used to find hard-linked files
2591 + */
2592 +
2593 +#include <stdlib.h>
2594 +#include "mkzftree.h"
2595 +
2596 +#define HASH_BUCKETS 2683
2597 +
2598 +struct file_hash {
2599 + struct file_hash *next;
2600 + struct stat st;
2601 + const char *outfile_name;
2602 +};
2603 +
2604 +static struct file_hash *hashp[HASH_BUCKETS];
2605 +
2606 +const char *hash_find_file(struct stat *st)
2607 +{
2608 + int bucket = (st->st_ino + st->st_dev) % HASH_BUCKETS;
2609 + struct file_hash *hp;
2610 +
2611 + for ( hp = hashp[bucket] ; hp ; hp = hp->next ) {
2612 + if ( hp->st.st_ino == st->st_ino &&
2613 + hp->st.st_dev == st->st_dev &&
2614 + hp->st.st_mode == st->st_mode &&
2615 + hp->st.st_nlink == st->st_nlink &&
2616 + hp->st.st_uid == st->st_uid &&
2617 + hp->st.st_gid == st->st_gid &&
2618 + hp->st.st_size == st->st_size &&
2619 + hp->st.st_mtime == st->st_mtime ) {
2620 + /* Good enough, it's the same file */
2621 + return hp->outfile_name;
2622 + }
2623 + }
2624 + return NULL; /* No match */
2625 +}
2626 +
2627 +/* Note: the stat structure is the input file; the name
2628 + is the output file to link to */
2629 +void hash_insert_file(struct stat *st, const char *outfile)
2630 +{
2631 + int bucket = (st->st_ino + st->st_dev) % HASH_BUCKETS;
2632 + struct file_hash *hp = xmalloc(sizeof(struct file_hash));
2633 +
2634 + hp->next = hashp[bucket];
2635 + memcpy(&hp->st, st, sizeof(struct stat));
2636 + hp->outfile_name = xstrdup(outfile);
2637 +
2638 + hashp[bucket] = hp;
2639 +}
2640 +
2641 +
2642
2643 --- zisofs_tools/install-sh 1970-01-01 01:00:00.000000000 +0100
2644 +++ zisofs_tools/install-sh 2002-12-27 14:48:49.000000000 +0100
2645 @@ -0,0 +1,238 @@
2646 +#! /bin/sh
2647 +#
2648 +# install - install a program, script, or datafile
2649 +# This comes from X11R5.
2650 +#
2651 +# Calling this script install-sh is preferred over install.sh, to prevent
2652 +# `make' implicit rules from creating a file called install from it
2653 +# when there is no Makefile.
2654 +#
2655 +# This script is compatible with the BSD install script, but was written
2656 +# from scratch.
2657 +#
2658 +
2659 +
2660 +# set DOITPROG to echo to test this script
2661 +
2662 +# Don't use :- since 4.3BSD and earlier shells don't like it.
2663 +doit="${DOITPROG-}"
2664 +
2665 +
2666 +# put in absolute paths if you don't have them in your path; or use env. vars.
2667 +
2668 +mvprog="${MVPROG-mv}"
2669 +cpprog="${CPPROG-cp}"
2670 +chmodprog="${CHMODPROG-chmod}"
2671 +chownprog="${CHOWNPROG-chown}"
2672 +chgrpprog="${CHGRPPROG-chgrp}"
2673 +stripprog="${STRIPPROG-strip}"
2674 +rmprog="${RMPROG-rm}"
2675 +mkdirprog="${MKDIRPROG-mkdir}"
2676 +
2677 +tranformbasename=""
2678 +transform_arg=""
2679 +instcmd="$mvprog"
2680 +chmodcmd="$chmodprog 0755"
2681 +chowncmd=""
2682 +chgrpcmd=""
2683 +stripcmd=""
2684 +rmcmd="$rmprog -f"
2685 +mvcmd="$mvprog"
2686 +src=""
2687 +dst=""
2688 +dir_arg=""
2689 +
2690 +while [ x"$1" != x ]; do
2691 + case $1 in
2692 + -c) instcmd="$cpprog"
2693 + shift
2694 + continue;;
2695 +
2696 + -d) dir_arg=true
2697 + shift
2698 + continue;;
2699 +
2700 + -m) chmodcmd="$chmodprog $2"
2701 + shift
2702 + shift
2703 + continue;;
2704 +
2705 + -o) chowncmd="$chownprog $2"
2706 + shift
2707 + shift
2708 + continue;;
2709 +
2710 + -g) chgrpcmd="$chgrpprog $2"
2711 + shift
2712 + shift
2713 + continue;;
2714 +
2715 + -s) stripcmd="$stripprog"
2716 + shift
2717 + continue;;
2718 +
2719 + -t=*) transformarg=`echo $1 | sed 's/-t=//'`
2720 + shift
2721 + continue;;
2722 +
2723 + -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
2724 + shift
2725 + continue;;
2726 +
2727 + *) if [ x"$src" = x ]
2728 + then
2729 + src=$1
2730 + else
2731 + # this colon is to work around a 386BSD /bin/sh bug
2732 + :
2733 + dst=$1
2734 + fi
2735 + shift
2736 + continue;;
2737 + esac
2738 +done
2739 +
2740 +if [ x"$src" = x ]
2741 +then
2742 + echo "install: no input file specified"
2743 + exit 1
2744 +else
2745 + true
2746 +fi
2747 +
2748 +if [ x"$dir_arg" != x ]; then
2749 + dst=$src
2750 + src=""
2751 +
2752 + if [ -d $dst ]; then
2753 + instcmd=:
2754 + else
2755 + instcmd=mkdir
2756 + fi
2757 +else
2758 +
2759 +# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
2760 +# might cause directories to be created, which would be especially bad
2761 +# if $src (and thus $dsttmp) contains '*'.
2762 +
2763 + if [ -f $src -o -d $src ]
2764 + then
2765 + true
2766 + else
2767 + echo "install: $src does not exist"
2768 + exit 1
2769 + fi
2770 +
2771 + if [ x"$dst" = x ]
2772 + then
2773 + echo "install: no destination specified"
2774 + exit 1
2775 + else
2776 + true
2777 + fi
2778 +
2779 +# If destination is a directory, append the input filename; if your system
2780 +# does not like double slashes in filenames, you may need to add some logic
2781 +
2782 + if [ -d $dst ]
2783 + then
2784 + dst="$dst"/`basename $src`
2785 + else
2786 + true
2787 + fi
2788 +fi
2789 +
2790 +## this sed command emulates the dirname command
2791 +dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
2792 +
2793 +# Make sure that the destination directory exists.
2794 +# this part is taken from Noah Friedman's mkinstalldirs script
2795 +
2796 +# Skip lots of stat calls in the usual case.
2797 +if [ ! -d "$dstdir" ]; then
2798 +defaultIFS='
2799 +'
2800 +IFS="${IFS-${defaultIFS}}"
2801 +
2802 +oIFS="${IFS}"
2803 +# Some sh's can't handle IFS=/ for some reason.
2804 +IFS='%'
2805 +set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
2806 +IFS="${oIFS}"
2807 +
2808 +pathcomp=''
2809 +
2810 +while [ $# -ne 0 ] ; do
2811 + pathcomp="${pathcomp}${1}"
2812 + shift
2813 +
2814 + if [ ! -d "${pathcomp}" ] ;
2815 + then
2816 + $mkdirprog "${pathcomp}"
2817 + else
2818 + true
2819 + fi
2820 +
2821 + pathcomp="${pathcomp}/"
2822 +done
2823 +fi
2824 +
2825 +if [ x"$dir_arg" != x ]
2826 +then
2827 + $doit $instcmd $dst &&
2828 +
2829 + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
2830 + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
2831 + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
2832 + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
2833 +else
2834 +
2835 +# If we're going to rename the final executable, determine the name now.
2836 +
2837 + if [ x"$transformarg" = x ]
2838 + then
2839 + dstfile=`basename $dst`
2840 + else
2841 + dstfile=`basename $dst $transformbasename |
2842 + sed $transformarg`$transformbasename
2843 + fi
2844 +
2845 +# don't allow the sed command to completely eliminate the filename
2846 +
2847 + if [ x"$dstfile" = x ]
2848 + then
2849 + dstfile=`basename $dst`
2850 + else
2851 + true
2852 + fi
2853 +
2854 +# Make a temp file name in the proper directory.
2855 +
2856 + dsttmp=$dstdir/#inst.$$#
2857 +
2858 +# Move or copy the file name to the temp name
2859 +
2860 + $doit $instcmd $src $dsttmp &&
2861 +
2862 + trap "rm -f ${dsttmp}" 0 &&
2863 +
2864 +# and set any options; do chmod last to preserve setuid bits
2865 +
2866 +# If any of these fail, we abort the whole thing. If we want to
2867 +# ignore errors from any of these, just make sure not to ignore
2868 +# errors from the above "$doit $instcmd $src $dsttmp" command.
2869 +
2870 + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
2871 + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
2872 + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
2873 + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
2874 +
2875 +# Now rename the file to the real destination.
2876 +
2877 + $doit $rmcmd -f $dstdir/$dstfile &&
2878 + $doit $mvcmd $dsttmp $dstdir/$dstfile
2879 +
2880 +fi &&
2881 +
2882 +
2883 +exit 0
2884
2885 --- zisofs_tools/iso9660.c 1970-01-01 01:00:00.000000000 +0100
2886 +++ zisofs_tools/iso9660.c 2002-12-27 14:48:49.000000000 +0100
2887 @@ -0,0 +1,111 @@
2888 +/* $Id: iso9660.c,v 1.1 2001/07/27 14:37:08 hpa Exp $ */
2889 +/* ----------------------------------------------------------------------- *
2890 + *
2891 + * Copyright 2001 H. Peter Anvin - All Rights Reserved
2892 + *
2893 + * This program is free software; you can redistribute it and/or modify
2894 + * it under the terms of the GNU General Public License as published by
2895 + * the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139,
2896 + * USA; either version 2 of the License, or (at your option) any later
2897 + * version; incorporated herein by reference.
2898 + *
2899 + * ----------------------------------------------------------------------- */
2900 +
2901 +#include "iso9660.h"
2902 +
2903 +/* zisofs magic */
2904 +
2905 +const unsigned char zisofs_magic[8] = {
2906 + 0x37, 0xE4, 0x53, 0x96, 0xC9, 0xDB, 0xD6, 0x07
2907 +};
2908 +
2909 +/* iso9660 integer formats */
2910 +
2911 +void
2912 +set_721(void *pnt, unsigned int i)
2913 +{
2914 + unsigned char *p = (unsigned char *)pnt;
2915 + p[0] = i & 0xff;
2916 + p[1] = (i >> 8) & 0xff;
2917 +}
2918 +
2919 +unsigned int
2920 +get_721(void *pnt)
2921 +{
2922 + unsigned char *p = (unsigned char *)pnt;
2923 + return ((unsigned int)p[0]) + ((unsigned int)p[1] << 8);
2924 +}
2925 +
2926 +void
2927 +set_722(void *pnt, unsigned int i)
2928 +{
2929 + unsigned char *p = (unsigned char *)pnt;
2930 + p[0] = (i >> 8) & 0xff;
2931 + p[1] = i & 0xff;
2932 +}
2933 +
2934 +unsigned int
2935 +get_722(void *pnt)
2936 +{
2937 + unsigned char *p = (unsigned char *)pnt;
2938 + return ((unsigned int)p[0] << 8) + ((unsigned int)p[1]);
2939 +}
2940 +
2941 +void
2942 +set_723(void *pnt, unsigned int i)
2943 +{
2944 + unsigned char *p = (unsigned char *)pnt;
2945 + p[3] = p[0] = i & 0xff;
2946 + p[2] = p[1] = (i >> 8) & 0xff;
2947 +}
2948 +
2949 +#define get_723(x) get_721(x)
2950 +
2951 +void
2952 +set_731(void *pnt, unsigned int i)
2953 +{
2954 + unsigned char *p = (unsigned char *)pnt;
2955 + p[0] = i & 0xff;
2956 + p[1] = (i >> 8) & 0xff;
2957 + p[2] = (i >> 16) & 0xff;
2958 + p[3] = (i >> 24) & 0xff;
2959 +}
2960 +
2961 +unsigned int
2962 +get_731(void *pnt)
2963 +{
2964 + unsigned char *p = (unsigned char *)pnt;
2965 + return ((unsigned int)p[0]) + ((unsigned int)p[1] << 8) +
2966 + ((unsigned int)p[2] << 16) + ((unsigned int)p[3] << 24);
2967 +}
2968 +
2969 +void
2970 +set_732(void *pnt, unsigned int i)
2971 +{
2972 + unsigned char *p = (unsigned char *)pnt;
2973 + p[3] = i & 0xff;
2974 + p[2] = (i >> 8) & 0xff;
2975 + p[1] = (i >> 16) & 0xff;
2976 + p[0] = (i >> 24) & 0xff;
2977 +}
2978 +
2979 +unsigned int
2980 +get_732(void *pnt)
2981 +{
2982 + unsigned char *p = (unsigned char *)pnt;
2983 + return ((unsigned int)p[0] << 24) + ((unsigned int)p[1] << 16) +
2984 + ((unsigned int)p[2] << 8) + ((unsigned int)p[3]);
2985 +}
2986 +
2987 +void
2988 +set_733(void *pnt, unsigned int i)
2989 +{
2990 + unsigned char *p = (unsigned char *)pnt;
2991 + p[7] = p[0] = i & 0xff;
2992 + p[6] = p[1] = (i >> 8) & 0xff;
2993 + p[5] = p[2] = (i >> 16) & 0xff;
2994 + p[4] = p[3] = (i >> 24) & 0xff;
2995 +}
2996 +
2997 +#define get_733(x) get_731(x)
2998 +
2999
3000 --- zisofs_tools/iso9660.h 1970-01-01 01:00:00.000000000 +0100
3001 +++ zisofs_tools/iso9660.h 2002-12-27 14:48:49.000000000 +0100
3002 @@ -0,0 +1,45 @@
3003 +#ident "$Id: iso9660.h,v 1.3 2001/07/27 19:49:08 hpa Exp $"
3004 +/* ----------------------------------------------------------------------- *
3005 + *
3006 + * Copyright 2001 H. Peter Anvin - All Rights Reserved
3007 + *
3008 + * This program is free software; you can redistribute it and/or modify
3009 + * it under the terms of the GNU General Public License as published by
3010 + * the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139,
3011 + * USA; either version 2 of the License, or (at your option) any later
3012 + * version; incorporated herein by reference.
3013 + *
3014 + * ----------------------------------------------------------------------- */
3015 +
3016 +/* zisofs definitions */
3017 +
3018 +#ifndef CBLOCK_SIZE_LG2
3019 +#define CBLOCK_SIZE_LG2 15 /* Compressed block size */
3020 +#endif
3021 +#define CBLOCK_SIZE (1 << CBLOCK_SIZE_LG2)
3022 +
3023 +/* Compressed file magic */
3024 +extern const unsigned char zisofs_magic[8];
3025 +
3026 +/* VERY VERY VERY IMPORTANT: Must be a multiple of 4 bytes */
3027 +struct compressed_file_header {
3028 + char magic[8];
3029 + char uncompressed_len[4];
3030 + unsigned char header_size;
3031 + unsigned char block_size;
3032 + char reserved[2]; /* Reserved for future use, MBZ */
3033 +};
3034 +
3035 +/* iso9660 integer formats */
3036 +void set_721(void *, unsigned int);
3037 +unsigned int get_721(void *);
3038 +void set_722(void *, unsigned int);
3039 +unsigned int get_722(void *);
3040 +void set_723(void *, unsigned int);
3041 +void set_731(void *, unsigned int);
3042 +unsigned int get_731(void *);
3043 +void set_732(void *, unsigned int);
3044 +unsigned int get_732(void *);
3045 +void set_733(void *, unsigned int);
3046 +#define get_723(x) get_721(x)
3047 +#define get_733(x) get_731(x)
3048
3049 --- zisofs_tools/Makefile 1970-01-01 01:00:00.000000000 +0100
3050 +++ zisofs_tools/Makefile 2002-12-27 14:48:49.000000000 +0100
3051 @@ -0,0 +1,24 @@
3052 +#ident %W% %E% %Q%
3053 +###########################################################################
3054 +# Makefile for zisofs_tools in cdrtools package for debian
3055 +###########################################################################
3056 +SRCROOT= ../
3057 +RULESDIR= RULES
3058 +include $(SRCROOT)/$(RULESDIR)/rules.top
3059 +###########################################################################
3060 +
3061 +INSDIR= bin
3062 +TARGET= mkzftree
3063 +CPPOPTS += -DUSE_LARGEFILES
3064 +
3065 +CFILES = mkzftree.c walk.c workers.c util.c hash.c iso9660.c \
3066 + compress.c uncompress.c
3067 +HFILES = config.h iso9660.h mkzftree.h version.h
3068 +LIBS= -lz
3069 +XMK_FILE= Makefile.man
3070 +
3071 +GNU_CC_WARNINGS = -Wall -W -Wpointer-arith -Wbad-function-cast -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wshadow -Wcast-align
3072 +
3073 +###########################################################################
3074 +include $(SRCROOT)/$(RULESDIR)/rules.cmd
3075 +###########################################################################
3076
3077 --- zisofs_tools/Makefile.man 1970-01-01 01:00:00.000000000 +0100
3078 +++ zisofs_tools/Makefile.man 2002-12-27 14:48:49.000000000 +0100
3079 @@ -0,0 +1,30 @@
3080 +#ident @(#)Makefile.man 1.3 00/11/19
3081 +###########################################################################
3082 +# This program is free software; you can redistribute it and/or modify
3083 +# it under the terms of the GNU General Public License as published by
3084 +# the Free Software Foundation; either version 2, or (at your option)
3085 +# any later version.
3086 +#
3087 +# This program is distributed in the hope that it will be useful,
3088 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
3089 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3090 +# GNU General Public License for more details.
3091 +#
3092 +# You should have received a copy of the GNU General Public License
3093 +# along with this program; see the file COPYING. If not, write to
3094 +# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
3095 +###########################################################################
3096 +SRCROOT= ..
3097 +RULESDIR= RULES
3098 +include $(SRCROOT)/$(RULESDIR)/rules.top
3099 +###########################################################################
3100 +
3101 +MANDIR= man
3102 +TARGETMAN= mkzftree
3103 +MANSECT= $(MANSECT_ADMIN)
3104 +MANSUFFIX= $(MANSUFF_ADMIN)
3105 +MANFILE= mkzftree.8
3106 +
3107 +###########################################################################
3108 +include $(SRCROOT)/$(RULESDIR)/rules.man
3109 +###########################################################################
3110
3111 --- zisofs_tools/MCONFIG.in 1970-01-01 01:00:00.000000000 +0100
3112 +++ zisofs_tools/MCONFIG.in 2002-12-27 14:48:49.000000000 +0100
3113 @@ -0,0 +1,38 @@
3114 +# Prefixes
3115 +prefix = @prefix@
3116 +exec_prefix = @exec_prefix@
3117 +
3118 +# Directory for user binaries
3119 +bindir = @bindir@
3120 +
3121 +# Man page tree
3122 +mandir = @mandir@
3123 +
3124 +# System binaries
3125 +sbindir = @sbindir@
3126 +
3127 +# Install into chroot area
3128 +# Useful when making rpms and similar
3129 +INSTALLROOT =
3130 +
3131 +# Install program
3132 +INSTALL = @INSTALL@
3133 +INSTALL_PROGRAM = @INSTALL_PROGRAM@
3134 +INSTALL_DATA = @INSTALL_DATA@
3135 +
3136 +# Compiler and compiler flags
3137 +CC = @CC@
3138 +CFLAGS = @CFLAGS@
3139 +
3140 +# Link flags
3141 +LDFLAGS = @LDFLAGS@
3142 +
3143 +# Libraries
3144 +LIBS = @LIBS@
3145 +
3146 +# Additional library we need to build
3147 +LIBOBJS = @LIBOBJS@
3148 +
3149 +# ar and ranlib (for making libraries)
3150 +AR = ar cq
3151 +RANLIB = @RANLIB@
3152
3153 --- zisofs_tools/mkzftree.8 1970-01-01 01:00:00.000000000 +0100
3154 +++ zisofs_tools/mkzftree.8 2002-12-27 14:48:49.000000000 +0100
3155 @@ -0,0 +1,120 @@
3156 +.\" $Id: mkzftree.1,v 1.12 2002/11/07 03:58:18 hpa Exp $
3157 +.\" -----------------------------------------------------------------------
3158 +.\"
3159 +.\" Copyright 2001 H. Peter Anvin - All Rights Reserved
3160 +.\"
3161 +.\" This program is free software; you can redistribute it and/or modify
3162 +.\" it under the terms of the GNU General Public License as published by
3163 +.\" the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139,
3164 +.\" USA; either version 2 of the License, or (at your option) any later
3165 +.\" version; incorporated herein by reference.
3166 +.\"
3167 +.\" -----------------------------------------------------------------------
3168 +.TH MKZFTREE "1" "30 July 2001" "zisofs-tools" "H. Peter Anvin"
3169 +.SH NAME
3170 +mkzftree \- Create a zisofs/RockRidge compressed file tree
3171 +.SH SYNOPSIS
3172 +.B mkzftree
3173 +[\fIOPTIONS\fR]... \fIINPUT\fR \fIOUTPUT\fR
3174 +.SH DESCRIPTION
3175 +.PP
3176 +Takes an input file tree (\fIINPUT\fR) and create a corresponding
3177 +compressed file tree (\fIOUTPUT\fR) that can be used with an
3178 +appropriately patched
3179 +.BR mkisofs (8)
3180 +to create a transparent-compression ISO 9660/Rock Ridge filesystem using
3181 +the "ZF" compression records.
3182 +.RP
3183 +.TP
3184 +\fB\-f\fP, \fB\-\-force\fP
3185 +Always compress all files, even if they get larger when compressed.
3186 +.TP
3187 +\fB\-z\fP \fIlevel\fP, \fB\-\-level\fP \fIlevel\fP
3188 +Select compression level (1-9, default is 9). Lower compression
3189 +levels are faster, but typically result in larger output.
3190 +.TP
3191 +\fB\-u\fP, \fB\-\-uncompress\fP
3192 +Uncompress an already compressed tree. This can be used to read a
3193 +compressed filesystem on a system which cannot read them natively.
3194 +.TP
3195 +\fB\-p\fP \fIparallelism\fP, \fB\-\-parallelism\fP \fIparallelism\fP
3196 +Compress in parallel. The
3197 +.I parallelism
3198 +value indicates how many compression threads are allowed to run.
3199 +.TP
3200 +\fB\-x\fP, \fB\-\-one-filesystem\fP
3201 +Do not cross filesystem boundaries, but create directory stubs at
3202 +mount points.
3203 +.TP
3204 +\fB\-X\fP, \fB\-\-strict-one-filesystem\fP
3205 +Do not cross filesystem boundaries, and do not create directory stubs
3206 +at mount points.
3207 +.TP
3208 +\fB\-C\fP \fIpath\fP, \fB\-\-crib-path\fP \fIpath\fP
3209 +Steal ("crib") files from another directory if it looks (based on
3210 +name, size, type and modification time) like they match entries in the
3211 +new filesystem. The "crib tree" is usually the compressed version of
3212 +an older version of the same workload; this thus allows for
3213 +"incremental rebuilds" of a compressed filesystem tree. The files are
3214 +hardlinked from the crib tree to the output tree, so if it is
3215 +desirable to keep the link count correct the crib path should be
3216 +deleted before running \fBmkisofs\fP. The crib tree must be on the
3217 +same filesystem as the output tree.
3218 +.TP
3219 +\fB\-l\fP, \fB\-\-local\fP
3220 +Do not recurse into subdirectories, but create the directories
3221 +themselves.
3222 +.TP
3223 +\fB\-L\fP, \fB\-\-strict-local\fP
3224 +Do not recurse into subdirectories, and do not create directories.
3225 +.TP
3226 +\fB\-F\fP, \fB\-\-file\fP
3227 +Indicates that \fIINPUT\fP may not necessarily be a directory; this
3228 +allows operation on a single file. Note especially that if \fI\-F\fP
3229 +is specified, and \fIINPUT\fP is a symlink, the symlink itself will be
3230 +copied rather than whatever it happens to point to.
3231 +.TP
3232 +\fB\-s\fP, \fB\-\-sloppy\fP
3233 +Treat file modes, times and ownership data as less than precious
3234 +information and don't abort if they cannot be set. This may be useful
3235 +if running
3236 +.B mkisofs
3237 +on an input tree you do not own.
3238 +.TP
3239 +\fB\-v\fP, \fB\-\-verbose\fP
3240 +Increase the program verbosity.
3241 +.TP
3242 +\fB\-V\fP \fIvalue\fP, \fB\-\-verbosity\fP \fIvalue\fP
3243 +Set the program verbosity to
3244 +.IR value .
3245 +.TP
3246 +\fB\-q\fP, \fB\-\-quiet\fP
3247 +Issue no messages whatsoever, including error messages. This is the same
3248 +as specifying
3249 +.IR "\-V\ 0" .
3250 +.TP
3251 +\fB\-h\fP, \fB\-\-help\fP
3252 +Display a brief help message.
3253 +.TP
3254 +\fB\-w\fP, \fB\-\-version\fP
3255 +Display the release version.
3256 +.SH BUGS
3257 +Long options (beginning with \fI\-\-\fP) may not work on all systems.
3258 +See the message printed out by \fImkzftree\ \-h\fP to see if this
3259 +applies to your system.
3260 +.PP
3261 +Inode change times (ctimes) are not copied. This is a system
3262 +limitation and applies to all file copy programs.
3263 +.PP
3264 +If using the parallel option (\fI\-p\fP) the access times (atimes) on
3265 +directories may or may not be copied. If it is important that the
3266 +atimes on directories are copied exactly, avoid using \fI\-p\fP.
3267 +.SH AUTHOR
3268 +Written by H. Peter Anvin <hpa@zytor.com>.
3269 +.SH COPYRIGHT
3270 +Copyright \(co 2001-2002 H. Peter Anvin.
3271 +.br
3272 +This is free software; see the source for copying conditions. There is NO
3273 +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
3274 +.SH "SEE ALSO"
3275 +.BR mkisofs (8)
3276
3277 --- zisofs_tools/mkzftree.c 1970-01-01 01:00:00.000000000 +0100
3278 +++ zisofs_tools/mkzftree.c 2002-12-27 14:48:49.000000000 +0100
3279 @@ -0,0 +1,284 @@
3280 +/* $Id: mkzftree.c,v 1.16 2002/11/07 04:10:06 hpa Exp $ */
3281 +/* ----------------------------------------------------------------------- *
3282 + *
3283 + * Copyright 2001 H. Peter Anvin - All Rights Reserved
3284 + *
3285 + * This program is free software; you can redistribute it and/or modify
3286 + * it under the terms of the GNU General Public License as published by
3287 + * the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139,
3288 + * USA; either version 2 of the License, or (at your option) any later
3289 + * version; incorporated herein by reference.
3290 + *
3291 + * ----------------------------------------------------------------------- */
3292 +
3293 +/*
3294 + * mkzffile.c
3295 + *
3296 + * - Generate block-compression of files for use with
3297 + * the "ZF" extension to the iso9660/RockRidge filesystem.
3298 + *
3299 + * The file compression technique used is the "deflate"
3300 + * algorithm used by the zlib library; each block must have a
3301 + * valid (12-byte) zlib header. In addition, the file itself
3302 + * has the following structure:
3303 + *
3304 + * Byte offset iso9660 type Contents
3305 + * 0 (8 bytes) Magic number (37 E4 53 96 C9 DB D6 07)
3306 + * 8 7.3.1 Uncompressed file size
3307 + * 12 7.1.1 header_size >> 2 (currently 4)
3308 + * 13 7.1.1 log2(block_size)
3309 + * 14 (2 bytes) Reserved, must be zero
3310 + *
3311 + * The header may get expanded in the future, at which point the
3312 + * header size field will be used to increase the space for the
3313 + * header.
3314 + *
3315 + * All implementations are required to support a block_size of 32K
3316 + * (byte 13 == 15).
3317 + *
3318 + * Note that bytes 12 and 13 and the uncompressed length are also
3319 + * present in the ZF record; THE TWO MUST BOTH BE CONSISTENT AND
3320 + * CORRECT.
3321 + *
3322 + * Given the uncompressed size, block_size, and header_size:
3323 + *
3324 + * Nblocks := ceil(size/block_size)
3325 + *
3326 + * After the header follow (nblock+1) 32-bit pointers, recorded as
3327 + * iso9660 7.3.1 (littleendian); each indicate the byte offset (from
3328 + * the start of the file) to one block and the first byte beyond the
3329 + * end of the previous block; the first pointer thus point to the
3330 + * start of the data area and the last pointer to the first byte
3331 + * beyond it:
3332 + *
3333 + * block_no := floor(byte_offset/block_size)
3334 + *
3335 + * block_start := read_pointer_731( (header_size+block_no)*4 )
3336 + * block_end := read_pointer_731( (header_size+block_no+1)*4 )
3337 + *
3338 + * The block data is compressed according to "zlib".
3339 + */
3340 +
3341 +#include <errno.h>
3342 +#include <stdlib.h>
3343 +#include <string.h>
3344 +#include <stdio.h>
3345 +#include <unistd.h>
3346 +#include <limits.h>
3347 +#include <utime.h>
3348 +#include <sys/stat.h>
3349 +#include <sys/types.h>
3350 +
3351 +#include "mkzftree.h"
3352 +#include "version.h"
3353 +
3354 +#ifdef HAVE_GETOPT_H
3355 +#include <getopt.h>
3356 +#endif
3357 +
3358 +/* Command line options */
3359 +struct cmdline_options opt = {
3360 + 0, /* Force compression */
3361 + 9, /* Compression level */
3362 + 0, /* Parallelism (0 = strictly serial) */
3363 + 0, /* One filesystem only */
3364 + 0, /* One directory only */
3365 + 1, /* Create stub directories */
3366 + 0, /* Root may be a file */
3367 + 0, /* Be paranoid about metadata */
3368 + default_verbosity, /* Default verbosity */
3369 + block_compress_file /* Default transformation function */
3370 +};
3371 +
3372 +/* Program name */
3373 +const char *program;
3374 +
3375 +/* Long options */
3376 +#define OPTSTRING "fz:up:xXC:lLFvqV:hw"
3377 +#ifdef HAVE_GETOPT_LONG
3378 +const struct option long_options[] = {
3379 + { "force", 0, 0, 'f' },
3380 + { "level", 1, 0, 'z' },
3381 + { "uncompress", 0, 0, 'u' },
3382 + { "parallelism", 1, 0, 'p' },
3383 + { "one-filesystem", 0, 0, 'x' },
3384 + { "strict-one-filesystem", 0, 0, 'X' },
3385 + { "crib-tree", 1, 0, 'C' },
3386 + { "local", 0, 0, 'l' },
3387 + { "strict-local", 0, 0, 'L' },
3388 + { "file", 0, 0, 'F' },
3389 + { "verbose", 0, 0, 'v' },
3390 + { "quiet", 0, 0, 'q' },
3391 + { "verbosity", 1, 0, 'V' },
3392 + { "help", 0, 0, 'h' },
3393 + { "version", 0, 0, 'w' },
3394 + { 0, 0, 0, 0 }
3395 +};
3396 +#define LO(X) X
3397 +#else
3398 +#define getopt_long(C,V,O,L,I) getopt(C,V,O)
3399 +#define LO(X)
3400 +#endif
3401 +
3402 +static void usage(enum verbosity level, int err)
3403 +{
3404 + message(level,
3405 + "zisofs-tools " ZISOFS_TOOLS_VERSION "\n"
3406 + "Usage: %s [options] intree outtree\n"
3407 + LO(" --force ")" -f Always compress, even if result is larger\n"
3408 + LO(" --level # ")" -z # Set compression level (1-9)\n"
3409 + LO(" --uncompress ")" -u Uncompress an already compressed tree\n"
3410 + LO(" --parallelism # ")" -p # Process up to # files in parallel\n"
3411 + LO(" --one-filesystem ")" -x Do not cross filesystem boundaries\n"
3412 + LO(" --strict-one-filesystem")" -X Same as -x, but don't create stubs dirs\n"
3413 + LO(" --crib-tree ")" -C Steal \"crib\" files from an old tree\n"
3414 + LO(" --local ")" -l Do not recurse into subdirectoires\n"
3415 + LO(" --strict-local ")" -L Same as -l, but don't create stubs dirs\n"
3416 + LO(" --file ")" -F Operate possibly on a single file\n"
3417 + LO(" --sloppy ")" -s Don't abort if metadata cannot be set\n"
3418 + LO(" --verbose ")" -v Increase message verbosity\n"
3419 + LO(" --verbosity # ")" -V # Set message verbosity to # (default = %d)\n"
3420 + LO(" --quiet ")" -q No messages, not even errors (-V 0)\n"
3421 + LO(" --help ")" -h Display this message\n"
3422 + LO(" --version ")" -w Display the program version\n"
3423 + ,program, (int)default_verbosity);
3424 + exit(err);
3425 +}
3426 +
3427 +static int opt_atoi(const char *str)
3428 +{
3429 + char *endptr;
3430 + long out;
3431 +
3432 + out = strtol(str, &endptr, 10);
3433 + if ( *endptr )
3434 + usage(vl_error, EX_USAGE);
3435 +
3436 + return (int)out;
3437 +}
3438 +
3439 +
3440 +int main(int argc, char *argv[])
3441 +{
3442 + const char *in, *out, *crib = NULL;
3443 + struct stat st;
3444 + struct utimbuf ut;
3445 + int optch, err;
3446 +
3447 + program = argv[0];
3448 +
3449 + while ( (optch = getopt_long(argc, argv, OPTSTRING, long_options, NULL))
3450 + != EOF ) {
3451 + switch(optch) {
3452 + case 'f':
3453 + opt.force = 1; /* Always compress */
3454 + break;
3455 + case 'z':
3456 + opt.level = opt_atoi(optarg);
3457 + if ( opt.level < 1 || opt.level > 9 ) {
3458 + message(vl_error, "%s: invalid compression level: %d\n",
3459 + program, optarg);
3460 + exit(EX_USAGE);
3461 + }
3462 + break;
3463 + case 'v':
3464 + opt.verbosity++;
3465 + break;
3466 + case 'V':
3467 + opt.verbosity = opt_atoi(optarg);
3468 + break;
3469 + case 'q':
3470 + opt.verbosity = vl_quiet;
3471 + break;
3472 + case 'u':
3473 + opt.munger = block_uncompress_file;
3474 + break;
3475 + case 'C':
3476 + crib = optarg;
3477 + break;
3478 + case 'p':
3479 + opt.parallel = opt_atoi(optarg);
3480 + break;
3481 + case 'x':
3482 + opt.onefs = 1; opt.do_mkdir = 1;
3483 + break;
3484 + case 'l':
3485 + opt.onedir = 1; opt.do_mkdir = 1;
3486 + break;
3487 + case 'X':
3488 + opt.onefs = 1; opt.do_mkdir = 0;
3489 + break;
3490 + case 'L':
3491 + opt.onedir = 1; opt.do_mkdir = 0;
3492 + break;
3493 + case 'F':
3494 + opt.file_root = 1;
3495 + break;
3496 + case 's':
3497 + opt.sloppy = 1;
3498 + break;
3499 + case 'h':
3500 + usage(vl_quiet, 0);
3501 + break;
3502 + case 'w':
3503 + message(vl_quiet, "zisofs-tools " ZISOFS_TOOLS_VERSION "\n");
3504 + exit(0);
3505 + default:
3506 + usage(vl_error, EX_USAGE);
3507 + break;
3508 + }
3509 + }
3510 +
3511 + if ( (argc-optind) != 2 )
3512 + usage(vl_error, EX_USAGE);
3513 +
3514 + in = argv[optind]; /* Input tree */
3515 + out = argv[optind+1]; /* Output tree */
3516 +
3517 + umask(077);
3518 +
3519 + if ( opt.file_root ) {
3520 + if ( lstat(in, &st) ) {
3521 + message(vl_error, "%s: %s: %s\n", program, in, strerror(errno));
3522 + exit(EX_NOINPUT);
3523 + }
3524 +
3525 + err = munge_entry(in, out, crib, NULL);
3526 + } else {
3527 + /* Special case: we use stat() for the root, not lstat() */
3528 + if ( stat(in, &st) ) {
3529 + message(vl_error, "%s: %s: %s\n", program, in, strerror(errno));
3530 + exit(EX_NOINPUT);
3531 + }
3532 + if ( !S_ISDIR(st.st_mode) ) {
3533 + message(vl_error, "%s: %s: Not a directory\n", program, in);
3534 + exit(EX_DATAERR);
3535 + }
3536 +
3537 + err = munge_tree(in, out, crib);
3538 + }
3539 +
3540 + wait_for_all_workers();
3541 +
3542 + if ( err )
3543 + exit(err);
3544 +
3545 + if ( !opt.file_root ) {
3546 + if ( chown(out, st.st_uid, st.st_gid) && !opt.sloppy ) {
3547 + message(vl_error, "%s: %s: %s", program, out, strerror(errno));
3548 + err = EX_CANTCREAT;
3549 + }
3550 + if ( chmod(out, st.st_mode) && !opt.sloppy && !err ) {
3551 + message(vl_error, "%s: %s: %s", program, out, strerror(errno));
3552 + err = EX_CANTCREAT;
3553 + }
3554 + ut.actime = st.st_atime;
3555 + ut.modtime = st.st_mtime;
3556 + if ( utime(out, &ut) && !opt.sloppy && !err ) {
3557 + message(vl_error, "%s: %s: %s", program, out, strerror(errno));
3558 + err = EX_CANTCREAT;
3559 + }
3560 + }
3561 +
3562 + return err;
3563 +}
3564
3565 --- zisofs_tools/mkzftree.h 1970-01-01 01:00:00.000000000 +0100
3566 +++ zisofs_tools/mkzftree.h 2002-12-27 14:48:49.000000000 +0100
3567 @@ -0,0 +1,86 @@
3568 +#ident "$Id: mkzftree.h,v 1.4 2002/11/07 03:58:18 hpa Exp $"
3569 +/* ----------------------------------------------------------------------- *
3570 + *
3571 + * Copyright 2001 H. Peter Anvin - All Rights Reserved
3572 + *
3573 + * This program is free software; you can redistribute it and/or modify
3574 + * it under the terms of the GNU General Public License as published by
3575 + * the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139,
3576 + * USA; either version 2 of the License, or (at your option) any later
3577 + * version; incorporated herein by reference.
3578 + *
3579 + * ----------------------------------------------------------------------- */
3580 +
3581 +#include "config.h"
3582 +#include <stddef.h>
3583 +#include <stdlib.h>
3584 +#include <stdio.h>
3585 +#include <sys/types.h>
3586 +#include <sys/stat.h>
3587 +
3588 +#ifdef HAVE_SYSEXITS_H
3589 +#include <sysexits.h>
3590 +#else
3591 +#define EX_USAGE 64 /* command line usage error */
3592 +#define EX_DATAERR 65 /* data format error */
3593 +#define EX_NOINPUT 66 /* cannot open input */
3594 +#define EX_NOUSER 67 /* addressee unknown */
3595 +#define EX_NOHOST 68 /* host name unknown */
3596 +#define EX_UNAVAILABLE 69 /* service unavailable */
3597 +#define EX_SOFTWARE 70 /* internal software error */
3598 +#define EX_OSERR 71 /* system error (e.g., can't fork) */
3599 +#define EX_OSFILE 72 /* critical OS file missing */
3600 +#define EX_CANTCREAT 73 /* can't create (user) output file */
3601 +#define EX_IOERR 74 /* input/output error */
3602 +#define EX_TEMPFAIL 75 /* temp failure; user is invited to retry */
3603 +#define EX_PROTOCOL 76 /* remote error in protocol */
3604 +#define EX_NOPERM 77 /* permission denied */
3605 +#define EX_CONFIG 78 /* configuration error */
3606 +#endif
3607 +
3608 +/* File transformation functions */
3609 +typedef int (*munger_func)(FILE *, FILE *, off_t);
3610 +int block_compress_file(FILE *, FILE *, off_t);
3611 +int block_uncompress_file(FILE *, FILE *, off_t);
3612 +
3613 +/* mkzftree.c */
3614 +extern const char *program; /* Program name */
3615 +enum verbosity { /* Message verbosity */
3616 + vl_quiet, /* No messages */
3617 + vl_error, /* Error messages only */
3618 + vl_filename, /* Display filenames */
3619 + vl_crib, /* Cribbing files */
3620 +};
3621 +#define default_verbosity vl_error
3622 +struct cmdline_options {
3623 + int force; /* Always compress */
3624 + int level; /* Compression level */
3625 + int parallel; /* Parallelism (0 = strictly serial) */
3626 + int onefs; /* One filesystem only */
3627 + int onedir; /* One directory only */
3628 + int do_mkdir; /* Create stub directories */
3629 + int file_root; /* The root may be a file */
3630 + int sloppy; /* Don't make sure metadata is set correctly */
3631 + enum verbosity verbosity; /* Message verbosity */
3632 + munger_func munger; /* Default action */
3633 +};
3634 +extern struct cmdline_options opt;
3635 +
3636 +/* walk.c */
3637 +int munge_tree(const char *, const char *, const char *);
3638 +int munge_entry(const char *, const char *, const char *, const struct stat *);
3639 +
3640 +/* workers.c */
3641 +void wait_for_all_workers(void);
3642 +int spawn_worker(void);
3643 +void end_worker(int);
3644 +
3645 +/* util.c */
3646 +void *xmalloc(size_t);
3647 +char *xstrdup(const char *);
3648 +void message(enum verbosity, const char *, ...);
3649 +
3650 +/* hash.c */
3651 +const char *hash_find_file(struct stat *);
3652 +void hash_insert_file(struct stat *, const char *);
3653 +
3654
3655 --- zisofs_tools/MRULES 1970-01-01 01:00:00.000000000 +0100
3656 +++ zisofs_tools/MRULES 2002-12-27 14:48:49.000000000 +0100
3657 @@ -0,0 +1,22 @@
3658 +# Standard compilation rules (don't use make builtins)
3659 +
3660 +.SUFFIXES: .c .cc .o .s .S .i
3661 +
3662 +.c.o:
3663 + $(CC) $(CFLAGS) -c $<
3664 +
3665 +.c.s:
3666 + $(CC) $(CFLAGS) -S -o $@ $<
3667 +
3668 +.c.i:
3669 + $(CC) $(CFLAGS) -E -o $@ $<
3670 +
3671 +.cc.o:
3672 + $(CXX) $(CXXFLAGS) -c $<
3673 +
3674 +.cc.s:
3675 + $(CXX) $(CXXFLAGS) -S -o $@ $<
3676 +
3677 +.cc.i:
3678 + $(CXX) $(CXXFLAGS) -E -o $@ $<
3679 +
3680
3681 --- zisofs_tools/README.zisofs 1970-01-01 01:00:00.000000000 +0100
3682 +++ zisofs_tools/README.zisofs 2002-12-27 14:48:49.000000000 +0100
3683 @@ -0,0 +1,48 @@
3684 + H. Peter Anvin <hpa@zytor.com>
3685 + October 18, 2002
3686 +
3687 +
3688 +User tools for zisofs:
3689 +
3690 +The user tools for zisofs come in two parts: a utility "mkzftree" and
3691 +a modification to mkisofs, which is part of the cdrtools package. The
3692 +mkisofs change has been integrated in the cdrtools distribution as of
3693 +cdrtools-1.11a20; a patch for cdrtools-1.11a09 which is also tested
3694 +and working on cdrtools-1.10 is included with this package if you
3695 +insist on running an older version.
3696 +
3697 +
3698 +First create a directory tree containing compressed files:
3699 +
3700 + mkzftree input_dir compressed_dir
3701 +
3702 +mkzftree will not overwrite an existing directory; you may want to "rm
3703 +-rf" the directory tree if you are doing this from a script:
3704 +
3705 +Second, invoke the patched mkisofs with the -z option:
3706 +
3707 + mkisofs -z -R [other options] -o compressed.iso compressed_dir
3708 +
3709 +IMPORTANT: you *must* enable RockRidge (-R or -r) since this is an
3710 +extensions to the RockRidge specification. Without RockRidge, -z will
3711 +have no effect.
3712 +
3713 +Note that if there are files you do not want compressed (for example,
3714 +files involved in booting, or README files you want to be readable
3715 +under all circumstances) you can simply put them in a separate tree
3716 +and not run mkzftree on that tree.
3717 +
3718 +mkzftree will not compress files that end up larger when compressed;
3719 +if you want it to compress the files anyway, you can give the -f
3720 +option to mkzftree.
3721 +
3722 +mkzftree also accepts a -u option (uncompress), which can be used to
3723 +convert a compressed tree back to normal form. This can be used to
3724 +read a zisofs CD-ROM on a machine without zisofs kernel support.
3725 +
3726 +This version of mkzftree supports a -p option (parallelize.)
3727 +Specifying -p and a parallelism (e.g. -p4) allows files (up to the
3728 +number specified) to compress in parallel. Depending on your setup
3729 +and your data set size, this might speed things up if you are not
3730 +completely I/O bound. Use -p0 to completely disable parallel
3731 +execution; this is the default.
3732
3733 --- zisofs_tools/uncompress.c 1970-01-01 01:00:00.000000000 +0100
3734 +++ zisofs_tools/uncompress.c 2002-12-27 14:48:49.000000000 +0100
3735 @@ -0,0 +1,133 @@
3736 +/* $Id: uncompress.c,v 1.2 2001/07/27 19:49:08 hpa Exp $ */
3737 +/* ----------------------------------------------------------------------- *
3738 + *
3739 + * Copyright 2001 H. Peter Anvin - All Rights Reserved
3740 + *
3741 + * This program is free software; you can redistribute it and/or modify
3742 + * it under the terms of the GNU General Public License as published by
3743 + * the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139,
3744 + * USA; either version 2 of the License, or (at your option) any later
3745 + * version; incorporated herein by reference.
3746 + *
3747 + * ----------------------------------------------------------------------- */
3748 +
3749 +#include <stdio.h>
3750 +#include <stdlib.h>
3751 +#include <zlib.h>
3752 +#include "mkzftree.h"
3753 +#include "iso9660.h"
3754 +
3755 +int block_uncompress_file(FILE *input, FILE *output, off_t size)
3756 +{
3757 + struct compressed_file_header hdr;
3758 + char *inbuf, *outbuf;
3759 + int block_shift;
3760 + char *pointer_block, *pptr;
3761 + unsigned long nblocks;
3762 + unsigned long fullsize, block_size, block_size2;
3763 + size_t ptrblock_bytes;
3764 + unsigned long cstart, cend, csize;
3765 + uLong bytes;
3766 + int zerr;
3767 + int err = EX_SOFTWARE;
3768 +
3769 + if ( (bytes = fread(&hdr, 1, sizeof hdr, input)) != sizeof hdr ) {
3770 + if ( bytes == (size_t)size ) {
3771 + /* Very short file; not compressed */
3772 + return ( fwrite(&hdr, 1, bytes, output) != bytes ) ? EX_CANTCREAT : 0;
3773 + } else {
3774 + return EX_IOERR; /* Read error */
3775 + }
3776 + }
3777 +
3778 + if ( memcmp(&hdr.magic, zisofs_magic, sizeof zisofs_magic) ) {
3779 + inbuf = xmalloc(CBLOCK_SIZE);
3780 + /* Not compressed */
3781 + memcpy(inbuf, &hdr, sizeof hdr);
3782 + bytes = sizeof hdr;
3783 + do {
3784 + if ( fwrite(inbuf, 1, bytes, output) != bytes )
3785 + return EX_CANTCREAT;
3786 + } while ( (bytes = fread(inbuf, 1, CBLOCK_SIZE, input)) > 0 );
3787 + free(inbuf);
3788 + return ferror(input) ? EX_IOERR : 0;
3789 + }
3790 +
3791 + /* Now we know the file must be compressed. Get the pointer table. */
3792 + if ( fseek(input, hdr.header_size << 2, SEEK_SET) == -1 )
3793 + return EX_IOERR;
3794 +
3795 + fullsize = get_731(hdr.uncompressed_len);
3796 + block_shift = hdr.block_size;
3797 + block_size = 1UL << block_shift;
3798 + block_size2 = block_size << 1;
3799 + inbuf = xmalloc(block_size2);
3800 + outbuf = xmalloc(block_size);
3801 +
3802 + nblocks = (fullsize + block_size - 1) >> block_shift;
3803 +
3804 + ptrblock_bytes = (nblocks+1) * 4;
3805 + pointer_block = xmalloc(ptrblock_bytes);
3806 +
3807 + if ( (bytes = fread(pointer_block, 1, ptrblock_bytes, input)) != ptrblock_bytes ) {
3808 + err = EX_IOERR;
3809 + goto free_ptr_bail;
3810 + }
3811 +
3812 + pptr = pointer_block;
3813 + while ( fullsize ) {
3814 + cstart = get_731(pptr);
3815 + pptr += 4;
3816 + cend = get_731(pptr);
3817 +
3818 + csize = cend-cstart;
3819 +
3820 + if ( csize == 0 ) {
3821 + memset(outbuf, 0, block_size);
3822 + bytes = block_size;
3823 + } else {
3824 + if ( csize > block_size2 ) {
3825 + err = EX_DATAERR;
3826 + goto free_ptr_bail;
3827 + }
3828 +
3829 + if ( fseek(input, cstart, SEEK_SET) == -1 ||
3830 + (bytes = fread(inbuf, 1, csize, input)) != csize ) {
3831 + err = EX_IOERR;
3832 + goto free_ptr_bail;
3833 + }
3834 +
3835 + bytes = block_size; /* Max output buffer size */
3836 + if ( (zerr = uncompress(outbuf, &bytes, inbuf, csize)) != Z_OK ) {
3837 + err = (zerr = Z_MEM_ERROR) ? EX_OSERR : EX_DATAERR;
3838 + goto free_ptr_bail;
3839 + }
3840 + }
3841 +
3842 + if ( ((fullsize > block_size) && (bytes != block_size))
3843 + || ((fullsize <= block_size) && (bytes < fullsize)) ) {
3844 + err = EX_DATAERR;
3845 + goto free_ptr_bail;
3846 + }
3847 +
3848 + if ( bytes > fullsize )
3849 + bytes = fullsize;
3850 +
3851 + if ( fwrite(outbuf, 1, bytes, output) != bytes ) {
3852 + err = EX_CANTCREAT;
3853 + goto free_ptr_bail;
3854 + }
3855 +
3856 + fullsize -= bytes;
3857 + }
3858 +
3859 + err = 0;
3860 +
3861 + free_ptr_bail:
3862 + free(pointer_block);
3863 + free(inbuf);
3864 + free(outbuf);
3865 + return err;
3866 +}
3867 +
3868 +
3869
3870 --- zisofs_tools/util.c 1970-01-01 01:00:00.000000000 +0100
3871 +++ zisofs_tools/util.c 2002-12-27 14:48:49.000000000 +0100
3872 @@ -0,0 +1,55 @@
3873 +/* $Id: util.c,v 1.2 2001/07/31 03:20:52 hpa Exp $ */
3874 +/* ----------------------------------------------------------------------- *
3875 + *
3876 + * Copyright 2001 H. Peter Anvin - All Rights Reserved
3877 + *
3878 + * This program is free software; you can redistribute it and/or modify
3879 + * it under the terms of the GNU General Public License as published by
3880 + * the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139,
3881 + * USA; either version 2 of the License, or (at your option) any later
3882 + * version; incorporated herein by reference.
3883 + *
3884 + * ----------------------------------------------------------------------- */
3885 +
3886 +#include <stdio.h>
3887 +#include <errno.h>
3888 +#include <stdlib.h>
3889 +#include <stdarg.h>
3890 +#include <string.h>
3891 +#include "mkzftree.h"
3892 +
3893 +/* Convenience functions */
3894 +void *xmalloc(size_t size)
3895 +{
3896 + void *p = malloc(size);
3897 +
3898 + if ( !p ) {
3899 + perror(program);
3900 + exit(EX_OSERR);
3901 + }
3902 +
3903 + return p;
3904 +}
3905 +
3906 +char *xstrdup(const char *str)
3907 +{
3908 + char *s = strdup(str);
3909 +
3910 + if ( !s ) {
3911 + perror(program);
3912 + exit(EX_OSERR);
3913 + }
3914 +
3915 + return s;
3916 +}
3917 +
3918 +void message(enum verbosity level, const char *format, ...)
3919 +{
3920 + va_list ap;
3921 +
3922 + va_start(ap, format);
3923 + if ( opt.verbosity >= level )
3924 + vfprintf(stderr, format, ap);
3925 + va_end(ap);
3926 +}
3927 +
3928
3929 --- zisofs_tools/version 1970-01-01 01:00:00.000000000 +0100
3930 +++ zisofs_tools/version 2002-12-27 14:48:49.000000000 +0100
3931 @@ -0,0 +1 @@
3932 +1.0.4
3933
3934 --- zisofs_tools/version.h 1970-01-01 01:00:00.000000000 +0100
3935 +++ zisofs_tools/version.h 2002-12-27 21:00:49.000000000 +0100
3936 @@ -0,0 +1 @@
3937 +#define ZISOFS_TOOLS_VERSION "1.0.4"
3938
3939 --- zisofs_tools/walk.c 1970-01-01 01:00:00.000000000 +0100
3940 +++ zisofs_tools/walk.c 2002-12-27 14:48:49.000000000 +0100
3941 @@ -0,0 +1,321 @@
3942 +#ident "$Id: walk.c,v 1.5 2002/11/07 03:58:18 hpa Exp $"
3943 +/* ----------------------------------------------------------------------- *
3944 + *
3945 + * Copyright 2001-2002 H. Peter Anvin - All Rights Reserved
3946 + *
3947 + * This program is free software; you can redistribute it and/or modify
3948 + * it under the terms of the GNU General Public License as published by
3949 + * the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139,
3950 + * USA; either version 2 of the License, or (at your option) any later
3951 + * version; incorporated herein by reference.
3952 + *
3953 + * ----------------------------------------------------------------------- */
3954 +
3955 +/*
3956 + * walk.c
3957 + *
3958 + * Functions to walk the file tree
3959 + */
3960 +
3961 +#include <stdlib.h>
3962 +#include <stdio.h>
3963 +#include <limits.h>
3964 +#include <utime.h>
3965 +#include <string.h>
3966 +#include <errno.h>
3967 +#include <dirent.h>
3968 +#include <unistd.h>
3969 +#include <sys/stat.h>
3970 +#include <sys/types.h>
3971 +#include "mkzftree.h"
3972 +#include "iso9660.h"
3973 +
3974 +static int munge_file(const char *inpath, const char *outpath,
3975 + const char *cribpath, struct stat *st)
3976 +{
3977 + FILE *in, *out;
3978 + int err = 0;
3979 + struct utimbuf ut;
3980 +
3981 + if ( cribpath ) {
3982 + struct stat cst;
3983 + struct compressed_file_header cfh;
3984 +
3985 + /* Compare as much as we realistically can */
3986 + if ( !stat(cribpath, &cst) &&
3987 + st->st_mode == cst.st_mode &&
3988 + st->st_uid == cst.st_uid &&
3989 + st->st_gid == cst.st_gid &&
3990 + st->st_mtime == cst.st_mtime ) {
3991 + if ( (in = fopen(cribpath, "rb")) ) {
3992 + int e = fread(&cfh, 1, sizeof cfh, in);
3993 + fclose(in);
3994 + /* Attempt to restore the atime */
3995 + ut.actime = cst.st_atime;
3996 + ut.modtime = cst.st_mtime;
3997 + utime(cribpath, &ut);
3998 +
3999 + if ( (e == sizeof cfh &&
4000 + !memcmp(cfh.magic, zisofs_magic, sizeof zisofs_magic) &&
4001 + (off_t)get_731(cfh.uncompressed_len) == st->st_size) ||
4002 + (st->st_size == cst.st_size &&
4003 + (e < (int)(sizeof zisofs_magic) ||
4004 + memcmp(cfh.magic, zisofs_magic, sizeof zisofs_magic))) ) {
4005 + /* File is cribbable. Steal it. */
4006 + if ( !link(cribpath, outpath) ) {
4007 + message(vl_crib, "crib: %s -> %s\n", cribpath, outpath);
4008 + ut.actime = st->st_atime;
4009 + ut.modtime = st->st_mtime;
4010 + utime(outpath, &ut); /* Set the the atime */
4011 +
4012 + return 0;
4013 + }
4014 + }
4015 + }
4016 + }
4017 + }
4018 +
4019 + in = fopen(inpath, "rb");
4020 + if ( !in )
4021 + return EX_NOINPUT;
4022 + out = fopen(outpath, "wb");
4023 + if ( !out ) {
4024 + fclose(in);
4025 + return EX_CANTCREAT;
4026 + }
4027 +
4028 + if ( spawn_worker() ) {
4029 + err = opt.munger(in, out, st->st_size);
4030 + fclose(in);
4031 + fclose(out);
4032 +
4033 + chown(outpath, st->st_uid, st->st_gid);
4034 + chmod(outpath, st->st_mode);
4035 + ut.actime = st->st_atime;
4036 + ut.modtime = st->st_mtime;
4037 + utime(outpath, &ut);
4038 +
4039 + end_worker(err);
4040 + } else {
4041 + fclose(in);
4042 + fclose(out);
4043 + }
4044 +
4045 + return err;
4046 +}
4047 +
4048 +int munge_tree(const char *intree, const char *outtree, const char *cribtree)
4049 +{
4050 + char *in_path, *out_path, *crib_path;
4051 + char *in_file, *out_file, *crib_file;
4052 + DIR *thisdir;
4053 + struct dirent *dirent;
4054 + struct stat dirst;
4055 + int err = 0;
4056 +
4057 + /* Construct buffers with the common filename prefix, and point to the end */
4058 +
4059 + in_path = xmalloc(strlen(intree) + NAME_MAX + 2);
4060 + strcpy(in_path, intree);
4061 + in_file = strchr(in_path, '\0');
4062 + *in_file++ = '/';
4063 +
4064 + out_path = xmalloc(strlen(outtree) + NAME_MAX + 2);
4065 + strcpy(out_path, outtree);
4066 + out_file = strchr(out_path, '\0');
4067 + *out_file++ = '/';
4068 +
4069 + if ( cribtree ) {
4070 + crib_path = xmalloc(strlen(cribtree) + NAME_MAX + 2);
4071 + strcpy(crib_path, cribtree);
4072 + crib_file = strchr(crib_path, '\0');
4073 + *crib_file++ = '/';
4074 + } else {
4075 + crib_path = crib_file = NULL;
4076 + }
4077 +
4078 + /* Get directory information */
4079 + if ( stat(intree, &dirst) ) {
4080 + message(vl_error, "%s: Failed to stat directory %s: %s\n",
4081 + program, intree, strerror(errno));
4082 + return EX_NOINPUT;
4083 + }
4084 +
4085 + /* Open the directory */
4086 + thisdir = opendir(intree);
4087 + if ( !thisdir ) {
4088 + message(vl_error, "%s: Failed to open directory %s: %s\n",
4089 + program, intree, strerror(errno));
4090 + return EX_NOINPUT;
4091 + }
4092 +
4093 + /* Create output directory */
4094 + if ( mkdir(outtree, 0700) ) {
4095 + message(vl_error, "%s: Cannot create output directory %s: %s\n",
4096 + program, outtree, strerror(errno));
4097 + return EX_CANTCREAT;
4098 + }
4099 +
4100 + while ( (dirent = readdir(thisdir)) != NULL ) {
4101 + if ( !strcmp(dirent->d_name, ".") ||
4102 + !strcmp(dirent->d_name, "..") )
4103 + continue; /* Ignore . and .. */
4104 +
4105 + strcpy(in_file, dirent->d_name);
4106 + strcpy(out_file, dirent->d_name);
4107 + if ( crib_file )
4108 + strcpy(crib_file, dirent->d_name);
4109 +
4110 + err = munge_entry(in_path, out_path, crib_path, &dirst);
4111 + if ( err )
4112 + break;
4113 + }
4114 + closedir(thisdir);
4115 +
4116 + free(in_path);
4117 + free(out_path);
4118 +
4119 + return err;
4120 +}
4121 +
4122 +
4123 +int munge_entry(const char *in_path, const char *out_path,
4124 + const char *crib_path, const struct stat *dirst)
4125 +{
4126 + struct stat st;
4127 + struct utimbuf ut;
4128 + int err = 0;
4129 +
4130 + message(vl_filename, "%s -> %s\n", in_path, out_path);
4131 +
4132 + if ( lstat(in_path, &st) ) {
4133 + message(vl_error, "%s: Failed to stat file %s: %s\n",
4134 + program, in_path, strerror(errno));
4135 + return EX_NOINPUT;
4136 + }
4137 +
4138 + if ( S_ISREG(st.st_mode) ) {
4139 + if ( st.st_nlink > 1 ) {
4140 + /* Hard link. */
4141 + const char *linkname;
4142 +
4143 + if ( (linkname = hash_find_file(&st)) != NULL ) {
4144 + /* We've seen it before, hard link it */
4145 +
4146 + if ( link(linkname, out_path) ) {
4147 + message(vl_error, "%s: hard link %s -> %s failed: %s\n",
4148 + program, out_path, linkname, strerror(errno));
4149 + return EX_CANTCREAT;
4150 + }
4151 + } else {
4152 + /* First encounter, compress and enter into hash */
4153 + if ( (err = munge_file(in_path, out_path, crib_path, &st)) != 0 ) {
4154 + message(vl_error, "%s: %s: %s", program, in_path, strerror(errno));
4155 + return err;
4156 + }
4157 + hash_insert_file(&st, out_path);
4158 + }
4159 + } else {
4160 + /* Singleton file; no funnies */
4161 + if ( (err = munge_file(in_path, out_path, crib_path, &st)) != 0 ) {
4162 + message(vl_error, "%s: %s: %s", program, in_path, strerror(errno));
4163 + return err;
4164 + }
4165 + }
4166 + } else if ( S_ISDIR(st.st_mode) ) {
4167 + /* Recursion: see recursion */
4168 + if ( !opt.onedir &&
4169 + (!opt.onefs || (dirst && dirst->st_dev == st.st_dev)) ) {
4170 + if ( (err = munge_tree(in_path, out_path, crib_path)) != 0 )
4171 + return err;
4172 + } else if ( opt.do_mkdir ) {
4173 + /* Create stub directories */
4174 + if ( mkdir(out_path, st.st_mode) ) {
4175 + message(vl_error, "%s: %s: %s", program, out_path, strerror(errno));
4176 + return EX_CANTCREAT;
4177 + }
4178 + }
4179 + } else if ( S_ISLNK(st.st_mode) ) {
4180 + int chars;
4181 +#ifdef PATH_MAX
4182 +#define BUFFER_SLACK PATH_MAX
4183 +#else
4184 +#define BUFFER_SLACK BUFSIZ
4185 +#endif
4186 + int buffer_len = st.st_size + BUFFER_SLACK + 1;
4187 + char *buffer = xmalloc(buffer_len);
4188 + if ( (chars = readlink(in_path, buffer, buffer_len)) < 0 ) {
4189 + message(vl_error, "%s: readlink failed for %s: %s\n",
4190 + program, in_path, strerror(errno));
4191 + return EX_NOINPUT;
4192 + }
4193 + buffer[chars] = '\0';
4194 + if ( symlink(buffer, out_path) ) {
4195 + message(vl_error, "%s: symlink %s -> %s failed: %s\n",
4196 + program, out_path, buffer, strerror(errno));
4197 + return EX_CANTCREAT;
4198 + }
4199 + free(buffer);
4200 + } else {
4201 + if ( st.st_nlink > 1 ) {
4202 + /* Hard link. */
4203 + const char *linkname;
4204 +
4205 + if ( (linkname = hash_find_file(&st)) != NULL ) {
4206 + /* We've seen it before, hard link it */
4207 +
4208 + if ( link(linkname, out_path) ) {
4209 + message(vl_error, "%s: hard link %s -> %s failed: %s\n",
4210 + program, out_path, linkname, strerror(errno));
4211 + return EX_CANTCREAT;
4212 + }
4213 + } else {
4214 + /* First encounter, create and enter into hash */
4215 + if ( mknod(out_path, st.st_mode, st.st_rdev) ) {
4216 + message(vl_error, "%s: mknod failed for %s: %s\n",
4217 + program, out_path, strerror(errno));
4218 + return EX_CANTCREAT;
4219 + }
4220 + hash_insert_file(&st, out_path);
4221 + }
4222 + } else {
4223 + /* Singleton node; no funnies */
4224 + if ( mknod(out_path, st.st_mode, st.st_rdev) ) {
4225 + message(vl_error, "%s: mknod failed for %s: %s\n",
4226 + program, out_path, strerror(errno));
4227 + return EX_CANTCREAT;
4228 + }
4229 + }
4230 + }
4231 +
4232 + /* This is done by munge_file() for files */
4233 + if ( !S_ISREG(st.st_mode) ) {
4234 +#ifdef HAVE_LCHOWN
4235 + if ( lchown(out_path, st.st_uid, st.st_gid) && opt.sloppy && !err ) {
4236 + message(vl_error, "%s: %s: %s", program, out_path, strerror(errno));
4237 + err = EX_CANTCREAT;
4238 + }
4239 +#endif
4240 + if ( !S_ISLNK(st.st_mode) ) {
4241 +#ifndef HAVE_LCHOWN
4242 + if ( chown(out_path, st.st_uid, st.st_gid) && !opt.sloppy && !err ) {
4243 + message(vl_error, "%s: %s: %s", program, out_path, strerror(errno));
4244 + err = EX_CANTCREAT;
4245 + }
4246 +#endif
4247 + if ( chmod(out_path, st.st_mode) && !opt.sloppy && !err ) {
4248 + message(vl_error, "%s: %s: %s", program, out_path, strerror(errno));
4249 + err = EX_CANTCREAT;
4250 + }
4251 + ut.actime = st.st_atime;
4252 + ut.modtime = st.st_mtime;
4253 + if ( utime(out_path, &ut) && !opt.sloppy && !err ) {
4254 + message(vl_error, "%s: %s: %s", program, out_path, strerror(errno));
4255 + err = EX_CANTCREAT;
4256 + }
4257 + }
4258 + }
4259 +
4260 + return err;
4261 +}
4262 +
4263
4264 --- zisofs_tools/workers.c 1970-01-01 01:00:00.000000000 +0100
4265 +++ zisofs_tools/workers.c 2002-12-27 14:48:49.000000000 +0100
4266 @@ -0,0 +1,98 @@
4267 +#ident "$Id: workers.c,v 1.2 2001/07/31 03:20:52 hpa Exp $"
4268 +/* ----------------------------------------------------------------------- *
4269 + *
4270 + * Copyright 2001 H. Peter Anvin - All Rights Reserved
4271 + *
4272 + * This program is free software; you can redistribute it and/or modify
4273 + * it under the terms of the GNU General Public License as published by
4274 + * the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139,
4275 + * USA; either version 2 of the License, or (at your option) any later
4276 + * version; incorporated herein by reference.
4277 + *
4278 + * ----------------------------------------------------------------------- */
4279 +
4280 +/*
4281 + * workers.c
4282 + *
4283 + * Parallel job maintenance
4284 + */
4285 +
4286 +#include <stddef.h>
4287 +#include <stdlib.h>
4288 +#include <unistd.h>
4289 +#include <signal.h>
4290 +#include <stdio.h>
4291 +#include <sys/wait.h>
4292 +#include "mkzftree.h"
4293 +
4294 +/* Global option */
4295 +extern int parallel; /* Number of parallel jobs */
4296 +
4297 +/* Functions related to parallel execution */
4298 +static volatile int work_threads = 0;
4299 +static int is_worker = 0;
4300 +
4301 +/* This waits for one worker to finish */
4302 +static void wait_for_one_worker(void)
4303 +{
4304 + int status;
4305 +
4306 + if ( wait(&status) > 0 ) {
4307 + work_threads--;
4308 +
4309 + if ( WIFSIGNALED(status) ) {
4310 + kill(getpid(), WTERMSIG(status));
4311 + exit(EX_SOFTWARE);
4312 + } else if ( WEXITSTATUS(status) ) {
4313 + exit(WEXITSTATUS(status));
4314 + }
4315 + }
4316 +}
4317 +
4318 +/* This waits for *all* workers to finish */
4319 +void wait_for_all_workers(void)
4320 +{
4321 + while ( work_threads )
4322 + wait_for_one_worker();
4323 +}
4324 +
4325 +/* This returns 1 if the "job" at hand should be performed */
4326 +int spawn_worker(void)
4327 +{
4328 + pid_t f;
4329 +
4330 + if ( opt.parallel == 0 )
4331 + return 1;
4332 +
4333 + fflush(NULL);
4334 +
4335 + /* Wait for a work slot */
4336 + while ( work_threads >= opt.parallel )
4337 + wait_for_one_worker();
4338 +
4339 + /* Spawn worker process */
4340 + work_threads++; /* Avoids race conditions */
4341 + f = fork();
4342 + if ( f == -1 ) {
4343 + work_threads--;
4344 + return 1; /* Do it ourselves */
4345 + }
4346 +
4347 + if ( f == 0 ) {
4348 + /* Worker process */
4349 + is_worker = 1;
4350 + return 1;
4351 + } else {
4352 + /* Control process */
4353 + return 0;
4354 + }
4355 +}
4356 +
4357 +/* Routine to perform at the end of the job */
4358 +void end_worker(int err)
4359 +{
4360 + if ( is_worker ) {
4361 + exit(err);
4362 + }
4363 +}
4364 +
4365
4366 --- zisofs_tools/zisofs.magic 1970-01-01 01:00:00.000000000 +0100
4367 +++ zisofs_tools/zisofs.magic 2002-12-27 14:48:49.000000000 +0100
4368 @@ -0,0 +1,8 @@
4369 +
4370 +#------------------------------------------------------------------------------
4371 +# zisofs: file(1) magic for zisofs/RockRidge compressed files
4372 +#
4373 +# from H. Peter Anvin <hpa@zytor.com> May 4, 2001
4374 +#
4375 +0 string \x37\xE4\x53\x96\xC9\xDB\xD6\x07 zisofs/Rockridge compressed file
4376 +>8 lelong x - %d bytes

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.5