diff --git a/nulib2/ArcUtils.c b/nulib2/ArcUtils.c index 0bf9ac0..f90fae3 100644 --- a/nulib2/ArcUtils.c +++ b/nulib2/ArcUtils.c @@ -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) */ diff --git a/nulib2/ChangeLog.txt b/nulib2/ChangeLog.txt index 079702d..5fe695e 100644 --- a/nulib2/ChangeLog.txt +++ b/nulib2/ChangeLog.txt @@ -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 diff --git a/nulib2/List.c b/nulib2/List.c index fb2af5e..c38b4bd 100644 --- a/nulib2/List.c +++ b/nulib2/List.c @@ -18,7 +18,7 @@ enum RecordKind { }; static const char* gShortFormatNames[] = { - "unc", "squ", "lz1", "lz2", "u12", "u16" + "unc", "squ", "lz1", "lz2", "u12", "u16", "dfl" }; diff --git a/nulib2/Main.c b/nulib2/Main.c index 11e3c41..e2ea584 100644 --- a/nulib2/Main.c +++ b/nulib2/Main.c @@ -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); diff --git a/nulib2/Makefile.in b/nulib2/Makefile.in index 7ff690c..0604589 100644 --- a/nulib2/Makefile.in +++ b/nulib2/Makefile.in @@ -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 diff --git a/nulib2/State.c b/nulib2/State.c index 64a296a..9ff140a 100644 --- a/nulib2/State.c +++ b/nulib2/State.c @@ -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) { diff --git a/nulib2/State.h b/nulib2/State.h index 91250de..2bf6816 100644 --- a/nulib2/State.h +++ b/nulib2/State.h @@ -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); diff --git a/nulib2/SysUtils.c b/nulib2/SysUtils.c index e5f6754..bcae9fb 100644 --- a/nulib2/SysUtils.c +++ b/nulib2/SysUtils.c @@ -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; } diff --git a/nulib2/config.h.in b/nulib2/config.h.in index 0625dd3..ad146cf 100644 --- a/nulib2/config.h.in +++ b/nulib2/config.h.in @@ -104,6 +104,9 @@ /* Define if you have the 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 diff --git a/nulib2/configure b/nulib2/configure index 95b3e1f..4b94997 100755 --- a/nulib2/configure +++ b/nulib2/configure @@ -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 < #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 <&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 <&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 < 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 < 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 < 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 < #include @@ -1078,7 +1077,7 @@ else #include 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 @@ -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 @@ -1134,7 +1133,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #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 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 <&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 +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 <&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 < #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 < #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 < #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 < #include @@ -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 < #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 < #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 < #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 < #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 < #include @@ -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 <&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 diff --git a/nulib2/configure.in b/nulib2/configure.in index 37973f3..423d2e1 100644 --- a/nulib2/configure.in +++ b/nulib2/configure.in @@ -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)