You are looking at historical revision 1176 of this page. It may differ significantly from its current revision.

Introduction

This explains how Autoconf and Automake should be used to build a package with Chicken Scheme that conforms to the GNU Coding Standards. We will assume your program is the one for the second example of the Using the compiler section of the User's Manual.

This is just a draft.

Makefile.am

Your Makefile.am should contain a list of the programs that make up your package and their sources, as well as some additional rules explaining how to compile .scm files:

# A list of the programs we want to build:
bin_PROGRAMS = foo
# The sources for each program we define:
foo_SOURCES = foo.scm bar.scm
# The following line causes autoconf to become aware of the fact that .scm
# files in the *_SOURCES lists should not be ignored:
.scm.o:
# The following lines defines a rule for GNU Make explaining how to build a
# .o file from its associated .scm file:
%.o: %.scm:
        csc -c $< -o $@ $(CHICKENFLAGS)

Compile time dependencies

If all your .scm files depend at compile time on some other files (which usually happens when you define macros), you'll want to define their dependency. To do that, change %.o: %.scm in your Makefile.am to %.o: %.scm macros.scm, where macros.scm is your compile-time dependency (you could include more than once).

Autoconf

The following should be the contents of your configure.in template:

dnl Process this file with autoconf to produce a configure script.
dnl Use the name of an existing source file for your program here:
AC_INIT(foo.scm)

dnl Use the name and version of your package (which doesn't have to match
dnl the names of your executables):
AM_INIT_AUTOMAKE(foo, 1.0)

AC_PREREQ(2.12)

dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
dnl Test for presence of csc (we should probably bail out with error if
dnl we fail to find it):
AC_CHECK_PROG(CSC, csc, YES)

AC_CHECK_PROG(CHICKEN, chicken, YES)

dnl Use here any special flags you require.  For example, if you want
dnl R5RS macros, use "-require-extension syntax-case"
AC_SUBST(CHICKENFLAGS,"")

AC_OUTPUT(Makefile)

Preparing things

Make sure to create the following files:

Then run:

automake -a
aclocal
autoconf