aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlaf Hering <olaf@aepfle.de>2013-02-05 11:31:11 +0000
committerOlaf Hering <olaf@aepfle.de>2013-02-05 11:31:11 +0000
commita2a9b63b48a0f3440929cad1d60c691900430c3d (patch)
treeca864d2b64a33ef63275935121c402b083fbbd93
parentc23e8e7d5082cbf68611135af24d4a8ec38cb708 (diff)
downloadxen-a2a9b63b48a0f3440929cad1d60c691900430c3d.tar.gz
xen-a2a9b63b48a0f3440929cad1d60c691900430c3d.tar.bz2
xen-a2a9b63b48a0f3440929cad1d60c691900430c3d.zip
tools: update ocamlfind handling
configure checks just for ocamlc, but the tools in tools/ocaml depend also on ocamlfind. On my workstation I have just ocamlc installed, but no ocamlfind. As a result make will fail. Update configure.ac to check also for OCAMLFIND, update various Makefiles and replace hardcoded ocamlfind string with $(OCAMLFIND) Please rerun autogen.sh after applying this patch. Signed-off-by: Olaf Hering <olaf@aepfle.de> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
-rwxr-xr-xtools/configure99
-rw-r--r--tools/configure.ac3
-rw-r--r--tools/ocaml/common.make3
-rw-r--r--tools/ocaml/libs/eventchn/Makefile6
-rw-r--r--tools/ocaml/libs/mmap/Makefile6
-rw-r--r--tools/ocaml/libs/xb/Makefile6
-rw-r--r--tools/ocaml/libs/xc/Makefile6
-rw-r--r--tools/ocaml/libs/xl/Makefile6
-rw-r--r--tools/ocaml/libs/xs/Makefile6
9 files changed, 120 insertions, 21 deletions
diff --git a/tools/configure b/tools/configure
index 898dd17809..66d588a1f8 100755
--- a/tools/configure
+++ b/tools/configure
@@ -620,6 +620,7 @@ GREP
CPP
pyconfig
PYTHONPATH
+OCAMLFIND
OCAMLBUILD
OCAMLDOC
OCAMLMKLIB
@@ -4796,7 +4797,103 @@ else
fi
- if test "x$OCAMLC" = "xno"; then :
+
+ # checking for ocamlfind
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ocamlfind", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlfind; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_OCAMLFIND+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OCAMLFIND"; then
+ ac_cv_prog_OCAMLFIND="$OCAMLFIND" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_OCAMLFIND="${ac_tool_prefix}ocamlfind"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLFIND=$ac_cv_prog_OCAMLFIND
+if test -n "$OCAMLFIND"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLFIND" >&5
+$as_echo "$OCAMLFIND" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLFIND"; then
+ ac_ct_OCAMLFIND=$OCAMLFIND
+ # Extract the first word of "ocamlfind", so it can be a program name with args.
+set dummy ocamlfind; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_OCAMLFIND+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OCAMLFIND"; then
+ ac_cv_prog_ac_ct_OCAMLFIND="$ac_ct_OCAMLFIND" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_OCAMLFIND="ocamlfind"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLFIND=$ac_cv_prog_ac_ct_OCAMLFIND
+if test -n "$ac_ct_OCAMLFIND"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLFIND" >&5
+$as_echo "$ac_ct_OCAMLFIND" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OCAMLFIND" = x; then
+ OCAMLFIND="no"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OCAMLFIND=$ac_ct_OCAMLFIND
+ fi
+else
+ OCAMLFIND="$ac_cv_prog_OCAMLFIND"
+fi
+
+
+
+ if test "x$OCAMLC" = "xno" || test "x$OCAMLFIND" = "xno"; then :
if test "x$enable_ocamltools" = "xyes"; then :
diff --git a/tools/configure.ac b/tools/configure.ac
index 2bd71b6adc..de5d085974 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -86,7 +86,8 @@ AS_IF([test "x$xapi" = "xy"], [
])
AS_IF([test "x$ocamltools" = "xy"], [
AC_PROG_OCAML
- AS_IF([test "x$OCAMLC" = "xno"], [
+ AC_PROG_FINDLIB
+ AS_IF([test "x$OCAMLC" = "xno" || test "x$OCAMLFIND" = "xno"], [
AS_IF([test "x$enable_ocamltools" = "xyes"], [
AC_MSG_ERROR([Ocaml tools enabled, but unable to find Ocaml])])
ocamltools="n"
diff --git a/tools/ocaml/common.make b/tools/ocaml/common.make
index 949433faba..d5478f626f 100644
--- a/tools/ocaml/common.make
+++ b/tools/ocaml/common.make
@@ -7,6 +7,7 @@ OCAMLMKLIB ?= ocamlmklib
OCAMLDEP ?= ocamldep
OCAMLLEX ?= ocamllex
OCAMLYACC ?= ocamlyacc
+OCAMLFIND ?= ocamlfind
CFLAGS += -fPIC -Werror -I$(shell ocamlc -where)
@@ -16,6 +17,6 @@ OCAMLCFLAGS += -g $(OCAMLINCLUDE) -w F -warn-error F
VERSION := 4.1
-OCAMLDESTDIR ?= $(DESTDIR)$(shell ocamlfind printconf destdir)
+OCAMLDESTDIR ?= $(DESTDIR)$(shell $(OCAMLFIND) printconf destdir)
o= >$@.new && mv -f $@.new $@
diff --git a/tools/ocaml/libs/eventchn/Makefile b/tools/ocaml/libs/eventchn/Makefile
index 2eb50dc8d5..2d8d6184df 100644
--- a/tools/ocaml/libs/eventchn/Makefile
+++ b/tools/ocaml/libs/eventchn/Makefile
@@ -24,12 +24,12 @@ OCAML_LIBRARY = xeneventchn
.PHONY: install
install: $(LIBS) META
mkdir -p $(OCAMLDESTDIR)
- ocamlfind remove -destdir $(OCAMLDESTDIR) xeneventchn
- ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore xeneventchn META $(INTF) $(LIBS) *.a *.so *.cmx
+ $(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xeneventchn
+ $(OCAMLFIND) install -destdir $(OCAMLDESTDIR) -ldconf ignore xeneventchn META $(INTF) $(LIBS) *.a *.so *.cmx
.PHONY: uninstall
uninstall:
- ocamlfind remove -destdir $(OCAMLDESTDIR) xeneventchn
+ $(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xeneventchn
include $(TOPLEVEL)/Makefile.rules
diff --git a/tools/ocaml/libs/mmap/Makefile b/tools/ocaml/libs/mmap/Makefile
index c131948c95..df45819df5 100644
--- a/tools/ocaml/libs/mmap/Makefile
+++ b/tools/ocaml/libs/mmap/Makefile
@@ -19,12 +19,12 @@ OCAML_LIBRARY = xenmmap
.PHONY: install
install: $(LIBS) META
mkdir -p $(OCAMLDESTDIR)
- ocamlfind remove -destdir $(OCAMLDESTDIR) xenmmap
- ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore xenmmap META $(INTF) $(LIBS) *.a *.so *.cmx
+ $(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xenmmap
+ $(OCAMLFIND) install -destdir $(OCAMLDESTDIR) -ldconf ignore xenmmap META $(INTF) $(LIBS) *.a *.so *.cmx
.PHONY: uninstall
uninstall:
- ocamlfind remove -destdir $(OCAMLDESTDIR) xenmmap
+ $(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xenmmap
include $(TOPLEVEL)/Makefile.rules
diff --git a/tools/ocaml/libs/xb/Makefile b/tools/ocaml/libs/xb/Makefile
index 35f23438d0..62ffefb666 100644
--- a/tools/ocaml/libs/xb/Makefile
+++ b/tools/ocaml/libs/xb/Makefile
@@ -45,11 +45,11 @@ xenbus.cmo : $(foreach obj, $(OBJS), $(obj).cmo)
.PHONY: install
install: $(LIBS) META
mkdir -p $(OCAMLDESTDIR)
- ocamlfind remove -destdir $(OCAMLDESTDIR) xenbus
- ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore xenbus META $(LIBS) xenbus.cmo xenbus.cmi xenbus.cmx *.a *.so
+ $(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xenbus
+ $(OCAMLFIND) install -destdir $(OCAMLDESTDIR) -ldconf ignore xenbus META $(LIBS) xenbus.cmo xenbus.cmi xenbus.cmx *.a *.so
.PHONY: uninstall
uninstall:
- ocamlfind remove -destdir $(OCAMLDESTDIR) xenbus
+ $(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xenbus
include $(TOPLEVEL)/Makefile.rules
diff --git a/tools/ocaml/libs/xc/Makefile b/tools/ocaml/libs/xc/Makefile
index b59b8dfb54..239c1878fe 100644
--- a/tools/ocaml/libs/xc/Makefile
+++ b/tools/ocaml/libs/xc/Makefile
@@ -23,11 +23,11 @@ libs: $(LIBS)
.PHONY: install
install: $(LIBS) META
mkdir -p $(OCAMLDESTDIR)
- ocamlfind remove -destdir $(OCAMLDESTDIR) xenctrl
- ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore xenctrl META $(INTF) $(LIBS) *.a *.so *.cmx
+ $(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xenctrl
+ $(OCAMLFIND) install -destdir $(OCAMLDESTDIR) -ldconf ignore xenctrl META $(INTF) $(LIBS) *.a *.so *.cmx
.PHONY: uninstall
uninstall:
- ocamlfind remove -destdir $(OCAMLDESTDIR) xenctrl
+ $(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xenctrl
include $(TOPLEVEL)/Makefile.rules
diff --git a/tools/ocaml/libs/xl/Makefile b/tools/ocaml/libs/xl/Makefile
index fe75abb582..c9e5274ea4 100644
--- a/tools/ocaml/libs/xl/Makefile
+++ b/tools/ocaml/libs/xl/Makefile
@@ -56,11 +56,11 @@ libs: $(LIBS)
.PHONY: install
install: $(LIBS) META
mkdir -p $(OCAMLDESTDIR)
- ocamlfind remove -destdir $(OCAMLDESTDIR) xenlight
- ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore xenlight META $(INTF) $(LIBS) *.a *.so *.cmx
+ $(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xenlight
+ $(OCAMLFIND) install -destdir $(OCAMLDESTDIR) -ldconf ignore xenlight META $(INTF) $(LIBS) *.a *.so *.cmx
.PHONY: uninstall
uninstall:
- ocamlfind remove -destdir $(OCAMLDESTDIR) xenlight
+ $(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xenlight
include $(TOPLEVEL)/Makefile.rules
diff --git a/tools/ocaml/libs/xs/Makefile b/tools/ocaml/libs/xs/Makefile
index 2913cae878..7a3d886d7b 100644
--- a/tools/ocaml/libs/xs/Makefile
+++ b/tools/ocaml/libs/xs/Makefile
@@ -36,12 +36,12 @@ xenstore.cmo : $(foreach obj, $(OBJS), $(obj).cmo)
.PHONY: install
install: $(LIBS) META
mkdir -p $(OCAMLDESTDIR)
- ocamlfind remove -destdir $(OCAMLDESTDIR) xenstore
- ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore xenstore META $(LIBS) xenstore.cmo xenstore.cmi xenstore.cmx *.a
+ $(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xenstore
+ $(OCAMLFIND) install -destdir $(OCAMLDESTDIR) -ldconf ignore xenstore META $(LIBS) xenstore.cmo xenstore.cmi xenstore.cmx *.a
.PHONY: uninstall
uninstall:
- ocamlfind remove -destdir $(OCAMLDESTDIR) xenstore
+ $(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xenstore
include $(TOPLEVEL)/Makefile.rules