-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
76 lines (58 loc) · 1.99 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
AC_PREREQ([2.68])
AC_INIT([fmf], [1.0.2], [[email protected]])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
m4_include([m4/ax_cxx_compile_stdcxx_11.m4])
AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_HEADERS([config.h])
AC_DEFINE_UNQUOTED([LICENSE_YEAR], m4_esyscmd([echo -n \"`date +"%Y"`\"]), [License copyright year])
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_INSTALL
# Check for languages
AC_LANG([C++])
AX_CXX_COMPILE_STDCXX_11([noext], [mandatory])
AX_PTHREAD(,AC_MSG_ERROR([pthread required]))
# Config for dependencies
PKG_CHECK_MODULES([DEPS], [taglib >= 1.7.0])
# Get uchardet library and include locations
AC_ARG_WITH([uchardet-include-path],
[AS_HELP_STRING([--with-uchardet-include-path],
[location of the uchardet headers, defaults to /usr/include/uchardet])],
[UCHARDET_CFLAGS="-I$withval"],
[UCHARDET_CFLAGS='-I/usr/include/uchardet'])
AC_SUBST([UCHARDET_CFLAGS])
AC_ARG_WITH([uchardet-lib-path],
[AS_HELP_STRING([--with-uchardet-lib-path], [location of the uchardet libraries])],
[UCHARDET_LIBS="-L$withval -luchardet"],
[UCHARDET_LIBS='-luchardet'])
AC_SUBST([UCHARDET_LIBS])
# Checks for header files.
AC_CHECK_HEADERS([limits.h stddef.h stdlib.h string.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_INLINE
AC_TYPE_SIZE_T
AC_TYPE_UINT32_T
# Checks for library functions.
AC_FUNC_ERROR_AT_LINE
AC_CHECK_FUNCS([mkdir realpath strcasecmp strchr strerror])
# Configure options: --enable-debug[=no].
AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug],
[enable debug code (default is no)])],
[debug="$enableval"], [debug=no])
CC="${PTHREAD_CC}"
if test "x${debug}" = xyes; then
CXXFLAGS="${CXXFLAGS} -O0 -g3 -gdwarf-3"
fi
CXXFLAGS+=" -Wall -Wextra"
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
echo "
($PACKAGE_NAME) version $PACKAGE_VERSION
Prefix.........: $prefix
Debug Build....: $debug
C++ Compiler...: $CXX $CXXFLAGS $CPPFLAGS $PTHREAD_CFLAGS
Linker.........: $LD $LDFLAGS $LIBS $PTHREAD_LIBS $PTHREAD_CFLAGS
"