diff options
-rw-r--r-- | Makefile.in | 3 | ||||
-rwxr-xr-x | configure | 51 | ||||
-rwxr-xr-x | makewrappers | 8 | ||||
-rwxr-xr-x | ports/linux/subports | 3 |
4 files changed, 55 insertions, 10 deletions
diff --git a/Makefile.in b/Makefile.in index a1bfe62..6aa4659 100644 --- a/Makefile.in +++ b/Makefile.in @@ -25,6 +25,7 @@ SQLITE=@SQLITE@ SQLITE_LIB=@SQLITE_LIB@ SQLITE_MEMORY=@SQLITE_MEMORY@ FORCE_ASYNC=@FORCE_ASYNC@ +XATTR=@XATTR@ PASSWD_FALLBACK=@PASSWD_FALLBACK@ BITS=@BITS@ ARCH_FLAGS=@ARCH_FLAGS@ @@ -133,7 +134,7 @@ tables: enums/*.in maketables templatefile.py $(TABLES) ./maketables enums/*.in wrappers: makewrappers templatefile.py $(TEMPLATES) ports/*/wrapfuncs.in - ./makewrappers + ./makewrappers "xattr=$(XATTR)" .SECONDARY: tables wrappers @@ -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 diff --git a/makewrappers b/makewrappers index 992737b..f487887 100755 --- a/makewrappers +++ b/makewrappers @@ -562,11 +562,15 @@ def process_wrapfuncs(port): print "" return funcs -def main(): +def main(argv): """Read in function definitions, write out files based on templates.""" funcs = [] sources = [] + for arg in argv: + name, value = arg.split('=') + os.environ["port_" + name] = value + # error checking helpfully provided by the exception handler copyright_file = open('guts/COPYRIGHT') TemplateFile.copyright = copyright_file.read() @@ -609,4 +613,4 @@ def main(): source.close() if __name__ == '__main__': - main() + main(sys.argv[1:]) diff --git a/ports/linux/subports b/ports/linux/subports index b68c25b..94d43e7 100755 --- a/ports/linux/subports +++ b/ports/linux/subports @@ -25,7 +25,8 @@ rm -f dummy.c dummy.o if ! $found; then echo >&2 "Can't tell, omitting clone(2) support." fi -if getfattr --help >/dev/null 2>&1; then + +if $port_xattr; then echo "linux/xattr" else echo "linux/noxattr" |