From b8e381131ca1a5b38b660be48adf0bef0228c6da Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Wed, 2 Nov 2005 13:19:10 +0000 Subject: [PATCH] * AUTHORS NEWS README autogen.sh configure.in: allow autogen.sh and configure to start working * src/Makefile.am src/internal.h src/libxen.c: make the first compile Daniel --- AUTHORS | 1 + ChangeLog | 6 +++++ NEWS | 2 ++ README | 7 ++++++ autogen.sh | 64 +++++++++++++++++++++++++++++++++++++++++++++++++ configure.in | 20 +++++++++++++++- src/Makefile.am | 2 +- src/internal.h | 27 +++++++++++++++++++++ src/libxen.c | 8 ++++--- 9 files changed, 132 insertions(+), 5 deletions(-) create mode 100644 AUTHORS create mode 100644 NEWS create mode 100644 README create mode 100755 autogen.sh create mode 100644 src/internal.h diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000000..410def36a4 --- /dev/null +++ b/AUTHORS @@ -0,0 +1 @@ +Daniel Veillard or diff --git a/ChangeLog b/ChangeLog index 3d4bf1d586..0a1f7f1045 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Wed Nov 2 14:17:50 CET 2005 Daniel Veillard + + * AUTHORS NEWS README autogen.sh configure.in: allow autogen.sh and + configure to start working + * src/Makefile.am src/internal.h src/libxen.c: make the first compile + Wed Nov 2 13:44:47 CET 2005 Daniel Veillard * src/libxen.c src/Makefile.am include/libxen.h configure.in diff --git a/NEWS b/NEWS new file mode 100644 index 0000000000..656ec62c28 --- /dev/null +++ b/NEWS @@ -0,0 +1,2 @@ +Wed Nov 2 2005 + - the very first work was checked in a CVS on veillard.com diff --git a/README b/README new file mode 100644 index 0000000000..94c569fda3 --- /dev/null +++ b/README @@ -0,0 +1,7 @@ + + LibXen : simple library to use the Xen hypervisor + + As of Wed Nov 2 2005, this is a completely new project, it is not +usable in any way yet. + +Daniel Veillard diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000000..60e36c64fe --- /dev/null +++ b/autogen.sh @@ -0,0 +1,64 @@ +#!/bin/sh +# Run this to generate all the initial makefiles, etc. + +srcdir=`dirname $0` +test -z "$srcdir" && srcdir=. + +THEDIR=`pwd` +cd $srcdir +DIE=0 + +(autoconf --version) < /dev/null > /dev/null 2>&1 || { + echo + echo "You must have autoconf installed to compile libxen." + echo "Download the appropriate package for your distribution," + echo "or see http://www.gnu.org/software/autoconf" + DIE=1 +} + +(libtool --version) < /dev/null > /dev/null 2>&1 || { + echo + echo "You must have libtool installed to compile libxen." + echo "Download the appropriate package for your distribution," + echo "or see http://www.gnu.org/software/libtool" + DIE=1 +} + +(automake --version) < /dev/null > /dev/null 2>&1 || { + echo + DIE=1 + echo "You must have automake installed to compile libxen." + echo "Download the appropriate package for your distribution," + echo "or see http://www.gnu.org/software/automake" +} + +if test "$DIE" -eq 1; then + exit 1 +fi + +test -f src/libxen.c || { + echo "You must run this script in the top-level libxen directory" + exit 1 +} + +if test -z "$*"; then + echo "I am going to run ./configure with no arguments - if you wish " + echo "to pass any to it, please specify them on the $0 command line." +fi + +libtoolize --copy --force +aclocal $ACLOCAL_FLAGS +automake --add-missing +autoconf + +cd $THEDIR + +if test x$OBJ_DIR != x; then + mkdir -p "$OBJ_DIR" + cd "$OBJ_DIR" +fi + +$srcdir/configure "$@" + +echo +echo "Now type 'make' to compile libxen." diff --git a/configure.in b/configure.in index 5b5c9c92b1..6178060ec7 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT(entities.c) +AC_INIT(src/libxen.c) AM_CONFIG_HEADER(config.h) AC_CANONICAL_HOST @@ -33,3 +33,21 @@ VERSION=${LIBXEN_VERSION} AM_INIT_AUTOMAKE(libxen, $VERSION) +dnl Checks for programs. +AC_PROG_CC +AC_PROG_INSTALL +AC_PROG_CPP +AC_PATH_PROG(RM, rm, /bin/rm) +AC_PATH_PROG(MV, mv, /bin/mv) +AC_PATH_PROG(TAR, tar, /bin/tar) + +dnl Make sure we have an ANSI compiler +AM_C_PROTOTYPES +test "x$U" != "x" && AC_MSG_ERROR(Compiler not ANSI compliant) + +AM_PROG_LIBTOOL + +dnl search for the low level Xen library +AC_SEARCH_LIBS(xc_domain_create, [xenctrl]) + +AC_OUTPUT(Makefile src/Makefile) diff --git a/src/Makefile.am b/src/Makefile.am index c848c79d0f..14b7902cd7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -4,5 +4,5 @@ INCLUDES = -I$(top_builddir)/include -I@srcdir@/include lib_LTLIBRARIES = libxen.la libxen_la_LIBADD = -libxen_la_LDFLAGS = -version-info @LIBXML_VERSION_INFO@ +libxen_la_LDFLAGS = -version-info @LIBXEN_VERSION_INFO@ libxen_la_SOURCES = libxen.c diff --git a/src/internal.h b/src/internal.h new file mode 100644 index 0000000000..ca13e360cc --- /dev/null +++ b/src/internal.h @@ -0,0 +1,27 @@ +/* + * internal.h: internal definitions just used by code from the library + */ + +#ifndef __XEN_INTERNAL_H__ +#define __XEN_INTERNAL_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __GNUC__ +#ifdef HAVE_ANSIDECL_H +#include +#endif +#ifndef ATTRIBUTE_UNUSED +#define ATTRIBUTE_UNUSED __attribute__((unused)) +#endif +#else +#define ATTRIBUTE_UNUSED +#endif + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __XEN_INTERNAL_H__ */ diff --git a/src/libxen.c b/src/libxen.c index e7d56088b9..941fbbde02 100644 --- a/src/libxen.c +++ b/src/libxen.c @@ -11,7 +11,8 @@ #include "libxen.h" -#include "memory.h" +#include + #include "internal.h" /* @@ -29,7 +30,7 @@ struct _xenConnect { unsigned int magic; /* specific value to check */ int handle; /* internal handle used for hypercall */ -} +}; /** * xenGetConnect: @@ -41,7 +42,7 @@ struct _xenConnect { * Returns a pointer to the hypervisor connection or NULL in case of error */ xenConnectPtr -xenOpenConnect(const char *name ATTRIBUTE_UNUSED) { +xenOpenConnect(const char *name) { return(NULL); } @@ -74,3 +75,4 @@ xenCloseConnect(xenConnectPtr conn) { * @conn: pointer to the hypervisor connection * * Get the version level of the Hypervisor running + */