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