summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in131
1 files changed, 94 insertions, 37 deletions
diff --git a/configure.in b/configure.in
index b3b1bae10..f2cc342e0 100644
--- a/configure.in
+++ b/configure.in
@@ -24,23 +24,23 @@ AC_CONFIG_SRCDIR([src/common/weechat.c])
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE([weechat], [0.1.6-cvs])
-# Checks for programs.
+# Checks for programs
AC_PROG_CC
AC_PROG_MAKE_SET
-AC_PROG_RANLIB
+AM_PROG_LIBTOOL
# Gettext
ALL_LINGUAS="fr es cs"
AM_GNU_GETTEXT
-# Checks for libraries.
-AC_CHECK_LIB([ncurses], [initscr], LIBNCURSES_FOUND=1, LIBNCURSES_FOUND=0)
+# Checks for libraries
+AC_CHECK_LIB(ncurses, initscr, LIBNCURSES_FOUND=1, LIBNCURSES_FOUND=0)
-# Checks for header files.
+# 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.
+# Checks for typedefs, structures, and compiler characteristics
AC_HEADER_TIME
AC_STRUCT_TM
@@ -63,6 +63,11 @@ AC_FUNC_SELECT_ARGTYPES
AC_TYPE_SIGNAL
AC_CHECK_FUNCS([gethostbyname gethostname getsockname gettimeofday inet_ntoa memset mkdir select setlocale socket strcasecmp strchr strdup strncasecmp strpbrk strrchr strstr uname])
+# Variables in config.h
+
+AH_VERBATIM([PREFIX], [#undef PREFIX])
+AH_VERBATIM([WEECHAT_LIBDIR], [#undef WEECHAT_LIBDIR])
+AH_VERBATIM([WEECHAT_SHAREDIR], [#undef WEECHAT_SHAREDIR])
AH_VERBATIM([PLUGINS], [#undef PLUGINS])
AH_VERBATIM([PLUGIN_PERL], [#undef PLUGIN_PERL])
AH_VERBATIM([PLUGIN_PYTHON], [#undef PLUGIN_PYTHON])
@@ -70,27 +75,33 @@ AH_VERBATIM([PLUGIN_RUBY], [#undef PLUGIN_RUBY])
AH_VERBATIM([HAVE_GNUTLS], [#undef HAVE_GNUTLS])
AH_VERBATIM([DEBUG], [#undef DEBUG])
+# Arguments for ./configure
+
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)
-AC_ARG_ENABLE(ruby, [ --enable-ruby Turn on Ruby plugins (default=no)],enable_ruby=$enableval,enable_ruby=no)
+AC_ARG_ENABLE(plugins, [ --disable-plugins Turn off plugins support (default=yes)],enable_plugins=$enableval,enable_plugins=yes)
+AC_ARG_ENABLE(perl, [ --enable-perl Turn on Perl script plugin (default=no)],enable_perl=$enableval,enable_perl=no)
+AC_ARG_ENABLE(python, [ --enable-python Turn on Python script plugin (default=no)],enable_python=$enableval,enable_python=no)
+AC_ARG_ENABLE(ruby, [ --enable-ruby Turn on Ruby script plugin (default=no)],enable_ruby=$enableval,enable_ruby=no)
AC_ARG_ENABLE(gnutls, [ --disable-gnutls Turn off gnutls support (default=auto)],enable_gnutls=$enableval,enable_gnutls=yes)
AC_ARG_WITH(debug, [ --with-debug Debugging: 0=no debug, 1=debug compilation, 2=debug compilation + verbose msgs (default=0)],debug=$withval,debug=0)
-enable_plugins="no"
-
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")
AM_CONDITIONAL(PLUGIN_PERL, test "$enable_perl" = "yes")
AM_CONDITIONAL(PLUGIN_PYTHON, test "$enable_python" = "yes")
AM_CONDITIONAL(PLUGIN_RUBY, test "$enable_ruby" = "yes")
AM_CONDITIONAL(HAVE_GNUTLS, test "$enable_gnutls" = "yes")
+# ------------------------------------------------------------------------------
+# GUI
+# ------------------------------------------------------------------------------
+
if test "x$enable_ncurses" = "xyes" ; then
if test "$LIBNCURSES_FOUND" = "0" ; then
AC_MSG_ERROR([
@@ -136,6 +147,10 @@ if test "x$enable_gtk" = "xyes" ; then
AC_SUBST(GTK_LIBS)
fi
+# ------------------------------------------------------------------------------
+# plugins
+# ------------------------------------------------------------------------------
+
PLUGINS_LIBS=
if test "x$enable_perl" = "xyes" ; then
@@ -169,7 +184,7 @@ it with your software package manager.])
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
- PLUGINS_LIBS="$PLUGINS_LIBS ../../plugins/perl/lib_weechat_perl.a `$PERL -MExtUtils::Embed -e ldopts`"
+ PERL_LFLAGS=`$PERL -MExtUtils::Embed -e ldopts`
else
AC_MSG_ERROR([
*** Perl library couldn't be found in your system.
@@ -178,6 +193,7 @@ it with your software package manager.])
AC_MSG_RESULT(found)
AC_SUBST(PERL_CFLAGS)
+ AC_SUBST(PERL_LFLAGS)
AC_DEFINE(PLUGIN_PERL)
fi
@@ -220,8 +236,8 @@ if test "x$enable_python" = "xyes" ; then
fi
AC_MSG_RESULT(found)
- PLUGINS_LIBS="$PLUGINS_LIBS ../../plugins/python/lib_weechat_python.a $PYTHON_LFLAGS"
AC_SUBST(PYTHON_CFLAGS)
+ AC_SUBST(PYTHON_LFLAGS)
AC_DEFINE(PLUGIN_PYTHON)
fi
@@ -232,17 +248,32 @@ if test "x$enable_ruby" = "xyes" ; then
RUBY_CFLAGS=-I`ruby -rrbconfig -e "puts Config::CONFIG[['archdir']]"`
RUBY_LFLAGS=`ruby -rrbconfig -e "puts Config::CONFIG[['LIBRUBYARG_SHARED']]"`
- PLUGINS_LIBS="$PLUGINS_LIBS ../../plugins/ruby/lib_weechat_ruby.a $RUBY_LFLAGS"
AC_SUBST(RUBY_CFLAGS)
+ AC_SUBST(RUBY_LFLAGS)
AC_DEFINE(PLUGIN_RUBY)
fi
if test "x$enable_plugins" = "xyes" ; then
- AC_DEFINE(PLUGINS)
+ 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)
+ fi
+ if test "$LIBDL_FOUND" = "yes"; then
+ PLUGINS_LIBS="../../plugins/lib_weechat_plugins.a -ldl"
+ AC_DEFINE(PLUGINS)
+ else
+ AC_MSG_ERROR([
+*** "dl" library (dynamic library loader) couldn't be found in your system.
+*** Try to install it with your software package manager or disable plugins.])
+ fi
fi
AC_SUBST(PLUGINS_LIBS)
+# ------------------------------------------------------------------------------
+# gnutls
+# ------------------------------------------------------------------------------
+
if test "x$enable_gnutls" = "xyes" ; then
found_gnutls="no"
AM_PATH_LIBGNUTLS( 1.0.0, found_gnutls=yes, AC_MSG_WARN([[
@@ -257,6 +288,29 @@ if test "x$enable_gnutls" = "xyes" ; then
enable_gnutls="no"
fi
fi
+
+# ------------------------------------------------------------------------------
+# 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)
CFLAGS=`echo $CFLAGS | sed s/-g//g`
if test "x$CFLAGS" = "x" ; then
@@ -272,19 +326,23 @@ if test "x$debug" = "x2" ; then
AC_DEFINE(DEBUG)
fi
-dnl For FreeBSD
+# for FreeBSD
LIBS="$LIBS $INTLLIBS"
CFLAGS="$CFLAGS $CPPFLAGS"
+# ------------------------------------------------------------------------------
+# output Makefiles
+# ------------------------------------------------------------------------------
+
AC_OUTPUT([Makefile
doc/Makefile
src/Makefile
src/common/Makefile
src/irc/Makefile
src/plugins/Makefile
- src/plugins/perl/Makefile
- src/plugins/python/Makefile
- src/plugins/ruby/Makefile
+ src/plugins/scripts/Makefile
+ src/plugins/scripts/perl/Makefile
+ src/plugins/scripts/python/Makefile
src/gui/Makefile
src/gui/curses/Makefile
src/gui/wxwidgets/Makefile
@@ -293,8 +351,9 @@ AC_OUTPUT([Makefile
intl/Makefile
po/Makefile.in])
-echo
-echo $PACKAGE $VERSION
+# ------------------------------------------------------------------------------
+# end message
+# ------------------------------------------------------------------------------
listgui=
if test "x$enable_ncurses" = "xyes" ; then
@@ -325,19 +384,17 @@ if test "x$debug" = "x2" ; then
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 Build with GNUtls support..... : $enable_gnutls
-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
+echo ""
+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"
+echo "Compile with debug info....... : $msg_debug_compiler"
+echo "Print debugging messages...... : $msg_debug_verbose"
+echo ""
+eval echo "WeeChat will be installed in $bindir."
+echo ""
+echo "configure complete, now type 'make' to build WeeChat $VERSION"
+echo ""