bytevector: Include <alloca.h>.
[guile-r6rs-libs.git] / configure.ac
blobde5adf433c9b70bf50c545e90a44d488b179c2a7
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
27 # Disable static libraries as this is usually useless.
28 LT_INIT([disable-static])
30 # Gnulib.
31 gl_INIT
33 # Checks for Guile.
34 GUILE_PROGS
35 GUILE_FLAGS
36 AC_PATH_PROG([guile_snarf], [guile-snarf], [not-found])
37 if test "x$guile_snarf" = "xnot-found"; then
38    AC_MSG_ERROR([`guile-snarf' not found.  Please install Guile 1.8.x or later.])
40 GUILE_SITE_DIR
42 # Checks for header files.
43 AC_HEADER_STDC
44 AC_CHECK_HEADERS([limits.h])
45 AC_CHECK_HEADER([gmp.h], [:],
46   AC_MSG_ERROR([GMP headers not found.  Please install it first.]))
48 # Checks for typedefs, structures, and compiler characteristics.
49 AC_C_CONST
50 AC_C_INLINE
51 AC_TYPE_SIZE_T
52 AC_CHECK_SIZEOF([void *])
54 # Checks for library functions.
55 AC_FUNC_MEMCMP
57 # Look for `scm_set_port_read ()' in libguile, scheduled to arrive in
58 # Guile 1.8.6.
59 save_CFLAGS="$CFLAGS"
60 save_LDFLAGS="$LDFLAGS"
61 CFLAGS="$CFLAGS $GUILE_CFLAGS"
62 LDFLAGS="$LDFLAGS $GUILE_LDFLAGS"
63 AC_CHECK_FUNCS([scm_set_port_read])
64 CFLAGS="$save_CFLAGS"
65 LDFLAGS="$save_LDFLAGS"
68 # Low-level details.
69 AC_C_BIGENDIAN
71 if test "x$GCC" = "xyes"; then
72   # Enable useful GCC compilation flags.
73   GCC_CFLAGS=""
75   gl_MANYWARN_ALL_GCC([POTENTIAL_GCC_CFLAGS])
76   POTENTIAL_GCC_CFLAGS="-pipe -Wall -Werror -Wno-error=inline $POTENTIAL_GCC_CFLAGS"
77   for flag in $POTENTIAL_GCC_CFLAGS
78   do
79     case "x$flag" in
80       *traditional*) break;;
81       *)             gl_WARN_ADD([$flag], [GCC_CFLAGS]);;
82     esac
83   done
84 else
85   GCC_CFLAGS=""
87 AC_SUBST([GCC_CFLAGS])
89 pkgdatadir="$datadir/$PACKAGE_NAME"
90 if test "x$guilemoduledir" = "x"; then
91   guilemoduledir="$pkgdatadir"
93 AC_SUBST([guilemoduledir])
95 if test "$guilemoduledir" != "$GUILE_SITE"; then
96    # Guile won't be able to locate the module "out of the box", so
97    # warn the user.
98    AC_MSG_WARN([`guilemoduledir' ($guilemoduledir) is different from `GUILE_SITE' ($GUILE_SITE).])
99    AC_MSG_WARN([Make sure to adjust the `GUILE_LOAD_PATH' environment variable accordingly,])
100    AC_MSG_WARN([or re-run `configure' with `--with-guilemoduledir=$GUILE_SITE'.])
103 AC_CONFIG_FILES([Makefile
104                  lib/Makefile
105                  modules/Makefile
106                  src/Makefile
107                  tests/Makefile
108                  benchmarks/Makefile
109                  doc/Makefile
110                  pre-inst-guile])
111 AC_CONFIG_COMMANDS([pre-inst-guile-exec], [chmod +x pre-inst-guile])
113 AC_OUTPUT