From 31b1f56902f2041dfb25f86bfce66733715a789a Mon Sep 17 00:00:00 2001 From: Moinak Ghosh Date: Tue, 14 Jan 2014 21:59:32 +0530 Subject: [PATCH] Fix issue #14 Updated fix for issue #12 Add check for correct Libarchive version. Update header checks to abort if not found. --- INSTALL | 2 +- config | 34 ++++++++++++++++++++++++++++++++-- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/INSTALL b/INSTALL index a27faa7..78d7612 100644 --- a/INSTALL +++ b/INSTALL @@ -8,7 +8,7 @@ GCC 4.4 (with mpfr, ppl and cloog support packages for loop libz (zlib) and development packages. Libbz2 and development packages. OpenSSL version 0.9.8 or greater. -Libarchive and its development packages. +Libarchive 3.x or greater and its development packages. Basic Installation ================== diff --git a/config b/config index 9e58216..bb284bb 100755 --- a/config +++ b/config @@ -437,7 +437,7 @@ do "${pref}/local/lib64" "${pref}/usr/local/lib64" "${pref}/local/lib" "${pref}/usr/local/lib" \ "${pref}/local/lib/x86_64-linux-gnu" "${pref}/usr/local/lib/x86_64-linux-gnu" \ "${use_prefix}/lib64" "${use_prefix}/lib" "${use_prefix}/lib/x86_64-linux-gnu" \ - "${use_prefix}/usr/lib/x86_64-linux-gnu" + "${use_prefix}/usr/lib/x86_64-linux-gnu" "${use_prefix}/.libs" "${use_prefix}" do if [ -d ${lib} ] then @@ -515,21 +515,51 @@ do then use_prefix="$prefix" fi + found=0 for inc in "${pref}/include" "${pref}/usr/include" \ "${pref}/local/include" "${pref}/usr/local/include" \ - "${use_prefix}/include" "${use_prefix}/usr/include" + "${use_prefix}/include" "${use_prefix}/usr/include" \ + "${use_prefix}/libarchive" "${use_prefix}" do if [ -d ${inc} ] then if [ -f "${inc}/${hdrf}" ] then eval "${var}=\"-I${inc}\"" + found=1 break fi fi done + if [ $found -ne 1 ] + then + echo "Cannot find header $hdrf" + exit 1 + fi done +echo "Checking for Libarchive version ..." +cat << _EOF > tst.c +#include +#include + +int +main(void) +{ + int flags = ARCHIVE_READDISK_NO_TRAVERSE_MOUNTS; + + return (0); +} +_EOF + +gcc ${extra_opt_flags} ${libarchive_inc} -L${libarchive_libdir} -O0 -g tst.c -o tst -larchive >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo "Libarchive version 3.0 or newer is required." + exit 1 +fi +rm -f tst tst.c + echo "Generating Makefile ..." linkvar="LINK" compilevar="COMPILE"