blob: 2f12d861259c3dbacb184165712f75836a4d01a9 [file] [log] [blame]
Harald Welte4cd3d8a2010-03-23 00:30:19 +08001AC_INIT([libosmocore],
2 m4_esyscmd([./git-version-gen .tarball-version]),
Holger Hans Peter Freyther8db70202012-03-26 16:34:37 +02003 [openbsc@lists.osmocom.org])
Harald Welte3cae0392010-02-20 21:09:24 +01004
Neels Hofmeyrcbdfa652016-09-30 23:45:28 +02005dnl *This* is the root dir, even if an install-sh exists in ../ or ../../
6AC_CONFIG_AUX_DIR([.])
7
Sylvain Munaut69b1b8b2015-08-19 11:15:14 +02008AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip 1.6 subdir-objects])
Holger Hans Peter Freytherf9eda742011-11-13 01:02:54 +01009AC_CONFIG_TESTDIR(tests)
Harald Welte3cae0392010-02-20 21:09:24 +010010
11dnl kernel style compile messages
12m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
13
Maxff932bb2017-07-04 18:19:38 +020014dnl include release helper
15RELMAKE='-include osmo-release.mk'
16AC_SUBST([RELMAKE])
17
Harald Welte3cae0392010-02-20 21:09:24 +010018dnl checks for programs
19AC_PROG_MAKE_SET
Diego Elio Pettenòd471a212012-06-29 13:01:19 -070020AC_PROG_MKDIR_P
Harald Welte3cae0392010-02-20 21:09:24 +010021AC_PROG_CC
22AC_PROG_INSTALL
Jan Engelhardtc2ddc4f2015-09-16 14:32:31 +020023LT_INIT([pic-only disable-static])
Harald Welte3cae0392010-02-20 21:09:24 +010024
Harald Welte4cd3d8a2010-03-23 00:30:19 +080025AC_CONFIG_MACRO_DIR([m4])
26
Neels Hofmeyrfef2fa22016-08-08 15:38:35 +020027dnl check for pkg-config
28dnl * If pkg-config is missing, we get a "syntax error" for PKG_CHECK_MODULES.
29dnl Instead, we want to say that pkg-config and pkg.m4 are missing.
30dnl * The proper way is PKG_PROG_PKG_CONFIG() but unfortunately that does not
31dnl produce an intelligible error message if pkg-config is missing entirely
32dnl ("syntax error near unexpected token `0.20'").
33dnl * To produce a hint that pkg-config is missing, check for the pkg-config
34dnl binary; but AC_PATH_PROG breaks if the distribution provides only
35dnl prefixed (<arch>-pkg-config) versions, so just print a warning.
36AC_PATH_PROG(PKG_CONFIG_INSTALLED, pkg-config, no)
37if test "x$PKG_CONFIG_INSTALLED" = "xno"; then
38 AC_MSG_WARN([You need to install pkg-config])
39fi
40PKG_PROG_PKG_CONFIG([0.20])
41
Tobias Engel597460f2012-10-24 17:52:52 +020042dnl check os: some linker flags not available on osx
43case $host in
44*-darwin*)
45 ;;
46*)
47 LTLDFLAGS_OSMOGB='-Wl,--version-script=$(srcdir)/libosmogb.map'
48 LTLDFLAGS_OSMOGSM='-Wl,--version-script=$(srcdir)/libosmogsm.map'
Vadim Yanitskiy3262f822016-09-23 01:48:59 +070049 LTLDFLAGS_OSMOCODING='-Wl,--version-script=$(srcdir)/libosmocoding.map'
Harald Welteed605782018-05-26 17:07:39 +020050 LTLDFLAGS_OSMOCTRL='-Wl,--version-script=$(srcdir)/libosmoctrl.map'
Tobias Engel597460f2012-10-24 17:52:52 +020051 ;;
52esac
53AC_SUBST(LTLDFLAGS_OSMOGB)
54AC_SUBST(LTLDFLAGS_OSMOGSM)
Vadim Yanitskiy272bd4f2017-08-31 17:53:04 +070055AC_SUBST(LTLDFLAGS_OSMOCODING)
Harald Welteed605782018-05-26 17:07:39 +020056AC_SUBST(LTLDFLAGS_OSMOCTRL)
Tobias Engel597460f2012-10-24 17:52:52 +020057
Harald Welte3cae0392010-02-20 21:09:24 +010058dnl checks for header files
59AC_HEADER_STDC
Neels Hofmeyr0c7826e2019-02-25 02:45:06 +010060AC_CHECK_HEADERS(execinfo.h sys/select.h sys/socket.h sys/timerfd.h syslog.h ctype.h netinet/tcp.h netinet/in.h)
Holger Hans Peter Freyther47723482011-11-09 11:26:15 +010061# for src/conv.c
62AC_FUNC_ALLOCA
Pau Espin Pedrolcacaa4a2018-05-04 19:21:58 +020063AC_SEARCH_LIBS([dlopen], [dl dld], [LIBRARY_DLOPEN="$LIBS";LIBS=""])
64AC_SUBST(LIBRARY_DLOPEN)
65AC_SEARCH_LIBS([dlsym], [dl dld], [LIBRARY_DLSYM="$LIBS";LIBS=""])
66AC_SUBST(LIBRARY_DLSYM)
Holger Hans Peter Freytherc2c042d2014-04-17 23:19:10 +020067# for src/backtrace.c
68AC_CHECK_LIB(execinfo, backtrace, BACKTRACE_LIB=-lexecinfo, BACKTRACE_LIB=)
69AC_SUBST(BACKTRACE_LIB)
Harald Welte3cae0392010-02-20 21:09:24 +010070
Pau Espin Pedrold12f6982019-09-17 18:38:58 +020071# check for pthread (PTHREAD_CFLAGS, PTHREAD_LIBS)
72AX_PTHREAD
73
Alexander Couzensa2f696f2018-04-24 16:15:23 +020074# check for old glibc < 2.17 to get clock_gettime
75AC_SEARCH_LIBS([clock_gettime], [rt posix4], [LIBRARY_RT="$LIBS";LIBS=""])
76AC_SUBST(LIBRARY_RT)
77
Pau Espin Pedrol639c4082017-07-06 10:45:22 +020078AC_ARG_ENABLE(doxygen,
79 [AS_HELP_STRING(
80 [--disable-doxygen],
81 [Disable generation of documentation using doxygen],
82 )],
83 [doxygen=$enableval], [doxygen="yes"])
Harald Welte21e73c22011-08-17 19:33:06 +020084AC_PATH_PROG(DOXYGEN,doxygen,false)
Pau Espin Pedrol639c4082017-07-06 10:45:22 +020085AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false && test "x$doxygen" = "xyes")
Harald Welte21e73c22011-08-17 19:33:06 +020086
Max4b2b0cc2017-07-10 14:32:48 +020087# check for syscal fallback on glibc < 2.25 - can be removed once glibc version requirement is bumped
88AC_CHECK_DECLS([SYS_getrandom], [], [], [[#include <sys/syscall.h>]])
89
Harald Welte3cae0392010-02-20 21:09:24 +010090# The following test is taken from WebKit's webkit.m4
91saved_CFLAGS="$CFLAGS"
92CFLAGS="$CFLAGS -fvisibility=hidden "
93AC_MSG_CHECKING([if ${CC} supports -fvisibility=hidden])
Alexander Huemer3d79f532011-05-24 15:16:13 +020094AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])],
Harald Welte3cae0392010-02-20 21:09:24 +010095 [ AC_MSG_RESULT([yes])
96 SYMBOL_VISIBILITY="-fvisibility=hidden"],
97 AC_MSG_RESULT([no]))
98CFLAGS="$saved_CFLAGS"
99AC_SUBST(SYMBOL_VISIBILITY)
100
Harald Welte14c4c492018-06-28 08:28:52 +0200101AC_CHECK_FUNCS(clock_gettime localtime_r)
102
Pau Espin Pedrol3f464fc2019-10-10 17:38:35 +0200103old_LIBS=$LIBS
104AC_SEARCH_LIBS([sctp_bindx], [sctp], [
105 AC_DEFINE(HAVE_LIBSCTP, 1, [Define 1 to enable SCTP support])
106 AC_SUBST(HAVE_LIBSCTP, [1])
107 if test -n "$ac_lib"; then
108 AC_SUBST(LIBSCTP_LIBS, [-l$ac_lib])
109 fi
110 ], [
111 AC_MSG_WARN([sctp_bindx not found in searched libs])])
112LIBS=$old_LIBS
113
Harald Welte7c8e2cc2012-08-29 16:47:30 +0200114AC_DEFUN([CHECK_TM_INCLUDES_TM_GMTOFF], [
115 AC_CACHE_CHECK(
116 [whether struct tm has tm_gmtoff member],
117 osmo_cv_tm_includes_tm_gmtoff,
118 [AC_LINK_IFELSE([
119 AC_LANG_PROGRAM([
120 #include <time.h>
121 ], [
122 time_t t = time(NULL);
123 struct tm* lt = localtime(&t);
124 int off = lt->tm_gmtoff;
125 ])
126 ],
127 osmo_cv_tm_includes_tm_gmtoff=yes,
128 osmo_cv_tm_includes_tm_gmtoff=no
129 )]
130 )
131 if test "x$osmo_cv_tm_includes_tm_gmtoff" = xyes; then
132 AC_DEFINE(HAVE_TM_GMTOFF_IN_TM, 1,
133 [Define if struct tm has tm_gmtoff member.])
134 fi
135])
136
137CHECK_TM_INCLUDES_TM_GMTOFF
138
Pau Espin Pedrole188b8c2019-08-05 13:46:33 +0200139dnl Check if We need to apply workaround for TLS bug on ARM platform for GCC < 7.3.0:
Pau Espin Pedrolafce89d2019-08-06 12:46:46 +0200140ARG_ENABLE_DETECT_TLS_GCC_ARM_BUG
Pau Espin Pedrole188b8c2019-08-05 13:46:33 +0200141
Harald Welte3cae0392010-02-20 21:09:24 +0100142dnl Generate the output
Christian Vogel854debc2013-01-05 20:30:41 +0100143AC_CONFIG_HEADER(config.h)
Harald Welte3cae0392010-02-20 21:09:24 +0100144
Harald Welte90e614f2015-12-05 23:38:18 +0100145PKG_CHECK_MODULES(TALLOC, [talloc >= 2.0.1])
146
Harald Welte495fe262012-09-10 16:28:17 +0200147AC_ARG_ENABLE([pcsc], [AS_HELP_STRING([--disable-pcsc], [Build without PC/SC support])],
148 [
Neels Hofmeyr96831042016-11-15 17:31:14 +0100149 ENABLE_PCSC=$enableval
Harald Welte495fe262012-09-10 16:28:17 +0200150 ],
151 [
Neels Hofmeyr96831042016-11-15 17:31:14 +0100152 ENABLE_PCSC="yes"
Harald Welte495fe262012-09-10 16:28:17 +0200153 ])
Neels Hofmeyr96831042016-11-15 17:31:14 +0100154AS_IF([test "x$ENABLE_PCSC" = "xyes"], [
Holger Hans Peter Freyther18bcc8a2014-11-14 15:06:09 +0100155 PKG_CHECK_MODULES(PCSC, libpcsclite)
Harald Welted086f212015-11-21 11:38:09 +0100156])
Neels Hofmeyr96831042016-11-15 17:31:14 +0100157AM_CONDITIONAL(ENABLE_PCSC, test "x$ENABLE_PCSC" = "xyes")
158AC_SUBST(ENABLE_PCSC)
Harald Welte495fe262012-09-10 16:28:17 +0200159
Maxed029df2017-10-26 10:56:04 +0200160AC_ARG_ENABLE([gnutls], [AS_HELP_STRING([--disable-gnutls], [Do not use GnuTLS fallback for missing getrandom()])],
161 [ENABLE_GNUTLS=$enableval], [ENABLE_GNUTLS="yes"])
162AM_CONDITIONAL(ENABLE_GNUTLS, test x"$ENABLE_GNUTLS" = x"yes")
163AS_IF([test "x$ENABLE_GNUTLS" = "xyes"], [
164 PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 2.12.0])
165])
166AC_SUBST(ENABLE_GNUTLS)
167if test x"$ENABLE_GNUTLS" = x"yes"
168then
169 AC_SUBST([LIBGNUTLS_CFLAGS])
170 AC_SUBST([LIBGNUTLS_LIBS])
171 AC_DEFINE([USE_GNUTLS], [1], [Use GnuTLS as a fallback for missing getrandom()])
172fi
173
Harald Welteb9ce51c2010-06-30 19:43:11 +0200174AC_ARG_ENABLE(plugin,
Sylvain Munautf23abab2010-07-25 16:16:42 +0200175 [AS_HELP_STRING(
176 [--disable-plugin],
177 [Disable support for dlopen plugins],
178 )],
job36b4a202011-08-21 17:18:23 +0200179 [enable_plugin=$enableval], [enable_plugin="yes"])
180AM_CONDITIONAL(ENABLE_PLUGIN, test x"$enable_plugin" = x"yes")
Harald Welteb9ce51c2010-06-30 19:43:11 +0200181
Harald Welte1067e8c2010-06-25 03:00:58 +0200182AC_ARG_ENABLE(vty,
Sylvain Munautf23abab2010-07-25 16:16:42 +0200183 [AS_HELP_STRING(
184 [--disable-vty],
185 [Disable building VTY telnet interface]
186 )],
job36b4a202011-08-21 17:18:23 +0200187 [enable_vty=$enableval], [enable_vty="yes"])
188AM_CONDITIONAL(ENABLE_VTY, test x"$enable_vty" = x"yes")
Harald Welte54403772010-05-29 11:49:51 +0200189
Sylvain Munautac3e61a2010-07-25 18:08:54 +0200190AC_ARG_ENABLE(panic_infloop,
191 [AS_HELP_STRING(
192 [--enable-panic-infloop],
193 [Trigger infinite loop on panic rather than fprintf/abort]
194 )],
job36b4a202011-08-21 17:18:23 +0200195 [panic_infloop=$enableval], [panic_infloop="no"])
196if test x"$panic_infloop" = x"yes"
Sylvain Munautac3e61a2010-07-25 18:08:54 +0200197then
198 AC_DEFINE([PANIC_INFLOOP],[1],[Use infinite loop on panic rather than fprintf/abort])
199fi
200
Holger Hans Peter Freyther43558312010-08-06 06:48:43 +0800201AC_ARG_ENABLE(bsc_fd_check,
202 [AS_HELP_STRING(
203 [--enable-bsc-fd-check],
204 [Instrument bsc_register_fd to check that the fd is registered]
205 )],
job36b4a202011-08-21 17:18:23 +0200206 [fd_check=$enableval], [fd_check="no"])
207if test x"$fd_check" = x"no"
Holger Hans Peter Freyther43558312010-08-06 06:48:43 +0800208then
209 AC_DEFINE([BSC_FD_CHECK],[1],[Instrument the bsc_register_fd])
210fi
211
Holger Hans Peter Freytherc87f2662010-10-07 00:00:15 +0800212AC_ARG_ENABLE(msgfile,
213 [AS_HELP_STRING(
214 [--disable-msgfile],
215 [Disable support for the msgfile],
216 )],
job36b4a202011-08-21 17:18:23 +0200217 [enable_msgfile=$enableval], [enable_msgfile="yes"])
218AM_CONDITIONAL(ENABLE_MSGFILE, test x"$enable_msgfile" = x"yes")
Holger Hans Peter Freytherc87f2662010-10-07 00:00:15 +0800219
Sylvain Munautfe28ded2011-09-02 22:18:24 +0200220AC_ARG_ENABLE(serial,
221 [AS_HELP_STRING(
222 [--disable-serial],
223 [Disable support for the serial helpers],
224 )],
225 [enable_serial=$enableval], [enable_serial="yes"])
226AM_CONDITIONAL(ENABLE_SERIAL, test x"$enable_serial" = x"yes")
227
job8e4deb62011-08-21 17:18:24 +0200228AC_ARG_ENABLE(utilities,
229 [AS_HELP_STRING(
230 [--disable-utilities],
231 [Disable building utility programs],
232 )],
233 [enable_utilities=$enableval], [enable_utilities="yes"])
234AM_CONDITIONAL(ENABLE_UTILITIES, test x"$enable_utilities" = x"yes")
235
Harald Weltee3a10b62012-09-08 22:18:43 +0200236AC_ARG_ENABLE(gb,
237 [AS_HELP_STRING(
238 [--disable-gb],
239 [Disable building Gb library],
240 )],
241 [enable_gb=$enableval], [enable_gb="yes"])
242AM_CONDITIONAL(ENABLE_GB, test x"$enable_gb" = x"yes")
243
Harald Welte1c67e752017-01-15 17:52:30 +0100244AC_ARG_ENABLE(ctrl,
245 [AS_HELP_STRING(
246 [--disable-ctrl],
247 [Disable building CTRL library],
248 )],
249 [enable_ctrl=$enableval], [enable_ctrl="yes"])
250AM_CONDITIONAL(ENABLE_CTRL, test x"$enable_ctrl" = x"yes")
251
Harald Welte898ffef2017-05-15 21:37:34 +0200252AC_ARG_ENABLE(pseudotalloc,
253 [AS_HELP_STRING(
254 [--enable-pseudotalloc],
255 [Enable building pseudotalloc library],
256 )],
257 [enable_pseudotalloc=$enableval], [enable_pseudotalloc="no"])
258AM_CONDITIONAL(ENABLE_PSEUDOTALLOC, test x"$enable_pseudotalloc" = x"yes")
259
job8e4deb62011-08-21 17:18:24 +0200260AC_ARG_ENABLE(embedded,
261 [AS_HELP_STRING(
262 [--enable-embedded],
263 [Enable building for embedded use and disable unsupported features]
264 )],
265 [embedded=$enableval], [embedded="no"])
Max89c8c402018-01-18 16:05:27 +0100266
267AM_CONDITIONAL(ENABLE_STATS_TEST, true)
Max3da79382018-01-18 16:50:51 +0100268AM_CONDITIONAL(ENABLE_SERCOM_STUB, false)
Max89c8c402018-01-18 16:05:27 +0100269
job8e4deb62011-08-21 17:18:24 +0200270if test x"$embedded" = x"yes"
271then
272 AC_DEFINE([EMBEDDED],[1],[Select building for embedded use])
job8e4deb62011-08-21 17:18:24 +0200273 AM_CONDITIONAL(ENABLE_PLUGIN, false)
274 AM_CONDITIONAL(ENABLE_MSGFILE, false)
Sylvain Munautfe28ded2011-09-02 22:18:24 +0200275 AM_CONDITIONAL(ENABLE_SERIAL, false)
Maxed029df2017-10-26 10:56:04 +0200276 AM_CONDITIONAL(ENABLE_GNUTLS, false)
job8e4deb62011-08-21 17:18:24 +0200277 AM_CONDITIONAL(ENABLE_VTY, false)
Harald Welte1c67e752017-01-15 17:52:30 +0100278 AM_CONDITIONAL(ENABLE_CTRL, false)
job8e4deb62011-08-21 17:18:24 +0200279 AM_CONDITIONAL(ENABLE_UTILITIES, false)
Harald Weltee3a10b62012-09-08 22:18:43 +0200280 AM_CONDITIONAL(ENABLE_GB, false)
Maxed029df2017-10-26 10:56:04 +0200281 AM_CONDITIONAL(ENABLE_GNUTLS, false)
Harald Welte1a7d64c2017-01-15 17:53:23 +0100282 AM_CONDITIONAL(ENABLE_PCSC, false)
Harald Welte898ffef2017-05-15 21:37:34 +0200283 AM_CONDITIONAL(ENABLE_PSEUDOTALLOC, true)
Max3da79382018-01-18 16:50:51 +0100284 AM_CONDITIONAL(ENABLE_SERCOM_STUB, true)
Max89c8c402018-01-18 16:05:27 +0100285 AM_CONDITIONAL(ENABLE_STATS_TEST, false)
Maxed029df2017-10-26 10:56:04 +0200286 AC_DEFINE([USE_GNUTLS], [0])
job8e4deb62011-08-21 17:18:24 +0200287 AC_DEFINE([PANIC_INFLOOP],[1],[Use infinite loop on panic rather than fprintf/abort])
288fi
Harald Welte54403772010-05-29 11:49:51 +0200289
Neels Hofmeyra2381762016-09-30 01:25:45 +0200290AC_ARG_ENABLE(sanitize,
291 [AS_HELP_STRING(
292 [--enable-sanitize],
293 [Compile with address sanitizer enabled],
294 )],
295 [sanitize=$enableval], [sanitize="no"])
296if test x"$sanitize" = x"yes"
297then
Pau Espin Pedrol13492492017-06-23 11:18:04 +0200298 CFLAGS="$CFLAGS -fsanitize=address -fsanitize=undefined"
299 CPPFLAGS="$CPPFLAGS -fsanitize=address -fsanitize=undefined"
Neels Hofmeyra2381762016-09-30 01:25:45 +0200300fi
301
Neels Hofmeyr09ecbb72018-03-05 20:40:05 +0100302AC_ARG_ENABLE(werror,
303 [AS_HELP_STRING(
304 [--enable-werror],
305 [Turn all compiler warnings into errors, with exceptions:
306 a) deprecation (allow upstream to mark deprecation without breaking builds);
307 b) "#warning" pragmas (allow to remind ourselves of errors without breaking builds)
308 ]
309 )],
310 [werror=$enableval], [werror="no"])
311if test x"$werror" = x"yes"
312then
313 WERROR_FLAGS="-Werror"
314 WERROR_FLAGS+=" -Wno-error=deprecated -Wno-error=deprecated-declarations"
315 WERROR_FLAGS+=" -Wno-error=cpp" # "#warning"
316 CFLAGS="$CFLAGS $WERROR_FLAGS"
317 CPPFLAGS="$CPPFLAGS $WERROR_FLAGS"
318fi
319
Neels Hofmeyr3a9ff112018-09-10 17:18:28 +0200320AC_ARG_ENABLE([external_tests],
321 AC_HELP_STRING([--enable-external-tests],
322 [Include the VTY/CTRL tests in make check [default=no]]),
323 [enable_ext_tests="$enableval"],[enable_ext_tests="no"])
324if test "x$enable_ext_tests" = "xyes" ; then
325 AM_PATH_PYTHON
326 AC_CHECK_PROG(OSMOTESTEXT_CHECK,osmo_verify_transcript_vty.py,yes)
327 if test "x$OSMOTESTEXT_CHECK" != "xyes" ; then
328 AC_MSG_ERROR([Please install git://osmocom.org/python/osmo-python-tests to run the VTY/CTRL tests.])
329 fi
330fi
331AC_MSG_CHECKING([whether to enable VTY/CTRL tests])
332AC_MSG_RESULT([$enable_ext_tests])
333AM_CONDITIONAL(ENABLE_EXT_TESTS, test "x$enable_ext_tests" = "xyes")
334
Pau Espin Pedrol13492492017-06-23 11:18:04 +0200335CFLAGS="$CFLAGS -DBUILDING_LIBOSMOCORE -Wall"
336CPPFLAGS="$CPPFLAGS -DBUILDING_LIBOSMOCORE -Wall"
Pau Espin Pedrol69dfe5a2017-06-17 23:18:11 +0200337
Vadim Yanitskiy2c3066e2017-04-30 19:41:56 +0700338AC_ARG_ENABLE(simd,
339 [AS_HELP_STRING(
340 [--disable-simd],
341 [Disable SIMD support]
342 )],
343 [simd=$enableval], [simd="yes"])
344if test x"$simd" = x"yes"
345then
346 # Find and define supported SIMD extensions
347 AX_CHECK_SIMD
348else
349 AM_CONDITIONAL(HAVE_AVX2, false)
Harald Welteb93f60f2017-11-17 11:41:34 +0100350 AM_CONDITIONAL(HAVE_SSSE3, false)
Vadim Yanitskiy2c3066e2017-04-30 19:41:56 +0700351 AM_CONDITIONAL(HAVE_SSE4_1, false)
352fi
353
Vadim Yanitskiya8a58192017-05-08 00:07:21 +0700354dnl Check if the compiler supports specified GCC's built-in function
355AC_DEFUN([CHECK_BUILTIN_SUPPORT], [
356 AC_CACHE_CHECK(
357 [whether ${CC} has $1 built-in],
358 [osmo_cv_cc_has_builtin], [
359 AC_LINK_IFELSE([
360 AC_LANG_PROGRAM([], [
361 __builtin_cpu_supports("sse");
362 ])
363 ],
364 [AS_VAR_SET([osmo_cv_cc_has_builtin], [yes])],
365 [AS_VAR_SET([osmo_cv_cc_has_builtin], [no])])
366 ]
367 )
368
369 AS_IF([test yes = AS_VAR_GET([osmo_cv_cc_has_builtin])], [
370 AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_$1), 1,
371 [Define to 1 if compiler has the '$1' built-in function])
372 ], [
373 AC_MSG_WARN($2)
374 ])
375])
376
377dnl Check if the compiler supports runtime SIMD detection
378CHECK_BUILTIN_SUPPORT([__builtin_cpu_supports],
379 [Runtime SIMD detection will be disabled])
380
Neels Hofmeyr09ecbb72018-03-05 20:40:05 +0100381AC_MSG_RESULT([CFLAGS="$CFLAGS"])
382AC_MSG_RESULT([CPPFLAGS="$CPPFLAGS"])
383
Harald Welte3cae0392010-02-20 21:09:24 +0100384AC_OUTPUT(
385 libosmocore.pc
Sylvain Munautb99b9302010-10-24 18:23:10 +0200386 libosmocodec.pc
Vadim Yanitskiy3262f822016-09-23 01:48:59 +0700387 libosmocoding.pc
Harald Weltee352c522010-05-19 19:42:32 +0200388 libosmovty.pc
Pablo Neira Ayusofba495e2011-03-23 18:08:08 +0100389 libosmogsm.pc
Harald Welte641f7ce2012-06-17 23:05:26 +0800390 libosmogb.pc
Harald Welte3ff81b12014-08-20 19:58:40 +0200391 libosmoctrl.pc
Harald Welted54c2ee2012-01-17 18:25:50 +0100392 libosmosim.pc
Harald Welte3cae0392010-02-20 21:09:24 +0100393 include/Makefile
394 src/Makefile
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200395 src/vty/Makefile
Sylvain Munaut1a4ea5b2010-10-08 15:09:16 +0200396 src/codec/Makefile
Vadim Yanitskiy3262f822016-09-23 01:48:59 +0700397 src/coding/Makefile
Harald Welted54c2ee2012-01-17 18:25:50 +0100398 src/sim/Makefile
Pablo Neira Ayusofba495e2011-03-23 18:08:08 +0100399 src/gsm/Makefile
Harald Welte641f7ce2012-06-17 23:05:26 +0800400 src/gb/Makefile
Harald Welte3ff81b12014-08-20 19:58:40 +0200401 src/ctrl/Makefile
Harald Welte898ffef2017-05-15 21:37:34 +0200402 src/pseudotalloc/Makefile
Harald Welte3cae0392010-02-20 21:09:24 +0100403 tests/Makefile
Neels Hofmeyr96831042016-11-15 17:31:14 +0100404 tests/atlocal
Harald Welteeeb78dd2011-08-02 13:44:54 +0200405 utils/Makefile
Harald Weltec7859ed2011-08-20 12:54:17 +0200406 Doxyfile.core
Harald Welte49e10562011-08-17 19:21:07 +0200407 Doxyfile.gsm
408 Doxyfile.vty
409 Doxyfile.codec
Vadim Yanitskiy3262f822016-09-23 01:48:59 +0700410 Doxyfile.coding
Neels Hofmeyr249fb712017-06-20 02:52:38 +0200411 Doxyfile.gb
Harald Welteb4186822018-05-26 17:25:11 +0200412 Doxyfile.ctrl
Harald Welte3cae0392010-02-20 21:09:24 +0100413 Makefile)