summaryrefslogtreecommitdiff
path: root/configure.ac
blob: 4368d9cb1fc04502bb7eb2fd78281cb3e39e751d (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
m4_define([exttextcat_version_major],[3])
m4_define([exttextcat_version_minor],[2])
m4_define([exttextcat_version_micro],[0])
m4_define([exttextcat_version],[exttextcat_version_major.exttextcat_version_minor.exttextcat_version_micro])

AC_PREREQ([2.65])

AC_INIT([libexttextcat], [exttextcat_version])
AC_CONFIG_MACRO_DIR([m4])
AC_LANG([C])

AM_INIT_AUTOMAKE([1.11 foreign dist-xz dist-bzip2])
AM_MAINTAINER_MODE
AM_CONFIG_HEADER([src/config.h])
AM_SILENT_RULES([yes])

dnl Checks for programs.
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_LIBTOOL

dnl Checks for headers
AC_HEADER_STDC
AC_CHECK_HEADERS([inttypes.h, stdint.h])

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_STRUCT_TM

dnl Checks for functions
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([gettimeofday strdup strpbrk])

# ================
# Check for cflags
# ================
AC_ARG_ENABLE([werror],
	[AS_HELP_STRING([--disable-werror], [Treat all warnings as errors, useful for development])],
	[enable_werror="$enableval"],
	[enable_werror=yes]
)
AS_IF([test x"$enable_werror" != "xno"], [
	CFLAGS="$CFLAGS -Werror"
	CXXFLAGS="$CXXFLAGS -Werror"
])
AS_IF([test x"$GCC" = xyes], [
	# Be tough with warnings and produce less careless code
	CFLAGS="$CFLAGS -Wall -pedantic"
	CXXFLAGS="$CXXFLAGS -Wall -pedantic"
])

AC_SUBST([EXTTEXTCAT_MAJOR_VERSION],[exttextcat_version_major])
AC_SUBST([EXTTEXTCAT_MINOR_VERSION],[exttextcat_version_minor])
AC_SUBST([EXTTEXTCAT_MICRO_VERSION],[exttextcat_version_micro])
AC_SUBST([EXTTEXTCAT_VERSION],[exttextcat_version])

AC_CONFIG_FILES([
libexttextcat.pc
Makefile
langclass/Makefile
langclass/LM/Makefile
langclass/ShortTexts/Makefile
src/Makefile
src/exttextcat-version.h
src/test-primary.sh
src/test-secondary.sh
])
AC_OUTPUT

# ==============================================
# Display final informations about configuration
# ==============================================
AC_MSG_NOTICE([
==============================================================================
Build configuration:
	werror:          ${enable_werror}
==============================================================================
])