# Note this list must be in dependency order.
OBJECTS = \
- config.cmx \
- throbber.cmx \
- utils.cmx \
- cmdline.cmx \
- deviceSet.cmx \
- slave_types.cmx \
- slave_utils.cmx \
- slave.cmx \
- filetree_type.cmx \
- filetree_markup.cmx \
- filetree_ops.cmx \
- filetree.cmx \
- window.cmx \
- main.cmx
+ config.cmo \
+ throbber.cmo \
+ utils.cmo \
+ cmdline.cmo \
+ deviceSet.cmo \
+ slave_types.cmo \
+ slave_utils.cmo \
+ slave.cmo \
+ filetree_type.cmo \
+ filetree_markup.cmo \
+ filetree_ops.cmo \
+ filetree.cmo \
+ window.cmo \
+ main.cmo
+
+XOBJECTS = $(OBJECTS:.cmo=.cmx)
bin_SCRIPTS = guestfs-browser
-I +threads \
-sort -html
-guestfs-browser: $(OBJECTS)
+if HAVE_OCAMLOPT
+guestfs-browser: $(XOBJECTS)
$(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) \
-predicates init,threads \
-linkpkg gtkThread.cmx \
$^ -o $@
+else
+guestfs-browser: $(OBJECTS)
+ $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) \
+ -predicates init,threads \
+ -linkpkg gtkThread.cmo \
+ $^ -o $@
+endif
# This file is built. However gdk_pixbuf_mlsource requires X11 to
# run, which prevents this from being built in places where an X
dnl Check for OCaml compiler.
AC_PROG_OCAML
-if test "$OCAMLOPT" = "no"; then
- AC_MSG_ERROR([You must install the OCaml native compiler (ocamlopt)])
+if test "$OCAMLC" = "no"; then
+ AC_MSG_ERROR([You must install the OCaml compiler (ocamlc or ocamlopt)])
fi
+dnl Choose native code if available, but allow the user to specify
+dnl bytecode only (useful for debugging).
+AC_ARG_WITH([native],
+ [AS_HELP_STRING([--without-native],
+ [disable native compilation (slow, but useful for debugging)])],
+ [],
+ [with_native=yes])
+AM_CONDITIONAL([HAVE_OCAMLOPT],
+ [test "x$with_native" != "xno" && test "x$OCAMLBEST" = "xopt"])
+
dnl Check for OCaml findlib.
AC_PROG_FINDLIB
if test "$OCAMLFIND" = "no"; then