Imported Upstream version 1.41.1
[platform/upstream/help2man.git] / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2
3 # Copyright (C) 2012 Free Software Foundation, Inc.
4
5 # Copying and distribution of this file, with or without modification,
6 # are permitted in any medium without royalty provided the copyright
7 # notice and this notice are preserved.  This file is offered as-is,
8 # without any warranty.
9
10 dnl Written by Brendan O'Dea <bod@debian.org>
11
12 AC_INIT([GNU help2man], m4_esyscmd_s([./help2man.PL --version]),
13         [bug-help2man@gnu.org])
14
15 AC_CONFIG_SRCDIR([help2man.PL])
16
17 AC_PROG_PERL(5.008)
18 test -z "$PERL" && AC_MSG_ERROR([perl 5.8 required])
19
20 AC_PERL_MODULE(Locale::gettext)
21 AC_PATH_PROG(MSGFMT, msgfmt)
22
23 AC_PROG_CC
24 AC_SEARCH_LIBS(dlsym, dl)
25 AC_SEARCH_LIBS(bindtextdomain, intl)
26
27 nls_default=yes
28 test "x$ac_cv_module_Locale__gettext" = xno && nls_default=no
29 test -z "$MSGFMT" && nls_default=no
30 test "x$ac_cv_search_dlsym" = xno && nls_default=no
31 test "x$ac_cv_search_bindtextdomain" = xno && nls_default=no
32
33 AC_ARG_ENABLE([nls], AC_HELP_STRING([--enable-nls],
34         [enable support for generating localised pages]),
35         [ac_cv_enable_nls=$enableval], [ac_cv_enable_nls=$nls_default])
36
37 AC_SUBST(extra_make_all, '')
38 AC_SUBST(extra_make_install, '')
39 AC_SUBST(extra_extract_args, '')
40 if test "$ac_cv_enable_nls" = yes
41 then
42     # note: the following tests should match what is used to set nls_default above
43     test "x$ac_cv_module_Locale__gettext" = xno &&
44         AC_MSG_ERROR([perl module Locale::gettext required])
45
46     test -z "$MSGFMT" && AC_MSG_ERROR([gettext required])
47
48     test "x$ac_cv_search_dlsym" = xno &&
49         AC_MSG_ERROR([dlsym() required])
50
51     test "x$ac_cv_search_bindtextdomain" = xno &&
52         AC_MSG_ERROR([bindtextdomain() required])
53
54     extra_make_all='preload man_l10n'
55     extra_make_install='install_preload install_l10n'
56     extra_extract_args='--with-gettext'
57 fi
58
59 AC_PROG_INSTALL
60 AC_PATH_PROG(MAKEINFO, makeinfo, :)
61 AC_PATH_PROG(INSTALL_INFO, install-info, :)
62
63 AC_CONFIG_FILES([Makefile])
64 AC_OUTPUT