Commit Graph
43 Commits
Author SHA1 Message Date
Keir Fraser 547cb1849c build: Make XEN_ROOT an absolute path.
Otherwise make can search the path relative to certain standard paths
such as /usr/include (e.g., the line '-include $(XEN_ROOT)/.config' in
Config.mk suffers from this).

Signed-off-by: Keir Fraser <keir@xen.org>
2011-03-17 10:36:25 +00:00
Gianni Tedesco 6d4ba52d49 libxl, tools/python: Add libxl python binding
Introduce python binding for libxl. The binding is not yet complete but
serveral methods are implemented and tested. Those which are implemented
provide examples of the two or three basic patterns that most future
methods should follow.

Over 5,000 lines of boilerplate is automatically generated to wrap and
export all relevant libxl structure definitions. There are a few places
where such code cannot be fully auto-generated and special hooks are
declared and stubbed where, for example, conversion between
libxl_file_reference and a python file object is required.

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-09-16 17:20:22 +01:00
Keir Fraser 79e0b9479d python: Don't install anything directly under /usr/share
Signed-off-by: Guillaume Rousse <Guillaume.Rousse@inria.fr>
2010-02-22 18:47:22 +00:00
Keir Fraser a2b4af7d77 Get rid of hardcoded pathes for stubdom and hotplug scripts
- Have the buid system generate a file which exports the install paths
   for the hotplug scripts and stubdom / stubdom-dm
- Move file generation code from tools/python/Makefile into a gmake
   macro
  in Config.mk to avoid maintenance of three duplicates each with its
   own
  tweaks and bugs
- Export gmake variables into ioemu as shell variables
  for upcoming ioemu patches
- Do above as a gmake macro to avoid maintenance of several duplicates
- Adjust hotplug scripts to find the right xen binaries from the
  install directory
- Adjust stubdom-dm to use the install directories

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-06-23 17:25:51 +01:00
Keir Fraser dcf18dfcc4 tools: don't require hardcoded firmware path in guest config file
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-06-23 11:23:27 +01:00
Keir Fraser 717626c9a5 tools: consistently use $(PYTHON)
Signed-off-by: Christoph Egger <Christoph. Egger@amd.com>
2009-06-23 11:13:29 +01:00
Keir Fraser 823f4b145f xm: xen-api: Install create.dtd in SHAREDIR
* Install create.dtd in SHAREDIR
* Use SHAREDIR/create.dtd
* import os.path.join into xenapi_create.py,
  it already seems to be used many times

Resolves the following error when using XenAPI:

$ xm create hvm.conf
Couldn't open resource '/usr/share/xen/create.dtd' at
/usr/share/xen/create.dtd:1:0

Signed-off-by: Simon Horman <horms@verge.net.au>
2009-06-04 10:38:13 +01:00
Keir Fraser 9f6d07bac9 tools: get rid of hardcoded config dirs
Remove *all* hardcoded "/etc/xen" strings in python code.

Additionally, it removes pygrub_path from osdep.py. Its use has been
replaced with auxbin.pathTo("pygrub").

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-05-20 15:27:30 +01:00
Keir Fraser 1f876c2e6e tools: Fix an obvious xgettext build typo.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-05-19 13:38:05 +01:00
Keir Fraser 9125594e4e python: get rid of hardcoded search pathes in python code.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-05-19 02:16:37 +01:00
Keir Fraser 727a00e80e Permit user to suppress passing --prefix to setup.py
We change all invocations of setup.py as follows:

* use $(PYTHON) instead of `python' so that the user can specify
  an alternative python version if they need to.  If not set it
  defaults to `python' in Config.mk.

