Project

General

Profile

Download (4.06 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.4-gitversion], [ploc@garoche.net])
4
AC_SUBST(VERSION_CODENAME, "Xia/Xiang-dev")
5
# Next release will be
6
#AC_INIT([lustrec], [1.5], [ploc@garoche.net])
7
#AC_SUBST(VERSION_CODENAME, "Xia/Shao Kang")
8

    
9
AC_CONFIG_SRCDIR([src/main_lustre_compiler.ml])
10
AC_CONFIG_SRCDIR([src/main_lustre_testgen.ml])
11

    
12
AC_PATH_PROG([OCAMLC],[ocamlc],[:])
13
AC_MSG_CHECKING(OCaml version)
14
ocamlc_version=`$OCAMLC -v | grep version | rev| cut -d \  -f 1 | rev`
15
major=`echo $ocamlc_version | cut -d . -f 1`
16
minor=`echo $ocamlc_version | cut -d . -f 2`
17
if (test "$major" -lt 3 -a "$minor" -lt 11 ); then
18
  AC_MSG_ERROR([Ocaml version must be at least 3.11. You have version $ocamlc_version])
19
fi
20
AC_MSG_RESULT(valid ocaml version detected: $ocamlc_version)
21

    
22
AC_PATH_PROG([OCAMLBUILD],[ocamlbuild],[:])
23

    
24

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

    
28
dnl AC_ARG_WITH([ocamlgraph-path],
29
dnl         [AS_HELP_STRING([--ocamlgraph-path],
30
dnl               [specify the path of ocamlgraph library. graph.cmxa should be in ocamlgraph-path @<:@default=$(ocamlfind query ocamlgraph)@:>@])],
31
dnl         [AS_IF([test "x$ocamlgraph_path" = xno],
32
dnl                 [AC_MSG_ERROR([ocamlgraph library is needed])],
33
dnl                 [test "x$ocamlgraph_path" = xyes],
34
dnl                 [OCAMLGRAPH_PATH=$(ocamlfind query ocamlgraph)],
35
dnl                 [OCAMLGRAPH_PATH=$ocamlgraph_path]
36
dnl         )],
37
dnl         [OCAMLGRAPH_PATH=$(ocamlfind query ocamlgraph)]
38
dnl )
39
dnl AC_SUBST(OCAMLGRAPH_PATH)
40

    
41

    
42
# Checking libs
43
AC_CHECK_PROG(FINDLIB_CHECK,ocamlfind,yes)
44
if test x"$FINDLIB_CHECK" != x"yes" ; then
45
   AC_MSG_ERROR(ocamlfind required!)
46
fi
47
dnl AC_MSG_RESULT(Hourrah: ocamlfind found!)
48

    
49
# Checks for libraries. OCamlgraph
50
AC_MSG_CHECKING(ocamlgraph library)
51
AS_IF([ocamlfind query ocamlgraph >/dev/null 2>&1],
52
    [],[AC_MSG_ERROR(ocamlgraph required. opam install ocamlgraph should solve the issue)],
53
)
54
AC_MSG_RESULT(yes)
55

    
56

    
57
AC_ARG_ENABLE(salsa, [AS_HELP_STRING([--disable-salsa],
58
              [disable Salsa plugin. Enabled by default if available.])])
59

    
60

    
61
AC_MSG_CHECKING(salsa library)
62
AS_IF([ocamlfind query salsa >/dev/null 2>&1],
63
    [salsa=yes; AC_MSG_RESULT(yes)],[salsa=no; AC_MSG_WARN(no)]
64
)
65

    
66

    
67
AS_IF([test "x$enable_salsa" != "xno"], [
68
  if (test "x$salsa" = xyes ); then
69
   AC_SUBST(SALSA, "(module Salsa_plugin.Plugin : PluginType.PluginType);")
70
   AC_SUBST(SALSA_TAG, "<**/*.native> or <plugins/salsa/*.cm?> : package(salsa)")
71
  fi	
72
])
73

    
74

    
75

    
76

    
77

    
78

    
79

    
80

    
81

    
82
AC_CHECK_LIB(gmp, __gmpz_init, 
83
      [gmp=yes],
84
      [AC_MSG_RESULT([GNU MP not found])
85
      gmp=no])
86

    
87
AC_CHECK_LIB(mpfr, mpfr_add, [mpfr=yes], 
88
		   [AC_MSG_RESULT(
89
[MPFR not found])
90
mpfr=no])
91

    
92

    
93

    
94

    
95
# End of config
96

    
97
AC_DEFUN([AC_DEFINE_DIR], [
98
  prefix_NONE=
99
  exec_prefix_NONE=
100
  test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
101
  test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
102
dnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn
103
dnl refers to ${prefix}.  Thus we have to use `eval' twice.
104
  eval ac_define_dir="\"[$]$2\""
105
  eval ac_define_dir="\"$ac_define_dir\""
106
  AC_SUBST($1, "$ac_define_dir")
107
  AC_DEFINE_UNQUOTED($1, "$ac_define_dir", [$3])
108
  test "$prefix_NONE" && prefix=NONE
109
  test "$exec_prefix_NONE" && exec_prefix=NONE
110
])
111

    
112
AC_DEFINE_DIR([abs_datadir], [datadir])
113

    
114
# Instanciation
115
AC_CONFIG_FILES([Makefile
116
		 src/Makefile
117
		 src/version.ml
118
		 src/pluginList.ml
119
		 src/_tags
120
		 ])
121

    
122
AC_OUTPUT
123

    
124

    
125
# summary
126
AC_MSG_NOTICE(******** Configuration ********)
127
AC_MSG_NOTICE(bin path:     $prefix/bin)
128
AC_MSG_NOTICE(include path: $prefix/include)
129
AC_MSG_NOTICE(********    Plugins    ********)
130

    
131
  if (test "x$gmp" = xyes -a "x$mpfr" = xyes ); then
132
      AC_MSG_NOTICE([-mpfr option enable])
133
  else 
134
      AC_MSG_WARN([MPFR option cannot be activated. Requires GMP and MPFR libs])
135
  fi
136

    
137
  if (test "x$salsa" = xyes -a "x$enable_salsa" = xyes); then
138
      AC_MSG_NOTICE([Salsa plugin enabled])
139
  else 
140
      AC_MSG_NOTICE([Salsa plugin disabled])
141
  fi
142

    
143
AC_MSG_NOTICE(******** Configuration ********)
144
AC_MSG_NOTICE(Execute "make; make install" now)
(11-11/12)