Add backward-compatible version of `make-custom-binary-input-port'.
[guile-r6rs-libs.git] / configure.ac
blob66e5c5c8ce466aec5ed3759384428bd7f98998ad
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
4 AC_PREREQ(2.61)
5 AC_INIT([guile-r6rs-libs], [0.2], [ludo@gnu.org])
6 AC_CONFIG_AUX_DIR(build-aux)
7 AC_CONFIG_MACRO_DIR(m4)
9 AM_INIT_AUTOMAKE([gnu check-news no-define -Wall])
11 AC_CONFIG_SRCDIR([src/bytevector.c])
12 AC_CONFIG_HEADER([src/config.h])
14 AC_ARG_WITH([guilemoduledir],
15   [use the specified installation path for Guile modules],
16   [case "x$withval" in
17      xyes|xno) guilemoduledir="";;
18      *)        guilemoduledir="$withval";;
19    esac],
20   [guilemoduledir=""])
21    
23 # Checks for programs.
24 AC_PROG_CC
25 gl_EARLY
26 AC_PROG_LIBTOOL
28 # Gnulib.
29 gl_INIT
31 # Checks for Guile.
32 GUILE_PROGS
33 GUILE_FLAGS
34 AC_PATH_PROG([guile_snarf], [guile-snarf], [not-found])
35 if test "x$guile_snarf" = "xnot-found"; then
36    AC_MSG_ERROR([`guile-snarf' not found.  Please install Guile 1.8.x or later.])
38 GUILE_SITE_DIR
40 # Checks for header files.
41 AC_HEADER_STDC
42 AC_CHECK_HEADERS([limits.h])
43 AC_CHECK_HEADER([gmp.h], [:],
44   AC_MSG_ERROR([GMP headers not found.  Please install it first.]))
46 # Checks for typedefs, structures, and compiler characteristics.
47 AC_C_CONST
48 AC_C_INLINE
49 AC_TYPE_SIZE_T
50 AC_CHECK_SIZEOF([void *])
52 # Checks for library functions.
53 AC_FUNC_MEMCMP
55 # Look for `scm_set_port_read ()' in libguile, scheduled to arrive in
56 # Guile 1.8.6.
57 save_CFLAGS="$CFLAGS"
58 save_LDFLAGS="$LDFLAGS"
59 CFLAGS="$CFLAGS $GUILE_CFLAGS"
60 LDFLAGS="$LDFLAGS $GUILE_LDFLAGS"
61 AC_CHECK_FUNCS([scm_set_port_read])
62 CFLAGS="$save_CFLAGS"
63 LDFLAGS="$save_LDFLAGS"
66 # Low-level details.
67 AC_C_BIGENDIAN
69 if test "x$GCC" = "xyes"; then
70   # Enable useful GCC compilation flags.
71   GCC_CFLAGS="-pipe -Wall -Werror"
72   GCC_CFLAGS="-Wcast-align -Wmissing-prototypes -Wpointer-arith $GCC_CFLAGS"
73   GCC_CFLAGS="-Winline -Wno-error=inline -Wdeclaration-after-statement $GCC_CFLAGS"
74 else
75   GCC_CFLAGS=""
77 AC_SUBST([GCC_CFLAGS])
79 pkgdatadir="$datadir/$PACKAGE_NAME"
80 if test "x$guilemoduledir" = "x"; then
81   guilemoduledir="$pkgdatadir"
83 AC_SUBST([guilemoduledir])
85 if test "$guilemoduledir" != "$GUILE_SITE"; then
86    # Guile won't be able to locate the module "out of the box", so
87    # warn the user.
88    AC_MSG_WARN([`guilemoduledir' ($guilemoduledir) is different from `GUILE_SITE' ($GUILE_SITE).])
89    AC_MSG_WARN([Make sure to adjust the `GUILE_LOAD_PATH' environment variable accordingly,])
90    AC_MSG_WARN([or re-run `configure' with `--with-guilemoduledir=$GUILE_SITE'.])
93 AC_CONFIG_FILES([Makefile
94                  lib/Makefile
95                  modules/Makefile
96                  src/Makefile
97                  tests/Makefile
98                  benchmarks/Makefile
99                  doc/Makefile
100                  pre-inst-guile])
101 AC_CONFIG_COMMANDS([pre-inst-guile-exec], [chmod +x pre-inst-guile])
103 AC_OUTPUT