Project

General

Profile

Revision 3769b712 configure.ac

View differences:

configure.ac
2 2

  
3 3
AC_INIT([lustrec], 1.7-gitversion, [ploc@garoche.net])
4 4
AC_SUBST(VERSION_NUMBER, 1.7)
5
AC_SUBST(VERSION_CODENAME, "Xia/Huai-dev")
6 5

  
7 6
gitbranch=`git branch | grep \* | sed "s/\*[ ]*//"`
8 7
AC_SUBST(GITBRANCH, "$gitbranch")
......
14 13

  
15 14
# Next release will be
16 15
#AC_INIT([lustrec], [1.8], [ploc@garoche.net])
17
#AC_SUBST(VERSION_CODENAME, "Xia/Mang")
18 16
AC_MSG_NOTICE(Git branch: ${GITBRANCH})
19 17
AC_CONFIG_SRCDIR([src/main_lustre_compiler.ml])
20 18
AC_CONFIG_SRCDIR([src/main_lustre_testgen.ml])
21 19

  
22
AC_PATH_PROG([OCAMLC],[ocamlc],[:])
23
AC_MSG_CHECKING(OCaml version)
24
ocamlc_version=`$OCAMLC -v | grep version | rev| cut -d \  -f 1 | rev`
25
major=`echo $ocamlc_version | cut -d . -f 1`
26
minor=`echo $ocamlc_version | cut -d . -f 2`
27
if (test "$major" -lt 3 -a "$minor" -lt 11 ); then
28
  AC_MSG_ERROR([Ocaml version must be at least 3.11. You have version $ocamlc_version])
29
fi
30
AC_MSG_RESULT(valid ocaml version detected: $ocamlc_version)
31

  
32
AC_PATH_PROG([OCAMLBUILD],[ocamlbuild],[:])
33

  
34
# Handle a mismatch in available function btw 4.02 and 4.04
35
if (test $"$major" -eq 4 -a "$minor" -gt 2); then
36
   AC_SUBST(UPPERCASEFUN, "String.uppercase_ascii")
37
else
38
   AC_SUBST(UPPERCASEFUN, "String.uppercase")
39
fi
40

  
41 20
# default prefix is /usr/local
42 21
AC_PREFIX_DEFAULT(/usr/local)
43 22

  
44
dnl AC_ARG_WITH([ocamlgraph-path],
45
dnl         [AS_HELP_STRING([--ocamlgraph-path],
46
dnl               [specify the path of ocamlgraph library. graph.cmxa should be in ocamlgraph-path @<:@default=$(ocamlfind query ocamlgraph)@:>@])],
47
dnl         [AS_IF([test "x$ocamlgraph_path" = xno],
48
dnl                 [AC_MSG_ERROR([ocamlgraph library is needed])],
49
dnl                 [test "x$ocamlgraph_path" = xyes],
50
dnl                 [OCAMLGRAPH_PATH=$(ocamlfind query ocamlgraph)],
51
dnl                 [OCAMLGRAPH_PATH=$ocamlgraph_path]
52
dnl         )],
53
dnl         [OCAMLGRAPH_PATH=$(ocamlfind query ocamlgraph)]
54
dnl )
55
dnl AC_SUBST(OCAMLGRAPH_PATH)
56

  
57

  
58
# Checking libs
59
AC_CHECK_PROG(FINDLIB_CHECK,ocamlfind,yes)
60
if test x"$FINDLIB_CHECK" != x"yes" ; then
61
   AC_MSG_ERROR(ocamlfind required!)
