2 # This file is part of the aMule Project.
4 # Copyright (c) 2003-2008 aMule Team ( admin@amule.org / http://www.amule.org )
6 # Any parts of this program derived from the xMule, lMule or eMule project,
7 # or contributed by third-party developers are copyrighted by their
10 # This program is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; either version 2 of the License, or
13 # (at your option) any later version.
15 # This program is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License for more details.
20 # You should have received a copy of the GNU General Public License
21 # along with this program; if not, write to the Free Software
22 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
25 dnl ----------------------------------------------------
26 dnl MULE_CHECK_AUTOPOINT([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
27 dnl check if autopoint is installed
28 dnl ----------------------------------------------------
29 AC_DEFUN([MULE_CHECK_AUTOPOINT],
31 AC_MSG_CHECKING([for autopoint])
32 autopoint_version=`autopoint --version | head -n 1 | sed -e 's/.*[[^0-9.]]\([[0-9]]\{1,\}\(\.[[0-9]]\{1,\}\)\{1,2\}\)[[^0-9.]]*/\1/'`
33 AS_IF([test -n "$autopoint_version"], [
34 AC_MSG_RESULT([yes ($autopoint_version)])
43 dnl ---------------------------------------------------------------------------
44 dnl GENERATE_MANS_TO_INSTALL(TESTNAME, BASENAMEPATH)
46 dnl This function will generate the list of manpages to be installed.
48 dnl TESTNAME is the name of a FEATURE selected by MULE_ARG_ENABLE() if this
49 dnl set of manpages need installing. The list of files will be returned in
50 dnl the TESTNAME_MANPAGES variable.
52 dnl BASENAMEPATH is the path and basename of the manpages we test for, relative
53 dnl to the package root (top_srcdir)
54 dnl ---------------------------------------------------------------------------
55 AC_DEFUN([GENERATE_MANS_TO_INSTALL],
56 [m4_define([MANPAGES], [m4_translit([$1], [a-z-], [A-Z_])[]_MANPAGES])dnl
58 MULE_IF_ENABLED([$1], [
59 AS_IF([test -z "$LINGUAS"],
60 [MANPAGES=`ls -1 ${srcdir}/$2.* | sed -e 's:.*/::g'`],
62 MANPAGES=`ls -1 ${srcdir}/$2.* | sed -e 's:.*/::g' | grep $Generate_Langs`
63 MANPAGES="`basename $2.1` $[]MANPAGES"
65 MANPAGES=`echo $[]MANPAGES | tr -d '\n'`
69 m4_undefine([MANPAGES])dnl
73 dnl ---------------------------------------------------------------------------
76 dnl Checks and tests everything needed for Native Language Support
77 dnl ---------------------------------------------------------------------------
78 AC_DEFUN([MULE_CHECK_NLS],
80 AC_ARG_WITH([language],
81 [AS_HELP_STRING([--with-language=<langs>],
82 [Specify a comma-separated list of languages you want to have installed. See po/LINGUAS for available languages])],
83 [AS_IF([test "$withval" != "all"], [LINGUAS="`echo $withval | sed -e 's/,/ /g'`"])])
85 AM_GNU_GETTEXT([no-libtool], [need-ngettext])
86 AS_IF([test $USE_INCLUDED_LIBINTL = yes], [INCINTL=-I\${top_builddir}/intl])
88 AS_IF([test x$USE_NLS = xyes], [MULE_CHECK_AUTOPOINT(, [USE_NLS=no])])
89 AS_IF([test x$USE_NLS = xno -a x${enable_nls:-yes} = xyes], [MULE_WARNING([You need to install GNU gettext/gettext-tools to compile aMule with i18n support.])])
91 AS_IF([test ${USE_NLS:-no} = yes], [
92 AC_MSG_CHECKING([for requested languages])
93 Generate_Langs=`echo $LINGUAS | $AWK ['OFS="\\\\|" { for (i = 1; i <= NF; ++i) $i = "\\\\." $i; print }']`
94 GENERATE_MANS_TO_INSTALL([amule-daemon], [docs/man/amuled])
95 GENERATE_MANS_TO_INSTALL([amulecmd], [docs/man/amulecmd])
96 GENERATE_MANS_TO_INSTALL([webserver], [docs/man/amuleweb])
97 GENERATE_MANS_TO_INSTALL([amule-gui], [docs/man/amulegui])
98 GENERATE_MANS_TO_INSTALL([cas], [src/utils/cas/docs/cas])
99 GENERATE_MANS_TO_INSTALL([wxcas], [src/utils/wxCas/docs/wxcas])
100 GENERATE_MANS_TO_INSTALL([ed2k], [docs/man/ed2k])
101 GENERATE_MANS_TO_INSTALL([alc], [src/utils/aLinkCreator/docs/alc])
102 GENERATE_MANS_TO_INSTALL([alcc], [src/utils/aLinkCreator/docs/alcc])
103 GENERATE_MANS_TO_INSTALL([monolithic], [docs/man/amule])
104 AC_MSG_RESULT([${LINGUAS:-all}])
107 AC_SUBST([INCINTL])dnl