local $_ = join ' ', @ARGV;
# Parse options
-/-h/ || /--help/ and die "usage: $0 [--prefix=path] [--without-python] [--with-trac] [--no-opt]\n\n\t--no-opt\tDo not use the optimimized version of OCaml\n\n";
+/-h/ || /--help/ and die "usage: $0 [--prefix=path] [--without-python] [--with-trac] [--no-opt]\n\n\t--no-opt\tDo not use the optimimized version of OCaml\n\t--opt\tUse the optimimized version of OCaml\n\n";
/--prefix=([^ ]*)/ and $prefix = $1;
/--without-python/ and $python = 0;
/--without-trac/ and $trac = 0;
/--with-trac/ and $trac = 1;
/--no-opt/ and $opt = "";
+/--opt/ and $opt = ".opt";
#if($ARGV[0] =~ "--prefix=(.*)") {
# $prefix = $1;
);
if ($opt eq ".opt") {
- my $opt_check = `which ocamlc.opt 2>&1 | cut -d' ' -f2`;
- if($opt_check =~ "no") {
+ my $opt_check = `which ocamlc.opt 2> /dev/null`;
+ if($opt_check =~ "/ocamlc.opt\$") {
+ pr2 "ocamlc.opt is present.";
+ }
+ else {
+ $opt="";
+ pr2 "ocamlc.opt not found";
+ }
+
+ my $opt_check = `which ocamlopt.opt 2> /dev/null`;
+ if($opt_check =~ "/ocamlopt.opt\$") {
+ pr2 "ocamlopt.opt is present.";
+ }
+ else {
$opt="";
- pr2 "Native version of OCaml not found";
+ pr2 "ocamlopt.opt not found";
+ }
+
+ my $opt_check = `which ocamldep.opt 2> /dev/null`;
+ if($opt_check =~ "/ocamldep.opt\$") {
+ pr2 "ocamldep.opt is present.";
}
else {
- pr2 "Native version of OCaml is present.";
+ $opt="";
+ pr2 "ocamldep.opt not found";
+ }
+
+ my $opt_check = `which ocamllex.opt 2> /dev/null`;
+ if($opt_check =~ "/ocamllex.opt\$") {
+ pr2 "ocamllex.opt is present.";
+ }
+ else {
+ $opt="";
+ pr2 "ocamllex.opt not found";
+ }
+
+ if($opt eq "") {
+ pr2 "At least one native OCaml tool have not been found.";
+ pr2 "Desactivation of all native OCaml tools for compilation.";
}
}
open(CONFIG, ">Makefile.config");
print CONFIG "# autogenerated by configure
+#
+INSTALL_PROGRAM?=install -c -m 755
+INSTALL_LIB?= install -c -m 755
+INSTALL_DATA?= install -c -m 644
+
# Where to install the binary
BINDIR=$prefix/bin