62
fi
63
dnl AC_MSG_RESULT(Hourrah: ocamlfind found!)
64

  
65
# Checks for libraries.
66
# OCamlgraph
67
AC_MSG_CHECKING(ocaml libraries required (ocamlgraph cmdliner fmt logs num)) 
68
AS_IF([ocamlfind query ocamlgraph cmdliner fmt logs num >/dev/null 2>&1],
69
    [],[AC_MSG_ERROR(A few ocaml library required. opam install ocamlgraph cmdliner fmt logs num should solve the issue)],
70
)
71
AC_MSG_RESULT(yes)
23
# Configuration
24
AC_MSG_NOTICE(******** Configuration ********)
25
AC_MSG_NOTICE(bin path:     $prefix/bin)
26
AC_MSG_NOTICE(include path: $prefix/include)
72 27

  
73
#Yojson
74
AC_MSG_CHECKING(yojson library (optional))
75
AS_IF([ocamlfind query yojson >/dev/null 2>&1],
76
    [yojson=yes; AC_MSG_RESULT(yes)],[yojson=no; AC_MSG_WARN(Yojson required for lustresf. opam install yojson should solve the issue)],
77
)
78 28

  
79
# Seal
80
AC_MSG_CHECKING(seal library (optional))
29
# Check seal library availability  
30
AC_MSG_CHECKING(if seal library is available)
81 31
AS_IF([ocamlfind query seal >/dev/null 2>&1],
82
    [seal=yes; AC_MSG_RESULT(yes)],[seal=no; AC_MSG_RESULT(no)],
32
    [seal=yes; AC_MSG_RESULT([yes])],
33
    [seal=no; AC_MSG_RESULT([no])]
83 34
)
84
AS_IF([test "x$seal" = "xyes"], [
85
   AC_SUBST(LUSTREV_SEAL, "(module Seal_verifier.Verifier : VerifierType.S);")
86
   AC_SUBST(LUSTREV_SEAL_TAG, "<**/*>: package(seal)")
87
])
88 35

  
89
# Tiny
90
AC_MSG_CHECKING(tiny library (optional))
36
# Check tiny library availability  
37
AC_MSG_CHECKING([if tiny library is available]) 
91 38
AS_IF([ocamlfind query tiny >/dev/null 2>&1],
92
    [tiny=yes; AC_MSG_RESULT(yes)],[tiny=no; AC_MSG_RESULT(no)],
39
    [tiny=yes; AC_MSG_RESULT([yes])],
40
    [tiny=no; AC_MSG_RESULT([no])],
93 41
)
94
AS_IF([test "x$tiny" = "xyes"], [
95
 dnl   AC_SUBST(LUSTREV_TINY_TAG, "<**/*>: package(apron.boxMPQ), package(apron.octMPQ), package(apron.polkaMPQ), package(tiny)")
96
])
97 42

  
98
# z3 (optional)
99

  
100
AC_ARG_ENABLE(z3, [AS_HELP_STRING([--disable-z3],
101
              [disable Z3 dependencies. Enabled by default if available.])])
102

  
103
# option to rely on github version if installed
104
AC_ARG_WITH(z3_github, [AS_HELP_STRING([--with-z3-github],
105
              [Rely on Z3 as distributed by the official github
106
	       repo rather then the opam distribution. Disabled by default.])])
43
# Check z3 library availability
44
AC_MSG_CHECKING(if z3 library is available)
45
AS_IF([ocamlfind query z3 >/dev/null 2>&1],
46
    [z3=yes; AC_MSG_RESULT([yes])],
47
    [z3=no; AC_MSG_RESULT([no])]
48
)
107 49

  
108
AS_IF([test "x$with_z3_github" != "xyes"],
109
      [z3name=z3],
110
      [z3name=Z3]
111
      )
112
	
113
AC_MSG_CHECKING(z3 library)
50
# Seal plugin feature
114 51

  
52
AC_ARG_ENABLE(seal, 
53
  [AS_HELP_STRING([--disable-seal],[disable the seal plugin. Enabled by default if available.])
54
   AS_HELP_STRING([--enable-seal],[enable the seal plugin. Enabled if available by default.])])
