[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [VTPM v6 6/8] Add autoconf to stubdom



Please rerun autoconf after commiting this patch

Signed-off-by: Matthew Fioravante <matthew.fioravante@xxxxxxxxxx>
---
 autogen.sh                             |    2 ++
 config/Stubdom.mk.in                   |   44 ++++++++++++++++++++++++
 {tools/m4 => m4}/curses.m4             |    0
 {tools/m4 => m4}/extfs.m4              |    0
 {tools/m4 => m4}/features.m4           |    0
 {tools/m4 => m4}/fetcher.m4            |    0
 {tools/m4 => m4}/ocaml.m4              |    0
 m4/path_or_fail.m4                     |   13 ++++++++
 {tools/m4 => m4}/pkg.m4                |    0
 {tools/m4 => m4}/pthread.m4            |    0
 {tools/m4 => m4}/ptyfuncs.m4           |    0
 {tools/m4 => m4}/python_devel.m4       |    0
 {tools/m4 => m4}/python_version.m4     |    0
 {tools/m4 => m4}/savevar.m4            |    0
 {tools/m4 => m4}/set_cflags_ldflags.m4 |    0
 m4/stubdom.m4                          |   57 ++++++++++++++++++++++++++++++++
 {tools/m4 => m4}/uuid.m4               |    0
 stubdom/Makefile                       |   53 ++++++-----------------------
 stubdom/configure.ac                   |   53 +++++++++++++++++++++++++++++
 tools/configure.ac                     |   28 ++++++++--------
 tools/m4/path_or_fail.m4               |    6 ----
 21 files changed, 194 insertions(+), 62 deletions(-)
 create mode 100644 config/Stubdom.mk.in
 rename {tools/m4 => m4}/curses.m4 (100%)
 rename {tools/m4 => m4}/extfs.m4 (100%)
 rename {tools/m4 => m4}/features.m4 (100%)
 rename {tools/m4 => m4}/fetcher.m4 (100%)
 rename {tools/m4 => m4}/ocaml.m4 (100%)
 create mode 100644 m4/path_or_fail.m4
 rename {tools/m4 => m4}/pkg.m4 (100%)
 rename {tools/m4 => m4}/pthread.m4 (100%)
 rename {tools/m4 => m4}/ptyfuncs.m4 (100%)
 rename {tools/m4 => m4}/python_devel.m4 (100%)
 rename {tools/m4 => m4}/python_version.m4 (100%)
 rename {tools/m4 => m4}/savevar.m4 (100%)
 rename {tools/m4 => m4}/set_cflags_ldflags.m4 (100%)
 create mode 100644 m4/stubdom.m4
 rename {tools/m4 => m4}/uuid.m4 (100%)
 create mode 100644 stubdom/configure.ac
 delete mode 100644 tools/m4/path_or_fail.m4

diff --git a/autogen.sh b/autogen.sh
index 58a71ce..ada482c 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -2,3 +2,5 @@
 cd tools
 autoconf
 autoheader
+cd ../stubdom
+autoconf
diff --git a/config/Stubdom.mk.in b/config/Stubdom.mk.in
new file mode 100644
index 0000000..d2456a9
--- /dev/null
+++ b/config/Stubdom.mk.in
@@ -0,0 +1,44 @@
+# Prefix and install folder
+prefix              := @prefix@
+PREFIX              := $(prefix)
+exec_prefix         := @exec_prefix@
+libdir              := @libdir@
+LIBDIR              := $(libdir)
+
+# Path Programs
+CMAKE               := @CMAKE@
+WGET                := @WGET@ -c
+
+# A debug build of stubdom? //FIXME: Someone make this do something
+debug               := @debug@
+
+STUBDOM_TARGETS     := @STUBDOM_TARGETS@
+STUBDOM_BUILD       := @STUBDOM_BUILD@
+STUBDOM_INSTALL     := @STUBDOM_INSTALL@
+
+ZLIB_VERSION        := @ZLIB_VERSION@
+ZLIB_URL            := @ZLIB_URL@
+
+LIBPCI_VERSION      := @LIBPCI_VERSION@
+LIBPCI_URL          := @LIBPCI_URL@
+
+NEWLIB_VERSION      := @NEWLIB_VERSION@
+NEWLIB_URL          := @NEWLIB_URL@
+
+LWIP_VERSION        := @LWIP_VERSION@
+LWIP_URL            := @LWIP_URL@
+
+GRUB_VERSION        := @GRUB_VERSION@
+GRUB_URL            := @GRUB_URL@
+
+OCAML_VERSION       := @OCAML_VERSION@
+OCAML_URL           := @OCAML_URL@
+
+GMP_VERSION         := @GMP_VERSION@
+GMP_URL             := @GMP_URL@
+
+POLARSSL_VERSION    := @POLARSSL_VERSION@
+POLARSSL_URL        := @POLARSSL_URL@
+
+TPMEMU_VERSION      := @TPMEMU_VERSION@
+TPMEMU_URL          := @TPMEMU_URL@
diff --git a/tools/m4/curses.m4 b/m4/curses.m4
similarity index 100%
rename from tools/m4/curses.m4
rename to m4/curses.m4
diff --git a/tools/m4/extfs.m4 b/m4/extfs.m4
similarity index 100%
rename from tools/m4/extfs.m4
rename to m4/extfs.m4
diff --git a/tools/m4/features.m4 b/m4/features.m4
similarity index 100%
rename from tools/m4/features.m4
rename to m4/features.m4
diff --git a/tools/m4/fetcher.m4 b/m4/fetcher.m4
similarity index 100%
rename from tools/m4/fetcher.m4
rename to m4/fetcher.m4
diff --git a/tools/m4/ocaml.m4 b/m4/ocaml.m4
similarity index 100%
rename from tools/m4/ocaml.m4
rename to m4/ocaml.m4
diff --git a/m4/path_or_fail.m4 b/m4/path_or_fail.m4
new file mode 100644
index 0000000..1fdb90d
--- /dev/null
+++ b/m4/path_or_fail.m4
@@ -0,0 +1,13 @@
+AC_DEFUN([AX_PATH_PROG_OR_FAIL],
+[AC_PATH_PROG([$1], [$2], [no])
+if test x"${$1}" == x"no"
+then
+    AC_MSG_ERROR([Unable to find $2, please install $2])
+fi])
+
+AC_DEFUN([AX_PATH_PROG_OR_FAIL_ARG],[
+AS_IF([test "x$$1" = "xy"], [AX_PATH_PROG_OR_FAIL([$2], [$3])], [
+$2="/$3-disabled-in-configure-script"
+AC_SUBST($2)
+])
+])
diff --git a/tools/m4/pkg.m4 b/m4/pkg.m4
similarity index 100%
rename from tools/m4/pkg.m4
rename to m4/pkg.m4
diff --git a/tools/m4/pthread.m4 b/m4/pthread.m4
similarity index 100%
rename from tools/m4/pthread.m4
rename to m4/pthread.m4
diff --git a/tools/m4/ptyfuncs.m4 b/m4/ptyfuncs.m4
similarity index 100%
rename from tools/m4/ptyfuncs.m4
rename to m4/ptyfuncs.m4
diff --git a/tools/m4/python_devel.m4 b/m4/python_devel.m4
similarity index 100%
rename from tools/m4/python_devel.m4
rename to m4/python_devel.m4
diff --git a/tools/m4/python_version.m4 b/m4/python_version.m4
similarity index 100%
rename from tools/m4/python_version.m4
rename to m4/python_version.m4
diff --git a/tools/m4/savevar.m4 b/m4/savevar.m4
similarity index 100%
rename from tools/m4/savevar.m4
rename to m4/savevar.m4
diff --git a/tools/m4/set_cflags_ldflags.m4 b/m4/set_cflags_ldflags.m4
similarity index 100%
rename from tools/m4/set_cflags_ldflags.m4
rename to m4/set_cflags_ldflags.m4
diff --git a/m4/stubdom.m4 b/m4/stubdom.m4
new file mode 100644
index 0000000..82f92dc
--- /dev/null
+++ b/m4/stubdom.m4
@@ -0,0 +1,57 @@
+AC_DEFUN([AX_STUBDOM_DEFAULT_ENABLE], [
+AC_ARG_ENABLE([$1],
+AS_HELP_STRING([--disable-$1], [Build and install $1 (default is ENABLED)]),[
+$2=n
+],[
+$2=y
+STUBDOM_TARGETS="$STUBDOM_TARGETS $2"
+STUBDOM_BUILD="$STUBDOM_BUILD $1"
+STUBDOM_INSTALL="$STUBDOM_INSTALL install-$2"
+])
+AC_SUBST($2)
+])
+
+AC_DEFUN([AX_STUBDOM_DEFAULT_DISABLE], [
+AC_ARG_ENABLE([$1],
+AS_HELP_STRING([--enable-$1], [Build and install $1 (default is DISABLED)]),[
+$2=y
+STUBDOM_TARGETS="$STUBDOM_TARGETS $2"
+STUBDOM_BUILD="$STUBDOM_BUILD $1"
+STUBDOM_INSTALL="$STUBDOM_INSTALL install-$2"
+],[
+$2=n
+])
+AC_SUBST($2)
+])
+
+AC_DEFUN([AX_STUBDOM_FINISH], [
+AC_SUBST(STUBDOM_TARGETS)
+AC_SUBST(STUBDOM_BUILD)
+AC_SUBST(STUBDOM_INSTALL)
+echo "Will build the following stub domains:"
+for x in $STUBDOM_BUILD; do
+       echo "  $x"
+done
+])
+
+AC_DEFUN([AX_STUBDOM_LIB], [
+AC_ARG_VAR([$1_URL], [Download url for $2])
+AS_IF([test "x$$1_URL" = "x"], [
+       AS_IF([test "x$extfiles" = "xy"],
+               [$1_URL=\@S|@\@{:@XEN_EXTFILES_URL\@:}@],
+               [$1_URL="$4"])
+       ])
+$1_VERSION="$3"
+AC_SUBST($1_URL)
+AC_SUBST($1_VERSION)
+])
+
+AC_DEFUN([AX_STUBDOM_LIB_NOEXT], [
+AC_ARG_VAR([$1_URL], [Download url for $2])
+AS_IF([test "x$$1_URL" = "x"], [
+       $1_URL="$4"
+       ])
+$1_VERSION="$3"
+AC_SUBST($1_URL)
+AC_SUBST($1_VERSION)
+])
diff --git a/tools/m4/uuid.m4 b/m4/uuid.m4
similarity index 100%
rename from tools/m4/uuid.m4
rename to m4/uuid.m4
diff --git a/stubdom/Makefile b/stubdom/Makefile
index fc70d88..c5bb3cb 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -6,44 +6,7 @@ export XEN_OS=MiniOS
 export stubdom=y
 export debug=y
 include $(XEN_ROOT)/Config.mk
-
-#ZLIB_URL?=http://www.zlib.net
-ZLIB_URL=$(XEN_EXTFILES_URL)
-ZLIB_VERSION=1.2.3
-
-#LIBPCI_URL?=http://www.kernel.org/pub/software/utils/pciutils
-LIBPCI_URL?=$(XEN_EXTFILES_URL)
-LIBPCI_VERSION=2.2.9
-
-#NEWLIB_URL?=ftp://sources.redhat.com/pub/newlib
-NEWLIB_URL?=$(XEN_EXTFILES_URL)
-NEWLIB_VERSION=1.16.0
-
-#LWIP_URL?=http://download.savannah.gnu.org/releases/lwip
-LWIP_URL?=$(XEN_EXTFILES_URL)
-LWIP_VERSION=1.3.0
-
-#GRUB_URL?=http://alpha.gnu.org/gnu/grub
-GRUB_URL?=$(XEN_EXTFILES_URL)
-GRUB_VERSION=0.97
-
-#OCAML_URL?=$(XEN_EXTFILES_URL)
-OCAML_URL?=http://caml.inria.fr/pub/distrib/ocaml-3.11
-OCAML_VERSION=3.11.0
-
-GMP_VERSION=4.3.2
-GMP_URL?=$(XEN_EXTFILES_URL)
-#GMP_URL?=ftp://ftp.gmplib.org/pub/gmp-$(GMP_VERSION)
-
-POLARSSL_VERSION=1.1.4
-POLARSSL_URL?=$(XEN_EXTFILES_URL)
-#POLARSSL_URL?=http://polarssl.org/code/releases
-
-TPMEMU_VERSION=0.7.4
-TPMEMU_URL?=$(XEN_EXTFILES_URL)
-#TPMEMU_URL?=http://download.berlios.de/tpm-emulator
-
-WGET=wget -c
+-include $(XEN_ROOT)/config/Stubdom.mk
 
 GNU_TARGET_ARCH:=$(XEN_TARGET_ARCH)
 ifeq ($(XEN_TARGET_ARCH),x86_32)
@@ -86,12 +49,12 @@ TARGET_CPPFLAGS += -I$(XEN_ROOT)/xen/include
 
 TARGET_LDFLAGS += -nostdlib -L$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib
 
-TARGETS=ioemu c caml grub xenstore vtpm vtpmmgr
+TARGETS=$(STUBDOM_TARGETS)
 
 .PHONY: all
 all: build
 ifeq ($(STUBDOM_SUPPORTED),1)
-build: genpath ioemu-stubdom c-stubdom pv-grub xenstore-stubdom vtpm-stubdom 
vtpmmgrdom
+build: genpath $(STUBDOM_BUILD)
 else
 build: genpath
 endif
@@ -245,7 +208,7 @@ tpm_emulator-$(XEN_TARGET_ARCH): 
tpm_emulator-$(TPMEMU_VERSION).tar.gz
        mv tpm_emulator-$(TPMEMU_VERSION) $@
        patch -d $@ -p1 < tpmemu-$(TPMEMU_VERSION).patch;
        mkdir $@/build
-       cd $@/build; cmake .. -DCMAKE_C_COMPILER=${CC} 
-DCMAKE_C_FLAGS="-std=c99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) 
-Wno-declaration-after-statement"
+       cd $@/build; $(CMAKE) .. -DCMAKE_C_COMPILER=${CC} 
-DCMAKE_C_FLAGS="-std=c99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) 
-Wno-declaration-after-statement"
        touch $@
 
 TPMEMU_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libtpm.a
@@ -483,7 +446,7 @@ xenstore-stubdom: mini-os-$(XEN_TARGET_ARCH)-xenstore libxc 
xenstore
 #########
 
 ifeq ($(STUBDOM_SUPPORTED),1)
-install: genpath install-readme install-ioemu install-grub install-xenstore 
install-vtpm install-vtpmmgr
+install: genpath install-readme $(STUBDOM_INSTALL)
 else
 install: genpath
 endif
@@ -581,3 +544,9 @@ downloadclean: patchclean
 
 .PHONY: distclean
 distclean: downloadclean
+       -rm ../config/Stubdom.mk
+
+ifeq (,$(findstring clean,$(MAKECMDGOALS)))
+$(XEN_ROOT)/config/Stubdom.mk:
+       $(error You have to run ./configure before building or installing 
stubdom)
+endif
diff --git a/stubdom/configure.ac b/stubdom/configure.ac
new file mode 100644
index 0000000..b3a307a
--- /dev/null
+++ b/stubdom/configure.ac
@@ -0,0 +1,53 @@
+#                                               -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ([2.67])
+AC_INIT([Xen Hypervisor Stub Domains], m4_esyscmd([../version.sh 
../xen/Makefile]),
+    [xen-devel@xxxxxxxxxxxxx], [xen], [http://www.xen.org/])
+AC_CONFIG_SRCDIR([../extras/mini-os/kernel.c])
+AC_CONFIG_FILES([../config/Stubdom.mk])
+AC_PREFIX_DEFAULT([/usr])
+AC_CONFIG_AUX_DIR([../])
+
+# M4 Macro includes
+m4_include([../m4/stubdom.m4])
+m4_include([../m4/features.m4])
+m4_include([../m4/path_or_fail.m4])
+
+# Enable/disable stub domains
+AX_STUBDOM_DEFAULT_ENABLE([ioemu-stubdom], [ioemu])
+AX_STUBDOM_DEFAULT_DISABLE([c-stubdom], [c])
+AX_STUBDOM_DEFAULT_ENABLE([caml-stubdom], [caml])
+AX_STUBDOM_DEFAULT_ENABLE([pv-grub], [grub])
+AX_STUBDOM_DEFAULT_ENABLE([xenstore-stubdom], [xenstore])
+AX_STUBDOM_DEFAULT_ENABLE([vtpm-stubdom], [vtpm])
+AX_STUBDOM_DEFAULT_ENABLE([vtpmmgrdom], [vtpmmgr])
+
+AX_ARG_DEFAULT_ENABLE([debug], [Disable debug build of stubdom])
+AX_ARG_DEFAULT_ENABLE([extfiles], [Use xen extfiles repository for libraries])
+
+AC_ARG_VAR([CMAKE], [Path to the cmake program])
+AC_ARG_VAR([WGET], [Path to wget program])
+
+# Checks for programs.
+AC_PROG_CC
+AC_PROG_MAKE_SET
+AC_PROG_INSTALL
+AX_PATH_PROG_OR_FAIL([WGET], [wget])
+
+# Checks for programs that depend on an argument
+AX_PATH_PROG_OR_FAIL_ARG([vtpm], [CMAKE], [cmake])
+
+# Stubdom libraries version and url setup
+AX_STUBDOM_LIB([ZLIB], [zlib], [1.2.3], [http://www.zlib.net])
+AX_STUBDOM_LIB([LIBPCI], [libpci], [2.2.9], 
[http://www.kernel.org/pub/software/utils/pciutils])
+AX_STUBDOM_LIB([NEWLIB], [newlib], [1.16.0], 
[ftp://sources.redhat.com/pub/newlib])
+AX_STUBDOM_LIB([LWIP], [lwip], [1.3.0], 
[http://download.savannah.gnu.org/releases/lwip])
+AX_STUBDOM_LIB([GRUB], [grub], [0.97], [http://alpha.gnu.org/gnu/grub])
+AX_STUBDOM_LIB_NOEXT([OCAML], [ocaml], [3.11.0], 
[http://caml.inria.fr/pub/distrib/ocaml-3.11])
+AX_STUBDOM_LIB([GMP], [libgmp], [4.3.2], [ftp://ftp.gmplib.org/pub/gmp-4.3.2])
+AX_STUBDOM_LIB([POLARSSL], [polarssl], [1.1.4], 
[http://polarssl.org/code/releases])
+AX_STUBDOM_LIB([TPMEMU], [berlios tpm emulator], [0.7.4], 
[http://download.berlios.de/tpm-emulator])
+
+AX_STUBDOM_FINISH
+AC_OUTPUT()
diff --git a/tools/configure.ac b/tools/configure.ac
index 586313d..971e3e9 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -22,20 +22,20 @@ APPEND_INCLUDES and APPEND_LIB instead when possible.])
 AC_CANONICAL_HOST
 
 # M4 Macro includes
-m4_include([m4/savevar.m4])
-m4_include([m4/features.m4])
-m4_include([m4/path_or_fail.m4])
-m4_include([m4/python_version.m4])
-m4_include([m4/python_devel.m4])
-m4_include([m4/ocaml.m4])
-m4_include([m4/set_cflags_ldflags.m4])
-m4_include([m4/uuid.m4])
-m4_include([m4/pkg.m4])
-m4_include([m4/curses.m4])
-m4_include([m4/pthread.m4])
-m4_include([m4/ptyfuncs.m4])
-m4_include([m4/extfs.m4])
-m4_include([m4/fetcher.m4])
+m4_include([../m4/savevar.m4])
+m4_include([../m4/features.m4])
+m4_include([../m4/path_or_fail.m4])
+m4_include([../m4/python_version.m4])
+m4_include([../m4/python_devel.m4])
+m4_include([../m4/ocaml.m4])
+m4_include([../m4/set_cflags_ldflags.m4])
+m4_include([../m4/uuid.m4])
+m4_include([../m4/pkg.m4])
+m4_include([../m4/curses.m4])
+m4_include([../m4/pthread.m4])
+m4_include([../m4/ptyfuncs.m4])
+m4_include([../m4/extfs.m4])
+m4_include([../m4/fetcher.m4])
 
 # Enable/disable options
 AX_ARG_DEFAULT_DISABLE([githttp], [Download GIT repositories via HTTP])
diff --git a/tools/m4/path_or_fail.m4 b/tools/m4/path_or_fail.m4
deleted file mode 100644
index ece8cd4..0000000
--- a/tools/m4/path_or_fail.m4
+++ /dev/null
@@ -1,6 +0,0 @@
-AC_DEFUN([AX_PATH_PROG_OR_FAIL],
-[AC_PATH_PROG([$1], [$2], [no])
-if test x"${$1}" == x"no" 
-then
-    AC_MSG_ERROR([Unable to find $2, please install $2])
-fi])
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.