2006-01-04 08:56:00 +00:00
|
|
|
# Copyright (c) 2003-2006 FlashCode <flashcode@flashtux.org>
|
2003-10-25 14:49:18 +00:00
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
2006-01-04 08:56:00 +00:00
|
|
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
2003-10-25 14:49:18 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
# -*- Autoconf -*-
|
|
|
|
# Process this file with autoconf to produce a configure script.
|
|
|
|
|
|
|
|
AC_PREREQ(2.56)
|
2006-01-14 13:05:25 +00:00
|
|
|
AC_INIT(WeeChat, 0.1.8-cvs, flashcode@flashtux.org)
|
2003-10-25 14:49:18 +00:00
|
|
|
AC_CONFIG_SRCDIR([src/common/weechat.c])
|
2003-10-25 23:13:40 +00:00
|
|
|
AM_CONFIG_HEADER(config.h)
|
2006-01-14 13:05:25 +00:00
|
|
|
AM_INIT_AUTOMAKE([weechat], [0.1.8-cvs])
|
2003-10-25 14:49:18 +00:00
|
|
|
|
2005-10-15 12:34:21 +00:00
|
|
|
# Checks for programs
|
2003-10-25 14:49:18 +00:00
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_MAKE_SET
|
2005-10-15 12:34:21 +00:00
|
|
|
AM_PROG_LIBTOOL
|
2003-10-25 14:49:18 +00:00
|
|
|
|
2005-10-29 17:56:50 +00:00
|
|
|
# Add some flags for some OS
|
|
|
|
case "$host_os" in
|
|
|
|
freebsd* | openbsd*)
|
2005-10-29 23:59:44 +00:00
|
|
|
LDFLAGS="$LDFLAGS -L/usr/local/lib"
|
2005-10-29 17:56:50 +00:00
|
|
|
;;
|
2005-11-01 18:32:10 +00:00
|
|
|
netbsd*)
|
|
|
|
CFLAGS="$CFLAGS -I/usr/pkg/include"
|
|
|
|
LDFLAGS="$LDFLAGS -L/usr/pkg/lib"
|
|
|
|
;;
|
2005-11-13 16:41:44 +00:00
|
|
|
solaris*)
|
|
|
|
LDFLAGS="$LDFLAGS -lsocket -lxnet"
|
|
|
|
;;
|
2005-10-29 17:56:50 +00:00
|
|
|
*)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2003-11-01 20:42:16 +00:00
|
|
|
# Gettext
|
2006-02-08 10:27:10 +00:00
|
|
|
ALL_LINGUAS="fr es cs hu"
|
2003-11-01 20:42:16 +00:00
|
|
|
AM_GNU_GETTEXT
|
|
|
|
|
2005-10-15 12:34:21 +00:00
|
|
|
# Checks for libraries
|
2005-10-25 09:23:10 +00:00
|
|
|
AC_CHECK_LIB(ncurses, initscr, LIBNCURSES_FOUND=1, LIBNCURSES_FOUND=0)
|
|
|
|
AC_CHECK_LIB(ncursesw, initscr, LIBNCURSESW_FOUND=1, LIBNCURSESW_FOUND=0)
|
2003-10-25 14:49:18 +00:00
|
|
|
|
2005-10-15 12:34:21 +00:00
|
|
|
# Checks for header files
|
2003-10-25 14:49:18 +00:00
|
|
|
AC_HEADER_STDC
|
2004-01-17 10:23:01 +00:00
|
|
|
AC_CHECK_HEADERS([arpa/inet.h libintl.h limits.h locale.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h sys/types.h unistd.h pwd.h errno.h])
|
2003-10-25 14:49:18 +00:00
|
|
|
|
2005-10-15 12:34:21 +00:00
|
|
|
# Checks for typedefs, structures, and compiler characteristics
|
2003-10-25 14:49:18 +00:00
|
|
|
AC_HEADER_TIME
|
|
|
|
AC_STRUCT_TM
|
|
|
|
|
2005-04-30 10:29:54 +00:00
|
|
|
AC_MSG_CHECKING([for socklen_t])
|
|
|
|
AC_CACHE_VAL(ac_cv_type_socklen_t,
|
|
|
|
[AC_TRY_COMPILE([
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/socket.h>],
|
|
|
|
[socklen_t t;],
|
|
|
|
ac_cv_type_socklen_t=yes,
|
|
|
|
ac_cv_type_socklen_t=no,
|
|
|
|
)])
|
|
|
|
if test $ac_cv_type_socklen_t = no; then
|
|
|
|
AC_DEFINE(socklen_t, int, Define to 'int' if <sys/socket.h> doesn't define.)
|
|
|
|
fi
|
|
|
|
AC_MSG_RESULT($ac_cv_type_socklen_t)
|
|
|
|
|
2003-10-25 14:49:18 +00:00
|
|
|
# Checks for library functions.
|
|
|
|
AC_FUNC_SELECT_ARGTYPES
|
|
|
|
AC_TYPE_SIGNAL
|
2005-04-30 10:29:54 +00:00
|
|
|
AC_CHECK_FUNCS([gethostbyname gethostname getsockname gettimeofday inet_ntoa memset mkdir select setlocale socket strcasecmp strchr strdup strncasecmp strpbrk strrchr strstr uname])
|
2003-10-25 14:49:18 +00:00
|
|
|
|
2005-10-15 12:34:21 +00:00
|
|
|
# Variables in config.h
|
|
|
|
|
|
|
|
AH_VERBATIM([PREFIX], [#undef PREFIX])
|
|
|
|
AH_VERBATIM([WEECHAT_LIBDIR], [#undef WEECHAT_LIBDIR])
|
|
|
|
AH_VERBATIM([WEECHAT_SHAREDIR], [#undef WEECHAT_SHAREDIR])
|
2003-11-17 21:07:17 +00:00
|
|
|
AH_VERBATIM([PLUGINS], [#undef PLUGINS])
|
2003-11-16 19:40:36 +00:00
|
|
|
AH_VERBATIM([PLUGIN_PERL], [#undef PLUGIN_PERL])
|
2005-05-01 18:53:23 +00:00
|
|
|
AH_VERBATIM([PLUGIN_PYTHON], [#undef PLUGIN_PYTHON])
|
2005-08-21 16:32:48 +00:00
|
|
|
AH_VERBATIM([PLUGIN_RUBY], [#undef PLUGIN_RUBY])
|
2006-02-03 00:29:38 +00:00
|
|
|
AH_VERBATIM([PLUGIN_LUA], [#undef PLUGIN_LUA])
|
2005-06-22 21:08:21 +00:00
|
|
|
AH_VERBATIM([HAVE_GNUTLS], [#undef HAVE_GNUTLS])
|
2003-11-09 00:08:01 +00:00
|
|
|
AH_VERBATIM([DEBUG], [#undef DEBUG])
|
|
|
|
|
2005-10-15 12:34:21 +00:00
|
|
|
# Arguments for ./configure
|
|
|
|
|
2005-10-29 09:36:45 +00:00
|
|
|
AC_ARG_ENABLE(ncurses, [ --disable-ncurses Turn off ncurses interface (default=compiled if found)],enable_ncurses=$enableval,enable_ncurses=yes)
|
|
|
|
AC_ARG_ENABLE(wxwidgets, [ --enable-wxwidgets Turn on WxWidgets interface (default=no wxwidgets)],enable_wxwidgets=$enableval,enable_wxwidgets=no)
|
2006-02-03 00:36:03 +00:00
|
|
|
AC_ARG_ENABLE(gtk, [ --enable-gtk Turn on Gtk interface (default=no Gtk)],enable_gtk=$enableval,enable_gtk=no)
|
2005-10-29 09:36:45 +00:00
|
|
|
AC_ARG_ENABLE(qt, [ --enable-qt Turn on Qt interface (default=no Qt)],enable_qt=$enableval,enable_qt=no)
|
|
|
|
AC_ARG_ENABLE(plugins, [ --disable-plugins Turn off plugins support (default=plugins enabled)],enable_plugins=$enableval,enable_plugins=yes)
|
|
|
|
AC_ARG_ENABLE(perl, [ --enable-perl Turn on Perl script plugin (default=no Perl plugin)],enable_perl=$enableval,enable_perl=no)
|
|
|
|
AC_ARG_ENABLE(python, [ --enable-python Turn on Python script plugin (default=no Python plugin)],enable_python=$enableval,enable_python=no)
|
|
|
|
AC_ARG_ENABLE(ruby, [ --enable-ruby Turn on Ruby script plugin (default=no Ruby script)],enable_ruby=$enableval,enable_ruby=no)
|
2006-02-03 00:29:38 +00:00
|
|
|
AC_ARG_ENABLE(lua, [ --enable-lua Turn on Lua script plugin (default=no Lua script)],enable_lua=$enableval,enable_lua=no)
|
|
|
|
AC_ARG_WITH(lua-inc, [ --with-lua-inc=DIR, Lua include files are in DIR (default=autodetect)],lua_inc=$withval,lua_inc='')
|
|
|
|
AC_ARG_WITH(lua-lib, [ --with-lua-lib=DIR, Lua library files are in DIR (default=autodetect)],lua_lib=$withval,lua_lib='')
|
|
|
|
AC_ARG_WITH(lua-suffix, [ --with-lua-suffix=ARG Lua is suffixed with ARG (default=autodetect)],lua_suffix=$withval,lua_suffix='')
|
2005-10-29 09:36:45 +00:00
|
|
|
AC_ARG_ENABLE(gnutls, [ --disable-gnutls Turn off gnutls support (default=compiled if found)],enable_gnutls=$enableval,enable_gnutls=yes)
|
2005-12-10 11:13:57 +00:00
|
|
|
AC_ARG_WITH(debug, [ --with-debug Debugging: 0=no debug, 1=debug compilation, 2=debug compilation + verbose msgs (default=1)],debug=$withval,debug=1)
|
2003-10-25 14:49:18 +00:00
|
|
|
|
2005-11-04 11:00:00 +00:00
|
|
|
AM_CONDITIONAL(GUI_NCURSES, test "$enable_ncurses" = "yes")
|
|
|
|
AM_CONDITIONAL(GUI_WXWIDGETS, test "$enable_wxwidgets" = "yes")
|
|
|
|
AM_CONDITIONAL(GUI_GTK, test "$enable_gtk" = "yes")
|
|
|
|
AM_CONDITIONAL(GUI_QT, test "$enable_qt" = "yes")
|
|
|
|
AM_CONDITIONAL(PLUGINS, test "$enable_plugins" = "yes")
|
2005-11-06 11:38:07 +00:00
|
|
|
AM_CONDITIONAL(PLUGIN_PERL, test "$enable_perl" = "yes")
|
2005-11-04 11:00:00 +00:00
|
|
|
AM_CONDITIONAL(PLUGIN_PYTHON, test "$enable_python" = "yes")
|
|
|
|
AM_CONDITIONAL(PLUGIN_RUBY, test "$enable_ruby" = "yes")
|
2006-02-03 00:29:38 +00:00
|
|
|
AM_CONDITIONAL(PLUGIN_LUA, test "$enable_lua" = "yes")
|
2005-11-04 11:00:00 +00:00
|
|
|
AM_CONDITIONAL(HAVE_GNUTLS, test "$enable_gnutls" = "yes")
|
2003-10-25 14:49:18 +00:00
|
|
|
|
2005-10-15 12:34:21 +00:00
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# GUI
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
2005-01-02 13:07:19 +00:00
|
|
|
if test "x$enable_ncurses" = "xyes" ; then
|
2005-10-25 09:23:10 +00:00
|
|
|
if test "$LIBNCURSESW_FOUND" = "0" ; then
|
|
|
|
if test "$LIBNCURSES_FOUND" = "0" ; then
|
|
|
|
AC_MSG_ERROR([
|
|
|
|
*** ncurses library not found!
|
2005-05-07 09:29:26 +00:00
|
|
|
*** Please install ncurses library or run ./configure with --disable-ncurses parameter.])
|
2005-10-25 09:23:10 +00:00
|
|
|
fi
|
|
|
|
AC_MSG_WARN([
|
|
|
|
*** ncursesw library not found! Falling back to "ncurses"
|
2005-10-25 17:37:13 +00:00
|
|
|
*** Be careful, UTF-8 display may not work properly if your locale is UTF-8.])
|
2005-10-25 09:23:10 +00:00
|
|
|
NCURSES_LIBS="-lncurses"
|
|
|
|
else
|
|
|
|
NCURSES_LIBS="-lncursesw"
|
|
|
|
AC_CHECK_HEADERS(ncursesw/curses.h)
|
2003-11-01 20:42:16 +00:00
|
|
|
fi
|
2005-01-02 13:07:19 +00:00
|
|
|
AC_SUBST(NCURSES_LIBS)
|
2003-10-26 11:52:22 +00:00
|
|
|
fi
|
2003-10-25 14:49:18 +00:00
|
|
|
|
2005-10-16 17:20:46 +00:00
|
|
|
#if test "x$enable_wxwidgets" = "xyes" ; then
|
|
|
|
# AM_OPTIONS_WXCONFIG
|
|
|
|
# AM_PATH_WXCONFIG(2.3.4, wxWin=1)
|
|
|
|
#
|
|
|
|
# if test "$wxWin" != 1; then
|
|
|
|
# AC_MSG_ERROR([
|
|
|
|
#*** wxWindows 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 wxWindows libraries are installed (returned by
|
|
|
|
#*** 'wx-config --libs' command) is in LD_LIBRARY_PATH or
|
|
|
|
#*** equivalent variable and wxWindows version is 2.3.4 or above.
|
|
|
|
# ])
|
|
|
|
# fi
|
|
|
|
#
|
|
|
|
# CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
|
|
|
|
# CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
|
|
|
|
# CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
|
|
|
|
# LDFLAGS="$LDFLAGS $WX_LIBS"
|
|
|
|
#
|
|
|
|
# WXWIDGETS_CFLAGS=""
|
|
|
|
# WXWIDGETS_LIBS=""
|
|
|
|
#fi
|
2005-04-24 11:08:22 +00:00
|
|
|
|
2003-10-26 11:52:22 +00:00
|
|
|
if test "x$enable_gtk" = "xyes" ; then
|
2006-02-03 00:36:03 +00:00
|
|
|
AM_PATH_GTK_2_0(2.4.0, LIBGTK_FOUND=1, LIBGTK_FOUND=0)
|
|
|
|
if test "$LIBGTK_FOUND" = "0" ; then
|
|
|
|
AC_MSG_ERROR([Gtk library not found! Install Gtk library (2.4 or higher) or run ./configure without --enable-gtk parameter.])
|
|
|
|
fi
|
2003-10-26 11:52:22 +00:00
|
|
|
GTK_CFLAGS=`pkg-config --cflags gtk+-2.0`
|
|
|
|
GTK_LIBS=`pkg-config --libs gtk+-2.0`
|
|
|
|
AC_SUBST(GTK_CFLAGS)
|
|
|
|
AC_SUBST(GTK_LIBS)
|
|
|
|
fi
|
2003-10-25 14:49:18 +00:00
|
|
|
|
2005-10-15 12:34:21 +00:00
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# plugins
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
2003-11-16 19:40:36 +00:00
|
|
|
PLUGINS_LIBS=
|
2003-11-09 00:08:01 +00:00
|
|
|
|
|
|
|
if test "x$enable_perl" = "xyes" ; then
|
|
|
|
enable_plugins="yes"
|
2005-05-07 09:29:26 +00:00
|
|
|
|
2005-12-15 12:32:36 +00:00
|
|
|
AC_PATH_PROGS(PERL, perl perl5)
|
2005-05-07 09:29:26 +00:00
|
|
|
if test -z $PERL ; then
|
|
|
|
AC_MSG_ERROR([
|
|
|
|
*** Perl must be installed on your system
|
|
|
|
*** but perl interpreter couldn't be found in path.
|
|
|
|
|
|
|
|
Please check that perl is in path, or install
|
|
|
|
it with your software package manager.])
|
|
|
|
fi
|
|
|
|
|
2005-05-24 15:14:54 +00:00
|
|
|
AC_MSG_CHECKING(for Perl headers files)
|
2005-05-07 09:29:26 +00:00
|
|
|
|
2005-05-24 15:14:54 +00:00
|
|
|
PERL_HEADER_TEST=`PT=perltest.c ; echo "#include <EXTERN.h>" > $PT; echo "#include <perl.h>" >> $PT; echo "#include <XSUB.h>" >> $PT ; echo "int main() { return 0; }" >> $PT ; $CC -Wall $PT -o $PT.out $($PERL -MExtUtils::Embed -e ccopts) 1>/dev/null 2>&1; echo $?; rm -f $PT $PT.out 1>/dev/null 2>&1`
|
2005-05-23 21:45:50 +00:00
|
|
|
|
2005-05-24 15:14:54 +00:00
|
|
|
if test "x$PERL_HEADER_TEST" = "x0" ; then
|
|
|
|
PERL_CFLAGS=`$PERL -MExtUtils::Embed -e ccopts`
|
|
|
|
else
|
|
|
|
AC_MSG_ERROR([
|
|
|
|
*** Perl headers couldn't be found in your system.
|
|
|
|
*** Try to install it with your software package manager.])
|
|
|
|
fi
|
|
|
|
AC_MSG_RESULT(found)
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(for Perl library)
|
|
|
|
|
|
|
|
PERL_LIB_TEST=`PT=perltest.c ; echo "int main() { return 0; }" > $PT ; $CC -Wall $PT -o $PT.out $($PERL -MExtUtils::Embed -e ldopts) 1>/dev/null 2>&1; echo $?; rm -f $PT $PT.out 1>/dev/null 2>&1`
|
|
|
|
|
|
|
|
if test "x$PERL_LIB_TEST" = "x0" ; then
|
2005-10-15 12:34:21 +00:00
|
|
|
PERL_LFLAGS=`$PERL -MExtUtils::Embed -e ldopts`
|
2005-05-07 09:29:26 +00:00
|
|
|
else
|
|
|
|
AC_MSG_ERROR([
|
|
|
|
*** Perl library couldn't be found in your system.
|
|
|
|
*** Try to install it with your software package manager.])
|
|
|
|
fi
|
|
|
|
AC_MSG_RESULT(found)
|
2005-05-24 15:14:54 +00:00
|
|
|
|
2003-11-09 00:08:01 +00:00
|
|
|
AC_SUBST(PERL_CFLAGS)
|
2005-10-15 12:34:21 +00:00
|
|
|
AC_SUBST(PERL_LFLAGS)
|
2003-11-16 19:40:36 +00:00
|
|
|
AC_DEFINE(PLUGIN_PERL)
|
2003-11-09 00:08:01 +00:00
|
|
|
fi
|
|
|
|
|
2005-05-01 18:53:23 +00:00
|
|
|
if test "x$enable_python" = "xyes" ; then
|
|
|
|
enable_plugins="yes"
|
2005-05-07 09:29:26 +00:00
|
|
|
|
2005-12-15 12:32:36 +00:00
|
|
|
AC_PATH_PROGS(PYTHON, python python2.4 python2.3 python2.2)
|
2005-05-07 09:29:26 +00:00
|
|
|
if test -z $PYTHON ; then
|
|
|
|
AC_MSG_ERROR([
|
|
|
|
*** Python must be installed on your system
|
|
|
|
*** but python interpreter couldn't be found in path.
|
|
|
|
|
|
|
|
*** Please check that python is in path, or install
|
|
|
|
*** it with your software package manager.])
|
|
|
|
fi
|
|
|
|
|
2005-05-29 15:15:12 +00:00
|
|
|
PYTHON_SYSPREFIX=`$PYTHON -c 'import sys; print "%s" % sys.prefix'`
|
|
|
|
PYTHON_VERSION=`$PYTHON -c 'import sys ; print sys.version[[:3]]'`
|
2005-10-26 10:20:15 +00:00
|
|
|
PYTHON_INCLUDE=`$PYTHON -c "import distutils.sysconfig,string; print distutils.sysconfig.get_config_var('CONFINCLUDEPY')"`
|
2005-05-07 09:29:26 +00:00
|
|
|
|
|
|
|
AC_MSG_CHECKING(for Python header files)
|
|
|
|
if test -r "$PYTHON_INCLUDE/Python.h"; then
|
2005-10-26 10:20:15 +00:00
|
|
|
PYTHON_CFLAGS="-I$PYTHON_INCLUDE"
|
2005-05-07 09:29:26 +00:00
|
|
|
else
|
|
|
|
AC_MSG_ERROR([
|
|
|
|
*** Python header files couldn't be found in your system.
|
|
|
|
*** Try to install them with your software package manager.])
|
|
|
|
fi
|
|
|
|
AC_MSG_RESULT(found)
|
|
|
|
|
2005-10-26 10:20:15 +00:00
|
|
|
PYTHON_LIB=`$PYTHON -c "import distutils.sysconfig; print distutils.sysconfig.get_config_var('LIBPL')"`
|
2005-11-04 22:30:23 +00:00
|
|
|
PYTHON_LFLAGS="-lpython$PYTHON_VERSION "`$PYTHON -c "import distutils.sysconfig; print distutils.sysconfig.get_config_var('LIBS')+' '+distutils.sysconfig.get_config_var('SYSLIBS')+' '+distutils.sysconfig.get_config_var('LINKFORSHARED')"`
|
2005-05-07 09:29:26 +00:00
|
|
|
|
|
|
|
AC_MSG_CHECKING(for Python library)
|
2005-10-27 15:49:03 +00:00
|
|
|
if test -r "$PYTHON_LIB/libpython$PYTHON_VERSION.so"; then
|
|
|
|
PYTHON_LFLAGS="-L$PYTHON_LIB $PYTHON_LFLAGS"
|
2005-11-01 19:52:29 +00:00
|
|
|
elif test -r "$PYTHON_LIB/libpython$PYTHON_VERSION.a"; then
|
|
|
|
PYTHON_LFLAGS="-L$PYTHON_LIB $PYTHON_LFLAGS"
|
2005-10-27 15:49:03 +00:00
|
|
|
elif test -r "$PYTHON_SYSPREFIX/lib/libpython$PYTHON_VERSION.so"; then
|
|
|
|
PYTHON_LFLAGS="-L$PYTHON_SYSPREFIX/lib/ $PYTHON_LFLAGS"
|
2005-05-07 09:29:26 +00:00
|
|
|
else
|
|
|
|
AC_MSG_ERROR([
|
|
|
|
*** Python library couldn't be found in your system.
|
|
|
|
*** Try to install it with your software package manager.])
|
|
|
|
fi
|
|
|
|
AC_MSG_RESULT(found)
|
|
|
|
|
2005-05-01 18:53:23 +00:00
|
|
|
AC_SUBST(PYTHON_CFLAGS)
|
2005-10-15 12:34:21 +00:00
|
|
|
AC_SUBST(PYTHON_LFLAGS)
|
2005-05-01 18:53:23 +00:00
|
|
|
AC_DEFINE(PLUGIN_PYTHON)
|
|
|
|
fi
|
|
|
|
|
2005-08-21 16:32:48 +00:00
|
|
|
if test "x$enable_ruby" = "xyes" ; then
|
|
|
|
enable_plugins="yes"
|
2005-11-22 14:36:20 +00:00
|
|
|
|
2005-12-15 12:32:36 +00:00
|
|
|
AC_PATH_PROGS(RUBY, ruby ruby1.8 ruby1.9)
|
2005-11-22 14:36:20 +00:00
|
|
|
if test -z $RUBY ; then
|
|
|
|
AC_MSG_ERROR([
|
|
|
|
*** Ruby must be installed on your system
|
|
|
|
*** but ruby interpreter couldn't be found in path.
|
|
|
|
|
|
|
|
*** Please check that ruby is in path, or install
|
|
|
|
*** it with your software package manager.])
|
|
|
|
fi
|
2005-08-21 16:32:48 +00:00
|
|
|
|
2005-11-22 14:36:20 +00:00
|
|
|
RUBY_INCLUDE=`$RUBY -rrbconfig -e "puts Config::CONFIG[['archdir']]"`
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(for Ruby header files)
|
|
|
|
if test -r "$RUBY_INCLUDE/ruby.h"; then
|
|
|
|
RUBY_CFLAGS="-I$RUBY_INCLUDE"
|
|
|
|
else
|
|
|
|
AC_MSG_ERROR([
|
|
|
|
*** Ruby header files couldn't be found in your system.
|
|
|
|
*** Try to install them with your software package manager.])
|
|
|
|
fi
|
|
|
|
AC_MSG_RESULT(found)
|
|
|
|
|
|
|
|
RUBY_LFLAGS=`$RUBY -rrbconfig -e "puts Config::CONFIG[['LIBRUBYARG_SHARED']]"`
|
|
|
|
|
2005-08-21 16:32:48 +00:00
|
|
|
AC_SUBST(RUBY_CFLAGS)
|
2005-10-15 12:34:21 +00:00
|
|
|
AC_SUBST(RUBY_LFLAGS)
|
2005-08-21 16:32:48 +00:00
|
|
|
AC_DEFINE(PLUGIN_RUBY)
|
|
|
|
fi
|
|
|
|
|
2006-02-03 00:29:38 +00:00
|
|
|
if test "x$enable_lua" = "xyes" ; then
|
|
|
|
enable_plugins="yes"
|
|
|
|
|
|
|
|
ac_save_CPPFLAGS="$CPPFLAGS"
|
|
|
|
ac_save_CFLAGS="$CFLAGS"
|
|
|
|
ac_save_LFLAGS="$LFLAGS"
|
|
|
|
|
|
|
|
LUA_CFLAGS=""
|
|
|
|
LUA_LFLAGS=""
|
|
|
|
|
|
|
|
if test -n "$lua_inc"; then
|
|
|
|
CFLAGS="$CFLAGS -I$lua_inc"
|
|
|
|
CPPFLAGS="$CPPFLAGS -I$lua_inc"
|
|
|
|
fi
|
|
|
|
if test -n "$lua_lib"; then
|
|
|
|
LFLAGS="$LFLAGS -L$lua_lib"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "x$LUA_CFLAGS" = "x" -o "x$LUA_LFLAGS" = "x" ; then
|
|
|
|
PKGCONFIG=""
|
|
|
|
AC_CHECK_PROGS(PKGCONFIG, pkg-config)
|
|
|
|
if test "x$PKGCONFIG" != "x"; then
|
|
|
|
AC_MSG_CHECKING(for Lua headers and librairies with pkg-config)
|
|
|
|
for l in "$lua_suffix" "" "50" "5.0" ; do
|
|
|
|
pkgconfig_lua_found=`$PKGCONFIG --exists lua$l && $PKGCONFIG --exists lualib$l`
|
|
|
|
if test "x$?" = "x0" ; then
|
|
|
|
LUA_CFLAGS="$LUA_CFLAGS "`$PKGCONFIG --cflags lua$l`
|
|
|
|
LUA_CFLAGS="$LUA_CFLAGS "`$PKGCONFIG --cflags lualib$l`
|
|
|
|
LUA_LFLAGS="$LUA_LFLAGS "`$PKGCONFIG --libs lua$l`
|
|
|
|
LUA_LFLAGS="$LUA_LFLAGS "`$PKGCONFIG --libs lualib$l`
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
2006-02-03 08:31:15 +00:00
|
|
|
if test "x$LUA_CFLAGS" = "x" -o "x$LUA_LFLAGS" = "x" ; then
|
|
|
|
AC_MSG_RESULT(found)
|
|
|
|
fi
|
2006-02-03 00:29:38 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "x$LUA_CFLAGS" = "x" -o "x$LUA_LFLAGS" = "x" ; then
|
|
|
|
LUACONFIG=""
|
|
|
|
AC_CHECK_PROGS(LUACONFIG, lua-config lua-config50 lua-config5.0)
|
|
|
|
if test "x$LUACONFIG" != "x" ; then
|
|
|
|
AC_MSG_CHECKING(for Lua headers and librairies with lua-config)
|
|
|
|
LUA_CFLAGS=`$LUACONFIG --include`
|
|
|
|
LUA_LFLAGS=`$LUACONFIG --libs`
|
|
|
|
fi
|
2006-02-03 08:31:15 +00:00
|
|
|
if test "x$LUA_CFLAGS" = "x" -o "x$LUA_LFLAGS" = "x" ; then
|
|
|
|
AC_MSG_RESULT(found)
|
|
|
|
fi
|
2006-02-03 00:29:38 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if test "x$LUA_CFLAGS" = "x" -o "x$LUA_LFLAGS" = "x" ; then
|
2006-02-03 08:31:15 +00:00
|
|
|
AC_MSG_CHECKING(for Lua headers and librairies)
|
2006-02-03 00:29:38 +00:00
|
|
|
AC_CHECK_HEADER(lua.h,ac_found_lua_header="yes",ac_found_lua_header="no")
|
|
|
|
AC_CHECK_HEADER(lualib.h,ac_found_liblua_header="yes",ac_found_liblua_header="no")
|
|
|
|
if test "x$ac_found_lua_header" = "xyes" -a "x$ac_found_liblua_header" = "xyes"; then
|
|
|
|
LUA_CFLAGS="$CFLAGS"
|
|
|
|
fi
|
|
|
|
for l in "$lua_suffix" "" "50" "5.0" ; do
|
|
|
|
AC_CHECK_LIB(lua$l,lua_open,ac_found_lua_lib="yes",ac_found_lua_lib="no")
|
|
|
|
AC_CHECK_LIB(lualib$l,luaopen_base,ac_found_liblua_lib="yes",ac_found_liblua_lib="no")
|
|
|
|
if test "x$ac_found_lua_lib" = "xyes" ; then
|
|
|
|
LUA_LFLAGS="$LFLAGS -llua$l"
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
if test "x$ac_found_liblua_lib" = "xyes" ; then
|
|
|
|
LUA_LFLAGS="$LUA_LFLAGS -llualib$l"
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
2006-02-03 08:31:15 +00:00
|
|
|
|
2006-02-03 00:29:38 +00:00
|
|
|
if test "x$LUA_CFLAGS" = "x" -o "x$LUA_LFLAGS" = "x" ; then
|
|
|
|
AC_MSG_ERROR([
|
|
|
|
*** Lua (>=5.0) headers and librairies couldn't be found in your system.
|
|
|
|
*** Try to install liblua, liblualib and liblua-dev
|
|
|
|
*** Try to install them with your software package manager.])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(found)
|
|
|
|
fi
|
|
|
|
|
|
|
|
CFLAGS="$ac_save_CFLAGS"
|
|
|
|
CPPFLAGS="$ac_save_CPPFLAGS"
|
|
|
|
LFLAGS="$ac_save_LFLAGS"
|
|
|
|
|
|
|
|
AC_SUBST(LUA_CFLAGS)
|
|
|
|
AC_SUBST(LUA_LFLAGS)
|
|
|
|
AC_DEFINE(PLUGIN_LUA)
|
|
|
|
fi
|
|
|
|
|
2003-11-17 21:07:17 +00:00
|
|
|
if test "x$enable_plugins" = "xyes" ; then
|
2005-10-15 12:34:21 +00:00
|
|
|
AC_CHECK_FUNCS(dlopen, LIBDL_FOUND=yes, LIBDL_FOUND=no)
|
|
|
|
if test "$LIBDL_FOUND" != "yes"; then
|
|
|
|
AC_CHECK_LIB(dl, dlopen, LIBDL_FOUND=yes, LIBDL_FOUND=no)
|
2005-10-17 10:36:09 +00:00
|
|
|
if test "$LIBDL_FOUND" = "yes"; then
|
2005-10-30 18:37:58 +00:00
|
|
|
PLUGINS_LIBS="-ldl"
|
2005-10-17 10:36:09 +00:00
|
|
|
else
|
|
|
|
AC_MSG_ERROR([
|
2005-10-15 12:34:21 +00:00
|
|
|
*** "dl" library (dynamic library loader) couldn't be found in your system.
|
|
|
|
*** Try to install it with your software package manager or disable plugins.])
|
2005-10-17 10:36:09 +00:00
|
|
|
fi
|
2005-10-15 12:34:21 +00:00
|
|
|
fi
|
2005-10-17 10:36:09 +00:00
|
|
|
AC_DEFINE(PLUGINS)
|
2003-11-17 21:07:17 +00:00
|
|
|
fi
|
|
|
|
|
2003-11-16 19:40:36 +00:00
|
|
|
AC_SUBST(PLUGINS_LIBS)
|
2003-11-09 00:08:01 +00:00
|
|
|
|
2005-10-15 12:34:21 +00:00
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# gnutls
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
2005-06-22 18:50:24 +00:00
|
|
|
if test "x$enable_gnutls" = "xyes" ; then
|
2005-07-02 15:59:44 +00:00
|
|
|
found_gnutls="no"
|
|
|
|
AM_PATH_LIBGNUTLS( 1.0.0, found_gnutls=yes, AC_MSG_WARN([[
|
|
|
|
*** libgnutls was not found. You may want to get it from
|
|
|
|
*** ftp://ftp.gnutls.org/pub/gnutls/
|
|
|
|
*** WeeChat will be built without GnuTLS support.]]))
|
|
|
|
if test "x$found_gnutls" = "xyes" ; then
|
2005-10-29 17:56:50 +00:00
|
|
|
GNUTLS_CFLAGS=`libgnutls-config --cflags`
|
|
|
|
GNUTLS_LFLAGS=`libgnutls-config --libs`
|
|
|
|
AC_SUBST(GNUTLS_CFLAGS)
|
|
|
|
AC_SUBST(GNUTLS_LFLAGS)
|
|
|
|
AC_DEFINE(HAVE_GNUTLS)
|
2005-07-02 15:59:44 +00:00
|
|
|
else
|
|
|
|
enable_gnutls="no"
|
|
|
|
fi
|
2005-06-22 18:50:24 +00:00
|
|
|
fi
|
2005-10-15 12:34:21 +00:00
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# general vars
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
if test "x$prefix" = "xNONE" ; then
|
|
|
|
prefix="$ac_default_prefix"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "x$exec_prefix" = "xNONE" ; then
|
|
|
|
exec_prefix="$prefix"
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_DEFINE_UNQUOTED(PREFIX, "${prefix}")
|
|
|
|
|
|
|
|
WEECHAT_LIBDIR=`eval echo ${libdir}/weechat`
|
|
|
|
AC_DEFINE_UNQUOTED(WEECHAT_LIBDIR, "$WEECHAT_LIBDIR")
|
|
|
|
|
|
|
|
WEECHAT_SHAREDIR=`eval echo ${datadir}/weechat`
|
|
|
|
AC_DEFINE_UNQUOTED(WEECHAT_SHAREDIR, "$WEECHAT_SHAREDIR")
|
|
|
|
|
|
|
|
weechat_libdir=${libdir}/weechat
|
|
|
|
AC_SUBST(weechat_libdir)
|
2005-06-22 18:50:24 +00:00
|
|
|
|
2004-11-05 21:05:32 +00:00
|
|
|
CFLAGS=`echo $CFLAGS | sed s/-g//g`
|
|
|
|
if test "x$CFLAGS" = "x" ; then
|
|
|
|
CFLAGS="-O2"
|
|
|
|
fi
|
2004-07-02 23:19:36 +00:00
|
|
|
if test "x$debug" = "x1" || test "x$debug" = "x2" ; then
|
2004-11-05 21:05:32 +00:00
|
|
|
CFLAGS="-Wall -W $CFLAGS -pipe -g"
|
2004-07-01 20:43:57 +00:00
|
|
|
else
|
2004-11-05 21:05:32 +00:00
|
|
|
CFLAGS="-Wall -W $CFLAGS -pipe"
|
2003-11-09 00:08:01 +00:00
|
|
|
fi
|
|
|
|
|
2004-07-02 23:19:36 +00:00
|
|
|
if test "x$debug" = "x2" ; then
|
|
|
|
AC_DEFINE(DEBUG)
|
|
|
|
fi
|
|
|
|
|
2005-10-31 10:56:32 +00:00
|
|
|
LIBS="$LIBS $INTLLIBS"
|
|
|
|
|
2005-10-29 17:56:50 +00:00
|
|
|
case "$host_os" in
|
2005-11-01 18:32:10 +00:00
|
|
|
freebsd* | netbsd*)
|
2005-10-31 10:56:32 +00:00
|
|
|
if test "x$enable_perl" = "xyes" -o "x$enable_python" = "xyes" ; then
|
2005-10-29 17:56:50 +00:00
|
|
|
CFLAGS="$CFLAGS -pthread"
|
2005-10-31 10:56:32 +00:00
|
|
|
fi
|
|
|
|
CFLAGS="$CFLAGS $CPPFLAGS"
|
2005-10-29 17:56:50 +00:00
|
|
|
;;
|
2005-10-30 13:17:20 +00:00
|
|
|
openbsd*)
|
2005-10-31 10:56:32 +00:00
|
|
|
if test "x$enable_python" = "xyes" ; then
|
|
|
|
CFLAGS="$CFLAGS -pthread"
|
|
|
|
fi
|
|
|
|
;;
|
2006-02-03 00:29:38 +00:00
|
|
|
gnu*)
|
|
|
|
if test "x$enable_plugins" = "xyes" ; then
|
|
|
|
LDFLAGS="$LDFLAGS -lpthread"
|
|
|
|
fi
|
|
|
|
;;
|
2005-10-29 17:56:50 +00:00
|
|
|
*)
|
|
|
|
;;
|
|
|
|
esac
|
2005-04-17 19:01:18 +00:00
|
|
|
|
2005-10-15 12:34:21 +00:00
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# output Makefiles
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
2003-10-25 14:49:18 +00:00
|
|
|
AC_OUTPUT([Makefile
|
2005-07-16 22:46:01 +00:00
|
|
|
doc/Makefile
|
2006-01-02 22:16:54 +00:00
|
|
|
doc/fr/Makefile
|
|
|
|
doc/en/Makefile
|
2003-10-25 14:49:18 +00:00
|
|
|
src/Makefile
|
|
|
|
src/common/Makefile
|
|
|
|
src/irc/Makefile
|
2003-11-09 00:08:01 +00:00
|
|
|
src/plugins/Makefile
|
2005-10-15 12:34:21 +00:00
|
|
|
src/plugins/scripts/Makefile
|
|
|
|
src/plugins/scripts/perl/Makefile
|
|
|
|
src/plugins/scripts/python/Makefile
|
2005-10-23 11:33:39 +00:00
|
|
|
src/plugins/scripts/ruby/Makefile
|
2006-02-08 12:06:24 +00:00
|
|
|
src/plugins/scripts/lua/Makefile
|
2003-10-25 14:49:18 +00:00
|
|
|
src/gui/Makefile
|
|
|
|
src/gui/curses/Makefile
|
2005-04-24 11:08:22 +00:00
|
|
|
src/gui/wxwidgets/Makefile
|
2003-10-25 14:49:18 +00:00
|
|
|
src/gui/gtk/Makefile
|
2003-11-01 20:42:16 +00:00
|
|
|
src/gui/qt/Makefile
|
|
|
|
intl/Makefile
|
|
|
|
po/Makefile.in])
|
2003-10-25 14:49:18 +00:00
|
|
|
|
2005-10-15 12:34:21 +00:00
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# end message
|
|
|
|
# ------------------------------------------------------------------------------
|
2003-10-25 14:49:18 +00:00
|
|
|
|
|
|
|
listgui=
|
2005-01-02 13:07:19 +00:00
|
|
|
if test "x$enable_ncurses" = "xyes" ; then
|
2005-01-23 02:14:37 +00:00
|
|
|
listgui="$listgui ncurses"
|
2003-10-25 14:49:18 +00:00
|
|
|
fi
|
2005-04-24 11:08:22 +00:00
|
|
|
if test "x$enable_wxwidgets" = "xyes"; then
|
|
|
|
listgui="$listgui WxWidgets"
|
|
|
|
fi
|
2003-10-25 14:49:18 +00:00
|
|
|
if test "x$enable_gtk" = "xyes" ; then
|
2006-02-03 00:36:03 +00:00
|
|
|
listgui="$listgui Gtk"
|
2003-10-25 14:49:18 +00:00
|
|
|
fi
|
|
|
|
if test "x$enable_qt" = "xyes" ; then
|
|
|
|
listgui="$listgui Qt"
|
|
|
|
fi
|
|
|
|
|
2003-10-26 22:49:01 +00:00
|
|
|
if test "x$listgui" = "x" ; then
|
2005-05-07 09:29:26 +00:00
|
|
|
AC_MSG_ERROR([
|
|
|
|
*** No interface specified...
|
|
|
|
*** Please specify at least ncurses, WxWidgets, Gtk or Qt.])
|
2003-10-26 22:49:01 +00:00
|
|
|
fi
|
|
|
|
|
2005-01-23 02:14:37 +00:00
|
|
|
msg_debug_compiler="no"
|
|
|
|
msg_debug_verbose="no"
|
2004-07-02 23:19:36 +00:00
|
|
|
if test "x$debug" = "x1" || test "x$debug" = "x2" ; then
|
2005-01-23 02:14:37 +00:00
|
|
|
msg_debug_compiler="yes"
|
2004-07-02 23:19:36 +00:00
|
|
|
fi
|
|
|
|
if test "x$debug" = "x2" ; then
|
2005-01-23 02:14:37 +00:00
|
|
|
msg_debug_verbose="yes"
|
2004-07-02 23:19:36 +00:00
|
|
|
fi
|
|
|
|
|
2005-10-15 12:34:21 +00:00
|
|
|
echo ""
|
2005-10-29 09:36:45 +00:00
|
|
|
echo "Interfaces.................................... :$listgui"
|
|
|
|
echo "Build with GNUtls support..................... : $enable_gnutls"
|
|
|
|
echo "Build with Plugin support..................... : $enable_plugins"
|
|
|
|
echo " Perl plugin..................... : $enable_perl"
|
|
|
|
echo " Python plugin................... : $enable_python"
|
|
|
|
echo " Ruby plugin..................... : $enable_ruby"
|
2006-02-03 00:29:38 +00:00
|
|
|
echo " Lua plugin...................... : $enable_lua"
|
2005-10-29 09:36:45 +00:00
|
|
|
echo "Compile with debug info....................... : $msg_debug_compiler"
|
|
|
|
echo "Print debugging messages...................... : $msg_debug_verbose"
|
2005-10-15 12:34:21 +00:00
|
|
|
echo ""
|
|
|
|
eval echo "WeeChat will be installed in $bindir."
|
|
|
|
echo ""
|
|
|
|
echo "configure complete, now type 'make' to build WeeChat $VERSION"
|
|
|
|
echo ""
|