115 55

  
116
#define([z3path], esyscmd([ocamlfind query z3 | tr -d '\n']))
117
#define([z3path], esyscmd([opam config var Z3:lib | tr -d '\n']))
118 56

  
119
AS_IF([ocamlfind query $z3name >/dev/null 2>&1],
120
    [z3=yes; AC_MSG_RESULT([yes])],[zustre=no; AC_MSG_RESULT(no)],
57
AS_IF([test "x$enable_seal" != "xno"],
58
  [
59
    if (test "x$seal" == "xyes" -a "x$z3" == "xyes"); then
60
      AC_MSG_RESULT([seal plugin : enabled])
61
      AC_SUBST(LUSTREV_SEAL, ["(module Seal_verifier.Verifier : Lustrec.VerifierType.S);"])
62
    else
63
      AC_MSG_RESULT([seal plugin : disabled (seal library or z3 package is not available)])
64
      if (test "x$enable_seal" == "xyes" ); then
65
        AC_MSG_ERROR([Cannot enable the seal plugin!])
66
      fi
67
    fi
68
  ], 
69
  [AC_MSG_RESULT([seal plugin disabled (you explicitely disabled it)])]
121 70
)
122 71

  
123
AS_IF([test "x$enable_z3" != "xno"], [
124
  if (test "x$z3" = xyes ); then
125
   AC_SUBST(LUSTREV_ZUSTRE, "(module Zustre_verifier.Verifier : VerifierType.S);")
126
   AC_SUBST(LUSTREV_Z3_TAG, "<**/*verifier.native> or <tools/zustre/*.ml> or <tools/zustre/*.mli> or <tools/seal/seal_extract.ml> or <tools/seal/seal_extract.mli>: package($z3name)")
127
   AS_IF([test "x$z3name" = "xZ3"],
128
   	       [define([Z3path], esyscmd([ocamlfind query Z3 | tr -d '\n']))
129
	        AC_SUBST(Z3LIBPATH, "Z3path")],
130
 	       [define([z3path], esyscmd([ocamlfind query z3 | tr -d '\n']))
131
	        AC_SUBST(Z3LIBPATH, "z3path")]
132
		)
133
  fi	
134
])
135

  
72
# Zustre plugin feature
73
AC_ARG_ENABLE(zustre, 
74
  [AS_HELP_STRING([--disable-zustre],[disable the Zustre plugin. Enabled by default if available.])
75
   AS_HELP_STRING([--enable-zustre],[enable the Zustre plugin. Enabled if available by default.])])
76

  
77
AS_IF([test "x$enable_zustre" != "xno"],
78
  [
79
    if (test "x$z3" == "xyes" ); then
80
      AC_MSG_RESULT([zustre plugin : enabled])
81
      AC_SUBST(LUSTREV_ZUSTRE, ["(module Zustre_for_lustrev.Zustre_verifier.Verifier : Lustrec.VerifierType.S);"])
82
      AC_SUBST(LUSTREV_Z3_TAG, ["<**/*verifier.native> or <tools/zustre/*.ml> or <tools/zustre/*.mli> or <tools/seal/seal_extract.ml> or <tools/seal/seal_extract.mli>: package($z3name)"])
83
      define([z3path], esyscmd([ocamlfind query z3 | tr -d '\n']))
84
      AC_SUBST(Z3LIBPATH, "z3path")
85
    else
86
      AC_MSG_RESULT([zustre plugin : disabled (z3 is not available)])
87
      if (test "x$enable_zustre" == "xyes" ); then
88
        AC_MSG_ERROR([Cannot enable the zustre plugin!])
89
      fi
90
    fi
91
  ], 
92
  [AC_MSG_RESULT([zustre plugin disabled (you explicitely disabled it)])]
93
)
136 94

  
137
dnl # Tiny
138
dnl AC_MSG_CHECKING(tiny library (optional))
139
dnl AS_IF([ocamlfind query tiny >/dev/null 2>&1],
140
dnl     [tiny=yes; AC_MSG_RESULT(yes)],[tiny=no; AC_MSG_RESULT(no)],
141
dnl )
142
AS_IF([test "x$tiny" = "xyes"], [
143
   AC_SUBST(LUSTREV_TINY, "(module Tiny_verifier.Verifier : VerifierType.S);")
144
   AC_SUBST(LUSTREV_TINY_TAG, ["<**/*>: package(apron.boxMPQ), package(apron.octMPQ), package(apron.polkaMPQ), package(tiny)"])
95
# Tiny plugin feature
96
AC_ARG_ENABLE(tiny, 
97
  [AS_HELP_STRING([--disable-tiny],[disable the Tiny plugin. Enabled by default if available.])
98
   AS_HELP_STRING([--enable-tiny],[enable the Tiny plugin. Enabled if available by default.])])
99

  
100
AS_IF([test "x$enable_tiny" != "xno"], [
101
  if (test "x$tiny" == "xyes" ); then
102
      AC_MSG_RESULT([tiny plugin : enabled])
103
      AC_SUBST(LUSTREV_TINY, ["(module Tiny_for_lustrev.Tiny_verifier.Verifier : Lustrec.VerifierType.S);"])
104
      AC_SUBST(LUSTREV_TINY_TAG, ["<**/*>: package(apron.boxMPQ), package(apron.octMPQ), package(apron.polkaMPQ), package(tiny)"])
105
    else
106
      AC_MSG_RESULT([tiny plugin : disabled (tiny library is not available)])
107
      if (test "x$enable_tiny" == "xyes" ); then
108
        AC_MSG_ERROR([Cannot enable the tiny plugin!])
109
      fi
110
    fi
145 111
])
146 112

  
147
# Salsa
148
AC_ARG_ENABLE(salsa, [AS_HELP_STRING([--disable-salsa],
149
              [disable Salsa plugin. Enabled by default if available.])])
150

  
151
AC_MSG_CHECKING(salsa library)
152
AS_IF([ocamlfind query salsa >/dev/null 2>&1],
153
    [salsa=yes; AC_MSG_RESULT(yes)],[salsa=no; AC_MSG_WARN(no)]
154
)
113
# Salsa plugin feature
114
AC_ARG_ENABLE(salsa, 
115
  [AS_HELP_STRING([--disable-salsa],[disable the salsa plugin. Enabled by default if available.])
116
   AS_HELP_STRING([--enable-salsa],[enable the salsa plugin. Enabled if available by default.])])
155 117

  
156 118

  
157 119
AS_IF([test "x$enable_salsa" != "xno"], [
158
  if (test "x$salsa" = xyes ); then
159
   AC_SUBST(SALSA, "(module Salsa_plugin.Plugin : PluginType.S);")
160
   AC_SUBST(SALSA_TAG, "<**/*.native> or <plugins/salsa/*.cm?> : package(salsa)")
161
  fi
120
  if (test "x$salsa" == "xyes" ); then
121
      AC_MSG_RESULT([salsa plugin : enabled])
122
      AC_SUBST(SALSA, ["(module Salsa_plugin.Plugin : Lustrec.PluginType.S);"])
123
      AC_SUBST(SALSA_TAG, ["<**/*.native> or <plugins/salsa/*.cm?> : package(salsa)"])
124
    else
125
      AC_MSG_RESULT([salsa plugin : disabled (salsa library is not available)])
126
      if (test "x$enable_salsa" == "xyes" ); then
127
        AC_MSG_ERROR([Cannot enable the salsa plugin!])
128
      fi
129
    fi
162 130
])
163 131

  
132

  
164 133
# GMP
165 134
AC_CHECK_LIB(gmp, __gmpz_init,
166 135
      [gmp=yes],
167 136
      [AC_MSG_RESULT([GNU MP not found])
168 137
      gmp=no])
169

  
138
#MPFR
170 139
AC_CHECK_LIB(mpfr, mpfr_add, [mpfr=yes],
171 140
		   [AC_MSG_RESULT(
172 141
[MPFR not found])
173 142
mpfr=no])
174 143

  
175
# lustresf
176
AC_ARG_ENABLE(lustresf, [AS_HELP_STRING([--disable-lustresf],
177
              [disable lustresf compilation. Enabled by default.])])
178 144

  
179 145
AC_SUBST_FILE(lustresf)
180 146
AC_SUBST_FILE(lustresf_src)
181 147
lustresf=/dev/null
182 148
lustresf_src=/dev/null
183 149

  
184
AS_IF([test "x$enable_lustresf" != "xno"], [
185
  AC_MSG_CHECKING(yojson library for lustresf)
186
  AS_IF([ocamlfind query yojson >/dev/null 2>&1],
187
      [yojson=yes; AC_MSG_RESULT(yes)],[yojson=no; AC_MSG_ERROR(Yojson required for lustresf. opam install yojson should solve the issue)],
188
  )
189
  lustresf=Makefile-lustresf.in
190
  lustresf_src=src/Makefile-lustresf.in
191
  AC_SUBST(lustresf_target, "lustresf")
192
])
150

  
151
lustresf=Makefile-lustresf.in
152
lustresf_src=src/Makefile-lustresf.in
153
AC_SUBST(lustresf_target, "lustresf")
154

  
193 155

  
194 156
# Checking availability of path to regression tests
195 157
tests_path="../lustrec-tests/regression_tests"
......
235 197
# Instanciation
236 198
AC_CONFIG_FILES([opam
237 199
		 Makefile
238
		 src/Makefile
239
		 src/version.ml
240 200
		 src/pluginList.ml
241 201
		 src/verifierList.ml
242
		 src/_tags
243
		 src/ocaml_utils.ml
244 202
		 include/z3librc
245 203
		 share/FindLustre.cmake
246 204
		 ])
......
248 206
AC_OUTPUT
249 207

  
250 208

  
251
# summary
252
AC_MSG_NOTICE(******** Configuration ********)
253
AC_MSG_NOTICE(bin path:     $prefix/bin)
254
AC_MSG_NOTICE(include path: $prefix/include)
255
AC_MSG_NOTICE(********    Plugins    ********)
256

  
257
  if (test "x$gmp" = xyes -a "x$mpfr" = xyes ); then
258
      AC_MSG_NOTICE([MPFR option enabled])
259
  else
260
      AC_MSG_WARN([MPFR option cannot be activated. Requires GMP and MPFR libs])
261
  fi
262

  
263
  if (test "x$salsa" = xyes -a "x$enable_salsa" != xno); then
264
      AC_MSG_NOTICE([Salsa plugin enabled])
265
  else
266
      AC_MSG_NOTICE([Salsa plugin disabled])
267
  fi
268

  
269
  if (test "x$z3" = xyes -a "x$enable_z3" != xno); then
270
      AC_MSG_NOTICE([Z3 dependencies enabled])
271
  else
272
      AC_MSG_NOTICE([Z3 dependencies disabled])
273
  fi
274

  
275
  if (test "x$yojson" = xyes -a "x$enable_lustresf" != "xno"); then
276
      AC_MSG_NOTICE([lustresf available])
277
  else
278
      if (test "x$enable_lustresf" = "xno"); then
279
        AC_MSG_NOTICE([lustresf not available (you explicitely disabled it)])
280
      else
281
        AC_MSG_NOTICE([lustresf not available])
282
      fi
283
  fi
284
AC_MSG_NOTICE(********   Verifiers    ********)
285

  
286
  if (test "x$z3" = xyes  -a "x$enable_z3" != xno); then
287
      AC_MSG_NOTICE([Zustre enabled])
288
      AC_MSG_WARN(Z3 shared lib (libz3.so) has to be available in the LD_LIBRARY_PATH (DYLD_LIBRARY_PATH in OSX).)
289
      dnl AC_MSG_WARN(It is currently located in "z3path")
290
      AC_MSG_WARN(If not already available run "source ${prefix}/include/lustrec/z3librc")
291
      AC_MSG_WARN(or add that line to your ~/.profile or ~/.bashrc)
292
else
293
      AC_MSG_NOTICE([Zustre disabled. Require Z3 ocaml library])
294
  fi
295

  
296
if (test "x$seal" = "xyes" -a "x$z3" = xyes  -a "x$enable_z3" != xno); then
297
      AC_MSG_NOTICE([Seal   enabled])
298
  else
299
      AC_MSG_NOTICE([Seal   disabled. Require Z3 library])
300
  fi
301

  
302 209

  
303
  if (test "x$tiny" = xyes); then
304
      AC_MSG_NOTICE([Tiny   enabled])
305
  else
306
      AC_MSG_NOTICE([Tiny   disabled. Require Tiny library])
307
  fi
308 210

  
309 211
AC_MSG_NOTICE(****** Regression Tests  ******)
310 212
if (test "x$valid_test_path" = xfalse); then

Also available in: Unified diff