aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Seebach <peter.seebach@windriver.com>2014-04-24 17:25:50 -0500
committerPeter Seebach <peter.seebach@windriver.com>2014-04-24 17:25:50 -0500
commit6c6d0a3e4a4d382fd0b2e056a3ecffb015652767 (patch)
tree18e95f18622f8b4aee80f5285469c12956921729
parent9485ba46bd622e328fe3557f94c38b77109e54fa (diff)
downloadpseudo-6c6d0a3e4a4d382fd0b2e056a3ecffb015652767.tar.gz
pseudo-6c6d0a3e4a4d382fd0b2e056a3ecffb015652767.tar.bz2
pseudo-6c6d0a3e4a4d382fd0b2e056a3ecffb015652767.zip
Make configure handle xattr guessing (or specifying)
Clean-up: Allow specification of environment hints for subports scripts, such as whether xattr support is available. Also make configure guess at a bit width if none is specified. Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
-rw-r--r--Makefile.in3
-rwxr-xr-xconfigure51
-rwxr-xr-xmakewrappers8
-rwxr-xr-xports/linux/subports3
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
diff --git a/configure b/configure
index 592e20b..88fbf8b 100755
--- a/configure
+++ b/configure
@@ -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"