Author: cazfi
Date: Fri Mar  4 09:48:32 2016
New Revision: 32174

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

See patch #7023

Modified:
    trunk/configure.ac
    trunk/doc/README.packaging

Modified: trunk/configure.ac
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/configure.ac?rev=32174&r1=32173&r2=32174&view=diff
==============================================================================
--- trunk/configure.ac  (original)
+++ trunk/configure.ac  Fri Mar  4 09:48:32 2016
@@ -787,23 +787,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: trunk/doc/README.packaging
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/doc/README.packaging?rev=32174&r1=32173&r2=32174&view=diff
==============================================================================
--- trunk/doc/README.packaging  (original)
+++ trunk/doc/README.packaging  Fri Mar  4 09:48:32 2016
@@ -141,9 +141,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