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)

Also available in: Unified diff