X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=configure.ac;h=af13a959e9dc12a1a9c00381195e58f377f41649;hb=3ccad2a6443fcae0fee2cd94132580d2d06268dd;hp=ac92442228cd06977e89da09517084ebac8a402a;hpb=99340c2ef762f3da92e4bb4ce3b2f6d5fc6ef9d0;p=platform%2Fupstream%2Fbtrfs-progs.git diff --git a/configure.ac b/configure.ac index ac92442..af13a95 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_INIT([btrfs-progs], - m4_esyscmd([./version.sh --configure]), + m4_chomp(m4_include([VERSION])), [linux-btrfs@vger.kernel.org],, [http://btrfs.wiki.kernel.org]) @@ -39,9 +39,12 @@ AC_CHECK_TOOL([AR], [ar]) AC_PATH_PROG([RM], [rm], [rm]) AC_PATH_PROG([RMDIR], [rmdir], [rmdir]) + AC_CHECK_FUNCS([openat], [], [AC_MSG_ERROR([cannot find openat() function])]) +AC_CHECK_FUNCS([reallocarray]) + m4_ifndef([PKG_PROG_PKG_CONFIG], [m4_fatal([Could not locate the pkg-config autoconf macros. These are usually located in /usr/share/aclocal/pkg.m4. @@ -55,8 +58,8 @@ dnl dnl Calls pkg-config --static dnl AC_DEFUN([PKG_STATIC], [ - if AC_RUN_LOG([pkg-config --exists --print-errors "$2"]); then - $1=`pkg-config --libs --static "$2"` + if AC_RUN_LOG([${PKG_CONFIG} --exists --print-errors "$2"]); then + $1=`${PKG_CONFIG} --libs --static "$2"` AC_SUBST([$1]) else AC_MSG_ERROR([pkg-config description of $2, needed for static build, is not available]) @@ -88,13 +91,27 @@ AS_IF([test "x$enable_documentation" = xyes], [DISABLE_DOCUMENTATION=0], [DISABL AC_SUBST([DISABLE_DOCUMENTATION]) dnl detect tools to build documentation +ASCIIDOC_TOOL="none" if test "x$enable_documentation" = xyes; then - AC_PATH_PROG([ASCIIDOC], [asciidoc], [asciidoc]) AC_PATH_PROG([XMLTO], [xmlto], [xmlto]) AC_PATH_PROG([GZIP], [gzip], [gzip]) AC_PATH_PROG([MV], [mv], [mv]) AC_PROG_SED + AC_PATH_PROG([ASCIIDOC], [asciidoc]) + AC_PATH_PROG([ASCIIDOCTOR], [asciidoctor]) + + dnl asciidoc is preferred + if test -n "$ASCIIDOC"; then + ASCIIDOC_TOOL="asciidoc" + else + if test -n "$ASCIIDOCTOR"; then + ASCIIDOC_TOOL="asciidoctor" + else + AC_MSG_ERROR([cannot find asciidoc or asciidoctor, cannot build documentation]) + fi + fi fi +AC_SUBST([ASCIIDOC_TOOL]) AC_ARG_ENABLE([convert], AS_HELP_STRING([--disable-convert], [do not build btrfs-convert]), @@ -148,7 +165,7 @@ AC_SUBST([BTRFSCONVERT_EXT2]) AC_SUBST([BTRFSCONVERT_REISERFS]) # catch typos -tmp=$(echo "$with_convert" | sed -e 's/auto//' | sed -e 's/ext2//' | sed -e 's/reiserfs//' | sed -e 's/,\+/,/') +tmp=$(echo "$with_convert" | sed -e 's/auto//' | sed -e 's/ext2//' | sed -e 's/reiserfs//' | sed -e 's/,\+//') if ! test "x$tmp" = "x"; then AC_MSG_ERROR([unknown tokens for --with-convert: $tmp]) fi @@ -182,12 +199,39 @@ PKG_STATIC(UUID_LIBS_STATIC, [uuid]) PKG_CHECK_MODULES(ZLIB, [zlib]) PKG_STATIC(ZLIB_LIBS_STATIC, [zlib]) +AC_ARG_ENABLE([zstd], + AS_HELP_STRING([--disable-zstd], [build without zstd support]), + [], [enable_zstd=yes] +) + +if test "x$enable_zstd" = xyes; then + PKG_CHECK_MODULES(ZSTD, [libzstd >= 1.0.0]) + PKG_STATIC(ZSTD_LIBS_STATIC, [libzstd]) +fi + +AS_IF([test "x$enable_zstd" = xyes], [BTRFSRESTORE_ZSTD=1], [BTRFSRESTORE_ZSTD=0]) +AC_SUBST(BTRFSRESTORE_ZSTD) + +AC_ARG_ENABLE([python], + AS_HELP_STRING([--disable-python], [do not build libbtrfsutil Python bindings]), + [], [enable_python=yes] +) + +if test "x$enable_python" = xyes; then + AM_PATH_PYTHON([3.4]) + PKG_CHECK_MODULES(PYTHON, [python-${PYTHON_VERSION}]) +fi + +AS_IF([test "x$enable_python" = xyes], [PYTHON_BINDINGS=1], [PYTHON_BINDINGS=0]) +AC_SUBST(PYTHON_BINDINGS) +AC_SUBST(PYTHON) + # udev v190 introduced the btrfs builtin and a udev rule to use it. # Our udev rule gives us the friendly dm names but isn't required (or valid) # on earlier releases. UDEVDIR= -if pkg-config udev --atleast-version 190; then - UDEVDIR="$(pkg-config udev --variable=udevdir)" +if ${PKG_CONFIG} udev --atleast-version 190; then + UDEVDIR="$(${PKG_CONFIG} udev --variable=udevdir)" fi AC_SUBST(UDEVDIR) @@ -221,21 +265,24 @@ AC_OUTPUT AC_MSG_RESULT([ ${PACKAGE_NAME} ${PACKAGE_VERSION} - prefix: ${prefix} - exec prefix: ${exec_prefix} + prefix: ${prefix} + exec prefix: ${exec_prefix} - bindir: ${bindir} - libdir: ${libdir} - includedir: ${includedir} + bindir: ${bindir} + libdir: ${libdir} + includedir: ${includedir} - compiler: ${CC} - cflags: ${CFLAGS} - ldflags: ${LDFLAGS} + compiler: ${CC} + cflags: ${CFLAGS} + ldflags: ${LDFLAGS} - documentation: ${enable_documentation} - backtrace support: ${enable_backtrace} - btrfs-convert: ${enable_convert} ${convertfs:+($convertfs)} + documentation: ${enable_documentation} + doc generator: ${ASCIIDOC_TOOL} + backtrace support: ${enable_backtrace} + btrfs-convert: ${enable_convert} ${convertfs:+($convertfs)} + btrfs-restore zstd: ${enable_zstd} + Python bindings: ${enable_python} + Python interpreter: ${PYTHON} Type 'make' to compile. ]) -