http://code.google.com/p/xar/source/detail?r=227
Modified:
/trunk/xar/ChangeLog
/trunk/xar/configure.ac
/trunk/xar/src/xar.c
=======================================
--- /trunk/xar/ChangeLog Wed Jul 8 20:15:55 2009
+++ /trunk/xar/ChangeLog Tue Nov 24 17:11:05 2009
@@ -1,4 +1,7 @@
devel
+ 2009-11-24 Rob Braun bbr...@synack.net
+ * src/xar.c: If a compression type is specified that we don't
support/haven't been compiled with, spit out an error.
+ * configure.ac: Allow explicit disabling of bzip2 support.
2009-07-08 Rob Braun bbr...@synack.net
* lib/archive.c: Fix an invalid free, pointed out by Randy Saldinger
* lib/archive.c: Have xar_open() check if there are checksum properties
in the toc and use that. If not, fall back to static location.
=======================================
--- /trunk/xar/configure.ac Fri Dec 14 12:32:01 2007
+++ /trunk/xar/configure.ac Tue Nov 24 17:11:05 2009
@@ -341,12 +341,17 @@
dnl
dnl Configure libbz2.
-dnl
+dnl This doesn't support specifying a path yet, but supports explicitly
+dnl enabling or disabling bzip2 support
have_libbz2="1"
-AC_CHECK_HEADERS([bzlib.h], , [have_libbz2="0"])
-AC_CHECK_LIB([bz2], [BZ2_bzCompress], , [have_libbz2="0"])
-if test "x${have_libbz2}" = "x1" ; then
- AC_DEFINE([HAVE_LIBBZ2])
+AC_ARG_WITH([bzip2], [AS_HELP_STRING([--with-bzip2], [Explicitly enable or
disable bzip2 support. Defaults to enabled if available.])], [],
[with_bzip2="yes"])
+
+if test "x$with_bzip2" != "xno"; then
+ AC_CHECK_HEADERS([bzlib.h], , [have_libbz2="0"])
+ AC_CHECK_LIB([bz2], [BZ2_bzCompress], , [have_libbz2="0"])
+ if test "x${have_libbz2}" = "x1" ; then
+ AC_DEFINE([HAVE_LIBBZ2])
+ fi
fi
dnl
=======================================
--- /trunk/xar/src/xar.c Fri Dec 19 08:34:32 2008
+++ /trunk/xar/src/xar.c Tue Nov 24 17:11:05 2009
@@ -793,10 +793,18 @@
exit(1);
}
if( (strcmp(optarg, XAR_OPT_VAL_NONE) != 0) &&
- (strcmp(optarg, XAR_OPT_VAL_GZIP) != 0) &&
- (strcmp(optarg, XAR_OPT_VAL_BZIP) != 0) &&
- (strcmp(optarg, XAR_OPT_VAL_LZMA) != 0) &&
- (strcmp(optarg, XAR_OPT_VAL_XZ) != 0) ) {
+ (strcmp(optarg, XAR_OPT_VAL_GZIP) != 0)
+#ifdef HAVE_LIBBZ2
+ && (strcmp(optarg, XAR_OPT_VAL_BZIP) != 0)
+#endif
+#ifdef HAVE_LIBLZMA
+ && (strcmp(optarg, XAR_OPT_VAL_LZMA) != 0)
+#endif
+#ifdef HAVE_XZ
+ && (strcmp(optarg, XAR_OPT_VAL_XZ) != 0)
+#endif
+ ) {
+ fprintf(stderr, "This instance of xar doesn't
understand compression type %s\n", optarg);
usage(argv[0]);
exit(1);
}