-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.ac
78 lines (68 loc) · 2 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
dnl vim: set sw=4 sts=4 ts=4 noet ft=config foldmethod=marker foldmarker={{{,}}} :
dnl {{{ program, version
AC_PREREQ(2.59)
AC_INIT([src/main.c])
VERSION_MAJOR=0
VERSION_MINOR=1
VERSION_MICRO=0
VERSION_FULL="$VERSION_MAJOR.$VERSION_MINOR.$VERSION_MICRO"
VERSION="$VERSION_FULL"
AC_SUBST([VERSION_MAJOR])
AC_SUBST([VERSION_MINOR])
AC_SUBST([VERSION_FULL])
AM_INIT_AUTOMAKE(afprint, [$VERSION_FULL])
dnl {{{ git revision
AC_MSG_CHECKING([for git head])
if test -d "${GIT_DIR:-${ac_top_srcdir:-./}/.git}" ; then
GIT_HEAD=`git describe 2>/dev/null`
if test -z ${GIT_HEAD} ; then
GIT_HEAD=`git rev-parse --short HEAD`
fi
if test -n "`git diff-index -m --name-only HEAD`" ; then
GIT_HEAD=${GIT_HEAD}-dirty
fi
if test -n "${GIT_HEAD}" ; then
GIT_HEAD="-${GIT_HEAD}"
fi
fi
AC_MSG_RESULT([$GIT_HEAD])
AC_SUBST([GIT_HEAD])
dnl }}}
dnl }}}
dnl {{{ toolchain checks
AC_PROG_CC
AC_PROG_CC_C99
if test x"$ac_cv_prog_cc_c99" = x"no"; then
AC_MSG_ERROR([afprint requires a C compiler that supports ISO C99!])
fi
AC_GNU_SOURCE
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_SED
dnl }}}
dnl {{{ check for functions
AC_CHECK_FUNCS([splice])
dnl }}}
dnl {{{ check for libraries
PKG_PROG_PKG_CONFIG([0.20.0])
PKG_CHECK_MODULES([libofa], [libofa],,
[AC_MSG_ERROR([afprint requires libofa])])
PKG_CHECK_MODULES([libsndfile], [sndfile],,
[AC_MSG_ERROR([afprint requires libsndfile])])
dnl }}}
dnl {{{ extra cflags
AFPRINT_CFLAGS=
WANTED_CFLAGS="-pedantic -Wall -W -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Wfloat-equal -Wformat=2 -Wformat-security -Wformat-nonliteral -Winit-self -Winline -Wlogical-op -Wmissing-prototypes -Wmissing-declarations -Wmissing-format-attribute -Wmissing-noreturn -Wpointer-arith -Wredundant-decls -Wshadow -Wswitch-default -Wunused -Wvla"
for flag in $WANTED_CFLAGS ; do
AX_CHECK_COMPILER_FLAGS([$flag], [AFPRINT_CFLAGS="$AFPRINT_CFLAGS $flag"],)
done
AC_SUBST([AFPRINT_CFLAGS])
dnl }}}
dnl {{{ output
AM_CONFIG_HEADER(config.h)
AC_OUTPUT(
Makefile
src/Makefile
scripts/Makefile
)
dnl }}}