Project

General

Profile

Download (7.02 KB) Statistics
| Branch: | Tag: | Revision:
1
define([gitversion], esyscmd([sh -c "git log --oneline | wc -l | tr -d ' \n'"]))
2

    
3
AC_INIT([lustrec], 1.7-gitversion, [ploc@garoche.net])
4
AC_SUBST(VERSION_NUMBER, 1.7)
5

    
6
gitbranch=`git branch | grep \* | sed "s/\*[ ]*//"`
7
if test x"$gitbranch" != "xmaster"; then
8
  AC_SUBST(CDASHSUBPROJ, "unstable")
9
else
10
  AC_SUBST(CDASHSUBPROJ, "master")
11
fi
12

    
13
if test -z "$share"; then
14
  share="$ac_pwd/_build/default/include"
15
fi
16

    
17
AC_SUBST(SHARE_PATH, $share)
18

    
19
# Next release will be
20
#AC_INIT([lustrec], [1.8], [ploc@garoche.net])
21
AC_MSG_NOTICE(Git branch: [$gitbranch])
22
AC_CONFIG_SRCDIR([src/main_lustre_compiler.ml])
23
AC_CONFIG_SRCDIR([src/main_lustre_testgen.ml])
24

    
25
# default prefix is /usr/local
26
AC_PREFIX_DEFAULT(./_build/install/default)
27

    
28
# Configuration
29
AC_MSG_NOTICE(******** Configuration ********)
30
AC_MSG_NOTICE(bin path:     $prefix/bin)
31
AC_MSG_NOTICE(share path: $prefix/share)
32

    
33

    
34
# Seal plugin feature
35

    
36
AC_ARG_ENABLE(seal, 
37
  [AS_HELP_STRING([--disable-seal],[disable the seal plugin. Enabled by default if available.])
38
   AS_HELP_STRING([--enable-seal],[enable the seal plugin. Enabled if available by default.])])
39

    
40

    
41
AS_IF([test "x$enable_seal" != "xno"],
42
  [
43
    if (test -z "$(dune external-lib-deps --missing plugins/seal 2>&1 | cat)" ); then
44
      AC_MSG_RESULT([seal plugin : enabled])
45
      AC_SUBST(LUSTREV_SEAL, ["(module Seal_plugin.Seal_verifier.Verifier : Lustrec.VerifierType.S);"])
46
      AC_SUBST(SEAL_PLUGIN_NAME, ["seal_plugin"])
47
    else
48
      AC_MSG_RESULT([seal plugin : disabled because the following libraries are missing : [$(dune external-lib-deps --missing plugins/seal  2>&1 | awk 'NR > 1 {print  $2}' ORS=', ' | sed 's/, $//')].])
49
      if (test "x$enable_seal" == "xyes" ); then
50
        AC_MSG_ERROR([Cannot enable the seal plugin!])
51
      fi
52
    fi
53
  ], 
54
  [AC_MSG_RESULT([seal plugin : disabled (you explicitely disabled it)])]
55
)
56

    
57
# Zustre plugin feature
58
AC_ARG_ENABLE(zustre, 
59
  [AS_HELP_STRING([--disable-zustre],[disable the Zustre plugin. Enabled by default if available.])
60
   AS_HELP_STRING([--enable-zustre],[enable the Zustre plugin. Enabled if available by default.])])
61

    
62
AS_IF([test "x$enable_zustre" != "xno"],
63
  [
64
    if (test -z "$(dune external-lib-deps --missing plugins/zustre 2>&1 | cat)" ); then
65
      AC_MSG_RESULT([zustre plugin : enabled])
66
      AC_SUBST(LUSTREV_ZUSTRE, ["(module Zustre_plugin.Zustre_verifier.Verifier : Lustrec.VerifierType.S);"])
67
      AC_SUBST(ZUSTRE_PLUGIN_NAME, ["zustre_plugin"])
68
      AC_SUBST(Z3LIBPATH, [`ocamlfind query z3 | tr -d '\n'`])
69
    else
70
      AC_MSG_RESULT([zustre plugin : disabled because the following libraries are missing : [$(dune external-lib-deps --missing plugins/zustre  2>&1 | awk 'NR > 1 {print  $2}' ORS=', ' | sed 's/, $//')].])
71
      if (test "x$enable_zustre" == "xyes" ); then
72
        AC_MSG_ERROR([Cannot enable the zustre plugin!])
73
      fi
74
    fi
75
  ], 
76
  [AC_MSG_RESULT([zustre plugin disabled (you explicitely disabled it)])]
77
)
78

    
79
# Tiny plugin feature
80
AC_ARG_ENABLE(tiny, 
81
  [AS_HELP_STRING([--disable-tiny],[disable the Tiny plugin. Enabled by default if available.])
82
   AS_HELP_STRING([--enable-tiny],[enable the Tiny plugin. Enabled if available by default.])])
