Author: cazfi
Date: Fri Mar  4 09:48:39 2016
New Revision: 32175

URL: http://svn.gna.org/viewcvs/freeciv?rev=32175&view=rev
Log:
Added configure options --with-libbz2 and --with-liblzma

See patch #7023

Modified:
    branches/S2_6/configure.ac
    branches/S2_6/doc/README.packaging

Modified: branches/S2_6/configure.ac
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/configure.ac?rev=32175&r1=32174&r2=32175&view=diff
==============================================================================
--- branches/S2_6/configure.ac  (original)
+++ branches/S2_6/configure.ac  Fri Mar  4 09:48:39 2016
@@ -748,23 +748,43 @@
 fi
 
 dnl Check for bzip2 compression
-AC_CHECK_LIB(bz2, BZ2_bzReadOpen,
-  [AC_CHECK_HEADERS([bzlib.h],
-   [AC_DEFINE([FREECIV_HAVE_LIBBZ2], [1], [libbzip2 is available])
-UTILITY_LIBS="${UTILITY_LIBS} -lbz2"
-libbz2_available=true])])
-if test "x$libbz2_available" != "xtrue" ; then
-  feature_bz2=missing
+AC_ARG_WITH([libbz2],
+  AS_HELP_STRING([--with-libbz2], [support bzip2 compressed files [if 
possible]]),
+[WITH_BZ2="${withval}"],
+[WITH_BZ2="test"])
+
+if test "x$WITH_BZ2" != xno ; then
+  AC_CHECK_LIB([bz2], [BZ2_bzReadOpen],
+    [AC_CHECK_HEADERS([bzlib.h],
+     [AC_DEFINE([FREECIV_HAVE_LIBBZ2], [1], [libbzip2 is available])
+  UTILITY_LIBS="${UTILITY_LIBS} -lbz2"
+  libbz2_available=true])])
+  if test "x$libbz2_available" != "xtrue" ; then
+    if test "x$WITH_BZ2" = "xyes" ; then
+      AC_MSG_ERROR([Could not find libbz2 devel files])
+    fi
+    feature_bz2=missing
+  fi
 fi
 
 dnl Check for xz compression
-AC_CHECK_LIB(lzma, lzma_code,
-  [AC_CHECK_HEADERS([lzma.h],
-   [AC_DEFINE([FREECIV_HAVE_LIBLZMA], [1], [liblzma is available])
-UTILITY_LIBS="${UTILITY_LIBS} -llzma"
-libxz_available=true])])
-if test "x$libxz_available" != "xtrue" ; then
-  feature_xz=missing
+AC_ARG_WITH([liblzma],
+  AS_HELP_STRING([--with-liblzma], [support xz compressed files [if 
possible]]),
+[WITH_XZ="${withval}"],
+[WITH_XZ="test"])
+
+if test "x$WITH_XZ" != xno ; then
+  AC_CHECK_LIB([lzma], [lzma_code],
+    [AC_CHECK_HEADERS([lzma.h],
+     [AC_DEFINE([FREECIV_HAVE_LIBLZMA], [1], [liblzma is available])
+  UTILITY_LIBS="${UTILITY_LIBS} -llzma"
+  libxz_available=true])])
+  if test "x$libxz_available" != "xtrue" ; then
+    if test "x$WITH_XZ" = "xyes" ; then
+      AC_MSG_ERROR([Could not find liblzma devel files])
+    fi
+    feature_xz=missing
+  fi
 fi
 
 UTILITY_LIBS="${UTILITY_LIBS} ${LTLIBINTL}"

Modified: branches/S2_6/doc/README.packaging
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/doc/README.packaging?rev=32175&r1=32174&r2=32175&view=diff
==============================================================================
--- branches/S2_6/doc/README.packaging  (original)
+++ branches/S2_6/doc/README.packaging  Fri Mar  4 09:48:39 2016
@@ -48,6 +48,13 @@
   that can take also value --enable-freeciv-manual=html to make
   freeciv-manual that produces manuals with alternative formatting,
   default still being wiki formatting.
+* Added configure options --with[out]-libbz2 and --with[out]-liblzma to
+  explicitly enable or disable support for bz2 or xz compressed files.
+  The default is still to autodetect if the support can be built in.
+  Note that it's usually a bad idea to disable one of these if you
+  have had it previously enabled, as then your new version will be
+  unable to load old savegames created with that compression type in
+  use.
 
 ----------------------------------------------------------------------
 Compatibility of modified versions
@@ -146,9 +153,11 @@
 * zlib (gzip compression) is required to compile freeciv so zlib
   compression support is always present
 * bzip2 compression is built into Freeciv if bzip2 libraries and
-  headers are present at configure time
+  headers are present at configure time. One can override this automatic
+  detection with configure option --with[out]-libbz2.
 * xz compression is built into Freeciv if liblzma library and
-  headers are present at configure time
+  headers are present at configure time. One can override this automatic
+  detection with configure option --with[out]-liblzma.
 
 While this feature is called "Savegame compression support" it actually
 applies to loading of all the section files: savegames, rulesets, tileset


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to