More implementation.
[wrappi.git] / configure.ac
index f1c908b..3cad79e 100644 (file)
@@ -20,6 +20,10 @@ AM_INIT_AUTOMAKE([foreign])
 
 AC_CONFIG_MACRO_DIR([m4])
 
+dnl Allow all GNU/Linux functions.
+dnl autoconf complains unless this is very early in the file.
+AC_USE_SYSTEM_EXTENSIONS
+
 AC_PROG_LIBTOOL
 
 AC_PROG_SED
@@ -34,20 +38,57 @@ test "x$U" != "x" && AC_MSG_ERROR([Compiler not ANSI compliant])
 
 AM_PROG_CC_C_O
 
+AC_ARG_ENABLE([gcc-warnings],
+    [AS_HELP_STRING([--enable-gcc-warnings],
+                    [turn on lots of GCC warnings (for developers)])],
+    [case $enableval in
+       yes|no) ;;
+       *)      AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;;
+     esac
+     gcc_warnings=$enableval],
+    [gcc_warnings=no]
+)
+
+if test "$gcc_warnings" = yes; then
+    # XXX With gnulib we can improve this in future.
+    WARN_CFLAGS="-Wall"
+    AC_SUBST([WARN_CFLAGS])
+    WERROR_CFLAGS="-Werror"
+    AC_SUBST([WERROR_CFLAGS])
+fi
+
 dnl Check support for 64 bit file offsets.
 AC_SYS_LARGEFILE
 
-dnl Check for OCaml compiler and camlp4.
+dnl Check for OCaml compiler.
 AC_PROG_OCAML
 if test "$OCAMLC" = "no"; then
     AC_MSG_ERROR([You must install the OCaml compiler])
 fi
 
+dnl Camlp4 is required.
 AC_PROG_CAMLP4
 if test "$CAMLP4" = "no"; then
     AC_MSG_ERROR([You must install camlp4 (the OCaml macro preprocessor)])
 fi
 
+dnl OCaml findlib ("ocamlfind") is required.
+AC_PROG_FINDLIB
+if test "$OCAMLFIND" = "no"; then
+    AC_MSG_ERROR([You must install OCaml findlib (the ocamlfind command)])
+fi
+
+dnl Library versioning.
+LIB_MINOR=`cat $srcdir/lib/LIB_MINOR`
+AC_SUBST(LIB_MINOR)
+
 AC_CONFIG_HEADERS([config.h])
-AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([Makefile
+                 APIs/Makefile
+                 examples/Makefile
+                 generator/Makefile
+                 generator-lib/config.ml
+                 generator-lib/Makefile
+                 generator-macros/Makefile
+                 lib/Makefile])
 AC_OUTPUT