mirror of
git://git.savannah.nongnu.org/eliot.git
synced 2024-11-17 07:48:27 +01:00
11adaba410
- New regexp parser using Boost.Spirit. Lex and yacc are now gone. The main advantage of this new parser, apart from being purely C++, is that it can handle wide characters. Currently, the new parser does the same as the previous one, but the code is not yet ready to use regular expressions with non-ASCII dictionaries.
204 lines
6.8 KiB
Text
204 lines
6.8 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.7-cvs)
|
||
AC_CONFIG_SRCDIR(wxwin/main.cc)
|
||
AM_INIT_AUTOMAKE
|
||
AM_CONFIG_HEADER(config.h)
|
||
AC_CANONICAL_HOST
|
||
AC_CANONICAL_BUILD
|
||
AM_OPTIONS_WXCONFIG
|
||
|
||
dnl --------------------------------------------------------------
|
||
dnl Checks for programs.
|
||
dnl --------------------------------------------------------------
|
||
AC_PROG_INSTALL
|
||
AC_PROG_CC
|
||
dnl Needed for gettext
|
||
AC_GNU_SOURCE
|
||
AC_PROG_CXX
|
||
AC_PROG_MAKE_SET
|
||
AC_PROG_RANLIB
|
||
PKG_PROG_PKG_CONFIG
|
||
|
||
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_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[ac_cv_c_Wall=yes],[ac_cv_c_Wall=no])])
|
||
CFLAGS="${CFLAGS_save}"
|
||
if test "${ac_cv_c_Wall}" != "no"; then
|
||
CFLAGS+=" -Wall"
|
||
CXXFLAGS+=" -Wall"
|
||
fi
|
||
|
||
CFLAGS_save="${CFLAGS}"
|
||
AC_CACHE_CHECK([if \$CC accepts -Wextra],
|
||
[ac_cv_c_Wextra],
|
||
[CFLAGS="-Wextra ${CFLAGS_save}"
|
||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[ac_cv_c_Wextra=yes],[ac_cv_c_Wextra=no])])
|
||
CFLAGS="${CFLAGS_save}"
|
||
if test "${ac_cv_c_Wextra}" != "no"; then
|
||
CFLAGS+=" -Wextra"
|
||
CXXFLAGS+=" -Wextra"
|
||
fi
|
||
|
||
dnl Debug mode
|
||
AC_ARG_ENABLE([debug],AC_HELP_STRING([--enable-debug],[debug mode (default disabled)]))
|
||
if test "${enable_debug}" = "yes"; then
|
||
CPPFLAGS+=" -DDEBUG"
|
||
CFLAGS+=" -g"
|
||
CXXFLAGS+=" -g"
|
||
fi
|
||
|
||
dnl Profile mode
|
||
AC_ARG_ENABLE([profile],AC_HELP_STRING([--enable-profile],[profile mode (default disabled)]))
|
||
if test "${enable_profile}" = "yes"; then
|
||
CPPFLAGS+=" -DPROFILE"
|
||
CFLAGS+=" -pg"
|
||
CXXFLAGS+=" -pg"
|
||
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_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)
|
||
AC_CHECK_HEADERS(arpa/inet.h netinet/in.h)
|
||
AC_CHECK_HEADERS([readline/readline.h], [has_readline=1], [has_readline=0])
|
||
AM_CONDITIONAL(HAS_READLINE, test "$has_readline" = "1")
|
||
|
||
dnl --------------------------------------------------------------
|
||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||
dnl --------------------------------------------------------------
|
||
AC_C_CONST
|
||
AC_TYPE_SIZE_T
|
||
AC_C_BIGENDIAN
|
||
AC_C_INLINE
|
||
dnl AC_CHECK_SIZEOF(char, 1)
|
||
dnl AC_CHECK_SIZEOF(short, 2)
|
||
dnl AC_CHECK_SIZEOF(int *, 4)
|
||
dnl AC_CHECK_SIZEOF(int, 4)
|
||
dnl AC_CHECK_SIZEOF(long, 4)
|
||
dnl AC_CHECK_SIZEOF(long long, 0)
|
||
|
||
dnl --------------------------------------------------------------
|
||
dnl Checks for library functions.
|
||
dnl --------------------------------------------------------------
|
||
AC_FUNC_MEMCMP
|
||
AC_CHECK_FUNCS([wcwidth])
|
||
|
||
dnl --------------------------------------------------------------
|
||
dnl Checks for libraries.
|
||
dnl --------------------------------------------------------------
|
||
|
||
dnl Check for the Boost libraries (in fact we only need the headers)
|
||
AX_BOOST_BASE([1.33.1])
|
||
|
||
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], [wxWin=0], [], [--unicode])
|
||
if test "${wxWin}" != 1; then
|
||
AC_MSG_ERROR([
|
||
wxWidgets (unicode build) 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
|
||
dnl We enable it if asked by the user, or if ncursesw is found
|
||
AC_ARG_ENABLE([ncurses],AC_HELP_STRING([--enable-ncurses],
|
||
[ncurses interface support (default enabled if ncursesw found on your system)]))
|
||
AC_CHECK_HEADERS(ncursesw/curses.h, [has_ncursesw=1], [has_ncursesw=0])
|
||
if test "${enable_ncurses}" != "no" -a "${has_ncursesw}" = "1"; then
|
||
want_ncurses=1
|
||
else
|
||
want_ncurses=0
|
||
if test "${enable_ncurses}" = "yes"; then
|
||
AC_MSG_ERROR([Could not find the ncursesw library on your system])
|
||
fi
|
||
fi
|
||
AM_CONDITIONAL([BUILD_NCURSES], [test "${want_ncurses}" = "1"])
|
||
|
||
dnl check for Qt
|
||
AC_ARG_ENABLE([qt],AC_HELP_STRING([--enable-qt],
|
||
[Qt interface support (default disabled)]))
|
||
qt_ok=0
|
||
AS_IF([test "${enable_qt}" = "yes"],
|
||
[PKG_CHECK_MODULES(QT, [QtCore QtGui >= 4.2.0],
|
||
[qt_ok=1
|
||
AC_PATH_PROG(MOC, moc, moc,`$PKG_CONFIG --variable=exec_prefix QtCore`/bin)
|
||
AC_PATH_PROG(UIC, uic, uic,`$PKG_CONFIG --variable=exec_prefix QtCore`/bin)
|
||
],
|
||
[AC_MSG_ERROR([Could not find Qt on your system (using pkg-config)])]
|
||
)
|
||
])
|
||
AM_CONDITIONAL([BUILD_QT], [test "${qt_ok}" = "1"])
|
||
|
||
dnl Enable/disable text version
|
||
AC_ARG_ENABLE([text],AC_HELP_STRING([--enable-text],[text interface support (default enabled)]))
|
||
AM_CONDITIONAL([BUILD_TEXT], [test "${enable_text}" != "no"])
|
||
|
||
dnl Internationalization macros
|
||
AM_GNU_GETTEXT_VERSION(0.16.1)
|
||
AM_GNU_GETTEXT
|
||
|
||
dnl Iconv
|
||
dnl This test depends on AM_GNU_GETTEXT executed before
|
||
AS_IF([test "$am_cv_func_iconv" != "yes"],
|
||
[AC_MSG_ERROR([libiconv is needed for Eliot to work properly])])
|
||
|
||
|
||
dnl Information about who built eliot (useful for the dictionary)
|
||
AC_DEFINE_UNQUOTED(ELIOT_COMPILE_BY, "`whoami`", [user who ran configure])
|
||
AC_DEFINE_UNQUOTED(ELIOT_COMPILE_HOST, "`hostname`", [host which ran configure])
|
||
|
||
dnl Check the operating system
|
||
case "${host_os}" in
|
||
*mingw32* | *cygwin*)
|
||
SYS=mingw32
|
||
;;
|
||
*)
|
||
dnl nothing to do
|
||
;;
|
||
esac
|
||
|
||
if test "$SYS" = "mingw32"; then
|
||
# For ntohl, in particular
|
||
LIBS="${LIBS} -lws2_32"
|
||
fi
|
||
|
||
dnl --------------------------------------------------------------
|
||
dnl Output
|
||
dnl --------------------------------------------------------------
|
||
AC_CONFIG_FILES(intl/Makefile po/Makefile.in
|
||
dic/Makefile
|
||
game/Makefile
|
||
utils/Makefile
|
||
wxwin/Makefile
|
||
qt/Makefile
|
||
Makefile)
|
||
AC_OUTPUT
|