2007-10-17 19:59:37 -04:00
|
|
|
# -*- Autoconf -*-
|
|
|
|
# Process this file with autoconf to produce a configure script.
|
|
|
|
|
|
|
|
AC_PREREQ(2.59)
|
2008-02-02 23:08:58 -05:00
|
|
|
AC_INIT(ikarus, 0.0.3, aghuloum@cs.indiana.edu)
|
2007-10-17 19:59:37 -04:00
|
|
|
AC_CANONICAL_SYSTEM
|
2008-02-02 23:08:58 -05:00
|
|
|
AM_INIT_AUTOMAKE(ikarus, 0.0.3)
|
2007-10-17 19:59:37 -04:00
|
|
|
AC_CONFIG_SRCDIR([src/])
|
|
|
|
|
2007-10-25 17:43:40 -04:00
|
|
|
|
2007-10-17 19:59:37 -04:00
|
|
|
AM_PROG_AS
|
|
|
|
# Checks for programs.
|
|
|
|
AC_PROG_CC
|
2007-11-10 23:50:54 -05:00
|
|
|
AM_PROG_CC_C_O
|
2007-10-17 19:59:37 -04:00
|
|
|
|
2008-07-20 17:09:04 -04:00
|
|
|
|
|
|
|
CFLAGS="$CFLAGS -DNDEBUG -O3 -Wall"
|
2007-10-17 19:59:37 -04:00
|
|
|
|
|
|
|
case "$target_os" in
|
|
|
|
*linux*)
|
|
|
|
LDFLAGS="-rdynamic $LDFLAGS"
|
|
|
|
;;
|
2007-11-01 00:46:04 -04:00
|
|
|
*bsd*)
|
|
|
|
LDFLAGS="-Wl,-E $LDFLAGS"
|
|
|
|
;;
|
2007-11-23 02:29:46 -05:00
|
|
|
*cygwin*)
|
|
|
|
LDFLAGS="-Wl,-E -Wl,--export-all-symbols $LDFLAGS"
|
|
|
|
;;
|
2007-10-17 19:59:37 -04:00
|
|
|
esac
|
|
|
|
|
2007-12-01 22:41:36 -05:00
|
|
|
AC_CHECK_SIZEOF(void *)
|
2008-10-21 00:43:27 -04:00
|
|
|
if test "$ac_cv_sizeof_void_p" = 4; then
|
|
|
|
AC_DEFINE(FLAT_TABLES, 1,
|
|
|
|
[use flat segment and dirty vectors (not used yet)])
|
|
|
|
fi
|
|
|
|
|
2008-11-09 22:24:04 -05:00
|
|
|
AC_SYS_LARGEFILE
|
2007-12-01 22:41:36 -05:00
|
|
|
|
2007-10-17 19:59:37 -04:00
|
|
|
# Checks for libraries.
|
|
|
|
AC_SEARCH_LIBS(dlsym, dl,, [AC_MSG_ERROR([Cannot find libdl])])
|
|
|
|
AC_SEARCH_LIBS(cos, m,, [AC_MSG_ERROR([Cannot find libm])])
|
2008-09-08 17:43:47 -04:00
|
|
|
AC_SEARCH_LIBS(nanosleep, rt,, [AC_MSG_ERROR([Cannot find nanosleep])])
|
|
|
|
AC_SEARCH_LIBS(socket, socket,, [AC_MSG_ERROR([Cannot find socket])])
|
|
|
|
|
2007-10-17 19:59:37 -04:00
|
|
|
|
|
|
|
# Checks for header files.
|
|
|
|
AC_HEADER_STDC
|
|
|
|
AC_HEADER_SYS_WAIT
|
|
|
|
|
|
|
|
|
|
|
|
AC_CHECK_HEADERS([assert.h dlfcn.h errno.h fcntl.h signal.h \
|
|
|
|
stdint.h stdlib.h string.h strings.h \
|
2007-10-26 00:22:16 -04:00
|
|
|
sys/mman.h sys/resource.h sys/stat.h \
|
2007-10-17 19:59:37 -04:00
|
|
|
sys/time.h sys/types.h sys/wait.h time.h \
|
|
|
|
unistd.h])
|
|
|
|
|
2007-11-10 08:28:19 -05:00
|
|
|
AC_CHECK_HEADERS([gmp.h],,[AC_MSG_ERROR([
|
|
|
|
ERROR: Cannot find libgmp.
|
|
|
|
ERROR: You might want to supply CFLAGS=-I</path/to/include> (containing
|
|
|
|
ERROR: the gmp.h header file), and LDFLAGS=-L</path/to/lib> (containing
|
|
|
|
ERROR: libgmp.so) if libgmp is installed in a non-standard location.
|
|
|
|
ERROR: libgmp can be obtained from <http://gmplib.org>. ])])
|
|
|
|
|
2007-11-07 13:05:31 -05:00
|
|
|
# check that gmp is present
|
|
|
|
AC_HAVE_LIBRARY([gmp],,[AC_MSG_ERROR([
|
|
|
|
ERROR: Cannot find libgmp.
|
|
|
|
ERROR: You might want to supply CFLAGS=-I</path/to/include> (containing
|
|
|
|
ERROR: the gmp.h header file), and LDFLAGS=-L</path/to/lib> (containing
|
|
|
|
ERROR: libgmp.so) if libgmp is installed in a non-standard location.
|
|
|
|
ERROR: libgmp can be obtained from <http://gmplib.org>. ])])
|
|
|
|
|
2008-09-14 07:17:24 -04:00
|
|
|
AC_ARG_ENABLE(libffi,
|
2008-09-22 21:55:05 -04:00
|
|
|
[ --enable-libffi enable support for libffi.])
|
|
|
|
|
|
|
|
if test "$enable_libffi" = "yes"; then
|
|
|
|
|
2008-09-14 07:17:24 -04:00
|
|
|
AC_CHECK_HEADERS([ffi.h],,
|
|
|
|
AC_MSG_ERROR([ffi.h cannot be found.
|
|
|
|
Please specify the location of the header file using
|
|
|
|
./configure CFLAGS=-I<path/to/ffi.h> <other-options ...>
|
2008-09-22 21:55:05 -04:00
|
|
|
]))
|
|
|
|
|
2008-09-14 07:17:24 -04:00
|
|
|
AC_CHECK_LIB(ffi,ffi_call,,
|
|
|
|
AC_MSG_ERROR([libffi cannot be found.
|
|
|
|
Please specify the location of the library file using
|
|
|
|
./configure LDFLAGS=-L<path/to/libffi.ld|dylib|so|etc.> <other-options ...>
|
2008-09-22 21:55:05 -04:00
|
|
|
]))
|
|
|
|
|
|
|
|
AC_DEFINE(ENABLE_LIBFFI, 1, [adds support for libffi])
|
|
|
|
|
|
|
|
fi
|
2007-10-17 19:59:37 -04:00
|
|
|
|
|
|
|
# Checks for typedefs, structures, and compiler characteristics.
|
|
|
|
AC_C_CONST
|
|
|
|
AC_C_INLINE
|
|
|
|
AC_C_RESTRICT
|
|
|
|
AC_TYPE_SIZE_T
|
|
|
|
AC_HEADER_TIME
|
|
|
|
AC_STRUCT_TM
|
|
|
|
|
2008-11-09 22:24:04 -05:00
|
|
|
|
2007-10-17 19:59:37 -04:00
|
|
|
# Checks for library functions.
|
|
|
|
AC_FUNC_FORK
|
|
|
|
AC_FUNC_MALLOC
|
|
|
|
AC_FUNC_MEMCMP
|
|
|
|
AC_FUNC_MMAP
|
|
|
|
AC_FUNC_STAT
|
|
|
|
AC_FUNC_STRFTIME
|
|
|
|
AC_FUNC_STRTOD
|
2008-01-07 19:04:46 -05:00
|
|
|
AC_CHECK_FUNCS([sigaltstack bzero gettimeofday memmove memset munmap setenv sqrt strerror getaddrinfo])
|
2007-10-25 17:43:40 -04:00
|
|
|
AC_CONFIG_HEADERS([config.h])
|
2007-12-01 01:21:18 -05:00
|
|
|
AC_CONFIG_FILES(Makefile src/Makefile scheme/Makefile doc/Makefile lib/Makefile benchmarks/Makefile)
|
2007-10-25 17:43:40 -04:00
|
|
|
AC_OUTPUT #(Makefile src/Makefile scheme/Makefile doc/Makefile)
|
|
|
|
|