Add detection of lttng-ctl with pkgconfig
[lttng-trace.git] / configure.ac
CommitLineData
27caca78
MD
1# SPDX-License-Identifier: MIT
2#
3# Copyright (C) 2019 Michael Jeanson <mjeanson@efficios.com>
4#
5
a6235500 6AC_PREREQ(2.69)
27caca78
MD
7AC_INIT([lttng-trace],[0.1.0-pre],[mathieu dot desnoyers at efficios dot com], [], [https://github.com/compudj/lttng-trace/])
8
9AC_CONFIG_HEADERS([include/config.h])
10AC_CONFIG_AUX_DIR([config])
11AC_CONFIG_MACRO_DIR([m4])
12
13AC_CANONICAL_TARGET
14AC_CANONICAL_HOST
15
a6235500 16AM_INIT_AUTOMAKE([1.12 foreign dist-bzip2 no-dist-gzip nostdinc -Wall -Wno-portability -Werror])
27caca78
MD
17AM_MAINTAINER_MODE([enable])
18
a6235500
MJ
19# Enable silent rules by default
20AM_SILENT_RULES([yes])
27caca78
MD
21
22# Checks for C compiler
23AC_USE_SYSTEM_EXTENSIONS
24AC_PROG_CC
a6235500
MJ
25# AC_PROG_CC_STDC was merged in AC_PROG_CC in autoconf 2.70
26m4_version_prereq([2.70], [], [AC_PROG_CC_STDC])
27caca78
MD
27AC_PROG_CXX
28
29# Checks for programs.
30AC_PROG_AWK
31AC_PROG_MAKE_SET
32
33LT_INIT
34
35# Checks for typedefs, structures, and compiler characteristics.
36AC_C_INLINE
37AC_TYPE_INT32_T
38AC_TYPE_INT64_T
39AC_TYPE_OFF_T
40AC_TYPE_SIZE_T
41AC_TYPE_UINT32_T
42AC_TYPE_UINT64_T
43
44AX_C___ATTRIBUTE__
45AS_IF([test "x$ax_cv___attribute__" = "xyes"],
46 [:],
47 [AC_MSG_ERROR([The compiler does not support __attribute__ extensions])])
48
49AX_PTHREAD(,[AC_MSG_ERROR([Could not configure pthreads support])])
50
51AM_CFLAGS="$AM_CFLAGS $PTHREAD_CFLAGS"
52
53# Checks for library functions.
54AC_FUNC_MMAP
55AC_FUNC_FORK
56AC_CHECK_FUNCS([ \
57 memset \
58 strerror \
59])
60
61# AC_FUNC_MALLOC causes problems when cross-compiling.
62#AC_FUNC_MALLOC
63
64# Check for headers
65AC_HEADER_STDBOOL
66AC_CHECK_HEADERS([ \
67 limits.h \
68 stddef.h \
69])
70
55d52d49
MJ
71# Check for liblttng-ust
72PKG_CHECK_MODULES([LTTNG_CTL], [lttng-ctl])
73AM_CFLAGS="$AM_CFLAGS $LTTNG_CTL_CFLAGS"
74
27caca78
MD
75AM_CPPFLAGS="-include config.h"
76AC_SUBST(AM_CPPFLAGS)
77
78AM_CFLAGS="-Wall -Wextra $AM_CFLAGS"
79AC_SUBST(AM_CFLAGS)
80
81AC_CONFIG_FILES([
82 Makefile
83 src/Makefile
84])
85
86AC_OUTPUT
87
88#
89# Mini-report on what will be built.
90#
91
92PPRINT_INIT
93PPRINT_SET_INDENT(1)
94PPRINT_SET_TS(38)
95
96AS_ECHO
97AS_ECHO("${PPRINT_COLOR_BLDBLU}lttng-trace $PACKAGE_VERSION${PPRINT_COLOR_RST}")
98AS_ECHO
99
100PPRINT_SUBTITLE([Features])
101
102PPRINT_PROP_STRING([Target architecture], $host_cpu)
103
104report_bindir="`eval eval echo $bindir`"
105report_libdir="`eval eval echo $libdir`"
106
107# Print the bindir and libdir this `make install' will install into.
108AS_ECHO
109PPRINT_SUBTITLE([Install directories])
110PPRINT_PROP_STRING([Binaries], [$report_bindir])
111PPRINT_PROP_STRING([Libraries], [$report_libdir])
This page took 0.036289 seconds and 4 git commands to generate.