1#                                               -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4AC_PREREQ([2.69])
5AC_INIT([seq2gif], [0.10.4], [user@zuse.jp])
6AC_CONFIG_SRCDIR([color.h])
7AC_CONFIG_HEADERS([config.h])
8AM_INIT_AUTOMAKE([foreign])
9
10AC_ARG_WITH(fontdata,
11            AC_HELP_STRING([--with-fontdata],
12                           [Specified font data (unifont, milkjf or mplus(default: unifont)]),
13                           [fontdata=${withval}],
14                           [fontdata=mplus])
15AC_MSG_NOTICE([font data ${fontdata} is selected])
16
17AC_DEFINE(FONT_MPLUS, 1, [M+ Bitmap font])
18AC_DEFINE(FONT_MILKJF, 2, [milkjf font])
19AC_DEFINE(FONT_UNIFONT, 3, [GNU Unifont])
20
21if test x$fontdata == xunifont; then
22    AC_DEFINE(SELECTED_FONT, FONT_MPLUS, [GNU Unifont is selected.])
23else
24    if test x$fontdata == xmplus; then
25        AC_DEFINE(SELECTED_FONT, FONT_MPLUS, [M+ font is selected.])
26    else
27        AC_DEFINE(SELECTED_FONT, FONT_MILKJF, [milkjf font is selected.])
28    fi
29fi
30
31AC_ARG_ENABLE([gcov],
32              [AS_HELP_STRING([--enable-gcov],
33                              [Use gcov])],
34              [],
35              [enable_gcov=no])
36AM_CONDITIONAL([COND_GCOV], [test x$enable_gcov != xno])
37
38# Checks for programs.
39AC_PROG_CC
40
41# Checks for libraries.
42
43# Checks for header files.
44AC_CHECK_HEADER([stdio.h], [],
45                [AC_MSG_ERROR(stdio.h not found.)])
46AC_CHECK_HEADER([stdint.h], [],
47                [AC_MSG_ERROR(stdint.h not found.)])
48AC_CHECK_HEADER([stdbool.h], [],
49                [AC_MSG_ERROR(stdbool.h not found.)])
50AC_CHECK_HEADER([math.h], [],
51                [AC_MSG_ERROR(math.h not found.)])
52AC_CHECK_HEADERS([errno.h \
53                  sys/types.h \
54                  ctype.h \
55                  fcntl.h \
56                  limits.h \
57                  stdlib.h \
58                  string.h \
59                  wchar.h \
60                  unistd.h \
61                  getopt.h])
62
63# Checks for typedefs, structures, and compiler characteristics.
64AC_CHECK_HEADER_STDBOOL
65AC_C_INLINE
66AC_TYPE_INT32_T
67AC_TYPE_OFF_T
68AC_TYPE_PID_T
69AC_TYPE_SIZE_T
70AC_TYPE_SSIZE_T
71AC_TYPE_UINT16_T
72AC_TYPE_UINT32_T
73AC_TYPE_UINT8_T
74
75# Checks for library functions.
76AC_FUNC_ERROR_AT_LINE
77AC_FUNC_MALLOC
78AC_FUNC_REALLOC
79
80AC_CHECK_FUNC([memset], [],
81              [AC_MSG_ERROR(memset is not available.)])
82
83AC_CHECK_FUNC([getopt_long],
84              [AC_DEFINE(HAVE_GETOPT_LONG, 1, [whether getopt_long is avilable])],
85              [AC_CHECK_FUNC([getopt],
86                             [AC_DEFINE(HAVE_GETOPT, 1, [whether getopt is avilable])],
87                             [AC_MSG_ERROR(getopt or getopt_long is not available.)])])
88
89AC_CHECK_FUNCS([setmode _setmode memcpy memmove strchr strstr strtol calloc])
90
91AC_DEFUN([LS_UPDATE_TIMESTAMP], [
92          touch aclocal.m4 Makefile.in configure config.h.in
93          ])
94LS_UPDATE_TIMESTAMP
95
96AC_CONFIG_FILES([Makefile package.json])
97AC_OUTPUT
98