1 # Bitstring syntax extension.
2 # Copyright (C) 2008 Red Hat Inc., Richard W.M. Jones
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2 of the License, or (at your option) any later version.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 dnl Process this file with autoconf to produce a configure script.
20 AC_INIT(ocaml-bitstring,2.0.1)
22 dnl Check for basic C environment.
28 test "x$U" != "x" && AC_MSG_ERROR(Compiler not ANSI compliant)
32 dnl Check for native endianness.
34 [AC_MSG_ERROR([Machine endianness could not be determined])]
36 if test "x$WORDS_BIGENDIAN" = "x"; then
37 NATIVEENDIAN=LittleEndian
39 NATIVEENDIAN=BigEndian
41 AC_SUBST(NATIVEENDIAN)
43 dnl Create byteswap.h if the system doesn't have this file.
44 dnl Written by Oskar Liljeblad.
45 dnl From gnulib, license is LGPLv2+.
46 AC_CHECK_HEADERS([byteswap.h], [
49 BYTESWAP_H='byteswap.h'
53 dnl Check for basic OCaml environment & findlib.
57 if test "x$OCAMLFIND" = "x"; then
58 AC_MSG_ERROR([You must have ocaml and findlib installed])
62 AC_CHECK_PROG(CAMLP4OF,camlp4of.opt,camlp4of.opt,no)
63 if test "x$CAMLP4OF" = "xno"; then
64 AC_MSG_ERROR([You must have camlp4 installed])
67 dnl Check for Extlib (optional)
68 AC_CHECK_OCAML_PKG(extlib)
71 dnl Check for CIL (optional)
72 AC_CHECK_OCAML_PKG(cil)
75 dnl Check for /usr/bin/time and get full path.
76 AC_PATH_PROG(TIME,time,no)
77 if test "x$TIME" = "xno"; then
78 AC_MSG_ERROR(['time' command not found])
81 dnl Check for diff and get full path.
82 AC_PATH_PROG(DIFF,diff,no)
83 if test "x$DIFF" = "xno"; then
84 AC_MSG_ERROR(['diff' command not found])
88 dnl Check for gprof (optional).
89 AC_CHECK_PROG(GPROF,gprof,gprof,no)
91 dnl Check for ocaml-bisect (optional) and --enable-coverage.
92 AC_CHECK_PROG(BISECT_REPORT,bisect-report,bisect-report,no)
93 AC_ARG_ENABLE([coverage],
94 [AS_HELP_STRING([--enable-coverage],
95 [add code coverage information (slow) @<:@default=no@:>@])],
99 if test "x$enable_coverage" != "xno" -a "x$BISECT_REPORT" = "xno"; then
100 AC_MSG_ERROR([You must install ocaml-bisect package to get code coverage])
102 AC_SUBST(enable_coverage)
104 dnl Produce output files.
105 AC_CONFIG_HEADERS([config.h])
106 AC_CONFIG_FILES([Makefile META bitstring_config.ml cil-tools/Makefile])