summaryrefslogtreecommitdiff
path: root/configure.ac
blob: 5a49e23d1c1e058d1bc078f7f8443c1b9e87392e (plain) (blame)
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
############################
# Specify program versions #
############################

AC_PREREQ([2.70])
LT_PREREQ([2.4.2])



##################################
# Initialize Autoconf & Automake #
##################################

AC_INIT([foobar],
  m4_normalize(m4_include([VERSION])),
  [mailto:user@foobar.org],
  [foobar],
  [https://foobar.org])

AC_CANONICAL_BUILD
AC_CANONICAL_HOST

AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_SRCDIR([src/main.c])
AC_CONFIG_FILES([
  Makefile
  include/Makefile
  tests/Makefile
])

AM_INIT_AUTOMAKE([1.16 subdir-objects])

AC_SUBST([PACKAGE_DESCR], ['Foo Bar'])
AC_SUBST([PACKAGE_VERSION_SO], m4_normalize(m4_include([VERSION_SO])))



#################
# Customization #
#################

AC_LANG([C])

AC_PROG_CC

AC_CHECK_HEADER_STDBOOL
AS_IF([test "$ac_cv_header_stdbool_h" != yes], AC_MSG_ERROR([standard headers]))

AC_ARG_ENABLE([werror], AS_HELP_STRING([--disable-werror], [disable -Werror]))
AS_IF([test "$enable_werror" != no], [enable_werror=yes], [enable_werror=no])
AM_CONDITIONAL([ENABLE_WERROR], [test "$enable_werror" = yes])

AC_ARG_ENABLE([checks], AS_HELP_STRING([--enable-checks], [enable checks]))
AS_IF([test "$enable_checks" != yes], [enable_werror=no], [enable_werror=yes])
AM_CONDITIONAL([ENABLE_CHECKS], [test "$enable_checks" = yes])



##########
# Finish #
##########

LT_INIT
AC_OUTPUT