diff options
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 51 |
1 files changed, 45 insertions, 6 deletions
@@ -27,6 +27,7 @@ opt_sqlite=/usr opt_rpath= opt_memory= opt_async= +opt_xattr= opt_passwd_fallback='""' compile_x86_32=-m32 @@ -39,6 +40,7 @@ usage() echo >&2 " [--libdir=...]" echo >&2 " [--suffix=...]" echo >&2 " [--enable-memory-db]" + echo >&2 " [--enable-xattr]" echo >&2 " [--enable-force-async]" echo >&2 " [--with-sqlite=...]" echo >&2 " [--with-sqlite-lib=...]" @@ -59,6 +61,11 @@ use_maybe_rpath=true for arg do case $arg in + --disable-*) + arg="--enable-${arg%--disable-}=no" + ;; + esac + case $arg in --) shift; break ;; --prefix=*) opt_prefix=${arg#--prefix=} @@ -89,6 +96,12 @@ do --enable-force-async=yes | --enable-force-async) opt_async=true ;; + --enable-xattr=no) + opt_xattr=false + ;; + --enable-xattr=yes | --enable-xattr) + opt_xattr=true + ;; --enable-memory-db=no) opt_memory=false ;; @@ -126,12 +139,6 @@ do ;; --bits=*) opt_bits=${arg#--bits=} - case $opt_bits in - 64) opt_mark64=64;; - 32) opt_mark64=;; - *) echo >&2 "Unknown bit size $opt_bits (only 32 and 64 known)." - ;; - esac ;; *) echo >&2 "warning: Unrecognized option '$arg'" @@ -146,6 +153,27 @@ case $opt_arch in ;; esac +if [ -z "$opt_bits" ]; then + printf >&2 "Bit width unspecified;" + case $(file -L /bin/sh 2>/dev/null) in + *64-bit*) opt_bits=64;; + *32-bit*) opt_bits=32;; + esac + if [ -n "$opt_bits" ]; then + echo >&2 " guessing bit width is $opt_bits, based on /bin/sh." + else + echo >&2 " can't tell, assuming 32." + opt_bits=32 + fi +fi + +case $opt_bits in +64) opt_mark64=64;; +32) opt_mark64=;; +*) echo >&2 "Unknown bit size $opt_bits (only 32 and 64 known)." + ;; +esac + if [ "${opt_cflags-UNSET}" = "UNSET" ]; then # Some targets want something like -m64. eval arch_flags=\$compile_${opt_arch}_${opt_bits} @@ -206,6 +234,16 @@ else FORCE_ASYNC="" fi +if [ -z "$opt_xattr" ]; then + if getfattr --help >/dev/null 2>&1; then + opt_xattr=true + echo "getfattr runs, enabling extended attribute support" + else + opt_xattr=false + echo "getfattr fails, disabling extended attribute support" + fi +fi + if [ -z "$opt_memory" ]; then if [ "${SQLITE3_VERSION}" -lt "03007000" ]; then echo "Disabling in-memory database by default (sqlite too old)." @@ -234,6 +272,7 @@ touch func_deps.mk sed -e ' s,@PREFIX@,'"$opt_prefix"',g + s,@XATTR@,'"$opt_xattr"',g s,@LIBDIR@,'"$opt_libdir"',g s,@LIB@,'"$opt_lib"',g s,@SUFFIX@,'"$opt_suffix"',g |