Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update ocaml-autoconf macro from upstream

  • Loading branch information...
commit a084d92bec22c03d1ba15441bb03a8999aa6d581 1 parent ed0a3d0
@kerneis kerneis authored
Showing with 98 additions and 69 deletions.
  1. +44 −28 configure
  2. +54 −41 m4/ocaml.m4
View
72 configure
@@ -648,6 +648,7 @@ OCAMLMKLIB
OCAMLMKTOP
OCAMLDEP
OCAML
+OCAMLNATDYNLINK
OCAMLOPTDOTOPT
OCAMLCDOTOPT
OCAMLBEST
@@ -3379,7 +3380,7 @@ fi
$as_echo "OCaml version is $OCAMLVERSION" >&6; }
# 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
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: OCAMLLIB previously set; preserving it." >&5
$as_echo "OCAMLLIB previously set; preserving it." >&6; }
@@ -3485,17 +3486,17 @@ fi
OCAMLBEST=byte
if test "$OCAMLOPT" = "no"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find ocamlopt; bytecode compilation only." >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find ocamlopt; bytecode compilation only." >&5
$as_echo "$as_me: WARNING: Cannot find ocamlopt; bytecode compilation only." >&2;}
else
- TMPVERSION=`$OCAMLOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
- if test "$TMPVERSION" != "$OCAMLVERSION" ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: versions differs from ocamlc; ocamlopt discarded." >&5
+ TMPVERSION=`$OCAMLOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
+ if test "$TMPVERSION" != "$OCAMLVERSION" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: versions differs from ocamlc; ocamlopt discarded." >&5
$as_echo "versions differs from ocamlc; ocamlopt discarded." >&6; }
- OCAMLOPT=no
- else
- OCAMLBEST=opt
- fi
+ OCAMLOPT=no
+ else
+ OCAMLBEST=opt
+ fi
fi
@@ -3594,18 +3595,18 @@ else
fi
if test "$OCAMLCDOTOPT" != "no"; then
- TMPVERSION=`$OCAMLCDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
- if test "$TMPVERSION" != "$OCAMLVERSION" ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: versions differs from ocamlc; ocamlc.opt discarded." >&5
+ TMPVERSION=`$OCAMLCDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
+ if test "$TMPVERSION" != "$OCAMLVERSION" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: versions differs from ocamlc; ocamlc.opt discarded." >&5
$as_echo "versions differs from ocamlc; ocamlc.opt discarded." >&6; }
- else
- OCAMLC=$OCAMLCDOTOPT
- fi
+ else
+ OCAMLC=$OCAMLCDOTOPT
+ fi
fi
# checking for ocamlopt.opt
if test "$OCAMLOPT" != "no" ; then
- if test -n "$ac_tool_prefix"; then
+ if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}ocamlopt.opt", so it can be a program name with args.
set dummy ${ac_tool_prefix}ocamlopt.opt; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -3697,15 +3698,15 @@ else
OCAMLOPTDOTOPT="$ac_cv_prog_OCAMLOPTDOTOPT"
fi
- if test "$OCAMLOPTDOTOPT" != "no"; then
- TMPVERSION=`$OCAMLOPTDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
- if test "$TMPVERSION" != "$OCAMLVERSION" ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: version differs from ocamlc; ocamlopt.opt discarded." >&5
+ if test "$OCAMLOPTDOTOPT" != "no"; then
+ TMPVERSION=`$OCAMLOPTDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
+ if test "$TMPVERSION" != "$OCAMLVERSION" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: version differs from ocamlc; ocamlopt.opt discarded." >&5
$as_echo "version differs from ocamlc; ocamlopt.opt discarded." >&6; }
- else
- OCAMLOPT=$OCAMLOPTDOTOPT
- fi
- fi
+ else
+ OCAMLOPT=$OCAMLOPTDOTOPT
+ fi
+ fi
fi
@@ -3713,6 +3714,21 @@ $as_echo "version differs from ocamlc; ocamlopt.opt discarded." >&6; }
+ # checking for native dynlink
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dynlink.cmxa" >&5
+$as_echo_n "checking for dynlink.cmxa... " >&6; }
+ if test -f "$OCAMLLIB/dynlink.cmxa" ; then
+ OCAMLNATDYNLINK=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ else
+ OCAMLNATDYNLINK=no
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ fi
+
+
+
# checking for ocaml toplevel
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}ocaml", so it can be a program name with args.
@@ -4379,7 +4395,7 @@ else
fi
if test "$OCAMLLEX" != "no"; then
- if test -n "$ac_tool_prefix"; then
+ if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}ocamllex.opt", so it can be a program name with args.
set dummy ${ac_tool_prefix}ocamllex.opt; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -4471,9 +4487,9 @@ else
OCAMLLEXDOTOPT="$ac_cv_prog_OCAMLLEXDOTOPT"
fi
- if test "$OCAMLLEXDOTOPT" != "no"; then
- OCAMLLEX=$OCAMLLEXDOTOPT
- fi
+ if test "$OCAMLLEXDOTOPT" != "no"; then
+ OCAMLLEX=$OCAMLLEXDOTOPT
+ fi
fi
View
95 m4/ocaml.m4
@@ -1,5 +1,6 @@
dnl autoconf macros for OCaml
dnl
+dnl Copyright © 2013 Gabriel Kerneis
dnl Copyright © 2009 Richard W.M. Jones
dnl Copyright © 2009 Stefano Zacchiroli
dnl Copyright © 2000-2005 Olivier Andrieu
@@ -18,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
@@ -31,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])
@@ -47,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])
@@ -73,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])
@@ -98,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])
])
@@ -122,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
@@ -172,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]))
@@ -197,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])
])
@@ -219,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])
Please sign in to comment.
Something went wrong with that request. Please try again.