mirror of https://github.com/fadden/nulib2.git
Added optional support for zlib deflate compression via the "-z" flag. The
auto-config checks for zlib, and enables the features if found. This isn't ideal, but it'll do. The "gory debug" output is now available with the "-g" command.
This commit is contained in:
parent
df3b8cc850
commit
e7a3225f04
|
@ -903,6 +903,11 @@ OpenArchiveReadWrite(NulibState* pState)
|
|||
err = NuSetValue(pArchive, kNuValueDataCompression, kNuCompressNone);
|
||||
BailError(err);
|
||||
}
|
||||
/* handle "-9" flag */
|
||||
if (NState_GetModCompressDeflate(pState)) {
|
||||
err = NuSetValue(pArchive, kNuValueDataCompression, kNuCompressDeflate);
|
||||
BailError(err);
|
||||
}
|
||||
|
||||
/* handle "-f" and "-u" flags */
|
||||
/* (BUG: if "-f" is set, creating a new archive is impossible) */
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
2002/09/30 fadden
|
||||
- added "-z" flag to specify zlib's "deflate" compression (the
|
||||
"secret" debug dump command is now -g)
|
||||
|
||||
2002/09/26 fadden
|
||||
- progress updater now shows "analyzing" for scan pass of SQ
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ enum RecordKind {
|
|||
};
|
||||
|
||||
static const char* gShortFormatNames[] = {
|
||||
"unc", "squ", "lz1", "lz2", "u12", "u16"
|
||||
"unc", "squ", "lz1", "lz2", "u12", "u16", "dfl"
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ typedef struct ValidCombo {
|
|||
} ValidCombo;
|
||||
|
||||
static const ValidCombo gValidCombos[] = {
|
||||
{ kCommandAdd, false, true, "ufrj0cke" },
|
||||
{ kCommandAdd, false, true, "ufrj0zcke" },
|
||||
{ kCommandDelete, false, true, "r" },
|
||||
{ kCommandExtract, true, false, "ufrjclse" },
|
||||
{ kCommandExtractToPipe, true, false, "rl" },
|
||||
|
@ -149,7 +149,7 @@ Usage(const NulibState* pState)
|
|||
NState_GetProgramVersion(pState),
|
||||
majorVersion, minorVersion, bugVersion, nufxLibFlags);
|
||||
printf("This software is distributed under terms of the GNU General Public License.\n");
|
||||
printf("Written by Andy McFadden, http://www.nulib.com/.\n\n");
|
||||
printf("Written by Andy McFadden. See http://www.nulib.com/ for full manual.\n\n");
|
||||
printf("Usage: %s -command[modifiers] archive [filename-list]\n\n",
|
||||
gProgName);
|
||||
printf(
|
||||
|
@ -161,10 +161,15 @@ Usage(const NulibState* pState)
|
|||
" modifiers:\n"
|
||||
" -u update files (add + keep newest) -f freshen (update, no add)\n"
|
||||
" -r recurse into subdirs -j junk (don't record) directory names\n"
|
||||
" -0 don't use compression -c add one-line comments\n"
|
||||
#ifdef HAVE_LIBZ
|
||||
" -0 don't use compression -z compress with gzip-style 'deflate'\n"
|
||||
#else
|
||||
" -0 don't use compression -z use zlib [not included]\n"
|
||||
#endif
|
||||
" -l auto-convert text files -ll auto-convert ALL files\n"
|
||||
" -s stomp existing files w/o asking -k store files as disk images\n"
|
||||
" -e preserve ProDOS file types -ee extend preserved names\n"
|
||||
" -e preserve ProDOS file types -ee preserve types and extend names\n"
|
||||
" -c add one-line comments\n"
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -220,7 +225,7 @@ ProcessOptions(NulibState* pState, int argc, char* const* argv)
|
|||
case 'p': NState_SetCommand(pState, kCommandExtractToPipe); break;
|
||||
case 't': NState_SetCommand(pState, kCommandListShort); break;
|
||||
case 'v': NState_SetCommand(pState, kCommandListVerbose); break;
|
||||
case 'z': NState_SetCommand(pState, kCommandListDebug); break;
|
||||
case 'g': NState_SetCommand(pState, kCommandListDebug); break;
|
||||
case 'i': NState_SetCommand(pState, kCommandTest); break;
|
||||
case 'd': NState_SetCommand(pState, kCommandDelete); break;
|
||||
default:
|
||||
|
@ -241,6 +246,14 @@ ProcessOptions(NulibState* pState, int argc, char* const* argv)
|
|||
case 'c': NState_SetModComments(pState, true); break;
|
||||
case 's': NState_SetModOverwriteExisting(pState, true); break;
|
||||
case 'k': NState_SetModAddAsDisk(pState, true); break;
|
||||
case 'z':
|
||||
#ifdef HAVE_LIBZ
|
||||
NState_SetModCompressDeflate(pState, true);
|
||||
#else
|
||||
fprintf(stderr, "%s: WARNING: zlib support not compiled in\n",
|
||||
gProgName);
|
||||
#endif
|
||||
break;
|
||||
case 'e':
|
||||
if (*(cp-1) == 'e') /* should never point at invalid */
|
||||
NState_SetModPreserveTypeExtended(pState, true);
|
||||
|
|
|
@ -90,7 +90,7 @@ purify:
|
|||
@$(MAKE) PURIFY_BUILD=1
|
||||
|
||||
$(PRODUCT): $(OBJS) $(NUFXLIB)
|
||||
$(PURIFY) $(QUANTIFY) $(CC) -o $@ $(OBJS) -L$(NUFXSRCDIR) -L$(libdir) -lnufx @DMALLOC@
|
||||
$(PURIFY) $(QUANTIFY) $(CC) -o $@ $(OBJS) -L$(NUFXSRCDIR) -L$(libdir) -lnufx @LIBS@
|
||||
|
||||
clean:
|
||||
-rm -f *.o core
|
||||
|
|
|
@ -123,6 +123,8 @@ NState_DebugDump(const NulibState* pState)
|
|||
printf(" junkPaths\n");
|
||||
if (pState->modNoCompression)
|
||||
printf(" noCompression\n");
|
||||
if (pState->modCompressDeflate)
|
||||
printf(" compressDeflate\n");
|
||||
if (pState->modComments)
|
||||
printf(" comments\n");
|
||||
if (pState->modConvertText)
|
||||
|
@ -413,6 +415,18 @@ NState_SetModNoCompression(NulibState* pState, Boolean val)
|
|||
pState->modNoCompression = val;
|
||||
}
|
||||
|
||||
Boolean
|
||||
NState_GetModCompressDeflate(const NulibState* pState)
|
||||
{
|
||||
return pState->modCompressDeflate;
|
||||
}
|
||||
|
||||
void
|
||||
NState_SetModCompressDeflate(NulibState* pState, Boolean val)
|
||||
{
|
||||
pState->modCompressDeflate = val;
|
||||
}
|
||||
|
||||
Boolean
|
||||
NState_GetModComments(const NulibState* pState)
|
||||
{
|
||||
|
|
|
@ -63,6 +63,7 @@ typedef struct NulibState {
|
|||
Boolean modRecurse;
|
||||
Boolean modJunkPaths;
|
||||
Boolean modNoCompression;
|
||||
Boolean modCompressDeflate;
|
||||
Boolean modComments;
|
||||
Boolean modConvertText;
|
||||
Boolean modConvertAll;
|
||||
|
@ -127,6 +128,8 @@ Boolean NState_GetModJunkPaths(const NulibState* pState);
|
|||
void NState_SetModJunkPaths(NulibState* pState, Boolean val);
|
||||
Boolean NState_GetModNoCompression(const NulibState* pState);
|
||||
void NState_SetModNoCompression(NulibState* pState, Boolean val);
|
||||
Boolean NState_GetModCompressDeflate(const NulibState* pState);
|
||||
void NState_SetModCompressDeflate(NulibState* pState, Boolean val);
|
||||
Boolean NState_GetModComments(const NulibState* pState);
|
||||
void NState_SetModComments(NulibState* pState, Boolean val);
|
||||
Boolean NState_GetModConvertText(const NulibState* pState);
|
||||
|
|
|
@ -610,7 +610,7 @@ DoAddFile(NulibState* pState, NuArchive* pArchive, const char* pathname,
|
|||
|
||||
bail:
|
||||
if (err != kNuErrNone)
|
||||
ReportError(err, "Unable to add file");
|
||||
ReportError(err, "unable to add file");
|
||||
bail_quiet:
|
||||
return err;
|
||||
}
|
||||
|
@ -744,7 +744,7 @@ UNIXAddFile(NulibState* pState, NuArchive* pArchive, const char* pathname)
|
|||
|
||||
bail:
|
||||
if (err != kNuErrNone)
|
||||
ReportError(err, "Unable to add file");
|
||||
ReportError(err, "unable to add file");
|
||||
bail_quiet:
|
||||
return err;
|
||||
}
|
||||
|
@ -975,7 +975,7 @@ Win32AddFile(NulibState* pState, NuArchive* pArchive, const char* pathname)
|
|||
|
||||
bail:
|
||||
if (err != kNuErrNone)
|
||||
ReportError(err, "Unable to add file");
|
||||
ReportError(err, "unable to add file");
|
||||
bail_quiet:
|
||||
return err;
|
||||
}
|
||||
|
|
|
@ -104,6 +104,9 @@
|
|||
/* Define if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define if you have libz.a or libz.so */
|
||||
#undef HAVE_LIBZ
|
||||
|
||||
/* Define if we want to use the dmalloc library (--enable-dmalloc). */
|
||||
#undef USE_DMALLOC
|
||||
|
||||
|
|
|
@ -858,18 +858,17 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
|
|||
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
|
||||
|
||||
|
||||
|
||||
ac_header_dirent=no
|
||||
for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
|
||||
do
|
||||
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
|
||||
echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
|
||||
echo "configure:868: checking for $ac_hdr that defines DIR" >&5
|
||||
echo "configure:867: checking for $ac_hdr that defines DIR" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 873 "configure"
|
||||
#line 872 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <sys/types.h>
|
||||
#include <$ac_hdr>
|
||||
|
@ -877,7 +876,7 @@ int main() {
|
|||
DIR *dirp = 0;
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:881: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:880: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_header_dirent_$ac_safe=yes"
|
||||
else
|
||||
|
@ -902,7 +901,7 @@ done
|
|||
# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
|
||||
if test $ac_header_dirent = dirent.h; then
|
||||
echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
|
||||
echo "configure:906: checking for opendir in -ldir" >&5
|
||||
echo "configure:905: checking for opendir in -ldir" >&5
|
||||
ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
|
||||
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
|
@ -910,7 +909,7 @@ else
|
|||
ac_save_LIBS="$LIBS"
|
||||
LIBS="-ldir $LIBS"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 914 "configure"
|
||||
#line 913 "configure"
|
||||
#include "confdefs.h"
|
||||
/* Override any gcc2 internal prototype to avoid an error. */
|
||||
/* We use char because int might match the return type of a gcc2
|
||||
|
@ -921,7 +920,7 @@ int main() {
|
|||
opendir()
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:925: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
if { (eval echo configure:924: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_lib_$ac_lib_var=yes"
|
||||
else
|
||||
|
@ -943,7 +942,7 @@ fi
|
|||
|
||||
else
|
||||
echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
|
||||
echo "configure:947: checking for opendir in -lx" >&5
|
||||
echo "configure:946: checking for opendir in -lx" >&5
|
||||
ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
|
||||
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
|
@ -951,7 +950,7 @@ else
|
|||
ac_save_LIBS="$LIBS"
|
||||
LIBS="-lx $LIBS"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 955 "configure"
|
||||
#line 954 "configure"
|
||||
#include "confdefs.h"
|
||||
/* Override any gcc2 internal prototype to avoid an error. */
|
||||
/* We use char because int might match the return type of a gcc2
|
||||
|
@ -962,7 +961,7 @@ int main() {
|
|||
opendir()
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:966: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
if { (eval echo configure:965: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_lib_$ac_lib_var=yes"
|
||||
else
|
||||
|
@ -985,7 +984,7 @@ fi
|
|||
fi
|
||||
|
||||
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
|
||||
echo "configure:989: checking how to run the C preprocessor" >&5
|
||||
echo "configure:988: checking how to run the C preprocessor" >&5
|
||||
# On Suns, sometimes $CPP names a directory.
|
||||
if test -n "$CPP" && test -d "$CPP"; then
|
||||
CPP=
|
||||
|
@ -1000,13 +999,13 @@ else
|
|||
# On the NeXT, cc -E runs the code through the compiler's parser,
|
||||
# not just through cpp.
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1004 "configure"
|
||||
#line 1003 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <assert.h>
|
||||
Syntax Error
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:1010: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:1009: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
|
||||
if test -z "$ac_err"; then
|
||||
:
|
||||
|
@ -1017,13 +1016,13 @@ else
|
|||
rm -rf conftest*
|
||||
CPP="${CC-cc} -E -traditional-cpp"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1021 "configure"
|
||||
#line 1020 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <assert.h>
|
||||
Syntax Error
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:1027: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:1026: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
|
||||
if test -z "$ac_err"; then
|
||||
:
|
||||
|
@ -1034,13 +1033,13 @@ else
|
|||
rm -rf conftest*
|
||||
CPP="${CC-cc} -nologo -E"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1038 "configure"
|
||||
#line 1037 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <assert.h>
|
||||
Syntax Error
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:1044: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:1043: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
|
||||
if test -z "$ac_err"; then
|
||||
:
|
||||
|
@ -1065,12 +1064,12 @@ fi
|
|||
echo "$ac_t""$CPP" 1>&6
|
||||
|
||||
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
|
||||
echo "configure:1069: checking for ANSI C header files" >&5
|
||||
echo "configure:1068: checking for ANSI C header files" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1074 "configure"
|
||||
#line 1073 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
|
@ -1078,7 +1077,7 @@ else
|
|||
#include <float.h>
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:1082: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:1081: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
|
||||
if test -z "$ac_err"; then
|
||||
rm -rf conftest*
|
||||
|
@ -1095,7 +1094,7 @@ rm -f conftest*
|
|||
if test $ac_cv_header_stdc = yes; then
|
||||
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1099 "configure"
|
||||
#line 1098 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <string.h>
|
||||
EOF
|
||||
|
@ -1113,7 +1112,7 @@ fi
|
|||
if test $ac_cv_header_stdc = yes; then
|
||||
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1117 "configure"
|
||||
#line 1116 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <stdlib.h>
|
||||
EOF
|
||||
|
@ -1134,7 +1133,7 @@ if test "$cross_compiling" = yes; then
|
|||
:
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1138 "configure"
|
||||
#line 1137 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <ctype.h>
|
||||
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
|
||||
|
@ -1145,7 +1144,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
|
|||
exit (0); }
|
||||
|
||||
EOF
|
||||
if { (eval echo configure:1149: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
|
||||
if { (eval echo configure:1148: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
|
||||
then
|
||||
:
|
||||
else
|
||||
|
@ -1173,17 +1172,17 @@ for ac_hdr in fcntl.h limits.h malloc.h stdlib.h strings.h sys/stat.h \
|
|||
do
|
||||
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
|
||||
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
|
||||
echo "configure:1177: checking for $ac_hdr" >&5
|
||||
echo "configure:1176: checking for $ac_hdr" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1182 "configure"
|
||||
#line 1181 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <$ac_hdr>
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:1187: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:1186: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
|
||||
if test -z "$ac_err"; then
|
||||
rm -rf conftest*
|
||||
|
@ -1210,13 +1209,90 @@ fi
|
|||
done
|
||||
|
||||
|
||||
LIBS=""
|
||||
echo $ac_n "checking for deflate in -lz""... $ac_c" 1>&6
|
||||
echo "configure:1215: checking for deflate in -lz" >&5
|
||||
ac_lib_var=`echo z'_'deflate | sed 'y%./+-%__p_%'`
|
||||
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
ac_save_LIBS="$LIBS"
|
||||
LIBS="-lz $LIBS"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1223 "configure"
|
||||
#include "confdefs.h"
|
||||
/* Override any gcc2 internal prototype to avoid an error. */
|
||||
/* We use char because int might match the return type of a gcc2
|
||||
builtin and then its argument prototype would still apply. */
|
||||
char deflate();
|
||||
|
||||
int main() {
|
||||
deflate()
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_lib_$ac_lib_var=yes"
|
||||
else
|
||||
echo "configure: failed program was:" >&5
|
||||
cat conftest.$ac_ext >&5
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_lib_$ac_lib_var=no"
|
||||
fi
|
||||
rm -f conftest*
|
||||
LIBS="$ac_save_LIBS"
|
||||
|
||||
fi
|
||||
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
|
||||
echo "$ac_t""yes" 1>&6
|
||||
ac_safe=`echo "zlib.h" | sed 'y%./+-%__p_%'`
|
||||
echo $ac_n "checking for zlib.h""... $ac_c" 1>&6
|
||||
echo "configure:1251: checking for zlib.h" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1256 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <zlib.h>
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:1261: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
|
||||
if test -z "$ac_err"; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_header_$ac_safe=yes"
|
||||
else
|
||||
echo "$ac_err" >&5
|
||||
echo "configure: failed program was:" >&5
|
||||
cat conftest.$ac_ext >&5
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_header_$ac_safe=no"
|
||||
fi
|
||||
rm -f conftest*
|
||||
fi
|
||||
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
|
||||
echo "$ac_t""yes" 1>&6
|
||||
cat >> confdefs.h <<\EOF
|
||||
#define HAVE_LIBZ 1
|
||||
EOF
|
||||
LIBS="$LIBS -lz"
|
||||
else
|
||||
echo "$ac_t""no" 1>&6
|
||||
fi
|
||||
|
||||
else
|
||||
echo "$ac_t""no" 1>&6
|
||||
fi
|
||||
|
||||
|
||||
echo $ac_n "checking for working const""... $ac_c" 1>&6
|
||||
echo "configure:1215: checking for working const" >&5
|
||||
echo "configure:1291: checking for working const" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1220 "configure"
|
||||
#line 1296 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
int main() {
|
||||
|
@ -1265,7 +1341,7 @@ ccp = (char const *const *) p;
|
|||
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1269: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:1345: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
ac_cv_c_const=yes
|
||||
else
|
||||
|
@ -1286,12 +1362,12 @@ EOF
|
|||
fi
|
||||
|
||||
echo $ac_n "checking for mode_t""... $ac_c" 1>&6
|
||||
echo "configure:1290: checking for mode_t" >&5
|
||||
echo "configure:1366: checking for mode_t" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1295 "configure"
|
||||
#line 1371 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <sys/types.h>
|
||||
#if STDC_HEADERS
|
||||
|
@ -1319,12 +1395,12 @@ EOF
|
|||
fi
|
||||
|
||||
echo $ac_n "checking for off_t""... $ac_c" 1>&6
|
||||
echo "configure:1323: checking for off_t" >&5
|
||||
echo "configure:1399: checking for off_t" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1328 "configure"
|
||||
#line 1404 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <sys/types.h>
|
||||
#if STDC_HEADERS
|
||||
|
@ -1352,12 +1428,12 @@ EOF
|
|||
fi
|
||||
|
||||
echo $ac_n "checking for size_t""... $ac_c" 1>&6
|
||||
echo "configure:1356: checking for size_t" >&5
|
||||
echo "configure:1432: checking for size_t" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1361 "configure"
|
||||
#line 1437 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <sys/types.h>
|
||||
#if STDC_HEADERS
|
||||
|
@ -1385,12 +1461,12 @@ EOF
|
|||
fi
|
||||
|
||||
echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
|
||||
echo "configure:1389: checking whether struct tm is in sys/time.h or time.h" >&5
|
||||
echo "configure:1465: checking whether struct tm is in sys/time.h or time.h" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1394 "configure"
|
||||
#line 1470 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <sys/types.h>
|
||||
#include <time.h>
|
||||
|
@ -1398,7 +1474,7 @@ int main() {
|
|||
struct tm *tp; tp->tm_sec;
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1402: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:1478: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
ac_cv_struct_tm=time.h
|
||||
else
|
||||
|
@ -1419,12 +1495,12 @@ EOF
|
|||
fi
|
||||
|
||||
echo $ac_n "checking for uchar""... $ac_c" 1>&6
|
||||
echo "configure:1423: checking for uchar" >&5
|
||||
echo "configure:1499: checking for uchar" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_type_uchar'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1428 "configure"
|
||||
#line 1504 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <sys/types.h>
|
||||
#if STDC_HEADERS
|
||||
|
@ -1452,12 +1528,12 @@ EOF
|
|||
fi
|
||||
|
||||
echo $ac_n "checking for ushort""... $ac_c" 1>&6
|
||||
echo "configure:1456: checking for ushort" >&5
|
||||
echo "configure:1532: checking for ushort" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_type_ushort'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1461 "configure"
|
||||
#line 1537 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <sys/types.h>
|
||||
#if STDC_HEADERS
|
||||
|
@ -1485,12 +1561,12 @@ EOF
|
|||
fi
|
||||
|
||||
echo $ac_n "checking for uint""... $ac_c" 1>&6
|
||||
echo "configure:1489: checking for uint" >&5
|
||||
echo "configure:1565: checking for uint" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_type_uint'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1494 "configure"
|
||||
#line 1570 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <sys/types.h>
|
||||
#if STDC_HEADERS
|
||||
|
@ -1518,12 +1594,12 @@ EOF
|
|||
fi
|
||||
|
||||
echo $ac_n "checking for ulong""... $ac_c" 1>&6
|
||||
echo "configure:1522: checking for ulong" >&5
|
||||
echo "configure:1598: checking for ulong" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_type_ulong'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1527 "configure"
|
||||
#line 1603 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <sys/types.h>
|
||||
#if STDC_HEADERS
|
||||
|
@ -1552,7 +1628,7 @@ fi
|
|||
|
||||
|
||||
echo $ac_n "checking whether utime accepts a null argument""... $ac_c" 1>&6
|
||||
echo "configure:1556: checking whether utime accepts a null argument" >&5
|
||||
echo "configure:1632: checking whether utime accepts a null argument" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_func_utime_null'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
|
@ -1562,7 +1638,7 @@ if test "$cross_compiling" = yes; then
|
|||
ac_cv_func_utime_null=no
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1566 "configure"
|
||||
#line 1642 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
@ -1573,7 +1649,7 @@ exit(!(stat ("conftestdata", &s) == 0 && utime("conftestdata", (long *)0) == 0
|
|||
&& t.st_mtime - s.st_mtime < 120));
|
||||
}
|
||||
EOF
|
||||
if { (eval echo configure:1577: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
|
||||
if { (eval echo configure:1653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
|
||||
then
|
||||
ac_cv_func_utime_null=yes
|
||||
else
|
||||
|
@ -1599,12 +1675,12 @@ fi
|
|||
for ac_func in memmove mkdir strtoul strcasecmp strncasecmp strerror
|
||||
do
|
||||
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
|
||||
echo "configure:1603: checking for $ac_func" >&5
|
||||
echo "configure:1679: checking for $ac_func" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1608 "configure"
|
||||
#line 1684 "configure"
|
||||
#include "confdefs.h"
|
||||
/* System header to define __stub macros and hopefully few prototypes,
|
||||
which can conflict with char $ac_func(); below. */
|
||||
|
@ -1627,7 +1703,7 @@ $ac_func();
|
|||
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1631: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
if { (eval echo configure:1707: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_func_$ac_func=yes"
|
||||
else
|
||||
|
@ -1695,7 +1771,7 @@ if test "${enable_dmalloc+set}" = set; then
|
|||
enableval="$enable_dmalloc"
|
||||
\
|
||||
echo "--- enabling dmalloc";
|
||||
DMALLOC="-L/usr/local/lib -ldmalloc"; cat >> confdefs.h <<\EOF
|
||||
LIBS="$LIBS -L/usr/local/lib -ldmalloc"; cat >> confdefs.h <<\EOF
|
||||
#define USE_DMALLOC 1
|
||||
EOF
|
||||
|
||||
|
|
|
@ -7,16 +7,17 @@ AC_CANONICAL_HOST
|
|||
AC_PROG_CC
|
||||
AC_PROG_INSTALL
|
||||
|
||||
dnl Checks for libraries.
|
||||
dnl Replace `main' with a function in -lr:
|
||||
dnl AC_CHECK_LIB(r, main)
|
||||
|
||||
dnl Checks for header files.
|
||||
AC_HEADER_DIRENT
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS(fcntl.h limits.h malloc.h stdlib.h strings.h sys/stat.h \
|
||||
sys/time.h sys/types.h unistd.h)
|
||||
|
||||
dnl Check for zlib. Make sure it comes with zlib.h.
|
||||
LIBS=""
|
||||
AC_CHECK_LIB(z, deflate,
|
||||
AC_CHECK_HEADER(zlib.h, AC_DEFINE(HAVE_LIBZ) LIBS="$LIBS -lz"))
|
||||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_C_CONST
|
||||
AC_TYPE_MODE_T
|
||||
|
@ -80,7 +81,7 @@ AC_SUBST(BUILD_FLAGS)
|
|||
DMALLOC=
|
||||
AC_ARG_ENABLE(dmalloc, [ --enable-dmalloc: do dmalloc stuff], \
|
||||
[ echo "--- enabling dmalloc";
|
||||
DMALLOC="-L/usr/local/lib -ldmalloc"; AC_DEFINE(USE_DMALLOC) ])
|
||||
LIBS="$LIBS -L/usr/local/lib -ldmalloc"; AC_DEFINE(USE_DMALLOC) ])
|
||||
AC_SUBST(DMALLOC)
|
||||
|
||||
AC_OUTPUT(Makefile)
|
||||
|
|
Loading…
Reference in New Issue