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 variable that'll evaluate to yes 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],
57 AS_IF([test "$[]$1" == "yes"], [
58 AS_IF([test -z "$LINGUAS"],
59 [$1_MANPAGES=`ls -1 ${srcdir}/$2.* | sed -e 's:.*/::g'`],
61 $1_MANPAGES=`ls -1 ${srcdir}/$2.* | sed -e 's:.*/::g' | grep $Generate_Langs `
62 $1_MANPAGES="`basename $2.1` $[]$1_MANPAGES"
64 $1_MANPAGES=`echo $[]$1_MANPAGES | tr -d '\n'`
67 AC_SUBST([$1_MANPAGES])dnl
71 dnl ---------------------------------------------------------------------------
74 dnl Checks and tests everything needed for Native Language Support
75 dnl ---------------------------------------------------------------------------
76 AC_DEFUN([MULE_CHECK_NLS],
78 AC_ARG_WITH([language],
79 [AS_HELP_STRING([--with-language=<langs>],
80 [Specify a comma-separated list of languages you want to have installed. See po/LINGUAS for available languages])],
81 [AS_IF([test "$withval" = "all"], [LINGUAS='%UNSET%'], [LINGUAS="`echo $withval | sed -e 's/,/ /g'`"])])
83 AM_GNU_GETTEXT([no-libtool], [need-ngettext])
84 AS_IF([test $USE_INCLUDED_LIBINTL = yes], [INCINTL=-I\${top_builddir}/intl])
86 AS_IF([test x$USE_NLS = xyes], [MULE_CHECK_AUTOPOINT(, [USE_NLS=no])])
87 AS_IF([test x$USE_NLS = xno -a x${enable_nls:-yes} = xyes], [AC_MSG_WARN([You need to install GNU gettext/gettext-tools to compile aMule with i18n support.])])
89 AS_IF([test ${USE_NLS:-no} = yes], [
90 AC_MSG_CHECKING([for requested languages])
91 Generate_Langs=`echo $LINGUAS | $AWK ['OFS="\\\\|" { for (i = 1; i <= NF; ++i) $i = "\\\\." $i; print }']`
92 GENERATE_MANS_TO_INSTALL([AMULE_DAEMON], [docs/man/amuled])
93 GENERATE_MANS_TO_INSTALL([AMULECMD], [docs/man/amulecmd])
94 GENERATE_MANS_TO_INSTALL([WEB], [docs/man/amuleweb])
95 GENERATE_MANS_TO_INSTALL([AMULE_GUI], [docs/man/amulegui])
96 GENERATE_MANS_TO_INSTALL([CAS], [src/utils/cas/docs/cas])
97 GENERATE_MANS_TO_INSTALL([WXCAS], [src/utils/wxCas/docs/wxcas])
98 GENERATE_MANS_TO_INSTALL([ED2K], [docs/man/ed2k])
99 GENERATE_MANS_TO_INSTALL([ALC], [src/utils/aLinkCreator/docs/alc])
100 GENERATE_MANS_TO_INSTALL([ALCC], [src/utils/aLinkCreator/docs/alcc])
101 GENERATE_MANS_TO_INSTALL([MONOLITHIC], [docs/man/amule])
102 AC_MSG_RESULT([${LINGUAS:-all}])
105 AC_SUBST([INCINTL])dnl