-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
80 lines (69 loc) · 2.43 KB
/
configure.ac
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
dnl -*- Autoconf -*-
dnl Process this file with autoconf to produce a configure script.
dnl
dnl This file is free software; as a special exception the author gives
dnl unlimited permission to copy and/or distribute it, with or without
dnl modifications, as long as this notice is preserved.
dnl
dnl This program is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
dnl implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
AC_PREREQ(2.61)
AC_INIT([GNU teseq], [1.2-devel], [bug-teseq@gnu.org])
AM_INIT_AUTOMAKE([-Wall -Werror dist-bzip2 dist-xz gnu])
AC_CONFIG_SRCDIR([src/teseq.c])
AC_CONFIG_HEADER([src/config.h])
# Checks for programs.
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_INSTALL
AM_MISSING_PROG([HELP2MAN], [help2man])
AM_MISSING_PROG([CHECKMK], [checkmk])
# Checks for libraries.
PKG_CHECK_MODULES([libcheck], [check], , : )
AM_CONDITIONAL([DO_CHECK_TESTS], [test -n "${libcheck_LIBS:-}"])
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([stddef.h stdlib.h string.h strings.h getopt.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_SETVBUF_REVERSED
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([strchr])
# Check that vsnprintf take (NULL, 0 ... )
AC_CACHE_CHECK([for working vsnprintf],
[teseq_cv_vsnprintf_works], [dnl
AC_RUN_IFELSE([AC_LANG_PROGRAM([[
#include <stdio.h>
#include <stdarg.h>
int
count_printf (const char *format, ...)
{
int count;
va_list ap;
va_start (ap, format);
count = vsnprintf (NULL, 0, format, ap);
va_end (ap);
return count;
}
]],[[count_printf ("%s", "supercalifragilisticexpialidocious");]])]
, [teseq_cv_vsnprintf_works=yes], [teseq_cv_vsnprintf_works=no] )]
)
AS_IF([test AS_VAR_GET([teseq_cv_vsnprintf_works]) = yes],,
AC_MSG_FAILURE([
You do not have a reasonable implmentation of vsnprintf.
Teseq would either fail to build or segfault.
]))
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([reseq],[chmod +x reseq])
AC_CONFIG_FILES([run-tests:tests/run.in],[chmod +x run-tests])
AC_CONFIG_COMMANDS([src/test-inputbuf.inf],
[test "$srcdir" = . || \
cp "$srcdir/src/test-inputbuf.inf" \
src/test-inputbuf.inf])
AC_CONFIG_COMMANDS([doc],
[mkdir -p doc])
AC_OUTPUT