When building 2.8.0 this morning for Fedora, I noticed that it was
building the included bzlib2 source and using it rather than the system
bzip2 libraries and headers. I tracked down the reason to this section
of configure:

cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#ifdef HAVE_BZLIB_H
#include <bzlib.h>
#endif
int main() {
    char *ver = BZ2_bzlibVersion();
    exit(strcmp(ver, "1.0.5") < 0);
}

_ACEOF

That code wasn't working at all because HAVE_BZLIB_H never gets set
anywhere, even though the configure script had found the system bzip2
bits. This patch adds it to m4/R.m4 and configure, against 2.8.0. With
the patch, R now properly detects bzip2 1.0.5 in Fedora and uses that
rather than the local copy.

~spot
diff -up R-2.8.0/configure.BAD R-2.8.0/configure
--- R-2.8.0/configure.BAD	2008-10-26 11:51:56.000000000 -0400
+++ R-2.8.0/configure	2008-10-26 11:52:31.000000000 -0400
@@ -44779,6 +44779,11 @@ else
   have_bzlib=no
 fi
 if test "x${have_bzlib}" = xyes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_BZLIB_H 1
+_ACEOF
+
 { echo "$as_me:$LINENO: checking if bzip2 version >= 1.0.5" >&5
 echo $ECHO_N "checking if bzip2 version >= 1.0.5... $ECHO_C" >&6; }
 if test "${r_cv_have_bzlib+set}" = set; then
diff -up R-2.8.0/m4/R.m4.BAD R-2.8.0/m4/R.m4
--- R-2.8.0/m4/R.m4.BAD	2008-09-21 18:05:06.000000000 -0400
+++ R-2.8.0/m4/R.m4	2008-10-26 11:53:05.000000000 -0400
@@ -3055,6 +3055,7 @@ else
   have_bzlib=no
 fi
 if test "x${have_bzlib}" = xyes; then
+AC_DEFINE(HAVE_BZLIB_H, 1, [Define to 1 if you have bzlib.h.])
 AC_CACHE_CHECK([if bzip2 version >= 1.0.5], [r_cv_have_bzlib],
 [AC_LANG_PUSH(C)
 r_save_LIBS="${LIBS}"
______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to