File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -247,7 +247,29 @@ AC_ARG_WITH([bz2lib],
247
247
248
248
if test "x$with_bz2lib" != "xno"; then
249
249
AC_CHECK_HEADERS ( [ bzlib.h] )
250
- AC_CHECK_LIB ( bz2 ,BZ2_bzDecompressInit )
250
+ case "$host_os" in
251
+ *mingw* | *cygwin*)
252
+ dnl AC_CHECK_LIB cannot be used on the Windows port of libbz2, therefore
253
+ dnl use AC_LINK_IFELSE.
254
+ AC_MSG_CHECKING ( [ for BZ2_bzDecompressInit in -lbz2] )
255
+ old_LIBS="$LIBS"
256
+ LIBS="-lbz2 $LIBS"
257
+ AC_LINK_IFELSE (
258
+ [ AC_LANG_SOURCE ( # include <bzlib.h>
259
+ int main ( ) { return BZ2_bzDecompressInit ( NULL , 0 , 0 ) ; } ) ] ,
260
+ [ ac_cv_lib_bz2_BZ2_bzDecompressInit=yes] ,
261
+ [ ac_cv_lib_bz2_BZ2_bzDecompressInit=no] )
262
+ LIBS="$old_LIBS"
263
+ AC_MSG_RESULT ( $ac_cv_lib_bz2_BZ2_bzDecompressInit )
264
+ if test "x$ac_cv_lib_bz2_BZ2_bzDecompressInit" = xyes; then
265
+ AC_DEFINE ( [ HAVE_LIBBZ2] , [ 1] , [ Define to 1 if you have the `bz2' library (-lbz2).] )
266
+ LIBS="-lbz2 $LIBS"
267
+ fi
268
+ ;;
269
+ *)
270
+ AC_CHECK_LIB ( bz2 ,BZ2_bzDecompressInit )
271
+ ;;
272
+ esac
251
273
fi
252
274
253
275
AC_ARG_WITH ( [ lzmadec] ,
You can’t perform that action at this time.
0 commit comments