-
Notifications
You must be signed in to change notification settings - Fork 24
/
configure.ac
51 lines (43 loc) · 1.5 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
# Define the package version numbers, bug reporting link, project homepage.
m4_define([HASHIDS_VERSION_MAJOR], [1])
m4_define([HASHIDS_VERSION_MINOR], [2])
m4_define([HASHIDS_VERSION_PATCH], [1])
m4_define([HASHIDS_VERSION_STRING], [HASHIDS_VERSION_MAJOR.HASHIDS_VERSION_MINOR.HASHIDS_VERSION_PATCH])
m4_define([HASHIDS_BUGREPORT_URL], [https://github.com/tzvetkoff/hashids.c/issues])
m4_define([HASHIDS_PROJECT_URL], [https://github.com/tzvetkoff/hashids.c])
# Initialize autoconf & automake.
AC_PREREQ(2.59)
AC_INIT([hashids], [HASHIDS_VERSION_STRING], [HASHIDS_BUGREPORT_URL], [hashids], [HASHIDS_PROJECT_URL])
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([1.9 foreign])
# Checks for programs.
AC_PROG_CC()
AC_PROG_CPP()
AC_PROG_INSTALL()
AC_PROG_LN_S()
AC_PROG_MAKE_SET()
# Libtool.
LT_INIT()
# GLibC's math.
AC_CHECK_LIB([m], [ceil], [LIBM="-lm"])
AC_SUBST([LIBM])
# TLS.
AX_TLS([:], [:])
# Debug.
AC_ARG_ENABLE([debug], AS_HELP_STRING([--enable-debug], [Enable debugging @<:@default=no@:>@.]), [
case "${enableval}" in
yes) HASHIDS_DEBUG="1"; CFLAGS="${CFLAGS} -g -fsanitize=address -fno-omit-frame-pointer";;
no) HASHIDS_DEBUG="0";;
*) AC_MSG_ERROR(["bad value ${enableval} for feature --enable-debug"]);;
esac
], [
HASHIDS_DEBUG="0"
])
AM_CONDITIONAL([DEBUG], [test "x${HASHIDS_DEBUG}" = "x1"])
AC_DEFINE_UNQUOTED([DEBUG], [${HASHIDS_DEBUG}], [Debug mode.])
# Makefiles.
AC_CONFIG_FILES([Makefile src/Makefile])
# Le grand finale.
AC_OUTPUT()