-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure.ac
58 lines (49 loc) · 1.51 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
AC_PREREQ(2.59)
cflags_set=${CFLAGS+set} # See if user set custom cflags
AC_INIT(clib, [1.0.0], [http://github.com/rib/clib/issues])
AC_CONFIG_SRCDIR(clib/clib.h)
AC_CONFIG_AUX_DIR([build])
AC_CONFIG_MACRO_DIR([build/autotools])
AC_CONFIG_HEADERS(config.h)
AC_CANONICAL_SYSTEM
AC_CANONICAL_HOST
AM_INIT_AUTOMAKE([1.11 foreign -Wno-portability no-define no-dist-gzip dist-bzip2 subdir-objects])
AC_USE_SYSTEM_EXTENSIONS
AC_PROG_CC
AM_SILENT_RULES([yes])
LT_INIT
AC_ARG_ENABLE(
[debug],
[AC_HELP_STRING([--enable-debug=@<:@no/yes@:>@],
[Control debugging level @<:@default=yes@:>@])],
[enable_debug="$enableval"],
[enable_debug=yes]
)
AS_IF([test "x$enable_debug" = "xyes"],
[ test "$cflags_set" = set || CFLAGS="$CFLAGS -g -O0" ])
AC_ARG_ENABLE(
[unit-tests],
[AC_HELP_STRING([--enable-unit-tests=@<:@no/yes@:>@], [Build unit tests @<:@default=yes@:>@])],
[],
enable_unit_tests=yes
)
AS_IF([test "x$enable_unit_tests" = "xyes"],
[ AC_DEFINE([ENABLE_UNIT_TESTS], [1], [Whether to enable building unit tests]) ])
AM_CONDITIONAL(UNIT_TESTS, test "x$enable_unit_tests" = "xyes")
PKG_CHECK_MODULES(LIBUV_DEP, [libuv])
AM_CONDITIONAL([USE_UV], [true])
AM_CONDITIONAL([USE_SYSTEM_UV], [true])
AC_DEFINE([USE_UV], [1], [Use libuv])
AM_CLIB
AC_OUTPUT(
Makefile
clib/Makefile
)
echo ""
echo "Clib configured:"
echo ""
echo " • Compiler options:"
echo " Clib debug: ${enable_debug}"
echo " Compiler flags: ${CFLAGS} ${CLIB_EXTRA_CFLAGS}"
echo " Linker flags: ${LDFLAGS}"
echo ""