]> matita.cs.unibo.it Git - helm.git/commitdiff
detects and uses {ocamlc,ocamlopt}.opt when available
authorStefano Zacchiroli <zack@upsilon.cc>
Wed, 21 Apr 2004 17:46:17 +0000 (17:46 +0000)
committerStefano Zacchiroli <zack@upsilon.cc>
Wed, 21 Apr 2004 17:46:17 +0000 (17:46 +0000)
helm/gTopLevel/Makefile.in
helm/gTopLevel/configure.ac

index 402813f91e157a08a5e929fd28769dafd5e31713..4c3138a39201e02f8dd26d1e29a837c652147dea 100644 (file)
@@ -17,7 +17,7 @@ REQUIRES = $(TEST_REQUIRES) gdome2-xslt helm-hbugs
 PREDICATES = "gnome,init,glade"
 OCAMLOPTIONS = \
        -package "$(REQUIRES)" -predicates "$(PREDICATES)" -pp camlp4o -thread
-OCAMLFIND = ocamlfind
+OCAMLFIND = @OCAMLFIND@
 OCAMLDEBUGOPTIONS = -g
 OCAMLC = $(OCAMLFIND) ocamlc $(OCAMLDEBUGOPTIONS) $(OCAMLOPTIONS)
 OCAMLOPT = $(OCAMLFIND) ocamlopt $(OCAMLOPTIONS)
index fa5e4034110bce3b23f8181b4e102015ea0e4234..2cddc9dbed4004cdcb28b09eba877e14c09bcdd2 100644 (file)
@@ -1,5 +1,33 @@
 AC_INIT(gTopLevel.ml)
 
+AC_CHECK_PROG(HAVE_OCAMLFIND, ocamlfind, yes, no)
+if test $HAVE_OCAMLFIND = "yes"; then
+  OCAMLFIND="ocamlfind"
+else
+  AC_MSG_ERROR(could not find ocamlfind)
+fi
+OCAMLFIND_COMMANDS=""
+AC_CHECK_PROG(HAVE_OCAMLC_OPT, ocamlc.opt, yes, no)
+if test $HAVE_OCAMLC_OPT = "yes"; then
+  if test "$OCAMLFIND_COMMANDS" = ""; then
+    OCAMLFIND_COMMANDS="ocamlc=ocamlc.opt"
+  else
+    OCAMLFIND_COMMANDS="$OCAMLFIND_COMMANDS ocamlc=ocamlc.opt"
+  fi
+fi
+AC_CHECK_PROG(HAVE_OCAMLOPT_OPT, ocamlopt.opt, yes, no)
+if test $HAVE_OCAMLOPT_OPT = "yes"; then
+  if test "$OCAMLFIND_COMMANDS" = ""; then
+    OCAMLFIND_COMMANDS="ocamlopt=ocamlopt.opt"
+  else
+    OCAMLFIND_COMMANDS="$OCAMLFIND_COMMANDS ocamlopt=ocamlopt.opt"
+  fi
+fi
+if test "$OCAMLFIND_COMMANDS" != ""; then
+  OCAMLFIND="OCAMLFIND_COMMANDS='$OCAMLFIND_COMMANDS' $OCAMLFIND"
+fi
+
+
 AC_ARG_WITH(term-editor,
              AS_HELP_STRING([--with-term-editor=(tex|textual)],
                             [choose term editor (default is tex)]),
@@ -56,6 +84,7 @@ else
   fi
 fi
 
+AC_SUBST(OCAMLFIND)
 AC_SUBST(CHOSEN_TERM_EDITOR)
 AC_SUBST(CHOSEN_TERM_PARSER)
 AC_SUBST(CHOSEN_TRANSFORMER)