summaryrefslogtreecommitdiffstats
path: root/configure.in
blob: 972bec818ba687d89b7d8d7e787c0c251adc4db3 (plain)
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
81
82
83
84
85
86
87
88
89
90
dnl Process this file with autoconf 2.61 or later to produce
dnl a configure script.
AC_PREREQ(2.61)
AC_INIT(config.h.in)
AC_CONFIG_HEADERS(config.h)

AC_PREFIX_PROGRAM(abc80)

dnl Checks for programs.
dnl Consider AC_USE_SYSTEM_EXTENSIONS if autoconf 2.61 is OK in the future
AC_USE_SYSTEM_EXTENSIONS
AC_PROG_CC
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_INSTALL

dnl If we have gcc, add appropriate options
PA_ADD_CFLAGS([-W])
PA_ADD_CFLAGS([-Wall])
PA_ADD_CFLAGS([-std=c99])
PA_ADD_CFLAGS([-pedantic])

dnl Look for programs...
AC_CHECK_PROGS(NROFF,    nroff,    false)
AC_CHECK_PROGS(ASCIIDOC, asciidoc, false)
AC_CHECK_PROGS(XMLTO,    xmlto,    false)
AC_CHECK_PROGS(ACRODIST, acrodist, false)
AC_CHECK_PROGS(PS2PDF,   ps2pdf,   false)
AC_CHECK_PROGS(PSTOPDF,  pstopdf,  false)

dnl Check for progs needed for manpage generation
if test $ASCIIDOC = false; then
  AC_MSG_WARN([No acsciidoc package found])
fi
if test $XMLTO = false; then
  AC_MSG_WARN([No xmlto package found])
fi

dnl Checks for header files.
AC_HEADER_STDC
if test $ac_cv_header_stdc = no; then
  AC_MSG_ERROR([abc80sim requires ANSI C header files to compile])
fi

AC_CHECK_HEADERS(limits.h)
if test $ac_cv_header_limits_h = no; then
  AC_MSG_ERROR([abc80sim requires '<limits.h>' to compile])
fi

dnl Check for <inttypes.h> or add a substitute version
AC_CHECK_HEADERS(inttypes.h, , CFLAGS="$CFLAGS -I\$(top_srcdir)/inttypes")

dnl The standard header for str*casecmp is <strings.h>
AC_CHECK_HEADERS(strings.h)

dnl Look for <stdbool.h>
AC_CHECK_HEADERS(stdbool.h)

AC_CHECK_HEADERS(SDL.h)
AC_CHECK_HEADERS(SDL/SDL.h)

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_C_RESTRICT
AC_TYPE_SIZE_T
PA_WORKING_BOOL
AC_C_BIGENDIAN(AC_DEFINE(WORDS_BIGENDIAN),AC_DEFINE(WORDS_LITTLEENDIAN))
AH_TEMPLATE(WORDS_BIGENDIAN,
[Define to 1 if your processor stores words with the most significant
byte first (like Motorola and SPARC, unlike Intel and VAX).])
AH_TEMPLATE(WORDS_LITTLEENDIAN,
[Define to 1 if your processor stores words with the least significant
byte first (like Intel and VAX, unlike Motorola and SPARC).])

dnl Checks for library functions.
AC_SEARCH_LIBS([pthread_create], [pthread])
AC_SEARCH_LIBS([SDL_Init], [SDL])
AC_SUBST(XOBJS)

dnl
dnl support cchace
dnl
AC_ARG_WITH([ccache],
            [AC_HELP_STRING([--with-ccache],
                            [Compile with ccache])],
          [CC="ccache $CC"],
          [])

AC_OUTPUT(Makefile)