Skip to contentSkip to conversation

build: add autoconf to replace custom checks in tools/check

RFC PATCH Superseded Roger Pau Monne 4 participants 11 messages Jan 7, 2012 – Jan 10, 2012 Kbuild

v1 of 8 Superseded Latest is v8 →

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 build: add autoconf to replace custom checks in tools/check

# HG changeset patch
# User Roger Pau Monne <[email protected]>
# Date 1325906230 -3600
# Node ID e12ec1071410c946367cb0508cf218a0c3b596ca # Parent 4086e4811547ddffb9a53fbf2efb6c2fa436b70a
build: add autoconf to replace custom checks in tools/check

Added autotools magic to replace custom check scripts. The previous checks have been ported to autoconf, and some additional ones have been added (plus the suggestions from running autoscan). Two files are created as a result from executing configure script, config/Autoconf.mk and config.h.

Autoconf.mk is included by Config.mk, and contains most of the options previously defined in .config, that can now be set passing parameters or defining environment variables when executing configure script.

config.h is still not used anywhere, and is automatically created by autoheader, altough this migh change when we start to include this file.

Just a first release, and since Iit's my first autoconf script I guess there will be many things to polish here... Please review and comment.

Config.mk +1 -33
diff -r 4086e4811547 -r e12ec1071410 Config.mk
@@ -9,8 +9,6 @@ realpath = $(wildcard $(foreach file,$(1
 
 -include $(XEN_ROOT)/.config
 
-# A debug build of Xen and tools?
-debug ?= y
 
 XEN_COMPILE_ARCH    ?= $(shell uname -m | sed -e s/i.86/x86_32/ \
                          -e s/i86pc/x86_32/ -e s/amd64/x86_64/)
@@ -43,6 +41,7 @@ endif
 
 include $(XEN_ROOT)/config/$(XEN_OS).mk
 include $(XEN_ROOT)/config/$(XEN_TARGET_ARCH).mk
+include $(XEN_ROOT)/config/Autoconf.mk
 
 SHAREDIR    ?= $(PREFIX)/share
 DOCDIR      ?= $(SHAREDIR)/doc/xen
@@ -70,10 +69,6 @@ EXTRA_INCLUDES += $(EXTRA_PREFIX)/includ
 EXTRA_LIB += $(EXTRA_PREFIX)/$(LIBLEAFDIR)
 endif
 
-BISON	?= bison
-FLEX	?= flex
-
-PYTHON      ?= python
 PYTHON_PREFIX_ARG ?= --prefix="$(PREFIX)"
 # The above requires that PREFIX contains *no spaces*. This variable is here
 # to permit the user to set PYTHON_PREFIX_ARG to '' to workaround this bug:
@@ -175,22 +170,9 @@ CFLAGS += $(foreach i, $(PREPEND_INCLUDE
 APPEND_LDFLAGS += $(foreach i, $(APPEND_LIB), -L$(i))
 APPEND_CFLAGS += $(foreach i, $(APPEND_INCLUDES), -I$(i))
 
-CHECK_LIB = $(EXTRA_LIB) $(PREPEND_LIB) $(APPEND_LIB)
-CHECK_INCLUDES = $(EXTRA_INCLUDES) $(PREPEND_INCLUDES) $(APPEND_INCLUDES)
-
 EMBEDDED_EXTRA_CFLAGS := -nopie -fno-stack-protector -fno-stack-protector-all
 EMBEDDED_EXTRA_CFLAGS += -fno-exceptions
 
-# Enable XSM security module (by default, Flask).
-XSM_ENABLE ?= n
-FLASK_ENABLE ?= $(XSM_ENABLE)
-
-# Download GIT repositories via HTTP or GIT's own protocol?
-# GIT's protocol is faster and more robust, when it works at all (firewalls
-# may block it). We make it the default, but if your GIT repository downloads
-# fail or hang, please specify GIT_HTTP=y in your environment.
-GIT_HTTP ?= n
-
 XEN_EXTFILES_URL=http://xenbits.xensource.com/xen-extfiles
 # All the files at that location were downloaded from elsewhere on
 # the internet.  The original download URL is preserved as a comment
@@ -222,17 +204,3 @@ QEMU_TAG ?= bb36d632e4cabf47882adff07a45
 # Note that using SeaBIOS requires the use the upstream qemu as the
 # device model.
 SEABIOS_DIR ?= 
-
-# Optional components
-XENSTAT_XENTOP     ?= y
-VTPM_TOOLS         ?= n
-LIBXENAPI_BINDINGS ?= n
-PYTHON_TOOLS       ?= y
-OCAML_TOOLS        ?= y
-CONFIG_MINITERM    ?= n
-CONFIG_LOMOUNT     ?= n
-CONFIG_SYSTEM_LIBAIO ?= y
-
-ifeq ($(OCAML_TOOLS),y)
-OCAML_TOOLS := $(shell ocamlopt -v > /dev/null 2>&1 && echo "y" || echo "n")
-endif
Makefile +0 -2
diff -r 4086e4811547 -r e12ec1071410 Makefile
@@ -40,11 +40,9 @@ dist: DESTDIR=$(DISTDIR)/install
 dist: dist-xen dist-kernels dist-tools dist-stubdom dist-docs dist-misc
 
 dist-misc:
-	$(INSTALL_DIR) $(DISTDIR)/check
 	$(INSTALL_DATA) ./COPYING $(DISTDIR)
 	$(INSTALL_DATA) ./README $(DISTDIR)
 	$(INSTALL_PROG) ./install.sh $(DISTDIR)
-	$(INSTALL_PROG) tools/check/chk tools/check/check_* tools/check/funcs.sh $(DISTDIR)/check
 dist-%: DESTDIR=$(DISTDIR)/install
 dist-%: install-%
 	@: # do nothing
README +6 -0
diff -r 4086e4811547 -r e12ec1071410 README
@@ -87,9 +87,15 @@ 2. cd to xen-unstable (or whatever you s
 3. For the very first build, or if you want to destroy build trees,
    perform the following steps:
 
+    # automake -a
+    # autoheader && autoconf
+    # ./configure
     # make world
     # make install
 
+   If you want, you can run ./configure --help to see the list of
+   optins available options when building and installing Xen.
+
    This will create and install onto the local machine. It will build
    the xen binary (xen.gz), the tools and the documentation.
 
config/Autoconf.mk.in new file +49 -0

49 lines not on this page · raw message

configure.ac new file +179 -0

179 lines not on this page · raw message

m4/default_lib.m4 new file +7 -0
diff -r 4086e4811547 -r e12ec1071410 m4/default_lib.m4
@@ -0,0 +1,7 @@
+AC_DEFUN([AX_DEFAULT_LIB],
+[AS_IF([test -d "$prefix/lib64"], [
+    LIB_PATH="lib64"
+],[
+    LIB_PATH="lib"
+])
+AC_SUBST(LIB_PATH)])
\ No newline at end of file
m4/disable_feature.m4 new file +10 -0
diff -r 4086e4811547 -r e12ec1071410 m4/disable_feature.m4
@@ -0,0 +1,10 @@
+AC_DEFUN([AX_ARG_DISABLE_AND_EXPORT],
+[AC_ARG_ENABLE([$1],
+    AS_HELP_STRING([--disable-$1], [$2]))
+
+AS_IF([test "x$enable_$1" = "xno"], [
+    $1="n"
+],[
+    $1="y"
+])
+AC_SUBST($1)])
\ No newline at end of file
m4/enable_feature.m4 new file +10 -0
diff -r 4086e4811547 -r e12ec1071410 m4/enable_feature.m4
@@ -0,0 +1,10 @@
+AC_DEFUN([AX_ARG_ENABLE_AND_EXPORT],
+[AC_ARG_ENABLE([$1],
+    AS_HELP_STRING([--enable-$1], [$2]))
+
+AS_IF([test "x$enable_$1" = "xyes"], [
+    $1="y"
+],[
+    $1="n"
+])
+AC_SUBST($1)])
\ No newline at end of file
m4/ocaml.m4 new file +240 -0

240 lines not on this page · raw message

m4/path_or_fail.m4 new file +6 -0
diff -r 4086e4811547 -r e12ec1071410 m4/path_or_fail.m4
@@ -0,0 +1,6 @@
+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])
m4/python_devel.m4 new file +18 -0
diff -r 4086e4811547 -r e12ec1071410 m4/python_devel.m4
@@ -0,0 +1,18 @@
+AC_DEFUN([AX_CHECK_PYTHON_DEVEL],
+[AC_MSG_CHECKING([for python devel])
+
+`$PYTHON -c '
+import os.path, sys
+for p in sys.path:
+    if os.path.exists(p + "/config/Makefile"):
+        sys.exit(0)
+sys.exit(1)
+' > /dev/null 2>&1`
+
+if test "$?" != "0"
+then
+    AC_MSG_RESULT([no])
+    AC_MSG_ERROR([Python devel package not found])
+else
+    AC_MSG_RESULT([yes])
+fi])
m4/python_version.m4 new file +12 -0
diff -r 4086e4811547 -r e12ec1071410 m4/python_version.m4
@@ -0,0 +1,12 @@
+AC_DEFUN([AX_CHECK_PYTHON_VERSION],
+[AC_MSG_CHECKING([for python version >= $1.$2 ])
+`$PYTHON -c 'import sys; exit(eval("sys.version_info < ($1, $2)"))'`
+if test "$?" != "0"
+then
+    python_version=`$PYTHON -V 2>&1`
+    AC_MSG_RESULT([no])
+    AC_MSG_ERROR(
+        [$python_version is too old, minimum required version is $1.$2])
+else
+    AC_MSG_RESULT([yes])
+fi])
m4/python_xml.m4 new file +10 -0
diff -r 4086e4811547 -r e12ec1071410 m4/python_xml.m4
@@ -0,0 +1,10 @@
+AC_DEFUN([AX_CHECK_PYTHON_XML],
+[AC_MSG_CHECKING([for python xml.dom.minidom])
+`$PYTHON -c 'import xml.dom.minidom'`
+if test "$?" != "0"
+then
+    AC_MSG_RESULT([no])
+    AC_MSG_ERROR([Unable to find xml.dom.minidom module])
+else
+    AC_MSG_RESULT([yes])
+fi])
m4/set_cflags_ldflags.m4 new file +19 -0
diff -r 4086e4811547 -r e12ec1071410 m4/set_cflags_ldflags.m4
@@ -0,0 +1,19 @@
+AC_DEFUN([AX_SET_FLAGS],
+[for cflag in $PREPEND_INCLUDES
+do
+    PREPEND_CFLAGS+=" -I$cflag"
+done
+for ldflag in $PREPEND_LIB
+do
+    PREPEND_LDFLAGS+=" -L$ldflag"
+done
+for cflag in $APPEND_INCLUDES
+do
+    APPEND_CFLAGS+=" -I$cflag"
+done
+for ldflag in $APPEND_LIB
+do
+    APPEND_LDFLAGS+=" -L$ldflag"
+done
+CFLAGS="$PREPEND_CFLAGS $CFLAGS $APPEND_CFLAGS"
+LDFLAGS="$PREPEND_LDFLAGS $LDFLAGS $APPEND_LDFLAGS"])
\ No newline at end of file
m4/udev.m4 new file +32 -0
diff -r 4086e4811547 -r e12ec1071410 m4/udev.m4
@@ -0,0 +1,32 @@
+AC_DEFUN([AX_CHECK_UDEV],
+[if test "$host_os" == "linux-gnu"
+then
+    AC_PATH_PROG([UDEVADM], [udevadm], [no])
+    if test x"${UDEVADM}" == x"no" 
+    then
+        AC_PATH_PROG([UDEVINFO], [udevinfo], [no])
+        if test x"${UDEVINFO}" == x"no"
+        then
+            AC_MSG_ERROR(
+                [Unable to find udevadm or udevinfo, please install udev])
+        fi
+        udevver=`${UDEVINFO} -V | awk '{print $NF}'`
+    else
+        udevver=`${UDEVADM} info -V | awk '{print $NF}'`
+    fi
+    if test ${udevver} -lt 59
+    then
+        AC_PATH_PROG([HOTPLUG], [hotplug], [no])
+        if test x"${HOTPLUG}" == x"no"
+        then
+            AC_MSG_ERROR([udev is too old, upgrade to version 59 or later])
+        fi
+    fi
+else
+    AC_PATH_PROG([VNCONFIG], [vnconfig], [no])
+    if test x"${VNCONFIG}" == x"no"
+    then
+        AC_MSG_ERROR([Not a Linux system and unable to find vnd])
+    fi
+fi
+])
tools/Makefile +0 -1
diff -r 4086e4811547 -r e12ec1071410 tools/Makefile
@@ -6,7 +6,6 @@ SUBDIRS-libaio := libaio
 endif
 
 SUBDIRS-y :=
-SUBDIRS-y += check
 SUBDIRS-y += include
 SUBDIRS-y += libxc
 SUBDIRS-y += flask
tools/blktap/drivers/Makefile +1 -1
diff -r 4086e4811547 -r e12ec1071410 tools/blktap/drivers/Makefile
@@ -13,7 +13,7 @@ CFLAGS   += $(CFLAGS_libxenstore)
 CFLAGS   += -I $(MEMSHR_DIR)
 CFLAGS   += -D_GNU_SOURCE
 
-ifeq ($(shell . ./check_gcrypt $(CC)),yes)
+ifeq ($CONFIG_GCRYPT,y)
 CFLAGS += -DUSE_GCRYPT
 CRYPT_LIB := -lgcrypt
 else
tools/blktap/drivers/check_gcrypt deleted +0 -14
diff -r 4086e4811547 -r e12ec1071410 tools/blktap/drivers/check_gcrypt
@@ -1,14 +0,0 @@
-#!/bin/sh
-
-cat > .gcrypt.c << EOF
-#include <gcrypt.h>
-int main(void) { return 0; }
-EOF
-
-if $1 -o .gcrypt .gcrypt.c -lgcrypt 2>/dev/null ; then
-  echo "yes"
-else
-  echo "no"
-fi
-
-rm -f .gcrypt*
tools/check/Makefile deleted +0 -26
diff -r 4086e4811547 -r e12ec1071410 tools/check/Makefile
@@ -1,26 +0,0 @@
-XEN_ROOT = $(CURDIR)/../..
-include $(XEN_ROOT)/tools/Rules.mk
-
-# Export the necessary environment variables for the tests
-export PYTHON
-export LIBXENAPI_BINDINGS
-export CHECK_INCLUDES
-export CHECK_LIB
-export CONFIG_SYSTEM_LIBAIO
-
-.PHONY: all install
-all install: check-build
-
-# Check this machine is OK for building on.
-.PHONY: check-build
-check-build:
-	./chk build
-
-# Check this machine is OK for installing on.
-.PHONY: check-install
-check-install:
-	./chk install
-
-.PHONY: clean
-clean:
-	./chk clean
tools/check/README deleted +0 -20
diff -r 4086e4811547 -r e12ec1071410 tools/check/README
@@ -1,20 +0,0 @@
-Checks for the suitability of a machine for Xen build or install.
-To check for build suitability use
-
-        ./chk build
-
-To check for install suitability use
-
-        ./chk install
-
-The chk script will run checks in this directory and print
-the ones that failed. It prints nothing if checks succeed.
-The chk script exits with 0 on success and 1 on failure.
-
-The chk script runs executable files in this directory whose
-names begin with 'check_'. Files containing CHECK-BUILD
-are run for the build check, and files containing CHECK-INSTALL
-are run for the install check.
-
-Detailed output from the check scripts is in .chkbuild for build
-and .chkinstall for install.
\ No newline at end of file
tools/check/check_brctl deleted +0 -13
diff -r 4086e4811547 -r e12ec1071410 tools/check/check_brctl
@@ -1,13 +0,0 @@
-#!/bin/sh
-# CHECK-INSTALL
-
-. ./funcs.sh
-
-case $OS in
-OpenBSD|NetBSD|FreeBSD)
-	has_or_fail brconfig ;;
-Linux)
-	has_or_fail brctl ;;
-*)
-	fail "unknown OS" ;;
-esac
tools/check/check_crypto_lib deleted +0 -11
diff -r 4086e4811547 -r e12ec1071410 tools/check/check_crypto_lib
@@ -1,11 +0,0 @@
-#!/bin/sh
-# CHECK-BUILD CHECK-INSTALL
-
-. ./funcs.sh
-
-case $OS in
-FreeBSD|NetBSD|OpenBSD)
-	exit 0 ;;
-esac
-
-has_lib libcrypto.so || fail "missing libcrypto.so"
tools/check/check_curl deleted +0 -13
diff -r 4086e4811547 -r e12ec1071410 tools/check/check_curl
@@ -1,13 +0,0 @@
-#!/bin/sh
-# CHECK-BUILD CHECK-INSTALL
-
-. ./funcs.sh
-
-if [ "$LIBXENAPI_BINDINGS" != "y" ]; then
-	echo -n "unused, "
-	exit 0
-fi
-
-has_or_fail curl-config
-curl_libs=`curl-config --libs` || fail "curl-config --libs failed"
-test_link $curl_libs || fail "dependency libraries for curl are missing"
tools/check/check_iproute deleted +0 -15
diff -r 4086e4811547 -r e12ec1071410 tools/check/check_iproute
@@ -1,15 +0,0 @@
-#!/bin/sh
-# CHECK-INSTALL
-
-. ./funcs.sh
-
-PATH=/sbin:$PATH
-
-case $OS in
-OpenBSD|NetBSD|FreeBSD)
-	has_or_fail ifconfig ;;
-Linux)
-	has_or_fail ip ;;
-*)
-	fail "unknown OS" ;;
-esac
tools/check/check_libaio_devel deleted +0 -11
diff -r 4086e4811547 -r e12ec1071410 tools/check/check_libaio_devel
@@ -1,11 +0,0 @@
-#!/bin/sh
-# CHECK-BUILD
-
-. ./funcs.sh
-
-if [ X${CONFIG_SYSTEM_LIBAIO} != X"y" ] ; then
-    exit 0
-fi
-if ! has_header libaio.h ; then
-    fail "can't find libaio headers, install libaio devel package or set CONFIG_SYSTEM_LIBAIO=n"
-fi
tools/check/check_libaio_lib deleted +0 -9
diff -r 4086e4811547 -r e12ec1071410 tools/check/check_libaio_lib
@@ -1,9 +0,0 @@
-#!/bin/sh
-# CHECK-BUILD CHECK-INSTALL
-
-. ./funcs.sh
-
-if [ X${CONFIG_SYSTEM_LIBAIO} != X"y" ] ; then
-    exit 0
-fi
-has_lib libaio.so || fail "can't find libaio"
tools/check/check_openssl_devel deleted +0 -6
diff -r 4086e4811547 -r e12ec1071410 tools/check/check_openssl_devel
@@ -1,6 +0,0 @@
-#!/bin/sh
-# CHECK-BUILD
-
-. ./funcs.sh
-
-has_header openssl/md5.h || fail "missing openssl headers"
tools/check/check_python deleted +0 -13
diff -r 4086e4811547 -r e12ec1071410 tools/check/check_python
@@ -1,13 +0,0 @@
-#!/bin/sh
-# CHECK-BUILD CHECK-INSTALL
-
-. ./funcs.sh
-
-if test -z ${PYTHON}; then
-  PYTHON=python
-fi
-
-${PYTHON} -c '
-import sys
-sys.exit(sys.version_info[0] < 2 or sys.version_info[1] < 3)
-' || fail "need python version >= 2.3"
tools/check/check_python_devel deleted +0 -17
diff -r 4086e4811547 -r e12ec1071410 tools/check/check_python_devel
@@ -1,17 +0,0 @@
-#!/bin/sh
-# CHECK-BUILD
-
-. ./funcs.sh
-
-if test -z ${PYTHON}; then
-  PYTHON=python
-fi
-has_or_fail ${PYTHON}
-
-${PYTHON} -c '
-import os.path, sys
-for p in sys.path:
-	if os.path.exists(p + "/config/Makefile"):
-		sys.exit(0)
-sys.exit(1)
-' || fail "can't find python devel files"
tools/check/check_python_xml deleted +0 -12
diff -r 4086e4811547 -r e12ec1071410 tools/check/check_python_xml
@@ -1,12 +0,0 @@
-#!/bin/sh
-# CHECK-INSTALL
-
-. ./funcs.sh
-
-if test -z ${PYTHON}; then
-  PYTHON=python
-fi
-has_or_fail ${PYTHON}
-
-${PYTHON} -c 'import xml.dom.minidom' 2>/dev/null || \
-fail "can't import xml.dom.minidom"
tools/check/check_udev deleted +0 -22
diff -r 4086e4811547 -r e12ec1071410 tools/check/check_udev
@@ -1,22 +0,0 @@
-#!/bin/sh
-# CHECK-INSTALL
-
-. ./funcs.sh
-
-case $OS in
-OpenBSD|NetBSD|FreeBSD)
-	has_or_fail vnconfig
-	;;
-Linux)
-	has /sbin/udevadm && \
-		udevver=`/sbin/udevadm info -V | awk '{print $NF}'`
-	[ -z "$udevver" ] && has_or_fail udevinfo && \
-		udevver=`udevinfo -V | awk '{print $NF}'`
-	[ "$udevver" -ge 59 ] 2>/dev/null || \
-		has hotplug || \
-		fail "udev is too old, upgrade to version 59 or later"
-	;;
-*)
-	fail "unknown OS"
-	;;
-esac
tools/check/check_uuid_devel deleted +0 -7
diff -r 4086e4811547 -r e12ec1071410 tools/check/check_uuid_devel
@@ -1,7 +0,0 @@
-#!/bin/sh
-# CHECK-BUILD
-
-. ./funcs.sh
-
-has_header uuid.h || \
-has_header uuid/uuid.h || fail "missing uuid headers (package uuid-dev)"
tools/check/check_x11_devel deleted +0 -9
diff -r 4086e4811547 -r e12ec1071410 tools/check/check_x11_devel
@@ -1,9 +0,0 @@
-#!/bin/sh
-# CHECK-BUILD
-
-. ./funcs.sh
-
-has_header X11/keysymdef.h || \
-has_header /usr/X11R6/include/X11/keysymdef.h || \
-has_header /usr/X11R7/include/X11/keysymdef.h || \
-warning "can't find X11 headers"
tools/check/check_xgettext deleted +0 -6
diff -r 4086e4811547 -r e12ec1071410 tools/check/check_xgettext
@@ -1,6 +0,0 @@
-#!/bin/sh
-# CHECK-BUILD
-
-. ./funcs.sh
-
-has_or_fail xgettext
tools/check/check_xml2 deleted +0 -14
diff -r 4086e4811547 -r e12ec1071410 tools/check/check_xml2
@@ -1,14 +0,0 @@
-#!/bin/sh
-# CHECK-BUILD CHECK-INSTALL
-
-. ./funcs.sh
-
-if [ ! "$LIBXENAPI_BINDINGS" = "y" ]
-then
-    echo -n "unused, "
-    exit 0
-fi
-
-has_or_fail xml2-config
-xml2_libs=`xml2-config --libs` || fail "xml2-config --libs failed"
-test_link $xml2_libs || fail "dependency libraries for xml2 are missing"
tools/check/check_yajl_devel deleted +0 -8
diff -r 4086e4811547 -r e12ec1071410 tools/check/check_yajl_devel
@@ -1,8 +0,0 @@
-#!/bin/sh
-# CHECK-BUILD
-
-. ./funcs.sh
-
-has_header yajl/yajl_parse.h || fail "can't find yajl/yajl_parse.h"
-has_header yajl/yajl_gen.h || fail "can't find yajl/yajl_gen.h"
-has_lib libyajl.so || fail "can't find libyajl.so"
tools/check/check_yajl_lib deleted +0 -6
diff -r 4086e4811547 -r e12ec1071410 tools/check/check_yajl_lib
@@ -1,6 +0,0 @@
-#!/bin/sh
-# CHECK-BUILD CHECK-INSTALL
-
-. ./funcs.sh
-
-has_lib libyajl.so.1 || fail "can't find libyajl.so.1 version 1"
tools/check/check_zlib_devel deleted +0 -6
diff -r 4086e4811547 -r e12ec1071410 tools/check/check_zlib_devel
@@ -1,6 +0,0 @@
-#!/bin/sh
-# CHECK-BUILD
-
-. ./funcs.sh
-
-has_header zlib.h || fail "can't find zlib headers"
tools/check/check_zlib_lib deleted +0 -12
diff -r 4086e4811547 -r e12ec1071410 tools/check/check_zlib_lib
@@ -1,12 +0,0 @@
-#!/bin/sh
-# CHECK-BUILD CHECK-INSTALL
-
-. ./funcs.sh
-
-case $OS in
-FreeBSD|NetBSD|OpenBSD)
-	exit 0
-	;;
-esac
-
-has_lib libz.so || fail "can't find zlib"
tools/check/chk deleted +0 -63

