Have `ChangeLog' refer to the Git repository.
[guile-r6rs-libs.git] / configure.ac
blob19c03c27d29e4f092bd023343b731cd12cb447b4
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=""
73   gl_MANYWARN_ALL_GCC([POTENTIAL_GCC_CFLAGS])
74   POTENTIAL_GCC_CFLAGS="-pipe -Wall -Werror -Wno-error=inline $POTENTIAL_GCC_CFLAGS"
75   for flag in $POTENTIAL_GCC_CFLAGS
76   do
77     case "x$flag" in
78       *traditional*) break;;
79       *)             gl_WARN_ADD([$flag], [GCC_CFLAGS]);;
80     esac
81   done
82 else
83   GCC_CFLAGS=""
85 AC_SUBST([GCC_CFLAGS])
87 pkgdatadir="$datadir/$PACKAGE_NAME"
88 if test "x$guilemoduledir" = "x"; then
89   guilemoduledir="$pkgdatadir"
91 AC_SUBST([guilemoduledir])
93 if test "$guilemoduledir" != "$GUILE_SITE"; then
94    # Guile won't be able to locate the module "out of the box", so
95    # warn the user.
96    AC_MSG_WARN([`guilemoduledir' ($guilemoduledir) is different from `GUILE_SITE' ($GUILE_SITE).])
97    AC_MSG_WARN([Make sure to adjust the `GUILE_LOAD_PATH' environment variable accordingly,])
98    AC_MSG_WARN([or re-run `configure' with `--with-guilemoduledir=$GUILE_SITE'.])
101 AC_CONFIG_FILES([Makefile
102                  lib/Makefile
103                  modules/Makefile
104                  src/Makefile
105                  tests/Makefile
106                  benchmarks/Makefile
107                  doc/Makefile
108                  pre-inst-guile])
109 AC_CONFIG_COMMANDS([pre-inst-guile-exec], [chmod +x pre-inst-guile])
111 AC_OUTPUT