blob: 4c827b0691fe88a1708f81695900837fc8866453 [file] [log] [blame]
Harald Welte4cd3d8a2010-03-23 00:30:19 +08001AC_INIT([libosmocore],
2 m4_esyscmd([./git-version-gen .tarball-version]),
3 [openbsc-devel@lists.openbsc.org])
Harald Welte3cae0392010-02-20 21:09:24 +01004
Harald Welte4cd3d8a2010-03-23 00:30:19 +08005AM_INIT_AUTOMAKE([dist-bzip2])
Harald Welte3cae0392010-02-20 21:09:24 +01006
7dnl kernel style compile messages
8m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
9
10dnl checks for programs
11AC_PROG_MAKE_SET
12AC_PROG_CC
13AC_PROG_INSTALL
Harald Welte4cd3d8a2010-03-23 00:30:19 +080014LT_INIT
Harald Welte3cae0392010-02-20 21:09:24 +010015AC_PROG_LIBTOOL
16
Harald Welte4cd3d8a2010-03-23 00:30:19 +080017AC_CONFIG_MACRO_DIR([m4])
18
Harald Welte3cae0392010-02-20 21:09:24 +010019dnl checks for header files
20AC_HEADER_STDC
21AC_CHECK_HEADERS(execinfo.h sys/select.h)
22
23# The following test is taken from WebKit's webkit.m4
24saved_CFLAGS="$CFLAGS"
25CFLAGS="$CFLAGS -fvisibility=hidden "
26AC_MSG_CHECKING([if ${CC} supports -fvisibility=hidden])
27AC_COMPILE_IFELSE([char foo;],
28 [ AC_MSG_RESULT([yes])
29 SYMBOL_VISIBILITY="-fvisibility=hidden"],
30 AC_MSG_RESULT([no]))
31CFLAGS="$saved_CFLAGS"
32AC_SUBST(SYMBOL_VISIBILITY)
33
34dnl Generate the output
35AM_CONFIG_HEADER(config.h)
36
Harald Weltecbb29f72010-03-07 20:24:30 +010037AC_ARG_ENABLE(talloc,
Sylvain Munautf23abab2010-07-25 16:16:42 +020038 [AS_HELP_STRING(
39 [--disable-talloc],
40 [Disable building talloc memory allocator]
41 )],
Harald Weltecbb29f72010-03-07 20:24:30 +010042 [enable_talloc=0], [enable_talloc=1])
Harald Weltecbb29f72010-03-07 20:24:30 +010043AM_CONDITIONAL(ENABLE_TALLOC, test "x$enable_talloc" = "x1")
44
Harald Welteb9ce51c2010-06-30 19:43:11 +020045AC_ARG_ENABLE(plugin,
Sylvain Munautf23abab2010-07-25 16:16:42 +020046 [AS_HELP_STRING(
47 [--disable-plugin],
48 [Disable support for dlopen plugins],
49 )],
Harald Welteb9ce51c2010-06-30 19:43:11 +020050 [enable_plugin=0], [enable_plugin=1])
51AM_CONDITIONAL(ENABLE_PLUGIN, test "x$enable_plugin" = "x1")
52
Harald Weltef8b2ba72010-03-07 20:33:59 +010053AC_ARG_ENABLE(tests,
Sylvain Munautf23abab2010-07-25 16:16:42 +020054 [AS_HELP_STRING(
55 [--disable-tests],
56 [Disable building test programs]
57 )],
Harald Weltef8b2ba72010-03-07 20:33:59 +010058 [enable_tests=0], [enable_tests=1])
59AM_CONDITIONAL(ENABLE_TESTS, test "x$enable_tests" = "x1")
60
Harald Welte1067e8c2010-06-25 03:00:58 +020061AC_ARG_ENABLE(vty,
Sylvain Munautf23abab2010-07-25 16:16:42 +020062 [AS_HELP_STRING(
63 [--disable-vty],
64 [Disable building VTY telnet interface]
65 )],
Harald Welte54403772010-05-29 11:49:51 +020066 [enable_vty=0], [enable_vty=1])
67AM_CONDITIONAL(ENABLE_VTY, test "x$enable_vty" = "x1")
68
Sylvain Munautac3e61a2010-07-25 18:08:54 +020069AC_ARG_ENABLE(panic_infloop,
70 [AS_HELP_STRING(
71 [--enable-panic-infloop],
72 [Trigger infinite loop on panic rather than fprintf/abort]
73 )],
74 [panic_infloop=1], [panic_infloop=0])
75if test "x$panic_infloop" = "x1"
76then
77 AC_DEFINE([PANIC_INFLOOP],[1],[Use infinite loop on panic rather than fprintf/abort])
78fi
79
Holger Hans Peter Freyther43558312010-08-06 06:48:43 +080080AC_ARG_ENABLE(bsc_fd_check,
81 [AS_HELP_STRING(
82 [--enable-bsc-fd-check],
83 [Instrument bsc_register_fd to check that the fd is registered]
84 )],
85 [fd_check=1], [fd_check=0])
86if test "x$fd_check" = "x1"
87then
88 AC_DEFINE([BSC_FD_CHECK],[1],[Instrument the bsc_register_fd])
89fi
90
Holger Hans Peter Freytherc87f2662010-10-07 00:00:15 +080091AC_ARG_ENABLE(msgfile,
92 [AS_HELP_STRING(
93 [--disable-msgfile],
94 [Disable support for the msgfile],
95 )],
96 [enable_msgfile=0], [enable_msgfile=1])
97AM_CONDITIONAL(ENABLE_MSGFILE, test "x$enable_msgfile" = "x1")
98
Harald Welte54403772010-05-29 11:49:51 +020099
Harald Welte3cae0392010-02-20 21:09:24 +0100100AC_OUTPUT(
101 libosmocore.pc
Harald Weltee352c522010-05-19 19:42:32 +0200102 libosmovty.pc
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200103 include/osmocom/Makefile
104 include/osmocom/vty/Makefile
Harald Welteb9ce51c2010-06-30 19:43:11 +0200105 include/osmocom/crypt/Makefile
Harald Welte3cae0392010-02-20 21:09:24 +0100106 include/osmocore/Makefile
107 include/osmocore/protocol/Makefile
108 include/Makefile
109 src/Makefile
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200110 src/vty/Makefile
Harald Welte3cae0392010-02-20 21:09:24 +0100111 tests/Makefile
112 tests/timer/Makefile
113 tests/sms/Makefile
Holger Hans Peter Freytherc87f2662010-10-07 00:00:15 +0800114 tests/msgfile/Makefile
Harald Welte3cae0392010-02-20 21:09:24 +0100115 Makefile)