From: Ian Jackson <ian.jackson@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: Julien Grall <Julien.Grall@arm.com>,
Stefano Stabellini <sstabellini@kernel.org>,
Ian Jackson <Ian.Jackson@eu.citrix.com>,
David Scott <dave@recoil.org>
Subject: [PATCH 1/2] ocaml: Copy up-to-date m4/ocaml.m4 from forge.ocamlcore
Date: Fri, 20 Jan 2017 15:46:41 +0000 [thread overview]
Message-ID: <1484927202-28014-2-git-send-email-ian.jackson@eu.citrix.com> (raw)
In-Reply-To: <1484927202-28014-1-git-send-email-ian.jackson@eu.citrix.com>
From
https://forge.ocamlcore.org/anonscm/git/ocaml-autoconf/ocaml-autoconf.git
commit id a20a590beb523fb64bf087b52a883cf628256d2f
Copy ocaml.m4, and also LICENSE to m4/ocaml.m4.LICENSE. (This is a
permissive licence and thus compatible with the licence of Xen.)
We mostly want this because in this version OCAMLC is set to ocamlopt
where available, or ocamlc otherwise.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
m4/ocaml.m4 | 96 ++++++++++++++++++++++++++++++-----------------------
m4/ocaml.m4.LICENSE | 29 ++++++++++++++++
2 files changed, 83 insertions(+), 42 deletions(-)
create mode 100644 m4/ocaml.m4.LICENSE
diff --git a/m4/ocaml.m4 b/m4/ocaml.m4
index b067ee9..1d3b657 100644
--- a/m4/ocaml.m4
+++ b/m4/ocaml.m4
@@ -1,6 +1,6 @@
dnl autoconf macros for OCaml
-dnl from http://forge.ocamlcore.org/
dnl
+dnl Copyright © 2013 Gabriel Kerneis
dnl Copyright © 2009 Richard W.M. Jones
dnl Copyright © 2009 Stefano Zacchiroli
dnl Copyright © 2000-2005 Olivier Andrieu
@@ -19,7 +19,7 @@ AC_DEFUN([AC_PROG_OCAML],
AC_MSG_RESULT([OCaml version is $OCAMLVERSION])
# If OCAMLLIB is set, use it
if test "$OCAMLLIB" = ""; then
- OCAMLLIB=`$OCAMLC -where 2>/dev/null || $OCAMLC -v|tail -1|cut -d ' ' -f 4`
+ OCAMLLIB=`$OCAMLC -where 2>/dev/null | tr -d '\015' || $OCAMLC -v|tail -1|cut -d ' ' -f 4`
else
AC_MSG_RESULT([OCAMLLIB previously set; preserving it.])
fi
@@ -32,15 +32,15 @@ AC_DEFUN([AC_PROG_OCAML],
AC_CHECK_TOOL([OCAMLOPT],[ocamlopt],[no])
OCAMLBEST=byte
if test "$OCAMLOPT" = "no"; then
- AC_MSG_WARN([Cannot find ocamlopt; bytecode compilation only.])
+ AC_MSG_WARN([Cannot find ocamlopt; bytecode compilation only.])
else
- TMPVERSION=`$OCAMLOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
- if test "$TMPVERSION" != "$OCAMLVERSION" ; then
- AC_MSG_RESULT([versions differs from ocamlc; ocamlopt discarded.])
- OCAMLOPT=no
- else
- OCAMLBEST=opt
- fi
+ TMPVERSION=`$OCAMLOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
+ if test "$TMPVERSION" != "$OCAMLVERSION" ; then
+ AC_MSG_RESULT([versions differs from ocamlc; ocamlopt discarded.])
+ OCAMLOPT=no
+ else
+ OCAMLBEST=opt
+ fi
fi
AC_SUBST([OCAMLBEST])
@@ -48,25 +48,25 @@ AC_DEFUN([AC_PROG_OCAML],
# checking for ocamlc.opt
AC_CHECK_TOOL([OCAMLCDOTOPT],[ocamlc.opt],[no])
if test "$OCAMLCDOTOPT" != "no"; then
- TMPVERSION=`$OCAMLCDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
- if test "$TMPVERSION" != "$OCAMLVERSION" ; then
- AC_MSG_RESULT([versions differs from ocamlc; ocamlc.opt discarded.])
- else
- OCAMLC=$OCAMLCDOTOPT
- fi
+ TMPVERSION=`$OCAMLCDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
+ if test "$TMPVERSION" != "$OCAMLVERSION" ; then
+ AC_MSG_RESULT([versions differs from ocamlc; ocamlc.opt discarded.])
+ else
+ OCAMLC=$OCAMLCDOTOPT
+ fi
fi
# checking for ocamlopt.opt
if test "$OCAMLOPT" != "no" ; then
- AC_CHECK_TOOL([OCAMLOPTDOTOPT],[ocamlopt.opt],[no])
- if test "$OCAMLOPTDOTOPT" != "no"; then
- TMPVERSION=`$OCAMLOPTDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
- if test "$TMPVERSION" != "$OCAMLVERSION" ; then
- AC_MSG_RESULT([version differs from ocamlc; ocamlopt.opt discarded.])
- else
- OCAMLOPT=$OCAMLOPTDOTOPT
- fi
- fi
+ AC_CHECK_TOOL([OCAMLOPTDOTOPT],[ocamlopt.opt],[no])
+ if test "$OCAMLOPTDOTOPT" != "no"; then
+ TMPVERSION=`$OCAMLOPTDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
+ if test "$TMPVERSION" != "$OCAMLVERSION" ; then
+ AC_MSG_RESULT([version differs from ocamlc; ocamlopt.opt discarded.])
+ else
+ OCAMLOPT=$OCAMLOPTDOTOPT
+ fi
+ fi
fi
AC_SUBST([OCAMLOPT])
@@ -74,6 +74,18 @@ AC_DEFUN([AC_PROG_OCAML],
AC_SUBST([OCAMLC])
+ # checking for native dynlink
+ AC_MSG_CHECKING([for dynlink.cmxa])
+ if test -f "$OCAMLLIB/dynlink.cmxa" ; then
+ OCAMLNATDYNLINK=yes
+ AC_MSG_RESULT([yes])
+ else
+ OCAMLNATDYNLINK=no
+ AC_MSG_RESULT([no])
+ fi
+
+ AC_SUBST([OCAMLNATDYNLINK])
+
# checking for ocaml toplevel
AC_CHECK_TOOL([OCAML],[ocaml],[no])
@@ -99,10 +111,10 @@ AC_DEFUN([AC_PROG_OCAMLLEX],
# checking for ocamllex
AC_CHECK_TOOL([OCAMLLEX],[ocamllex],[no])
if test "$OCAMLLEX" != "no"; then
- AC_CHECK_TOOL([OCAMLLEXDOTOPT],[ocamllex.opt],[no])
- if test "$OCAMLLEXDOTOPT" != "no"; then
- OCAMLLEX=$OCAMLLEXDOTOPT
- fi
+ AC_CHECK_TOOL([OCAMLLEXDOTOPT],[ocamllex.opt],[no])
+ if test "$OCAMLLEXDOTOPT" != "no"; then
+ OCAMLLEX=$OCAMLLEXDOTOPT
+ fi
fi
AC_SUBST([OCAMLLEX])
])
@@ -123,7 +135,7 @@ AC_DEFUN([AC_PROG_CAMLP4],
if test "$CAMLP4" != "no"; then
TMPVERSION=`$CAMLP4 -v 2>&1| sed -n -e 's|.*version *\(.*\)$|\1|p'`
if test "$TMPVERSION" != "$OCAMLVERSION" ; then
- AC_MSG_RESULT([versions differs from ocamlc])
+ AC_MSG_RESULT([versions differs from ocamlc])
CAMLP4=no
fi
fi
@@ -173,15 +185,15 @@ AC_DEFUN([AC_CHECK_OCAML_PKG],
found=no
for pkg in $1 $2 ; do
if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then
- AC_MSG_RESULT([found])
- AS_TR_SH([OCAML_PKG_$1])=$pkg
- found=yes
- break
+ AC_MSG_RESULT([found])
+ AS_TR_SH([OCAML_PKG_$1])=$pkg
+ found=yes
+ break
fi
done
if test "$found" = "no" ; then
- AC_MSG_RESULT([not found])
- AS_TR_SH([OCAML_PKG_$1])=no
+ AC_MSG_RESULT([not found])
+ AS_TR_SH([OCAML_PKG_$1])=no
fi
AC_SUBST(AS_TR_SH([OCAML_PKG_$1]))
@@ -198,16 +210,16 @@ EOF
unset found
for $1 in $$1 $4 ; do
if $OCAMLC -c -I "$$1" conftest.ml >&5 2>&5 ; then
- found=yes
- break
+ found=yes
+ break
fi
done
if test "$found" ; then
- AC_MSG_RESULT([$$1])
+ AC_MSG_RESULT([$$1])
else
- AC_MSG_RESULT([not found])
- $1=no
+ AC_MSG_RESULT([not found])
+ $1=no
fi
AC_SUBST([$1])
])
@@ -220,7 +232,7 @@ AC_DEFUN([AC_CHECK_OCAML_WORD_SIZE],
AC_MSG_CHECKING([for OCaml compiler word size])
cat > conftest.ml <<EOF
print_endline (string_of_int Sys.word_size)
- EOF
+EOF
OCAML_WORD_SIZE=`$OCAML conftest.ml`
AC_MSG_RESULT([$OCAML_WORD_SIZE])
AC_SUBST([OCAML_WORD_SIZE])
diff --git a/m4/ocaml.m4.LICENSE b/m4/ocaml.m4.LICENSE
new file mode 100644
index 0000000..d4d3d16
--- /dev/null
+++ b/m4/ocaml.m4.LICENSE
@@ -0,0 +1,29 @@
+Copyright © 2013 Gabriel Kerneis
+Copyright © 2009 Richard W.M. Jones
+Copyright © 2009 Stefano Zacchiroli
+Copyright © 2000-2005 Olivier Andrieu
+Copyright © 2000-2005 Jean-Christophe Filliâtre
+Copyright © 2000-2005 Georges Mariano
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions and the following disclaimer in the documentation
+and/or other materials provided with the distribution.
+* The names of the contributors may not be used to endorse or promote
+products derived from this software without specific prior written
+permission.
+
+THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ''AS IS'' AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-01-20 15:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-20 15:46 [PATCH 0/2] ocaml: Start on fixing brokenness when no ocamlopt Ian Jackson
2017-01-20 15:46 ` Ian Jackson [this message]
2017-01-20 15:46 ` [PATCH 2/2] ocaml: Substitute tools/ocaml/common.make with configure Ian Jackson
2017-01-24 11:35 ` [PATCH 0/2] ocaml: Start on fixing brokenness when no ocamlopt Ian Jackson
2017-01-24 22:19 ` David Scott
2017-02-08 19:50 ` Julien Grall
2017-02-14 14:18 ` Julien Grall
2017-02-14 14:36 ` Julien Grall
[not found] ` <81966962-3dc6-88e7-054d-185ed5c35eab@arm.com>
[not found] ` <D4E716C2.34027%lars.kurth@citrix.com>
2017-03-30 14:40 ` ARM64 hardware in osstest (WAS: [PATCH 0/2] ocaml: Start on fixing brokenness when no ocamlopt) Ian Jackson
2017-03-30 15:17 ` Christian Lindig
2017-04-03 10:16 ` Julien Grall
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1484927202-28014-2-git-send-email-ian.jackson@eu.citrix.com \
--to=ian.jackson@eu.citrix.com \
--cc=Julien.Grall@arm.com \
--cc=dave@recoil.org \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).