* pass --prefix=$(PREFIX) via a new make variable
  $(PYTHON_PREFIX_ARG).  This allows a user to suppress the
  --prefix=... argument entirely by setting PYTHON_PREFIX_ARG=''.
  This will work around the bug described here
     https://bugs.launchpad.net/ubuntu/+bug/362570
  where passing --prefix=/usr/local (which ought to have no effect as
  /usr/local is the default prefix) changes which subdirectory
  distutils chooses, and results in the files being installed in
  site-packages which is not on the default search path.

  Users not affected by this python packaging bug should not set
  PYTHON_PREFIX_ARG and their builds will not be affected.  (Provided
  PREFIX did not contain spaces.  People who put spaces in PREFIX are
  being quite optimistic.)

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2009-05-07 19:32:10 +01:00
Keir Fraser 11e1149fe0 tools: Always use sane upstream (`native') python paths
Previously, by default we would install our python modules into
/usr/lib/python/xen, for example /usr/lib/python/xen/__init__.py.
Upstream python's standard install location (a) includes the Python
version number and (b) puts things in site-packages by default.

Our best conjecture for the reason for this was an attempt to make the
installs portable between different python versions.  However, that
doesn't work because compiled python modules (.pyc), and C python
extensions corresponding to one version of python, are not compatible
across different versions of python.

This is why upstream include the version number.

site-packages is the standard location for locally-installed packages
and is automatically included on the python search path.

In this change, we abandon our own unusual python path setup:

 * Invoke setup.py in an entirely standard manner.  We pass
   PREFIX and DESTDIR using the appropriate options provided by
   setup.py for those purposes (adding them to setup.py calls
   which were previously lacking them).

 * Since the installation locations are now on the standard
   python path, we no longer need to add anything to the path
   in any of our python utilities.  Therefore remove all that
   code from every python script.  (Many of these scripts
   unconditionally added /usr/lib/python and /usr/lib64/python which
   is wrong even in the old world.)

 * There is no longer any special `Xen python path'.  xen-python-path
   is no longer needed.  It is no longer called by anything in our
   tree.  However since out-of-tree callers may still invoke it, we
   retain it.  It now prints a fixed string referring to a directory
   which does not to exist; callers (who use it to augment their
   python path) will thus add a nonexistent directory to their python
   path which is harmless.

 * Remove various workarounds including use of setup.py --home
   (which is intended for something completely different).

 * Remove tests for the XEN_PYTHON_NATIVE_INSTALL build-time
   environment variable.  The new behaviour is the behaviour which we
   should have had if this variable had been set.  That is, it is now
   as if this variable was always set but also bugs in the resulting
   install have been fixed.

This should be a proper fix for the bug addressed by c/s 19515.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2009-04-08 19:13:04 +01:00
Keir Fraser ca01c742be tools: fix python installation
attached patch lets python install the modules into
DESTDIR/PREFIX as before, but lets python search
the modules in PREFIX rather DESTDIR/PREFIX.

This prevents failures about not finding python modules
after files have been installed into PREFIX.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-04-07 14:37:35 +01:00
Keir Fraser 98da66a3bd build: Get rid of some more hardcoded install paths
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-03-31 13:30:50 +01:00
Keir Fraser 9f8501582f Use -MMD -MF in tools/* rather than -Wp,-M...
If you use -MMD -MF then the correct .o filename is written to the
.*.d file as the compiler driver arranges everything.  This was done
in 19010:275abe1c5d24 for the hypervisor.

In this patch we do the same elsewhere in the xen-unstable tree,
particularly tools/.  Specifically:
 * Change tools/Rules.mk to add -MMD -MF ... to CFLAGS and set DEPS.
 * Remove -Wp,-MD... from every other Makefile
 * Remove setting of DEPS from every other Makefile
 * Ensure that every Makefile says -include $(DEPS)
 * Ensure that every Makefile's clean target removes $(DEPS)

Some Makefiles were already halfway there, but often for a different
variable name eg PROG_DEP.  The variable name is now standardised in
Rules.mk as DEPS.

I have done a test build with this change, on Debian etch.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2009-01-12 10:16:05 +00:00
Keir Fraser 06cfe5df7b xsm, python tools: remove autogenerated xsm.py
- The patch does away with the autogenerated xsm.py file and
introduces a config parameter in xend-config.sxp to determine the
security module. The parameter is (xsm_module_name {acm, dummy,
flask}).  The default setting/option is dummy.  .hgignore is also
updated to stop ignoring xsm.py on commits.

- The patch has created an xsconstant for XS_POLICY_FLASK and updated
  the toolchain to check the instance of XS_POLICY_USE.  XS_POLICY_USE
  evalauates to XS_POLICY_FLASK or XS_POLICY_ACM or XS_POLICY_DUMMY
  depending on configuration.

- Flask relies on the current value of ssidref returned by dominfo to
  ensure that the label to sid mapping is consistent.  ssidref had
  been pop'ed from the dominfo object.  The patch addresses this
  issue.

- Flask python module style cleanups.

Signed-off-by: George Coker <gscoker@alpha.ncsc.mil>
2008-09-04 11:23:08 +01:00
Keir Fraser 53f48ca221 Fix some build system error handling.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2007-12-20 13:16:21 +00:00
Keir Fraser 891143e321 tools: Some fixes for 'make clean'.
Signed-off-by: Kurt Hackel <kurt.hackel@oracle.com>
2007-12-14 10:16:52 +00:00
kfraser@localhost.localdomain e6f4576ed5 Fix handling of auto-generated file xsm.py.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-08-31 12:12:27 +01:00
kfraser@localhost.localdomain d89af62954 Xen Security Modules: Tools.
Signed-off-by: George Coker <gscoker@alpha.ncsc.mil>
2007-08-31 11:37:20 +01:00
kfraser@localhost.localdomain a247b8c7db tools: Use INSTALL_{DIR,DATA} to install stuff.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-04-17 12:21:33 +01:00
James Bulpin bd9d988e80 Fix tools build
Signed-off-by: James Bulpin <james@xensource.com>
2007-04-17 12:01:00 +01:00
Tom Wilkie 1d4f277da8 Install dtd into correct place
signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
2007-04-13 16:54:03 +01:00
Tom Wilkie 7771ae57e8 Fix up locale strings for xm
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2007-04-13 16:46:41 +01:00
Christian Limpach 98b8fba136 [tools] Use auxbin.py to determine libpath at build time.
Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
2007-03-05 16:43:12 +00:00
kfraser@localhost.localdomain efa2dca17a Fix failure to localise xm by preventing cd from writing to stdout
which gets incorrectly captured as a value for the bash for loop.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-01-22 17:07:16 +00:00
kaf24@localhost.localdomain e7a7e19187 Explicitly use GNU msgfmt on non-GNU systems.
Signed-off-by: John Levon <john.levon@sun.com>
2006-12-29 16:23:11 +00:00
Ewan Mellor 84172b6306 Don't try to copy the .mo files if they haven't been built.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-12-23 21:32:05 +00:00
Ewan Mellor 42a0276111 Only build the message database if msgfmt is installed.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-12-23 19:06:31 +00:00
Ewan Mellor 8ecdc794ab Added I18N support for Xen-API error codes.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-12-23 11:24:10 +00:00
kfraser@localhost.localdomain 2b30fc3c70 [SOLARIS] More tools fixes.
Many of the tools use C99 features such as bool, or expect certain functions.
Fix the CFLAGS to enable these on Solaris.

Also make sure the correct $CC is passed to Python.

Signed-off-by: John Levon <john.levon@sun.com>
2006-10-18 18:13:57 +01:00
kaf24@firebug.cl.cam.ac.uk f9afb49240 Fix python installation on sles10. Install prefix is being
passed along for some reason, so we explicitly redefine it
to nothing.

Signed-off-by: Ryan Grimm <grimm@us.ibm.com>
2006-04-21 09:14:07 +01:00
kaf24@firebug.cl.cam.ac.uk b5fa90ac8e build: Clean up use of .PHONY
* Move .PHONY directives next to targets,
  this makes them a lot harder to miss
* Add missing .PHONY directives
* Remove nonexistent .PHONY directives
* Hopefully I didn'T miss anything...

Signed-Off-By: Horms <horms@verge.net.au>
2006-04-10 17:02:49 +01:00
kaf24@firebug.cl.cam.ac.uk a5414d898b Ensure old Python files are overwritten during tools install.
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
2006-03-08 11:18:39 +01:00
emellor@ewan 0c6f366280 Added Zope's test.py, and a unit test to sxp. This test itself isn't very
exciting, but it's there to encourage the creation of more interesting ones.  A
test target has been added to the main Makefile, and the one in tools/python.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-06 15:12:31 +01:00
ewan@linford.intra e4eb0b4cde Added .PHONY target so that make works from the tools/python directory (it was seeing the build directory and therefore doing nothing). 2005-09-13 14:43:18 +01:00
kaf24@viper.(none) 322cee6129 bitkeeper revision 1.1159.270.4 (42330defA42oRGAfkwmQERgN45uyOg)
Python packages can be installed to the Python installation's 'native'
location, instead of generic /usr/lib/python, by specifying
XEN_PYTHON_NATIVE_INSTALL in the environment or on the make command line.
Signed-off-by: Keir Fraser <keir@xensource.com>
2005-03-12 15:42:39 +00:00
doogie@brainfood.com[kaf24] be7913c187 bitkeeper revision 1.1159.270.3 (42330ae8efsd9SdlhNX6EpksrtV6oQ)
[PATCH] add-build.patch

 Add build targets to all makefiles.  Debian does builds as non-root, so
 it's better to do as much as possible before requiring root privs.
Signed-off-by: Adam Heath <doogie@brainfood.com>
2005-03-12 15:29:44 +00:00
kaf24@scramble.cl.cam.ac.uk 2f34aafbb6 bitkeeper revision 1.1159.223.44 (41f8c832pMZZ7WmykH_gAUBQHtPF1A)
Allow target architecture to be specified by specifying ARCH variable to
root Makefile (e.g, make ARCH=x86_32).
2005-01-27 10:53:38 +00:00
kaf24@scramble.cl.cam.ac.uk 3279b48916 bitkeeper revision 1.1159.223.40 (41f676cbajLGqFeWFqajtJ3X4OkgoA)
Build system fixes.
Signed-off-by: keir.fraser@cl.cam.ac.uk
2005-01-25 16:41:47 +00:00
iap10@labyrinth.cl.cam.ac.uk d2f5d53621 bitkeeper revision 1.1159.223.26 (41f2cdb6LNpheOtPoAKEUn-czlZFig)
Description: use DESTDIR correctly
Standard makefiles always attempt to install to the root(/).  Setting
DESTDIR is the normal way to install to an alternative location.
Setting prefix has the possibility of breaking programs, as the prefix
may have been embedded inside a compiled binary.

From: Adam Heath <doogie@brainfood.com>
Signed-off-by: ian.pratt@cl.cam.ac.uk
2005-01-22 22:03:34 +00:00
kaf24@scramble.cl.cam.ac.uk cf36fcf0e3 bitkeeper revision 1.1159.170.89 (41e4ef8aHmcX3lP2zVDZBpN59cSX6A)
Python packages always install to ${prefix}/us/lib/python/xen/...
2005-01-12 09:36:10 +00:00
mjw@wray-m-3.hpl.hp.com 48e9a9c636 bitkeeper revision 1.1026.1.8 (40e1b09foCFBM0EuIgrSA1uLJrWuzA)
Restructuring the python code and libs - first stage.
2004-06-29 18:10:39 +00:00