Commit | Line | Data |
---|---|---|
27caca78 MD |
1 | # SPDX-License-Identifier: MIT |
2 | # | |
3 | # Copyright (C) 2019 Michael Jeanson <mjeanson@efficios.com> | |
4 | # | |
5 | ||
6 | AC_PREREQ(2.59) | |
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 | ||
16 | AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip nostdinc]) | |
17 | AM_MAINTAINER_MODE([enable]) | |
18 | ||
19 | # Enable silent rules if available (Introduced in AM 1.11) | |
20 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) | |
21 | ||
22 | # Checks for C compiler | |
23 | AC_USE_SYSTEM_EXTENSIONS | |
24 | AC_PROG_CC | |
25 | AC_PROG_CC_STDC | |
26 | AC_PROG_CXX | |
27 | ||
28 | # Checks for programs. | |
29 | AC_PROG_AWK | |
30 | AC_PROG_MAKE_SET | |
31 | ||
32 | LT_INIT | |
33 | ||
34 | # Checks for typedefs, structures, and compiler characteristics. | |
35 | AC_C_INLINE | |
36 | AC_TYPE_INT32_T | |
37 | AC_TYPE_INT64_T | |
38 | AC_TYPE_OFF_T | |
39 | AC_TYPE_SIZE_T | |
40 | AC_TYPE_UINT32_T | |
41 | AC_TYPE_UINT64_T | |
42 | ||
43 | AX_C___ATTRIBUTE__ | |
44 | AS_IF([test "x$ax_cv___attribute__" = "xyes"], | |
45 | [:], | |
46 | [AC_MSG_ERROR([The compiler does not support __attribute__ extensions])]) | |
47 | ||
48 | AX_PTHREAD(,[AC_MSG_ERROR([Could not configure pthreads support])]) | |
49 | ||
50 | AM_CFLAGS="$AM_CFLAGS $PTHREAD_CFLAGS" | |
51 | ||
52 | # Checks for library functions. | |
53 | AC_FUNC_MMAP | |
54 | AC_FUNC_FORK | |
55 | AC_CHECK_FUNCS([ \ | |
56 | memset \ | |
57 | strerror \ | |
58 | ]) | |
59 | ||
60 | # AC_FUNC_MALLOC causes problems when cross-compiling. | |
61 | #AC_FUNC_MALLOC | |
62 | ||
63 | # Check for headers | |
64 | AC_HEADER_STDBOOL | |
65 | AC_CHECK_HEADERS([ \ | |
66 | limits.h \ | |
67 | stddef.h \ | |
68 | ]) | |
69 | ||
70 | AM_CPPFLAGS="-include config.h" | |
71 | AC_SUBST(AM_CPPFLAGS) | |
72 | ||
73 | AM_CFLAGS="-Wall -Wextra $AM_CFLAGS" | |
74 | AC_SUBST(AM_CFLAGS) | |
75 | ||
76 | AC_CONFIG_FILES([ | |
77 | Makefile | |
78 | src/Makefile | |
79 | ]) | |
80 | ||
81 | AC_OUTPUT | |
82 | ||
83 | # | |
84 | # Mini-report on what will be built. | |
85 | # | |
86 | ||
87 | PPRINT_INIT | |
88 | PPRINT_SET_INDENT(1) | |
89 | PPRINT_SET_TS(38) | |
90 | ||
91 | AS_ECHO | |
92 | AS_ECHO("${PPRINT_COLOR_BLDBLU}lttng-trace $PACKAGE_VERSION${PPRINT_COLOR_RST}") | |
93 | AS_ECHO | |
94 | ||
95 | PPRINT_SUBTITLE([Features]) | |
96 | ||
97 | PPRINT_PROP_STRING([Target architecture], $host_cpu) | |
98 | ||
99 | report_bindir="`eval eval echo $bindir`" | |
100 | report_libdir="`eval eval echo $libdir`" | |
101 | ||
102 | # Print the bindir and libdir this `make install' will install into. | |
103 | AS_ECHO | |
104 | PPRINT_SUBTITLE([Install directories]) | |
105 | PPRINT_PROP_STRING([Binaries], [$report_bindir]) | |
106 | PPRINT_PROP_STRING([Libraries], [$report_libdir]) |