mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-02 23:50:56 -08:00
404 lines
12 KiB
Text
404 lines
12 KiB
Text
dnl
|
|
dnl This is an autoconf script.
|
|
dnl To rebuild the `configure' script from this, execute the command
|
|
dnl autoconf
|
|
dnl in the directory containing this script.
|
|
dnl
|
|
dnl AUTOCONF configuration for ECL
|
|
dnl Giuseppe Attardi 25.1.1994
|
|
dnl
|
|
dnl configure.in ---<autoconf>--->> configure
|
|
dnl
|
|
dnl _____
|
|
dnl configure \
|
|
dnl src/h/config.h.in ----<sh>---->> $(machine)/h/config.h
|
|
dnl src/*/Makefile.in _____/ $(machine)/*/Makefile
|
|
dnl
|
|
dnl $(machine)/Makefile ---<make>--->> ecl
|
|
dnl
|
|
dnl
|
|
AC_INIT(configure.in)
|
|
AC_PREREQ(2.1) # You must have autoconf version 2.1 or later.
|
|
|
|
###
|
|
### Make sure we do not configure within source directory
|
|
###
|
|
AC_CONFIG_SRCDIR(CHANGELOG)
|
|
AC_CONFIG_AUX_DIR(${srcdir}/gmp)
|
|
if test -f configure; then
|
|
echo "***"
|
|
echo "*** This program cannot be built within the source directory ***"
|
|
echo "***"
|
|
exit 2;
|
|
fi
|
|
|
|
dnl Set the version number. This seems the best place to keep it.
|
|
ECL_VERSION=0.9e
|
|
AC_SUBST(ECL_VERSION)
|
|
|
|
dnl Guess operating system of host. We do not allow cross-compiling.
|
|
AC_CANONICAL_BUILD
|
|
AC_CANONICAL_HOST
|
|
|
|
AC_SUBST(thehost)
|
|
AC_SUBST(bindir)
|
|
AC_SUBST(mandir)
|
|
AC_SUBST(infodir)
|
|
AC_SUBST(builddir)
|
|
AC_SUBST(libdir)
|
|
AC_SUBST(docdir)
|
|
AC_SUBST(top_srcdir)
|
|
dnl AC_ARG_ENABLE(tk,
|
|
dnl [--enable-tk Include Tk.],
|
|
dnl tk="$enable_tk")
|
|
AC_ARG_WITH(clx,
|
|
[--with-clx Include CLX.],
|
|
clx="yes")
|
|
AC_ARG_WITH(tcp,
|
|
[--with-tcp Include socket interface.],
|
|
tcp="yes")
|
|
AC_ARG_ENABLE(boehm,
|
|
[--disable-boehm Disable Boehm's garbage collector.],
|
|
boehm="${enableval}",boehm="yes")
|
|
AC_ARG_ENABLE(local-boehm,
|
|
[--enable-local-boehm Use already installed Boehm GC library.],
|
|
[local_boehm="${enableval}" boehm="yes"],local_boehm="no")
|
|
AC_ARG_ENABLE(local-gmp,
|
|
[--enable-local-gmp Use already installed GMP library.],
|
|
local_gmp="${enableval}",local_gmp="no")
|
|
AC_ARG_WITH(gmp,
|
|
[--with-gmp=args Configure supplied GMP library with arguments.],
|
|
[gmp_flags=${withval}; local_gmp="no"],
|
|
gmp_flags="")
|
|
AC_ARG_WITH(cross_config,
|
|
[--with-config-file=f Supply configuration for a cross compiler.],
|
|
cross_config="${withval}", cross_config="`pwd`/cross_config")
|
|
dnl AC_ARG_ENABLE(locative,
|
|
dnl [--enable-locative Include locative support.],
|
|
dnl locative="$enable_locative")
|
|
AC_ARG_ENABLE(threads,
|
|
[--enable-threads Include the multiple thread facility.],
|
|
threads="$enable_threads")
|
|
dnl AC_ARG_ENABLE(runtime,
|
|
dnl [--enable-runtime Build no compiler.],
|
|
dnl runtime="$enable_runtime")
|
|
AC_ARG_ENABLE(shared,
|
|
[--disable-shared Disable building dynamically loadable extensions.],
|
|
shared="$enable_shared",shared="yes")
|
|
AC_ARG_WITH(oldloop,
|
|
[--with-oldloop Use the old MIT LOOP macro.],
|
|
oldloop="yes")
|
|
AC_ARG_WITH(cmuformat,
|
|
[--without-cmuformat Use the FORMAT routine from CMUCL.],
|
|
cmuformat="${withval}",cmuformat="yes")
|
|
AC_ARG_WITH(clos-streams,
|
|
[--with-clos-streams Allow user defined stream objects.],
|
|
closstreams="${withval}",closstreams="no")
|
|
AC_ARG_WITH(cxx,
|
|
[--with-cxx Build ECL using C++ compiler.],
|
|
usecxx="${withval}",usecxx="no")
|
|
AC_ARG_ENABLE(opcode8,
|
|
[--enable-opcode8 Interpreter uses 8-bit codes (only Intel!).],
|
|
opcode8=${enableval},opcode8="no")
|
|
|
|
### ----------------------------------------------------------------------
|
|
### Checks for programs
|
|
###
|
|
AC_PROG_CC # sets variable CC
|
|
AC_PROG_CXX # sets variable CXX
|
|
AC_PROG_CPP # sets variable CPP
|
|
AC_PROG_RANLIB # sets variable RANLIB
|
|
AC_PROG_INSTALL # sets variables INSTALL, INSTALL_DATA, INSTALL_PROGRAM
|
|
AC_PROG_LN_S # sets variable LN_S
|
|
AC_EXEEXT dnl Guess whether .exe is needed for executables
|
|
AC_SUBST(ECL_CC)dnl Which compiler should we use for building ECL
|
|
AC_SUBST(CFLAGS)dnl Flags for the compiler
|
|
AC_SUBST(ECL_CFLAGS)dnl Similar, but specific to ECL (see src/util/ecl-config)
|
|
AC_SUBST(CLIBS)dnl System & ECL libraries to be linked in
|
|
AC_SUBST(STATICLIBS)dnl Libraries used when linking ECL statically
|
|
AC_SUBST(LDFLAGS)dnl Flags for program linker
|
|
AC_SUBST(SHARED_LDFLAGS)dnl Flags for shared libraries linker
|
|
AC_SUBST(BUNDLE_LDFLAGS)dnl Flags for FASL files linker
|
|
AC_SUBST(SHORT_SITE_NAME)dnl Short name for the machine we built this on
|
|
AC_SUBST(LONG_SITE_NAME)dnl Long name for the machine we built this on
|
|
AC_SUBST(EXTRA_OBJS)dnl Extra *.o files to be compiled into libecl.a
|
|
AC_SUBST(TARGETS)dnl Versions of ECL to be built
|
|
AC_SUBST(TKLIBS)dnl Libraries with the Tcl/Tk components
|
|
AC_SUBST(SUBDIR)dnl Subdirectories that make should process
|
|
AC_SUBST(LIBRARIES)dnl GMP, Boehm's GC, etc
|
|
AC_SUBST(LSP_LIBRARIES)dnl Libraries produced by lisp translator
|
|
AC_SUBST(BOEHM_HEADERS)dnl Header path for Boehm GC
|
|
|
|
dnl ----------------------------------------------------------------------
|
|
dnl checks for UNIX variants that set DEFS
|
|
dnl
|
|
AC_CHECK_LIB(sun, getpwnam) # on IRIX adds -lsun
|
|
|
|
dnl ----------------------------------------------------------------------
|
|
dnl checks for header files
|
|
dnl
|
|
dnl AC_CHECK_HEADERS(unistd.h stdlib.h stdarg.h string.h)
|
|
AC_CHECK_HEADERS(sys/resource.h sys/utsname.h float.h pwd.h dlfcn.h link.h\
|
|
mach-o/dyld.h ulimit.h dirent.h sys/ioctl.h)
|
|
AC_CHECK_FUNCS(nanosleep alarm times isnanf select setenv putenv\
|
|
lstat mkstemp sigprocmask)
|
|
AC_ISC_POSIX
|
|
|
|
dnl ----------------------------------------------------------------------
|
|
dnl Installation directories
|
|
dnl
|
|
libdir="${libdir}/ecl"
|
|
includedir="${libdir}/ecl/h"
|
|
if test -z "${docdir}"; then docdir="${datadir}/doc/ecl"; fi
|
|
|
|
dnl ----------------------------------------------------------------------
|
|
dnl Checks which do not come with autoconf
|
|
dnl
|
|
ECL_MAKE_ABSOLUTE_SRCDIR()
|
|
ECL_CROSS_CONFIG()
|
|
ECL_GUESS_HOST_OS()
|
|
ECL_LINEFEED_MODE()
|
|
ECL_FIND_SETJMP()
|
|
ECL_FILE_STRUCTURE()
|
|
|
|
dnl ------------------------------------------------------------
|
|
dnl Find out how to install the INFO files.
|
|
dnl
|
|
AC_SUBST(INFOEXT)
|
|
AC_SUBST(INSTALL_INFO)
|
|
AC_PATH_PROG([INSTALL_INFO], [install-info], [foo], [$PATH:/sbin:/usr/sbin:/usr/etc])
|
|
if which gzip; then
|
|
INFOEXT=info.gz
|
|
else
|
|
INFOEXT=info
|
|
fi
|
|
|
|
dnl ----------------------------------------------------------------------
|
|
dnl Set options
|
|
dnl
|
|
gc_flags=""
|
|
TARGETS="ecl${EXEEXT}"
|
|
LIBRARIES=""
|
|
SUBDIR=c
|
|
CLIBS="${CLIBS} -lm"
|
|
STATICLIBS=""
|
|
if test ${boehm} = "no" ; then
|
|
EXTRA_OBJS="${EXTRA_OBJS} alloc.${OBJEXT} gbc.${OBJEXT}"
|
|
else
|
|
if test ${local_boehm} = "no"; then
|
|
SUBDIR="${SUBDIR} gc"
|
|
BOEHM_HEADERS="-I../include"
|
|
STATICLIBS="-leclgc"
|
|
if test ${shared} = "no"; then
|
|
LIBRARIES="${LIBRARIES} ${LIBPREFIX}eclgc.${LIBEXT}"
|
|
fi
|
|
else
|
|
BOEHM_HEADERS=""
|
|
CLIBS="-lgc ${CLIBS}"
|
|
fi
|
|
EXTRA_OBJS="${EXTRA_OBJS} alloc_2.${OBJEXT}"
|
|
AC_DEFINE(GBC_BOEHM)
|
|
fi
|
|
if test ${shared} = "yes"; then
|
|
AC_DEFINE(ENABLE_DLOPEN)
|
|
LSP_LIBRARIES="${SHAREDPREFIX}ecl.${SHAREDEXT}"
|
|
else
|
|
LSP_LIBRARIES="${LIBPREFIX}ecl.${LIBEXT}"
|
|
LDRPATH='~*'
|
|
fi
|
|
if test ${local_gmp} = "no" ; then
|
|
SUBDIR="${SUBDIR} gmp"
|
|
STATICLIBS="-leclgmp ${STATICLIBS}"
|
|
if test ${shared} = "no"; then
|
|
LIBRARIES="${LIBRARIES} ${LIBPREFIX}eclgmp.${LIBEXT}"
|
|
fi
|
|
else
|
|
CLIBS="-lgmp ${CLIBS}"
|
|
fi
|
|
if test ${runtime} ; then
|
|
AC_DEFINE(RUNTIME)
|
|
else
|
|
if test ${shared} = "yes" ; then
|
|
LSP_LIBRARIES="${LSP_LIBRARIES} cmp.fas sysfun.lsp"
|
|
else
|
|
LSP_LIBRARIES="${LSP_LIBRARIES} ${LIBPREFIX}cmp.${LIBEXT} sysfun.lsp"
|
|
fi
|
|
fi
|
|
if test ${tk} ; then
|
|
TKLIBS="-ltk -ltcl -lXpm @XLIBS@"
|
|
AC_DEFINE(TK)
|
|
fi
|
|
AC_SUBST(CLX_INFO)
|
|
if test ${clx} ; then
|
|
if test ${shared} = "yes" ; then
|
|
LSP_LIBRARIES="${LSP_LIBRARIES} clx.fas"
|
|
else
|
|
LSP_LIBRARIES="${LSP_LIBRARIES} ${LIBPREFIX}clx.${LIBEXT}"
|
|
fi
|
|
AC_DEFINE(CLX)
|
|
CLX_INFO="clx.${INFOEXT}"
|
|
else
|
|
CLX_INFO=""
|
|
fi
|
|
if test "${tcp}" -o "${clx}"; then
|
|
AC_DEFINE(TCP)
|
|
EXTRA_OBJS="${EXTRA_OBJS} tcp.${OBJEXT}"
|
|
if test ${shared} = "yes" ; then
|
|
LSP_LIBRARIES="${LSP_LIBRARIES} sockets.fas"
|
|
else
|
|
LSP_LIBRARIES="${LSP_LIBRARIES} ${LIBPREFIX}sockets.${LIBEXT}"
|
|
fi
|
|
CLIBS="${CLIBS} ${TCPLIBS}"
|
|
fi
|
|
if test "${oldloop}"; then
|
|
AC_DEFINE(ECL_OLD_LOOP)
|
|
fi
|
|
if test "${cmuformat}" = "yes"; then
|
|
closstreams="yes"
|
|
AC_DEFINE(ECL_CMU_FORMAT)
|
|
fi
|
|
if test "${closstreams}"; then
|
|
AC_DEFINE(ECL_CLOS_STREAMS)
|
|
fi
|
|
if test "${locative}" ; then
|
|
EXTRA_OBJS="${EXTRA_OBJS} unify.${OBJEXT}"
|
|
AC_DEFINE(LOCATIVE)
|
|
fi
|
|
AC_MSG_CHECKING(for threads support)
|
|
if test "${threads}" ; then
|
|
if test -z "${THREAD_OBJ}"; then
|
|
gc_flags="${gc_flags} --disable-threads"
|
|
threads='';
|
|
AC_MSG_RESULT(no)
|
|
else
|
|
gc_flags="${gc_flags} ${THREAD_GC_FLAGS}"
|
|
EXTRA_OBJS="${EXTRA_OBJS} ${THREAD_OBJ}.${OBJEXT}"
|
|
CLIBS="${THREAD_LDFLAGS} ${CLIBS}"
|
|
CFLAGS="${CFLAGS} ${THREAD_CFLAGS}"
|
|
AC_DEFINE(ECL_THREADS)
|
|
AC_MSG_RESULT(native threads)
|
|
fi
|
|
else
|
|
AC_MSG_RESULT(disabled)
|
|
gc_flags="${gc_flags} --disable-threads"
|
|
fi
|
|
if test ${usecxx} = "no" ; then
|
|
ECL_CC="${CC}"
|
|
else
|
|
ECL_CC="${CXX}"
|
|
gc_flags="${gc_flags} --enable-cplusplus"
|
|
fi
|
|
if test ! ${opcode8} = "no" ; then
|
|
AC_DEFINE(ECL_SMALL_BYTECODES)
|
|
fi
|
|
|
|
dnl ---------------------------------------------------------------------
|
|
dnl This flag is an optimization for GNU
|
|
dnl ---------------------------------------------------------------------
|
|
if test "${GCC}" = "yes"; then
|
|
CFLAGS="${CFLAGS} -fstrict-aliasing"
|
|
fi
|
|
|
|
dnl ----------------------------------------------------------------------
|
|
dnl Study the call conventions
|
|
dnl
|
|
ECL_STACK_DIRECTION()
|
|
|
|
dnl ---------------------------------------------------------------------
|
|
dnl Check the appropiate type for cl_fixnum/cl_index
|
|
dnl
|
|
ECL_FIXNUM_TYPE()
|
|
|
|
dnl # DEFS HAVE_UNISTD_H, HAVE_STDLIB_H, HAVE_STDARG_H
|
|
dnl # and HAVE_STRING_H
|
|
dnl AC_DIR_HEADER # directory reading functions, DEFS VOID_CLOSEDIR
|
|
dnl
|
|
dnl checks for typedefs
|
|
dnl
|
|
dnl AC_TYPE_SIZE_T # DEFS size_t
|
|
dnl AC_TYPE_PID_T # DEFS pid_t
|
|
dnl AC_TYPE_UID_T # DEFS uid_t, gid_t
|
|
dnl AC_TYPE_OFF_T # DEFS off_t
|
|
dnl
|
|
dnl checks for functions and declarations
|
|
dnl
|
|
dnl checks for compiler characteristics
|
|
dnl
|
|
AC_C_BIGENDIAN([AC_DEFINE(WORDS_BIGENDIAN)],
|
|
[],[AC_DEFINE(WORDS_BIGENDIAN,[/* EDIT!!! - Undefine if small endian */])])
|
|
dnl AC_C_CONST # DEFS const
|
|
dnl AC_C_CHAR_UNSIGNED # DEFS __CHAR_UNSIGNED__ if char is unsigned
|
|
|
|
dnl ---------------------------------------------------------------------
|
|
dnl X11 stuff
|
|
dnl
|
|
AC_PATH_X
|
|
AC_PATH_XTRA
|
|
|
|
XINCLUDES=""
|
|
XLIBS=""
|
|
|
|
if test "$x_includes" != ""
|
|
then
|
|
XINCLUDES=-I$x_includes
|
|
fi
|
|
|
|
if test "$x_libraries" != ""
|
|
then
|
|
XLIBS="-L$x_libraries"
|
|
fi
|
|
|
|
AC_SUBST(XINCLUDES)
|
|
AC_SUBST(XLIBS)
|
|
|
|
XLIBS="$XLIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
|
|
|
|
dnl ---------------------------------------------------------------------
|
|
dnl GNU multiprecision library
|
|
dnl
|
|
AC_MSG_CHECKING(for gmp...)
|
|
if test ${local_gmp} = "yes" ; then
|
|
AC_MSG_RESULT(already installed)
|
|
else
|
|
AC_MSG_RESULT(configuring local copy)
|
|
test -d gmp && rm -rf gmp
|
|
if mkdir gmp; then
|
|
(destdir=`${PWDCMD}`; cd gmp; CC="${CC} ${PICFLAG}" \
|
|
$srcdir/gmp/configure --disable-shared --prefix=${destdir} \
|
|
--infodir=${destdir}/doc --includedir=${destdir}/h \
|
|
--libdir=${destdir} --build=${build_alias} --host=${host_alias} $gmp_flags)
|
|
fi
|
|
fi
|
|
dnl ---------------------------------------------------------------------
|
|
dnl Boehm-Weiser garbage collector
|
|
dnl
|
|
AC_MSG_CHECKING(for Boehm-Weiser gc...)
|
|
if test ${boehm} = "no"; then
|
|
AC_MSG_RESULT(use small collector instead)
|
|
elif test "${local_boehm}" = "no" ; then
|
|
AC_MSG_RESULT(configuring local copy)
|
|
test -d gc && rm -rf gc
|
|
if mkdir gc; then
|
|
(destdir=`${PWDCMD}`; cd gc; CC="${CC} ${PICFLAG}" \
|
|
$srcdir/gc/configure --disable-shared --prefix=${destdir} \
|
|
--includedir=${destdir}/h --libdir=${destdir} --build=${build_alias} \
|
|
--host=${host_alias} ${gc_flags})
|
|
fi
|
|
else
|
|
AC_MSG_RESULT(already installed)
|
|
fi
|
|
dnl ---------------------------------------------------------------------
|
|
dnl Final pass over configuration files
|
|
dnl
|
|
dnl Notice that we build ${builddir}/h/configpre.h fron ${srcdir}/h/config.h.in,
|
|
dnl and then use all AC_DEF* to build h/config.h from h/configpre.h
|
|
dnl
|
|
AC_CONFIG_FILES(bare.lsp cmp/cmpcfg.lsp lsp/load.lsp clos/load.lsp cmp/load.lsp
|
|
../Makefile Makefile c/Makefile doc/Makefile doc/ecl.man
|
|
tk/Makefile tests/Makefile ansi-tests/Makefile gabriel/Makefile)
|
|
AC_CONFIG_FILES([ecl-config.pre:util/ecl-config])
|
|
AC_CONFIG_FILES([h/configpre:h/config.h.in])
|
|
AC_CONFIG_FILES([lsp/config.pre:lsp/config.lsp.in])
|
|
AC_CONFIG_FILES([compile.pre:compile.lsp.in])
|
|
AC_CONFIG_HEADER([h/config.h:h/configpre])
|
|
AC_OUTPUT
|