File: configure.ac

package info (click to toggle)
bzrtp 1.0.6-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 896 kB
  • sloc: ansic: 8,331; makefile: 48; sh: 33
file content (84 lines) | stat: -rw-r--r-- 2,536 bytes parent folder | download | duplicates (5)
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
#   -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.



AC_INIT([bzrtp],[1.0.5])
AC_PREREQ(2.63)
AC_CONFIG_SRCDIR([src/bzrtp.c])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([tar-ustar --warnings=no-portability foreign])
AC_PROG_CC(["xcrun clang" gcc])
LT_INIT(win32-dll shared disable-static)
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

AC_ARG_ENABLE(strict,
[  --enable-strict       Enable error on compilation warning [default=yes]],
[wall_werror=$enableval],
[wall_werror=yes]
)

# configure option to disable the tests
PKG_CHECK_MODULES(BCTOOLBOXTESTER, bctoolbox-tester, [found_pkg_config_bctoolboxtester=yes],[found_pkg_config_bctoolboxtester=no])
if test "$found_pkg_config_bctoolboxtester" = "no" ; then
	AC_MSG_WARN([Could not find bctoolbox-tester wrapper, tests are not compiled.])
fi

dnl check bctoolbox
PKG_CHECK_MODULES(BCTOOLBOX, [bctoolbox] ,[bctoolbox_found=yes] ,foo=bar)
if test "$bctoolbox_found" != "yes" ; then
	AC_MSG_ERROR([bctoolbox not found, aborting. ])
fi


dnl check for sqlite
PKG_CHECK_MODULES(SQLITE3,[sqlite3 >= 3.6.0],[found_sqlite=yes],[found_sqlite=no])
if test "$found_sqlite" != "yes" ; then
        AC_MSG_WARN([sqlite3 not found. Disabling cache.])
else
        AC_DEFINE(ZIDCACHE_ENABLED,1,[defined when libxml2 is available])
fi

dnl check libxml2
PKG_CHECK_MODULES(LIBXML2, [libxml-2.0] ,[libxml2_found=yes] ,foo=bar)
if test "$libxml2_found$found_sqlite" != "yesyes" ; then
	AC_MSG_WARN([libxml2 not found. Disabling cache.])
else
	AC_DEFINE(HAVE_LIBXML2,1,[defined when libxml2 is available])
fi

AC_ARG_ENABLE(tests,
        [AS_HELP_STRING([--disable-tests], [Disable compilation of tests])],
        [case "${enableval}" in
                yes)    tests_enabled=true ;;
                no)     tests_enabled=false ;;
                *)      AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;;
        esac],
        [tests_enabled=yes]
)
AM_CONDITIONAL(ENABLE_TESTS, test x$tests_enabled = xyes && test x$found_pkg_config_bctoolboxtester = xyes)

CFLAGS="$CFLAGS -Wall"

case $CC in
        *clang*)
                CFLAGS="$CFLAGS -Qunused-arguments"
        ;;
esac

if test $GCC = yes && test $wall_werror = yes;  then
	CFLAGS="$CFLAGS -Werror -Wextra -Wno-unused-parameter -Wno-missing-field-initializers "
fi

# Create the following files from their .in counterparts
AC_CONFIG_FILES([
  Makefile
  src/Makefile
  include/Makefile
  include/bzrtp/Makefile
  test/Makefile
  libbzrtp.pc
])

AC_OUTPUT