-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathconfigure.ac
83 lines (71 loc) · 2.63 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
79
80
81
82
83
# Copyright (C) 2012-2021 Marc Ferland
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
AC_PREREQ([2.69])
AC_INIT([zc],[0.4.4],[marc.ferland@gmail.com],[libzc],[http://github.com/mferland/libzc])
m4_include([m4/ax_pthread.m4])
AC_CONFIG_SRCDIR([lib/libzc.c])
AM_INIT_AUTOMAKE([-Wall -Werror -Wno-extra-portability])
AC_SYS_LARGEFILE
AC_CONFIG_MACRO_DIR([m4])
AM_SILENT_RULES([yes])
LT_INIT
AC_PREFIX_DEFAULT([/usr])
AC_PROG_CC
AM_PROG_CC_C_O
AX_PTHREAD([CLIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
LDFLAGS="$LDFLAGS $PTHREAD_CFLAGS"])
PKG_PROG_PKG_CONFIG
PKG_CHECK_MODULES(ZLIB, zlib)
PKG_CHECK_MODULES([CHECK], [check >= 0.15.2], [HAVE_CHECK=1], [HAVE_CHECK=0])
AM_CONDITIONAL([USE_CHECK], [test "$HAVE_CHECK" -eq 1])
AC_ARG_ENABLE([logging],
AS_HELP_STRING([--disable-logging], [disable system logging @<:@default=enabled@:>@]),
[], enable_logging=yes)
AS_IF([test "x$enable_logging" = "xyes"], [
AC_DEFINE(ENABLE_LOGGING, [1], [System logging.])
])
AC_ARG_ENABLE([debug],
AS_HELP_STRING([--enable-debug], [enable debug messages @<:@default=disabled@:>@]),
[], [enable_debug=no])
AS_IF([test "x$enable_debug" = "xyes"], [
AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.])
AC_DEFINE(NDEBUG, [], [Assert macro.])
])
AC_CONFIG_HEADERS(config.h)
AC_CONFIG_FILES([
Makefile
lib/Makefile
yazc/Makefile
tests/Makefile
lib/libzc.pc
])
AC_OUTPUT
AC_MSG_RESULT([
$PACKAGE $VERSION
===========
prefix: ${prefix}
sysconfdir: ${sysconfdir}
libdir: ${libdir}
includedir: ${includedir}
compiler: ${CC}
cflags: ${CFLAGS}
cppflags: ${CPPFLAGS}
ldflags: ${LIBS} ${LDFLAGS}
logging: ${enable_logging}
debug: ${enable_debug}
PTHREAD_LIBS: ${PTHREAD_LIBS}
PTHREAD_CFLAGS: ${PTHREAD_CFLAGS}
])