Remove rseq_deref_loadoffp placeholders
[librseq.git] / configure.ac
CommitLineData
4a97c059
MJ
1dnl SPDX-License-Identifier: MIT
2dnl
3dnl Copyright (C) 2021 EfficiOS, Inc.
4dnl
5dnl Process this file with autoconf to produce a configure script.
6
7# Project version information
8m4_define([rseq_version_major], [0])
9m4_define([rseq_version_minor], [1])
10m4_define([rseq_version_patch], [0])
11m4_define([rseq_version_dev_stage], [-pre])
12m4_define([rseq_version], rseq_version_major[.]rseq_version_minor[.]rseq_version_patch[]rseq_version_dev_stage)
13
14# Library version information of "librseq"
2cbca301
MJ
15# Following the numbering scheme proposed by libtool for the library version
16# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
4a97c059
MJ
17m4_define([rseq_lib_version_current], [0])
18m4_define([rseq_lib_version_revision], [0])
19m4_define([rseq_lib_version_age], [0])
20m4_define([rseq_lib_version], rseq_lib_version_current[:]rseq_lib_version_revision[:]rseq_lib_version_age)
21
22
23## ##
24## Autoconf base setup ##
25## ##
26
27AC_PREREQ([2.69])
28AC_INIT([librseq],[rseq_version],[mathieu dot desnoyers at efficios dot com],[],[https://github.com/compudj/librseq/])
2cbca301
MJ
29
30AC_CONFIG_HEADERS([include/config.h])
31AC_CONFIG_AUX_DIR([config])
32AC_CONFIG_MACRO_DIR([m4])
33
34AC_CANONICAL_TARGET
35AC_CANONICAL_HOST
36
4a97c059
MJ
37
38## ##
39## Automake base setup ##
40## ##
41
42AM_INIT_AUTOMAKE([1.12 foreign dist-bzip2 no-dist-gzip nostdinc -Wall -Werror])
2cbca301
MJ
43AM_MAINTAINER_MODE([enable])
44
4a97c059
MJ
45# Enable silent rules by default
46AM_SILENT_RULES([yes])
2cbca301 47
4a97c059
MJ
48
49## ##
50## C compiler checks ##
51## ##
52
53# Choose the C compiler
2cbca301 54AC_PROG_CC
4a97c059
MJ
55# AC_PROG_CC_STDC was merged in AC_PROG_CC in autoconf 2.70
56m4_version_prereq([2.70], [], [AC_PROG_CC_STDC])
2cbca301 57
4a97c059
MJ
58# Make sure the C compiler supports C99
59AS_IF([test "$ac_cv_prog_cc_c99" = "no"], [AC_MSG_ERROR([The compiler does not support C99])])
2cbca301 60
4a97c059
MJ
61# Enable available system extensions and LFS support
62AC_USE_SYSTEM_EXTENSIONS
63AC_SYS_LARGEFILE
64
65# Make sure the C compiler supports __attribute__
66AX_C___ATTRIBUTE__
67AS_IF([test "x$ax_cv___attribute__" != "xyes"],
68 [AC_MSG_ERROR([The compiler does not support __attribute__ extensions])])
69
70# Make sure we have pthread support
71AX_PTHREAD([], [AC_MSG_ERROR([Could not configure pthread support])])
2cbca301
MJ
72
73# Checks for typedefs, structures, and compiler characteristics.
74AC_C_INLINE
4a97c059 75AC_C_TYPEOF
2cbca301
MJ
76AC_TYPE_INT32_T
77AC_TYPE_INT64_T
78AC_TYPE_OFF_T
79AC_TYPE_SIZE_T
80AC_TYPE_UINT32_T
81AC_TYPE_UINT64_T
82
2cbca301 83
4a97c059
MJ
84## ##
85## Header checks ##
86## ##
87
88AC_HEADER_STDBOOL
89AC_CHECK_HEADERS([ \
90 limits.h \
91 stddef.h \
92 sys/time.h \
93])
94
95AC_CHECK_HEADER([linux/rseq.h], [],
96 [AC_MSG_ERROR([Cannot find 'linux/rseq.h'.])
97])
98
99
100## ##
101## Programs checks ##
102## ##
103
104AM_PROG_AR
105AC_PROG_AWK
106AC_PROG_MAKE_SET
107
108# Initialize and configure libtool
109LT_INIT
2cbca301 110
4a97c059
MJ
111
112## ##
113## Library checks ##
114## ##
2cbca301
MJ
115
116# Checks for library functions.
117AC_FUNC_MMAP
118AC_FUNC_FORK
119AC_CHECK_FUNCS([ \
4a97c059 120 atexit \
2cbca301
MJ
121 memset \
122 strerror \
123])
124
125# AC_FUNC_MALLOC causes problems when cross-compiling.
126#AC_FUNC_MALLOC
127
2cbca301 128
4a97c059
MJ
129## ##
130## Substitute variables for use in Makefile.am ##
131## ##
132
133# Library versions for libtool
134AC_SUBST([RSEQ_LIBRARY_VERSION], [rseq_lib_version])
2cbca301 135
4a97c059
MJ
136# The order in which the include folders are searched is important.
137# The top_builddir should always be searched first in the event that a build
138# time generated file is included.
139AM_CPPFLAGS="-I\$(top_builddir)/include -I\$(top_srcdir)/include -include config.h"
2cbca301
MJ
140AC_SUBST(AM_CPPFLAGS)
141
4a97c059 142AM_CFLAGS="-Wall -Wextra $PTHREAD_CFLAGS"
2cbca301
MJ
143AC_SUBST(AM_CFLAGS)
144
4a97c059
MJ
145
146## ##
147## Output files generated by configure ##
148## ##
149
2cbca301
MJ
150AC_CONFIG_FILES([
151 Makefile
6146efae
MD
152 doc/Makefile
153 doc/man/Makefile
2cbca301
MJ
154 include/Makefile
155 src/Makefile
2cbca301 156 src/librseq.pc
b848736e 157 tests/Makefile
544cdc88 158 tests/utils/Makefile
2cbca301
MJ
159])
160
161AC_OUTPUT
aa4ed6d6 162
4a97c059 163
aa4ed6d6
MJ
164#
165# Mini-report on what will be built.
166#
167
168PPRINT_INIT
169PPRINT_SET_INDENT(1)
170PPRINT_SET_TS(38)
171
172AS_ECHO
173AS_ECHO("${PPRINT_COLOR_BLDBLU}librseq $PACKAGE_VERSION${PPRINT_COLOR_RST}")
174AS_ECHO
175
176PPRINT_SUBTITLE([Features])
177
178PPRINT_PROP_STRING([Target architecture], $host_cpu)
179
aa4ed6d6
MJ
180report_bindir="`eval eval echo $bindir`"
181report_libdir="`eval eval echo $libdir`"
182
183# Print the bindir and libdir this `make install' will install into.
184AS_ECHO
185PPRINT_SUBTITLE([Install directories])
186PPRINT_PROP_STRING([Binaries], [$report_bindir])
187PPRINT_PROP_STRING([Libraries], [$report_libdir])
This page took 0.030062 seconds and 4 git commands to generate.