Add -lm dependency for gettextlib to fix LTO build
[platform/upstream/gettext.git] / gettext-runtime / libasprintf / configure.ac
1 dnl Configuration for the GNU libasprintf library
2 dnl Copyright (C) 2002-2011, 2015 Free Software Foundation, Inc.
3 dnl
4 dnl This program is free software: you can redistribute it and/or modify
5 dnl it under the terms of the GNU General Public License as published by
6 dnl the Free Software Foundation; either version 3 of the License, or
7 dnl (at your option) any later version.
8 dnl
9 dnl This program is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 dnl GNU General Public License for more details.
13 dnl
14 dnl You should have received a copy of the GNU General Public License
15 dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
17 dnl Process this file with autoconf to produce a configure script.
18
19 AC_PREREQ([2.59])
20 AC_INIT([libasprintf], [1.0])
21 AC_CONFIG_SRCDIR([vasprintf.c])
22 AC_CONFIG_AUX_DIR([../../build-aux])
23 AM_INIT_AUTOMAKE([silent-rules])
24 AC_CONFIG_HEADERS([config.h])
25
26 dnl Checks for programs.
27 AC_PROG_CC
28 AC_PROG_CXX
29 AC_PROG_INSTALL
30
31 dnl Check for host type.
32 AC_CANONICAL_HOST
33
34 dnl Checks for compiler output filename suffixes.
35 AC_OBJEXT
36 AC_EXEEXT
37
38 dnl Early checks, assembled by gnulib.
39 gl_EARLY
40
41 dnl Check for build configuration.
42 gl_WOE32_DLL
43 LT_INIT([win32-dll])
44 case "$host_os" in
45   # On Cygwin, without -no-undefined, a warning is emitted and only a static
46   # library is built.
47   beos* | mingw* | cygwin*) LTNOUNDEF='-no-undefined' ;;
48   *) LTNOUNDEF='' ;;
49 esac
50 AC_SUBST([LTNOUNDEF])
51
52 dnl Checks for libraries.
53
54 dnl Checks for header files.
55 AC_CHECK_HEADERS([features.h])
56
57 dnl Checks for typedefs, structures, and compiler characteristics.
58 AC_C_INLINE
59 AC_TYPE_SIZE_T
60 AC_TYPE_LONG_LONG_INT
61 gt_TYPE_WCHAR_T
62 gt_TYPE_WINT_T
63 AC_TYPE_MBSTATE_T
64 AC_CHECK_TYPE([ptrdiff_t], ,
65   [AC_DEFINE([ptrdiff_t], [long],
66      [Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
67   ])
68 gl_AC_TYPE_INTMAX_T
69 gl_XSIZE
70
71 dnl Checks for library functions.
72
73 gl_INIT
74 AC_CHECK_FUNCS([snprintf vasprintf strnlen wcslen wcsnlen mbrtowc wcrtomb])
75 dnl Use the _snprintf function only if it is declared (because on NetBSD it
76 dnl is defined as a weak alias of snprintf; we prefer to use the latter).
77 AC_CHECK_DECLS([_snprintf], , , [#include <stdio.h>])
78 gt_PRINTF_POSIX
79
80 dnl Check for tools needed for formatting the documentation.
81 ac_aux_dir_abs=`cd $ac_aux_dir && pwd`
82 AC_PATH_PROG([DVIPS], [dvips], [$ac_aux_dir_abs/missing dvips])
83 AC_PATH_PROG([TEXI2PDF], [texi2pdf], [$ac_aux_dir_abs/missing texi2pdf])
84 AC_PATH_PROG([PERL], [perl], [$ac_aux_dir_abs/missing perl])
85
86 AC_CONFIG_FILES([Makefile])
87
88 AC_OUTPUT