Project

General

Profile

« Previous | Next » 

Revision 1954d776

Added by Pierre-Loïc Garoche about 5 years ago

Cleaner configure autoconf script

View differences:

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

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

  
41 41

  
42 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!)
43 48

  
44 49
# Checks for libraries. OCamlgraph
45 50
AC_MSG_CHECKING(ocamlgraph library)
46
   ocamlgraph_lib=`find $OCAMLGRAPH_PATH -iname graph.cmxa | grep -m 1 -o "graph.cmxa"`
47
   if (test "x$ocamlgraph_lib" = xgraph.cmxa ); then
48
	ocamlgraph_lib_full=`find $OCAMLGRAPH_PATH -iname graph.cmxa | grep -m 1 "graph.cmxa"`
49
      AC_MSG_RESULT(library detected: $ocamlgraph_lib_full )
50
   else
51
      AC_MSG_ERROR([ocamlgraph library not installed in $OCAMLGRAPH_PATH])
52
   fi
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

  
53 81

  
54 82
AC_CHECK_LIB(gmp, __gmpz_init, 
55 83
      [gmp=yes],
......
62 90
mpfr=no])
63 91

  
64 92

  
65
# Workaround to solve an issue with ocamlbuild and C libraries.
66
# oCFLAGS="$CFLAGS"
67
# CFLAGS="$FLAGS -Wl,--no-as-needed"
68
# AC_MSG_CHECKING([whether we need to add --no-as-needed linking option])
69
# AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],
70
#                                      [[
71
#                                         int main(){ return 0; }
72
#                                     ]])],
73
#                   [AC_MSG_RESULT([yes]); CC_NOASNEEDED="true"],
74
#                   [AC_MSG_RESULT([no]); CC_NOASNEEDED="false"])
75
# CFLAGS=$oCFLAGS
76
# AC_SUBST(CC_NOASNEEDED)
77 93

  
78 94

  
79 95
# End of config
......
98 114
# Instanciation
99 115
AC_CONFIG_FILES([Makefile
100 116
		 src/Makefile
101
		 src/version.ml])
117
		 src/version.ml
118
		 src/pluginList.ml
119
		 src/_tags
120
		 ])
102 121

  
103 122
AC_OUTPUT
104 123

  
......
110 129
AC_MSG_NOTICE(********    Plugins    ********)
111 130

  
112 131
  if (test "x$gmp" = xyes -a "x$mpfr" = xyes ); then
113
       AC_MSG_NOTICE([-mpfr option enable])
114

  
115
   else 
116
       AC_MSG_WARN([MPFR option cannot be activated. Requires GMP and MPFR libs])
117
      
118
   fi
119
 
120
AC_MSG_NOTICE
121
AC_MSG_NOTICE(******** Configuration ********)
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
122 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)
lustrec.odocl
1
Access
2
Automata
3
backends/C/C_backend
4
backends/C/C_backend_common
5
backends/C/C_backend_header
6
backends/C/C_backend_main
7
backends/C/C_backend_makefile
8
backends/C/C_backend_spec
9
backends/C/C_backend_src
10
backends/Horn/Horn_backend_common
11
backends/Horn/Horn_backend_printers
12
backends/Horn/Horn_backend_collecting_sem
13
backends/Horn/Horn_backend
14
plugins/scopes/Scopes
15
Basic_library
16
Causality
17
Clock_calculus
18
Clock_predef
19
Clocks
20
Compiler_common
21
Corelang
22
Delay
23
Delay_predef
24
Dimension
25
Env
26
Global
27
Inliner
28
Lexer_lustre
29
LexerLustreSpec
30
Liveness
31
Location
32
Log
33
Lusic
34
LustreSpec
35
Machine_code
36
Mmap
37
Mutation
38
Main_lustre_compiler
39
Main_lustre_testgen
40
Modules
41
Mpfr
42
Normalization
43
Optimize_machine
44
Optimize_prog
45
Options
46
PathConditions
47
Parse
48
Parser_lustre
49
Plugins
50
Printers
51
Scheduling
52
SortProg
53
Splitting
54
Stateless
55
Type_predef
56
Types
57
Typing
58
Utils
59
Version
src/_tags
9 9
<**/*.native>: package(ocamlgraph)
10 10
<**/*.native>: use_str
11 11
<**/*.native>: use_unix
12
<**/*.native>: package(salsa)
12
<**/*.native>: package(num)
13

  
14

  
15
# Required for ocamldoc. Otherwise failed to build
16
<*.ml{,i}>: package(ocamlgraph)
17

  
18
# Plugin dependencies
19
<**/*.native> or <plugins/salsa/*.cm?> : package(salsa)
13 20

  
14
#<*.ml{,i}>: package(ocamlgraph)
15
#<*.ml{,i}>: package(salsa)
16
<**/*.cm?>: package(ocamlgraph)
17
#<*.ml{,i}>: use_str
18
#<*.ml{,i}>: use_unix
19
<**/*.cm?>: package(salsa)
src/_tags.in
1
"backends/C": include
2
"backends/Horn": include
3
"plugins/salsa": include
4
"plugins/scopes": include
5
"plugins/mpfr": include
6
<**/.svn>: -traverse
7
<**/.svn>: not_hygienic
8

  
9
<**/*.native>: package(ocamlgraph)
10
<**/*.native>: use_str
11
<**/*.native>: use_unix
12
<**/*.native>: package(num)
13

  
14

  
15
# Required for ocamldoc. Otherwise failed to build
16
<*.ml{,i}>: package(ocamlgraph)
17

  
18
# Plugin dependencies
19
@SALSA_TAG@
20

  
src/lustrec.odocl
1
Access
2
Automata
3
backends/C/C_backend
4
backends/C/C_backend_common
5
backends/C/C_backend_header
6
backends/C/C_backend_main
7
backends/C/C_backend_makefile
8
backends/C/C_backend_spec
9
backends/C/C_backend_src
10
backends/Horn/Horn_backend_common
11
backends/Horn/Horn_backend_printers
12
backends/Horn/Horn_backend_collecting_sem
13
backends/Horn/Horn_backend
14
plugins/scopes/Scopes
15
Basic_library
16
Causality
17
Clock_calculus
18
Clock_predef
19
Clocks
20
Compiler_common
21
Corelang
22
Delay
23
Delay_predef
24
Dimension
25
Env
26
Global
27
Inliner
28
Lexer_lustre
29
LexerLustreSpec
30
Liveness
31
Location
32
Log
33
Lusic
34
LustreSpec
35
Machine_code
36
Mmap
37
Mutation
38
Main_lustre_compiler
39
Main_lustre_testgen
40
Modules
41
Mpfr
42
Normalization
43
Optimize_machine
44
Optimize_prog
45
Options
46
PathConditions
47
Parse
48
Parser_lustre
49
Plugins
50
Printers
51
Scheduling
52
SortProg
53
Splitting
54
Stateless
55
Type_predef
56
Types
57
Typing
58
Utils
59
Version
src/pluginList.ml.in
1
let plugins =
2
  [
3
    (module Scopes.Plugin : PluginType.PluginType);
4
    @SALSA@
5
  ]
src/plugins.ml
1 1
open LustreSpec
2 2

  
3
let plugins =
4
  [
5
    (module Scopes.Plugin : PluginType.PluginType);
6
    (module Salsa_plugin.Plugin : PluginType.PluginType)
7
  ]
3
open PluginList
8 4

  
9 5

  
10 6
let options () = 

Also available in: Unified diff