-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
45 lines (38 loc) · 1.26 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
AC_PREREQ(2.57)
AC_INIT([pblc], [0.1], [[email protected]])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_GNU_SOURCE
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
AC_CONFIG_HEADERS(src/config.h)
AC_PROG_CC
# Check if CC is linked to CLANG
AC_MSG_CHECKING([if compiling with clang])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([], [[
#ifndef __clang__
not clang
#endif
]])],
[CLANG=yes], [CLANG=no])
AC_MSG_RESULT([$CLANG])
AM_CONDITIONAL(CLANG, test "$CLANG" = yes)
AM_CONDITIONAL(GCC, test "$GCC" = yes) # let the Makefile know if we're gcc
AC_PROG_LIBTOOL
AC_SUBST(LIBTOOL_DEPS)
# Check whether some low-level functions/files are available
AC_HEADER_STDC
# Check libraries
PKG_CHECK_MODULES([UNITTEST], [cmockery2], , AC_MSG_ERROR([cmockery2 library is required to build]))
PKG_CHECK_MODULES([MSGPACK], [msgpack], ,
[AC_CHECK_LIB([msgpack], [msgpack_version],
[MSGPACK_LIBS="-lmsgpack"],
AC_MSG_ERROR([msgpack library is required to build]))])
# If pkg-config
AC_CHECK_PROG(PKG_CONFIG, pkg-config, yes)
AM_CONDITIONAL([HAVE_PKG_CONFIG], [test "x$PKG_CONFIG" != "x"])
AS_IF([test "x$PKG_CONFIG" != "x"], [
AC_CONFIG_FILES([pblc.pc])
])
AC_CONFIG_FILES([Makefile
src/Makefile])
AC_OUTPUT