63 lines not on this page · raw message

tools/check/funcs.sh deleted +0 -106

106 lines not on this page · raw message

tools/debugger/gdbsx/xg/Makefile +0 -1
diff -r 4086e4811547 -r e12ec1071410 tools/debugger/gdbsx/xg/Makefile
@@ -21,7 +21,6 @@ xg_all.a: $(XG_OBJS) Makefile $(XG_HDRS)
 #	$(CC) -m32 -c -o $@ $^
 
 xen-headers:
-	$(MAKE) -C ../../../check 
 	$(MAKE) -C ../../../include
 
 # xg_main.o: xg_main.c Makefile $(XG_HDRS)
tools/libfsimage/Makefile +5 -1
diff -r 4086e4811547 -r e12ec1071410 tools/libfsimage/Makefile
@@ -2,7 +2,11 @@ XEN_ROOT = $(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
 SUBDIRS-y = common ufs reiserfs iso9660 fat zfs xfs
-SUBDIRS-y += $(shell env CC="$(CC)" ./check-libext2fs)
+ifeq ($(CONFIG_EXT2FS), y)
+    SUBDIRS-y += ext2fs-lib
+else
+    SUBDIRS-y += ext2fs
+endif
 
 .PHONY: all clean install
 all clean install: %: subdirs-%
tools/libfsimage/check-libext2fs deleted +0 -21
diff -r 4086e4811547 -r e12ec1071410 tools/libfsimage/check-libext2fs
@@ -1,21 +0,0 @@
-#!/bin/sh
-
-cat >ext2-test.c <<EOF
-#include <ext2fs/ext2fs.h>
-
-int main()
-{
-	ext2fs_open2;
-}
-EOF
-
-${CC-gcc} -o ext2-test ext2-test.c -lext2fs >/dev/null 2>&1
-if [ $? = 0 ]; then
-	echo ext2fs-lib
-else
-	echo ext2fs
-fi
-
-rm -f ext2-test ext2-test.c
-
-exit 0
tools/libxen/Makefile +4 -4
diff -r 4086e4811547 -r e12ec1071410 tools/libxen/Makefile
@@ -22,12 +22,12 @@ MAJOR = 1.0
 MINOR = 0
 
 CFLAGS += -Iinclude                     \
-          $(shell xml2-config --cflags) \
-          $(shell curl-config --cflags) \
+          $(shell $(XML2-CONFIG) --cflags) \
+          $(shell $(CURL-CONFIG) --cflags) \
           -fPIC
 
-LDFLAGS += $(shell xml2-config --libs) \
-           $(shell curl-config --libs)
+LDFLAGS += $(shell $(XML2-CONFIG) --libs) \
+           $(shell $(CURL-CONFIG) --libs)
 
 LIBXENAPI_HDRS = $(wildcard include/xen/api/*.h) include/xen/api/xen_all.h
 LIBXENAPI_OBJS = $(patsubst %.c, %.o, $(wildcard src/*.c))

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw
Quoted 32 lines
Quoted 1 line
Quoted 1 line · Roger Pau Monne

# HG changeset patch
# User Roger Pau Monne <[email protected]>
# Date 1325906230 -3600
# Node ID e12ec1071410c946367cb0508cf218a0c3b596ca # Parent 4086e4811547ddffb9a53fbf2efb6c2fa436b70a
build: add autoconf to replace custom checks in tools/check

Added autotools magic to replace custom check scripts. The previous checks have been ported to autoconf, and some additional ones have been added (plus the suggestions from running autoscan). Two files are created as a result from executing configure script, config/Autoconf.mk and config.h.

Autoconf.mk is included by Config.mk, and contains most of the options previously defined in .config, that can now be set passing parameters or defining environment variables when executing configure script.

config.h is still not used anywhere, and is automatically created by autoheader, altough this migh change when we start to include this file.

Just a first release, and since Iit's my first autoconf script I guess there will be many things to polish here... Please review and comment.

diff -r 4086e4811547 -r e12ec1071410 Config.mk

Config.mk realpath = $(wildcard $(foreach file,$(1 · line 13

Quoted 5 lines
Config.mk +0 -2
@@ -9,8 +9,6 @@ realpath = $(wildcard $(foreach file,$(1
 
 -include $(XEN_ROOT)/.config
 
-# A debug build of Xen and tools?
-debug ?= y

I think this should be kept here (possibly override-able by the autoconf determined setting, i.e. it may need moving past the inclusion below).

Config.mk endif · line 44

Quoted 8 lines
Config.mk +1 -0
 XEN_COMPILE_ARCH    ?= $(shell uname -m | sed -e s/i.86/x86_32/ \
                          -e s/i86pc/x86_32/ -e s/amd64/x86_64/)
@@ -43,6 +41,7 @@ endif
 
 include $(XEN_ROOT)/config/$(XEN_OS).mk
 include $(XEN_ROOT)/config/$(XEN_TARGET_ARCH).mk
+include $(XEN_ROOT)/config/Autoconf.mk

And I would really like to avoid having hypervisor (and perhaps also stubdom) builds to require running the autoconfig thing first - this ought to be limited to the tools (as were the check scripts).

Jan

Quoted 2 lines
Config.mk +0 -0
 SHAREDIR    ?= $(PREFIX)/share
 DOCDIR      ?= $(SHAREDIR)/doc/xen
#2 lore raw

2012/1/9 Jan Beulich <[email protected]>:

Quoted 46 lines
Quoted 35 lines
Quoted 1 line
Quoted 1 line · Roger Pau Monne

# HG changeset patch
# User Roger Pau Monne <[email protected]>
# Date 1325906230 -3600
# Node ID e12ec1071410c946367cb0508cf218a0c3b596ca # Parent  4086e4811547ddffb9a53fbf2efb6c2fa436b70a
build: add autoconf to replace custom checks in tools/check

Added autotools magic to replace custom check scripts. The previous checks have been ported to autoconf, and some additional ones have been added (plus the suggestions from running autoscan). Two files are created as a result from executing configure script, config/Autoconf.mk and config.h.

Autoconf.mk is included by Config.mk, and contains most of the options previously defined in .config, that can now be set passing parameters or defining environment variables when executing configure script.

config.h is still not used anywhere, and is automatically created by autoheader, altough this migh change when we start to include this file.

Just a first release, and since Iit's my first autoconf script I guess there will be many things to polish here... Please review and comment.

diff -r 4086e4811547 -r e12ec1071410 Config.mk

Config.mk       Sat Jan 07 04:17:10 2012 +0100 renamed from Config.mk       Thu Jan 05 17:25:23 2012 +0000 +0 -0
@@ -9,8 +9,6 @@ realpath = $(wildcard $(foreach file,$(1
 

 -include $(XEN_ROOT)/.config

Config.mk       Sat Jan 07 04:17:10 2012 +0100

Quoted 2 lines
Config.mk       Sat Jan 07 04:17:10 2012 +0100 renamed from Config.mk       Thu Jan 05 17:25:23 2012 +0000 +0 -2
-# A debug build of Xen and tools?
-debug ?= y

I think this should be kept here (possibly override-able by the autoconf determined setting, i.e. it may need moving past the inclusion below).

Quoted 5 lines

 XEN_COMPILE_ARCH    ?= $(shell uname -m | sed -e s/i.86/x86_32/ \
                          -e s/i86pc/x86_32/ -e s/amd64/x86_64/)

Config.mk       Sat Jan 07 04:17:10 2012 +0100 renamed from Config.mk       Thu Jan 05 17:25:23 2012 +0000 +0 -0
@@ -43,6 +41,7 @@ endif
 
Quoted 8 lines
Quoted 3 lines

 include $(XEN_ROOT)/config/$(XEN_OS).mk
 include $(XEN_ROOT)/config/$(XEN_TARGET_ARCH).mk
+include $(XEN_ROOT)/config/Autoconf.mk

And I would really like to avoid having hypervisor (and perhaps also stubdom) builds to require running the autoconfig thing first - this ought to be limited to the tools (as were the check scripts).

Doing something like this is probably more suitable:

tools/Makefile +1 -0
diff -r e12ec1071410 tools/Makefile
@@ -1,4 +1,5 @@
 XEN_ROOT = $(CURDIR)/..
+include $(XEN_ROOT)/config/Autoconf.mk
 include $(XEN_ROOT)/tools/Rules.mk
 
 ifneq ($(CONFIG_SYSTEM_LIBAIO),y)

Also, I'm having some trouble with automake, I just want it to generate config.sub and related files, but it keeps trying to parse Makefile.am, and I don't know how to disable that. Someone with experience on autotools can shed some light on this?

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#3 lore raw
Quoted 64 lines
Quoted 1 line
Quoted 1 line · Roger Pau Monné

2012/1/9 Jan Beulich <[email protected]>:

Quoted 46 lines
Quoted 32 lines
Quoted 1 line
Quoted 1 line · Roger Pau Monne

# HG changeset patch
# User Roger Pau Monne <[email protected]>
# Date 1325906230 -3600
# Node ID e12ec1071410c946367cb0508cf218a0c3b596ca # Parent 4086e4811547ddffb9a53fbf2efb6c2fa436b70a
build: add autoconf to replace custom checks in tools/check

Added autotools magic to replace custom check scripts. The previous checks have been ported to autoconf, and some additional ones have been added (plus the suggestions from running autoscan). Two files are created as a result from executing configure script, config/Autoconf.mk and config.h.

Autoconf.mk is included by Config.mk, and contains most of the options previously defined in .config, that can now be set passing parameters or defining environment variables when executing configure script.

config.h is still not used anywhere, and is automatically created by autoheader, altough this migh change when we start to include this file.

Just a first release, and since Iit's my first autoconf script I guess there will be many things to polish here... Please review and comment.

diff -r 4086e4811547 -r e12ec1071410 Config.mk

Config.mk Sat Jan 07 04:17:10 2012 +0100 realpath = $(wildcard $(foreach file,$(1 · line 13

Quoted 5 lines
Config.mk Sat Jan 07 04:17:10 2012 +0100 renamed from Config.mk Thu Jan 05 17:25:23 2012 +0000 +0 -2
@@ -9,8 +9,6 @@ realpath = $(wildcard $(foreach file,$(1
 
 -include $(XEN_ROOT)/.config
 
-# A debug build of Xen and tools?
-debug ?= y

I think this should be kept here (possibly override-able by the autoconf determined setting, i.e. it may need moving past the inclusion below).

Quoted 5 lines
Config.mk Sat Jan 07 04:17:10 2012 +0100 renamed from Config.mk Thu Jan 05 17:25:23 2012 +0000 +0 -0
 XEN_COMPILE_ARCH    ?= $(shell uname -m | sed -e s/i.86/x86_32/ \
                          -e s/i86pc/x86_32/ -e s/amd64/x86_64/)
@@ -43,6 +41,7 @@ endif
 
Quoted 8 lines

Config.mk Sat Jan 07 04:17:10 2012 +0100 endif · line 44

Quoted 3 lines
Config.mk Sat Jan 07 04:17:10 2012 +0100 renamed from Config.mk Thu Jan 05 17:25:23 2012 +0000 +1 -0
 include $(XEN_ROOT)/config/$(XEN_OS).mk
 include $(XEN_ROOT)/config/$(XEN_TARGET_ARCH).mk
+include $(XEN_ROOT)/config/Autoconf.mk

And I would really like to avoid having hypervisor (and perhaps also stubdom) builds to require running the autoconfig thing first - this ought to be limited to the tools (as were the check scripts).

Doing something like this is probably more suitable:

diff -r e12ec1071410 tools/Makefile

tools/Makefile line 5

Quoted 5 lines
tools/Makefile +1 -0
@@ -1,4 +1,5 @@
 XEN_ROOT = $(CURDIR)/..
+include $(XEN_ROOT)/config/Autoconf.mk
 include $(XEN_ROOT)/tools/Rules.mk
 
 ifneq ($(CONFIG_SYSTEM_LIBAIO),y)

Yes, please. Of course, the question then is whether it shouldn't really be tools/Autoconf.mk (and whether perhaps the whole set of new files should also be rooted under tools/ rather than at $(XEN_ROOT)/).

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#4 lore raw

2012/1/9 Jan Beulich <[email protected]>:

Quoted 68 lines
Quoted 68 lines
Quoted 1 line
Quoted 1 line · Roger Pau Monné

2012/1/9 Jan Beulich <[email protected]>:

Quoted 46 lines
Quoted 35 lines
Quoted 1 line
Quoted 1 line · Roger Pau Monne

# HG changeset patch
# User Roger Pau Monne <[email protected]>
# Date 1325906230 -3600
# Node ID e12ec1071410c946367cb0508cf218a0c3b596ca # Parent  4086e4811547ddffb9a53fbf2efb6c2fa436b70a
build: add autoconf to replace custom checks in tools/check

Added autotools magic to replace custom check scripts. The previous checks have been ported to autoconf, and some additional ones have been added (plus the suggestions from running autoscan). Two files are created as a result from executing configure script, config/Autoconf.mk and config.h.

Autoconf.mk is included by Config.mk, and contains most of the options previously defined in .config, that can now be set passing parameters or defining environment variables when executing configure script.

config.h is still not used anywhere, and is automatically created by autoheader, altough this migh change when we start to include this file.

Just a first release, and since Iit's my first autoconf script I guess there will be many things to polish here... Please review and comment.

diff -r 4086e4811547 -r e12ec1071410 Config.mk

Config.mk       Sat Jan 07 04:17:10 2012 +0100 renamed from Config.mk       Thu Jan 05 17:25:23 2012 +0000 +0 -0
@@ -9,8 +9,6 @@ realpath = $(wildcard $(foreach file,$(1
 

 -include $(XEN_ROOT)/.config

Config.mk       Sat Jan 07 04:17:10 2012 +0100

Quoted 2 lines
Config.mk       Sat Jan 07 04:17:10 2012 +0100 renamed from Config.mk       Thu Jan 05 17:25:23 2012 +0000 +0 -2
-# A debug build of Xen and tools?
-debug ?= y

I think this should be kept here (possibly override-able by the autoconf determined setting, i.e. it may need moving past the inclusion below).

Quoted 5 lines

 XEN_COMPILE_ARCH    ?= $(shell uname -m | sed -e s/i.86/x86_32/ \
                          -e s/i86pc/x86_32/ -e s/amd64/x86_64/)

Config.mk       Sat Jan 07 04:17:10 2012 +0100 renamed from Config.mk       Thu Jan 05 17:25:23 2012 +0000 +0 -0
@@ -43,6 +41,7 @@ endif
 
Quoted 8 lines
Quoted 3 lines

 include $(XEN_ROOT)/config/$(XEN_OS).mk
 include $(XEN_ROOT)/config/$(XEN_TARGET_ARCH).mk
+include $(XEN_ROOT)/config/Autoconf.mk

And I would really like to avoid having hypervisor (and perhaps also stubdom) builds to require running the autoconfig thing first - this ought to be limited to the tools (as were the check scripts).

Doing something like this is probably more suitable:

diff -r e12ec1071410 tools/Makefile

tools/Makefile  Sat Jan 07 06:46:55 2012 +0100 renamed from tools/Makefile  Sat Jan 07 04:17:10 2012 +0100 +0 -0
@@ -1,4 +1,5 @@

 XEN_ROOT = $(CURDIR)/..
+include $(XEN_ROOT)/config/Autoconf.mk
 include $(XEN_ROOT)/tools/Rules.mk

Quoted 6 lines
Quoted 1 line

 ifneq ($(CONFIG_SYSTEM_LIBAIO),y)

Yes, please. Of course, the question then is whether it shouldn't really be tools/Autoconf.mk (and whether perhaps the whole set of new files should also be rooted under tools/ rather than at $(XEN_ROOT)/).

I think it's more common to find a configure script in the root folder of the package rather than having to search for it under some folder. Also I prefer to rename config/Autoconf.mk to config/Tools.mk than to place it inside tools/.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#5 lore raw
Quoted 77 lines
Quoted 1 line
Quoted 1 line · Roger Pau Monné

2012/1/9 Jan Beulich <[email protected]>:

Quoted 68 lines
Quoted 68 lines
Quoted 1 line
Quoted 1 line · Roger Pau Monné

2012/1/9 Jan Beulich <[email protected]>:

Quoted 46 lines
Quoted 32 lines
Quoted 1 line
Quoted 1 line · Roger Pau Monne

# HG changeset patch
# User Roger Pau Monne <[email protected]>
# Date 1325906230 -3600
# Node ID e12ec1071410c946367cb0508cf218a0c3b596ca # Parent 4086e4811547ddffb9a53fbf2efb6c2fa436b70a
build: add autoconf to replace custom checks in tools/check

Added autotools magic to replace custom check scripts. The previous checks have been ported to autoconf, and some additional ones have been added (plus the suggestions from running autoscan). Two files are created as a result from executing configure script, config/Autoconf.mk and config.h.

Autoconf.mk is included by Config.mk, and contains most of the options previously defined in .config, that can now be set passing parameters or defining environment variables when executing configure script.

config.h is still not used anywhere, and is automatically created by autoheader, altough this migh change when we start to include this file.

Just a first release, and since Iit's my first autoconf script I guess there will be many things to polish here... Please review and comment.

diff -r 4086e4811547 -r e12ec1071410 Config.mk

Config.mk Sat Jan 07 04:17:10 2012 +0100 realpath = $(wildcard $(foreach file,$(1 · line 13

Quoted 5 lines
Config.mk Sat Jan 07 04:17:10 2012 +0100 renamed from Config.mk Thu Jan 05 17:25:23 2012 +0000 +0 -2
@@ -9,8 +9,6 @@ realpath = $(wildcard $(foreach file,$(1
 
 -include $(XEN_ROOT)/.config
 
-# A debug build of Xen and tools?
-debug ?= y

I think this should be kept here (possibly override-able by the autoconf determined setting, i.e. it may need moving past the inclusion below).

Quoted 5 lines
Config.mk Sat Jan 07 04:17:10 2012 +0100 renamed from Config.mk Thu Jan 05 17:25:23 2012 +0000 +0 -0
 XEN_COMPILE_ARCH    ?= $(shell uname -m | sed -e s/i.86/x86_32/ \
                          -e s/i86pc/x86_32/ -e s/amd64/x86_64/)
@@ -43,6 +41,7 @@ endif
 
Quoted 8 lines

Config.mk Sat Jan 07 04:17:10 2012 +0100 endif · line 44

Quoted 3 lines
Config.mk Sat Jan 07 04:17:10 2012 +0100 renamed from Config.mk Thu Jan 05 17:25:23 2012 +0000 +1 -0
 include $(XEN_ROOT)/config/$(XEN_OS).mk
 include $(XEN_ROOT)/config/$(XEN_TARGET_ARCH).mk
+include $(XEN_ROOT)/config/Autoconf.mk

And I would really like to avoid having hypervisor (and perhaps also stubdom) builds to require running the autoconfig thing first - this ought to be limited to the tools (as were the check scripts).

Doing something like this is probably more suitable:

diff -r e12ec1071410 tools/Makefile

tools/Makefile Sat Jan 07 06:46:55 2012 +0100 renamed from tools/Makefile Sat Jan 07 04:17:10 2012 +0100 +1 -0
@@ -1,4 +1,5 @@
 XEN_ROOT = $(CURDIR)/..
+include $(XEN_ROOT)/config/Autoconf.mk
 include $(XEN_ROOT)/tools/Rules.mk
 
Quoted 6 lines

tools/Makefile Sat Jan 07 06:46:55 2012 +0100 line 5

Quoted 1 line
tools/Makefile Sat Jan 07 06:46:55 2012 +0100 renamed from tools/Makefile Sat Jan 07 04:17:10 2012 +0100 +0 -0
 ifneq ($(CONFIG_SYSTEM_LIBAIO),y)

Yes, please. Of course, the question then is whether it shouldn't really be tools/Autoconf.mk (and whether perhaps the whole set of new files should also be rooted under tools/ rather than at $(XEN_ROOT)/).

Quoted 4 lines

I think it's more common to find a configure script in the root folder of the package rather than having to search for it under some folder. Also I prefer to rename config/Autoconf.mk to config/Tools.mk than to place it inside tools/.

Having a ./configure at the root is certainly fine, just that it should then be a simple wrapper around the individual subtree scripts (where they exist), just like the top level Makefile just controls the invocation of subtree makes.

Unless there is really meaningful sharing of configure determined data between subtrees, all of their subtree specific bits should reside in that subtree imo.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#6 lore raw
In reply to Roger Pau Monne
Quoted 18 lines · Roger Pau Monne

# HG changeset patch
# User Roger Pau Monne <[email protected]>
# Date 1325906230 -3600
# Node ID e12ec1071410c946367cb0508cf218a0c3b596ca # Parent 4086e4811547ddffb9a53fbf2efb6c2fa436b70a
build: add autoconf to replace custom checks in tools/check

Added autotools magic to replace custom check scripts. The previous checks have been ported to autoconf, and some additional ones have been added (plus the suggestions from running autoscan). Two files are created as a result from executing configure script, config/Autoconf.mk and config.h.

Autoconf.mk is included by Config.mk, and contains most of the options previously defined in .config, that can now be set passing parameters or defining environment variables when executing configure script.

Quoted 8 lines

config.h is still not used anywhere, and is automatically created by autoheader, altough this migh change when we start to include this file.

Just a first release, and since Iit's my first autoconf script I guess there will be many things to polish here... Please review and comment.

I would have expected to see an update to the clean/distclean rules and .hgignore due to all the new generated files.

README Sat Jan 07 04:17:10 2012 +0100 2. cd to xen-unstable (or whatever you s · line 90

Quoted 8 lines

diff -r 4086e4811547 -r e12ec1071410 README

README Sat Jan 07 04:17:10 2012 +0100 renamed from README Thu Jan 05 17:25:23 2012 +0000 +1 -0
@@ -87,9 +87,15 @@ 2. cd to xen-unstable (or whatever you s
 3. For the very first build, or if you want to destroy build trees,
    perform the following steps:
 
+    # automake -a

We aren't using automake though? Perhaps this explains your problem with things alwyas trying to use Makefile.am?

README Sat Jan 07 04:17:10 2012 +0100 2. cd to xen-unstable (or whatever you s · line 91

Quoted 1 line
README Sat Jan 07 04:17:10 2012 +0100 renamed from README Thu Jan 05 17:25:23 2012 +0000 +1 -0
+    # autoheader && autoconf

What does autoheader do? This should be clearly noted as being only necessary if building from hg and not if you are building from tarball. I expect we also need some makefile runes or process updates to make sure the generated stuff gets included in the tarball.

You need to add the relevant packages to the list of build requirements.

README Sat Jan 07 04:17:10 2012 +0100 2. cd to xen-unstable (or whatever you s · line 97

Quoted 6 lines
README Sat Jan 07 04:17:10 2012 +0100 renamed from README Thu Jan 05 17:25:23 2012 +0000 +3 -0
+    # ./configure
     # make world
     # make install
 
+   If you want, you can run ./configure --help to see the list of
+   optins available options when building and installing Xen.

options

Quoted 13 lines
README Sat Jan 07 04:17:10 2012 +0100 renamed from README Thu Jan 05 17:25:23 2012 +0000 +1 -0
+
    This will create and install onto the local machine. It will build
    the xen binary (xen.gz), the tools and the documentation.
 

diff -r 4086e4811547 -r e12ec1071410 config/Autoconf.mk.in

config/Autoconf.mk.in Sat Jan 07 04:17:10 2012 +0100 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +5 -0
@@ -0,0 +1,49 @@
+# Prefix and install folder
+PREFIX              := @prefix@
+LIBLEAFDIR_x86_64   := @LIB_PATH@
+
+# A debug build of Xen and tools?

config/Autoconf.mk.in Sat Jan 07 04:17:10 2012 +0100 line 15

Quoted 10 lines
config/Autoconf.mk.in Sat Jan 07 04:17:10 2012 +0100 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +10 -0
+debug               := @debug@
+
+# Tools path
+BISON               := @BISON@
+FLEX                := @FLEX@
+PYTHON              := @PYTHON@
+PERL                := @PERL@
+BRCTL               := @BRCTL@
+IP                  := @IP@
+CURL-CONFIG         := @CURL@

Are hyphens ok in make variables?

Quoted 38 lines
config/Autoconf.mk.in Sat Jan 07 04:17:10 2012 +0100 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +34 -0
+XML2-CONFIG         := @XML@
+BASH                := @BASH@
+XGETTTEXT           := @XGETTEXT@
+
+# Extra folder for libs/includes
+PREPEND_INCLUDES    := @PREPEND_INCLUDES@
+PREPEND_LIB         := @PREPEND_LIB@
+APPEND_INCLUDES     := @APPEND_INCLUDES@
+APPEND_LIB          := @APPEND_LIB@
+
+# Enable XSM security module (by default, Flask).
+XSM_ENABLE          := @xsm@
+FLASK_ENABLE        := @xsm@
+
+# Download GIT repositories via HTTP or GIT's own protocol?
+# GIT's protocol is faster and more robust, when it works at all (firewalls
+# may block it). We make it the default, but if your GIT repository downloads
+# fail or hang, please specify GIT_HTTP=y in your environment.
+GIT_HTTP            := @githttp@
+
+# Optional components
+XENSTAT_XENTOP      := @monitors@
+VTPM_TOOLS          := @vtpm@
+LIBXENAPI_BINDINGS  := @xapi@
+PYTHON_TOOLS        := @pythontools@
+OCAML_TOOLS         := @ocamltools@
+CONFIG_MINITERM     := @miniterm@
+CONFIG_LOMOUNT      := @lomount@
+
+#System options
+CONFIG_SYSTEM_LIBAIO:= @system_aio@
+CONFIG_LIBICONV     := @libiconv@
+CONFIG_GCRYPT       := @libgcrypt@
+CONFIG_EXT2FS       := @libext2fs@

diff -r 4086e4811547 -r e12ec1071410 configure.ac

configure.ac Sat Jan 07 04:17:10 2012 +0100 line 4

Quoted 4 lines
configure.ac Sat Jan 07 04:17:10 2012 +0100 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +4 -0
@@ -0,0 +1,179 @@
+#                                               -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ([2.67])

This is the version in Debian stable which is my rule of thumb for how far back to support things as a minimum.

However do we rely on features of 2.67 or could we go older if someone has an older version?

configure.ac Sat Jan 07 04:17:10 2012 +0100 line 5

Quoted 1 line
configure.ac Sat Jan 07 04:17:10 2012 +0100 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +1 -0
+AC_INIT([Xen Hypervisor], [4.2], [[email protected]])

Ideally the 4.2 would not be duplicated both here and in xen/Makefile. I'm not sure how this can be resolved without conflicting with Jan's (quite reasonable) desire not to need ./configure for the hypervisor.

I suppose it must be possible via the magic of m4 to pull out the version from the Makefile and include it here.

I didn't review all the tests in detail, I presume we'll end up having to find a bunch of those errors via testing anywhere.

Does the set of tests here precisely equal those currently done by tools/check (or elsewhere) or did you add more as you went? It might have been better for review to present this as a basic infrastructure patch, the conversion of each test individually as a patch each and lastly any new tests etc so we could easily review. But I think it's a bit late now and there's no point splitting this patch up now you've got it.

Quoted 22 lines
configure.ac Sat Jan 07 04:17:10 2012 +0100 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +22 -0
+AC_CONFIG_SRCDIR([tools/libxl/libxl.c])
+AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_FILES([config/Autoconf.mk])
+AC_PREFIX_DEFAULT([/usr])
+
+# Check if CFLAGS, LDFLAGS, LIBS, CPPFLAGS or CPP is set and print a warning
+
+AS_IF([test -n "$CC$CFLAGS$LDFLAGS$LIBS$CPPFLAGS$CPP"], [
+    AC_MSG_WARN(
+[Setting CC, CFLAGS, LDFLAGS, LIBS, CPPFLAGS or CPP is not \
+recommended, use PREPEND_INCLUDES, PREPEND_LIB, \
+APPEND_INCLUDES and APPEND_LIB instead when possible.])
+])
+
+AC_USE_SYSTEM_EXTENSIONS
+AC_CANONICAL_HOST
+
+# M4 Macro includes
+m4_include([m4/enable_feature.m4])
+m4_include([m4/disable_feature.m4])
+m4_include([m4/path_or_fail.m4])
+m4_include([m4/python_xml.m4])

configure.ac Sat Jan 07 04:17:10 2012 +0100 line 37

Quoted 10 lines
configure.ac Sat Jan 07 04:17:10 2012 +0100 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +10 -0
+m4_include([m4/python_version.m4])
+m4_include([m4/python_devel.m4])
+m4_include([m4/udev.m4])
+m4_include([m4/ocaml.m4])
+m4_include([m4/default_lib.m4])
+m4_include([m4/set_cflags_ldflags.m4])
+
+# Enable/disable options
+AX_ARG_ENABLE_AND_EXPORT([xsm],
+    [Enable XSM security module (by default, Flask)])

Does this macro include support for reading from config.cache as well as the cmdline option?

[...]

configure.ac Sat Jan 07 04:17:10 2012 +0100 line 41

Quoted 4 lines
configure.ac Sat Jan 07 04:17:10 2012 +0100 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +4 -0
+AS_IF([test "x$ocamltools" = "xy"], [
+    AC_PROG_OCAML
+    AS_IF([test "x$OCAMLC" = "xno"], [
+      AC_MSG_ERROR([You must install the OCaml compiler])

ocaml was previously optional, I think.

[...]

Quoted 9 lines
configure.ac Sat Jan 07 04:17:10 2012 +0100 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +9 -0
+
+# Checks for header files.
+AC_FUNC_ALLOCA
+AC_CHECK_HEADERS([ \
+                arpa/inet.h fcntl.h inttypes.h libintl.h limits.h malloc.h \
+                netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h \
+                strings.h sys/file.h sys/ioctl.h sys/mount.h sys/param.h \
+                sys/socket.h sys/statvfs.h sys/time.h syslog.h termios.h \
+                unistd.h yajl/yajl_version.h \

configure.ac Sat Jan 07 04:17:10 2012 +0100 line 60

Quoted 10 lines
configure.ac Sat Jan 07 04:17:10 2012 +0100 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +10 -0
+                ])
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_HEADER_STDBOOL
+AC_TYPE_UID_T
+AC_C_INLINE
+AC_TYPE_INT16_T
+AC_TYPE_INT32_T
+AC_TYPE_INT64_T
+AC_TYPE_INT8_T

There's no AC_TYPE_STDINT or similar?

configure.ac Sat Jan 07 04:17:10 2012 +0100 line 66

Quoted 6 lines
configure.ac Sat Jan 07 04:17:10 2012 +0100 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +6 -0
+AC_TYPE_MODE_T
+AC_TYPE_OFF_T
+AC_TYPE_PID_T
+AC_C_RESTRICT
+AC_TYPE_SIZE_T
+AC_TYPE_SSIZE_T

Is there not some umbrella test for these sorts of very standard things, e.g. AC_POSIX or something like that?

Quoted 36 lines
configure.ac Sat Jan 07 04:17:10 2012 +0100 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +32 -0
+AC_CHECK_MEMBERS([struct stat.st_blksize])
+AC_STRUCT_ST_BLOCKS
+AC_CHECK_MEMBERS([struct stat.st_rdev])
+AC_TYPE_UINT16_T
+AC_TYPE_UINT32_T
+AC_TYPE_UINT64_T
+AC_TYPE_UINT8_T
+AC_CHECK_TYPES([ptrdiff_t])
+
+# Checks for library functions.
+AC_FUNC_ERROR_AT_LINE
+AC_FUNC_FORK
+AC_FUNC_FSEEKO
+AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
+AC_HEADER_MAJOR
+AC_FUNC_MALLOC
+AC_FUNC_MKTIME
+AC_FUNC_MMAP
+AC_FUNC_REALLOC
+AC_FUNC_STRNLEN
+AC_FUNC_STRTOD
+AC_CHECK_FUNCS([ \
+                alarm atexit bzero clock_gettime dup2 fdatasync ftruncate \
+                getcwd gethostbyname gethostname getpagesize gettimeofday \
+                inet_ntoa isascii localtime_r memchr memmove memset mkdir \
+                mkfifo munmap pathconf realpath regcomp rmdir select setenv \
+                socket strcasecmp strchr strcspn strdup strerror strndup \
+                strpbrk strrchr strspn strstr strtol strtoul strtoull tzset \
+                uname \
+                ])
+
+AC_OUTPUT()

diff -r 4086e4811547 -r e12ec1071410 m4/default_lib.m4

m4/default_lib.m4 Sat Jan 07 04:17:10 2012 +0100 line 7

Quoted 7 lines
m4/default_lib.m4 Sat Jan 07 04:17:10 2012 +0100 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +7 -0
@@ -0,0 +1,7 @@
+AC_DEFUN([AX_DEFAULT_LIB],
+[AS_IF([test -d "$prefix/lib64"], [
+    LIB_PATH="lib64"
+],[
+    LIB_PATH="lib"
+])
+AC_SUBST(LIB_PATH)])

Does this get exposed via config.cache and/or the command line? It should be.

Did you write m4/* from scratch or did they come from some snippet library?

Isn't the management of these snippets the sort of thing aclocal does for you?

Quoted 1 line

\ No newline at end of file

Might this newline be significant in a macro expansion library? I think it's good practice to include it anyway (here and elsewhere).

[...]

m4/ocaml.m4 Sat Jan 07 04:17:10 2012 +0100 line 1

Quoted 5 lines

diff -r 4086e4811547 -r e12ec1071410 m4/ocaml.m4

m4/ocaml.m4 Sat Jan 07 04:17:10 2012 +0100 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +1 -0
@@ -0,0 +1,240 @@
+dnl autoconf macros for OCaml

Please add a comment describing where this came from so we know how to update in the future.

Shouldn't/couldn't this be provided by the ocaml packages and just included by us?

[...]

Ian.

#7 lore raw

2012/1/9 Ian Campbell <[email protected]>:

Quoted 23 lines · Roger Pau Monne
Quoted 22 lines

# HG changeset patch
# User Roger Pau Monne <[email protected]>
# Date 1325906230 -3600
# Node ID e12ec1071410c946367cb0508cf218a0c3b596ca # Parent  4086e4811547ddffb9a53fbf2efb6c2fa436b70a
build: add autoconf to replace custom checks in tools/check

Added autotools magic to replace custom check scripts. The previous checks have been ported to autoconf, and some additional ones have been added (plus the suggestions from running autoscan). Two files are created as a result from executing configure script, config/Autoconf.mk and config.h.

Autoconf.mk is included by Config.mk, and contains most of the options previously defined in .config, that can now be set passing parameters or defining environment variables when executing configure script.

config.h is still not used anywhere, and is automatically created by autoheader, altough this migh change when we start to include this file.

Quoted 7 lines
Quoted 4 lines

Just a first release, and since Iit's my first autoconf script I guess there will be many things to polish here... Please review and comment.

I would have expected to see an update to the clean/distclean rules and .hgignore due to all the new generated files.

Yes, I was going to do that when we agree on were should things reside, that's why I didn't include any of this on the patch.

Quoted 7 lines
Quoted 7 lines

diff -r 4086e4811547 -r e12ec1071410 README

README    Sat Jan 07 04:17:10 2012 +0100 renamed from README    Thu Jan 05 17:25:23 2012 +0000 +0 -0
@@ -87,9 +87,15 @@ 2. cd to xen-unstable (or whatever you s
  3. For the very first build, or if you want to destroy build trees,

    perform the following steps:

This will be like:

# aclocal && automake -a
Quoted 4 lines
Quoted 1 line

+    # automake -a

We aren't using automake though? Perhaps this explains your problem with things alwyas trying to use Makefile.am?

We need to run automake, because it generates config.sub and config.guess, which is needed for certain autoconf tests. The problem is that I don't know how to call automake to only generate those files and don't try to parse Makefile.am, because automake tries to parse Makefile.am and exits with an error code, that's also preventing me from using autoreconf and forget about calling aclocal, automake, autoheader... separately. I was hoping that some autotools expert has a solution for this (I will keep searching also).

Quoted 6 lines
Quoted 1 line

+    # autoheader && autoconf

What does autoheader do? This should be clearly noted as being only necessary if building from hg and not if you are building from tarball. I expect we also need some makefile runes or process updates to make sure the generated stuff gets included in the tarball.

autoheader creates a generic config.h.in which contains defines for all the exported variables. We could create our own config.h.in and don't run autoheader, but I think the generated file is fine.

Quoted 2 lines

You need to add the relevant packages to the list of build requirements.

Ok, will make a list

Quoted 8 lines
Quoted 6 lines

+    # ./configure

     # make world
     # make install

+   If you want, you can run ./configure --help to see the list of
+   optins available options when building and installing Xen.

     options

Also Ok when we decide the definitive options.

Quoted 17 lines
Quoted 17 lines

+
    This will create and install onto the local machine. It will build the xen binary (xen.gz), the tools and the documentation.

diff -r 4086e4811547 -r e12ec1071410 config/Autoconf.mk.in

config/Autoconf.mk.in     Sat Jan 07 04:17:10 2012 +0100 renamed from dev/null   Thu Jan 01 00:00:00 1970 +0000 +9 -0
@@ -0,0 +1,49 @@
+# Prefix and install folder
+PREFIX              := @prefix@
+LIBLEAFDIR_x86_64   := @LIB_PATH@
+
+# A debug build of Xen and tools?
+debug               := @debug@
+
+# Tools path
+BISON               := @BISON@
Quoted 8 lines

config/Autoconf.mk.in     Sat Jan 07 04:17:10 2012 +0100 line 15

Quoted 6 lines
config/Autoconf.mk.in     Sat Jan 07 04:17:10 2012 +0100 renamed from dev/null   Thu Jan 01 00:00:00 1970 +0000 +6 -0
+FLEX                := @FLEX@
+PYTHON              := @PYTHON@
+PERL                := @PERL@
+BRCTL               := @BRCTL@
+IP                  := @IP@
+CURL-CONFIG         := @CURL@

Are hyphens ok in make variables?

Looks like, but I will replace them with underscores (_) to be on the safe side.

Quoted 47 lines
Quoted 39 lines
config/Autoconf.mk.in     Sat Jan 07 04:17:10 2012 +0100 renamed from dev/null   Thu Jan 01 00:00:00 1970 +0000 +34 -0
+XML2-CONFIG         := @XML@
+BASH                := @BASH@
+XGETTTEXT           := @XGETTEXT@
+
+# Extra folder for libs/includes
+PREPEND_INCLUDES    := @PREPEND_INCLUDES@
+PREPEND_LIB         := @PREPEND_LIB@
+APPEND_INCLUDES     := @APPEND_INCLUDES@
+APPEND_LIB          := @APPEND_LIB@
+
+# Enable XSM security module (by default, Flask).
+XSM_ENABLE          := @xsm@
+FLASK_ENABLE        := @xsm@
+
+# Download GIT repositories via HTTP or GIT's own protocol?
+# GIT's protocol is faster and more robust, when it works at all (firewalls
+# may block it). We make it the default, but if your GIT repository downloads
+# fail or hang, please specify GIT_HTTP=y in your environment.
+GIT_HTTP            := @githttp@
+
+# Optional components
+XENSTAT_XENTOP      := @monitors@
+VTPM_TOOLS          := @vtpm@
+LIBXENAPI_BINDINGS  := @xapi@
+PYTHON_TOOLS        := @pythontools@
+OCAML_TOOLS         := @ocamltools@
+CONFIG_MINITERM     := @miniterm@
+CONFIG_LOMOUNT      := @lomount@
+
+#System options
+CONFIG_SYSTEM_LIBAIO:= @system_aio@
+CONFIG_LIBICONV     := @libiconv@
+CONFIG_GCRYPT       := @libgcrypt@
+CONFIG_EXT2FS       := @libext2fs@

diff -r 4086e4811547 -r e12ec1071410 configure.ac

configure.ac      Sat Jan 07 04:17:10 2012 +0100 line 4

Quoted 4 lines
configure.ac      Sat Jan 07 04:17:10 2012 +0100 renamed from dev/null   Thu Jan 01 00:00:00 1970 +0000 +4 -0
@@ -0,0 +1,179 @@
+#                                               -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ([2.67])

This is the version in Debian stable which is my rule of thumb for how far back to support things as a minimum.

Quoted 2 lines

However do we rely on features of 2.67 or could we go older if someone has an older version?

AC_PREREQ is automatically set by autoscan based on the used version. I've generated this with 2.68, and changed the AC_PREREQ to 2.67 because I knew that you where going to check debian stable version. I've tested this under 2.67 with Debian and it works fine, but I don't know about older versions.

Quoted 8 lines

configure.ac      Sat Jan 07 04:17:10 2012 +0100 line 5

Quoted 1 line
configure.ac      Sat Jan 07 04:17:10 2012 +0100 renamed from dev/null   Thu Jan 01 00:00:00 1970 +0000 +1 -0
+AC_INIT([Xen Hypervisor], [4.2], [[email protected]])

Ideally the 4.2 would not be duplicated both here and in xen/Makefile. I'm not sure how this can be resolved without conflicting with Jan's (quite reasonable) desire not to need ./configure for the hypervisor.

I suppose it must be possible via the magic of m4 to pull out the version from the Makefile and include it here.

Probably with some m4 and shell scripting

Quoted 5 lines

I didn't review all the tests in detail, I presume we'll end up having to find a bunch of those errors via testing anywhere.

Does the set of tests here precisely equal those currently done by tools/check (or elsewhere) or did you add more as you went?

I've moved all tools/check, and added a test for libiconv and yajl/yajl_version.h.

Quoted 6 lines

It might
have been better for review to present this as a basic infrastructure patch, the conversion of each test individually as a patch each and lastly any new tests etc so we could easily review. But I think it's a bit late now and there's no point splitting this patch up now you've got it.

Each test has it's own m4 file inside m4/, if it's really difficult to understand (m4 is not easy for the eye, although I tried to follow libxl CODING_STYLE), I will split it up in several patches (one for each m4/ and one for the rest of the autotools infrastructure).

Quoted 28 lines
Quoted 28 lines
configure.ac      Sat Jan 07 04:17:10 2012 +0100 renamed from dev/null   Thu Jan 01 00:00:00 1970 +0000 +27 -0
+AC_CONFIG_SRCDIR([tools/libxl/libxl.c])
+AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_FILES([config/Autoconf.mk])
+AC_PREFIX_DEFAULT([/usr])
+
+# Check if CFLAGS, LDFLAGS, LIBS, CPPFLAGS or CPP is set and print a warning
+
+AS_IF([test -n "$CC$CFLAGS$LDFLAGS$LIBS$CPPFLAGS$CPP"], [
+    AC_MSG_WARN(
+[Setting CC, CFLAGS, LDFLAGS, LIBS, CPPFLAGS or CPP is not \
+recommended, use PREPEND_INCLUDES, PREPEND_LIB, \
+APPEND_INCLUDES and APPEND_LIB instead when possible.])
+])
+
+AC_USE_SYSTEM_EXTENSIONS
+AC_CANONICAL_HOST
+
+# M4 Macro includes
+m4_include([m4/enable_feature.m4])
+m4_include([m4/disable_feature.m4])
+m4_include([m4/path_or_fail.m4])
+m4_include([m4/python_xml.m4])
+m4_include([m4/python_version.m4])
+m4_include([m4/python_devel.m4])
+m4_include([m4/udev.m4])
+m4_include([m4/ocaml.m4])
+m4_include([m4/default_lib.m4])
Quoted 8 lines

configure.ac      Sat Jan 07 04:17:10 2012 +0100 line 37

Quoted 5 lines
configure.ac      Sat Jan 07 04:17:10 2012 +0100 renamed from dev/null   Thu Jan 01 00:00:00 1970 +0000 +5 -0
+m4_include([m4/set_cflags_ldflags.m4])
+
+# Enable/disable options
+AX_ARG_ENABLE_AND_EXPORT([xsm],
+    [Enable XSM security module (by default, Flask)])

Does this macro include support for reading from config.cache as well as the cmdline option?

They weren't but I've added support and they are cached now (provided that you run configure with --config-cache).

Quoted 8 lines

[...]

Quoted 4 lines

+AS_IF([test "x$ocamltools" = "xy"], [
+    AC_PROG_OCAML
+    AS_IF([test "x$OCAMLC" = "xno"], [
+      AC_MSG_ERROR([You must install the OCaml compiler])

ocaml was previously optional, I think.

Ok, I will set to disabled by default then.

Quoted 15 lines

[...]

Quoted 13 lines
configure.ac      Sat Jan 07 04:17:10 2012 +0100 renamed from dev/null   Thu Jan 01 00:00:00 1970 +0000 +13 -0
+
+# Checks for header files.
+AC_FUNC_ALLOCA
+AC_CHECK_HEADERS([ \
+                arpa/inet.h fcntl.h inttypes.h libintl.h limits.h malloc.h \
+                netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h \
+                strings.h sys/file.h sys/ioctl.h sys/mount.h sys/param.h \
+                sys/socket.h sys/statvfs.h sys/time.h syslog.h termios.h \
+                unistd.h yajl/yajl_version.h \
+                ])
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_HEADER_STDBOOL
Quoted 8 lines

configure.ac      Sat Jan 07 04:17:10 2012 +0100

Quoted 6 lines
configure.ac      Sat Jan 07 04:17:10 2012 +0100 renamed from dev/null   Thu Jan 01 00:00:00 1970 +0000 +6 -0
+AC_TYPE_UID_T
+AC_C_INLINE
+AC_TYPE_INT16_T
+AC_TYPE_INT32_T
+AC_TYPE_INT64_T
+AC_TYPE_INT8_T

There's no AC_TYPE_STDINT or similar?

This was automatically done by autoscan, and I've tried searching for something like AC_TYPE_STDINT, but I haven't been able to find anything. If you want I can bundle the INT checks inside a macro called AX_TYPE_STDINT.

Quoted 10 lines

configure.ac      Sat Jan 07 04:17:10 2012 +0100

Quoted 7 lines
configure.ac      Sat Jan 07 04:17:10 2012 +0100 renamed from dev/null   Thu Jan 01 00:00:00 1970 +0000 +6 -0
+AC_TYPE_MODE_T
+AC_TYPE_OFF_T
+AC_TYPE_PID_T
+AC_C_RESTRICT
+AC_TYPE_SIZE_T
+AC_TYPE_SSIZE_T

Is there not some umbrella test for these sorts of very standard things, e.g. AC_POSIX or something like that?

Again, the same as above.

Quoted 48 lines
Quoted 37 lines
configure.ac      Sat Jan 07 04:17:10 2012 +0100 renamed from dev/null   Thu Jan 01 00:00:00 1970 +0000 +32 -0
+AC_CHECK_MEMBERS([struct stat.st_blksize])
+AC_STRUCT_ST_BLOCKS
+AC_CHECK_MEMBERS([struct stat.st_rdev])
+AC_TYPE_UINT16_T
+AC_TYPE_UINT32_T
+AC_TYPE_UINT64_T
+AC_TYPE_UINT8_T
+AC_CHECK_TYPES([ptrdiff_t])
+
+# Checks for library functions.
+AC_FUNC_ERROR_AT_LINE
+AC_FUNC_FORK
+AC_FUNC_FSEEKO
+AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
+AC_HEADER_MAJOR
+AC_FUNC_MALLOC
+AC_FUNC_MKTIME
+AC_FUNC_MMAP
+AC_FUNC_REALLOC
+AC_FUNC_STRNLEN
+AC_FUNC_STRTOD
+AC_CHECK_FUNCS([ \
+                alarm atexit bzero clock_gettime dup2 fdatasync ftruncate \
+                getcwd gethostbyname gethostname getpagesize gettimeofday \
+                inet_ntoa isascii localtime_r memchr memmove memset mkdir \
+                mkfifo munmap pathconf realpath regcomp rmdir select setenv \
+                socket strcasecmp strchr strcspn strdup strerror strndup \
+                strpbrk strrchr strspn strstr strtol strtoul strtoull tzset \
+                uname \
+                ])
+
+AC_OUTPUT()

diff -r 4086e4811547 -r e12ec1071410 m4/default_lib.m4

m4/default_lib.m4 Sat Jan 07 04:17:10 2012 +0100 line 7

Quoted 7 lines
m4/default_lib.m4 Sat Jan 07 04:17:10 2012 +0100 renamed from dev/null   Thu Jan 01 00:00:00 1970 +0000 +7 -0
@@ -0,0 +1,7 @@
+AC_DEFUN([AX_DEFAULT_LIB],
+[AS_IF([test -d "$prefix/lib64"], [
+    LIB_PATH="lib64"
+],[
+    LIB_PATH="lib"
+])
+AC_SUBST(LIB_PATH)])

Does this get exposed via config.cache and/or the command line? It should be.

Quoted 2 lines

Did you write m4/* from scratch or did they come from some snippet library?

The only one that comes from a library is ocaml.m4, the other ones are hand-written. Most are translations of tools/check/check_*, and the rest are a couple of handful macros that avoid repeating code blocks all over.

Quoted 3 lines

Isn't the management of these snippets the sort of thing aclocal does for you?

aclocal just scans configure.ac and concatenates all necessary macros into aclocal.m4, I've tried to use all the predefined macros I could, and most of the files inside m4/* are just wrappers to make configure.ac cleaner and easier to understand.

Quoted 5 lines
Quoted 2 lines

\ No newline at end of file

Might this newline be significant in a macro expansion library? I think it's good practice to include it anyway (here and elsewhere).

Yup, I've forgot.

Quoted 11 lines

[...]

m4/ocaml.m4       Sat Jan 07 04:17:10 2012 +0100 line 1

Quoted 5 lines

diff -r 4086e4811547 -r e12ec1071410 m4/ocaml.m4

m4/ocaml.m4       Sat Jan 07 04:17:10 2012 +0100 renamed from dev/null   Thu Jan 01 00:00:00 1970 +0000 +1 -0
@@ -0,0 +1,240 @@
+dnl autoconf macros for OCaml

Please add a comment describing where this came from so we know how to update in the future.

Quoted 2 lines

Shouldn't/couldn't this be provided by the ocaml packages and just included by us?

This comes from http://forge.ocamlcore.org/, and the manpage states that:

"To begin using these macros, you will need to copy the ocaml.m4 file (usually located at /usr/share/aclocal/ocaml.m4) to the autoconf macros directory in your project. Normally this is the m4/ directory in your project, but the directory can be changed using the AC_CONFIG_MACRO_DIR(DIR) directive."

That's why I copied it to m4/

Quoted 5 lines

[...]

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#8 lore raw
Quoted 27 lines · Roger Pau Monné

2012/1/9 Ian Campbell <[email protected]>:

Quoted 26 lines · Roger Pau Monne
Quoted 25 lines

# HG changeset patch
# User Roger Pau Monne <[email protected]>
# Date 1325906230 -3600
# Node ID e12ec1071410c946367cb0508cf218a0c3b596ca # Parent 4086e4811547ddffb9a53fbf2efb6c2fa436b70a
build: add autoconf to replace custom checks in tools/check

Added autotools magic to replace custom check scripts. The previous checks have been ported to autoconf, and some additional ones have been added (plus the suggestions from running autoscan). Two files are created as a result from executing configure script, config/Autoconf.mk and config.h.

Autoconf.mk is included by Config.mk, and contains most of the options previously defined in .config, that can now be set passing parameters or defining environment variables when executing configure script.

config.h is still not used anywhere, and is automatically created by autoheader, altough this migh change when we start to include this file.

Just a first release, and since Iit's my first autoconf script I guess there will be many things to polish here... Please review and comment.

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

I would have expected to see an update to the clean/distclean rules and .hgignore due to all the new generated files.

Yes, I was going to do that when we agree on were should things reside, that's why I didn't include any of this on the patch.

OK

Quoted 17 lines
Quoted 7 lines

README Sat Jan 07 04:17:10 2012 +0100 2. cd to xen-unstable (or whatever you s · line 89

Quoted 7 lines

diff -r 4086e4811547 -r e12ec1071410 README

README Sat Jan 07 04:17:10 2012 +0100 renamed from README Thu Jan 05 17:25:23 2012 +0000 +0 -0
@@ -87,9 +87,15 @@ 2. cd to xen-unstable (or whatever you s
 3. For the very first build, or if you want to destroy build trees,
    perform the following steps:
 

This will be like:

# aclocal && automake -a
Quoted 4 lines

README Sat Jan 07 04:17:10 2012 +0100 2. cd to xen-unstable (or whatever you s · line 90

Quoted 1 line
README Sat Jan 07 04:17:10 2012 +0100 renamed from README Thu Jan 05 17:25:23 2012 +0000 +1 -0
+    # automake -a

We aren't using automake though? Perhaps this explains your problem with things alwyas trying to use Makefile.am?

Quoted 8 lines

We need to run automake, because it generates config.sub and config.guess, which is needed for certain autoconf tests. The problem is that I don't know how to call automake to only generate those files and don't try to parse Makefile.am, because automake tries to parse Makefile.am and exits with an error code, that's also preventing me from using autoreconf and forget about calling aclocal, automake, autoheader... separately. I was hoping that some autotools expert has a solution for this (I will keep searching also).

I'm afraid I don't know the answer to this. It seems like it should be obvious that we shouldn't be running automake unless we want to use automake, but with auto* who knows what goes on ;-).

[...]

Quoted 10 lines
Quoted 8 lines

README Sat Jan 07 04:17:10 2012 +0100 2. cd to xen-unstable (or whatever you s · line 96

Quoted 6 lines
README Sat Jan 07 04:17:10 2012 +0100 renamed from README Thu Jan 05 17:25:23 2012 +0000 +3 -0
+    # ./configure
     # make world
     # make install
 
+   If you want, you can run ./configure --help to see the list of
+   optins available options when building and installing Xen.

options

Also Ok when we decide the definitive options.

I was pointing out the typo "optins".

Quoted 47 lines
Quoted 47 lines
Quoted 39 lines
README Sat Jan 07 04:17:10 2012 +0100 renamed from README Thu Jan 05 17:25:23 2012 +0000 +34 -0
+XML2-CONFIG         := @XML@
+BASH                := @BASH@
+XGETTTEXT           := @XGETTEXT@
+
+# Extra folder for libs/includes
+PREPEND_INCLUDES    := @PREPEND_INCLUDES@
+PREPEND_LIB         := @PREPEND_LIB@
+APPEND_INCLUDES     := @APPEND_INCLUDES@
+APPEND_LIB          := @APPEND_LIB@
+
+# Enable XSM security module (by default, Flask).
+XSM_ENABLE          := @xsm@
+FLASK_ENABLE        := @xsm@
+
+# Download GIT repositories via HTTP or GIT's own protocol?
+# GIT's protocol is faster and more robust, when it works at all (firewalls
+# may block it). We make it the default, but if your GIT repository downloads
+# fail or hang, please specify GIT_HTTP=y in your environment.
+GIT_HTTP            := @githttp@
+
+# Optional components
+XENSTAT_XENTOP      := @monitors@
+VTPM_TOOLS          := @vtpm@
+LIBXENAPI_BINDINGS  := @xapi@
+PYTHON_TOOLS        := @pythontools@
+OCAML_TOOLS         := @ocamltools@
+CONFIG_MINITERM     := @miniterm@
+CONFIG_LOMOUNT      := @lomount@
+
+#System options
+CONFIG_SYSTEM_LIBAIO:= @system_aio@
+CONFIG_LIBICONV     := @libiconv@
+CONFIG_GCRYPT       := @libgcrypt@
+CONFIG_EXT2FS       := @libext2fs@

diff -r 4086e4811547 -r e12ec1071410 configure.ac

configure.ac Sat Jan 07 04:17:10 2012 +0100 line 4

Quoted 4 lines
configure.ac Sat Jan 07 04:17:10 2012 +0100 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +4 -0
@@ -0,0 +1,179 @@
+#                                               -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ([2.67])

This is the version in Debian stable which is my rule of thumb for how far back to support things as a minimum.

Quoted 8 lines
Quoted 2 lines

However do we rely on features of 2.67 or could we go older if someone has an older version?

AC_PREREQ is automatically set by autoscan based on the used version. I've generated this with 2.68, and changed the AC_PREREQ to 2.67 because I knew that you where going to check debian stable version. I've tested this under 2.67 with Debian and it works fine, but I don't know about older versions.

I think we can fault them in as testers report issues.

[...]

Quoted 8 lines
Quoted 5 lines

I didn't review all the tests in detail, I presume we'll end up having to find a bunch of those errors via testing anywhere.

Does the set of tests here precisely equal those currently done by tools/check (or elsewhere) or did you add more as you went?

I've moved all tools/check, and added a test for libiconv and yajl/yajl_version.h.

There seems to be a lot more tests in the configure.ac than there ever were under tools/check though? All sorts of headers and function checks etc. Did they come from autoscan? (autoscan is new to me...)

Quoted 11 lines
Quoted 6 lines

It might
have been better for review to present this as a basic infrastructure patch, the conversion of each test individually as a patch each and lastly any new tests etc so we could easily review. But I think it's a bit late now and there's no point splitting this patch up now you've got it.

Each test has it's own m4 file inside m4/, if it's really difficult to understand (m4 is not easy for the eye, although I tried to follow libxl CODING_STYLE), I will split it up in several patches (one for each m4/ and one for the rest of the autotools infrastructure).

I guess most of the stuff was from autoscan can't logically be split up, so don't worry.

Quoted 9 lines
Quoted 7 lines

[...]

configure.ac Sat Jan 07 04:17:10 2012 +0100

Quoted 4 lines
configure.ac Sat Jan 07 04:17:10 2012 +0100 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +4 -0
+AS_IF([test "x$ocamltools" = "xy"], [
+    AC_PROG_OCAML
+    AS_IF([test "x$OCAMLC" = "xno"], [
+      AC_MSG_ERROR([You must install the OCaml compiler])

ocaml was previously optional, I think.

Ok, I will set to disabled by default then.

By default it should be enabled if the necessary bits are present and disabled otherwise.

[...]

Quoted 6 lines
Quoted 1 line

There's no AC_TYPE_STDINT or similar?

This was automatically done by autoscan, and I've tried searching for something like AC_TYPE_STDINT, but I haven't been able to find anything. If you want I can bundle the INT checks inside a macro called AX_TYPE_STDINT.

[...]

Quoted 4 lines
Quoted 2 lines

Is there not some umbrella test for these sorts of very standard things, e.g. AC_POSIX or something like that?

Again, the same as above.

Lets just leave it then.

Quoted 7 lines
Quoted 2 lines

Isn't the management of these snippets the sort of thing aclocal does for you?

aclocal just scans configure.ac and concatenates all necessary macros into aclocal.m4, I've tried to use all the predefined macros I could, and most of the files inside m4/* are just wrappers to make configure.ac cleaner and easier to understand.

OK.

Quoted 15 lines
Quoted 10 lines

[...]

m4/ocaml.m4 Sat Jan 07 04:17:10 2012 +0100 line 1

Quoted 5 lines

diff -r 4086e4811547 -r e12ec1071410 m4/ocaml.m4

m4/ocaml.m4 Sat Jan 07 04:17:10 2012 +0100 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +1 -0
@@ -0,0 +1,240 @@
+dnl autoconf macros for OCaml

Please add a comment describing where this came from so we know how to update in the future.

Quoted 2 lines

Shouldn't/couldn't this be provided by the ocaml packages and just included by us?

This comes from http://forge.ocamlcore.org/, and the manpage states that:

Quoted 7 lines

"To begin using these macros, you will need to copy the ocaml.m4 file (usually located at /usr/share/aclocal/ocaml.m4) to the autoconf macros directory in your project. Normally this is the m4/ directory in your project, but the directory can be changed using the AC_CONFIG_MACRO_DIR(DIR) directive."

That's why I copied it to m4/

Fair enough!

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#9 lore raw
In reply to Roger Pau Monné

Roger Pau Monné writes ("Re: [Xen-devel] [PATCH RFC] build: add autoconf to replace custom checks in tools/check"):

Quoted 2 lines

We need to run automake, because it generates config.sub and config.guess, which is needed for certain autoconf tests.

config.sub and config.guess are fixed files which you can just copy into your source tree. They should be in our hg.

Ian.

#10 lore raw
In reply to Ian Campbell

Ian Campbell writes ("Re: [Xen-devel] [PATCH RFC] build: add autoconf to replace custom checks in tools/check"):

Quoted 7 lines · Roger Pau Monne
Quoted 1 line

+ # autoheader && autoconf

What does autoheader do? This should be clearly noted as being only necessary if building from hg and not if you are building from tarball. I expect we also need some makefile runes or process updates to make sure the generated stuff gets included in the tarball.

autoheader generates config.h.in, which is processed by configure to make config.h.

I think the output of autoconf and autoheader should be committed to the hg tree. It only needs to be rerun when we change the set of things we test for, add features, etc. And it is not very portable.

Ian.