summaryrefslogtreecommitdiffstats
path: root/kalzium/configure.in.in
blob: 99e2acca1d66da42ee163ba2e58b2bcb3d0a952e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#MIN_CONFIG(3.3)

ocaml_installed=no
facile_installed=no
eqchem_enabled=no

AC_DEFUN([OCAML_PROG],[
    KDE_FIND_PATH(ocamlopt, OCAML, [$bindir],
      [
        OCAML=''
      ])
])

AC_DEFUN([FACILE_PROG],[
    AC_REQUIRE([OCAML_PROG])

    AC_MSG_CHECKING([if the facile constraint solver is installed])
    FACILE="`ocamlopt -where`/facile"
    if test -d "$FACILE" ; then
        eqchem_enabled=yes
        AC_MSG_RESULT([yes])
        facile_installed=yes
    else
        eqchem_enabled=no
        AC_MSG_RESULT([no])
        facile_installed=no
    fi

    AC_SUBST([FACILE])
])

AC_ARG_ENABLE( ocamlsolver,
  [  --disable-ocamlsolver	  Disable support for the OCaml solver @<:@default=check@:>@]],
  [  with_ocamlsolver=$enableval ],
  [  with_ocamlsolver=check] )

if test "x$with_ocamlsolver" != xno; then
  OCAML_PROG
  if test -n "$OCAML"; then
    ocaml_installed=yes
    FACILE_PROG
  fi

  AH_TEMPLATE(HAVE_FACILE, facile solver available?)

  EQCHEM_SUB=
  OCAMLLIB=
  OCAMLLIB_FLAGS=
  EQCHEM_LDADD=
  if test "$eqchem_enabled" = "yes"; then
    EQCHEM_SUB=solver
    OCAMLLIB=`ocamlc -where`
    OCAMLLIB_FLAGS="-L$OCAMLLIB"
    FACILELIB=`ocamlc -where`/facile
    FACILELIB_FLAGS="-L$FACILELIB"
    EQCHEM_LDADD="-lasmrun -lnums -lm -ldl solver.o modwrap.o"

    AC_DEFINE(HAVE_FACILE, 1)
  fi

  AC_SUBST(EQCHEM_SUB)
  AC_SUBST(OCAMLLIB)
  AC_SUBST(FACILELIB)
  AC_SUBST(OCAMLLIB_FLAGS)
  AC_SUBST(FACILELIB_FLAGS)
  AC_SUBST(EQCHEM_LDADD)

  if test "$eqchem_enabled" = "yes"; then
    with_ocamlsolver=yes
  fi
fi