weechat/configure.in

299 lines
9.9 KiB
Plaintext
Raw Normal View History

2005-01-01 12:31:19 +00:00
# Copyright (c) 2003-2005 FlashCode <flashcode@flashtux.org>
#
# 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
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.56)
2005-05-22 16:12:24 +00:00
AC_INIT(WeeChat, 0.1.3-cvs, flashcode@flashtux.org)
AC_CONFIG_SRCDIR([src/common/weechat.c])
2003-10-25 23:13:40 +00:00
AM_CONFIG_HEADER(config.h)
2005-05-22 16:12:24 +00:00
AM_INIT_AUTOMAKE([weechat], [0.1.3-cvs])
# Checks for programs.
AC_PROG_CC
AC_PROG_MAKE_SET
AC_PROG_RANLIB
# Gettext
2005-02-27 13:25:36 +00:00
ALL_LINGUAS="fr es"
AM_GNU_GETTEXT
# Checks for libraries.
2005-01-02 13:07:19 +00:00
AC_CHECK_LIB([ncurses], [initscr], LIBNCURSES_FOUND=1, LIBNCURSES_FOUND=0)
AM_OPTIONS_WXCONFIG
AM_PATH_WXCONFIG(2.3.4, wxWin=1)
# Checks for header files.
AC_HEADER_STDC
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])
# Checks for typedefs, structures, and compiler characteristics.
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)
# 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-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])
2003-11-09 00:08:01 +00:00
AH_VERBATIM([DEBUG], [#undef DEBUG])
2005-05-22 17:40:25 +00:00
AC_ARG_ENABLE(ncurses, [ --disable-ncurses Turn off ncurses interface (default=auto)],enable_ncurses=$enableval,enable_ncurses=yes)
AC_ARG_ENABLE(wxwidgets,[ --enable-wxwidgets Turn on WxWidgets interface (default=no)],enable_wxwidgets=$enableval,enable_wxwidgets=no)
AC_ARG_ENABLE(gtk, [ --enable-gtk Turn on Gtk+ interface (default=no)],enable_gtk=$enableval,enable_gtk=no)
AC_ARG_ENABLE(qt, [ --enable-qt Turn on Qt interface (default=no)],enable_qt=$enableval,enable_qt=no)
AC_ARG_ENABLE(perl, [ --enable-perl Turn on Perl plugins (default=no)],enable_perl=$enableval,enable_perl=no)
AC_ARG_ENABLE(python, [ --enable-python Turn on Python plugins (default=no)],enable_python=$enableval,enable_python=no)
2005-01-02 13:07:19 +00:00
AC_ARG_WITH(debug, [ --with-debug Debugging: 0=no debug, 1=debug compilation, 2=debug compilation + verbose msgs (default=0)],debug=$withval,debug=0)
2003-11-09 00:08:01 +00:00
enable_plugins="no"
enable_ruby="no"
RUBY_CFLAGS=
2005-01-02 13:07:19 +00:00
AM_CONDITIONAL(GUI_NCURSES, test "$enable_ncurses" = "yes")
AM_CONDITIONAL(GUI_WXWIDGETS, test "$enable_wxwidgets" = "yes")
2003-11-09 00:08:01 +00:00
AM_CONDITIONAL(GUI_GTK, test "$enable_gtk" = "yes")
AM_CONDITIONAL(GUI_QT, test "$enable_qt" = "yes")
AM_CONDITIONAL(PLUGIN_PERL, test "$enable_perl" = "yes")
2005-05-01 18:53:23 +00:00
AM_CONDITIONAL(PLUGIN_PYTHON, test "$enable_python" = "yes")
2003-11-09 00:08:01 +00:00
# AM_CONDITIONAL(PLUGIN_RUBY, test "$enable_ruby" = "yes")
2005-01-02 13:07:19 +00:00
if test "x$enable_ncurses" = "xyes" ; then
if test "$LIBNCURSES_FOUND" = "0" ; then
AC_MSG_ERROR([
*** ncurses library not found!
*** Please install ncurses library or run ./configure with --disable-ncurses parameter.])
fi
2005-01-02 13:07:19 +00:00
NCURSES_LIBS="-lncurses"
AC_SUBST(NCURSES_LIBS)
2003-10-26 11:52:22 +00:00
fi
if test "x$enable_wxwidgets" = "xyes" ; then
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
2003-10-26 11:52:22 +00:00
if test "x$enable_gtk" = "xyes" ; then
#if test "$LIBGTK_FOUND" = "0" ; then
# AC_MSG_ERROR([Gtk+ library not found! Install Gtk+ (2.0 or higher) library 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-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"
AC_PATH_PROG(PERL, perl)
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
AC_MSG_CHECKING(for Perl library)
2005-05-23 21:45:50 +00:00
PERL_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_TEST" = "x0" ; then
PLUGINS_LIBS="$PLUGINS_LIBS ../../plugins/perl/lib_weechat_perl.a `$PERL -MExtUtils::Embed -e ldopts`"
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-23 21:45:50 +00:00
PERL_CFLAGS=`$PERL -MExtUtils::Embed -e ccopts`
2003-11-09 00:08:01 +00:00
AC_SUBST(PERL_CFLAGS)
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"
AC_PATH_PROG(PYTHON, python)
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
PYTHON_INCLUDE=`$PYTHON -c 'import sys ; print "%s/include/python%s" % (sys.prefix, sys.version[[:3]])'`
AC_MSG_CHECKING(for Python header files)
if test -r "$PYTHON_INCLUDE/Python.h"; then
PYTHON_CFLAGS=`$PYTHON -c "import distutils.sysconfig,string; print ' -I' + distutils.sysconfig.get_config_var('CONFINCLUDEPY')"`
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-05-23 21:45:50 +00:00
PYTHON_SYSPREFIX=`$PYTHON -c 'import sys; print "%s" % sys.prefix'`
PYTHON_LIB=`$PYTHON -c 'import sys; print "%s/lib/python%s/config" % (sys.prefix, sys.version[[:3]])'`
PYTHON_VERSION=`$PYTHON -c 'import sys ; print sys.version[[0:3]]'`
AC_MSG_CHECKING(for Python library)
2005-05-23 21:45:50 +00:00
if test -r "$PYTHON_LIB/libpython$PYTHON_VERSION.so" -o -r "$PYTHON_SYSPREFIX/lib/libpython$PYTHON_VERSION.so"; then
PYTHON_LFLAGS=`$PYTHON -c "import distutils.sysconfig,string; print string.join(distutils.sysconfig.get_config_vars('LINKFORSHARED', 'BLDLIBRARY', 'SHLIBS'))"`
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
PLUGINS_LIBS="$PLUGINS_LIBS ../../plugins/python/lib_weechat_python.a $PYTHON_LFLAGS"
AC_SUBST(PYTHON_CFLAGS)
AC_DEFINE(PLUGIN_PYTHON)
fi
2003-11-17 21:07:17 +00:00
if test "x$enable_plugins" = "xyes" ; then
AC_DEFINE(PLUGINS)
fi
2003-11-16 19:40:36 +00:00
AC_SUBST(PLUGINS_LIBS)
2003-11-09 00:08:01 +00:00
CFLAGS=`echo $CFLAGS | sed s/-g//g`
if test "x$CFLAGS" = "x" ; then
CFLAGS="-O2"
fi
if test "x$debug" = "x1" || test "x$debug" = "x2" ; then
CFLAGS="-Wall -W $CFLAGS -pipe -g"
2004-07-01 20:43:57 +00:00
else
CFLAGS="-Wall -W $CFLAGS -pipe"
2003-11-09 00:08:01 +00:00
fi
if test "x$debug" = "x2" ; then
AC_DEFINE(DEBUG)
fi
dnl For FreeBSD
LIBS="$LIBS $INTLLIBS"
CFLAGS="$CFLAGS $CPPFLAGS"
AC_OUTPUT([Makefile
src/Makefile
src/common/Makefile
src/irc/Makefile
2003-11-09 00:08:01 +00:00
src/plugins/Makefile
src/plugins/perl/Makefile
2005-05-01 18:53:23 +00:00
src/plugins/python/Makefile
src/gui/Makefile
src/gui/curses/Makefile
src/gui/wxwidgets/Makefile
src/gui/gtk/Makefile
src/gui/qt/Makefile
intl/Makefile
po/Makefile.in])
echo
echo $PACKAGE $VERSION
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"
fi
if test "x$enable_wxwidgets" = "xyes"; then
listgui="$listgui WxWidgets"
fi
if test "x$enable_gtk" = "xyes" ; then
listgui="$listgui Gtk+"
fi
if test "x$enable_qt" = "xyes" ; then
listgui="$listgui Qt"
fi
if test "x$listgui" = "x" ; then
AC_MSG_ERROR([
*** No interface specified...
*** Please specify at least ncurses, WxWidgets, Gtk or Qt.])
fi
2005-01-23 02:14:37 +00:00
msg_debug_compiler="no"
msg_debug_verbose="no"
if test "x$debug" = "x1" || test "x$debug" = "x2" ; then
2005-01-23 02:14:37 +00:00
msg_debug_compiler="yes"
fi
if test "x$debug" = "x2" ; then
2005-01-23 02:14:37 +00:00
msg_debug_verbose="yes"
fi
echo
echo Interfaces.................... :$listgui
echo
echo Build with Plugin support..... : $enable_plugins
echo Build with Perl support....... : $enable_perl
echo Build with Python support..... : $enable_python
echo Build with Ruby support....... : $enable_ruby
echo
echo Compile with debug info....... : $msg_debug_compiler
echo Print debugging messages...... : $msg_debug_verbose
echo
eval eval echo WeeChat will be installed in $bindir.
echo
echo configure complete, now type \'make\' to build WeeChat
echo