2004-04-08 11:43:06 +02:00
|
|
|
|
dnl -*-m4-*-
|
|
|
|
|
dnl Process this file with autoconf to produce a configure script.
|
|
|
|
|
dnl --------------------------------------------------------------
|
|
|
|
|
dnl configure.in for Eliot
|
|
|
|
|
dnl --------------------------------------------------------------
|
2013-04-03 23:02:53 +02:00
|
|
|
|
AC_INIT([eliot],[2.1])
|
2008-09-07 15:17:39 +02:00
|
|
|
|
AC_CONFIG_SRCDIR(qt/main.cpp)
|
2012-12-05 20:26:47 +01:00
|
|
|
|
dnl See http://www.flameeyes.eu/autotools-mythbuster/automake/nonrecursive.html
|
|
|
|
|
dnl for the subdir-objets arguments (used at the moment for game/cmd/)
|
|
|
|
|
AM_INIT_AUTOMAKE([subdir-objects])
|
2013-01-06 17:02:29 +01:00
|
|
|
|
AC_CONFIG_HEADERS([config.h])
|
2008-01-08 14:52:32 +01:00
|
|
|
|
AC_CANONICAL_HOST
|
|
|
|
|
AC_CANONICAL_BUILD
|
2004-04-08 11:43:06 +02:00
|
|
|
|
|
|
|
|
|
dnl --------------------------------------------------------------
|
|
|
|
|
dnl Checks for programs.
|
|
|
|
|
dnl --------------------------------------------------------------
|
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
|
AC_PROG_CC
|
2008-01-08 14:52:32 +01:00
|
|
|
|
dnl Needed for gettext
|
2013-01-06 17:02:29 +01:00
|
|
|
|
AC_USE_SYSTEM_EXTENSIONS
|
2004-04-08 11:43:06 +02:00
|
|
|
|
AC_PROG_CXX
|
|
|
|
|
AC_PROG_MAKE_SET
|
|
|
|
|
AC_PROG_RANLIB
|
2008-01-20 19:40:12 +01:00
|
|
|
|
PKG_PROG_PKG_CONFIG
|
2004-04-08 11:43:06 +02:00
|
|
|
|
|
2010-10-17 23:23:39 +02:00
|
|
|
|
AC_CHECK_HEADERS_ONCE(execinfo.h)
|
|
|
|
|
AX_CXX_GCC_ABI_DEMANGLE
|
|
|
|
|
|
2004-04-08 11:43:06 +02:00
|
|
|
|
dnl --------------------------------------------------------------
|
2005-02-05 12:14:56 +01:00
|
|
|
|
dnl Checks for compilation flags
|
2004-04-08 11:43:06 +02:00
|
|
|
|
dnl --------------------------------------------------------------
|
2005-04-03 23:12:03 +02:00
|
|
|
|
CFLAGS_save="${CFLAGS}"
|
2005-02-05 12:14:56 +01:00
|
|
|
|
AC_CACHE_CHECK([if \$CC accepts -Wall],
|
2007-08-04 22:01:27 +02:00
|
|
|
|
[ac_cv_c_Wall],
|
|
|
|
|
[CFLAGS="-Wall ${CFLAGS_save}"
|
|
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[ac_cv_c_Wall=yes],[ac_cv_c_Wall=no])])
|
2005-04-03 23:12:03 +02:00
|
|
|
|
CFLAGS="${CFLAGS_save}"
|
2005-02-05 12:14:56 +01:00
|
|
|
|
if test "${ac_cv_c_Wall}" != "no"; then
|
2007-08-04 22:01:27 +02:00
|
|
|
|
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"
|
2005-04-03 23:12:03 +02:00
|
|
|
|
fi
|
|
|
|
|
|
2011-01-16 22:30:30 +01:00
|
|
|
|
dnl Logging
|
2013-01-06 17:02:29 +01:00
|
|
|
|
AC_ARG_ENABLE([logging],AS_HELP_STRING([--enable-logging],[logging (default disabled)]))
|
2011-01-16 22:30:30 +01:00
|
|
|
|
if test "${enable_logging}" = "yes"; then
|
|
|
|
|
want_logging=1
|
|
|
|
|
else
|
|
|
|
|
want_logging=0
|
|
|
|
|
fi
|
|
|
|
|
|
2005-04-03 23:12:03 +02:00
|
|
|
|
dnl Debug mode
|
2013-01-06 17:02:29 +01:00
|
|
|
|
AC_ARG_ENABLE([debug],AS_HELP_STRING([--enable-debug],[debug mode (default disabled)]))
|
2006-01-01 20:23:05 +01:00
|
|
|
|
if test "${enable_debug}" = "yes"; then
|
2008-01-08 14:52:32 +01:00
|
|
|
|
CPPFLAGS+=" -DDEBUG"
|
|
|
|
|
CFLAGS+=" -g"
|
|
|
|
|
CXXFLAGS+=" -g"
|
2004-04-08 11:57:28 +02:00
|
|
|
|
fi
|
|
|
|
|
|
2006-01-01 20:23:05 +01:00
|
|
|
|
dnl Profile mode
|
2013-01-06 17:02:29 +01:00
|
|
|
|
AC_ARG_ENABLE([profile],AS_HELP_STRING([--enable-profile],[profile mode (default disabled)]))
|
2006-01-01 20:23:05 +01:00
|
|
|
|
if test "${enable_profile}" = "yes"; then
|
2008-01-08 14:52:32 +01:00
|
|
|
|
CPPFLAGS+=" -DPROFILE"
|
|
|
|
|
CFLAGS+=" -pg"
|
|
|
|
|
CXXFLAGS+=" -pg"
|
2007-08-04 22:01:27 +02:00
|
|
|
|
LDFLAGS+=" -pg"
|
2006-01-01 20:23:05 +01:00
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
dnl Regexp / Listdic / Compdic build enable
|
2013-01-06 17:02:29 +01:00
|
|
|
|
AC_ARG_ENABLE([dictools],AS_HELP_STRING([--enable-dictools],[build independant dictionary tools (default enabled)]))
|
2005-04-09 21:16:56 +02:00
|
|
|
|
AM_CONDITIONAL([BUILD_DICTOOLS], [test "${enable_dictools}" != "no"])
|
|
|
|
|
|
2008-09-07 15:17:39 +02:00
|
|
|
|
dnl Define WIN32_BUILD if the compiler is i586-mingw32msvc-g++
|
|
|
|
|
AM_CONDITIONAL([WIN32_BUILD], [test "${CXX}" = "i586-mingw32msvc-g++"])
|
|
|
|
|
|
2004-04-08 11:43:06 +02:00
|
|
|
|
dnl --------------------------------------------------------------
|
|
|
|
|
dnl Checks for header files.
|
|
|
|
|
dnl --------------------------------------------------------------
|
|
|
|
|
AC_HEADER_STDC
|
2012-05-16 20:49:00 +02:00
|
|
|
|
AC_CHECK_HEADERS(fcntl.h unistd.h sys/stats.h sys/types.h)
|
2008-01-08 14:52:32 +01:00
|
|
|
|
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")
|
2004-04-08 11:43:06 +02:00
|
|
|
|
|
|
|
|
|
dnl --------------------------------------------------------------
|
|
|
|
|
dnl Checks for typedefs, structures, and compiler characteristics.
|
|
|
|
|
dnl --------------------------------------------------------------
|
|
|
|
|
AC_C_CONST
|
|
|
|
|
AC_TYPE_SIZE_T
|
2006-04-16 13:26:04 +02:00
|
|
|
|
AC_C_BIGENDIAN
|
2004-06-26 16:47:39 +02:00
|
|
|
|
AC_C_INLINE
|
2008-01-08 14:52:32 +01:00
|
|
|
|
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)
|
2004-04-08 11:43:06 +02:00
|
|
|
|
|
|
|
|
|
dnl --------------------------------------------------------------
|
|
|
|
|
dnl Checks for library functions.
|
|
|
|
|
dnl --------------------------------------------------------------
|
|
|
|
|
AC_FUNC_MEMCMP
|
2008-01-08 14:52:32 +01:00
|
|
|
|
AC_CHECK_FUNCS([wcwidth])
|
2004-04-08 11:43:06 +02:00
|
|
|
|
|
2005-02-05 12:14:56 +01:00
|
|
|
|
dnl --------------------------------------------------------------
|
|
|
|
|
dnl Checks for libraries.
|
|
|
|
|
dnl --------------------------------------------------------------
|
|
|
|
|
|
2008-01-08 14:52:32 +01:00
|
|
|
|
dnl Check for the Boost libraries (in fact we only need the headers)
|
2009-05-01 11:04:47 +02:00
|
|
|
|
dnl We need at least version 1.36, for Boost.Unordered
|
|
|
|
|
AX_BOOST_BASE([1.36.0])
|
2008-01-08 14:52:32 +01:00
|
|
|
|
|
2008-09-22 23:21:38 +02:00
|
|
|
|
PKG_CHECK_MODULES(LIBCONFIG, [libconfig++],
|
|
|
|
|
[has_libconfig=1
|
|
|
|
|
AC_DEFINE(HAVE_LIBCONFIG, 1, [Define to 1 if you have the libconfig library])],
|
|
|
|
|
[has_libconfig=0])
|
|
|
|
|
|
2011-01-16 22:30:30 +01:00
|
|
|
|
dnl Check for liblog4cxx
|
|
|
|
|
PKG_CHECK_MODULES(LOG4CXX, [liblog4cxx],
|
|
|
|
|
[has_log4cxx=1
|
|
|
|
|
AC_DEFINE(HAVE_LIBLOG4CXX, 1, [Define to 1 if you have the liblog4cxx library])],
|
|
|
|
|
[has_log4cxx=0])
|
|
|
|
|
AS_IF([test "${want_logging}" = "1"],
|
|
|
|
|
[AS_IF([test "${has_log4cxx}" = "1"],
|
|
|
|
|
[with_logging=1
|
|
|
|
|
AC_DEFINE(USE_LOGGING, 1, [Define to 1 if you want to enable logging])],
|
|
|
|
|
[AC_MSG_ERROR([Logging requested, but liblog4cxx could not be found on your system (using pkg-config)])])])
|
|
|
|
|
# Conditional, to avoid a useless dependency (in the case of shared library)
|
|
|
|
|
AM_CONDITIONAL([WITH_LOGGING], [test "${with_logging}" = "1"])
|
|
|
|
|
|
2009-12-06 01:07:35 +01:00
|
|
|
|
dnl Check for Expat
|
|
|
|
|
AX_LIB_EXPAT([2.0.1])
|
|
|
|
|
|
2009-11-29 17:01:31 +01:00
|
|
|
|
dnl Check for arabica and libxml2
|
|
|
|
|
PKG_CHECK_MODULES(ARABICA, [arabica], [],
|
|
|
|
|
[AC_MSG_ERROR([Could not find Arabica on your system (using pkg-config)])])
|
|
|
|
|
|
2009-12-06 01:07:35 +01:00
|
|
|
|
dnl PKG_CHECK_MODULES(LIBXML2, [libxml-2.0], [],
|
|
|
|
|
dnl [AC_MSG_ERROR([Could not find libxml2 on your system (using pkg-config)])])
|
2009-11-29 17:01:31 +01:00
|
|
|
|
|
2005-02-05 12:14:56 +01:00
|
|
|
|
dnl Check for ncurses
|
2008-01-08 14:52:32 +01:00
|
|
|
|
dnl We enable it if asked by the user, or if ncursesw is found
|
2013-01-06 17:02:29 +01:00
|
|
|
|
AC_ARG_ENABLE([ncurses],AS_HELP_STRING([--enable-ncurses],
|
2008-01-08 14:52:32 +01:00
|
|
|
|
[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
|
2005-02-05 12:14:56 +01:00
|
|
|
|
fi
|
|
|
|
|
AM_CONDITIONAL([BUILD_NCURSES], [test "${want_ncurses}" = "1"])
|
|
|
|
|
|
2008-01-20 19:40:12 +01:00
|
|
|
|
dnl check for Qt
|
2013-01-06 17:02:29 +01:00
|
|
|
|
AC_ARG_ENABLE([qt],AS_HELP_STRING([--enable-qt],
|
2008-01-20 19:40:12 +01:00
|
|
|
|
[Qt interface support (default disabled)]))
|
|
|
|
|
qt_ok=0
|
2008-09-03 19:28:27 +02:00
|
|
|
|
AS_IF([test "${enable_qt}" != "no"],
|
2013-01-19 00:16:12 +01:00
|
|
|
|
[PKG_CHECK_MODULES(QT, [QtCore QtGui QtNetwork >= 4.2.0],
|
2008-01-20 19:40:12 +01:00
|
|
|
|
[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)
|
2008-09-03 19:28:27 +02:00
|
|
|
|
AC_PATH_PROG(RCC, rcc, rcc,`$PKG_CONFIG --variable=exec_prefix QtCore`/bin)
|
|
|
|
|
QT4LOCALEDIR="$($PKG_CONFIG --variable=prefix QtCore)/share/qt4/translations/"
|
|
|
|
|
AC_SUBST(QT4LOCALEDIR)
|
2008-01-20 19:40:12 +01:00
|
|
|
|
],
|
|
|
|
|
[AC_MSG_ERROR([Could not find Qt on your system (using pkg-config)])]
|
|
|
|
|
)
|
|
|
|
|
])
|
|
|
|
|
AM_CONDITIONAL([BUILD_QT], [test "${qt_ok}" = "1"])
|
|
|
|
|
|
2005-02-05 12:14:56 +01:00
|
|
|
|
dnl Enable/disable text version
|
2013-01-06 17:02:29 +01:00
|
|
|
|
AC_ARG_ENABLE([text],AS_HELP_STRING([--enable-text],[text interface support (default enabled)]))
|
2005-02-05 12:14:56 +01:00
|
|
|
|
AM_CONDITIONAL([BUILD_TEXT], [test "${enable_text}" != "no"])
|
|
|
|
|
|
2005-04-03 23:12:03 +02:00
|
|
|
|
dnl Internationalization macros
|
2013-01-06 17:42:12 +01:00
|
|
|
|
AM_GNU_GETTEXT_VERSION(0.18.1)
|
2005-02-06 23:18:11 +01:00
|
|
|
|
AM_GNU_GETTEXT
|
2005-02-05 12:14:56 +01:00
|
|
|
|
|
2008-01-08 14:52:32 +01:00
|
|
|
|
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
|
|
|
|
|
|
2004-04-08 11:43:06 +02:00
|
|
|
|
dnl --------------------------------------------------------------
|
|
|
|
|
dnl Output
|
|
|
|
|
dnl --------------------------------------------------------------
|
2005-02-06 23:18:11 +01:00
|
|
|
|
AC_CONFIG_FILES(intl/Makefile po/Makefile.in
|
2004-06-26 16:47:39 +02:00
|
|
|
|
dic/Makefile
|
2004-04-08 11:43:06 +02:00
|
|
|
|
game/Makefile
|
|
|
|
|
utils/Makefile
|
2008-01-20 19:40:12 +01:00
|
|
|
|
qt/Makefile
|
2008-09-22 23:21:38 +02:00
|
|
|
|
extras/Makefile
|
2013-01-17 16:21:27 +01:00
|
|
|
|
extras/innosetup/eliot-setup.iss
|
2004-04-08 11:43:06 +02:00
|
|
|
|
Makefile)
|
2004-06-26 16:47:39 +02:00
|
|
|
|
AC_OUTPUT
|
2008-09-22 23:21:38 +02:00
|
|
|
|
|
|
|
|
|
if test "$has_libconfig" != "1"; then
|
|
|
|
|
echo
|
|
|
|
|
echo "@@@@@@@@@@@"
|
|
|
|
|
echo "Warning!"
|
|
|
|
|
echo "libconfig++ was not detected on your system: saving and loading the configuration will be impossible!"
|
|
|
|
|
echo "libconfig++ can be downloaded here: http://www.hyperrealm.com/main.php?s=libconfig"
|
|
|
|
|
echo "@@@@@@@@@@@"
|
|
|
|
|
fi
|