eliot/configure.in
2006-01-01 22:16:42 +00:00

139 lines
4.7 KiB
Text

dnl -*-m4-*-
dnl Process this file with autoconf to produce a configure script.
dnl --------------------------------------------------------------
dnl configure.in for Eliot
dnl --------------------------------------------------------------
AC_INIT(eliot, 1.5)
AC_CONFIG_SRCDIR(wxwin/main.cc)
AM_INIT_AUTOMAKE
AM_CONFIG_HEADER(config.h)
AM_OPTIONS_WXCONFIG
dnl --------------------------------------------------------------
dnl Checks for programs.
dnl --------------------------------------------------------------
AC_PROG_INSTALL
AC_PROG_CC
AC_PROG_CXX
AC_PROG_MAKE_SET
AC_PROG_RANLIB
dnl --------------------------------------------------------------
dnl Checks for compilation flags
dnl --------------------------------------------------------------
CFLAGS_save="${CFLAGS}"
AC_CACHE_CHECK([if \$CC accepts -Wall],
[ac_cv_c_Wall],
[CFLAGS="-Wall ${CFLAGS_save}"
AC_TRY_COMPILE([],,ac_cv_c_Wall=yes, ac_cv_c_Wall=no)])
CFLAGS="${CFLAGS_save}"
if test "${ac_cv_c_Wall}" != "no"; then
CFLAGS="-Wall ${CFLAGS}"
CXXFLAGS="-Wall ${CXXFLAGS}"
fi
dnl Debug mode
AC_ARG_ENABLE([debug],AC_HELP_STRING([--enable-debug],[debug mode (default disabled)]))
if test "${enable_debug}" = "yes"; then
CFLAGS="${CFLAGS} -g -DDEBUG"
CPPFLAGS="${CPPFLAGS} -g -DDEBUG"
fi
dnl Profile mode
AC_ARG_ENABLE([profile],AC_HELP_STRING([--enable-profile],[profile mode (default disabled)]))
if test "${enable_profile}" = "yes"; then
CFLAGS="${CFLAGS} -pg -DPROFILE"
CPPFLAGS="${CPPFLAGS} -pg -DPROFILE"
LDFLAGS="${LDFLAGS} -pg"
fi
dnl Regexp / Listdic / Compdic build enable
AC_ARG_ENABLE([dictools],AC_HELP_STRING([--enable-dictools],[build independant dictionary tools (default enabled)]))
AM_PROG_LEX
AC_PROG_YACC
AM_CONDITIONAL([BUILD_DICTOOLS], [test "${enable_dictools}" != "no"])
dnl --------------------------------------------------------------
dnl Checks for header files.
dnl --------------------------------------------------------------
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h unistd.h sys/wait.h)
dnl --------------------------------------------------------------
dnl Checks for typedefs, structures, and compiler characteristics.
dnl --------------------------------------------------------------
AC_C_CONST
AC_TYPE_SIZE_T
dnl AC_C_BIGENDIAN
AC_C_INLINE
AC_CHECK_SIZEOF(char, 1)
AC_CHECK_SIZEOF(short, 2)
AC_CHECK_SIZEOF(int *, 4)
AC_CHECK_SIZEOF(int, 4)
AC_CHECK_SIZEOF(long, 4)
AC_CHECK_SIZEOF(long long, 0)
dnl --------------------------------------------------------------
dnl Checks for library functions.
dnl --------------------------------------------------------------
AC_FUNC_MEMCMP
dnl --------------------------------------------------------------
dnl Checks for libraries.
dnl --------------------------------------------------------------
dnl Check for wxWidgets
AC_ARG_ENABLE([wxwidgets],AC_HELP_STRING([--enable-wxwidgets],[wxWidgets interface support (default disabled)]))
if test "${enable_wxwidgets}" = "yes"
then
AM_PATH_WXCONFIG(2.6.0, wxWin=1)
if test "${wxWin}" != 1; then
AC_MSG_ERROR([
wxWidgets must be installed on your system
but wx-config script couldn't be found.
Please check that wx-config is in path, the directory
where wxWidgets libraries are installed (returned by
'wx-config --libs' command) is in LD_LIBRARY_PATH or
equivalent variable and wxWidgets version is 2.6.0 or above.
])
fi
AM_CPPFLAGS="$AM_CPPFLAGS $WX_CPPFLAGS"
AM_CXXFLAGS="$AM_CXXFLAGS $WX_CXXFLAGS_ONLY"
AM_CFLAGS="$AM_CFLAGS $WX_CFLAGS_ONLY"
AM_LDFLAGS="$AM_LDFLAGS $WX_LIBS"
fi
AM_CONDITIONAL([BUILD_WXWIDGETS], [test "${wxWin}" = "1"])
dnl Check for ncurses
AC_ARG_ENABLE([ncurses],AC_HELP_STRING([--enable-ncurses],[ncurses interface support (default disabled)]))
if test "${enable_ncurses}" = "yes"
then
AC_CHECK_HEADERS(ncurses.h, want_ncurses=1,
[AC_MSG_ERROR([Could not find the ncurses library on your system])])
fi
AM_CONDITIONAL([BUILD_NCURSES], [test "${want_ncurses}" = "1"])
dnl Enable/disable text version
AC_ARG_ENABLE([text],AC_HELP_STRING([--enable-text],[text interface support (default enabled)]))
if test "${enable_text}" != "no"
then
AC_CHECK_HEADERS(readline/readline.h, want_text=1,
[AC_MSG_ERROR([Could not find the readline library on your system])])
fi
AM_CONDITIONAL([BUILD_TEXT], [test "${enable_text}" != "no"])
dnl Internationalization macros
AM_GNU_GETTEXT_VERSION(0.11.5)
AM_GNU_GETTEXT
dnl --------------------------------------------------------------
dnl Output
dnl --------------------------------------------------------------
AC_CONFIG_FILES(intl/Makefile po/Makefile.in
dic/Makefile
game/Makefile
wxwin/Makefile
utils/Makefile
Makefile)
AC_OUTPUT