-
Notifications
You must be signed in to change notification settings - Fork 22
/
configure.ac
176 lines (149 loc) · 5.39 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
AC_INIT([satyr], m4_esyscmd([cat ./satyr-version]), [crash-catcher@fedorahosted.org])
AC_CANONICAL_TARGET
AC_CANONICAL_HOST
AC_CONFIG_HEADERS([lib/config.h])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AM_MAINTAINER_MODE
PKG_PROG_PKG_CONFIG
# Support silent build rules. Disable by either passing --disable-silent-rules
# to ./configure or passing V=1 to make
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
# The 'yes' argument is undocumented but it is common knowledge that it works.
AM_SILENT_RULES([yes])
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
AC_PROG_CC
AC_DISABLE_STATIC
AC_PROG_LIBTOOL
AM_PROG_CC_C_O
AC_ARG_ENABLE(doxygen-docs,
AS_HELP_STRING([--enable-doxygen-docs],
[build DOXYGEN documentation (requires Doxygen)]),
[enable_doxygen_docs=$enableval],
[enable_doxygen_docs=no]
)
# Doxygen Documentation
AC_PATH_PROG(DOXYGEN, doxygen, no)
AC_MSG_CHECKING([whether to build Doxygen documentation])
if test "$DOXYGEN" = "no" ; then
have_doxygen=no
else
have_doxygen=yes
fi
if test "$enable_doxygen_docs" = "yes" ; then
if test "$have_doxygen" = "no"; then
AC_MSG_ERROR([Building Doxygen docs explicitly required, but Doxygen not found])
fi
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
AM_CONDITIONAL(DOXYGEN_DOCS_ENABLED, test "$enable_doxygen_docs" = "yes")
AC_PATH_PROG([GPERF], [gperf], [no])
if test "x$GPERF" = "xno"
then
AC_MSG_ERROR(["gperf not found in the search path."])
fi
# Initialize the test suite.
AC_CONFIG_TESTDIR(tests)
AM_MISSING_PROG([AUTOM4TE], [autom4te])
AX_VALGRIND_DFLT([memcheck], [on])
AX_VALGRIND_DFLT([helgrind], [off])
AX_VALGRIND_DFLT([drd], [off])
AX_VALGRIND_DFLT([sgcheck], [off])
AX_VALGRIND_CHECK
# Needed by tests/atlocal.in.
AC_SUBST([O0CFLAGS], [`echo $CFLAGS | sed 's/-O[[0-9]] *//'`])
AC_ARG_ENABLE([static-python-module],
[AS_HELP_STRING([--enable-static-python-module],
[Compile the python module so that it does not load libsatyr.so
dynamically but includes the object files directly.
Might be needed to use the module on OpenShift.])],
[enable_static_python_module=$enableval],
[enable_static_python_module=no])
AM_CONDITIONAL(ENABLE_STATIC_PYTHON_MODULE, [test $enable_static_python_module = yes])
AC_ARG_WITH([python3],
[AS_HELP_STRING([--without-python3],
[Build without python3 support.])],
[with_python3=$withval],
[with_python3=yes])
AM_CONDITIONAL(WITH_PYTHON3, [test $with_python3 = yes])
[if test "$with_python3" = "yes"]
[then]
AM_PATH_PYTHON([3.6],,
[AC_MSG_ERROR([
The python3 program was not found in the search path. Please ensure
that it is installed and its directory is included in the search path or
pass --without-python3 to ./configure.
Then run configure again before attempting to build satyr.
])])
AC_PATH_PROG([PYTHON3_CONFIG], [python${PYTHON_VERSION}-config], [no])
[if test "$PYTHON3_CONFIG" = "no"]
[then]
[echo "The python${PYTHON_VERSION}-config program was not found in the search path. Please ensure"]
[echo "that it is installed and its directory is included in the search path or"]
[echo "pass --without-python3 to ./configure."]
[echo "Then run configure again before attempting to build satyr."]
[exit 1]
[fi]
PYTHON3_CFLAGS=`${PYTHON3_CONFIG} --cflags 2> /dev/null`
PYTHON3_LIBS=`${PYTHON3_CONFIG} --libs 2> /dev/null`
AC_SUBST([PYTHON3_CFLAGS])
AC_SUBST([PYTHON3_LIBS])
AC_SUBST([python3dir], [$pythondir])
AC_SUBST([py3execdir], [$pyexecdir])
[fi]
# Check BFD
AC_CHECK_LIB([bfd], [main])
AC_CHECK_LIB([dl], [main])
PKG_CHECK_MODULES([GLIB], [glib-2.0])
PKG_CHECK_MODULES([JSON], [json-c])
PKG_CHECK_MODULES([LIBDW], [libdw], [AC_DEFINE([HAVE_LIBDW], [], [libdw found])])
PKG_CHECK_MODULES([LIBELF], [libelf], [AC_DEFINE([HAVE_LIBELF], [], [libelf found])])
AC_ARG_WITH([unwinder],
[AS_HELP_STRING([--with-unwinder=@<:@elfutils/libunwind@:>@],
[call stack unwinder to use @<:@default=elfutils@:>@])],
[],
[with_unwinder=elfutils])
AS_IF([test "x$with_unwinder" = "xlibunwind"],
[PKG_CHECK_MODULES([LIBUNWIND],
[libunwind-coredump],
[AC_DEFINE([WITH_LIBUNWIND], [], [use libunwind for unwinding])])],
[AC_DEFINE([WITH_LIBDWFL], [], [use elfutils for unwinding])])
# rpm
AC_ARG_WITH([rpm],
[AS_HELP_STRING([--with-rpm],
[Build with rpm support.])],
[with_rpm=$withval],
[with_rpm=yes])
[if test "$with_rpm" = "yes"]
[then]
PKG_CHECK_MODULES([RPM], [rpm])
AC_DEFINE(HAVE_LIBRPM, [], [Have rpm support.])
[fi]
# c++ symbol demangling
AC_CHECK_LIB([stdc++], [__cxa_demangle], [], [echo "error: stdc++ library not found"; exit 1])
AC_CHECK_PROGS([VALGRIND], [valgrind])
case "$host_os" in
freebsd*)
AC_CHECK_HEADER([elfutils/version.h], [],
[AC_MSG_ERROR([elfutils/version.h is needed to build satyr])])
;;
*)
;;
esac
AC_CONFIG_FILES([
satyr.pc
Makefile
apidoc/Makefile
apidoc/Doxyfile
apidoc/html/Makefile
lib/Makefile
python/Makefile
python/doc/Makefile
tests/Makefile
include/Makefile
tests/atlocal
ruby/Makefile
])
AC_OUTPUT