summaryrefslogtreecommitdiff
path: root/configure.in
blob: 3be80ed18e29d2d132b37448d27ed59a9588ef78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
dnl Process this file with autoconf to produce a configure script.

AC_INIT(help2man.PL)
AC_PROG_PERL(5.008)
test -z "$PERL" && AC_MSG_ERROR([perl 5.8 required])

AC_PERL_MODULE(Locale::gettext)
AC_PATH_PROG(MSGFMT, msgfmt)

AC_PROG_CC
AC_SEARCH_LIBS(dlsym, dl)

AC_MSG_CHECKING([for pre-loadable libintl])
preload=`LD_PRELOAD="preloadable_libintl.so" sh -c 'echo yes' 2>/dev/null`
AC_MSG_RESULT(${preload:=no})

nls_default=yes
test "$ac_cv_module_Locale__gettext" = no && nls_default=no
test -z "$MSGFMT" && nls_default=no
test "$preload" = no && nls_default=no

AC_ARG_ENABLE([nls], AC_HELP_STRING([--enable-nls],
	[enable support for generating localised pages]),
	[ac_cv_enable_nls=$enableval], [ac_cv_enable_nls=$nls_default])

AC_SUBST(extra_make_all, '')
AC_SUBST(extra_make_install, '')
AC_SUBST(extra_extract_args, '')
if test "$ac_cv_enable_nls" = yes
then
    # note: the following tests should match what is used to set nls_default above
    test "$ac_cv_module_Locale__gettext" = no &&
	AC_MSG_ERROR([perl module Locale::gettext required])

    test -z "$MSGFMT" && AC_MSG_ERROR([gettext required])

    test "$preload" = no &&
	AC_MSG_ERROR([libpreloadable_libintl.so required (gettext 0.12+)])

    extra_make_all='preload man_l10n'
    extra_make_install='install_preload install_l10n'
    extra_extract_args='--with-gettext'
fi

AC_PROG_INSTALL
AC_PATH_PROG(MAKEINFO, makeinfo, :)
AC_PATH_PROG(INSTALL_INFO, install-info, :)
AC_OUTPUT(Makefile)