xenstore: Use $(PTHREAD_LDFLAGS) and $(PTHREAD_LIBS) not -lpthread

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
v3: We need PTHREAD_LDFLAGS too (!)
xenstore: In xenstore_client, avoid stack buffer in recursive function

do_ls is recursive.  It had a buffer of size around 5K allocated on
the stack.  This combination is not a very good idea: some
environments (eg, Mini-OS) have limited stack sizes (eg 64K).

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
rump kernels: Start introducing new XEN_OS NetBSDRump

Provide an entry in config/, and a copy of xen-sys privcmd.h.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
libxc: rump kernels: Use standard xc_osdep_get_info

Do not try to support the dlopen-based xc indirection.

Introduce a local #define DO_DYNAMIC_OSDEP to centralise the condition.

Add comments to the #endifs.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <Ian.Campbell@citrix.com>

---
v2: Remove duplication by introducing DO_DYNAMIC_OSDEP.
    Add comments to the #endifs.
xenstore: rump kernels: Look for /dev/xen/xenbus

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xenstore: Make building of xenstored optional

In principle it would be possible to make a rumpuser-xen-based stub
xenstored, but all the necessary pieces do not yet exist.

So provide a facility to disable compilation of xenstored, and use it
to disable it on rump kernels.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
build system: Introduce INSTALL_SHLIB and SYMLINK_SHLIB

INSTALL_SHLIB is like INSTALL_PROG but used only for shared libraries.
SYMLINK_SHLIB is the ln -sf rune for shared library symlinks.

Use these in the appropriate places in tools/libxc and tools/xenstore.

No functional change right now.  In a forthcoming patch these
variables might take on different values.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
build system: Introduce libextension variable

This variable is the suffix to use for finding libraries when doing
compile-time linking.  For now we always set it to ".so" - so no
functional change.

In a forthcoming patch it may take on different values.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
build system: Introduce nosharedlibs variable.

Introduce a new build variable "nosharedlibs".

In tools/libxc use it instead of $(stubdom).
In tools/xenstore honour it, and build static clients.

If shared libs are disabled, do not try to install or symlink them.

Set nosharedlibs when building for MiniOS or NetBSDRump.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <Ian.Campbell@citrix.com>

---
v2: Clarify deliberate INSTALL_SHLIB and SYMLINK_SHLIB breakage.
rump kernels: Handle rumpxen host in configure

Support
   ./configure --host=x86_64-rumpxen-netbsd
   ./configure --host=i386-rumpxen-netbsd

Setting --host tells configure we are cross compiling and therefore
has various automatic effects.

But in this patch we make some deliberate changes as well:
 * We disable a large number of configure tests for libraries
   etc. which don't exist.
 * We set CONFIG_RUMP in Tools.mk.
 * Hence, we automatically set XEN_OS.

(I have only tested the 32-bit build but I think the 64-bit build
should work just as well.)

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <Ian.Campbell@citrix.com>

---
v3: Add comment to `fi'
v2: Mention x86_64.
    Drop an erroneous whitespace change.
tools/Makefile: Build only a subset of things for rump kernels

Override the set of tools/ subdirectories for rump kernel builds.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>