Imported Upstream version 1.47.12
[platform/upstream/help2man.git] / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2
3 # Copyright (C) 2012, 2014 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 AC_CONFIG_AUX_DIR([build-aux])
17 AC_SUBST(auxdir, $ac_aux_dir)
18
19 LOCAL_PROG_PERL(5.008)
20 test -z "$PERL" && AC_MSG_ERROR([perl 5.8 required])
21
22 LOCAL_PERL_MODULE(Locale::gettext)
23 AC_PATH_PROG(MSGFMT, msgfmt)
24
25 AC_PROG_CC
26 AC_SEARCH_LIBS(dlsym, dl)
27 AC_SEARCH_LIBS(bindtextdomain, intl)
28
29 nls_default=yes
30 test "x$ac_cv_module_Locale__gettext" = xno && nls_default=no
31 test -z "$MSGFMT" && nls_default=no
32 test "x$ac_cv_search_dlsym" = xno && nls_default=no
33 test "x$ac_cv_search_bindtextdomain" = xno && nls_default=no
34
35 AC_ARG_ENABLE([nls], AC_HELP_STRING([--enable-nls],
36         [enable support for generating localised pages]),
37         [ac_cv_enable_nls=$enableval], [ac_cv_enable_nls=$nls_default])
38
39 AC_SUBST(extra_make_all, '')
40 AC_SUBST(extra_make_install, '')
41 AC_SUBST(extra_extract_args, '')
42 if test "$ac_cv_enable_nls" = yes
43 then
44     # note: the following tests should match what is used to set nls_default above
45     test "x$ac_cv_module_Locale__gettext" = xno &&
46         AC_MSG_ERROR([perl module Locale::gettext required])
47
48     test -z "$MSGFMT" && AC_MSG_ERROR([gettext required])
49
50     test "x$ac_cv_search_dlsym" = xno &&
51         AC_MSG_ERROR([dlsym() required])
52
53     test "x$ac_cv_search_bindtextdomain" = xno &&
54         AC_MSG_ERROR([bindtextdomain() required])
55
56     extra_make_all='preload man_l10n info_l10n'
57     extra_make_install='install_preload install_l10n'
58     extra_extract_args='--with-gettext'
59 fi
60
61 AC_PROG_INSTALL
62 LOCAL_PROG_OR_MISSING(makeinfo)
63 LOCAL_PROG_OR_MISSING(install-info)
64 LOCAL_PROG_OR_MISSING(msgmerge)
65 LOCAL_PROG_OR_MISSING(xgettext)
66 LOCAL_PROG_OR_MISSING(po4a-updatepo)
67 LOCAL_PROG_OR_MISSING(po4a-translate)
68
69 AC_CONFIG_FILES([Makefile])
70 AC_OUTPUT