2003-08-30 12:16:52 -04:00
|
|
|
# $Id$
|
|
|
|
|
2023-02-13 07:01:10 -05:00
|
|
|
AC_INIT([elk],[3.99.8])
|
2023-02-13 06:50:10 -05:00
|
|
|
AC_CONFIG_SRCDIR([src/main.c])
|
2003-08-25 07:15:39 -04:00
|
|
|
|
2023-02-13 06:50:10 -05:00
|
|
|
AC_PREREQ([2.71])
|
2009-12-19 07:28:26 -05:00
|
|
|
AC_CONFIG_AUX_DIR(.auto)
|
2023-02-13 07:01:10 -05:00
|
|
|
AC_CANONICAL_HOST
|
2023-02-13 06:50:10 -05:00
|
|
|
AC_CANONICAL_TARGET
|
2003-08-25 07:15:39 -04:00
|
|
|
|
2023-02-13 07:01:10 -05:00
|
|
|
AM_INIT_AUTOMAKE
|
2009-12-19 07:28:26 -05:00
|
|
|
dnl AM_MAINTAINER_MODE
|
2023-02-13 07:01:10 -05:00
|
|
|
AC_CONFIG_HEADERS(config.h)
|
2003-08-25 07:15:39 -04:00
|
|
|
|
|
|
|
AC_PROG_CC
|
2003-08-25 14:28:02 -04:00
|
|
|
AM_PROG_CC_C_O
|
2003-09-05 21:57:13 -04:00
|
|
|
AC_PROG_CXX
|
2023-02-13 07:01:10 -05:00
|
|
|
|
|
|
|
LT_INIT([win32-dll])
|
2003-08-25 07:15:39 -04:00
|
|
|
|
|
|
|
AC_C_CONST
|
|
|
|
AC_C_INLINE
|
|
|
|
AC_TYPE_SIZE_T
|
|
|
|
|
2003-09-26 11:42:13 -04:00
|
|
|
# Check whether we are doing a native build
|
2003-09-26 12:21:24 -04:00
|
|
|
AM_CONDITIONAL(NATIVE_BUILD, test "${cross_compiling}" = "no")
|
2003-09-26 11:42:13 -04:00
|
|
|
|
2003-09-10 11:10:11 -04:00
|
|
|
AC_CHECK_HEADERS(inttypes.h,
|
|
|
|
[STDINT_HEADER="<inttypes.h>"],
|
|
|
|
[AC_CHECK_HEADERS(sys/inttypes.h,
|
|
|
|
[STDINT_HEADER="<sys/inttypes.h>"],
|
|
|
|
[AC_CHECK_HEADERS(sys/_inttypes.h,
|
|
|
|
[STDINT_HEADER="<sys/_inttypes.h>"],
|
|
|
|
[AC_CHECK_HEADERS(stdint.h,
|
|
|
|
[STDINT_HEADER="<stdint.h>"],
|
|
|
|
[AC_MSG_ERROR([cannot find C99 integer headers])])])])])
|
|
|
|
AC_DEFINE_UNQUOTED(STDINT_HEADER, [${STDINT_HEADER}], [Define the C99 integer types header])
|
2003-09-06 07:15:57 -04:00
|
|
|
AC_SUBST(STDINT_HEADER)
|
2003-09-05 21:57:13 -04:00
|
|
|
|
2003-08-25 10:17:09 -04:00
|
|
|
# $system should contain the name of this file. It may be used by some
|
|
|
|
# of the build scripts to do things that are specific to one single
|
|
|
|
# type of system.
|
2003-09-10 11:10:11 -04:00
|
|
|
AC_DEFINE_UNQUOTED(SYSTEMTYPE, ["${target_os}"], [Our operating system])
|
2003-08-25 07:15:39 -04:00
|
|
|
|
2003-10-07 15:20:35 -04:00
|
|
|
SYSTEM="${target_os}"
|
2003-09-17 09:18:59 -04:00
|
|
|
MATH_LIBS="-lm"
|
2003-09-10 18:40:44 -04:00
|
|
|
case "${target_os}" in
|
|
|
|
*hpux*)
|
|
|
|
AC_DEFINE(ARRAY_BROKEN, 1, [Define if a-=1000; a[1000] doesn't work])
|
|
|
|
;;
|
2003-09-17 09:18:59 -04:00
|
|
|
*mingw32*)
|
|
|
|
ELK_CFLAGS="${ELK_CFLAGS} -DELK_BUILD_DLL"
|
|
|
|
ELK_LDFLAGS="${ELK_LDFLAGS} -no-undefined"
|
|
|
|
MATH_LIBS=""
|
2003-10-07 15:20:35 -04:00
|
|
|
SYSTEM="mingw32"
|
|
|
|
;;
|
|
|
|
*cygwin*)
|
|
|
|
SYSTEM="cygwin"
|
2003-09-17 09:18:59 -04:00
|
|
|
;;
|
2003-09-26 11:32:16 -04:00
|
|
|
*darwin*)
|
2003-09-27 10:41:16 -04:00
|
|
|
AC_DEFINE(SYS_DARWIN, 1, Define if the system is Darwin)
|
2003-09-26 11:32:16 -04:00
|
|
|
;;
|
2003-09-10 18:40:44 -04:00
|
|
|
esac
|
2003-09-17 09:18:59 -04:00
|
|
|
ELK_LIBS="${ELK_LIBS} ${MATH_LIBS}"
|
2003-09-10 18:40:44 -04:00
|
|
|
|
2003-10-05 18:52:37 -04:00
|
|
|
# Various required headers
|
|
|
|
AC_CHECK_HEADERS(pwd.h grp.h sys/resource.h)
|
|
|
|
|
|
|
|
# The UNIX extension likes to know which of the following system calls,
|
|
|
|
# library functions, and include files are supported by the system.
|
|
|
|
AC_CHECK_HEADERS(utime.h sys/utime.h sys/wait.h sys/times.h dirent.h netdb.h)
|
|
|
|
AC_CHECK_FUNCS(waitpid wait3 wait4 vfork uname gethostname gettimeofday ftime)
|
|
|
|
AC_CHECK_FUNCS(mktemp tmpnam tempnam getcwd getwd rename regcomp environ)
|
|
|
|
AC_MSG_CHECKING(for __environ in unistd.h)
|
|
|
|
AC_EGREP_HEADER(__environ, unistd.h,
|
|
|
|
[AC_MSG_RESULT(yes)
|
|
|
|
AC_DEFINE(__ENVIRON_IN_UNISTD_H, 1, Define if <unistd.h> defines __environ)],
|
|
|
|
[AC_MSG_RESULT(no)])
|
|
|
|
AC_MSG_CHECKING(for environ in unistd.h)
|
|
|
|
AC_EGREP_HEADER(environ, unistd.h,
|
|
|
|
[AC_MSG_RESULT(yes)
|
|
|
|
AC_DEFINE(ENVIRON_IN_UNISTD_H, 1, Define if <unistd.h> defines environ)],
|
|
|
|
[AC_MSG_RESULT(no)])
|
|
|
|
|
2003-08-25 10:17:09 -04:00
|
|
|
# Does the system support the vprintf library function? If not,
|
|
|
|
# availability of the (non-portable) _doprnt function is assumed.
|
|
|
|
AC_CHECK_FUNCS(vprintf)
|
2003-08-25 07:15:39 -04:00
|
|
|
|
2003-08-25 10:17:09 -04:00
|
|
|
# Does the directory(3) library follow the POSIX conventions (i.e.
|
|
|
|
# requires the <dirent.h> include file and uses "struct dirent")?
|
|
|
|
# If not, the (obsolete) BSD-style interface with <sys/dir.h> and
|
|
|
|
# "struct direct" is assumed.
|
|
|
|
AC_CHECK_FUNCS(dirent)
|
2003-08-25 07:15:39 -04:00
|
|
|
|
2003-08-25 10:17:09 -04:00
|
|
|
# Does the system have the random/srandom library functions? If not,
|
|
|
|
# rand/srand will be used instead.
|
|
|
|
AC_CHECK_FUNCS(random)
|
2003-08-25 07:15:39 -04:00
|
|
|
|
2003-08-25 10:17:09 -04:00
|
|
|
# Does the system have the index library function? If not, strchr
|
|
|
|
# will be used.
|
2003-09-09 11:18:55 -04:00
|
|
|
AC_CHECK_FUNCS(index)
|
2003-08-25 07:15:39 -04:00
|
|
|
|
2003-08-25 10:17:09 -04:00
|
|
|
# Does the system have the bcopy, bzero, and bcmp library functions?
|
|
|
|
# If not, memcpy/memset/memcmp will be used.
|
|
|
|
dnl FIXME
|
|
|
|
|
|
|
|
# Does using the access system call require <unistd.h> to be included?
|
|
|
|
# (Look into the manual page for access if in doubt.)
|
|
|
|
AC_CHECK_HEADERS(unistd.h)
|
|
|
|
|
|
|
|
# If the FIONREAD ioctl command is defined, which file must be included?
|
2003-09-07 10:28:01 -04:00
|
|
|
AC_CHECK_HEADERS(termios.h sys/ioctl.h sys/filio.h)
|
2003-08-25 10:17:09 -04:00
|
|
|
|
|
|
|
# If getdtablesize() is available to determine the maximum number of open
|
|
|
|
# files per process, set getdtablesize=yes.
|
|
|
|
# Alternatively, if POSIX-style sysconf() can be called with _SC_OPEN_MAX,
|
|
|
|
# set sysconf_open_max=yes.
|
|
|
|
# If neither is set to "yes", an educated guess will be made.
|
|
|
|
AC_CHECK_FUNCS(getdtablesize)
|
|
|
|
|
|
|
|
# If POSIX-style pathconf() can be invoked with _PC_PATH_MAX to determine
|
|
|
|
# the maximum pathname length, set pathconf_path_max=yes.
|
|
|
|
|
|
|
|
# If the system page size can be determined by calling getpagesize()
|
|
|
|
# set getpagesize=yes.
|
|
|
|
# Alternatively, if sysconf() can be invoked with _SC_PAGESIZE, set
|
|
|
|
# sysconf_pagesize=yes.
|
|
|
|
# These two variables are only required if the generational garbage
|
|
|
|
# collector is used.
|
|
|
|
AC_CHECK_FUNCS(getpagesize)
|
|
|
|
|
|
|
|
# Set reliable_signals=bsd if your system supports BSD-style reliable
|
|
|
|
# signals (has sigblock and related functions); set reliable_signals=posix
|
|
|
|
# for POSIX-style signals (sigprocmask, sigsets); otherwise old V7/SysV
|
|
|
|
# signal semantics are assumed.
|
2003-09-09 11:18:55 -04:00
|
|
|
AC_CHECK_HEADERS(signal.h)
|
|
|
|
AC_CHECK_FUNCS(sigprocmask sigblock)
|
2003-08-25 10:17:09 -04:00
|
|
|
|
|
|
|
# To support dynamic loading of object files and "dump", the system's
|
|
|
|
# a.out format has to be known. Choose one of the following:
|
|
|
|
#
|
|
|
|
# coff ecoff xcoff elf macho hp9k convex
|
|
|
|
#
|
|
|
|
# Other values of "aout_format" are interpreted as BSD-style a.out format.
|
2003-08-25 08:38:36 -04:00
|
|
|
if false; then
|
2003-08-25 10:17:09 -04:00
|
|
|
AC_DEFINE(COFF, 1, [FIXME HARD])
|
2003-08-25 08:38:36 -04:00
|
|
|
fi
|
2003-09-06 10:45:29 -04:00
|
|
|
|
2003-08-25 08:38:36 -04:00
|
|
|
if false; then
|
2003-08-25 10:17:09 -04:00
|
|
|
AC_DEFINE(ECOFF, 1, [FIXME HARD])
|
2003-08-25 08:38:36 -04:00
|
|
|
fi
|
2003-09-06 10:45:29 -04:00
|
|
|
|
2003-08-25 08:38:36 -04:00
|
|
|
if false; then
|
2003-08-25 10:17:09 -04:00
|
|
|
AC_DEFINE(XCOFF, 1, [FIXME HARD])
|
2003-08-25 08:38:36 -04:00
|
|
|
fi
|
2003-09-06 10:45:29 -04:00
|
|
|
|
|
|
|
AC_CHECK_LIB(elf, elf_begin, ac_cv_my_have_elf=yes, ac_cv_my_have_elf=no)
|
2003-09-07 07:18:38 -04:00
|
|
|
AM_CONDITIONAL(HAVE_LIBELF, test "${ac_cv_my_have_elf}" = "yes")
|
2003-09-06 10:45:29 -04:00
|
|
|
|
2003-08-25 08:38:36 -04:00
|
|
|
if false; then
|
2003-08-25 10:17:09 -04:00
|
|
|
AC_DEFINE(MACH_O, 1, [FIXME HARD])
|
2003-08-25 08:38:36 -04:00
|
|
|
fi
|
2003-09-06 10:45:29 -04:00
|
|
|
|
2003-08-25 08:38:36 -04:00
|
|
|
if false; then
|
2003-08-25 10:17:09 -04:00
|
|
|
AC_DEFINE(CONVEX_AOUT, 1, [FIXME HARD])
|
2003-08-25 08:38:36 -04:00
|
|
|
fi
|
2003-09-06 10:45:29 -04:00
|
|
|
|
2003-08-25 08:38:36 -04:00
|
|
|
if false; then
|
2003-08-25 10:17:09 -04:00
|
|
|
AC_DEFINE(HP9K, 1, [FIXME HARD])
|
2003-08-25 08:38:36 -04:00
|
|
|
fi
|
2003-08-25 10:17:09 -04:00
|
|
|
|
2003-09-06 10:45:29 -04:00
|
|
|
if test "${ac_cv_my_have_elf}" = "yes"; then
|
|
|
|
AC_DEFINE(HAVE_LIBELF, 1, Define if you have libelf.)
|
2003-09-06 12:19:02 -04:00
|
|
|
ELK_LIBS="${ELK_LIBS} -lelf"
|
2003-09-06 12:05:42 -04:00
|
|
|
ac_cv_my_can_dump=yes
|
2003-09-06 10:45:29 -04:00
|
|
|
else
|
2003-09-06 12:05:42 -04:00
|
|
|
ac_cv_my_can_dump=no
|
2003-09-06 10:45:29 -04:00
|
|
|
dnl AC_MSG_ERROR([could not handle the native object format, if you are running Linux please install the libelf development headers])
|
|
|
|
fi
|
|
|
|
|
2003-08-25 10:17:09 -04:00
|
|
|
# Which mechanism should be used to dynamically load object files?
|
2003-09-07 07:18:38 -04:00
|
|
|
ac_cv_my_can_load_lib=no
|
2003-09-07 16:23:47 -04:00
|
|
|
|
2003-09-09 09:30:23 -04:00
|
|
|
# OS X style
|
2003-09-07 16:23:47 -04:00
|
|
|
AC_CHECK_HEADERS(mach-o/dyld.h,
|
|
|
|
[AC_CHECK_FUNCS(NSLinkModule,
|
|
|
|
[AC_DEFINE(HAVE_DL_DYLD, 1, [Define if you have the Darwin dyld API])
|
2003-09-07 18:07:33 -04:00
|
|
|
AC_DEFINE(SYMS_BEGIN_WITH, ['_'], [Define if symbols start with '_'])
|
2003-09-07 16:23:47 -04:00
|
|
|
ac_cv_my_can_load_lib=yes])])
|
|
|
|
|
2003-09-09 09:30:23 -04:00
|
|
|
# HP-UX style
|
|
|
|
if test "${ac_cv_my_can_load_lib}" = "no"; then
|
|
|
|
AC_CHECK_HEADERS(dl.h)
|
|
|
|
ac_cv_my_have_shl_load=no
|
|
|
|
AC_CHECK_FUNC(shl_load,
|
|
|
|
[ac_cv_my_have_shl_load=yes,
|
|
|
|
AC_CHECK_LIB(dld, shl_load,
|
|
|
|
[ac_cv_my_have_shl_load=yes
|
|
|
|
ELK_LIBS="${ELK_LIBS} -ldld"])])
|
|
|
|
if test "${ac_cv_my_have_shl_load}" = "yes"; then
|
|
|
|
AC_DEFINE(HAVE_DL_SHL_LOAD, 1, [Define if you have the shl_load API])
|
|
|
|
ac_cv_my_can_load_lib=yes
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Whatever style
|
|
|
|
if test "${ac_cv_my_can_load_lib}" = "no"; then
|
|
|
|
AC_CHECK_LIB(dld, dld_link,
|
|
|
|
[ELK_LIBS="${ELK_LIBS} -ldld"
|
|
|
|
AC_DEFINE(HAVE_DL_DLD_LINK, 1, [Define if you have the GNU dld library])
|
|
|
|
ac_cv_my_can_load_lib=yes])
|
|
|
|
fi
|
|
|
|
|
2003-10-05 09:11:41 -04:00
|
|
|
# BeOS style
|
|
|
|
if test "${ac_cv_my_can_load_lib}" = "no"; then
|
|
|
|
AC_CHECK_HEADERS(image.h)
|
|
|
|
AC_CHECK_FUNCS(load_add_on,
|
|
|
|
[AC_DEFINE(HAVE_DL_BEOS, 1, [Define if you have the BeOS dl])
|
|
|
|
ac_cv_my_can_load_lib=yes])
|
|
|
|
fi
|
|
|
|
|
2003-09-17 09:18:59 -04:00
|
|
|
# Win32 style
|
|
|
|
if test "${ac_cv_my_can_load_lib}" = "no"; then
|
2003-10-07 15:20:35 -04:00
|
|
|
if test "${SYSTEM}" = "mingw32" -o "${SYSTEM}" = "cygwin"; then
|
|
|
|
AC_CHECK_LIB(kernel32, main,
|
|
|
|
[ELK_LIBS="${ELK_LIBS} -lkernel32"
|
|
|
|
AC_DEFINE(HAVE_DL_WINDOWS, 1, [Define if you have Windows' LoadLibrary])
|
|
|
|
ac_cv_my_can_load_lib=yes])
|
|
|
|
fi
|
2003-09-17 09:18:59 -04:00
|
|
|
fi
|
|
|
|
|
2003-09-07 18:07:33 -04:00
|
|
|
AC_CHECK_HEADERS(a.out.h)
|
2003-09-07 07:18:38 -04:00
|
|
|
|
2003-09-07 16:23:47 -04:00
|
|
|
# Only test for dlopen() if the others didn't work
|
|
|
|
if test "${ac_cv_my_can_load_lib}" = "no"; then
|
2003-09-09 09:30:23 -04:00
|
|
|
AC_CHECK_HEADERS(dlfcn.h sys/dl.h)
|
|
|
|
ac_cv_my_have_dlopen=no
|
|
|
|
AC_CHECK_FUNC(dlopen,
|
|
|
|
ac_cv_my_have_dlopen=yes,
|
|
|
|
AC_CHECK_LIB(dl, dlopen,
|
|
|
|
ac_cv_my_have_dlopen=yes
|
|
|
|
ELK_LIBS="${ELK_LIBS} -ldl",
|
|
|
|
AC_CHECK_LIB(svld, dlopen,
|
|
|
|
ac_cv_my_have_dlopen=yes
|
|
|
|
ELK_LIBS="${ELK_LIBS} -lsvld")))
|
|
|
|
if test "${ac_cv_my_have_dlopen}" = "yes"; then
|
|
|
|
AC_DEFINE(HAVE_DL_DLOPEN, 1, [Define if you have the dlopen API])
|
|
|
|
ac_cv_my_can_load_lib=yes
|
|
|
|
fi
|
2003-09-07 16:23:47 -04:00
|
|
|
fi
|
|
|
|
|
2003-09-06 12:05:42 -04:00
|
|
|
if test "${ac_cv_my_can_load_lib}" = "yes"; then
|
2003-09-07 16:23:47 -04:00
|
|
|
AC_DEFINE(CAN_LOAD_LIB, 1, [Define if dynamic loading is supported])
|
2003-09-06 12:05:42 -04:00
|
|
|
fi
|
|
|
|
|
2003-09-07 07:18:38 -04:00
|
|
|
# Systems with "aout_format=ecoff" may require a call to the cacheflush
|
|
|
|
# system call after an object file has been loaded. Which include file
|
|
|
|
# has to be included in this case?
|
|
|
|
AC_DEFINE(CACHECTL_H, <sys/cachectl.h>, [FIXME HARD])
|
2003-08-25 10:17:09 -04:00
|
|
|
|
2003-09-07 07:18:38 -04:00
|
|
|
# Is the ANSI-C atexit function supported to register an exit handler?
|
|
|
|
# If not, the exit library function will be redefined and will end in
|
|
|
|
# a call to _exit.
|
|
|
|
AC_CHECK_FUNCS(atexit)
|
2003-08-25 10:17:09 -04:00
|
|
|
|
|
|
|
# The symbol prefixes of extension initialization and finalization
|
|
|
|
# functions (without the initial $syms_begin_with). Do not change
|
|
|
|
# these unless the compiler or linker restricts the length of symbols!
|
|
|
|
AC_DEFINE(INIT_PREFIX, "elk_init_", [FIXME HARD])
|
|
|
|
AC_DEFINE(FINIT_PREFIX, "elk_finit_", [FIXME HARD])
|
|
|
|
|
|
|
|
# Is the "dump" function supported?
|
2003-09-06 12:05:42 -04:00
|
|
|
if test "${ac_cv_my_can_dump}" = "yes"; then
|
|
|
|
AC_DEFINE(CAN_DUMP, 1, [FIXME HARD])
|
|
|
|
fi
|
2003-08-25 10:17:09 -04:00
|
|
|
|
|
|
|
# Is the fchmod system call broken or unavailable?
|
|
|
|
if false; then
|
|
|
|
AC_DEFINE(FCHMOD_BROKEN, 1, [FIXME HARD])
|
|
|
|
fi
|
|
|
|
|
|
|
|
# These four variables are only relevant if the system has the BSD-style
|
|
|
|
# a.out format.
|
|
|
|
# segment_size is the segment size of the system's memory management
|
|
|
|
# unit, i.e. the number to a multiple of which the size of an a.out
|
|
|
|
# segment (e.g. .text) is rounded up.
|
|
|
|
# file_text_start is the file offset at which the text segment starts
|
|
|
|
# in an a.out file.
|
|
|
|
# mem_text_start is the starting address of the text segment in memory.
|
|
|
|
# text_length_adj must be set to "sizeof (struct exec)" if the length of
|
|
|
|
# the text segment stored in the a.out header includes the a.out header
|
|
|
|
# itself.
|
|
|
|
AC_DEFINE(SEG_SIZ, 1024, [FIXME HARD])
|
|
|
|
AC_DEFINE(FILE_TEXT_START, N_TXTOFF(hdr), [FIXME HARD])
|
|
|
|
AC_DEFINE(MEM_TEXT_START, 0, [FIXME HARD])
|
|
|
|
AC_DEFINE(TEXT_LENGTH_ADJ, 0, [FIXME HARD])
|
|
|
|
|
|
|
|
# Only relevant if "aout_format=coff": the system's pagesize.
|
|
|
|
AC_DEFINE(COFF_PAGESIZE, 4096, [FIXME HARD])
|
|
|
|
|
|
|
|
# Only relevant if "aout_format=hp9k" and "load_obj=shl"
|
|
|
|
AC_DEFINE(HPSHLIB, 1, [FIXME HARD])
|
|
|
|
|
|
|
|
# Print debug messages when dumping
|
|
|
|
AC_DEFINE(DEBUG_DUMP, 1, [FIXME HARD])
|
|
|
|
|
|
|
|
# Is the "termio" terminal interface supported by the system? If not,
|
|
|
|
# BSD-style tty handling will be used.
|
|
|
|
AC_DEFINE(TERMIO, 1, [FIXME HARD])
|
|
|
|
|
|
|
|
# flush_stdio and flush_tty indicate how clear-input/output-port can
|
|
|
|
# flush (purge) a FILE pointer and a TTY file descriptor.
|
|
|
|
# Possible values of flush_stdio:
|
|
|
|
# bsd assume old BSD-style FILE* (with _cnt, _ptr, _base)
|
|
|
|
# fpurge use 4.4BSD-style fpurge stdio library function
|
|
|
|
# Possible values of flush_tty:
|
|
|
|
# tiocflush use TIOCFLUSH ioctl from <sys/ioctl.h>
|
|
|
|
# tcflsh use TCFLSH ioctl from <termio.h>
|
|
|
|
# Leave the variable(s) empty if flushing is not supported.
|
2003-09-07 10:28:01 -04:00
|
|
|
AC_CHECK_FUNCS(fpurge)
|
|
|
|
|
|
|
|
AC_CACHE_CHECK([for BSD-style flushing],
|
|
|
|
[ac_cv_have_bsd_flush],
|
2023-02-13 06:50:10 -05:00
|
|
|
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]], [[FILE *f;
|
2003-09-07 10:28:01 -04:00
|
|
|
f->_cnt = 0;
|
2023-02-13 06:50:10 -05:00
|
|
|
f->_ptr = f->_base;]])],[ac_cv_have_bsd_flush=yes],[ac_cv_have_bsd_flush=no])])
|
2003-09-07 10:28:01 -04:00
|
|
|
if test "${ac_cv_have_bsd_flush}" = "yes"; then
|
|
|
|
AC_DEFINE(HAVE_BSD_FLUSH, 1, [Define if you have BSD-style flushing])
|
2003-08-25 08:38:36 -04:00
|
|
|
fi
|
2003-09-07 10:28:01 -04:00
|
|
|
|
|
|
|
AC_CHECK_HEADERS(termio.h termios.h)
|
2003-08-25 10:17:09 -04:00
|
|
|
|
|
|
|
# The interpreter uses the getrlimit function to determine the maximum
|
|
|
|
# stack size of the running program. If this function is not supported,
|
|
|
|
# set max_stack_size to a (fixed) maximum stack size (in bytes).
|
2003-09-09 11:18:55 -04:00
|
|
|
AC_CHECK_FUNCS(getrlimit)
|
2003-10-05 18:52:37 -04:00
|
|
|
AC_CACHE_CHECK([for struct rlimit],
|
|
|
|
[ac_cv_have_struct_rlimit],
|
2023-02-13 06:50:10 -05:00
|
|
|
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef HAVE_SYS_TIME_H
|
2003-10-05 18:52:37 -04:00
|
|
|
# include <sys/time.h>
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_SYS_RESOURCE_H
|
|
|
|
# include <sys/resource.h>
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_UNISTD_H
|
|
|
|
# include <unistd.h>
|
2023-02-13 06:50:10 -05:00
|
|
|
#endif]], [[struct rlimit rl;]])],[ac_cv_have_struct_rlimit=yes],[ac_cv_have_struct_rlimit=no])])
|
2003-10-05 18:52:37 -04:00
|
|
|
if test "${ac_cv_have_struct_rlimit}" = "yes"; then
|
|
|
|
AC_DEFINE(HAVE_STRUCT_RLIMIT, 1, [Define if you have struct rlimit])
|
|
|
|
fi
|
2003-09-09 11:18:55 -04:00
|
|
|
AC_DEFINE(DEFAULT_MAX_STACK_SIZE, 1024*1024, [Define default max stack size])
|
2003-08-25 10:17:09 -04:00
|
|
|
|
|
|
|
# Is the mprotect system call supported? The generational garbage collector
|
|
|
|
# requires mprotect to implement incremental GC. $mprotect is ignored if
|
|
|
|
# generational_gc is set to "no" in the site file. Set mprotect=mmap if
|
|
|
|
# mprotect is supported, but only for mmap()ed memory.
|
|
|
|
AC_CHECK_FUNCS(mprotect)
|
2003-08-25 11:01:22 -04:00
|
|
|
if false; then
|
|
|
|
AC_DEFINE(MPROTECT_SIG, 1, [FIXME HARD])
|
|
|
|
fi
|
2003-08-25 08:38:36 -04:00
|
|
|
if false; then
|
2003-08-25 10:17:09 -04:00
|
|
|
AC_DEFINE(MPROTECT_MMAP, 1, [FIXME HARD])
|
2003-08-25 08:38:36 -04:00
|
|
|
fi
|
2003-08-25 10:17:09 -04:00
|
|
|
|
|
|
|
# How can a SIGSEGV or SIGBUS signal handler find out the address of
|
|
|
|
# the faulting memory reference? This variable is only used if
|
|
|
|
# $mprotect is "yes" or "mmap". Possible values are:
|
|
|
|
#
|
|
|
|
# siginfo handler is called with siginfo_t structure (enabled
|
|
|
|
# by a call to sigaction)
|
|
|
|
# sigcontext address is in the sigcontext structure (3rd arg, sc_badvaddr)
|
|
|
|
# arg4 address is delivered to handler as argument #4
|
|
|
|
# aix use an AIX-specific hack to get hold of the bad address
|
|
|
|
# hpux use a HP-UX-specific hack
|
2003-08-25 08:38:36 -04:00
|
|
|
if false; then
|
2003-08-25 10:17:09 -04:00
|
|
|
AC_DEFINE(SIGSEGV_SIGINFO, 1, [FIXME HARD])
|
2003-08-25 08:38:36 -04:00
|
|
|
fi
|
|
|
|
if false; then
|
2003-08-25 10:17:09 -04:00
|
|
|
AC_DEFINE(SIGSEGV_SIGCONTEXT, 1, [FIXME HARD])
|
2003-08-25 08:38:36 -04:00
|
|
|
fi
|
|
|
|
if false; then
|
2003-08-25 10:17:09 -04:00
|
|
|
AC_DEFINE(SIGSEGV_ARG4, 1, [FIXME HARD])
|
2003-08-25 08:38:36 -04:00
|
|
|
fi
|
|
|
|
if false; then
|
2003-08-25 10:17:09 -04:00
|
|
|
AC_DEFINE(SIGSEGV_AIX, 1, [FIXME HARD])
|
2003-08-25 08:38:36 -04:00
|
|
|
fi
|
|
|
|
if false; then
|
2003-08-25 10:17:09 -04:00
|
|
|
AC_DEFINE(SIGSEGV_HPUX, 1, [FIXME HARD])
|
2003-08-25 08:38:36 -04:00
|
|
|
fi
|
2003-08-25 10:17:09 -04:00
|
|
|
|
|
|
|
# Does the system support the alloca library function, and does this
|
|
|
|
# function actually extend the stack? If in doubt, extract alloca.o
|
|
|
|
# from the C library and check if it contains the symbols malloc and free.
|
|
|
|
# If this is the case, forget it.
|
2003-09-10 11:10:11 -04:00
|
|
|
AC_FUNC_ALLOCA
|
|
|
|
dnl AC_CHECK_FUNCS(alloca)
|
2003-08-25 10:17:09 -04:00
|
|
|
|
|
|
|
# Must <alloca.h> be included to use alloca? Is "#pragma alloca" required?
|
|
|
|
AC_CHECK_HEADERS(alloca.h)
|
2003-08-25 08:38:36 -04:00
|
|
|
if false; then
|
2003-08-25 10:17:09 -04:00
|
|
|
AC_DEFINE(PRAGMA_ALLOCA, 1, [FIXME HARD])
|
2003-08-25 08:38:36 -04:00
|
|
|
fi
|
2003-08-25 10:17:09 -04:00
|
|
|
|
|
|
|
# Does the system (or compiler) require certain objects (e.g. doubles)
|
|
|
|
# to be aligned at 8-byte boundaries? If not, 4-byte alignment will
|
|
|
|
# be assumed.
|
2003-08-25 08:38:36 -04:00
|
|
|
if false; then
|
2003-08-25 10:17:09 -04:00
|
|
|
AC_DEFINE(ALIGN_8BYTE, 1, [FIXME HARD])
|
2003-08-25 08:38:36 -04:00
|
|
|
fi
|
2003-08-25 10:17:09 -04:00
|
|
|
|
|
|
|
# The name of the linker. This is usually just "ld", or /usr/ccs/bin/ld
|
|
|
|
# in SVR4-based systems.
|
|
|
|
AC_DEFINE(LD_NAME, "ld", [FIXME HARD])
|
|
|
|
|
|
|
|
# Does your C preprocessor support the ANSI-C ## operator, although
|
|
|
|
# __STDC__ is not defined?
|
|
|
|
AC_DEFINE(ANSI_CPP, 1, [FIXME HARD])
|
|
|
|
|
|
|
|
# Element type of the gidset argument of getgroups(); typically int
|
|
|
|
# or gid_t. Only needed by the UNIX extension.
|
|
|
|
AC_DEFINE(GETGROUPS_TYPE, gid_t, [FIXME HARD])
|
|
|
|
|
|
|
|
# Do you want to use the generational garbage collector? If not, the
|
|
|
|
# stop-and-copy garbage collector will be used.
|
|
|
|
AC_DEFINE(GENERATIONAL_GC, 1, [FIXME HARD])
|
|
|
|
|
|
|
|
# The default heap size of the Scheme interpreter in KBytes (if the
|
|
|
|
# stop-and-copy garbage collector is used).
|
|
|
|
AC_DEFINE(HEAP_SIZE, 1024, [FIXME HARD])
|
|
|
|
|
2003-11-26 12:50:30 -05:00
|
|
|
# The directory where all files are installed by running "make install". We
|
|
|
|
# cannot use AC_DEFINE_UNQUOTED here because ${prefix} is not set until the
|
|
|
|
# end of the configure script. Thanks to Phillip Rulon for spotting that.
|
2003-12-08 05:48:49 -05:00
|
|
|
CPPFLAGS="${CPPFLAGS} -DSCM_DIR=\"\\\"\$(prefix)/share/elk\\\"\""
|
|
|
|
CPPFLAGS="${CPPFLAGS} -DLIB_DIR=\"\\\"\$(prefix)/lib/elk\\\"\""
|
2003-08-25 10:17:09 -04:00
|
|
|
|
|
|
|
#define FIND_AOUT defined(USE_LD) || defined(CAN_DUMP) || defined(INIT_OBJECTS)
|
|
|
|
AC_DEFINE(FIND_AOUT, 1, [FIXME HARD])
|
|
|
|
|
|
|
|
dnl
|
2003-09-05 22:33:10 -04:00
|
|
|
dnl Check for available compiler features
|
2003-08-25 10:17:09 -04:00
|
|
|
dnl
|
|
|
|
CFLAGS_save="${CFLAGS}"
|
2003-09-06 07:15:57 -04:00
|
|
|
LDFLAGS_save="${LDFLAGS}"
|
|
|
|
|
2003-09-19 22:27:44 -04:00
|
|
|
AC_CACHE_CHECK([if \$CXX really works],
|
|
|
|
[ac_cv_my_have_cxx],
|
|
|
|
[AC_LANG_PUSH(C++)
|
2023-02-13 06:50:10 -05:00
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[ac_cv_my_have_cxx=yes],[ac_cv_my_have_cxx=no])
|
2003-09-19 22:27:44 -04:00
|
|
|
AC_LANG_POP(C++)])
|
2003-09-06 07:15:57 -04:00
|
|
|
AM_CONDITIONAL(HAVE_CXX, test "${ac_cv_my_have_cxx}" = "yes")
|
2003-08-25 10:17:09 -04:00
|
|
|
|
|
|
|
AC_CACHE_CHECK([if \$CC accepts -Wall],
|
2003-09-05 22:33:10 -04:00
|
|
|
[ac_cv_c_Wall],
|
|
|
|
[CFLAGS="-Wall ${CFLAGS_save}"
|
2023-02-13 06:50:10 -05:00
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[ac_cv_c_Wall=yes],[ac_cv_c_Wall=no])])
|
2003-08-25 10:17:09 -04:00
|
|
|
if test "x${ac_cv_c_Wall}" != "xno"; then
|
2003-09-05 22:33:10 -04:00
|
|
|
CFLAGS_save="-Wall ${CFLAGS_save}"
|
2003-08-25 08:38:36 -04:00
|
|
|
fi
|
2003-08-25 10:17:09 -04:00
|
|
|
|
2004-08-09 16:08:52 -04:00
|
|
|
# Code qui fait des warnings == code de porc == deux baffes dans ta gueule
|
2006-09-17 07:08:01 -04:00
|
|
|
CFLAGS_warn="-Wpointer-arith -Wcast-align -Wcast-qual -Wshadow -Wmissing-prototypes -Wnested-externs -Wsign-compare"
|
2004-08-09 16:08:52 -04:00
|
|
|
AC_CACHE_CHECK([if \$CC accepts ${CFLAGS_warn}],
|
|
|
|
[ac_cv_c_Wwarn],
|
|
|
|
[CFLAGS="${CFLAGS_warn} ${CFLAGS_save}"
|
2023-02-13 06:50:10 -05:00
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[ac_cv_c_Wwarn=yes],[ac_cv_c_Wwarn=no])])
|
2004-08-09 16:08:52 -04:00
|
|
|
if test "x${ac_cv_c_Wwarn}" != "xno"; then
|
|
|
|
CFLAGS_save="${CFLAGS_warn} ${CFLAGS_save}"
|
2003-08-25 08:38:36 -04:00
|
|
|
fi
|
|
|
|
|
2003-09-06 07:15:57 -04:00
|
|
|
dnl
|
|
|
|
dnl Check for available headers and libraries
|
|
|
|
dnl
|
2003-08-25 10:17:09 -04:00
|
|
|
CFLAGS="${CFLAGS_save}"
|
2003-09-06 07:15:57 -04:00
|
|
|
LDFLAGS="${LDFLAGS_save}"
|
2003-08-25 07:15:39 -04:00
|
|
|
|
2003-09-15 07:09:21 -04:00
|
|
|
AM_CONDITIONAL(HAVE_MONITOR, false)
|
|
|
|
|
2003-09-06 10:45:29 -04:00
|
|
|
AC_CHECK_LIB(gdbm, gdbm_open, ac_cv_my_have_gdbm=yes, ac_cv_my_have_gdbm=no)
|
2003-09-06 07:15:57 -04:00
|
|
|
AM_CONDITIONAL(HAVE_GDBM, test "${ac_cv_my_have_gdbm}" = "yes")
|
2003-08-26 21:17:40 -04:00
|
|
|
|
2003-09-06 07:15:57 -04:00
|
|
|
AC_PATH_X
|
2006-06-14 11:06:05 -04:00
|
|
|
if test -n "${x_includes}"; then x_cflags="-I${x_includes}"; fi
|
|
|
|
if test -n "${x_libraries}"; then x_libs="-I${x_libraries}"; fi
|
2003-08-26 21:17:40 -04:00
|
|
|
|
2003-09-26 11:42:13 -04:00
|
|
|
AC_CHECK_LIB(X11, XOpenDisplay,
|
|
|
|
[ac_cv_my_have_x11=yes
|
2006-06-14 11:06:05 -04:00
|
|
|
X_CFLAGS="${x_cflags}"
|
|
|
|
X_LIBS="${x_libs} -lX11"],
|
2003-09-26 11:42:13 -04:00
|
|
|
[ac_cv_my_have_x11=no],
|
2006-06-14 11:06:05 -04:00
|
|
|
[[${x_libs}]])
|
2003-09-06 07:15:57 -04:00
|
|
|
AM_CONDITIONAL(HAVE_X11, test "${ac_cv_my_have_x11}" = "yes")
|
2003-08-26 21:17:40 -04:00
|
|
|
AC_SUBST(X_CFLAGS)
|
|
|
|
AC_SUBST(X_LIBS)
|
2003-09-06 07:15:57 -04:00
|
|
|
|
2003-09-28 05:57:09 -04:00
|
|
|
if test "${cross_compiling}" = "no"; then
|
2003-10-05 20:19:21 -04:00
|
|
|
AC_CHECK_LIB(Xt, XtFree,
|
2003-09-29 22:00:20 -04:00
|
|
|
[ac_cv_my_have_xt=yes
|
|
|
|
AC_CHECK_LIB(Xmu, XmuDrawLogo,
|
2006-06-14 11:06:05 -04:00
|
|
|
[XT_CFLAGS="${x_cflags}"
|
|
|
|
XT_LIBS="${x_libs} -lXmu -lXt -lSM -lICE -lXext -lX11"],
|
|
|
|
[XT_CFLAGS="${x_cflags}"
|
|
|
|
XT_LIBS="${x_libs} -lXt -lSM -lICE -lXext -lX11"],
|
|
|
|
[[-lXt -lSM -lICE -lXext -lX11 ${x_libs}]])],
|
2003-09-29 22:00:20 -04:00
|
|
|
[ac_cv_my_have_xt=no],
|
2006-06-14 11:06:05 -04:00
|
|
|
[[-lSM -lICE -lXext -lX11 ${x_libs}]])
|
2003-09-28 05:57:09 -04:00
|
|
|
else
|
2003-09-29 22:00:20 -04:00
|
|
|
ac_cv_my_have_xt=no
|
2003-09-28 05:57:09 -04:00
|
|
|
fi
|
2003-09-29 22:00:20 -04:00
|
|
|
AM_CONDITIONAL(HAVE_XT, test "${ac_cv_my_have_xt}" = "yes")
|
|
|
|
AC_SUBST(XT_CFLAGS)
|
|
|
|
AC_SUBST(XT_LIBS)
|
2003-09-26 11:42:13 -04:00
|
|
|
|
2003-09-26 12:21:24 -04:00
|
|
|
if test "${cross_compiling}" = "no"; then
|
2003-09-26 11:42:13 -04:00
|
|
|
AC_CHECK_LIB(Xaw, XawTextSearch,
|
|
|
|
[ac_cv_my_have_xaw=yes
|
2006-06-14 11:06:05 -04:00
|
|
|
XAW_CFLAGS="${x_cflags}"
|
|
|
|
XAW_LIBS="${x_libs} -lXaw ${XT_LIBS}"],
|
2003-09-26 11:42:13 -04:00
|
|
|
[ac_cv_my_have_xaw=no],
|
2003-09-29 22:00:20 -04:00
|
|
|
[[${XT_LIBS}]])
|
2003-09-26 11:42:13 -04:00
|
|
|
else
|
|
|
|
ac_cv_my_have_xaw="no (cross-compiling)"
|
|
|
|
fi
|
2003-09-06 07:15:57 -04:00
|
|
|
AM_CONDITIONAL(HAVE_XAW, test "${ac_cv_my_have_xaw}" = "yes")
|
2003-08-26 21:17:40 -04:00
|
|
|
AC_SUBST(XAW_CFLAGS)
|
|
|
|
AC_SUBST(XAW_LIBS)
|
2003-09-06 07:15:57 -04:00
|
|
|
|
2003-09-26 12:21:24 -04:00
|
|
|
if test "${cross_compiling}" = "no"; then
|
2003-09-26 11:42:13 -04:00
|
|
|
AC_CHECK_LIB(Xm, XmStringConcat,
|
|
|
|
[ac_cv_my_have_motif=yes
|
2006-06-14 11:06:05 -04:00
|
|
|
MOTIF_CFLAGS="${x_cflags} -I/usr/include/Xm"
|
|
|
|
MOTIF_LIBS="${x_libs} -lXm ${XT_LIBS}"],
|
2003-09-26 11:42:13 -04:00
|
|
|
[ac_cv_my_have_motif=no],
|
2003-09-29 22:00:20 -04:00
|
|
|
[[${XT_LIBS}]])
|
2003-09-26 11:42:13 -04:00
|
|
|
else
|
|
|
|
ac_cv_my_have_motif="no (cross-compiling)"
|
|
|
|
fi
|
2003-09-06 07:15:57 -04:00
|
|
|
AM_CONDITIONAL(HAVE_MOTIF, test "${ac_cv_my_have_motif}" = "yes")
|
|
|
|
AC_SUBST(MOTIF_CFLAGS)
|
|
|
|
AC_SUBST(MOTIF_LIBS)
|
|
|
|
|
2003-09-11 02:57:26 -04:00
|
|
|
INCLUDES="${INCLUDES} -I\$(top_srcdir)/include -I\$(top_builddir)/include"
|
2003-09-06 07:15:57 -04:00
|
|
|
AC_SUBST(INCLUDES)
|
2003-09-17 09:18:59 -04:00
|
|
|
|
|
|
|
dnl Export variables
|
|
|
|
AC_SUBST(ELK_CFLAGS)
|
|
|
|
AC_SUBST(ELK_LDFLAGS)
|
2003-09-06 12:19:02 -04:00
|
|
|
AC_SUBST(ELK_LIBS)
|
2003-08-25 07:15:39 -04:00
|
|
|
|
2003-09-11 04:21:49 -04:00
|
|
|
dnl
|
|
|
|
dnl Check for available programs
|
|
|
|
dnl
|
|
|
|
AC_PROG_AWK
|
|
|
|
AC_MSG_CHECKING(for groff -ms)
|
|
|
|
if echo foo | groff -ms >/dev/null 2>&1; then
|
|
|
|
ac_cv_my_have_groff=yes
|
|
|
|
else
|
|
|
|
ac_cv_my_have_groff=no
|
|
|
|
fi
|
|
|
|
AC_MSG_RESULT([${ac_cv_my_have_groff}])
|
|
|
|
AM_CONDITIONAL(HAVE_GROFF, test "${ac_cv_my_have_groff}" = "yes")
|
|
|
|
|
|
|
|
|
|
|
|
dnl
|
|
|
|
dnl Finished!
|
|
|
|
dnl
|
2009-12-19 07:28:36 -05:00
|
|
|
AC_CONFIG_FILES([
|
2003-08-25 07:15:39 -04:00
|
|
|
Makefile
|
|
|
|
doc/Makefile
|
2003-08-26 21:17:40 -04:00
|
|
|
doc/bitstring/Makefile
|
|
|
|
doc/cprog/Makefile
|
|
|
|
doc/kernel/Makefile
|
|
|
|
doc/man/Makefile
|
|
|
|
doc/oops/Makefile
|
|
|
|
doc/record/Makefile
|
|
|
|
doc/regexp/Makefile
|
|
|
|
doc/unix/Makefile
|
|
|
|
doc/usenix/Makefile
|
|
|
|
doc/util/Makefile
|
|
|
|
doc/xlib/Makefile
|
|
|
|
doc/xt/Makefile
|
2003-08-25 07:15:39 -04:00
|
|
|
examples/Makefile
|
2003-08-25 12:29:54 -04:00
|
|
|
include/Makefile
|
2003-08-25 07:15:39 -04:00
|
|
|
lib/Makefile
|
2003-08-25 07:54:18 -04:00
|
|
|
lib/misc/Makefile
|
2003-08-25 12:00:50 -04:00
|
|
|
lib/unix/Makefile
|
2003-08-25 12:29:54 -04:00
|
|
|
lib/xlib/Makefile
|
2003-09-03 18:00:01 -04:00
|
|
|
lib/xwidgets/Makefile
|
2003-09-28 05:57:09 -04:00
|
|
|
lib/xwidgets/xaw/Makefile
|
|
|
|
lib/xwidgets/motif/Makefile
|
2003-08-25 07:15:39 -04:00
|
|
|
scm/Makefile
|
|
|
|
src/Makefile
|
2009-12-19 07:28:26 -05:00
|
|
|
test/Makefile
|
2009-12-19 07:28:36 -05:00
|
|
|
])
|
|
|
|
AC_CONFIG_FILES([
|
2003-09-06 07:15:57 -04:00
|
|
|
scm/slib.scm
|
|
|
|
include/site.h
|
2003-08-25 07:15:39 -04:00
|
|
|
])
|
2009-12-19 07:28:36 -05:00
|
|
|
AC_CONFIG_FILES([test/check-gc], [chmod 0755 test/check-gc])
|
|
|
|
AC_CONFIG_FILES([test/check-gc2], [chmod 0755 test/check-gc2])
|
|
|
|
AC_CONFIG_FILES([test/check-r4rs], [chmod 0755 test/check-r4rs])
|
|
|
|
|
|
|
|
AC_OUTPUT
|
2003-08-25 07:15:39 -04:00
|
|
|
|
2003-09-06 07:15:57 -04:00
|
|
|
cat << EOF
|
|
|
|
|
2003-09-06 10:45:29 -04:00
|
|
|
Elk configuration summary
|
|
|
|
-------------------------
|
2003-09-06 08:33:55 -04:00
|
|
|
build C++ plugins: ${ac_cv_my_have_cxx}
|
2003-09-07 07:18:38 -04:00
|
|
|
libgdbm support: ${ac_cv_my_have_gdbm}
|
2003-09-06 07:15:57 -04:00
|
|
|
X11 support: ${ac_cv_my_have_x11}
|
|
|
|
Xaw support: ${ac_cv_my_have_xaw}
|
|
|
|
Motif support: ${ac_cv_my_have_motif}
|
2003-09-11 04:21:49 -04:00
|
|
|
build documentation: ${ac_cv_my_have_groff}
|
2003-09-06 07:15:57 -04:00
|
|
|
EOF
|