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