83

    
84
AS_IF([test "x$enable_tiny" != "xno"], [
85
  if (test -z "$(dune external-lib-deps --missing plugins/tiny 2>&1 | cat)" ); then
86
      AC_MSG_RESULT([tiny plugin : enabled])
87
      AC_SUBST(LUSTREV_TINY, ["(module Tiny_plugin.Tiny_verifier.Verifier : Lustrec.VerifierType.S);"])
88
      AC_SUBST(TINY_PLUGIN_NAME, ["tiny_plugin"])
89
    else
90
      AC_MSG_RESULT([tiny plugin : disabled because the following libraries are missing : [$(dune external-lib-deps --missing plugins/tiny  2>&1 | awk 'NR > 1 {print  $2}' ORS=', ' | sed 's/, $//')].])
91
      if (test "x$enable_tiny" == "xyes" ); then
92
        AC_MSG_ERROR([Cannot enable the tiny plugin!])
93
      fi
94
    fi
95
],
96
  [AC_MSG_RESULT([tiny plugin : disabled (you explicitely disabled it)])])
97

    
98
# Salsa plugin feature
99
AC_ARG_ENABLE(salsa, 
100
  [AS_HELP_STRING([--disable-salsa],[disable the salsa plugin. Enabled by default if available.])
101
   AS_HELP_STRING([--enable-salsa],[enable the salsa plugin. Enabled if available by default.])])
102

    
103

    
104
AS_IF([test "x$enable_salsa" != "xno"], [
105
  if (test -z "$(dune external-lib-deps --missing plugins/salsa 2>&1 | cat)" ); then
106
      AC_MSG_RESULT([salsa plugin : enabled])
107
      AC_SUBST(SALSA, ["(module Salsa_plugin.Plugin : Lustrec.PluginType.S);"])
108
      AC_SUBST(SALSA_PLUGIN_NAME, ["salsa_plugin"])
109
    else
110
      AC_MSG_RESULT([salsa plugin : disabled because the following libraries are missing : [$(dune external-lib-deps --missing plugins/salsa  2>&1 | awk 'NR > 1 {print  $2}' ORS=', ' | sed 's/, $//')].])
111
      if (test "x$enable_salsa" == "xyes" ); then
112
        AC_MSG_ERROR([Cannot enable the salsa plugin!])
113
      fi
114
    fi
115
],
116
  [AC_MSG_RESULT([salsa plugin : disabled (you explicitely disabled it)])])
117

    
118

    
119
# GMP
120
AC_CHECK_LIB(gmp, __gmpz_init,
121
      [gmp=yes],
122
      [AC_MSG_RESULT([GNU MP not found])
123
      gmp=no])
124
#MPFR
125
AC_CHECK_LIB(mpfr, mpfr_add, [mpfr=yes],
126
		   [AC_MSG_RESULT(
127
[MPFR not found])
128
mpfr=no])
129

    
130

    
131
AC_SUBST_FILE(lustresf)
132
AC_SUBST_FILE(lustresf_src)
133
lustresf=/dev/null
134
lustresf_src=/dev/null
135

    
136

    
137
lustresf=Makefile-lustresf.in
138
lustresf_src=src/Makefile-lustresf.in
139
AC_SUBST(lustresf_target, "lustresf")
140

    
141

    
142
# Checking availability of path to regression tests
143
tests_path="../lustrec-tests/regression_tests"
144

    
145
AC_ARG_WITH([tests-path],
146
            [AS_HELP_STRING([--with-tests-path],
147
               [provides path to test suite (default is ../lustrec-test if available)])],
148
            [tests_path="$withval";
149
	     if (test "x$tests_path" = xyes); then
150
	       AC_MSG_ERROR(Option --with-tests-path requires a parameter: eg. --with-tests-path=value);
151
	     fi],
152
            )
153
AC_MSG_NOTICE($tests_path)
154
AC_CHECK_FILE(${tests_path}/CMakeLists.txt,
155
              [
156
	      valid_test_path=true
157
	      ],
158
	      [
159
	      valid_test_path=false
160
	        AC_SUBST(PATH_TO_TESTS, $tests_path)	      ])
161
AC_SUBST(PATH_TO_TESTS_DEFINED, $valid_test_path)
162
AC_SUBST(PATH_TO_TESTS, $tests_path)
163

    
164
# End of config
165

    
166
AC_DEFUN([AC_DEFINE_DIR], [
167
  prefix_NONE=
168
  exec_prefix_NONE=
169
  test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
170
  test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
171
dnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn
172
dnl refers to ${prefix}.  Thus we have to use `eval' twice.
173
  eval ac_define_dir="\"[$]$2\""
174
  eval ac_define_dir="\"$ac_define_dir\""
175
  AC_SUBST($1, "$ac_define_dir")
176
  AC_DEFINE_UNQUOTED($1, "$ac_define_dir", [$3])
177
  test "$prefix_NONE" && prefix=NONE
178
  test "$exec_prefix_NONE" && exec_prefix=NONE
179
])
180

    
181
AC_DEFINE_DIR([abs_datadir], [datadir])
182

    
183
# Instanciation
184
AC_CONFIG_FILES([
185
		 Makefile
186
     src/dune
187
     plugins/zustre/dune
188
     src/pluginList.ml
189
		 src/verifierList.ml
190
     lib/version.ml
191
		 share/FindLustre.cmake
192
		 ])
193

    
194
AC_OUTPUT
195

    
196

    
197

    
198

    
199
AC_MSG_NOTICE(****** Regression Tests  ******)
200
if (test "x$valid_test_path" = xfalse); then
201
  AC_MSG_NOTICE(no valid tests path provided ($tests_path))
202
else
203
AC_MSG_NOTICE(tests path: $tests_path)
204
fi
205
AC_MSG_NOTICE(******** Configuration ********)
206
AC_MSG_NOTICE(Execute "make; make install" now)
(13-13/17)