-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathconfigure.ac
106 lines (83 loc) · 2.12 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.61])
AC_INIT([BlipKit], [0.17.7], [[email protected]], [blipkit], [https://blipkit.audio])
AC_CONFIG_SRCDIR([src/BKBase.c])
AC_CONFIG_HEADER([config.h])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
m4_include([m4/common.m4])
# Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_RANLIB
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
AM_CFLAGS="$CFLAGS"
# Define flags.
AM_CFLAGS="$AM_CFLAGS -Wall \
-Wmissing-prototypes \
-Wmissing-declarations \
-Wstrict-prototypes \
-Wformat-security \
-Winline \
-Wno-shift-negative-value \
-D_FORTIFY_SOURCE=1"
# Use C11 standard.
CHECK_COMPILE_FLAG([-std=c11], [AM_CFLAGS])
# Checks for header files.
AC_CHECK_HEADERS([alloca.h fcntl.h malloc.h math.h stdarg.h stddef.h stdint.h stdlib.h string.h unistd.h])
AC_ARG_WITH([sdl],
AS_HELP_STRING([--without-sdl], [do not link agains SDL library]))
AC_ARG_WITH([wav],
AS_HELP_STRING([--without-wav], [do not include WAV functions]))
# Set default of with_sdl to yes.
AS_IF([test "x$with_sdl" = "x"],
[with_sdl=yes],
[])
# Set default of with_wave to yes.
AS_IF([test "x$with_wav" = "x"],
[with_wav=yes],
[])
# Enable WAV reader.
if test "x$with_wav" = xyes; then
BK_ENABLE_WAV=1
AC_SUBST(BK_ENABLE_WAV)
fi
AM_CONDITIONAL([ENABLE_WAV], [test x$with_wav = xyes])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_UINT8_T
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_SIZE_T
# Check sizes.
AC_CHECK_SIZEOF(size_t)
if test "x${ac_cv_sizeof_size_t}" = x8; then
AC_TYPE_INT64_T
AC_TYPE_UINT64_T
fi
if test "x$with_sdl" = xyes; then
AC_CHECK_HEADERS(termios.h)
fi
# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_CHECK_FUNCS([memmove memset pow strdup])
AC_CONFIG_FILES([
Makefile
src/Makefile
examples/Makefile
test/Makefile
dev/step_phases/Makefile
dev/tone_periods/Makefile
])
# Run tests.
CHECK_SIGNED_SHIFT()
# Check for SDL.
if test "x$with_sdl" = xyes; then
CHECK_SDL()
fi
AC_SUBST([AM_CFLAGS])
AC_OUTPUT